:root {
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel-2: #10243b;
  --line: #213650;
  --text: #edf6ff;
  --muted: #8fa5bd;
  --cyan: #2dd4bf;
  --blue: #38bdf8;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% 0%, #102d49 0, var(--bg) 42%); color: var(--text); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #041117; background: linear-gradient(135deg, var(--cyan), var(--blue)); font-weight: 900; box-shadow: 0 14px 35px rgba(45, 212, 191, .22); }
.brand-mark.small { width: 34px; height: 34px; border-radius: 11px; font-size: 12px; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 26px; background: rgba(13, 27, 45, .93); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card h1 { margin: 14px 0 8px; font-size: 30px; }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 8px; color: #c8d8e8; font-size: 13px; font-weight: 700; }
input, select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--text); background: #091725; transition: border .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(45, 212, 191, .12); }
.primary, .secondary { border: 0; border-radius: 11px; padding: 13px 18px; font-weight: 850; }
.primary { color: #031016; background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.secondary { color: var(--text); border: 1px solid var(--line); background: var(--panel-2); }
.message { min-height: 24px; color: #fda4af; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; border-right: 1px solid var(--line); background: rgba(7, 17, 31, .92); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 28px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-group { margin: 12px 13px 0; color: #607b96; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.nav-item { padding: 11px 13px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; text-align: left; font-weight: 750; }
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-2); }
.nav-item.active { box-shadow: inset 3px 0 var(--cyan); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 8px; color: var(--muted); font-size: 12px; }
.text-button { border: 0; color: var(--blue); background: none; }
.manual-entry { display: block; margin-top: 20px; color: var(--blue); text-align: center; font-size: 13px; font-weight: 750; text-decoration: none; }
.manual-entry:hover { color: var(--cyan); text-decoration: underline; }
.nav-link { display: block; text-decoration: none; }
main { min-width: 0; padding: 32px clamp(22px, 4vw, 64px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); }
.system-state { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 800; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.dot.ready { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.notice { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; padding: 16px 18px; border: 1px solid #59422a; border-radius: 13px; background: rgba(125, 80, 30, .17); }
.notice strong { white-space: nowrap; color: #fbbf24; }
.notice.secure { border-color: #175b58; background: rgba(20, 108, 100, .14); }
.notice.secure strong { color: var(--cyan); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 22px; }
.metric-grid article, .panel { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(16, 36, 59, .86), rgba(10, 24, 40, .9)); box-shadow: var(--shadow); }
.metric-grid article { padding: 20px; }
.metric-grid span, .metric-grid small { display: block; color: var(--muted); }
.metric-grid strong { display: block; margin: 8px 0 2px; font-size: 25px; }
.panel { padding: 22px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.tag { padding: 5px 9px; border-radius: 999px; color: var(--cyan); background: rgba(45, 212, 191, .1); font-size: 11px; font-weight: 850; }
.tag.locked { color: #fda4af; background: rgba(251, 113, 133, .1); }
.progress-list { display: grid; gap: 12px; margin: 4px 0 0; padding-left: 22px; color: var(--muted); }
.progress-list .done { color: var(--cyan); }
.settings-group h2 { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.label-head { display: flex; justify-content: space-between; align-items: center; }
.label-head small { color: var(--muted); }
.label-head small.ok { color: var(--cyan); }
.form-actions { display: flex; justify-content: flex-end; gap: 11px; margin-top: 20px; }
.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--cyan); }
.pipeline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pipeline span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #091725; }
.pipeline i { color: var(--cyan); font-style: normal; }
.pipeline.explained span { display: grid; gap: 2px; }
.pipeline.explained span b { font-size: 13px; }
.pipeline.explained span small { color: var(--muted); font-size: 10px; white-space: nowrap; }
.help-panel { margin-bottom: 18px; border-color: #28506f; background: rgba(10, 29, 47, .9); }
.help-panel summary { color: #dff7ff; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.help-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #091725; }
.help-grid article strong { color: var(--cyan); }
.help-grid article p { margin: 5px 0; color: #c2d2e1; }
.help-grid article small { display: block; color: var(--muted); }
.help-more, .panel-help-link { color: var(--blue); font-size: 12px; font-weight: 750; text-decoration: none; }
.help-more { display: inline-block; margin-top: 13px; }
.help-more:hover, .panel-help-link:hover { color: var(--cyan); text-decoration: underline; }
.panel-help-link { display: block; margin-top: -12px; margin-bottom: 16px; }
.candidate-list { display: grid; gap: 9px; }
.candidate-list article { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #091725; }
.candidate-list article div { min-width: 0; }
.candidate-list article strong, .candidate-list article small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-list article small { color: var(--muted); }
.candidate-list article > span { color: var(--cyan); font-variant-numeric: tabular-nums; }
.panel-subtitle { margin: -12px 0 16px; color: var(--muted); font-size: 12px; }
.dossier-list { display: grid; gap: 10px; }
.dossier-card { margin: 0; }
.dossier-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; list-style: none; }
.dossier-card > summary::-webkit-details-marker { display: none; }
.dossier-card > summary::after { content: '자세히'; margin-left: auto; color: var(--blue); font-size: 11px; }
.dossier-card[open] > summary::after { content: '접기'; }
.dossier-identity { display: grid; min-width: 0; }
.dossier-identity strong, .dossier-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dossier-identity small { color: var(--muted); font-weight: 500; }
.dossier-card summary > b { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 10px; }
.status-ok { color: var(--cyan); background: rgba(45, 212, 191, .1); }
.status-wait { color: #fbbf24; background: rgba(251, 191, 36, .1); }
.dossier-body { padding: 4px 18px 20px; border-top: 1px solid var(--line); }
.dossier-body h3 { margin: 18px 0 6px; font-size: 15px; }
.dossier-body > p { margin: 0; color: #b8cadb; }
.dossier-rules, .dossier-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.dossier-rules article, .dossier-facts article { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #091725; }
.dossier-rules small, .dossier-facts small { color: var(--blue); font-weight: 800; }
.dossier-rules p, .dossier-facts p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.dossier-facts strong { display: block; margin-top: 5px; color: var(--text); }
.dossier-failures { margin-top: 12px; padding: 13px 15px; border: 1px solid #60404a; border-radius: 10px; background: rgba(134, 42, 60, .08); }
.dossier-failures > strong { color: #fecdd3; }
.dossier-failures ul { display: grid; gap: 4px; margin-bottom: 0; padding-left: 18px; color: #c8d5e0; }
.dossier-failures p { margin: 5px 0 0; color: #b8cadb; }
.compact-panel { display: flex; align-items: end; gap: 14px; padding: 14px 16px; }
.compact-panel label { min-width: 180px; }
.compact-panel button { flex: 0 0 auto; }
.compact-panel > small { padding-bottom: 11px; }
.filter-grid { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)) auto; }
.chart-toolbar { grid-template-columns: minmax(220px, 1.35fr) minmax(130px, .7fr) minmax(160px, 1fr) auto; }
.field-control { display: grid; align-self: stretch; gap: 6px; color: #475467; font-size: 12px; font-weight: 650; }
.field-hint { min-height: 16px; color: #7a8595; font-size: 10px; font-weight: 500; }
.autocomplete { position: relative; }
.autocomplete-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  width: min(420px, calc(100vw - 44px));
  max-height: 308px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #dce2e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(18, 28, 45, .15);
}
.strategy-options { width: min(460px, calc(100vw - 44px)); }
.autocomplete-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #243044;
  background: transparent;
  text-align: left;
}
.autocomplete-option:hover, .autocomplete-option.active { color: #293b9e; background: #f1f3fd; }
.autocomplete-option > span { display: grid; min-width: 0; }
.autocomplete-option strong, .autocomplete-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autocomplete-option strong { font-size: 12px; font-weight: 750; }
.autocomplete-option small { margin-top: 2px; color: #7a8595; font-size: 10px; }
.autocomplete-option > code { flex: 0 0 auto; color: #596678; font: 650 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; }
.autocomplete-empty { margin: 0; padding: 15px 12px; color: #7a8595; font-size: 11px; text-align: center; }
.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); font-size: 11px; }
.data-table td { color: #cad8e6; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table button, .link-button { padding: 0; border: 0; color: var(--blue); background: none; font-weight: 800; text-align: left; }
.data-table button:hover, .link-button:hover { color: var(--cyan); text-decoration: underline; }
.number { font-variant-numeric: tabular-nums; text-align: right !important; }
.positive { color: var(--cyan) !important; }
.negative { color: #fda4af !important; }
.empty-state { padding: 24px 4px; text-align: center; }
.position-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.position-card { padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg, rgba(16, 36, 59, .86), rgba(10, 24, 40, .9)); box-shadow: var(--shadow); }
.position-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.position-card h2 { margin: 0; font-size: 18px; }
.position-card header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.position-card .position-pnl { margin: 16px 0; font-size: 25px; font-weight: 900; }
.position-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.position-facts div { padding: 10px; border-radius: 9px; background: #091725; }
.position-facts small, .position-facts strong { display: block; }
.position-facts small { color: var(--muted); font-size: 10px; }
.position-facts strong { margin-top: 3px; font-size: 12px; }
.position-reason { margin: 14px 0; color: #b8cadb; font-size: 12px; }
.position-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.split-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.split-layout.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split-layout > .panel { min-width: 0; }
.detail-panel { position: sticky; top: 24px; }
.select-list { display: grid; gap: 7px; max-height: 720px; overflow: auto; }
.select-item { display: grid; gap: 2px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #091725; text-align: left; }
.select-item:hover, .select-item.active { border-color: #2a7188; background: #10243b; }
.select-item small { color: var(--muted); }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 9px; font-size: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-grid article { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #091725; }
.detail-grid small, .detail-grid strong { display: block; }
.detail-grid small { color: var(--muted); }
.detail-grid strong { margin-top: 4px; overflow-wrap: anywhere; }
.chart-canvas { min-height: 420px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #071522; }
.chart-canvas svg { display: block; min-width: 720px; width: 100%; height: 420px; }
.chart-grid-line { stroke: #18324a; stroke-width: 1; }
.chart-axis-label { fill: #7890a7; font-size: 10px; }
.chart-candle-up { fill: #2dd4bf; stroke: #2dd4bf; }
.chart-candle-down { fill: #fb7185; stroke: #fb7185; }
.chart-volume { fill: rgba(56, 189, 248, .28); }
.chart-fast { fill: none; stroke: #fbbf24; stroke-width: 1.6; }
.chart-slow { fill: none; stroke: #38bdf8; stroke-width: 1.6; }
.chart-event-buy { fill: #2dd4bf; stroke: #e9fffb; }
.chart-event-sell { fill: #fb7185; stroke: #ffe8ed; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 13px; margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.legend-key::before { content: ''; display: inline-block; width: 15px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--blue); }
.legend-key.fast::before { background: #fbbf24; }
.legend-key.slow::before { background: #38bdf8; }
.legend-key.buy::before { background: var(--cyan); }
.legend-key.sell::before { background: var(--danger); }
.event-strip { display: grid; gap: 7px; margin-top: 12px; }
.event-strip article { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: #bfd0df; font-size: 11px; }
.audit-list { display: grid; gap: 7px; }
.audit-list article { display: grid; grid-template-columns: 155px minmax(130px, .5fr) minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.audit-list time, .audit-list small { color: var(--muted); }
.status-pill { display: inline-block; padding: 3px 7px; border-radius: 999px; color: #fbbf24; background: rgba(251, 191, 36, .1); font-size: 10px; font-weight: 850; }
.status-pill.ok { color: var(--cyan); background: rgba(45, 212, 191, .1); }
.status-pill.danger { color: #fda4af; background: rgba(251, 113, 133, .1); }

/* Standalone operator manual */
.manual-body { background: radial-gradient(circle at 50% -10%, #143b5b 0, var(--bg) 34%); scroll-behavior: smooth; }
.manual-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 14px clamp(18px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(7, 17, 31, .94); backdrop-filter: blur(18px); }
.manual-brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.manual-brand strong, .manual-brand small { display: block; }
.manual-brand small { color: var(--muted); font-size: 11px; }
.manual-back { display: inline-block; padding: 9px 13px; text-decoration: none; }
.manual-layout { width: min(1480px, 100%); margin: 0 auto; display: grid; grid-template-columns: 260px minmax(0, 920px); justify-content: center; gap: clamp(28px, 5vw, 70px); padding: 42px clamp(18px, 4vw, 56px) 100px; }
.manual-toc { position: sticky; top: 112px; align-self: start; max-height: calc(100vh - 140px); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(9, 23, 37, .82); }
.manual-toc > strong { display: block; margin-bottom: 14px; }
.manual-toc nav { display: grid; gap: 3px; }
.manual-toc a { padding: 8px 9px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.manual-toc a:hover { color: var(--text); background: var(--panel-2); }
.manual-content { min-width: 0; padding: 0; }
.manual-hero { padding: clamp(28px, 5vw, 54px); border: 1px solid #28506f; border-radius: 24px; background: linear-gradient(145deg, rgba(18, 55, 83, .92), rgba(9, 25, 42, .92)); box-shadow: var(--shadow); }
.manual-hero h1 { max-width: 760px; margin: 0 0 18px; font-size: clamp(32px, 5vw, 52px); line-height: 1.13; letter-spacing: -.035em; }
.manual-hero > p:not(.eyebrow) { max-width: 770px; color: #bed0e1; font-size: 17px; }
.manual-status-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.manual-status-row span { padding: 8px 11px; border: 1px solid rgba(56, 189, 248, .25); border-radius: 999px; color: #bbd4e8; background: rgba(3, 16, 24, .35); font-size: 12px; }
.manual-status-row b { margin-right: 5px; color: var(--cyan); }
.manual-section { scroll-margin-top: 100px; padding: 66px 0 4px; }
.manual-section-title { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; }
.manual-section-title > span { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border: 1px solid #245a72; border-radius: 14px; color: var(--cyan); background: rgba(45, 212, 191, .08); font-size: 14px; font-weight: 900; }
.manual-section-title p { margin: 0 0 2px; color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.manual-section-title h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.025em; }
.manual-section > h3 { margin: 34px 0 12px; font-size: 19px; }
.manual-section > p { color: #b4c7da; }
.callout { margin: 18px 0; padding: 18px 20px; border: 1px solid #31506a; border-left: 4px solid var(--blue); border-radius: 13px; background: rgba(16, 36, 59, .7); }
.callout strong, .callout p { display: block; }
.callout p { margin: 5px 0 0; color: #b6cadd; }
.callout.compact { margin: 4px 0 16px; padding: 13px 15px; }
.callout.secure { border-color: #1e6661; border-left-color: var(--cyan); background: rgba(20, 108, 100, .12); }
.callout.danger { border-color: #6a3440; border-left-color: var(--danger); background: rgba(134, 42, 60, .12); }
.callout.danger strong { color: #fecdd3; }
.manual-flow { display: flex; align-items: stretch; gap: 7px; overflow-x: auto; padding: 5px 0 12px; }
.manual-flow span { display: flex; flex: 1 0 130px; flex-direction: column; justify-content: center; min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #091725; font-weight: 800; }
.manual-flow small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.manual-flow i { align-self: center; color: var(--cyan); font-style: normal; }
.manual-steps { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; counter-reset: manual-step; }
.manual-steps > li { position: relative; min-height: 72px; padding: 18px 18px 18px 66px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 27, 45, .8); counter-increment: manual-step; }
.manual-steps > li::before { content: counter(manual-step); position: absolute; top: 17px; left: 18px; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #031016; background: var(--cyan); font-size: 12px; font-weight: 900; }
.manual-steps strong { font-size: 16px; }
.manual-steps p { margin: 5px 0 0; color: #aec2d5; }
.manual-steps.compact > li { min-height: 60px; padding-top: 14px; padding-bottom: 14px; }
.manual-steps.compact > li::before { top: 13px; }
.check-line { display: flex; gap: 9px; margin-top: 10px; padding: 9px 11px; border-radius: 8px; background: rgba(56, 189, 248, .07); font-size: 12px; }
.check-line b { flex: 0 0 auto; color: var(--blue); }
.check-line span { color: #c3d5e4; }
.manual-grid { display: grid; gap: 13px; }
.manual-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.manual-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.manual-grid article { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: rgba(13, 27, 45, .72); }
.manual-grid h3 { margin: 0 0 7px; font-size: 16px; }
.manual-grid p { margin: 0; color: #aebfd1; }
.manual-grid .state-card { border-top-width: 4px; }
.manual-grid .state-card.locked { border-top-color: var(--danger); }
.manual-grid .state-card.shadow { border-top-color: var(--blue); }
.manual-grid .state-card.canary { border-top-color: var(--cyan); }
.manual-list { display: grid; gap: 8px; padding-left: 22px; color: #b8cadb; }
.manual-list.numbered { padding-left: 25px; }
.manual-list b { color: var(--text); }
.manual-definition-list { display: grid; gap: 10px; }
.manual-definition-list article { padding: 17px 18px; border-left: 3px solid #2d536e; border-radius: 0 11px 11px 0; background: rgba(13, 27, 45, .66); }
.manual-definition-list h3 { margin: 0 0 5px; font-size: 15px; }
.manual-definition-list p { margin: 0; color: #adbed0; }
.code-explain { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #091725; }
.code-explain code { overflow-wrap: anywhere; color: var(--cyan); font: 700 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-explain p { margin: 0; color: #afc2d5; }
.timeline { position: relative; display: grid; gap: 12px; }
.timeline::before { content: ''; position: absolute; top: 18px; bottom: 18px; left: 48px; width: 1px; background: #286077; }
.timeline article { position: relative; display: grid; grid-template-columns: 98px 1fr; align-items: start; }
.timeline article > span { z-index: 1; justify-self: start; min-width: 70px; padding: 7px 9px; border: 1px solid #286077; border-radius: 999px; color: var(--cyan); background: #091725; text-align: center; font-size: 11px; font-weight: 850; }
.timeline article > div { padding: 4px 0 20px 10px; }
.timeline h3 { margin: 0 0 5px; font-size: 16px; }
.timeline p { margin: 0; color: #adbed0; }
.routine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.routine-grid article { padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: rgba(13, 27, 45, .75); }
.routine-grid time { color: var(--cyan); font-size: 12px; font-weight: 850; }
.routine-grid h3 { margin: 7px 0 10px; }
.routine-grid ul { display: grid; gap: 6px; margin: 0; padding-left: 18px; color: #adbed0; }
.emergency-box { padding: 22px; border: 2px solid var(--danger); border-radius: 16px; background: rgba(134, 42, 60, .14); }
.emergency-box > strong { color: #fecdd3; font-size: 19px; }
.emergency-box ol { display: grid; gap: 9px; margin-bottom: 0; padding-left: 22px; color: #d7e1ea; }
details { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(13, 27, 45, .72); }
summary { padding: 15px 18px; cursor: pointer; color: var(--text); font-weight: 800; }
details > div { padding: 0 18px 17px; color: #adbed0; }
details p { margin: 0 0 8px; }
details ol { margin-bottom: 0; }
.glossary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.glossary-grid article { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(13, 27, 45, .68); }
.glossary-grid dt { color: var(--cyan); font-weight: 850; }
.glossary-grid dd { margin: 0; color: #afc0d2; }
.glossary-grid dd em { display: block; margin-top: 5px; color: #7dd3fc; font-size: 12px; font-style: normal; }
.glossary-group-title { margin: 30px 0 10px; color: #dcecf9; font-size: 17px; }
.manual-footer { display: grid; justify-items: start; gap: 7px; margin-top: 70px; padding: 28px; border-top: 1px solid var(--line); color: var(--muted); }
.manual-footer p { margin: 0; }
.manual-footer .primary { display: inline-block; margin-top: 13px; text-decoration: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { grid-template-columns: repeat(2, 1fr); }
  .nav-group { grid-column: 1 / -1; }
  .sidebar-foot { margin-top: 18px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc { position: static; max-height: none; }
  .manual-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .routine-grid { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
  .dossier-rules, .dossier-facts { grid-template-columns: 1fr; }
  .position-grid, .split-layout, .split-layout.equal { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
  .filter-grid, .chart-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .auth-card { padding: 28px 22px; }
  .metric-grid, .field-grid { grid-template-columns: 1fr; }
  .notice { align-items: flex-start; flex-direction: column; gap: 4px; }
  .topbar { align-items: flex-start; gap: 18px; }
  .manual-header { align-items: flex-start; gap: 12px; }
  .manual-back { max-width: 135px; text-align: center; }
  .manual-layout { padding-top: 20px; }
  .manual-toc nav, .manual-grid.two, .manual-grid.three, .glossary-grid { grid-template-columns: 1fr; }
  .manual-flow i { display: none; }
  .manual-steps > li { padding-left: 58px; }
  .timeline article { grid-template-columns: 84px 1fr; }
  .timeline::before { left: 40px; }
  .glossary-grid article { grid-template-columns: 1fr; gap: 3px; }
  .compact-panel, .filter-grid, .chart-toolbar { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .compact-panel label { min-width: 0; }
  .compact-panel > small { padding-bottom: 0; }
  .position-facts, .detail-grid { grid-template-columns: 1fr 1fr; }
  .audit-list article { grid-template-columns: 1fr; gap: 2px; }
}

/* Application shell refinement */
:root {
  --bg: #090c12;
  --panel: #111722;
  --panel-2: #171f2d;
  --line: #252e3d;
  --line-soft: rgba(148, 163, 184, .11);
  --text: #f2f5f9;
  --muted: #8d99aa;
  --cyan: #5eead4;
  --blue: #8b9cff;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 18px 48px rgba(0, 0, 0, .18);
}

body {
  background: #0b0f16;
  font-size: 14px;
  letter-spacing: -.006em;
}

button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, .nav-item, .manual-entry { transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  background:
    radial-gradient(circle at 87% -10%, rgba(102, 115, 255, .10), transparent 28rem),
    #0b0f16;
}

.sidebar {
  z-index: 30;
  width: 264px;
  padding: 22px 16px 16px;
  border-right-color: rgba(148, 163, 184, .12);
  background: rgba(12, 16, 24, .97);
  box-shadow: 12px 0 40px rgba(0, 0, 0, .08);
  backdrop-filter: blur(24px);
}

.sidebar-brand {
  gap: 11px;
  min-height: 54px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  color: #0a0e15;
  background: #f0f3f8;
  box-shadow: none;
  letter-spacing: -.06em;
}

.brand-copy { display: grid; min-width: 0; line-height: 1.25; }
.brand-copy strong { font-size: 14px; letter-spacing: -.015em; }
.brand-copy small { margin-top: 3px; color: #687487; font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }

.sidebar nav {
  display: block;
  flex: 1;
  min-height: 0;
  margin: 12px -5px 0;
  padding: 0 5px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #30394a transparent;
}

.nav-group {
  display: block;
  margin: 17px 11px 6px;
  color: #5f6b7d;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav-group:first-child { margin-top: 5px; }

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 39px;
  margin: 2px 0;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #8995a7;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.nav-item::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #6d7a8e;
  font-size: 14px;
  font-weight: 600;
}

.nav-item:hover {
  color: #e8edf5;
  background: rgba(255, 255, 255, .035);
}

.nav-item:hover::before { color: #aeb8c7; }

.nav-item.active {
  color: #f8fafc;
  border-color: rgba(139, 156, 255, .16);
  background: rgba(139, 156, 255, .10);
  box-shadow: none;
}

.nav-item.active::before {
  color: #c7d0ff;
  background: rgba(139, 156, 255, .12);
}

.nav-item.active::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(139, 156, 255, .9);
}

.nav-link { text-decoration: none; }

.sidebar-foot {
  gap: 9px;
  margin-top: 0;
  padding: 13px 5px 0;
  border-top: 1px solid var(--line-soft);
}

.account-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.account-chip > span:last-child { display: grid; min-width: 0; line-height: 1.2; }
.account-chip strong { overflow: hidden; color: #dbe2eb; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-chip small { margin-top: 3px; color: #5f6b7d; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.user-avatar { display: grid; place-items: center; flex: 0 0 29px; height: 29px; border: 1px solid #313b4b; border-radius: 9px; color: #aab5c5; background: #171d28; font-size: 10px; font-weight: 900; }

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #8c98aa;
  background: rgba(255, 255, 255, .025);
}

.icon-button:hover { color: #f4f7fb; border-color: #3a4659; background: rgba(255, 255, 255, .06); }
.logout-button { width: 30px; height: 30px; border-color: transparent; font-size: 17px; }
.sidebar-close, .sidebar-open { display: none; }

main { padding: 0 clamp(24px, 3.3vw, 52px) 72px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 112px;
  max-width: 1440px;
  margin: 0 auto 26px;
  padding: 25px 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(11, 15, 22, .98) 76%, rgba(11, 15, 22, .80));
  backdrop-filter: blur(18px);
}

.title-group { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar .eyebrow { margin-bottom: 3px; color: #677386; font-size: 9px; letter-spacing: .15em; }
.topbar h1 { font-size: clamp(24px, 2.6vw, 33px); line-height: 1.15; letter-spacing: -.035em; }
.page-description { margin: 5px 0 0; color: #7f8b9d; font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.universe-badge { color: #667386; font-size: 10px; font-weight: 750; letter-spacing: .04em; }

.system-state {
  gap: 8px;
  min-width: 96px;
  justify-content: center;
  padding: 8px 11px;
  border-color: #283141;
  border-radius: 9px;
  color: #aab4c2;
  background: rgba(18, 24, 35, .7);
  font-size: 10px;
  letter-spacing: .05em;
}

.dot { width: 6px; height: 6px; box-shadow: 0 0 8px rgba(251, 113, 133, .65); }
.dot.ready { box-shadow: 0 0 8px rgba(94, 234, 212, .6); }

.page-view { width: 100%; max-width: 1440px; margin: 0 auto; animation: page-in .22s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.notice {
  position: relative;
  gap: 13px;
  margin-bottom: 18px;
  padding: 12px 15px 12px 17px;
  overflow: hidden;
  border-color: rgba(251, 191, 36, .14);
  border-radius: 11px;
  color: #9da8b7;
  background: rgba(251, 191, 36, .045);
  font-size: 12px;
}

.notice::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: rgba(251, 191, 36, .7); }
.notice strong { color: #e9bd5d; font-size: 11px; }
.notice.secure { border-color: rgba(94, 234, 212, .14); background: rgba(94, 234, 212, .045); }
.notice.secure::before { background: rgba(94, 234, 212, .65); }
.notice.secure strong { color: #7ce8d8; }

.metric-grid { gap: 12px; margin-bottom: 18px; }
.metric-grid article, .panel {
  border-color: var(--line-soft);
  border-radius: 13px;
  background: rgba(17, 23, 34, .92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 12px 34px rgba(0, 0, 0, .10);
}

.metric-grid article {
  position: relative;
  min-height: 121px;
  padding: 18px;
  overflow: hidden;
}

.metric-grid article::after { content: ''; position: absolute; top: 0; right: 18px; width: 30px; height: 2px; border-radius: 0 0 3px 3px; background: rgba(139, 156, 255, .55); }
.metric-grid span { color: #7e8a9b; font-size: 11px; font-weight: 700; }
.metric-grid strong { margin: 11px 0 3px; font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.metric-grid small { color: #667386; font-size: 10px; }

.panel { margin-bottom: 14px; padding: 20px; }
.panel-head { align-items: flex-start; gap: 16px; margin-bottom: 17px; }
.panel h2 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.panel-subtitle { margin: 4px 0 0; color: #768396; font-size: 10px; }
.tag { flex: 0 0 auto; padding: 4px 8px; border: 1px solid rgba(94, 234, 212, .11); border-radius: 7px; color: #81dfd2; background: rgba(94, 234, 212, .055); font-size: 9px; letter-spacing: .025em; }
.tag.locked { border-color: rgba(251, 113, 133, .12); color: #f693a2; background: rgba(251, 113, 133, .055); }
.overview-grid { display: grid; grid-template-columns: minmax(320px, .82fr) minmax(420px, 1.18fr); gap: 14px; align-items: start; }
.overview-grid > .panel { margin-bottom: 0; }
.message:empty { display: none; }

.primary, .secondary {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}

.primary { color: #0c1017; background: #dce2ff; box-shadow: none; }
.primary:hover { background: #eef1ff; transform: translateY(-1px); }
.secondary { color: #b9c3d0; border-color: #30394a; background: #171e29; }
.secondary:hover { color: #f2f5f9; border-color: #465166; background: #1b2431; }

input, select {
  min-height: 40px;
  padding: 9px 11px;
  border-color: #2b3443;
  border-radius: 9px;
  color: #e8edf4;
  background: #0d121b;
  font-size: 12px;
}

input::placeholder { color: #4e5a6b; }
input:focus, select:focus { border-color: #6f80dd; box-shadow: 0 0 0 3px rgba(139, 156, 255, .10); }
label { gap: 6px; color: #8995a7; font-size: 10px; letter-spacing: .01em; }

.compact-panel { gap: 11px; min-height: 69px; padding: 13px 14px; background: rgba(15, 20, 30, .84); }
.compact-panel > small { padding-bottom: 9px; font-size: 10px; }
.toolbar.panel { margin-bottom: 18px; }

.progress-list { gap: 9px; padding: 0; list-style: none; }
.progress-list li { position: relative; padding: 8px 12px 8px 34px; border-bottom: 1px solid var(--line-soft); color: #7e8a9b; font-size: 11px; }
.progress-list li:last-child { border-bottom: 0; }
.progress-list li::before { content: '·'; position: absolute; left: 12px; color: #566274; font-size: 18px; line-height: 15px; }
.progress-list .done { color: #b8c2cf; }
.progress-list .done::before { content: '✓'; top: 8px; color: #69d8c7; font-size: 11px; line-height: inherit; }

.data-table { font-size: 11px; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom-color: var(--line-soft); }
.data-table th { position: sticky; top: 0; z-index: 1; color: #687588; background: #111722; font-size: 9px; letter-spacing: .035em; text-transform: uppercase; }
.data-table td { color: #b8c2cf; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: rgba(139, 156, 255, .035); }

.candidate-list { gap: 6px; }
.candidate-list article { padding: 11px 12px; border-color: var(--line-soft); border-radius: 9px; background: rgba(9, 13, 20, .5); }
.candidate-list article > span { color: #7de0d1; font-size: 12px; font-weight: 750; }

.position-grid { gap: 12px; }
.position-card { padding: 18px; border-color: var(--line-soft); border-radius: 13px; background: rgba(17, 23, 34, .92); box-shadow: 0 12px 34px rgba(0, 0, 0, .1); }
.position-facts div, .detail-grid article { border: 1px solid var(--line-soft); background: #0d121b; }
.position-card .position-pnl { font-size: 23px; letter-spacing: -.025em; }

.split-layout { gap: 14px; }
.select-list { gap: 5px; }
.select-item { padding: 11px; border-color: var(--line-soft); border-radius: 9px; color: #c6ced9; background: #0d121b; }
.select-item:hover, .select-item.active { border-color: rgba(139, 156, 255, .3); background: rgba(139, 156, 255, .07); }
.detail-panel { top: 130px; }

.chart-canvas { border-color: var(--line-soft); background: #0a0f17; }
.chart-grid-line { stroke: #202938; }
.event-strip article { border-color: var(--line-soft); background: rgba(9, 13, 20, .42); }
.audit-list { gap: 0; }
.audit-list article { border-bottom-color: var(--line-soft); }
.empty-state { color: #657184; }

.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .universe-badge { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100dvh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-102%);
    transition: transform .22s ease;
  }
  .app-shell.sidebar-visible .sidebar { transform: translateX(0); }
  .sidebar nav { display: block; }
  .sidebar-foot { margin-top: 0; }
  .sidebar-close { display: grid; margin-left: auto; border-color: transparent; font-size: 20px; }
  .sidebar-open { display: grid; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; width: 100%; height: 100%; border: 0; border-radius: 0; background: rgba(2, 5, 10, .68); backdrop-filter: blur(3px); }
  .app-shell.sidebar-visible .sidebar-backdrop { display: block !important; }
  main { padding-inline: clamp(16px, 4vw, 30px); }
  .topbar { min-height: 96px; padding: 18px 0; }
  .detail-panel { position: static; }
}

@media (max-width: 620px) {
  main { padding-bottom: 48px; }
  .topbar { align-items: center; gap: 12px; margin-bottom: 18px; }
  .topbar h1 { font-size: 22px; }
  .page-description { max-width: 245px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions { align-self: center; }
  .system-state { min-width: 0; padding: 8px; }
  .system-state span:last-child { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-grid article { min-height: 108px; padding: 15px; }
  .metric-grid strong { font-size: 20px; }
  .panel { padding: 16px; }
  .panel-head { gap: 10px; }
  .notice { align-items: flex-start; flex-direction: column; gap: 2px; padding-left: 15px; }
  .compact-panel, .filter-grid, .chart-toolbar { gap: 10px; }
  .form-actions { flex-wrap: wrap; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-grid article { min-height: 100px; }
  .page-description { max-width: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* High-contrast light workspace */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f1f4f9;
  --line: #d9e0ea;
  --line-soft: rgba(40, 55, 79, .10);
  --text: #172033;
  --muted: #5f6f84;
  --cyan: #078f7d;
  --blue: #5266cc;
  --danger: #d94a60;
  --warning: #a86b00;
  --shadow: 0 10px 30px rgba(31, 45, 68, .08);
}

body { color: var(--text); background: #f4f7fb; font-size: 15px; }
.muted { color: var(--muted); }

.auth-shell { background: radial-gradient(circle at 50% 0%, #e6ebff, #f5f7fb 45%); }
.auth-card { border-color: #dbe2ec; color: var(--text); background: rgba(255, 255, 255, .96); box-shadow: 0 24px 70px rgba(54, 67, 98, .14); }
.auth-card .muted { color: #5e6c7d; }
.auth-card .brand-mark { color: #fff; background: linear-gradient(135deg, #5064c9, #0a9a88); box-shadow: 0 12px 28px rgba(82, 102, 204, .20); }
.auth-card .manual-entry { color: #4258c2; }

.app-shell {
  background:
    radial-gradient(circle at 84% -8%, rgba(82, 102, 204, .08), transparent 30rem),
    #f4f7fb;
  transition: grid-template-columns .22s ease;
}

.sidebar {
  border-right-color: #dde3ec;
  background: rgba(255, 255, 255, .97);
  box-shadow: 8px 0 28px rgba(31, 45, 68, .045);
  transition: width .22s ease, padding .22s ease, transform .22s ease;
}

.sidebar-brand { position: relative; border-bottom-color: #edf0f5; }
.brand-mark.small { color: #fff; background: linear-gradient(145deg, #5368d0, #4153aa); box-shadow: 0 5px 14px rgba(82, 102, 204, .22); }
.brand-copy strong { color: #172033; }
.brand-copy small { color: #7c899b; }
.sidebar nav { scrollbar-color: #c8d0dc transparent; }
.nav-group { color: #8995a6; }
.nav-item { color: #46566d; font-size: 13px; }
.nav-item::before { color: #718096; }
.nav-item:hover { color: #172033; background: #f4f6fa; }
.nav-item:hover::before { color: #4054bc; }
.nav-item.active { color: #2d42aa; border-color: #d9def8; background: #eef0fc; }
.nav-item.active::before { color: #4056be; background: #dde2fb; }
.nav-item.active::after { background: #5368d0; box-shadow: none; }
.sidebar-foot { border-top-color: #edf0f5; }
.account-chip strong { color: #344258; }
.account-chip small { color: #7c899b; }
.user-avatar { border-color: #d9e0ea; color: #43516a; background: #f0f3f8; }

.icon-button { border-color: #d7dee8; color: #526178; background: #fff; box-shadow: 0 2px 6px rgba(31, 45, 68, .05); }
.icon-button:hover { color: #263b9f; border-color: #bfc8dd; background: #f6f8fd; }
.logout-button { background: transparent; box-shadow: none; }
.sidebar-collapse { position: absolute; top: 7px; right: -31px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; font-size: 19px; line-height: 1; }
.sidebar-collapse span { transform: translateY(-1px); }

main { background: transparent; }
.topbar { border-bottom-color: #dfe5ee; background: linear-gradient(180deg, rgba(244, 247, 251, .98) 76%, rgba(244, 247, 251, .84)); }
.topbar .eyebrow { color: #68778c; }
.topbar h1 { color: #152036; }
.page-description { color: #5d6c80; font-size: 13px; }
.universe-badge { color: #65748a; }
.system-state { border-color: #d8dfea; color: #47566b; background: rgba(255, 255, 255, .9); box-shadow: 0 3px 10px rgba(31, 45, 68, .045); }

.notice { border-color: #ead9b5; color: #5a6574; background: #fffaf0; font-size: 13px; }
.notice strong { color: #936000; font-size: 12px; }
.notice.secure { border-color: #bfe4dd; background: #f0fbf8; }
.notice.secure strong { color: #087c6d; }

.metric-grid article, .panel { border-color: #dfe5ed; background: rgba(255, 255, 255, .96); box-shadow: 0 7px 22px rgba(34, 48, 73, .055); }
.metric-grid article::after { background: #6578d5; }
.metric-grid span { color: #5f6f84; font-size: 12px; }
.metric-grid strong { color: #172033; }
.metric-grid small { color: #6b798b; font-size: 11px; }
.panel h2 { color: #1b2639; font-size: 17px; }
.panel-subtitle { color: #65748a; font-size: 12px; }
.tag { border-color: #bde2dc; color: #087b6c; background: #eefaf7; font-size: 10px; }
.tag.locked { border-color: #f0c5cc; color: #bc3c51; background: #fff2f4; }

.primary { color: #fff; background: #4f63c7; }
.primary:hover { color: #fff; background: #3e52b4; }
.secondary { color: #33435a; border-color: #ccd5e1; background: #f7f9fc; }
.secondary:hover { color: #263b9f; border-color: #abb7ca; background: #fff; }
.text-button { color: #4057be; }

input, select { border-color: #cfd8e4; color: #223047; background: #fff; font-size: 13px; }
input::placeholder { color: #929dac; }
input:focus, select:focus { border-color: #6679d4; box-shadow: 0 0 0 3px rgba(82, 102, 204, .12); }
label { color: #46566d; font-size: 12px; }
.compact-panel { background: rgba(255, 255, 255, .94); }
.label-head small { color: #6b798b; }
.label-head small.ok { color: #078674; }

.progress-list li { border-bottom-color: #edf0f4; color: #536277; font-size: 12px; }
.progress-list li::before { color: #8793a4; }
.progress-list .done { color: #344258; }
.progress-list .done::before { color: #078f7d; }

.data-table { font-size: 13px; }
.data-table th, .data-table td { border-bottom-color: #e8edf3; }
.data-table th { color: #5e6d82; background: #f7f9fc; font-size: 10px; }
.data-table td { color: #344258; }
.data-table tbody tr:hover { background: #f6f8fd; }
.data-table button, .link-button { color: #4057be; }
.positive { color: #078674 !important; }
.negative { color: #c83f55 !important; }

.candidate-list article { border-color: #e0e6ee; background: #f8fafc; }
.candidate-list article strong { color: #243149; }
.candidate-list article small { color: #68778c; }
.candidate-list article > span { color: #087f70; }

.app-shell .help-panel, .app-shell details { border-color: #dce3ec; background: #fff; }
.app-shell .help-panel summary, .app-shell summary { color: #233149; }
.app-shell details > div { color: #526178; }
.app-shell .help-grid article { border-color: #e0e6ee; background: #f7f9fc; }
.app-shell .help-grid article strong { color: #087f70; }
.app-shell .help-grid article p { color: #38475d; }
.app-shell .help-grid article small { color: #66758a; }
.help-more, .panel-help-link { color: #4057be; }

.app-shell .pipeline span { border-color: #dce3ec; color: #344258; background: #f7f9fc; }
.app-shell .pipeline i { color: #168b7c; }
.app-shell .pipeline.explained span small { color: #68778c; }
.app-shell .callout { border-color: #cfd9e8; color: #344258; background: #f6f8fc; }
.app-shell .callout p { color: #526178; }

.app-shell .dossier-card { border-color: #dde4ec; background: #fff; }
.dossier-identity strong { color: #233149; }
.dossier-identity small { color: #68778c; }
.dossier-body { border-top-color: #e5eaf0; }
.dossier-body > p, .dossier-failures p { color: #526178; }
.dossier-rules article, .dossier-facts article { border-color: #e0e6ee; background: #f8fafc; }
.dossier-rules small, .dossier-facts small { color: #4057be; }
.dossier-rules p, .dossier-facts p { color: #66758a; }
.dossier-facts strong { color: #233149; }
.dossier-failures { border-color: #efc5cc; background: #fff5f6; }
.dossier-failures > strong { color: #b7384e; }
.dossier-failures ul { color: #4d5b6d; }

.position-card { border-color: #dfe5ed; background: #fff; box-shadow: 0 7px 22px rgba(34, 48, 73, .055); }
.position-card h2, .position-facts strong { color: #233149; }
.position-card header p, .position-facts small { color: #65748a; }
.position-facts div, .detail-grid article { border-color: #e0e6ee; background: #f7f9fc; }
.position-reason { color: #4c5b70; }
.select-item { border-color: #dce3ec; color: #344258; background: #fff; }
.select-item small { color: #68778c; }
.select-item:hover, .select-item.active { border-color: #bdc7ee; background: #f0f2fc; }
.detail-grid small { color: #65748a; }
.detail-grid strong { color: #233149; }

.chart-canvas { border-color: #dce3ec; background: #fbfcfe; }
.chart-grid-line { stroke: #e1e6ee; }
.chart-axis-label { fill: #65748a; }
.event-strip article { border-color: #e0e6ee; color: #45556b; background: #f8fafc; }
.chart-legend { color: #526178; }
.audit-list article { border-bottom-color: #e5eaf0; }
.audit-list time, .audit-list small { color: #65748a; }
.empty-state { color: #65748a; }
.status-pill { color: #8b5b00; background: #fff7e6; }
.status-pill.ok, .status-ok { color: #087f70; background: #edf9f6; }
.status-pill.danger { color: #bd3d52; background: #fff1f3; }
.status-wait { color: #8b5b00; background: #fff7e6; }
.switch-row input { accent-color: #5266cc; }

@media (min-width: 901px) {
  .app-shell.sidebar-collapsed { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { width: 78px; padding-inline: 10px; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .brand-copy { display: none; }
  .sidebar-collapsed .sidebar-collapse { right: -23px; }
  .sidebar-collapsed .nav-group { height: 1px; margin: 16px 9px 9px; overflow: hidden; color: transparent; background: #e4e9f0; }
  .sidebar-collapsed .nav-group:first-child { margin-top: 8px; }
  .sidebar-collapsed .nav-item { grid-template-columns: 1fr; justify-items: center; min-height: 42px; padding-inline: 6px; }
  .sidebar-collapsed .nav-item > span { display: none; }
  .sidebar-collapsed .nav-item::before { width: 28px; height: 28px; }
  .sidebar-collapsed .nav-item.active::after { display: none; }
  .sidebar-collapsed .sidebar-foot { flex-direction: column; }
  .sidebar-collapsed .account-chip > span:last-child { display: none; }
  .sidebar-collapsed .logout-button { display: grid; }
}

@media (max-width: 900px) {
  .sidebar-collapse { display: none; }
  .sidebar-backdrop { background: rgba(27, 36, 53, .38); }
}

/* The standalone manual intentionally keeps its dedicated dark reading theme. */
.manual-body {
  --bg: #07111f;
  --panel: #0d1b2d;
  --panel-2: #10243b;
  --line: #213650;
  --text: #edf6ff;
  --muted: #8fa5bd;
  --cyan: #2dd4bf;
  --blue: #38bdf8;
  --danger: #fb7185;
  color: var(--text);
}

/* Modern workspace design system · v0.8.6 */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f3f5f8;
  --line: #e3e7ed;
  --line-soft: #edf0f4;
  --text: #18212f;
  --muted: #667386;
  --cyan: #087d70;
  --blue: #4659c7;
  --danger: #cb3d54;
  --warning: #9b6200;
  --shadow: 0 1px 2px rgba(18, 28, 45, .03), 0 8px 24px rgba(18, 28, 45, .045);
  --radius-lg: 16px;
  --radius-md: 12px;
  --accent-soft: #eef0ff;
}

html { background: var(--bg); }
body {
  color: var(--text);
  background: var(--bg);
  font-family: Pretendard, "Noto Sans KR", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: -.012em;
}

button, input, select { font-family: inherit; }
button { letter-spacing: -.01em; }
.muted { color: var(--muted); }
.eyebrow { color: #7a8595; letter-spacing: .13em; }

.auth-shell { background: radial-gradient(circle at 50% 0%, #eef0ff 0, #f6f7f9 42%); }
.auth-card { padding: 40px; border-color: #e1e5eb; border-radius: 20px; color: var(--text); background: rgba(255, 255, 255, .97); box-shadow: 0 24px 64px rgba(18, 28, 45, .11); }
.auth-card h1 { color: #18212f; font-weight: 780; letter-spacing: -.04em; }
.auth-card .muted { color: #667386; }
.auth-card .brand-mark { color: #fff; background: #1d2939; box-shadow: none; }
.auth-card .manual-entry { color: #3f53bd; }

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  background: #f6f7f9;
}

.sidebar {
  z-index: 30;
  width: 252px;
  padding: 20px 14px 14px;
  border-right: 1px solid #e5e8ed;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.sidebar-brand {
  gap: 11px;
  min-height: 55px;
  padding: 0 8px 18px;
  border-bottom: 1px solid #eef0f3;
}

.brand-mark.small {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  color: #fff;
  background: #1d2939;
  box-shadow: none;
  font-size: 11px;
  letter-spacing: -.04em;
}

.brand-copy { display: grid; min-width: 0; line-height: 1.2; }
.brand-copy strong { color: #17202d; font-size: 14px; font-weight: 800; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: #8a94a3; font-size: 9px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }

.sidebar nav {
  display: block;
  flex: 1;
  min-height: 0;
  margin: 12px -2px 0;
  padding: 0 2px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d6dbe2 transparent;
}

.nav-group {
  display: block;
  margin: 20px 12px 7px;
  color: #9aa3b0;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.nav-group:first-child { margin-top: 6px; }

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 42px;
  margin: 2px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  color: #566477;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}

.nav-item::before {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 0;
  color: inherit;
  background-color: currentColor;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 18px;
  -webkit-mask-image: var(--nav-icon);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 18px;
  mask-image: var(--nav-icon);
}

.nav-item[data-view="overview"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.nav-item[data-view="account"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h18v12H3zM16 11h5v4h-5a2 2 0 0 1 0-4zM5 7V5h13v2'/%3E%3C/svg%3E"); }
.nav-item[data-view="orders"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h12l-3-3M17 17H5l3 3M19 7l-3 3M5 17l3-3'/%3E%3C/svg%3E"); }
.nav-item[data-view="positions"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18'/%3E%3C/svg%3E"); }
.nav-item[data-view="chart"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5M4 19h16M7 15l4-4 3 2 5-7'/%3E%3C/svg%3E"); }
.nav-item[data-view="strategies"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 4V2M20 12h2'/%3E%3C/svg%3E"); }
.nav-item[data-view="research"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5M8 11l2-2 2 3 2-4'/%3E%3C/svg%3E"); }
.nav-item[data-view="performance"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5M4 19h16M7 15l4-4 3 2 5-7M16 6h3v3'/%3E%3C/svg%3E"); }
.nav-item[data-view="connections"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 12h8M5 8v8M19 8v8M3 10h4v4H3zM17 10h4v4h-4z'/%3E%3C/svg%3E"); }
.nav-item[data-view="risk"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 5 6v5c0 4.6 2.9 8.3 7 10 4.1-1.7 7-5.4 7-10V6zM9 12l2 2 4-5'/%3E%3C/svg%3E"); }
.nav-item[href="/manual"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a3 3 0 0 1 3-2h5v17H7a3 3 0 0 0-3 2zM20 5a3 3 0 0 0-3-2h-5v17h5a3 3 0 0 1 3 2z'/%3E%3C/svg%3E"); }
.nav-item[href*="glossary"]::before { --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.7 9a2.5 2.5 0 1 1 3.4 2.3c-.8.4-1.1.9-1.1 1.7M12 17h.01'/%3E%3C/svg%3E"); }

.nav-item:hover { color: #1f2a3a; background: #f5f7fa; }
.nav-item.active { color: #3549b8; background: var(--accent-soft); box-shadow: none; }
.nav-item.active::before { color: #4659c7; background-color: currentColor; }
.nav-item.active::after { display: none; }

.sidebar-foot { gap: 9px; margin-top: 0; padding: 14px 7px 0; border-top: 1px solid #eef0f3; }
.account-chip { gap: 9px; }
.account-chip strong { color: #344054; font-size: 11px; }
.account-chip small { color: #98a2b3; }
.user-avatar { border: 0; border-radius: 9px; color: #3549b8; background: #eef0ff; }

.icon-button { border-color: #e0e4ea; color: #667386; background: #fff; box-shadow: none; }
.icon-button:hover { color: #3448b5; border-color: #cbd2dc; background: #f8f9fb; }
.sidebar-collapse { top: 9px; right: -29px; width: 25px; height: 25px; border-radius: 8px; background: #fff; font-size: 17px; }
.logout-button { background: transparent; }

main { padding: 0 clamp(24px, 3.2vw, 48px) 72px; }
.topbar {
  min-height: 104px;
  max-width: 1360px;
  margin: 0 auto 24px;
  padding: 25px 0 18px;
  border-bottom: 1px solid #e6e9ee;
  background: rgba(246, 247, 249, .92);
  backdrop-filter: blur(18px);
}
.title-group { gap: 13px; }
.topbar .eyebrow { margin-bottom: 4px; color: #8b95a3; font-size: 9px; }
.topbar h1 { color: #18212f; font-size: clamp(25px, 2.5vw, 31px); font-weight: 780; line-height: 1.15; letter-spacing: -.045em; }
.page-description { margin-top: 6px; color: #667386; font-size: 13px; }
.topbar-actions { gap: 10px; }
.universe-badge { color: #697586; font-size: 11px; }
.system-state { min-width: 100px; padding: 8px 11px; border-color: #dde2e8; border-radius: 9px; color: #475467; background: #fff; box-shadow: none; font-size: 10px; }
.dot { width: 7px; height: 7px; box-shadow: none; }
.dot.ready { box-shadow: none; }

.page-view { max-width: 1360px; animation: page-in .16s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: translateY(0); } }

.notice {
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 15px;
  border: 1px solid #ede1c9;
  border-radius: 10px;
  color: #5d6673;
  background: #fffbf3;
  font-size: 12px;
}
.notice::before { display: none; }
.notice strong { color: #855900; font-size: 12px; }
.notice.secure { border-color: #cee7e2; background: #f4fbf9; }
.notice.secure strong { color: #08766a; }

.metric-grid { gap: 14px; margin-bottom: 18px; }
.metric-grid article, .panel { border: 1px solid #e4e8ed; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.metric-grid article { min-height: 126px; padding: 20px; }
.metric-grid article::after { top: 20px; right: 20px; width: 8px; height: 8px; border-radius: 50%; background: #d9defa; }
.metric-grid span { color: #697586; font-size: 12px; font-weight: 650; }
.metric-grid strong { margin: 12px 0 4px; color: #17202d; font-size: 25px; font-weight: 780; letter-spacing: -.035em; }
.metric-grid small { color: #8a94a3; font-size: 11px; }

.panel { margin-bottom: 16px; padding: 22px; }
.panel-head { align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel h2 { color: #1d2735; font-size: 16px; font-weight: 760; letter-spacing: -.025em; }
.panel-subtitle { margin-top: 5px; color: #7a8595; font-size: 11px; }
.tag { padding: 5px 9px; border: 0; border-radius: 999px; color: #08766a; background: #ecf8f5; font-size: 9px; font-weight: 800; }
.tag.locked { color: #b7354a; background: #fdf0f2; }
.overview-grid { grid-template-columns: minmax(330px, .82fr) minmax(420px, 1.18fr); gap: 16px; align-items: start; }
.overview-grid > .panel { min-height: 0; }
.overview-scanner-panel { display: flex; flex-direction: column; overflow: hidden; }
.overview-scanner-panel .panel-head { flex: 0 0 auto; }
.overview-scanner-panel #scanner-list {
  flex: 1 1 auto;
  min-height: 0;
  padding-right: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: #c8cfda transparent;
}
.overview-scanner-panel #scanner-list::-webkit-scrollbar { width: 6px; }
.overview-scanner-panel #scanner-list::-webkit-scrollbar-track { background: transparent; }
.overview-scanner-panel #scanner-list::-webkit-scrollbar-thumb { border-radius: 999px; background: #c8cfda; }
.overview-scanner-panel #scanner-list::-webkit-scrollbar-thumb:hover { background: #aeb7c4; }
.overview-scanner-panel #scanner-list:focus-visible { outline: 2px solid #7180d7; outline-offset: 3px; }

.primary, .secondary { min-height: 40px; padding: 9px 15px; border-radius: 10px; font-size: 12px; font-weight: 750; }
.primary { color: #fff; background: #3448b5; box-shadow: 0 2px 7px rgba(52, 72, 181, .18); }
.primary:hover { color: #fff; background: #293b9e; transform: translateY(-1px); }
.secondary { color: #344054; border-color: #d8dde5; background: #fff; }
.secondary:hover { color: #293b9e; border-color: #bfc7d4; background: #fafbfc; transform: translateY(-1px); }
.text-button, .data-table button, .link-button, .help-more, .panel-help-link { color: #3f53bd; }

input, select { min-height: 41px; padding: 9px 11px; border-color: #d7dde5; border-radius: 10px; color: #243044; background: #fff; font-size: 13px; }
input::placeholder { color: #98a2b3; }
input:focus, select:focus { border-color: #7180d7; box-shadow: 0 0 0 3px rgba(70, 89, 199, .10); }
label { gap: 6px; color: #475467; font-size: 12px; font-weight: 650; }
.compact-panel { gap: 12px; min-height: 72px; padding: 14px 16px; background: #fff; }
.compact-panel > small { padding-bottom: 9px; font-size: 11px; }

.progress-list { gap: 0; padding: 0; }
.progress-list li { min-height: 37px; padding: 9px 12px 9px 34px; border-bottom: 1px solid #f0f2f5; color: #596678; font-size: 12px; }
.progress-list li::before { left: 11px; color: #98a2b3; }
.progress-list .done { color: #344054; }
.progress-list .done::before { color: #087d70; }

.data-table-wrap { border: 1px solid #e7eaee; border-radius: 12px; }
.data-table { font-size: 12px; }
.data-table th, .data-table td { padding: 12px 13px; border-bottom-color: #edf0f3; }
.data-table th { color: #697586; background: #f8f9fb; font-size: 10px; font-weight: 750; letter-spacing: .045em; }
.data-table td { color: #344054; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tr:last-child td { border-bottom: 0; }
.positive { color: #087d70 !important; }
.negative { color: #c43c52 !important; }

.candidate-list { gap: 7px; }
.candidate-list article { padding: 12px 13px; border-color: #e7eaee; border-radius: 10px; background: #fafbfc; }
.candidate-list article strong { color: #243044; }
.candidate-list article small { color: #7a8595; }
.candidate-list article > span { color: #08766a; font-size: 12px; font-weight: 750; }

.position-grid { gap: 14px; }
.position-card { padding: 20px; border-color: #e4e8ed; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.position-card h2, .position-facts strong { color: #243044; }
.position-card header p, .position-facts small { color: #7a8595; }
.position-facts div, .detail-grid article { border: 1px solid #e7eaee; border-radius: 10px; background: #f8f9fb; }
.position-reason { color: #566477; }
.position-card .position-pnl { font-size: 24px; }

.split-layout { gap: 16px; }
.strategy-split-layout > .panel { min-height: 560px; }
.strategy-list-panel { display: flex; flex-direction: column; }
.strategy-list-panel > #strategy-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.select-list { gap: 6px; }
.select-item { padding: 12px; border-color: #e3e7ed; border-radius: 10px; color: #344054; background: #fff; }
.select-item small { color: #7a8595; }
.select-item:hover, .select-item.active { border-color: #c4cbef; color: #293b9e; background: #f3f4fd; }
.detail-grid small { color: #7a8595; }
.detail-grid strong { color: #243044; }
.detail-panel { top: 122px; }

.app-shell .help-panel, .app-shell details { border-color: #e3e7ed; border-radius: 12px; background: #fff; }
.app-shell summary { color: #243044; }
.app-shell details > div { color: #566477; }
.app-shell .help-grid article, .dossier-rules article, .dossier-facts article { border-color: #e7eaee; border-radius: 10px; background: #f8f9fb; }
.app-shell .help-grid article strong, .dossier-rules small, .dossier-facts small { color: #08766a; }
.app-shell .help-grid article p, .dossier-body > p, .dossier-rules p, .dossier-facts p { color: #475467; }
.app-shell .help-grid article small { color: #7a8595; }
.app-shell .pipeline span { border-color: #e3e7ed; color: #344054; background: #f8f9fb; }
.app-shell .pipeline i { color: #087d70; }
.app-shell .pipeline.explained span small { color: #7a8595; }
.app-shell .callout { border-color: #dde3eb; color: #344054; background: #f8f9fb; }
.app-shell .callout p { color: #566477; }
.app-shell .dossier-card { border-color: #e3e7ed; background: #fff; }
.dossier-identity strong { color: #243044; }
.dossier-identity small { color: #7a8595; }
.dossier-body { border-top-color: #e9ecf0; }
.dossier-facts strong { color: #243044; }
.dossier-failures { border-color: #f0ccd2; background: #fff6f7; }
.dossier-failures > strong { color: #b7354a; }
.dossier-failures ul { color: #475467; }

.chart-canvas { border-color: #e4e8ed; border-radius: 12px; background: #fcfcfd; }
.chart-grid-line { stroke: #e8ebef; }
.chart-axis-label { fill: #697586; }
.event-strip article { border-color: #e7eaee; color: #475467; background: #fafbfc; }
.chart-legend { color: #566477; }
.audit-list article { border-bottom-color: #edf0f3; }
.audit-list time, .audit-list small { color: #7a8595; }
.empty-state { color: #7a8595; }
.status-pill { color: #855900; background: #fff7e8; }
.status-pill.ok, .status-ok { color: #08766a; background: #ecf8f5; }
.status-pill.danger { color: #b7354a; background: #fdf0f2; }
.status-wait { color: #855900; background: #fff7e8; }

@media (min-width: 901px) {
  .app-shell.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar-collapsed .sidebar { width: 72px; padding-inline: 10px; }
  .sidebar-collapsed .nav-group { background: #eef0f3; }
  .sidebar-collapsed .nav-item { min-height: 42px; }
  .sidebar-collapsed .nav-item::before { width: 19px; height: 19px; -webkit-mask-size: 19px; mask-size: 19px; }
}

@media (max-width: 1180px) {
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { position: fixed; width: 252px; height: 100dvh; transform: translateX(-102%); }
  .app-shell.sidebar-visible .sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; margin-left: auto; }
  .sidebar-open { display: grid; }
  .sidebar-backdrop { background: rgba(23, 32, 47, .34); backdrop-filter: blur(2px); }
  main { padding-inline: clamp(16px, 4vw, 28px); }
}

@media (max-width: 620px) {
  .topbar { min-height: 92px; }
  .topbar h1 { font-size: 22px; }
  .page-description { max-width: 230px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-grid article { min-height: 112px; padding: 16px; }
  .metric-grid strong { font-size: 21px; }
  .panel { padding: 17px; }
  .notice { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
}

/* The manual now shares the same bright, restrained visual language. */
.manual-body {
  --bg: #f6f7f9;
  --panel: #fff;
  --panel-2: #f3f5f8;
  --line: #e3e7ed;
  --text: #18212f;
  --muted: #667386;
  --cyan: #087d70;
  --blue: #4659c7;
  --danger: #cb3d54;
  color: var(--text);
  background: #f6f7f9;
}
.manual-header { border-bottom-color: #e5e8ed; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 0 rgba(18, 28, 45, .02); }
.manual-brand { color: #18212f; }
.manual-brand small { color: #7a8595; }
.manual-toc { border-color: #e3e7ed; background: #fff; box-shadow: var(--shadow); }
.manual-toc a { color: #667386; }
.manual-toc a:hover { color: #293b9e; background: #f3f4fd; }
.manual-hero { border-color: #e0e4eb; background: linear-gradient(145deg, #fff, #f2f4fc); box-shadow: var(--shadow); }
.manual-hero > p:not(.eyebrow) { color: #566477; }
.manual-status-row span { border-color: #dfe3f6; color: #475467; background: rgba(255,255,255,.72); }
.manual-status-row b { color: #3549b8; }
.manual-section-title > span { border-color: #d8def8; color: #3549b8; background: #eef0ff; }
.manual-section-title p { color: #4659c7; }
.manual-section > p { color: #566477; }
.manual-body .callout { border-color: #d9e0e9; border-left-color: #4659c7; background: #f8f9fb; }
.manual-body .callout p { color: #566477; }
.manual-body .callout.secure { border-color: #cce5e0; border-left-color: #087d70; background: #f1faf8; }
.manual-body .callout.danger { border-color: #edcbd1; border-left-color: #cb3d54; background: #fff5f6; }
.manual-body .callout.danger strong { color: #b7354a; }
.manual-flow span, .manual-steps > li, .manual-grid article, .routine-grid article, .manual-definition-list article, .code-explain, .manual-body details { border-color: #e3e7ed; color: #344054; background: #fff; }
.manual-flow small, .manual-steps p, .manual-grid p, .routine-grid ul, .manual-definition-list p, .code-explain p, .manual-body details > div, .manual-list { color: #667386; }
.manual-flow i, .routine-grid time, .manual-definition-list h3, .code-explain code, .glossary-grid dt { color: #3549b8; }
.manual-steps > li::before { color: #fff; background: #4659c7; }
.check-line { color: #344054; background: #f1f3fd; }
.check-line b { color: #3549b8; }
.check-line span { color: #566477; }
.manual-grid .state-card.locked { border-top-color: #cb3d54; }
.manual-grid .state-card.shadow { border-top-color: #4659c7; }
.manual-grid .state-card.canary { border-top-color: #087d70; }
.manual-definition-list article { border-left-color: #c7ceed; }
.timeline::before { background: #d8def3; }
.timeline article > span { border-color: #c7ceed; color: #3549b8; background: #fff; }
.timeline p { color: #667386; }
.emergency-box { border-color: #cb3d54; background: #fff5f6; }
.emergency-box > strong { color: #b7354a; }
.emergency-box ol { color: #475467; }
.glossary-grid article { border-color: #e3e7ed; background: #fff; }
.glossary-grid dd { color: #566477; }
.glossary-grid dd em { color: #4659c7; }
.glossary-group-title { color: #344054; }
.manual-footer { border-top-color: #e3e7ed; color: #7a8595; }

/* Interactive evidence chart · v0.8.7 */
.chart-toolbar {
  align-items: start;
}
.chart-toolbar .field-control {
  grid-template-rows: 16px 42px minmax(16px, auto);
  align-content: start;
  gap: 6px;
  min-width: 0;
}
.chart-toolbar .field-control > label,
.chart-toolbar .field-label-spacer {
  display: block;
  margin: 0;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
}
.chart-toolbar input,
.chart-toolbar select,
.chart-toolbar .chart-action-field > button {
  width: 100%;
  height: 42px;
  min-height: 42px;
  margin: 0;
}
.chart-toolbar .autocomplete,
.chart-toolbar .autocomplete > input {
  height: 42px;
}
.chart-action-field .field-label-spacer {
  visibility: hidden;
}
.chart-action-field .field-hint {
  text-align: center;
}
.chart-interaction-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
}
.chart-interaction-bar > small {
  color: #7a8595;
  text-align: right;
}
.chart-zoom-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}
.chart-zoom-controls .compact-button {
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11px;
}
.chart-candle-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  min-height: 42px;
  margin-bottom: 8px;
  padding: 9px 12px;
  border: 1px solid #e4e8ed;
  border-radius: 10px;
  color: #475467;
  background: #f8f9fb;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart-candle-info span { white-space: nowrap; }
.chart-candle-info .chart-info-time { color: #243044; font-weight: 750; }
.chart-candle-info b { margin-right: 3px; color: #7a8595; font-size: 10px; }
.chart-candle-info .chart-info-up { color: #c9374f; }
.chart-candle-info .chart-info-down { color: #245fc7; }
.chart-canvas {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}
.chart-canvas.is-pannable { cursor: grab; }
.chart-canvas.is-dragging { cursor: grabbing; }
.chart-canvas svg {
  width: 100%;
  min-width: 0;
  height: 520px;
}
.chart-plot-background { fill: #fff; }
.chart-volume-background { fill: #f8f9fb; }
.chart-section-line { stroke: #d9dee6; stroke-width: 1; }
.chart-crosshair { stroke: #667085; stroke-width: 1; stroke-dasharray: 4 4; pointer-events: none; }
.chart-hover-dot { fill: #fff; stroke: #344054; stroke-width: 1.5; pointer-events: none; }
.chart-hover-band { fill: rgba(70, 89, 199, .055); pointer-events: none; }
.chart-candle-up { fill: #d6455d; stroke: #d6455d; }
.chart-candle-down { fill: #2d67c7; stroke: #2d67c7; }
.chart-candle-flat { fill: #667085; stroke: #667085; }
.chart-volume-up { fill: rgba(214, 69, 93, .30); }
.chart-volume-down { fill: rgba(45, 103, 199, .27); }
.chart-volume-flat { fill: rgba(102, 112, 133, .25); }
.chart-overlay {
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.chart-overlay-sma_5 { stroke: #7c3aed; }
.chart-overlay-sma_20 { stroke: #e08918; }
.chart-overlay-sma_60 { stroke: #0f8f83; }
.chart-strategy-fast { fill: none; stroke: #c43c78; stroke-width: 1.7; stroke-dasharray: 7 4; }
.chart-strategy-slow { fill: none; stroke: #3457d5; stroke-width: 1.7; stroke-dasharray: 7 4; }
.chart-strategy-trend { fill: none; stroke: #64748b; stroke-width: 1.7; stroke-dasharray: 7 4; }
.chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 12px;
  min-width: 186px;
  max-width: 230px;
  padding: 10px 12px;
  border: 1px solid #d9dee7;
  border-radius: 9px;
  color: #344054;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(22, 34, 54, .11);
  font-size: 11px;
  line-height: 1.55;
  pointer-events: none;
}
.chart-tooltip strong { display: block; margin-bottom: 4px; color: #18212f; }
.chart-tooltip-grid { display: grid; grid-template-columns: auto auto; gap: 1px 12px; }
.chart-tooltip-grid b { color: #7a8595; font-weight: 600; }
.chart-tooltip-grid span { text-align: right; font-variant-numeric: tabular-nums; }
.chart-axis-label { font-variant-numeric: tabular-nums; }
.chart-time-label { fill: #7a8595; font-size: 10px; }
.legend-key.price::before { height: 8px; background: linear-gradient(90deg, #d6455d 0 48%, #2d67c7 52% 100%); }
.legend-key.sma_5::before { background: #7c3aed; }
.legend-key.sma_20::before { background: #e08918; }
.legend-key.sma_60::before { background: #0f8f83; }
.legend-key.strategy::before { height: 2px; }
.legend-key.strategy-fast::before { background: repeating-linear-gradient(90deg, #c43c78 0 7px, transparent 7px 11px); }
.legend-key.strategy-slow::before { background: repeating-linear-gradient(90deg, #3457d5 0 7px, transparent 7px 11px); }
.legend-key.strategy-trend::before { background: repeating-linear-gradient(90deg, #64748b 0 7px, transparent 7px 11px); }

@media (max-width: 760px) {
  .chart-interaction-bar { align-items: flex-start; flex-direction: column; }
  .chart-interaction-bar > small { text-align: left; }
  .chart-zoom-controls { width: 100%; }
  .chart-zoom-controls .compact-button { flex: 1 1 auto; }
  .chart-canvas { min-height: 440px; }
  .chart-canvas svg { height: 440px; }
  .chart-candle-info { align-items: flex-start; gap: 5px 12px; }
}
