
:root {
  --bg: #08111f;
  --bg-2: #0b1529;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: rgba(17, 24, 39, 0.95);
  --panel-soft: rgba(30, 41, 59, 0.6);
  --text: #e5eefc;
  --muted: #93a3ba;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --cyan: #67e8f9;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.18), transparent 34%),
    radial-gradient(circle at top right, rgba(103,232,249,.12), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
body.drawer-open {
  overflow: hidden;
}
body[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-2: #edf3fa;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-strong: rgba(255, 255, 255, 0.99);
  --panel-soft: rgba(246, 250, 255, 0.92);
  --text: #18324b;
  --muted: #61758b;
  --border: rgba(24, 50, 75, 0.12);
  --border-strong: rgba(24, 50, 75, 0.2);
  --primary: #2f80ed;
  --primary-2: #1d6fd8;
  --success: #219a6b;
  --danger: #d55a6f;
  --warning: #d99128;
  --cyan: #1e7ca8;
  --shadow: 0 18px 40px rgba(83, 102, 126, 0.12);
}
body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(47,128,237,.12), transparent 28%),
    radial-gradient(circle at top right, rgba(33,154,107,.08), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
button, input, textarea, select { font: inherit; }
.app-shell { max-width: 1560px; margin: 0 auto; padding: 28px; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 520px);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}
.logged-out .hero {
  min-height: 62vh;
  align-items: center;
}
.logged-out .account-session-row,
.logged-out .metrics-grid,
.logged-out .workflow-nav,
.logged-out .admin-landing,
.logged-out .workspace-grid {
  display: none;
}
body.stage-admin-home .hero,
body.stage-admin-home .account-session-row,
body.stage-admin-home .metrics-grid,
body.stage-admin-home .workflow-nav,
body.stage-admin-home .workspace-grid,
body.stage-admin-home .pending-sync-banner,
body.stage-admin-home .pending-sync-detail {
  display: none !important;
}
body.stage-admin-home .admin-landing {
  display: block;
}
body.stage-tor-auth .hero,
body.stage-gateway-auth .hero {
  min-height: 70vh;
  grid-template-columns: minmax(0, 620px);
  justify-content: center;
  align-items: center;
}
body.stage-gateway-auth .hero {
  min-height: auto;
  margin-bottom: 16px;
}
body.stage-tor-auth #heroIntro,
body.stage-gateway-auth #heroIntro,
body.stage-admin-home #heroIntro,
body.stage-tor-auth .hero-utility-row,
body.stage-gateway-auth .hero-utility-row,
body.stage-admin-home .hero-utility-row,
body.stage-tor-auth #torAdminPanel,
body.stage-gateway-auth #torAdminPanel {
  display: none !important;
}
body.stage-tor-auth:not(.local-dev) #advancedConnectionCard,
body.stage-gateway-auth:not(.local-dev) #advancedConnectionCard {
  display: none !important;
}
body.stage-tor-auth #torAccessStage,
body.stage-gateway-auth #gatewayAccessStage {
  display: grid;
}
body.stage-tor-auth #gatewayAccessStage,
body.stage-gateway-auth #torAccessStage {
  display: none !important;
}
.hero, .panel, .metric-card {
  backdrop-filter: none;
}
.hero-card, .panel, .metric-card, .api-card {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero-card {
  background: linear-gradient(135deg, rgba(15,23,42,.88), rgba(15,23,42,.72));
  border-radius: 24px;
  padding: 28px;
}
body.flow-compact .hero {
  margin-bottom: 14px;
}
body.flow-compact .mode-banner,
body.flow-compact .api-card-advanced {
  display: none;
}
body[data-theme="light"] .hero-card,
body[data-theme="light"] .api-card,
body[data-theme="light"] .auth-card,
body[data-theme="light"] .metric-card,
body[data-theme="light"] .panel,
body[data-theme="light"] .panel-accent,
body[data-theme="light"] .panel-detail,
body[data-theme="light"] .strategy-panel,
body[data-theme="light"] .workflow-step-pill,
body[data-theme="light"] .metric-drawer {
  background: linear-gradient(180deg, rgba(255,255,255,.99), rgba(247,250,254,.98));
}
.hero-copy-card,
.hero-session-card {
  display: grid;
  gap: 14px;
}
body.stage-tor-auth .hero-session-card,
body.stage-gateway-auth .hero-session-card {
  width: 100%;
  max-width: 620px;
}
body.stage-gateway-auth .hero-session-card {
  max-width: 760px;
}
.hero-utility-row {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.header-session-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow);
}
.header-session-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--cyan);
}
.header-session-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.mode-banner {
  background: linear-gradient(135deg, rgba(14,116,144,.3), rgba(59,130,246,.18));
  border: 1px solid rgba(103,232,249,.22);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(16,185,129,.16);
  border: 1px solid rgba(16,185,129,.32);
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.mode-copy {
  margin-top: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.status-pill {
  align-self: start;
  justify-self: end;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(148,163,184,.12);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.status-pill.ok { color: #8ff7c7; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.status-pill.error { color: #fca5a5; background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.35); }
.api-card {
  background: linear-gradient(180deg, rgba(15,23,42,.9), rgba(15,23,42,.76));
  border-radius: 24px;
  padding: 18px;
}
.api-card-advanced {
  padding: 0;
  overflow: hidden;
}
.advanced-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
}
.advanced-summary::-webkit-details-marker {
  display: none;
}
.advanced-title {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.advanced-hint {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.advanced-body {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(148,163,184,.12);
}
.eyebrow, .panel-kicker { text-transform: uppercase; letter-spacing: .08em; color: var(--cyan); font-size: 12px; font-weight: 700; }
h1 { margin: 10px 0 8px; font-size: clamp(2rem, 3vw, 3rem); line-height: 1.05; }
.hero-copy { margin: 0; color: var(--muted); max-width: 70ch; line-height: 1.55; }
.api-card label, .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.api-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.toggle-row {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.gateway-status-row { margin-top: 8px; font-size: 12px; }
.microcopy { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ── Auth Card ── */
.auth-card {
  background: linear-gradient(180deg, rgba(15,23,42,.9), rgba(15,23,42,.76));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-card-inline {
  padding: 20px;
}
.logged-out .auth-card {
  padding: 24px;
  border-radius: 28px;
}
.auth-stage {
  display: grid;
  gap: 14px;
}
.login-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}
.auth-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.auth-card-header-stack {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}
.tor-auth-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(59,130,246,.06);
}
.tor-auth-panel.is-passive {
  background: rgba(148,163,184,.08);
}
.tor-auth-panel-landing {
  padding: 22px;
  gap: 18px;
  align-items: center;
}
.tor-auth-panel-landing .tor-auth-copy {
  gap: 8px;
}
.tor-auth-panel-landing .auth-btn-row {
  justify-content: flex-end;
}
.tor-auth-copy {
  display: grid;
  gap: 4px;
}
.tor-admin-panel {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(14,165,233,.05);
}
.tor-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tor-admin-title {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.tor-admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tor-admin-status {
  font-size: 13px;
}
.tor-admin-list {
  display: grid;
  gap: 10px;
}
.tor-admin-empty {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
}
.tor-admin-user {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
}
.tor-admin-user-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.tor-admin-user-name {
  font-weight: 700;
  color: var(--text);
}
.tor-admin-user-email {
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}
.tor-admin-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
}
.tor-admin-user-note {
  font-size: 13px;
  color: var(--text);
}
.tor-admin-user-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-chip.pending {
  color: var(--warning);
  background: rgba(245,158,11,.10);
  border-color: rgba(245,158,11,.28);
}
.status-chip.approved {
  color: var(--success);
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.28);
}
.status-chip.denied {
  color: var(--danger);
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.28);
}
.input-sm {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}
.session-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(148,163,184,.1);
}
.session-pill.authenticated {
  color: #8ff7c7;
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.35);
}
.session-pill.unauthenticated {
  color: #fca5a5;
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.3);
}
.session-pill.gateway-down {
  color: #fcd34d;
  background: rgba(245,158,11,.1);
  border-color: rgba(245,158,11,.3);
}
.session-pill.checking {
  color: var(--cyan);
  background: rgba(103,232,249,.08);
  border-color: rgba(103,232,249,.25);
}
.session-detail {
  font-size: 12px;
  line-height: 1.5;
}
.auth-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-btn-row a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.admin-landing {
  display: none;
  margin-bottom: 18px;
}
.admin-landing-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  box-shadow: var(--shadow);
}
.admin-landing-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.admin-landing-head h2 {
  margin: 6px 0 0;
  font-size: 30px;
  line-height: 1.08;
}
.admin-landing-copy {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 64ch;
  line-height: 1.5;
}
.admin-landing-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.stage-tor-auth .auth-card-inline,
body.stage-gateway-auth .auth-card-inline {
  padding: 28px;
  border-radius: 28px;
}
body.stage-tor-auth .login-title,
body.stage-gateway-auth .login-title {
  font-size: clamp(2rem, 2.8vw, 2.6rem);
}
body.stage-tor-auth .session-detail,
body.stage-gateway-auth .session-detail {
  font-size: 14px;
}
body.stage-tor-auth .auth-btn-row,
body.stage-gateway-auth .auth-btn-row {
  gap: 12px;
}
body.stage-tor-auth .auth-btn-row .btn,
body.stage-tor-auth .auth-btn-row a.btn,
body.stage-gateway-auth .auth-btn-row .btn,
body.stage-gateway-auth .auth-btn-row a.btn {
  min-height: 52px;
  padding-inline: 20px;
}
body.stage-workspace .auth-stage-tor .auth-card-header {
  display: none;
}
body.stage-workspace .tor-auth-panel-landing {
  padding: 14px 16px;
}
body.stage-gateway-auth .tor-auth-panel-landing {
  padding: 16px 18px;
}
body.stage-gateway-auth #torAuthPanel {
  margin-bottom: 8px;
}
body.stage-gateway-auth #sessionDetail {
  font-size: 13px;
}
body.stage-gateway-auth .account-session-row {
  display: grid;
  max-width: 760px;
  margin: 0 auto 18px;
}
body.stage-gateway-auth .account-session-row .field label {
  font-size: 13px;
}
body.stage-admin-home .tor-admin-panel {
  display: grid;
}

