:root {
  color-scheme: dark;
  --bg: #101316;
  --panel: #181d20;
  --panel-2: #20282a;
  --line: #344044;
  --text: #edf4ee;
  --muted: #a9b8b0;
  --green: #51d27b;
  --cyan: #55c7d9;
  --amber: #f0b85a;
  --red: #ff6f61;
  --violet: #b7a4ff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 30% 20%, rgba(81, 210, 123, 0.12), transparent 24rem),
    linear-gradient(135deg, #101316 0%, #151b1c 52%, #111417 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

button,
select,
input[type="search"],
input[type="number"],
textarea {
  color: var(--text);
  background: #111719;
  border: 1px solid var(--line);
}

button {
  cursor: pointer;
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
}

.shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px;
  background: rgba(16, 19, 22, 0.88);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  color: var(--green);
  filter: drop-shadow(0 10px 18px rgba(81, 210, 123, 0.16));
}

.brand-mark rect {
  fill: rgba(17, 23, 25, 0.94);
  stroke: rgba(81, 210, 123, 0.7);
}

.brand-grid {
  fill: none;
  stroke: rgba(169, 184, 176, 0.22);
  stroke-width: 1;
}

.brand-line {
  fill: none;
  stroke: url("#brandLogoGlow");
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-outlier {
  fill: var(--red);
  stroke: #ffe1dd;
  stroke-width: 2;
}

.brand-lens {
  fill: none;
  stroke: rgba(85, 199, 217, 0.82);
  stroke-width: 2.5;
}

.brand-handle {
  fill: none;
  stroke: rgba(85, 199, 217, 0.82);
  stroke-width: 4;
  stroke-linecap: round;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.05rem;
}

h2 {
  margin-top: 4px;
  font-size: clamp(1.85rem, 4vw, 3.4rem);
  line-height: 0.98;
}

h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.brand p,
.method-note p,
.eyebrow,
small {
  color: var(--muted);
}

.tabs,
.control-panel {
  display: grid;
  gap: 10px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  border-radius: 8px;
  text-align: left;
}

.tab.is-active,
.segmented button.is-active {
  border-color: rgba(81, 210, 123, 0.72);
  background: rgba(81, 210, 123, 0.14);
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 26px;
  aspect-ratio: 1;
  color: #111719;
  background: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

select,
input[type="search"],
input[type="number"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
}

textarea {
  width: 100%;
  min-height: 152px;
  padding: 12px;
  border-radius: 8px;
  resize: vertical;
  line-height: 1.45;
}

input[type="range"] {
  accent-color: var(--green);
}

.method-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(240, 184, 90, 0.32);
  background: rgba(240, 184, 90, 0.08);
  border-radius: 8px;
}

.method-note p {
  margin-top: 7px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.method-note a {
  color: var(--amber);
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.user-menu {
  display: grid;
  grid-template-columns: 38px minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 25, 0.78);
}

.user-menu[hidden] {
  display: none;
}

.user-menu strong,
.user-menu small {
  display: block;
  overflow-wrap: anywhere;
}

.user-menu a,
.logout-form {
  color: var(--text);
  text-decoration: none;
}

.logout-form {
  margin: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  color: #111719;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 900;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(108px, 1fr));
  gap: 10px;
}

.status-strip div {
  padding: 12px 14px;
  background: rgba(24, 29, 32, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.status-strip span {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-radar {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
}

.grid-radar .hero-panel {
  grid-row: span 2;
}

.grid-event,
.grid-alerts,
.grid-workflow,
.grid-accounts,
.grid-active-detail,
.grid-management,
.grid-investigations {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.62fr);
  align-items: stretch;
}

.grid-workflow .hero-panel {
  display: flex;
  flex-direction: column;
  grid-row: span 2;
  min-height: calc(100vh - 150px);
}

.grid-active-markets {
  grid-template-columns: minmax(0, 1fr);
}

.grid-relationships {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  min-width: 0;
  padding: 18px;
  background: linear-gradient(180deg, rgba(32, 40, 42, 0.94), rgba(24, 29, 32, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

canvas {
  display: block;
  width: 100%;
  height: min(56vh, 540px);
  min-height: 410px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.outlier-list,
.signature-bars,
.account-detail {
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.outlier {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 12px;
  background: rgba(17, 23, 25, 0.74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.outlier strong {
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(85, 199, 217, 0.16);
  color: #9ee4ec;
  font-size: 0.76rem;
  font-weight: 800;
}

.bar-row {
  display: grid;
  grid-template-columns: 104px 1fr 48px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.bar-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.segmented button {
  min-width: 58px;
  height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

.segmented button:last-child {
  border-right: 0;
}

.timeline {
  display: grid;
  gap: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) 1fr minmax(68px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
}

.event-track {
  position: relative;
  height: 26px;
  background: linear-gradient(90deg, rgba(85, 199, 217, 0.12), rgba(240, 184, 90, 0.16), rgba(255, 111, 97, 0.18));
}

.event-marker {
  position: absolute;
  top: 3px;
  width: 20px;
  height: 20px;
  transform: translateX(-50%);
  background: var(--green);
  border: 2px solid #eaffef;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.heat-cell {
  min-height: 118px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--cell-bg);
}

.heat-cell strong {
  font-size: 1.45rem;
}

.metric-grid {
  display: grid;
  gap: 10px;
}

.workflow-stage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.workflow-stage-strip div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
}

.workflow-stage-strip span {
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
}

.workflow-stage-strip strong,
.workflow-stage-strip small {
  overflow-wrap: anywhere;
}

.model-evidence,
.wallet-breakout,
.market-profile,
.similar-market-list {
  display: grid;
  gap: 10px;
}

.wallet-breakout {
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.evidence-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  border-radius: 8px;
}

.evidence-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.evidence-card strong {
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.evidence-card small {
  color: var(--muted);
  line-height: 1.4;
}

.evidence-strong {
  border-color: rgba(81, 210, 123, 0.62);
  background: rgba(81, 210, 123, 0.12);
}

.evidence-watch {
  border-color: rgba(240, 184, 90, 0.58);
  background: rgba(240, 184, 90, 0.1);
}

.wallet-driver {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  text-align: left;
  border-radius: 8px;
}

.wallet-driver[draggable="true"] {
  cursor: grab;
}

.wallet-driver[draggable="true"]:active {
  cursor: grabbing;
}

.wallet-driver.is-watched {
  border-color: rgba(240, 184, 90, 0.72);
  background: rgba(240, 184, 90, 0.1);
}

.wallet-driver-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 8px;
  min-width: 0;
}

.wallet-driver-actions .compact-button {
  min-height: 30px;
  padding: 4px 9px;
}

.wallet-driver strong,
.wallet-driver small,
.similar-market strong,
.similar-market small {
  display: block;
  overflow-wrap: anywhere;
}

.wallet-export-panel {
  align-self: start;
}

.wallet-export-dropzone {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  min-height: 92px;
  padding: 14px;
  border: 1px dashed rgba(85, 199, 217, 0.58);
  border-radius: 8px;
  background: rgba(85, 199, 217, 0.08);
  outline: none;
}

.wallet-export-dropzone.is-empty {
  border-color: rgba(240, 184, 90, 0.54);
  background: rgba(240, 184, 90, 0.08);
}

.wallet-export-dropzone.is-dragging,
.wallet-export-dropzone:focus-visible {
  border-color: rgba(81, 210, 123, 0.82);
  background: rgba(81, 210, 123, 0.14);
}

.wallet-export-dropzone strong,
.wallet-export-dropzone small {
  overflow-wrap: anywhere;
}

.wallet-export-dropzone small {
  grid-column: 2;
}

.dropzone-mark {
  display: grid;
  place-items: center;
  grid-row: span 2;
  width: 38px;
  aspect-ratio: 1;
  color: #111719;
  background: var(--cyan);
  font-size: 1.3rem;
  font-weight: 900;
}

.wallet-export-manual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.wallet-export-manual textarea {
  min-height: 82px;
}

.wallet-export-list {
  display: grid;
  gap: 8px;
  max-height: 30vh;
  margin-top: 12px;
  overflow: auto;
  padding-right: 4px;
}

.wallet-export-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 25, 0.72);
}

.wallet-export-item strong,
.wallet-export-item small {
  display: block;
  overflow-wrap: anywhere;
}

.wallet-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wallet-export-actions button:not(:disabled)[data-export-format] {
  border-color: rgba(81, 210, 123, 0.72);
  background: rgba(81, 210, 123, 0.16);
}

.compact-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.similar-market {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  text-align: left;
  border-radius: 8px;
}

.market-profile dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.market-profile dl div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
}

.market-profile dt {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.market-profile dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.driver-rank {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  color: #111719;
  background: var(--cyan);
  font-weight: 900;
}

.alert-list,
.catalyst-list,
.profile-section {
  display: grid;
  gap: 10px;
}

.alert-list {
  height: min(76vh, 920px);
  min-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.alert-card,
.mini-row {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.alert-card {
  gap: 6px;
  padding: 11px;
}

.alert-card > strong {
  font-size: 0.96rem;
  line-height: 1.25;
}

.alert-card > small,
.alert-card > span {
  font-size: 0.78rem;
  line-height: 1.32;
}

.relationship-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.relationship-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.6fr) auto;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 520px);
}

.relationship-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  border-radius: 8px;
  min-width: 0;
}

.relationship-card.is-watched {
  border-color: rgba(240, 184, 90, 0.72);
  background: rgba(240, 184, 90, 0.1);
}

.relationship-card strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.relationship-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.relationship-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}

.relationship-card dt {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.relationship-card dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.catalyst-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  border-radius: 8px;
  min-width: 0;
}

.catalyst-card.is-watched {
  border-color: rgba(240, 184, 90, 0.72);
  background: rgba(240, 184, 90, 0.1);
}

.catalyst-card strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.catalyst-card small {
  color: var(--muted);
}

.catalyst-terms,
.catalyst-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.catalyst-terms span {
  padding: 5px 8px;
  border: 1px solid rgba(85, 199, 217, 0.24);
  color: #9ee4ec;
  font-size: 0.76rem;
}

.catalyst-links a {
  display: inline-grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: #e8f0ed;
  text-decoration: none;
}

.catalyst-links a:hover {
  border-color: rgba(81, 210, 123, 0.6);
}

.market-source-list,
.market-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  color: #e8f0ed;
  text-decoration: none;
}

.market-source-links a:hover {
  border-color: rgba(81, 210, 123, 0.6);
}

.alert-card.is-watched,
.is-watched-row {
  border-color: rgba(240, 184, 90, 0.72);
  background: rgba(240, 184, 90, 0.1);
}

.alert-card.is-acknowledged {
  opacity: 0.66;
}

.alert-card-top,
.alert-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-card-top {
  justify-content: space-between;
}

.alert-action {
  min-height: 30px;
  padding: 4px 9px;
}

.focus-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.focus-summary:empty {
  display: none;
}

.focus-summary span {
  color: #ffd99b;
  font-size: 0.84rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.is-hidden {
  display: none !important;
}

.severity-critical {
  background: rgba(255, 111, 97, 0.22);
  color: #ffc2bb;
}

.severity-high {
  background: rgba(240, 184, 90, 0.2);
  color: #ffd99b;
}

.severity-medium {
  background: rgba(85, 199, 217, 0.16);
  color: #9ee4ec;
}

.severity-low {
  background: rgba(81, 210, 123, 0.14);
  color: #b8efc8;
}

.profile-section {
  margin-top: 14px;
}

.profile-section > strong {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.wallet-spend-chart {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  overflow: hidden;
}

.wallet-spend-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.wallet-spend-chart line {
  stroke: rgba(255, 255, 255, 0.1);
}

.wallet-spend-chart .spend-area {
  fill: rgba(81, 210, 123, 0.14);
}

.wallet-spend-chart .spend-line {
  fill: none;
  stroke: #51d27b;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wallet-spend-chart circle {
  fill: #151b1c;
  stroke: #51d27b;
  stroke-width: 2;
}

.wallet-spend-chart .axis-label,
.wallet-spend-chart .axis-title {
  fill: var(--muted);
  font-size: 0.72rem;
}

.wallet-spend-chart .axis-title {
  fill: #e8f0ed;
  font-weight: 800;
}

.wallet-spend-chart .axis-title-x,
.wallet-spend-chart .axis-title-y {
  font-size: 0.68rem;
  text-transform: uppercase;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-form label {
  min-width: 0;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.settings-form .wide-field,
.settings-form .save-button {
  grid-column: 1 / -1;
}

.investigation-meta-form {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 180px);
}

.investigation-meta-form .wide-field,
.investigation-meta-form .investigation-id-field,
.investigation-meta-form .save-button {
  grid-column: 1 / -1;
}

.investigation-meta-form input,
.investigation-meta-form textarea {
  overflow-wrap: anywhere;
}

.investigation-meta-form .save-button {
  margin-bottom: 8px;
}

.save-button {
  justify-self: start;
  border-color: rgba(81, 210, 123, 0.72);
  background: rgba(81, 210, 123, 0.16);
}

.settings-summary {
  display: grid;
  gap: 10px;
}

.settings-summary dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.settings-summary div {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
}

.settings-summary dt {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.settings-summary dd {
  margin: 4px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.investigation-list,
.investigation-timeline {
  display: grid;
  gap: 10px;
}

.investigation-row,
.investigation-artifact {
  min-width: 0;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 25, 0.72);
}

.investigation-row {
  display: grid;
  gap: 6px;
  color: var(--text);
  text-align: left;
}

.investigation-row.is-selected {
  border-color: rgba(81, 210, 123, 0.7);
  background: rgba(81, 210, 123, 0.12);
}

.investigation-row strong,
.investigation-row small,
.investigation-artifact strong,
.investigation-artifact small,
.investigation-artifact p,
.investigation-artifact a {
  overflow-wrap: anywhere;
}

.investigation-artifact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
}

.investigation-artifact p,
.investigation-artifact a {
  grid-column: 1 / -1;
  margin: 0;
}

.investigation-artifact a {
  color: var(--accent-2);
}

.metric-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
  border-radius: 8px;
}

.metric-card code {
  color: #9ee4ec;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.metric-card p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.metric-card.is-triggered {
  border-color: rgba(240, 184, 90, 0.58);
  background: rgba(240, 184, 90, 0.1);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 25, 0.72);
}

.detail-stats span {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
}

.metric-hit {
  display: grid;
  gap: 3px;
  margin-bottom: 7px;
  color: #9ee4ec;
  font-size: 0.78rem;
  font-weight: 800;
}

.table-wrap {
  max-height: 64vh;
  overflow: auto;
  border: 1px solid var(--line);
}

.workflow-table-wrap {
  flex: 1;
  max-height: none;
  min-height: 520px;
}

.market-moves-table-wrap {
  height: min(76vh, 920px);
  min-height: 720px;
  max-height: none;
}

.grid-alerts .catalyst-panel {
  grid-column: 1 / -1;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #151b1c;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(81, 210, 123, 0.1);
}

tbody tr.clickable-row {
  cursor: pointer;
}

td small {
  display: block;
  margin-top: 4px;
}

.signal {
  display: inline-block;
  width: 100%;
  max-width: 150px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.signal span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--amber), var(--red));
}

.account-detail dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  min-width: 0;
}

.account-detail dl div,
.detail-panel h3 {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.account-detail dt {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.account-detail dd {
  margin: 4px 0 0;
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.thesis {
  padding: 12px;
  border: 1px solid rgba(85, 199, 217, 0.28);
  background: rgba(85, 199, 217, 0.08);
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 74% 20%, rgba(85, 199, 217, 0.18), transparent 26rem),
    radial-gradient(circle at 22% 72%, rgba(240, 184, 90, 0.12), transparent 22rem),
    linear-gradient(135deg, #101316 0%, #151b1c 52%, #111417 100%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: stretch;
}

.login-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.login-market-grid {
  width: min(78vw, 760px);
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 12px;
  transform: perspective(900px) rotateX(58deg) rotateZ(-19deg);
}

.login-market-grid span {
  min-height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    linear-gradient(180deg, rgba(81, 210, 123, 0.16), rgba(17, 23, 25, 0.72)),
    linear-gradient(90deg, transparent 45%, rgba(85, 199, 217, 0.3) 48%, transparent 52%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.login-market-grid span:nth-child(3n) {
  background:
    linear-gradient(180deg, rgba(255, 111, 97, 0.18), rgba(17, 23, 25, 0.76)),
    linear-gradient(90deg, transparent 30%, rgba(240, 184, 90, 0.3) 34%, transparent 39%);
}

.login-signal-card {
  position: absolute;
  right: 8%;
  bottom: 18%;
  display: grid;
  gap: 5px;
  width: min(280px, 80vw);
  padding: 16px;
  border: 1px solid rgba(81, 210, 123, 0.42);
  border-radius: 8px;
  background: rgba(17, 23, 25, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-signal-card span {
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.login-signal-card strong {
  font-size: 1.35rem;
}

.login-panel {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  padding: clamp(28px, 6vw, 64px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 19, 22, 0.9);
  backdrop-filter: blur(20px);
}

.login-brand .brand-mark {
  width: 56px;
}

.login-copy {
  display: grid;
  gap: 14px;
}

.login-copy h2 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 6vw, 4.8rem);
}

.login-copy p:not(.eyebrow) {
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.55;
}

.login-button {
  display: inline-grid;
  grid-template-columns: 32px auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  width: min(100%, 320px);
  padding: 0 18px;
  border: 1px solid rgba(81, 210, 123, 0.72);
  border-radius: 8px;
  color: #111719;
  background: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.login-button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(17, 23, 25, 0.72);
  border-color: var(--line);
}

.google-mark {
  display: grid;
  place-items: center;
  width: 32px;
  aspect-ratio: 1;
  color: #111719;
  background: #fff;
  font-weight: 900;
}

.login-error {
  width: min(100%, 420px);
  padding: 12px 14px;
  border: 1px solid rgba(255, 111, 97, 0.46);
  border-radius: 8px;
  background: rgba(255, 111, 97, 0.12);
  color: #ffc2bb;
}

@media (max-width: 1020px) {
  .shell,
  .grid-radar,
  .grid-event,
  .grid-alerts,
  .grid-workflow,
  .grid-accounts,
  .grid-active-markets,
  .grid-relationships,
  .grid-active-detail,
  .grid-management,
  .grid-investigations {
    grid-template-columns: 1fr;
  }

  .relationship-cards {
    grid-template-columns: 1fr;
  }

  .relationship-controls {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 38vh;
  }

  .login-panel {
    min-height: 62vh;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (max-width: 620px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .status-strip,
  .heatmap,
  .detail-stats,
  .workflow-stage-strip,
  .market-profile dl,
  .settings-form,
  .settings-summary dl {
    grid-template-columns: 1fr;
  }

  .event-row {
    grid-template-columns: 1fr;
  }

  .wallet-driver,
  .wallet-export-manual,
  .wallet-export-item {
    grid-template-columns: 1fr;
  }

  .wallet-driver-actions {
    justify-content: start;
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-table-wrap {
    min-height: 360px;
  }

  .user-menu {
    grid-template-columns: 38px minmax(0, 1fr);
    min-width: 0;
  }

  .user-menu a,
  .logout-form {
    grid-column: 1 / -1;
  }

  .login-copy h2 {
    max-width: 100%;
  }
}
