:root {
  color-scheme: dark;
  --bg: #0b1118;
  --panel: #111b27;
  --panel2: #162232;
  --line: #223044;
  --text: #eef4fb;
  --muted: #8fa0b4;
  --accent: #6aa4ff;
  --down: #ff6574;
  --up: #61d69a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
.wrap { width: min(100%, 760px); margin: 0 auto; padding: 16px 10px 40px; }
header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.title-block { min-width: 0; }
h1 { margin: 0 0 4px; font-size: 19px; line-height: 1.15; }
h2 { margin: 0; font-size: 14px; }
p { margin: 0; }
#meta, #stockMeta { color: var(--muted); font-size: 11px; line-height: 1.45; }
.submeta { color: #71849a; font-size: 10px; margin-top: 2px; }
button, input { font: inherit; }
button {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
button:disabled { opacity: .55; cursor: default; }
button.active { border-color: var(--accent); color: #fff; background: var(--panel2); }
.actions { display: flex; gap: 5px; }
.actions button { white-space: nowrap; font-size: 12px; }
.top-settings-link {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 7px 8px; border-radius: 8px; font-size: 10.5px; line-height: 1;
}
.top-settings-link:hover { color: #fff; border-color: var(--accent); }
@media (max-width: 430px) {
  .top-settings-link { padding: 7px 7px; font-size: 9.5px; }
}

.filters { display: grid; grid-template-columns: auto auto auto 1fr auto; gap: 6px; align-items: center; margin-bottom: 8px; }
.filters button { font-size: 12px; padding: 8px 10px; }
.filters input {
  min-width: 0; width: 100%; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); padding: 9px 10px; border-radius: 8px; outline: none;
}
.filters input:focus { border-color: var(--accent); }
#count { white-space: nowrap; color: var(--muted); font-size: 11px; }
.table-card, .stats-card, .history-card, .detail-current {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel);
}
.row {
  display: grid;
  grid-template-columns: 1.28fr .84fr .84fr .9fr .72fr .96fr 38px;
  gap: 3px; align-items: center; min-height: 42px; padding: 0 7px;
  border-bottom: 1px solid var(--line); font-size: 11.3px;
}
.row:last-child { border-bottom: 0; }
.row span:not(:first-child) { text-align: right; }
.row-link:hover { background: rgba(255,255,255,.025); }
.head { min-height: 33px; color: var(--muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.symbol { font-weight: 800; color: #fff; }
.symbol small { display: block; font-size: 8.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.chev { color: var(--muted); font-size: 19px; line-height: 1; }
.pending, .muted { color: var(--muted); }
.negative { color: var(--down); }
.positive { color: var(--up); }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.notice { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.footnote { margin-top: 8px; color: #728399; font-size: 10px; line-height: 1.45; }

/* Detail page: intentionally no chart and no logo. */
.detail-wrap { width: min(100%, 620px); }
.detail-header { align-items: center; justify-content: flex-start; }
.back { color: var(--accent); font-size: 13px; padding: 8px 4px 8px 0; white-space: nowrap; }
.detail-current { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 10px; }
.detail-current > div { padding: 12px 8px; border-right: 1px solid var(--line); }
.detail-current > div:last-child { border-right: 0; }
.detail-current small, .stats-grid small { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.detail-current strong { font-size: 13px; }
.stats-card, .history-card { margin-top: 10px; }
.stats-card h2, .section-title { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; }
.stats-grid > div { padding: 11px 12px; border-bottom: 1px solid var(--line); }
.stats-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.stats-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.stats-grid strong { font-size: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; }
.section-title span { color: var(--muted); font-size: 10px; }
.history-head, .history-row {
  display: grid; grid-template-columns: 1.1fr .9fr .9fr .9fr .8fr;
  gap: 5px; align-items: center; padding: 0 10px;
}
.history-head { min-height: 31px; color: var(--muted); font-size: 9px; border-bottom: 1px solid var(--line); }
.history-row { min-height: 38px; font-size: 10.5px; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-head span:not(:first-child), .history-row span:not(:first-child) { text-align: right; }

@media (max-width: 430px) {
  .wrap { padding-left: 6px; padding-right: 6px; }
  header { align-items: center; }
  h1 { font-size: 17px; }
  .actions button { padding: 7px 8px; font-size: 11px; }
  .filters { grid-template-columns: auto auto auto; }
  .filters input { grid-column: 1 / -1; }
  #count { display: none; }
  .filters input { font-size: 12px; }
  .row {
    grid-template-columns: 1.19fr .8fr .8fr .86fr .67fr .93fr 34px;
    padding: 0 4px; gap: 2px; font-size: 10.2px;
  }
  .head { font-size: 8.4px; }
  .chev { font-size: 20px; }
  .detail-current strong { font-size: 11.5px; }
  .detail-current > div { padding: 10px 6px; }
  .stats-grid strong { font-size: 11.5px; }
}
.sig-mark { display: inline-flex; width: 8px; height: 8px; margin-right: 2px; align-items: center; justify-content: center; vertical-align: 1px; }
.sig-none { opacity: 0; }
.sig-buy { color: #39e58c; width: 12px; height: 12px; margin-right: 3px; font-size: 10px; line-height: 1; font-weight: 900; text-shadow: 0 0 5px rgba(57, 229, 140, 0.82); }
.sig-wait::before, .sig-over::before { content: ""; display: block; width: 5px; height: 5px; border-radius: 50%; }
.sig-wait::before { background: #ffe100; box-shadow: 0 0 5px rgba(255, 225, 0, 0.85); }
.sig-over::before { background: #ff3048; box-shadow: 0 0 5px rgba(255, 48, 72, 0.85); }
.signal-buy-text { color: #39e58c; font-weight: 800; }
@media (max-width: 430px) {
  .sig-mark { width: 8px; height: 8px; margin-right: 2px; }
  .sig-buy { width: 13px; height: 13px; margin-right: 3px; font-size: 11px; }
  .sig-wait::before, .sig-over::before { width: 5px; height: 5px; }
}
@media (max-width: 430px) {
  .filters { grid-template-columns: auto auto auto auto; }
  .filters input { grid-column: 1 / -1; }
  .filters button { padding-left: 7px; padding-right: 7px; font-size: 10.5px; }
}

/* V6 compact market-risk strip */
.market-strip {
  display: flex; align-items: center; gap: 8px; overflow-x: auto; white-space: nowrap;
  margin: -2px 0 9px; padding: 8px 9px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel); color: var(--muted); font-size: 10.5px;
  scrollbar-width: none;
}
.market-strip::-webkit-scrollbar { display: none; }
.market-strip .market-main { color: var(--text); font-weight: 800; }
.market-green { border-left: 3px solid #39e58c; }
.market-yellow { border-left: 3px solid #ffe100; }
.market-red { border-left: 3px solid #ff3048; }
.market-unknown { border-left: 3px solid #526174; }
@media (max-width: 430px) {
  .market-strip { gap: 7px; padding: 7px 7px; font-size: 9.7px; }
}
/* V6.1 peer/sector comparison summary on stock detail */
.relative-against_group { color: #61d69a; }
.relative-with_group { color: #ffe100; }
.relative-with_market { color: #ff6574; }
.relative-unknown { color: var(--muted); }

/* V7.1 Telegram alerts */
.alerts-wrap { width:min(100%,620px); }
.settings-card, .alert-section { border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--panel); margin-bottom:10px; }
.setting-row, .stock-toggle-row { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:54px; padding:9px 12px; border-bottom:1px solid var(--line); }
.setting-row:last-child, .stock-toggle-row:last-child { border-bottom:0; }
.setting-row span, .stock-toggle-row span { min-width:0; }
.setting-row b, .stock-toggle-row b { display:block; font-size:12px; }
.setting-row small, .stock-toggle-row small { display:block; color:var(--muted); font-size:9.5px; margin-top:2px; }
.setting-row input, .stock-toggle-row input { width:18px; height:18px; accent-color:#39e58c; flex:0 0 auto; }
.alert-search { width:calc(100% - 16px); margin:8px; background:var(--panel2); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:9px 10px; outline:none; }
.stock-toggle-list { max-height:390px; overflow:auto; border-top:1px solid var(--line); }
.alert-log-row { display:flex; justify-content:space-between; align-items:center; gap:10px; min-height:48px; padding:8px 12px; border-bottom:1px solid var(--line); font-size:11px; }
.alert-log-row:last-child { border-bottom:0; }
.alert-log-row b { display:block; }
.alert-log-row small { display:block; color:var(--muted); font-size:9px; margin-top:2px; }

/* V7.2 US core market session / Telegram gate */
.session-strip{margin:8px 0 6px;padding:7px 10px;border:1px solid #263344;border-radius:8px;font-size:12px;font-weight:700;line-height:1.2}
.session-open{color:#ffcf5a;background:#18160e;border-color:#5b4a1f}
.session-closed{color:#7ee7a6;background:#0d1913;border-color:#225b39}

/* V8 Backtest */
.backtest-wrap { width:min(100%,700px); }
.bt-summary { display:grid; grid-template-columns:repeat(3,1fr); border:1px solid var(--line); border-radius:10px; overflow:hidden; background:var(--panel); margin-bottom:10px; }
.bt-summary > div { padding:10px 9px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.bt-summary > div:nth-child(3n) { border-right:0; }
.bt-summary > div:nth-last-child(-n+3) { border-bottom:0; }
.bt-summary small { display:block; color:var(--muted); font-size:9px; margin-bottom:3px; }
.bt-summary strong { font-size:13px; }
.bt-filters { grid-template-columns:1fr auto; }
.bt-row { display:grid; grid-template-columns:1.25fr .55fr .72fr .7fr 1fr 12px; gap:4px; align-items:center; min-height:42px; padding:0 8px; border-bottom:1px solid var(--line); font-size:11px; }
.bt-row:last-child { border-bottom:0; }
.bt-row span:not(:first-child) { text-align:right; }
.bt-head { min-height:32px; color:var(--muted); font-size:9px; font-weight:700; }
.bt-link:hover { background:rgba(255,255,255,.025); }
@media (max-width:430px) {
  .bt-summary { grid-template-columns:repeat(3,1fr); }
  .bt-summary > div { padding:9px 6px; }
  .bt-summary strong { font-size:11.5px; }
  .bt-row { grid-template-columns:1.15fr .48fr .68fr .65fr .92fr 10px; padding:0 4px; gap:2px; font-size:10px; }
  .bt-head { font-size:8.2px; }
}

/* V8.1 auditable backtest trade details */
.bt-trades-card { overflow:hidden; }
.bt-trade-card { padding:9px 10px; border-bottom:1px solid var(--line); font-size:10px; line-height:1.35; }
.bt-trade-card:last-child { border-bottom:0; }
.bt-trade-top { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:8px; margin-bottom:5px; }
.bt-trade-top strong { font-size:11px; }
.bt-trade-top b { text-align:right; font-size:11px; }
.bt-trade-line { display:flex; justify-content:space-between; align-items:center; gap:8px; color:var(--muted); padding:2px 0; }
.bt-trade-line span:last-child { text-align:right; }
.bt-trade-line b { color:var(--text); font-weight:700; }
.bt-trade-note { color:var(--muted); font-size:9px; margin-top:4px; padding-top:4px; border-top:1px dashed rgba(255,255,255,.07); }
@media (max-width:430px) {
  .bt-trade-card { padding:8px 7px; font-size:9.5px; }
  .bt-trade-top { gap:5px; }
  .bt-trade-top strong,.bt-trade-top b { font-size:10px; }
  .bt-trade-note { font-size:8.5px; }
}
.version-tag{font-size:9px;color:var(--muted);font-weight:700;vertical-align:middle}


/* V8.4 Backtest audit status */
.bt-trade-status { margin:-1px 0 5px; min-height:16px; }
.bt-audit { display:inline-flex; align-items:center; min-height:16px; padding:1px 6px; border-radius:999px; font-size:8.5px; font-weight:800; letter-spacing:.01em; border:1px solid var(--line); }
.bt-audit.ready { color:var(--up); border-color:rgba(65,211,142,.28); background:rgba(65,211,142,.07); }
.bt-audit.loading { color:#ffd54a; border-color:rgba(255,213,74,.30); background:rgba(255,213,74,.07); }
.bt-audit.error { color:#ff5a6b; border-color:rgba(255,90,107,.32); background:rgba(255,90,107,.07); }

/* V8.4 realtime zone dwell */
.dwell-note { padding:8px 12px; border-top:1px solid var(--line); color:var(--muted); font-size:9px; line-height:1.4; }


/* V8.4.1 longest zone dwell per day */
.zone-session-row { display:grid; grid-template-columns:82px 1fr auto 34px; gap:8px; align-items:center; padding:9px 12px; border-bottom:1px solid var(--line); font-size:10px; }
.zone-session-row:last-child { border-bottom:0; }
.zone-session-date { color:var(--muted); font-variant-numeric:tabular-nums; }
.zone-session-time { font-variant-numeric:tabular-nums; white-space:nowrap; }
.zone-session-row strong { font-size:11px; white-space:nowrap; }
.zone-source { justify-self:end; font-size:8px; line-height:1; padding:3px 4px; border-radius:4px; border:1px solid var(--line); }
.zone-source.live { color:#47e59a; border-color:rgba(71,229,154,.35); background:rgba(71,229,154,.06); }
.zone-source.approx { color:var(--muted); }
@media (max-width:420px) {
  .zone-session-row { grid-template-columns:70px 1fr auto 30px; gap:5px; padding-left:9px; padding-right:9px; font-size:9px; }
  .zone-session-row strong { font-size:10px; }
}


/* V8.4.2 Binance $30K liquidity dropdown */
.liquidity-toggle {
  width:32px; height:30px; display:inline-flex; align-items:center; justify-content:center;
  justify-self:end; border:1px solid #3a4b61; border-radius:8px;
  background:#182536; color:#d9e6f5; font-size:24px; font-weight:800; line-height:1;
  cursor:pointer; user-select:none; box-shadow:0 1px 4px rgba(0,0,0,.28);
  transition:background .15s ease, border-color .15s ease, color .15s ease, transform .08s ease;
}
.liquidity-toggle:hover, .liquidity-toggle:focus {
  color:#fff; background:#223652; border-color:var(--accent); outline:none;
}
.liquidity-toggle:active { transform:scale(.94); }
.liquidity-toggle.open { color:#fff; background:#24466d; border-color:var(--accent); }
/* V8.4.8: make per-stock Budget/QTY override visible even when the dropdown is closed */
.liquidity-toggle.override {
  color:#ffe100; background:rgba(255,225,0,.10); border-color:rgba(255,225,0,.72);
  box-shadow:0 0 0 1px rgba(255,225,0,.08) inset, 0 1px 4px rgba(0,0,0,.28);
}
.liquidity-toggle.override:hover, .liquidity-toggle.override:focus {
  color:#fff3a0; background:rgba(255,225,0,.18); border-color:#ffe100;
}
.liquidity-toggle.override.open {
  color:#151515; background:#ffe100; border-color:#ffe100;
}
@media (max-width:430px) {
  .liquidity-toggle { width:30px; height:28px; border-radius:7px; font-size:22px; }
}
.liquidity-panel { padding:9px 10px 10px; border-bottom:1px solid var(--line); background:#0d1621; }
.liquidity-grid { display:grid; grid-template-columns:repeat(3,1fr); border:1px solid var(--line); border-radius:8px; overflow:hidden; background:var(--panel); }
.liquidity-grid > div { min-width:0; padding:8px 9px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.liquidity-grid > div:nth-child(3n) { border-right:0; }
.liquidity-grid > div:nth-last-child(-n+1) { border-bottom:0; }
.liquidity-grid small { display:block; color:var(--muted); font-size:8.5px; margin-bottom:2px; }
.liquidity-grid strong { display:block; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.liquidity-profit { grid-column:1 / -1; border-right:0 !important; }
.liquidity-loading, .liquidity-error, .liquidity-warning { padding:7px 8px; font-size:10px; color:var(--muted); }
.liquidity-error { color:var(--down); }
.liquidity-warning { margin-top:6px; border:1px solid rgba(255,225,0,.22); border-radius:7px; color:#ffe100; background:rgba(255,225,0,.04); }
.liq-good { color:var(--up); }
.liq-fair { color:#ffe100; }
.liq-thin { color:var(--down); }
.liq-unknown { color:var(--muted); }
@media (max-width:430px) {
  .liquidity-panel { padding:7px 5px 8px; }
  .liquidity-grid { grid-template-columns:repeat(2,1fr); }
  .liquidity-grid > div { padding:7px 7px; border-right:1px solid var(--line); }
  .liquidity-grid > div:nth-child(3n) { border-right:1px solid var(--line); }
  .liquidity-grid > div:nth-child(2n) { border-right:0; }
  .liquidity-grid strong { font-size:10.5px; }
  .liquidity-profit { grid-column:1 / -1; border-right:0 !important; }
}


.usa-close-status {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}
.usa-close-status.fresh { color: #97d9aa; }
.usa-close-status.stale { color: #ffd36a; }


/* V8.4.7 editable global budget + per-stock budget/QTY override */
.budget-bar { display:flex; align-items:center; gap:6px; margin-top:4px; min-height:27px; color:var(--muted); font-size:10.5px; }
.budget-bar strong { color:#fff; font-size:11.5px; }
.budget-bar > button { padding:4px 8px; border-radius:6px; font-size:9.5px; color:var(--accent); }
.budget-editor { display:inline-flex; align-items:center; gap:4px; }
.budget-editor input { width:98px; min-width:0; padding:5px 6px; border:1px solid var(--line); border-radius:6px; background:#0d1621; color:#fff; font-size:10.5px; }
.budget-editor button { padding:5px 7px; border-radius:6px; font-size:9px; }
.liquidity-control { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:7px; padding:6px 7px; border:1px solid var(--line); border-radius:7px; background:#101b28; font-size:10px; color:var(--muted); }
.liquidity-control strong { color:#fff; margin-left:4px; }
.liquidity-control em { margin-left:5px; color:#71849a; font-size:8.5px; font-style:normal; }
.liquidity-control button { padding:4px 9px; border-radius:6px; font-size:9px; color:var(--accent); white-space:nowrap; }
.trade-editor { display:grid; grid-template-columns:1.15fr .85fr; gap:6px; margin:0 0 7px; padding:7px; border:1px solid #30425a; border-radius:7px; background:#0b141e; }
.trade-editor label { min-width:0; }
.trade-editor label > span { display:block; margin-bottom:3px; color:var(--muted); font-size:8.5px; }
.trade-editor select, .trade-editor input { width:100%; min-width:0; height:30px; padding:5px 7px; border:1px solid var(--line); border-radius:6px; background:var(--panel); color:#fff; font-size:10px; outline:none; }
.trade-editor select:focus, .trade-editor input:focus { border-color:var(--accent); }
.trade-editor input:disabled { opacity:.45; }
.trade-editor-actions { grid-column:1 / -1; display:flex; gap:5px; justify-content:flex-end; }
.trade-editor-actions button { padding:5px 8px; border-radius:6px; font-size:9px; }
.trade-save { border-color:#3b6ba6 !important; }
.trade-reset { color:#ffd36a; }
@media (max-width:430px) {
  .budget-bar { flex-wrap:wrap; gap:4px; }
  .budget-editor { flex:1 1 100%; }
  .budget-editor input { width:92px; }
  .trade-editor { grid-template-columns:1fr; }
  .trade-editor-actions { grid-column:1; justify-content:flex-start; flex-wrap:wrap; }
}

/* V8.4.9 access-code / multi-user */
.user-badge { margin:2px 0 0; color:#8fa4ba; font-size:9.5px; font-weight:700; }
.logout-btn { padding:5px 9px; border-radius:7px; font-size:9px; color:#ffb1b8; border-color:#473039; }
.disabled-link { opacity:.48; pointer-events:none; }
.login-page { min-height:100vh; display:grid; place-items:center; padding:18px; background:#0b1118; color:var(--text); }
.login-card { width:min(100%,360px); padding:24px 20px; border:1px solid var(--line); border-radius:14px; background:var(--panel); box-shadow:0 12px 40px rgba(0,0,0,.28); }
.login-card h1 { margin:0 0 5px; font-size:20px; }
.login-card p { margin:0 0 16px; color:var(--muted); font-size:11px; }
.access-input { width:100%; height:46px; box-sizing:border-box; padding:10px 12px; border:1px solid #34465c; border-radius:9px; background:#0c151f; color:#fff; font-size:20px; letter-spacing:.16em; text-align:center; outline:none; }
.access-input:focus { border-color:var(--accent); }
.login-submit { width:100%; min-height:42px; margin-top:10px; border-radius:9px; font-size:12px; font-weight:800; }
.login-error { min-height:18px; margin-top:10px !important; color:var(--down) !important; }
.admin-users-wrap { width:min(100%,720px); }
.admin-card { margin-bottom:10px; padding:12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.admin-card h2 { margin:0 0 9px; font-size:13px; }
.admin-form-grid { display:grid; grid-template-columns:1.1fr 1fr .8fr auto; gap:6px; align-items:end; }
.admin-form-grid label { min-width:0; }
.admin-form-grid label span { display:block; margin-bottom:3px; color:var(--muted); font-size:8.5px; }
.admin-form-grid input { width:100%; box-sizing:border-box; min-width:0; height:32px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:#0d1621; color:#fff; }
.admin-form-grid button { height:32px; padding:0 10px; border-radius:6px; }
.user-admin-row { display:grid; grid-template-columns:1fr .7fr .8fr auto; gap:7px; align-items:center; padding:8px 0; border-bottom:1px solid var(--line); font-size:10px; }
.user-admin-row:last-child { border-bottom:0; }
.user-admin-row small { display:block; color:var(--muted); font-size:8.5px; margin-top:2px; }
.user-admin-actions { display:flex; gap:4px; justify-content:flex-end; flex-wrap:wrap; }
.user-admin-actions button { padding:4px 7px; border-radius:5px; font-size:8.5px; }
.user-off { opacity:.52; }
.group-editor { display:flex; gap:6px; }
.group-editor input { flex:1; min-width:0; height:34px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:#0d1621; color:#fff; }
@media (max-width:560px) {
  .admin-form-grid { grid-template-columns:1fr 1fr; }
  .admin-form-grid button { grid-column:1 / -1; }
  .user-admin-row { grid-template-columns:1fr auto; }
  .user-admin-row > .user-budget { text-align:right; }
  .user-admin-actions { grid-column:1 / -1; justify-content:flex-start; }
}

/* V8.4.10 Telegram group destination */
.group-label { display:block; margin:8px 0 4px; color:var(--muted); font-size:8.5px; }
.group-chat-row input { font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.group-chat-row button { white-space:nowrap; }
@media (max-width:520px) {
  .group-chat-row { display:grid; grid-template-columns:1fr auto auto; }
  .group-chat-row input { min-width:0; }
}


/* V8.4.11 Data Health */
.health-strip {
  margin: 7px 0 9px; display:flex; align-items:center; gap:6px; overflow-x:auto;
  white-space:nowrap; scrollbar-width:none; padding:6px 7px; border:1px solid var(--line);
  border-radius:9px; background:#0c141d; font-size:9.8px; color:var(--muted);
}
.health-strip::-webkit-scrollbar { display:none; }
.health-title { color:var(--text); font-weight:800; margin-right:1px; }
.health-chip { display:inline-flex; align-items:center; gap:3px; padding:3px 6px; border-radius:999px; border:1px solid #243140; background:#101b26; }
.health-chip b { font-weight:700; color:inherit; }
.health-ok { color:#95d6a8; border-color:#284a35; }
.health-warn { color:#ffd36a; border-color:#5d4a22; }
.health-error { color:#ff6978; border-color:#5f2830; }
@media (max-width:560px) {
  .health-strip { gap:4px; padding:5px 6px; font-size:9.2px; }
  .health-chip { padding:3px 5px; }
}

/* V8.4.12 mobile responsive header/status fix */
@media (max-width: 600px) {
  .wrap {
    width: 100%;
    padding: 10px 8px 34px;
  }

  header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 7px;
    margin-bottom: 9px;
  }

  .title-block {
    width: 100%;
    min-width: 0;
  }

  h1 {
    font-size: 18px;
    line-height: 1.12;
    margin-bottom: 3px;
  }

  #meta,
  #stockMeta,
  .usa-close-status,
  #historyMeta {
    width: 100%;
    max-width: none;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #meta,
  #stockMeta {
    font-size: 10px;
    line-height: 1.35;
  }

  .usa-close-status {
    margin-top: 3px;
    font-size: 10.8px;
    line-height: 1.35;
  }

  #historyMeta.submeta {
    margin-top: 3px;
    font-size: 9.2px;
    line-height: 1.35;
  }

  .budget-bar {
    width: 100%;
    min-height: 25px;
    margin-top: 3px;
  }

  .actions {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1px 0 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .actions::-webkit-scrollbar { display: none; }
  .actions > * { flex: 0 0 auto; }
  .actions button,
  .actions .top-settings-link {
    min-height: 31px;
    padding: 7px 9px;
    font-size: 10.5px;
  }

  .market-strip,
  .health-strip,
  .filters,
  .table-card {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 390px) {
  .wrap { padding-left: 5px; padding-right: 5px; }
  h1 { font-size: 17px; }
  #meta, #stockMeta { font-size: 9.6px; }
  .usa-close-status { font-size: 10.3px; }
  #historyMeta.submeta { font-size: 8.9px; }
  .actions button,
  .actions .top-settings-link { padding: 7px 8px; font-size: 10px; }
}