/* ── Account Summary Row ── */
.account-session-row {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  box-shadow: var(--shadow);
}
.account-session-toolbar {
  display: flex;
  justify-content: flex-end;
}
.account-session-main {
  display: grid;
}
.account-session-row .api-row {
  grid-template-columns: minmax(0, 1fr) auto;
}
.account-summary-row {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(59,130,246,.07);
  border: 1px solid rgba(59,130,246,.18);
  border-radius: 10px;
  flex-wrap: wrap;
}
.account-balance-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.account-balance-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.account-balance-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
}
.account-balance-value.paper-mode { color: #86efac; }
.account-balance-value.live-mode { color: #fca5a5; }
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--panel-strong);
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 20px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
}
.metric-card {
  background: var(--panel-strong);
  border-radius: var(--radius);
  padding: 15px 16px;
}
.metric-card-action {
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.metric-card-action:hover {
  transform: translateY(-2px);
  border-color: rgba(59,130,246,.28);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}
.metric-card-action:focus-visible {
  outline: 2px solid rgba(103,232,249,.8);
  outline-offset: 2px;
}
.metric-label { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.metric-value { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.metric-value.success { color: var(--success); }
.metric-value.danger { color: var(--danger); }
.metric-value.warning { color: var(--warning); }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.stack { display: grid; gap: 18px; }
.side-stack {
  align-content: start;
}
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-strong));
  border-radius: var(--radius);
  padding: 18px;
  overflow: hidden;
}
#intakePanel,
#reviewStepSection,
.review-workbench {
  overflow: visible;
}
.panel-accent {
  background:
    radial-gradient(circle at top right, rgba(103,232,249,.13), transparent 36%),
    linear-gradient(180deg, rgba(8,17,31,.96), rgba(15,23,42,.92));
  border-color: rgba(103,232,249,.18);
}
.panel-detail {
  background: linear-gradient(180deg, rgba(12,20,35,.96), rgba(15,23,42,.92));
}
.is-hidden { display: none !important; }
.panel-lg { padding: 20px; }
.panel h2 { margin: 6px 0 0; font-size: 20px; }
.panel h3 { margin: 6px 0 0; font-size: 18px; }
.panel-head, .toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel-subhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin: 6px 0 8px;
}
#reviewStepHeader {
  position: sticky;
  top: 104px;
  z-index: 18;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(148,163,184,.12);
  box-shadow: 0 10px 26px rgba(24,50,75,.08);
}
.section-copy {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.section-copy-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: auto;
}
.workflow-nav {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  width: 100%;
  align-items: stretch;
}

