:root {
  color-scheme: light;
  --ink: #15201e;
  --muted: #68736f;
  --line: #dce2df;
  --soft-line: #e9edeb;
  --surface: #ffffff;
  --canvas: #f3f5f4;
  --nav: #111817;
  --nav-soft: #1a2422;
  --green: #16805f;
  --green-soft: #e8f4ef;
  --amber: #c27812;
  --amber-soft: #fff4dc;
  --red: #b54135;
  --red-soft: #fcecea;
  --mono: "DM Mono", Consolas, monospace;
  --sans: "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--sans); font-size: 14px; letter-spacing: 0; }
button { font: inherit; letter-spacing: 0; }
button:focus-visible { outline: 2px solid #52b895; outline-offset: 2px; }
[hidden] { display: none !important; }
.login-page { min-height: 100vh; padding: 28px; display: grid; place-items: center; background: #111817; color: #edf3f0; }
.login-shell { width: min(900px, 100%); min-height: 520px; display: grid; grid-template-columns: minmax(0, 1fr) 390px; border: 1px solid #2d3a36; background: #17211f; box-shadow: 0 26px 70px rgb(0 0 0 / 28%); }
.login-intro { padding: 40px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid #2d3a36; background: #141d1b; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.login-brand strong { font-size: 17px; }
.login-brand small { color: #899691; font: 500 9px/1 var(--mono); }
.login-intro-copy { max-width: 340px; }
.login-intro-copy > span, .login-kicker { color: #63c6a0; font: 500 9px/1.2 var(--mono); }
.login-intro-copy h1 { margin: 13px 0 10px; max-width: 280px; font-size: clamp(26px, 4vw, 38px); line-height: 1.18; letter-spacing: 0; }
.login-intro-copy p { margin: 0; color: #9caaa5; font-size: 12px; line-height: 1.8; }
.login-safety { padding-top: 16px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #2d3a36; color: #a7b5af; font-size: 10px; }
.login-safety svg { width: 16px; color: #d5a241; }
.login-panel { align-self: stretch; padding: 48px 38px 32px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); color: var(--ink); }
.login-panel h2 { margin: 8px 0 0; font-size: 22px; }
.login-copy { margin: 8px 0 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.login-form { display: grid; gap: 15px; }
.login-form label { display: grid; gap: 7px; }
.login-form label span { color: #53615c; font-size: 10px; font-weight: 600; }
.login-form input { height: 42px; width: 100%; padding: 0 12px; border: 1px solid #cbd4d0; border-radius: 3px; color: var(--ink); background: #fff; font: 500 12px var(--mono); }
.login-form input:focus { outline: 2px solid rgb(22 128 95 / 18%); border-color: var(--green); }
.login-form .primary-button { width: 100%; height: 42px; margin-top: 2px; }
.login-message { padding: 10px 12px; border: 1px solid #efb7b1; color: #8f3028; background: var(--red-soft); font-size: 10px; line-height: 1.5; }
.login-foot { margin: auto 0 0; padding-top: 24px; display: flex; align-items: center; gap: 7px; color: #89938f; font-size: 9px; }
.login-foot svg { width: 14px; color: var(--green); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: #edf3f0; display: flex; flex-direction: column; z-index: 20; }
.brand { height: 76px; padding: 0 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #27302e; }
.brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.brand strong { font-size: 17px; }
.brand small { font: 500 9px/1 var(--mono); color: #899691; }
.brand-mark { position: relative; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #4c5e59; }
.brand-mark i { position: absolute; width: 15px; height: 5px; background: #56b993; transform: skew(-28deg); }
.brand-mark i:first-child { transform: translateY(-5px) skew(-28deg); background: #d5a241; }
.primary-nav { padding: 22px 12px; display: grid; gap: 5px; }
.nav-item { height: 44px; width: 100%; padding: 0 12px; border: 0; border-left: 2px solid transparent; background: transparent; color: #9caaa5; display: grid; grid-template-columns: 20px 1fr auto; gap: 11px; align-items: center; text-align: left; cursor: pointer; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item b { min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 10px; background: #2a3532; color: #aab5b1; font: 500 10px var(--mono); }
.nav-item:hover { color: #fff; background: #18211f; }
.nav-item.active { color: #fff; background: var(--nav-soft); border-left-color: #53bd96; }
.nav-item.active svg { color: #63c6a0; }
.sidebar-foot { margin-top: auto; padding: 18px 20px; border-top: 1px solid #27302e; }
.environment { display: flex; gap: 10px; align-items: center; }
.environment > span { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgb(194 120 18 / 14%); }
.environment div { display: flex; flex-direction: column; }
.environment small { color: #788681; font-size: 10px; }
.environment strong { font-size: 12px; margin-top: 2px; }
.sidebar-foot p { margin: 14px 0 0; color: #5f6d68; font: 10px var(--mono); }

.workspace { min-width: 0; }
.topbar { height: 76px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; }
.page-heading span, .panel-head span { display: block; color: #7c8984; font: 500 9px/1.2 var(--mono); }
.page-heading h1 { margin: 4px 0 0; font-size: 20px; line-height: 1.2; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.clock { padding-right: 16px; border-right: 1px solid var(--line); text-align: right; display: flex; flex-direction: column; }
.clock small { color: var(--muted); font-size: 10px; }
.clock time { margin-top: 2px; font: 500 12px var(--mono); }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); color: #52605b; display: grid; place-items: center; cursor: pointer; border-radius: 4px; }
.icon-button:hover { background: #f7f9f8; color: var(--ink); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.loading svg { animation: spin .8s linear infinite; }
.menu-button { display: none; }
.operator { padding: 0; border: 0; display: flex; align-items: center; gap: 9px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.operator > span { width: 34px; height: 34px; display: grid; place-items: center; background: #e8efec; color: #34564a; font: 600 11px var(--mono); border-radius: 4px; }
.operator div { display: flex; flex-direction: column; }
.operator strong { font-size: 11px; }
.operator small { color: var(--muted); font-size: 10px; }
.operator:hover > span { background: var(--green-soft); color: var(--green); }

.main-content { padding: 24px 28px 36px; max-width: 1540px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }
.connection-error { min-height: 42px; margin-bottom: 16px; padding: 8px 12px; border: 1px solid #efb7b1; background: var(--red-soft); color: #8f3028; display: flex; align-items: center; gap: 9px; }
.connection-error svg { width: 17px; }
.connection-error button { margin-left: auto; border: 0; background: transparent; color: inherit; font-weight: 600; cursor: pointer; }

.system-banner { min-height: 112px; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--amber); display: grid; grid-template-columns: 48px minmax(220px, 1fr) auto auto; gap: 18px; align-items: center; }
.state-symbol { width: 46px; height: 46px; display: grid; place-items: center; color: var(--amber); background: var(--amber-soft); border-radius: 4px; }
.state-symbol svg { width: 22px; }
.state-copy > span { color: var(--amber); font-size: 10px; font-weight: 700; }
.state-copy h2 { margin: 5px 0 2px; font-size: 18px; }
.state-copy p { margin: 0; color: var(--muted); font-size: 12px; }
.state-permissions { display: flex; gap: 34px; padding: 0 24px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.state-permissions div { display: flex; flex-direction: column; gap: 4px; }
.state-permissions small { color: var(--muted); font-size: 10px; }
.state-permissions strong { color: var(--red); font-size: 12px; }
.status-pill, .filter-chip { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 3px; font: 600 10px var(--mono); }
.status-pill { color: #9a5d0b; background: var(--amber-soft); border: 1px solid #ebce97; }

.metric-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 112px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-label svg { width: 17px; color: #8b9994; }
.metric > strong { display: block; margin-top: 14px; font: 500 25px/1 var(--mono); }
.metric > strong em { font-style: normal; font-size: 11px; color: var(--muted); }
.metric > small { display: block; margin-top: 8px; color: #89938f; font-size: 10px; }
.metric.accent { border-top: 2px solid var(--green); }
.metric.accent > strong { color: var(--green); }

.dashboard-grid { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.panel-head { min-height: 65px; padding: 14px 18px; border-bottom: 1px solid var(--soft-line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h2 { margin: 5px 0 0; font-size: 14px; }
.panel-head > strong { font: 500 12px var(--mono); color: var(--amber); }
.panel-head > svg { width: 18px; color: #8b9994; }
.panel-head-actions { display: inline-flex; align-items: center; gap: 12px; }
.market-status { color: #9a5d0b; font: 500 9px var(--mono); }
.market-status.live { color: var(--green); }
.market-status.error { color: var(--red); }
.check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-item { min-height: 58px; padding: 11px 16px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--soft-line); }
.check-item:nth-child(odd) { border-right: 1px solid var(--soft-line); }
.check-item:nth-last-child(-n+2) { border-bottom: 0; }
.check-icon { width: 25px; height: 25px; border: 1px solid #e1c58e; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; border-radius: 50%; }
.check-icon svg { width: 13px; }
.check-item div { display: flex; flex-direction: column; gap: 2px; }
.check-item strong { font-size: 11px; font-weight: 600; }
.check-item small { color: var(--muted); font-size: 9px; }
.exchange-list { display: grid; }
.exchange-item { min-height: 87px; padding: 16px 18px; display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--soft-line); }
.exchange-item:last-child { border-bottom: 0; }
.exchange-logo { width: 36px; height: 36px; display: grid; place-items: center; background: #f0f3f1; border: 1px solid var(--line); font: 600 12px var(--mono); }
.exchange-item div:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.exchange-item strong { font-size: 12px; }
.exchange-item small { color: var(--muted); font-size: 9px; }
.exchange-state { color: var(--amber); font: 500 9px var(--mono); }
.exchange-state.ready { color: var(--green); }
.opportunity-panel, .activity-panel { min-height: 288px; }
.available-opportunities-panel { margin-bottom: 14px; }
.text-button { border: 0; background: transparent; color: var(--green); font-size: 10px; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.text-button svg { width: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 16px; text-align: left; background: #f8faf9; color: #78847f; font-size: 9px; font-weight: 600; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid var(--soft-line); }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.mono { font: 500 10px var(--mono); }
.route { color: #43534e; font: 500 9px var(--mono); text-transform: uppercase; }
.network-status { font: 600 9px var(--mono); white-space: nowrap; }
.network-status.good { color: var(--green); }
.network-status.warning { color: var(--amber); }
.network-status.bad { color: var(--red); }
.spread { font: 600 10px var(--mono); }
.spread.positive { color: var(--green); }
.spread.negative { color: var(--red); }
.spread-action { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.depth-button { width: 27px; height: 27px; border: 1px solid var(--line); background: var(--surface); color: #61706b; display: grid; place-items: center; border-radius: 3px; cursor: pointer; }
.depth-button:hover { color: var(--green); border-color: #9fc9b9; background: var(--green-soft); }
.depth-button svg { width: 14px; height: 14px; }
.empty-row td { height: 185px; text-align: center; color: var(--muted); }
.empty-row svg { display: block; width: 26px; margin: 0 auto 9px; color: #9ca8a3; }
.empty-row strong, .empty-row span { display: block; }
.empty-row strong { color: #52605b; font-size: 11px; }
.empty-row span { margin-top: 4px; font-size: 9px; }
.empty-state, .wide-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state { min-height: 222px; padding: 20px; }
.empty-icon { width: 40px; height: 40px; margin-bottom: 11px; display: grid; place-items: center; background: #f0f3f1; color: #8a9792; border-radius: 50%; }
.empty-icon svg { width: 18px; }
.empty-state strong, .wide-empty strong { color: #52605b; font-size: 11px; }
.empty-state p, .wide-empty span { margin: 5px 0 0; font-size: 9px; }
.activity-list { min-height: 222px; }
.activity-event { min-height: 63px; padding: 13px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--soft-line); }
.activity-event:last-child { border-bottom: 0; }
.activity-event > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.activity-event strong { overflow: hidden; color: #52605b; font: 600 10px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.activity-event small, .activity-event p { margin: 0; color: var(--muted); font-size: 9px; }
.activity-event p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact { width: 30px; height: 30px; }

.section-toolbar { min-height: 70px; margin-bottom: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.section-toolbar h2 { margin: 0; font-size: 16px; }
.section-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.filter-chip { color: #53615c; border: 1px solid var(--line); background: #f8faf9; }
.filter-chip.danger { color: var(--red); border-color: #efc0bb; background: var(--red-soft); }
.wide-empty { min-height: 390px; background: var(--surface); border: 1px solid var(--line); }
.wide-empty > svg { width: 34px; height: 34px; margin-bottom: 12px; color: #9aa6a1; }
.account-layout { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 14px; }
.account-status-panel, .account-config-panel { min-height: 390px; }
.account-config-list { display: grid; }
.account-config-item { min-height: 92px; padding: 16px 18px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--soft-line); }
.account-config-item:last-child { border-bottom: 0; }
.account-config-item > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.account-config-item strong { font-size: 12px; }
.account-config-item small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.account-config-state { color: var(--amber); font: 600 9px var(--mono); }
.account-config-state.ready { color: var(--green); }
.account-config-form { padding: 18px; }
.account-config-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.account-config-fields label { display: grid; gap: 6px; }
.account-config-fields label span { color: #53615c; font-size: 10px; font-weight: 600; }
.account-config-fields input, .account-config-fields select { height: 39px; width: 100%; padding: 0 11px; border: 1px solid #cbd4d0; border-radius: 3px; color: var(--ink); background: #fff; font: 500 12px var(--mono); }
.account-config-fields input:focus, .account-config-fields select:focus { outline: 2px solid rgb(22 128 95 / 18%); border-color: var(--green); }
.account-config-reason { grid-column: 1 / -1; }
.account-config-footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-config-footer > span { color: var(--muted); font-size: 9px; }
.account-config-actions { display: flex; gap: 8px; flex-shrink: 0; }
.account-config-footer svg { width: 14px; }
.account-config-message { margin-top: 14px; padding: 10px 12px; border: 1px solid #a6d2c1; color: var(--green); background: var(--green-soft); font-size: 10px; }
.account-config-message:not([hidden]) { display: block; }
.account-config-message.error { border-color: #efb7b1; color: #8f3028; background: var(--red-soft); }
.risk-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 14px; }
.risk-control-panel, .risk-check-panel { min-height: 360px; }
.risk-state-summary { min-height: 110px; padding: 20px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--soft-line); }
.risk-state-summary > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.risk-state-summary small { color: var(--muted); font-size: 10px; }
.risk-state-summary strong { font: 600 20px var(--mono); color: var(--amber); }
.risk-state-summary span { color: var(--muted); font-size: 10px; }
.risk-permissions { display: flex; gap: 14px; }
.risk-permissions span { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 9px; }
.risk-permissions b { color: var(--red); font: 600 9px var(--mono); }
.risk-actions { padding: 16px 18px; display: flex; flex-wrap: wrap; gap: 9px; }
.risk-actions button { flex: 1 1 145px; }
.risk-actions svg { width: 14px; }
.risk-note { margin: 0 18px 18px; padding: 11px 12px; display: flex; gap: 8px; color: #68736f; background: #f7f9f8; border-left: 3px solid var(--amber); font-size: 9px; line-height: 1.6; }
.risk-note svg { width: 15px; min-width: 15px; color: var(--amber); }
.control-message { margin: 0 18px 18px; padding: 10px 12px; border: 1px solid #efb7b1; color: #8f3028; background: var(--red-soft); font-size: 10px; }
.risk-check-list { min-height: 294px; }
.risk-check-list .check-item { min-height: 49px; }
.risk-check-list .check-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--soft-line); }
.risk-config-panel { grid-column: 1 / -1; }
.risk-config-form { padding: 18px; }
.risk-config-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.risk-config-fields label { display: grid; gap: 6px; }
.risk-config-fields label span { color: #53615c; font-size: 10px; font-weight: 600; }
.risk-config-fields input { height: 39px; width: 100%; padding: 0 11px; border: 1px solid #cbd4d0; border-radius: 3px; color: var(--ink); background: #fff; font: 500 12px var(--mono); }
.risk-config-fields input:focus { outline: 2px solid rgb(22 128 95 / 18%); border-color: var(--green); }
.risk-config-reason { grid-column: 1 / -1; }
.risk-config-footer { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.risk-config-footer > span { color: var(--muted); font-size: 9px; }
.risk-config-footer svg { width: 14px; }
.risk-config-message { margin-top: 14px; padding: 10px 12px; border: 1px solid #a6d2c1; color: var(--green); background: var(--green-soft); font-size: 10px; }
.risk-config-message:not([hidden]) { display: block; }
.risk-config-message.error { border-color: #efb7b1; color: #8f3028; background: var(--red-soft); }
.danger-button { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d28f87; border-radius: 3px; color: #9d3329; background: var(--red-soft); cursor: pointer; font-size: 10px; font-weight: 600; }
.danger-button:hover { background: #f8deda; }
.danger-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .5; }
.audit-panel { min-height: 390px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.audit-table { min-width: 680px; }
.audit-table .empty-row td { height: 330px; }
.audit-subhead { padding: 16px 18px 8px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.audit-subhead span { color: #78847f; font: 500 9px var(--mono); }
.audit-subhead strong { font-size: 12px; }
.event-table .empty-row td { height: 180px; }
.event-detail { max-width: 260px; color: var(--muted); font-size: 10px; white-space: normal; }
.audit-status { font: 600 9px var(--mono); color: var(--amber); }
.audit-status.good { color: var(--green); }
.audit-status.bad { color: var(--red); }
.sidebar-scrim { display: none; }

.depth-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 22px 70px rgb(12 24 20 / 24%); }
.depth-dialog::backdrop { background: rgb(12 20 18 / 55%); }
.control-dialog { width: min(430px, calc(100vw - 32px)); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 22px 70px rgb(12 24 20 / 24%); }
.control-dialog::backdrop { background: rgb(12 20 18 / 55%); }
.control-form { padding: 18px; display: grid; gap: 14px; }
.control-form p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.control-form label { display: grid; gap: 6px; }
.control-form label span { color: #53615c; font-size: 10px; font-weight: 600; }
.control-form input { height: 39px; width: 100%; padding: 0 11px; border: 1px solid #cbd4d0; border-radius: 3px; color: var(--ink); background: #fff; font: 500 12px var(--mono); }
.control-form input:focus { outline: 2px solid rgb(22 128 95 / 18%); border-color: var(--green); }
.control-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.control-dialog-actions .secondary-button { background: var(--surface); }
.dialog-head { min-height: 67px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head span { color: #78847f; font: 500 9px var(--mono); }
.dialog-head h2 { margin: 5px 0 0; font-size: 15px; }
.dialog-body { padding: 18px; }
.depth-route { min-height: 60px; padding: 12px 14px; display: grid; grid-template-columns: 1fr 22px 1fr; gap: 12px; align-items: center; background: #f7f9f8; border: 1px solid var(--soft-line); }
.depth-route > svg { width: 17px; color: #7c8984; }
.depth-route div { display: flex; flex-direction: column; gap: 3px; }
.depth-route small, .analysis-metrics small { color: var(--muted); font-size: 9px; }
.depth-route strong { font: 500 11px var(--mono); text-transform: uppercase; }
.depth-form { margin-top: 14px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.depth-actions { display: flex; flex-direction: column; gap: 7px; }
.depth-form label { display: grid; gap: 6px; }
.depth-form label span { color: #53615c; font-size: 10px; font-weight: 600; }
.depth-form input { height: 39px; width: 100%; padding: 0 11px; border: 1px solid #cbd4d0; border-radius: 3px; color: var(--ink); background: #fff; font: 500 12px var(--mono); }
.depth-form input:focus { outline: 2px solid rgb(22 128 95 / 18%); border-color: var(--green); }
.primary-button { height: 39px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #126c51; border-radius: 3px; color: #fff; background: var(--green); cursor: pointer; font-size: 11px; font-weight: 600; }
.primary-button:hover { background: #116f53; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.primary-button svg { width: 15px; }
.secondary-button { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #9fc9b9; border-radius: 3px; color: var(--green); background: var(--green-soft); cursor: pointer; font-size: 10px; font-weight: 600; }
.secondary-button:hover { background: #dcefe8; }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button svg { width: 14px; }
.depth-message { margin-top: 14px; padding: 10px 12px; border: 1px solid #efb7b1; color: #8f3028; background: var(--red-soft); font-size: 10px; }
.depth-result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.cost-result { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.analysis-state { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.analysis-state div { display: flex; flex-direction: column; gap: 4px; }
.analysis-state span { color: var(--amber); font-size: 9px; font-weight: 700; }
.analysis-state strong { font-size: 13px; }
.analysis-state b { padding: 6px 8px; color: #9a5d0b; background: var(--amber-soft); border: 1px solid #ebce97; border-radius: 3px; font: 600 9px var(--mono); }
.analysis-metrics { margin-top: 13px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.analysis-metrics > div { min-height: 66px; padding: 11px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--line); }
.analysis-metrics > div:last-child { border-right: 0; }
.analysis-metrics strong { font: 500 11px var(--mono); overflow-wrap: anywhere; }
.cost-diagnostics { margin-top: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.cost-diagnostics > div { min-height: 58px; padding: 10px; display: flex; flex-direction: column; gap: 7px; border-right: 1px solid var(--line); }
.cost-diagnostics > div:last-child { border-right: 0; }
.cost-diagnostics small { color: var(--muted); font-size: 9px; }
.cost-diagnostics strong { color: var(--ink); font: 500 10px var(--mono); overflow-wrap: anywhere; }
.missing-costs { margin-top: 13px; display: grid; grid-template-columns: 60px 1fr; gap: 10px; align-items: start; }
.missing-costs > span { padding-top: 5px; color: var(--muted); font-size: 9px; }
.missing-costs > div { display: flex; flex-wrap: wrap; gap: 6px; }
.network-detail { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.network-detail strong { color: var(--ink); font: 500 10px var(--mono); overflow-wrap: anywhere; text-align: right; }
.cost-chip { padding: 4px 7px; color: #6c521f; background: var(--amber-soft); border: 1px solid #ead29e; border-radius: 3px; font-size: 9px; }
.cost-chip.warning { color: #8b5a13; background: #fff3dc; border-color: #e4bd70; }
.cost-chip.verified { color: var(--green); background: var(--green-soft); border-color: #a6d2c1; }
.analysis-note { margin: 13px 0 0; padding: 10px 11px; display: flex; gap: 8px; color: #68736f; background: #f7f9f8; border-left: 3px solid var(--amber); font-size: 9px; line-height: 1.6; }
.analysis-note svg { width: 15px; min-width: 15px; color: var(--amber); }
.execution-submit-panel { margin-top: 14px; padding: 12px; border: 1px solid #9fc9b9; background: #f3faf7; }
.execution-submit-head, .execution-submit-footer, .allowlist-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.execution-submit-head > div { display: flex; flex-direction: column; gap: 4px; }
.execution-submit-head span { color: var(--green); font: 500 9px var(--mono); }
.execution-submit-head strong { font-size: 12px; }
.execution-submit-head b { padding: 5px 7px; color: #6c521f; background: var(--amber-soft); border: 1px solid #ead29e; border-radius: 3px; font: 600 9px var(--mono); }
.execution-submit-fields { margin-top: 11px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.execution-submit-fields label, .allowlist-fields label { display: grid; gap: 5px; }
.execution-submit-fields label span, .allowlist-fields label span { color: #53615c; font-size: 9px; font-weight: 600; }
.execution-submit-fields input, .allowlist-fields input, .allowlist-fields select { height: 34px; width: 100%; padding: 0 9px; border: 1px solid #cbd4d0; border-radius: 3px; color: var(--ink); background: #fff; font: 500 10px var(--mono); }
.execution-submit-fields input:focus, .allowlist-fields input:focus, .allowlist-fields select:focus { outline: 2px solid rgb(22 128 95 / 18%); border-color: var(--green); }
.execution-submit-footer { margin-top: 11px; }
.execution-submit-footer > span, .allowlist-footer > span { color: #68736f; font-size: 9px; line-height: 1.5; }
.allowlist-panel { margin-top: 14px; }
.allowlist-table-wrap { margin-top: 8px; }
.allowlist-form { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.allowlist-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.allowlist-footer { margin-top: 11px; }
.allowlist-footer .primary-button { flex: 0 0 auto; }
.allowlist-disable { color: #9a5d0b; border-color: #ebce97; background: var(--amber-soft); }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }
  .risk-layout { grid-template-columns: 1fr; }
  .risk-config-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-diagnostics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .execution-submit-fields, .allowlist-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cost-diagnostics > div:nth-child(2) { border-right: 0; }
  .cost-diagnostics > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .login-page { padding: 16px; }
  .login-shell { min-height: 0; grid-template-columns: 1fr; }
  .login-intro { min-height: 260px; padding: 26px; border-right: 0; border-bottom: 1px solid #2d3a36; }
  .login-intro-copy h1 { margin-top: 10px; font-size: 27px; }
  .login-panel { padding: 30px 24px 24px; }
  .login-foot { margin-top: 28px; }
  .execution-submit-fields, .allowlist-fields { grid-template-columns: 1fr; }
  .execution-submit-head, .execution-submit-footer, .allowlist-footer { align-items: stretch; flex-direction: column; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 232px; transition: transform .2s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 15; background: rgb(10 16 15 / 48%); }
  body.nav-open .sidebar-scrim { display: block; }
  .topbar { height: 68px; padding: 0 16px; }
  .menu-button { display: grid; }
  .page-heading span { display: none; }
  .page-heading h1 { margin: 0; font-size: 17px; }
  .clock, .operator div { display: none; }
  .operator > span { width: 36px; height: 36px; }
  .main-content { padding: 16px; }
  .system-banner { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; }
  .state-symbol { width: 40px; height: 40px; }
  .state-permissions { grid-column: 1 / -1; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); justify-content: space-between; }
  .status-pill { position: absolute; right: 30px; margin-top: -68px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 104px; padding: 14px; }
  .metric > strong { font-size: 21px; }
  .check-list { grid-template-columns: 1fr; }
  .check-item:nth-child(odd) { border-right: 0; }
  .check-item:nth-last-child(2) { border-bottom: 1px solid var(--soft-line); }
  .section-toolbar { align-items: flex-start; gap: 12px; }
}

@media (max-width: 460px) {
  .topbar-actions { gap: 8px; }
  .operator { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { min-height: 98px; }
  .metric-label span { font-size: 10px; }
  .system-banner { padding: 17px; }
  .state-copy h2 { font-size: 16px; }
  .status-pill { right: 22px; }
  .panel-head { padding: 13px 14px; }
  .opportunity-panel th:nth-child(3),
  .opportunity-panel th:nth-child(4),
  .opportunity-panel td:nth-child(3),
  .opportunity-panel td:nth-child(4) { display: none; }
  .opportunity-panel th,
  .opportunity-panel td { padding-left: 12px; padding-right: 12px; }
  .dialog-body { padding: 14px; }
  .depth-form { grid-template-columns: 1fr; }
  .depth-actions { gap: 8px; }
  .primary-button { width: 100%; }
  .secondary-button { width: 100%; }
  .analysis-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-metrics > div:nth-child(2) { border-right: 0; }
  .analysis-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .risk-state-summary { align-items: flex-start; flex-direction: column; }
  .account-config-fields { grid-template-columns: 1fr; }
  .account-config-reason { grid-column: auto; }
  .account-config-footer { align-items: stretch; flex-direction: column; }
  .account-config-actions { flex-direction: column; }
  .account-config-actions .primary-button, .account-config-actions .secondary-button { width: 100%; }
  .risk-permissions { width: 100%; justify-content: space-between; }
  .risk-config-fields { grid-template-columns: 1fr; }
  .risk-config-reason { grid-column: auto; }
  .risk-config-footer { align-items: stretch; flex-direction: column; }
  .risk-config-footer .primary-button { width: 100%; }
  .control-dialog-actions { flex-direction: column-reverse; }
  .control-dialog-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

.probe-button { margin-left: 12px; white-space: nowrap; }
.probe-result { margin: 16px 0; padding: 14px 16px; border: 1px solid #d8e2df; background: #f7faf9; }
.probe-result.ok { border-color: #77b99e; }
.probe-result.failed { border-color: #d79b8f; background: #fff7f5; }
.probe-result-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.probe-result-head span { color: #75817d; font-family: "DM Mono", monospace; font-size: 12px; }
.probe-steps { display: grid; gap: 6px; }
.probe-step { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; background: rgba(255,255,255,.72); }
.probe-step strong { font-size: 12px; }
.probe-step span { color: #687571; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.probe-step b { font-size: 11px; color: #358466; }
.probe-step.failed b { color: #b14d42; }
@media (max-width: 900px) { .probe-button { margin: 12px 0 0; } .probe-result-head, .probe-step { grid-template-columns: 1fr; display: grid; } }
