:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: #0d1823;
  --panel-2: #111f2c;
  --line: #223445;
  --muted: #8395a6;
  --text: #edf5fb;
  --cyan: #31d7c7;
  --cyan-2: #0c8f86;
  --red: #ff6474;
  --amber: #f4bd4f;
  --green: #59d48b;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: radial-gradient(circle at 75% -10%, #123143 0, transparent 32%), var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.good-text { color: var(--green) !important; }
.warn-text { color: var(--amber) !important; }
.bad-text { color: var(--red) !important; }
.eyebrow { margin: 0 0 5px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 38px; background: rgba(13, 24, 35, .94); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.login-card h1 { margin: 12px 0 2px; font-size: 28px; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: #041514; background: linear-gradient(135deg, #64f2df, #20a7a1); font-weight: 900; letter-spacing: -.06em; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 12px; }
.stack { display: grid; gap: 14px; margin-top: 24px; }
.stack.small { margin-top: 12px; gap: 10px; }
label { display: grid; gap: 7px; color: #b9c8d4; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; color: var(--text); background: #08131d; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; transition: .15s border, .15s box-shadow; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan-2); box-shadow: 0 0 0 3px rgba(49, 215, 199, .09); }
.check-line { display: flex; align-items: center; gap: 8px; }
.check-line input { width: auto; }
button { border: 0; border-radius: 9px; padding: 10px 14px; font-weight: 800; transition: .15s transform, .15s filter; }
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(49, 215, 199, .34);
  outline-offset: 2px;
}
button.mini { margin-top: 6px; padding: 6px 9px; font-size: 11px; }
.primary { color: #041514; background: var(--cyan); }
.secondary { color: var(--text); background: #172939; border: 1px solid #294154; }
.danger-soft { color: #ffc3ca; background: rgba(255, 100, 116, .13); border: 1px solid rgba(255, 100, 116, .32); }
.text-button { padding: 4px; color: var(--muted); background: transparent; }
.form-message { min-height: 20px; color: var(--red); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 14px; background: rgba(7, 16, 25, .93); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { color: var(--muted); font-size: 11px; }
nav { display: grid; gap: 5px; }
.nav-item { text-align: left; color: #9db0c0; background: transparent; padding: 11px 13px; }
.nav-item:hover { background: #0d1d29; }
.nav-item.active { color: #071514; background: var(--cyan); }
.sidebar-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.main { min-width: 0; padding: 0 30px 50px; }
.topbar { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h2 { margin: 0; font-size: 25px; }
.top-actions, .button-row, .config-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.badge.good { color: #9af0bd; background: rgba(89, 212, 139, .12); }
.badge.bad { color: #ffc0c6; background: rgba(255, 100, 116, .14); }
.badge.warn { color: #ffe09c; background: rgba(244, 189, 79, .14); }
.badge.neutral { color: #b8c8d5; background: #142433; }
.page { display: none; }
.page.active { display: block; }
.decision-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.decision-card { min-width: 0; padding: 14px 16px; background: #091721; border: 1px solid #214055; border-radius: 13px; }
.decision-card:first-child { border-color: rgba(49, 215, 199, .42); background: linear-gradient(135deg, rgba(49,215,199,.1), #091721 72%); }
.decision-card span, .decision-card small { display: block; color: var(--muted); }
.decision-card strong { display: block; min-height: 29px; margin: 3px 0; overflow: hidden; text-overflow: ellipsis; color: #f5fbff; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .panel { background: linear-gradient(180deg, rgba(17, 31, 44, .96), rgba(12, 24, 35, .96)); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 12px 36px rgba(0,0,0,.12); }
.metric { padding: 18px; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 4px 0; font-size: 30px; font-variant-numeric: tabular-nums; }
.trading-page { --trading-cell-y: 7px; }
.trading-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  overflow: hidden;
  background: #091721;
  border: 1px solid #214055;
  border-radius: 10px;
}
.trading-kpi {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(92px, auto);
  gap: 1px 10px;
  align-items: baseline;
  padding: 9px 12px;
  border-left: 1px solid #1c3344;
}
.trading-kpi:first-child { border-left: 0; }
.trading-kpi span, .trading-kpi small { color: var(--muted); font-size: 11px; }
.trading-kpi strong {
  min-width: 92px;
  overflow: hidden;
  color: #f4fbff;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trading-kpi small { grid-column: 1 / -1; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.panel.trading-workbench-panel { padding: 0; overflow: hidden; }
.panel-head.trading-workbench-head { margin: 0; padding: 11px 14px; background: #0e1d29; border-bottom: 1px solid var(--line); }
.trading-master-detail { display: grid; grid-template-columns: minmax(380px, .9fr) minmax(500px, 1.1fr); min-width: 0; }
.trading-master-pane, .trading-detail-pane { min-width: 0; }
.trading-master-pane { align-content: start; display: grid; border-right: 1px solid var(--line); }
.workbench-block { min-width: 0; border-bottom: 1px solid var(--line); }
.workbench-block:last-child { border-bottom: 0; }
.workbench-block-head, .trading-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  background: rgba(8, 19, 29, .74);
  border-bottom: 1px solid #1a2d3c;
}
.workbench-block-head h4, .trading-detail-head h4 { margin: 0; font-size: 13px; }
.workbench-block-head p, .trading-detail-head p { margin: 1px 0 0; color: var(--muted); font-size: 10px; }
.trading-aggregate-table { max-height: 220px; }
.trading-account-table { max-height: 350px; }
.trading-page table { font-size: 12px; }
.trading-page th, .trading-page td { padding: var(--trading-cell-y) 7px; }
.trading-page .table-wrap thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #0d1d29;
  box-shadow: 0 1px #233a4c;
}
.trading-page tr[data-trading-account-row] { transition: background .12s ease; }
.trading-page tr[data-trading-account-row]:hover { background: rgba(49, 215, 199, .045); }
.trading-page tr[data-trading-account-row].selected { background: rgba(49, 215, 199, .09); box-shadow: inset 3px 0 var(--cyan); }
.account-open {
  max-width: 210px;
  overflow: hidden;
  padding: 0;
  color: #e8f5fb;
  background: transparent;
  border-radius: 3px;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-open:hover { color: var(--cyan); text-decoration: underline; }
.trading-page .coverage-cell { min-width: 96px; }
.trading-page .coverage-cell .coverage-bar { margin-top: 4px; }
.scope-label { display: inline-flex; min-width: 30px; margin-right: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.trading-detail-pane { background: #0a1620; }
.trading-detail-head { min-height: 49px; }
.compact-tabs {
  display: flex;
  min-width: 0;
  gap: 2px;
  padding: 5px 7px 0;
  overflow-x: auto;
  background: #08131c;
  border-bottom: 1px solid var(--line);
}
.compact-tab {
  flex: 0 0 auto;
  padding: 7px 11px;
  color: #8da2b2;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  font-size: 11px;
}
.compact-tab:hover { color: var(--text); background: #102432; }
.compact-tab.active { color: #a8f4e8; background: #10232f; border-color: #244050; border-bottom-color: var(--cyan); }
.compact-tab.danger-tab.active { color: #ffd0d5; border-bottom-color: var(--red); }
.section-tabs {
  display: flex;
  min-width: 0;
  gap: 6px;
  margin-bottom: 14px;
  padding: 6px;
  overflow-x: auto;
  background: #08131c;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.section-tab {
  flex: 0 0 auto;
  min-width: 126px;
  padding: 9px 14px;
  color: #92a8b8;
  background: transparent;
  border: 1px solid transparent;
}
.section-tab:hover { color: var(--text); background: #102432; }
.section-tab.active {
  color: #071514;
  background: var(--cyan);
  border-color: rgba(49, 215, 199, .55);
}
.people-tab-panel { min-width: 0; }
.trading-tab-panel { min-height: 104px; padding: 10px 11px; border-bottom: 1px solid var(--line); }
.compact-form { display: grid; gap: 8px; }
.compact-form label { gap: 4px; font-size: 10px; }
.compact-form input, .compact-form select { min-height: 34px; padding: 6px 8px; border-radius: 7px; }
.compact-form .wide { grid-column: 1 / -1; }
.trading-query-grid { grid-template-columns: minmax(150px, 1.4fr) minmax(90px, .6fr) minmax(125px, .8fr) minmax(125px, .8fr); }
.trading-stats-grid { grid-template-columns: minmax(180px, 1fr) auto; align-items: end; }
.backfill-grid { grid-template-columns: 1fr 100px; }
.compact-actions { margin-top: 8px; }
.compact-actions button { padding: 7px 10px; font-size: 11px; }
.backfill-panel .banner { margin-bottom: 8px; padding: 8px 10px; font-size: 11px; }
.backfill-panel .check-line { align-items: flex-start; font-weight: 600; }
.compact-summary {
  grid-template-columns: repeat(4, auto minmax(42px, 1fr));
  gap: 5px 8px;
  min-height: 0;
  margin: 0;
  padding: 7px 11px;
  background: #08131c;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.compact-summary:empty { display: none; }
.compact-summary span:nth-child(even) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backfill-panel .compact-summary { margin: 9px -11px -10px; border-top: 1px solid var(--line); border-bottom: 0; }
.trading-result-block { min-width: 0; }
.trading-result-table { min-height: 230px; max-height: 430px; }
.trading-result-table .empty { padding: 54px 12px; }
.panel { padding: 18px; margin-bottom: 16px; }
.panel.compact { margin: 0; }
.panel h3 { margin: 0; font-size: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 16px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-column { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; margin-bottom: 16px; }
.service-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.service-list { display: grid; gap: 10px; }
.service-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px; background: #0a1620; border: 1px solid #1c3040; border-radius: 11px; }
.service-row strong, .service-row span { display: block; }
.service-row span { color: var(--muted); font-size: 12px; }
.service-card { padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; }
.service-card header { display: flex; justify-content: space-between; gap: 12px; }
.service-card h3 { margin: 0; }
.service-card dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 18px 0; }
.service-card dt { color: var(--muted); }
.service-card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.attention-list { display: grid; gap: 8px; }
.attention { padding: 11px; border-left: 3px solid var(--amber); background: rgba(244, 189, 79, .08); border-radius: 8px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.admin-boundary { border-color: rgba(131, 149, 166, .38); }
.search-box { display: grid; grid-template-columns: auto minmax(180px, 260px); align-items: center; gap: 9px; }
.search-box input { padding-block: 8px; }
.team-tree { display: grid; gap: 12px; }
.team-node { overflow: hidden; background: #091620; border: 1px solid #203648; border-radius: 13px; }
.team-node > header { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 14px; background: #0f202d; }
.team-node h4, .user-node h5 { margin: 0; }
.team-node header p, .user-node p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.user-list { display: grid; gap: 1px; background: #1a2d3b; }
.user-node { padding: 13px 14px; background: #091620; }
.user-line { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.state-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.account-strip { display: grid; grid-template-columns: minmax(180px, 1.35fr) .8fr .7fr .7fr .8fr .85fr; gap: 9px; align-items: center; margin-top: 9px; padding: 9px 10px; background: #07121a; border: 1px solid #1a2c3a; border-radius: 9px; }
.account-strip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-strip .numeric { text-align: right; }
.coverage-bar { height: 6px; margin-top: 9px; overflow: hidden; background: #1d3140; border-radius: 999px; }
.coverage-bar > i { display: block; height: 100%; background: var(--green); }
.health-drilldown { display: grid; gap: 7px; margin: 12px 0; }
.health-account { padding: 9px 10px; background: #07131c; border-left: 3px solid var(--amber); border-radius: 7px; }
.health-account.ready { border-left-color: var(--green); }
.health-account strong, .health-account span { display: block; }
.health-account span { color: var(--muted); font-size: 11px; white-space: normal; }
.banner { margin-bottom: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(244,189,79,.32); color: #ffe0a1; background: rgba(244,189,79,.09); }
.banner.info { color: #b7e9f3; border-color: rgba(49,215,199,.25); background: rgba(49,215,199,.07); }
.admission-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}
.admission-explainer > div {
  min-width: 0;
  padding: 12px;
  background: #08151f;
  border: 1px solid #1d3343;
  border-radius: 10px;
}
.admission-explainer strong,
.admission-explainer span { display: block; }
.admission-explainer strong { margin-bottom: 4px; color: #a8f4e8; }
.admission-explainer span { color: var(--muted); font-size: 11px; }
.admission-policy-panel .form-grid { align-items: end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid button { align-self: end; }
.form-grid .wide { grid-column: 1 / -1; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-align: left; }
th, td { padding: 10px 9px; border-bottom: 1px solid #1b2d3c; white-space: nowrap; }
td { color: #dbe8f1; }
td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.credential-history { margin-top: 16px; padding: 15px; background: #091722; border: 1px solid #224055; border-radius: 12px; }
.credential-history .panel-head { margin-bottom: 10px; }
.credential-history .banner { margin: 0 0 10px; }
.secret-once { margin-top: 14px; padding: 14px; border: 1px dashed var(--cyan); border-radius: 10px; background: rgba(49,215,199,.06); word-break: break-all; }
.key-values { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin-top: 14px; }
.key-values span:nth-child(odd) { color: var(--muted); }
.key-values span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.auth-control-panel { padding: 0; overflow: hidden; }
.auth-panel-head { margin: 0; padding: 15px 17px; background: #0e1d29; border-bottom: 1px solid var(--line); }
.auth-panel-head .eyebrow { margin-bottom: 3px; }
.auth-control-panel > .key-values { margin: 0; padding: 12px 17px; border-bottom: 1px solid var(--line); }
.auth-state-strip { justify-content: flex-end; margin: 0; }
.auth-boundary-banner { margin: 12px 14px 0; padding: 9px 11px; font-size: 11px; }
.auth-config-form { min-width: 0; }
.auth-config-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.auth-config-section { min-width: 0; padding: 14px; }
.auth-config-section + .auth-config-section { border-left: 1px solid var(--line); }
.auth-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.auth-section-head.compact { align-items: center; margin-bottom: 8px; }
.auth-section-head h4, .auth-section-head h5, .consumer-toolbar h5, .auth-save-strip h4 { margin: 0; font-size: 13px; }
.auth-section-head h5, .consumer-toolbar h5 { font-size: 12px; }
.auth-section-head p, .consumer-toolbar p, .auth-save-strip p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.auth-subsection { margin-top: 12px; padding-top: 11px; border-top: 1px solid #1b2e3d; }
.auth-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.auth-form-grid label { min-width: 0; gap: 4px; font-size: 10px; }
.auth-form-grid label.wide { grid-column: 1 / -1; }
.auth-form-grid input { min-height: 35px; padding: 7px 9px; border-radius: 7px; font-size: 12px; }
.auth-form-grid small, .secret-status { color: var(--muted); font-size: 9px; font-weight: 600; }
.secret-status { justify-self: end; margin-top: -18px; padding-right: 7px; pointer-events: none; }
.secret-status.good-text, .secret-status.warn-text { font-weight: 800; }
.auth-uri-preview { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 12px; margin-top: 12px; padding: 10px; background: #08151f; border: 1px solid #1d3343; border-radius: 8px; }
.auth-uri-preview span { color: var(--muted); font-size: 10px; }
.auth-uri-preview code { min-width: 0; overflow-wrap: anywhere; color: #b7e9f3; font-size: 11px; }
.auth-danger-zone { margin-top: 12px; padding: 9px 10px; background: rgba(236,91,91,.05); border: 1px solid rgba(236,91,91,.25); border-radius: 8px; }
.auth-danger-zone summary { color: #ffb3b3; font-size: 11px; font-weight: 800; cursor: pointer; }
.auth-danger-zone p { margin: 7px 0; color: var(--muted); font-size: 10px; }
.auth-danger-zone label { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: #e8c7c7; font-size: 10px; }
.auth-danger-zone input { width: auto; margin: 0; }
.switch-line { display: flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 30px; padding: 5px 8px; color: #dbe8f1; background: #08151f; border: 1px solid #213648; border-radius: 8px; white-space: nowrap; }
.switch-line input { width: auto; margin: 0; }
.consumer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 7px; }
.auth-consumers { display: grid; gap: 7px; }
.auth-consumer-row { min-width: 0; padding: 8px; background: #08151f; border: 1px solid #1d3343; border-radius: 8px; }
.auth-consumer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.auth-consumer-head strong { min-width: 0; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.auth-consumer-grid { display: grid; grid-template-columns: minmax(110px, .65fr) minmax(145px, 1fr); gap: 6px; }
.auth-consumer-grid label { min-width: 0; gap: 3px; font-size: 9px; }
.auth-consumer-grid label.wide { grid-column: 1 / -1; }
.auth-consumer-grid input, .auth-consumer-grid textarea { min-height: 31px; padding: 5px 7px; border-radius: 6px; font-size: 11px; }
.auth-consumer-grid textarea { min-height: 48px; resize: vertical; }
.login-method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.check-tile { display: flex; align-items: flex-start; gap: 6px; min-width: 0; padding: 7px; background: #08151f; border: 1px solid #1d3343; border-radius: 7px; }
.check-tile input { flex: 0 0 auto; width: auto; margin: 3px 0 0; }
.check-tile span, .check-tile strong, .check-tile small { display: block; min-width: 0; }
.check-tile strong { color: #dbe8f1; font-size: 10px; }
.check-tile small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.35; }
.auth-save-strip { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(190px, 1fr) minmax(190px, .85fr); gap: 9px 12px; align-items: end; margin: 13px -14px -14px; padding: 12px 14px; background: #09151f; border-top: 1px solid var(--line); }
.auth-save-strip > label { min-width: 0; gap: 4px; font-size: 10px; }
.auth-save-strip > label input { min-height: 35px; padding: 7px 9px; border-radius: 7px; font-size: 12px; }
.auth-inline-message { min-height: 17px; color: var(--muted); font-size: 10px; }
.auth-inline-message.error { color: #ffb3b3; }
.auth-confirm-line { grid-column: 1 / 3; align-self: center; display: flex !important; color: #c8d7e1; font-weight: 600 !important; }
.auth-confirm-line input { flex: 0 0 auto; width: auto !important; min-height: 0 !important; margin: 0; }
.auth-action-row { justify-content: flex-end; }
.auth-action-row button { padding: 8px 11px; font-size: 11px; }
.auth-result { min-height: 0; max-height: 160px; margin: 0 14px 14px; padding: 9px 11px; font-size: 11px; }
.auth-guide-grid { align-items: start; }
.setup-steps { display: grid; gap: 9px; margin: 0; padding-left: 22px; }
.setup-steps li { padding-left: 3px; color: var(--cyan); font-weight: 800; }
.setup-steps strong, .setup-steps span { display: block; color: #dbe8f1; }
.setup-steps span { margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 500; }
.auth-difference-table { display: grid; gap: 1px; overflow: hidden; background: #1c3040; border: 1px solid #1c3040; border-radius: 9px; }
.auth-difference-table > div { display: grid; grid-template-columns: minmax(120px, .4fr) minmax(0, 1fr); gap: 10px; padding: 9px 10px; background: #08151f; }
.auth-difference-table strong { color: #a9eee4; font-size: 11px; }
.auth-difference-table span { color: #b8c9d5; font-size: 11px; }
.auth-identity-boundary { padding-top: 11px; border-top: 1px solid #1c3040; font-size: 11px; }
.json-editor { min-height: 300px; margin-top: 14px; resize: vertical; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.config-toolbar select, .config-toolbar input { width: auto; min-width: 150px; }
.result-box { min-height: 38px; max-height: 320px; overflow: auto; padding: 12px; color: #a9d8e5; background: #061019; border: 1px solid #1c3040; border-radius: 9px; white-space: pre-wrap; word-break: break-word; }
.toast { position: fixed; z-index: 20; right: 24px; top: 22px; max-width: 420px; padding: 11px 15px; border-radius: 9px; color: #06110f; background: var(--cyan); box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { color: white; background: var(--red); }
.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(1, 7, 12, .84); }
.modal-card { width: min(450px, 100%); padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.modal-card h2 { margin: 4px 0; }
@media (max-width: 1050px) {
  .metric-grid, .decision-grid { grid-template-columns: 1fr 1fr; }
  .three-column, .service-card-grid { grid-template-columns: 1fr; }
  .account-strip { grid-template-columns: 1fr 1fr 1fr; }
  .trading-master-detail { grid-template-columns: minmax(0, 1fr); }
  .trading-master-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .trading-account-table { max-height: 310px; }
  .auth-config-columns { grid-template-columns: minmax(0, 1fr); }
  .auth-config-section + .auth-config-section { border-left: 0; border-top: 1px solid var(--line); }
  .auth-save-strip { grid-template-columns: 1fr 1fr; }
  .auth-save-strip > div:first-child { grid-column: 1 / -1; }
  .auth-confirm-line { grid-column: 1 / -1; }
  .auth-action-row { grid-column: 1 / -1; }
  .admission-explainer { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); width: 100%; overflow-x: hidden; }
  .sidebar { position: static; width: 100%; min-width: 0; height: auto; }
  nav { grid-template-columns: 1fr 1fr; }
  .main { padding: 0 14px 35px; }
  .two-column, .form-grid { grid-template-columns: 1fr; }
  .topbar { min-height: 82px; }
  .panel { padding: 14px; }
  .panel.trading-workbench-panel { padding: 0; }
  .search-box { grid-template-columns: 1fr; width: 100%; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-head.trading-workbench-head { align-items: stretch; }
  .auth-panel-head { align-items: stretch; }
  .auth-state-strip { justify-content: flex-start; }
  .auth-save-strip { grid-template-columns: minmax(0, 1fr); }
  .auth-save-strip > div:first-child, .auth-confirm-line, .auth-action-row { grid-column: auto; }
  .auth-action-row { justify-content: stretch; }
  .auth-action-row button { flex: 1 1 130px; }
  .trading-kpi-strip { grid-template-columns: repeat(4, minmax(265px, 1fr)); overflow-x: auto; }
  .trading-kpi { border-left: 1px solid #1c3344; }
  .trading-kpi strong { min-width: 148px; }
  .trading-kpi:first-child { border-left: 0; }
  .trading-query-grid { grid-template-columns: 1fr 1fr; }
  .trading-query-grid .account-field { grid-column: 1 / -1; }
  .compact-summary { grid-template-columns: auto minmax(60px, 1fr) auto minmax(60px, 1fr); }
  .account-strip { grid-template-columns: 1fr 1fr; }
  .account-strip > span:first-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .decision-grid, .metric-grid { grid-template-columns: 1fr; }
  .sidebar { padding: 12px; gap: 5px; }
  .sidebar-brand { padding: 0 4px 8px; }
  nav { display: flex; width: 100%; min-width: 0; gap: 6px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x proximity; }
  .nav-item { flex: 0 0 auto; padding: 8px 11px; white-space: nowrap; scroll-snap-align: start; }
  .sidebar-bottom { margin-top: 0; padding: 7px 4px 0; }
  .topbar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 0; }
  .top-actions { width: 100%; justify-content: space-between; }
  .trading-query-grid, .trading-stats-grid, .backfill-grid { grid-template-columns: 1fr; }
  .trading-query-grid .account-field { grid-column: auto; }
  .compact-form .wide { grid-column: auto; }
  .compact-summary { grid-template-columns: auto minmax(80px, 1fr); }
  .trading-result-table { min-height: 180px; max-height: 360px; }
  .auth-form-grid, .auth-consumer-grid, .login-method-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-form-grid label.wide, .auth-consumer-grid label.wide { grid-column: auto; }
  .auth-uri-preview { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .auth-config-section { padding: 11px; }
  .auth-section-head { align-items: stretch; flex-direction: column; }
  .switch-line { align-self: flex-start; }
  .auth-difference-table > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .auth-identity-boundary { grid-template-columns: minmax(95px, auto) minmax(0, 1fr); }
  .section-tab { min-width: 112px; padding-inline: 11px; }
}