.pending-sync-banner {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: #fff7e8;
  color: #8a5a05;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.pending-sync-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.14);
  color: #a16207;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pending-sync-copy {
  font-size: 14px;
  font-weight: 600;
}

.pending-sync-detail {
  margin: -4px 0 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: #fffdf8;
}

.pending-sync-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.pending-sync-detail-copy {
  color: var(--muted);
  font-size: 13px;
}

.pending-sync-list {
  display: grid;
  gap: 10px;
}

.pending-sync-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.12);
}

.pending-sync-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.pending-sync-symbol {
  font-weight: 800;
  color: var(--text);
}

.pending-sync-time {
  font-size: 12px;
  color: var(--muted);
}

.pending-sync-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.pending-sync-empty {
  color: var(--muted);
  font-size: 13px;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.submission-receipt {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(47,128,237,.18);
  background: var(--panel-strong);
}

.submission-receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.submission-receipt-copy {
  color: var(--muted);
  font-size: 13px;
}

.submission-receipt-list {
  display: grid;
  gap: 10px;
}

.submission-receipt-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(255,255,255,.72);
}

.submission-receipt-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.submission-receipt-symbol {
  font-weight: 800;
  color: var(--text);
}

.submission-receipt-status {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.submission-receipt-status-submitted {
  color: #219a6b;
}

.submission-receipt-status-pending-sync {
  color: #b87414;
}

.submission-receipt-status-skipped {
  color: #d05b62;
}

.submission-receipt-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.submission-receipt-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
}
.workflow-step-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(15,23,42,.96);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  position: relative;
  min-height: 76px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.workflow-step-pill:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 42%, 68% 42%, 68% 18%, 100% 50%, 68% 82%, 68% 58%, 0 58%);
  background: linear-gradient(90deg, rgba(148,163,184,.5), rgba(59,130,246,.68));
  color: var(--primary);
  z-index: 2;
  box-shadow: 0 8px 18px rgba(24,50,75,.14);
}
.workflow-step-pill.is-active {
  border-color: rgba(59,130,246,.78);
  background: linear-gradient(180deg, rgba(47,128,237,.22), rgba(255,255,255,.99));
  box-shadow: 0 22px 38px rgba(47,128,237,.22);
  transform: translateY(-4px) scale(1.01);
}
.workflow-step-pill.is-complete {
  border-color: rgba(16,185,129,.62);
  background: linear-gradient(180deg, rgba(16,185,129,.3), rgba(15,23,42,.98));
  box-shadow: 0 16px 30px rgba(16,185,129,.24);
}
.workflow-step-pill.is-locked {
  opacity: .65;
}
.workflow-step-pill:disabled {
  cursor: not-allowed;
}
.workflow-step-pill.is-active .workflow-step-label {
  color: var(--primary);
}
.workflow-step-pill.is-active .workflow-step-state {
  color: var(--primary);
  font-weight: 800;
}
.workflow-step-pill.is-active .workflow-step-number {
  background: linear-gradient(180deg, rgba(47,128,237,.95), rgba(29,111,216,.95));
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(47,128,237,.25);
}
.workflow-step-pill.is-active .workflow-step-number-text {
  font-size: 14px;
}
.workflow-step-pill.is-active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px rgba(47,128,237,.18);
  pointer-events: none;
}
.workflow-step-number {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59,130,246,.18);
  color: #bfdbfe;
  font-weight: 800;
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}
.workflow-step-number-text,
.workflow-step-check {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.workflow-step-check {
  opacity: 0;
}
.workflow-step-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.workflow-step-label {
  font-weight: 700;
}
.workflow-step-state {
  font-size: 12px;
  color: var(--muted);
}
.workflow-step-pill[aria-current="step"] .workflow-step-state::before {
  content: "You are here";
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}
.workflow-step-pill.is-complete .workflow-step-state {
  color: #d1fae5;
  font-weight: 700;
}
.workflow-step-pill.is-complete .workflow-step-number {
  background: rgba(16,185,129,.95);
  color: #ffffff;
}
.workflow-step-pill.is-complete .workflow-step-number-text {
  opacity: 0;
}
.workflow-step-pill.is-complete .workflow-step-check {
  opacity: 1;
}
.workflow-step-pill.is-complete .workflow-step-label {
  color: #f0fdf4;
}
body[data-theme="light"] .workflow-step-pill {
  border-color: rgba(25, 50, 74, 0.14);
}
body[data-theme="light"] .workflow-step-label {
  color: #2b4158;
}
.strategy-panel {
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8,17,31,.92), rgba(15,23,42,.84));
  border: 1px solid rgba(148,163,184,.14);
}
.strategy-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.strategy-head h3 {
  margin: 6px 0 0;
  font-size: 18px;
}
.strategy-copy {
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}
.strategy-pair-card {
  grid-column: span 2;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.52);
}
.strategy-pair-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.strategy-pair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 12px;
}
.strategy-static-value {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8,17,31,.9);
  color: var(--text);
  font-weight: 700;
}
.btn {
  border: 1px solid var(--border-strong);
  background: rgba(30,41,59,.76);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: .16s ease;
  font-size: 14px;
  font-weight: 600;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(148,163,184,.44); }
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}
.btn.primary { background: linear-gradient(180deg, var(--primary), var(--primary-2)); border-color: rgba(59,130,246,.65); color: white; }
.btn.secondary { background: rgba(30,41,59,.82); }
.btn.success { background: rgba(16,185,129,.92); border-color: rgba(16,185,129,.7); color: white; }
.btn.danger { background: rgba(239,68,68,.92); border-color: rgba(239,68,68,.7); color: white; }
.btn.ghost { background: transparent; }
.tooltip-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
  outline: none;
}
.tooltip-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  max-width: 240px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15,23,42,.96);
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 16px 30px rgba(15,23,42,.18);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 40;
}
.tooltip-chip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%) translateY(6px);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(15,23,42,.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 41;
}
.tooltip-chip:hover::after,
.tooltip-chip:hover::before,
.tooltip-chip:focus-visible::after,
.tooltip-chip:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tooltip-chip:focus-visible {
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.input, .textarea, .select, .rec-table input, .rec-table select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8,17,31,.9);
  color: var(--text);
  outline: none;
}
.input:focus, .textarea:focus, .rec-table input:focus, .rec-table select:focus {
  border-color: rgba(59,130,246,.65);
  box-shadow: 0 0 0 3px rgba(59,130,246,.14);
}
.textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 14px; }
.compact-grid { align-items: end; }
.field.full { grid-column: 1 / -1; }
.action-cell { display: flex; align-items: end; }
.file-status-row {
  min-height: auto;
}
.file-status-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.strategy-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 46px;
  align-items: center;
}
.strategy-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}
.strategy-checkbox input {
  margin: 0;
}
.strategy-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.field.is-disabled {
  opacity: .55;
}
.preview-wrap {
  min-height: 180px;
  border: 1px dashed rgba(148,163,184,.25);
  border-radius: 16px;
  padding: 10px;
  background: rgba(8,17,31,.42);
  display: flex;
  justify-content: center;
  align-items: center;
}
#recPreview { max-width: 100%; max-height: 360px; border-radius: 14px; display: none; }
.table-card { margin-top: 18px; }
.review-workbench {
  display: grid;
  gap: 8px;
}
.review-sticky-bar {
  position: sticky;
  top: 188px;
  z-index: 17;
  display: grid;
  gap: 12px;
  padding: 2px 0 6px;
  background: var(--panel-strong);
}
.table-wrap { overflow: auto; border: 1px solid rgba(148,163,184,.12); border-radius: 16px; background: var(--panel-strong); }
.review-table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}
.review-table-wrap thead {
  display: none;
}
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table-section-row td {
  padding: 12px 12px 10px;
  background: rgba(8,17,31,.92);
  border-bottom: 1px solid rgba(148,163,184,.1);
}
.table-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--cyan);
}
.table-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59,130,246,.16);
  color: #bfdbfe;
  font-size: 11px;
}
.table-section-copy {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.rec-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.data-table th, .data-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid rgba(148,163,184,.1); vertical-align: top; }
.data-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.rec-table input,
.rec-table select {
  min-width: 84px;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}
.rec-table th,
.rec-table td {
  padding: 8px 6px;
}
.rec-table th {
  font-size: 11px;
  background: var(--panel-strong);
  box-shadow: inset 0 -1px 0 rgba(148,163,184,.1);
}
.rec-table td:first-child,
.rec-table th:first-child {
  width: 42px;
}
.rec-table td:nth-child(2),
.rec-table th:nth-child(2) {
  width: 92px;
}
.rec-table td:nth-child(3),
.rec-table th:nth-child(3) {
  width: 130px;
}
.rec-table td:nth-child(4),
.rec-table th:nth-child(4) {
  width: 170px;
}
.rec-table td:nth-child(5),
.rec-table th:nth-child(5),
.rec-table td:nth-child(6),
.rec-table th:nth-child(6),
.rec-table td:nth-child(7),
.rec-table th:nth-child(7),
.rec-table td:nth-child(8),
.rec-table th:nth-child(8),
.rec-table td:nth-child(9),
.rec-table th:nth-child(9),
.rec-table td:nth-child(10),
.rec-table th:nth-child(10),
.rec-table td:nth-child(11),
.rec-table th:nth-child(11) {
  width: 82px;
}
.rec-table td:nth-child(12),
.rec-table th:nth-child(12) {
  width: 126px;
}

.rec-table input,
.rec-table select {
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.rec-table td:nth-child(9),
.rec-table td:nth-child(10),
.rec-table td:nth-child(11) {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rec-table td:nth-child(12) {
  white-space: nowrap;
  font-size: 12px;
}

.rec-table {
  min-width: 0;
}
.rec-table th,
.rec-table td {
  padding-left: 8px;
  padding-right: 8px;
}
.rec-table th {
  font-size: 11px;
}
.rec-table td {
  font-size: 12px;
}
.rec-table th:nth-child(1),
.rec-table td:nth-child(1) {
  width: 48px;
}
.rec-table th:nth-child(2),
.rec-table td:nth-child(2) {
  width: 72px;
}
.rec-table th:nth-child(3),
.rec-table td:nth-child(3) {
  width: 84px;
}
.rec-table th:nth-child(4),
.rec-table td:nth-child(4) {
  min-width: 170px;
}
.rec-table th:nth-child(5),
.rec-table td:nth-child(5),
.rec-table th:nth-child(6),
.rec-table td:nth-child(6),
.rec-table th:nth-child(7),
.rec-table td:nth-child(7),
.rec-table th:nth-child(8),
.rec-table td:nth-child(8),
.rec-table th:nth-child(9),
.rec-table td:nth-child(9),
.rec-table th:nth-child(10),
.rec-table td:nth-child(10),
.rec-table th:nth-child(11),
.rec-table td:nth-child(11) {
  width: 88px;
}
.rec-table th:nth-child(12),
.rec-table td:nth-child(12) {
  width: 126px;
}
.badge, .badge-ready, .badge-bad, .badge-warn, .badge-muted {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge.pending, .badge-warn { background: rgba(245,158,11,.12); color: #fbbf24; }
.badge.open { background: rgba(59,130,246,.12); color: #93c5fd; }
.badge.win, .badge-ready { background: rgba(16,185,129,.12); color: #6ee7b7; }
.badge.loss, .badge-bad { background: rgba(239,68,68,.12); color: #fca5a5; }
.badge.cancel, .badge-muted { background: rgba(148,163,184,.12); color: #d1d5db; }
.summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 0; }
.mini-stat { padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(148,163,184,.12); background: var(--panel-strong); }
.mini-stat-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.mini-stat-value { font-size: 22px; font-weight: 800; }
.workflow-card {
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--panel-strong);
  border: 1px solid rgba(148,163,184,.16);
}
.workflow-card-validation {
  min-width: 0;
}
.review-column-header {
  display: block;
  padding: 0;
  border: 1px solid rgba(148,163,184,.12);
  border-radius: 14px;
  background: var(--panel-strong);
  overflow: hidden;
}
.review-header-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.review-header-table th {
  position: static;
  white-space: nowrap;
}
.workflow-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}
.workflow-value {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
  color: var(--text);
}
.workflow-value.ok {
  color: #86efac;
}
.workflow-value.warn {
  color: #fcd34d;
}
.workflow-value.danger {
  color: #fca5a5;
}
.cta-row { margin-top: 16px; }
.paper-guard-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.24);
  color: #fcd34d;
  font-size: 13px;
  line-height: 1.5;
}
.bulk-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.focus-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.focus-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  background: rgba(8,17,31,.52);
  border: 1px solid rgba(148,163,184,.12);
}
.focus-step-number {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(59,130,246,.18);
  color: #bfdbfe;
  font-weight: 800;
}
.focus-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.focus-step-copy {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.focus-note,
.detail-note {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(59,130,246,.08);
  border: 1px solid rgba(59,130,246,.16);
  color: #c9dafc;
  font-size: 13px;
  line-height: 1.5;
}
.table-card,
.summary-strip,
.cta-row {
  transition: opacity .18s ease, transform .18s ease;
}
.review-sticky-bar .cta-row {
  margin-top: 0;
}
.cta-row-sticky {
  justify-content: space-between;
  align-items: center;
}
.cta-row-sticky .btn.primary {
  margin-left: auto;
}
.flash { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent; display: none; white-space: pre-line; }
.flash.success { display: block; color: #86efac; background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.28); }
.flash.error { display: block; color: #fca5a5; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.28); }
.flash.info { display: block; color: #93c5fd; background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.24); }
.flash.ok { display: block; color: #86efac; background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.28); }
.empty, .muted { color: var(--muted); }
.table-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  max-width: 280px;
}
.rec-meta-note {
  margin-top: 8px;
  color: #fcd34d;
  font-size: 11px;
  line-height: 1.4;
}
.rec-meta-note-fresh {
  color: #86efac;
}
.mono { font-family: Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.hint { margin-top: 8px; color: var(--muted); font-size: 12px; }
.selected-tag { color: var(--muted); font-size: 13px; }
.timeline { display: grid; gap: 12px; max-height: 760px; overflow: auto; padding-right: 4px; }
.timeline-item { border: 1px solid rgba(148,163,184,.12); border-radius: 14px; padding: 12px; background: rgba(30,41,59,.4); }
.timeline-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.timeline-type { font-size: 12px; color: var(--cyan); font-weight: 700; letter-spacing: .05em; }
.timeline-time { font-size: 12px; color: var(--muted); }
.timeline-title { font-weight: 700; margin-bottom: 6px; }
.timeline-pre { white-space: pre-wrap; word-break: break-word; margin: 0; color: #dbe5f5; font-size: 13px; }

#intakePanel .form-grid {
  margin-bottom: 2px;
}

#intakePanel .panel-actions {
  align-items: center;
}

#intakePanel .btn.secondary,
#tradesPanel .btn.ghost,
#positionsPanel .btn.ghost,
#ordersPanel .btn.ghost {
  background: rgba(255,255,255,.03);
}

.hint {
  line-height: 1.45;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.58);
  backdrop-filter: blur(6px);
  z-index: 49;
}
.metric-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 100vw);
  padding: 22px;
  background: linear-gradient(180deg, rgba(8,17,31,.985), rgba(11,21,41,.985));
  border-left: 1px solid rgba(148,163,184,.16);
  box-shadow: -16px 0 44px rgba(0, 0, 0, 0.34);
  z-index: 50;
  overflow: auto;
}
.metric-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}
.metric-drawer-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.metric-drawer-body {
  display: grid;
  gap: 12px;
}
.metric-drawer-empty {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.12);
  background: rgba(30,41,59,.28);
  color: var(--muted);
}
.drawer-trade-card {
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(15,23,42,.72);
}
.drawer-trade-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.drawer-trade-symbol {
  font-size: 18px;
  font-weight: 800;
}
.drawer-trade-name {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.drawer-trade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.drawer-trade-market {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(47,128,237,.14);
  background: rgba(47,128,237,.06);
}
.drawer-trade-market-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}
.drawer-trade-market-value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.drawer-trade-market-context {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.drawer-trade-stat-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.drawer-trade-stat-value {
  margin-top: 3px;
  font-weight: 700;
  color: var(--text);
}
.drawer-trade-stat-value.success {
  color: #86efac;
}
.drawer-trade-stat-value.danger {
  color: #fca5a5;
}
body[data-theme="light"] .metric-card-action:hover {
  box-shadow: 0 18px 28px rgba(47, 128, 237, 0.16);
}
body[data-theme="light"] .workflow-step-pill.is-active {
  background: linear-gradient(180deg, rgba(47,128,237,.16), rgba(255,255,255,.99));
  border-color: rgba(47,128,237,.56);
  box-shadow: 0 20px 34px rgba(47,128,237,.18);
}
body[data-theme="light"] .workflow-step-pill:not(:last-child)::after {
  background: linear-gradient(90deg, rgba(132,161,196,.55), rgba(47,128,237,.72));
}
body[data-theme="light"] .workflow-step-pill.is-complete {
  background: linear-gradient(180deg, rgba(33,154,107,.14), rgba(248,253,250,.98));
  border-color: rgba(33,154,107,.42);
  box-shadow: 0 14px 26px rgba(33,154,107,.14);
}
body[data-theme="light"] .workflow-step-pill.is-complete .workflow-step-label {
  color: #1f513d;
}
body[data-theme="light"] .workflow-step-pill.is-complete .workflow-step-state {
  color: #219a6b;
}
body[data-theme="light"] .workflow-step-pill.is-complete .workflow-step-number {
  background: #219a6b;
  color: #ffffff;
}
body[data-theme="light"] .pending-sync-banner {
  background: #fff7e8;
  border-color: rgba(217,145,40,.28);
  color: #8a5a05;
}
body[data-theme="light"] .pending-sync-detail {
  background: #fffdf8;
  border-color: rgba(217,145,40,.2);
}
body[data-theme="light"] .submission-receipt {
  background: #f8fbff;
  border-color: rgba(47,128,237,.16);
}
body[data-theme="light"] .submission-receipt-item {
  background: rgba(255,255,255,.88);
}
body[data-theme="light"] .drawer-trade-market {
  background: rgba(47,128,237,.07);
  border-color: rgba(47,128,237,.16);
}
body[data-theme="light"] .review-sticky-bar {
  background: var(--panel-strong);
}
body[data-theme="light"] .rec-table th {
  background: var(--panel-strong);
}
.current-step-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(47,128,237,.12);
  border: 1px solid rgba(47,128,237,.2);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: middle;
}
.panel-head.is-current-step,
.panel-subhead.is-current-step,
.toolbar.is-current-step {
  padding: 12px 14px;
  margin: -4px -4px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(47,128,237,.08), rgba(255,255,255,.68));
  border: 1px solid rgba(47,128,237,.18);
  box-shadow: 0 10px 22px rgba(47,128,237,.08);
}
body[data-theme="light"] .panel-head.is-current-step,
body[data-theme="light"] .panel-subhead.is-current-step,
body[data-theme="light"] .toolbar.is-current-step {
  background: linear-gradient(180deg, rgba(47,128,237,.12), rgba(255,255,255,.92));
  border-color: rgba(47,128,237,.24);
}
body[data-theme="light"] .status-pill.ok {
  color: #219a6b;
  background: rgba(33,154,107,.1);
  border-color: rgba(33,154,107,.24);
}
body[data-theme="light"] .badge.pending,
body[data-theme="light"] .badge-warn {
  background: rgba(217,145,40,.12);
  color: #b87414;
}
body[data-theme="light"] .badge.open {
  background: rgba(47,128,237,.12);
  color: #2f80ed;
}
body[data-theme="light"] .badge.win,
body[data-theme="light"] .badge-ready {
  background: rgba(33,154,107,.12);
  color: #219a6b;
}
body[data-theme="light"] .badge.loss,
body[data-theme="light"] .badge-bad {
  background: rgba(213,90,111,.12);
  color: #c64e64;
}
body[data-theme="light"] .badge.cancel,
body[data-theme="light"] .badge-muted {
  background: rgba(97,117,139,.12);
  color: #61758b;
}
body[data-theme="light"] .focus-note,
body[data-theme="light"] .detail-note,
body[data-theme="light"] .workflow-card,
body[data-theme="light"] .focus-step,
body[data-theme="light"] .preview-wrap,
body[data-theme="light"] .drawer-trade-card,
body[data-theme="light"] .table-section-row td {
  background: rgba(255,255,255,.72);
}
body[data-theme="light"] .btn.secondary {
  background: rgba(255,255,255,.92);
}
body[data-theme="light"] .btn.ghost {
  background: rgba(255,255,255,.5);
}
body[data-theme="light"] .input,
body[data-theme="light"] .textarea,
body[data-theme="light"] .select,
body[data-theme="light"] .rec-table input,
body[data-theme="light"] .rec-table select,
body[data-theme="light"] .strategy-static-value {
  background: rgba(255,255,255,.96);
  color: var(--text);
}
body[data-theme="light"] .metric-drawer-copy,
body[data-theme="light"] .section-copy,
body[data-theme="light"] .hero-copy,
body[data-theme="light"] .hint,
body[data-theme="light"] .preview-empty,
body[data-theme="light"] .table-section-copy,
body[data-theme="light"] .table-hint,
body[data-theme="light"] .selected-tag,
body[data-theme="light"] .workflow-step-state,
body[data-theme="light"] .session-detail,
body[data-theme="light"] .microcopy {
  color: var(--muted);
}
@media (max-width: 1180px) {
  .admin-landing-head { flex-direction: column; }
  .metrics-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .workspace-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .side-stack { position: static; }
  .workflow-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); top: 188px; }
  .workflow-step-pill::after { display: none; }
}
@media (max-width: 760px) {
  .app-shell { padding: 18px; }
  .metrics-grid, .summary-strip, .workflow-strip, .form-grid, .strategy-grid { grid-template-columns: 1fr; }
  .metrics-grid { top: 8px; padding: 10px; }
  .workflow-nav { grid-template-columns: 1fr; top: 116px; }
  .api-row { grid-template-columns: 1fr; }
  .metric-drawer { width: 100vw; padding: 18px; }
  .drawer-trade-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}
