:root {
  color-scheme: light;
  --paper: #f2f5f0; --card: #fff; --ink: #162924; --sub: #4d625b; --line: #d9e1db;
  --accent: #086045; --soft: #e4f3e9; --warn: #91500e; --danger: #9c3930; --night: #102822;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
[hidden], .defs { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #3978a7; outline-offset: 3px; }
button:disabled, input:disabled, select:disabled { cursor: default; opacity: .55; }
label { display: grid; gap: .38rem; font-size: .82rem; font-weight: 630; color: var(--sub); }
input, select { color: var(--ink); background: #fff; border: 1px solid #b9c8bf; border-radius: 7px; min-width: 0; padding: .62rem .74rem; width: 100%; }
input:focus, select:focus { border-color: var(--accent); }
button.primary, button.quiet { border: 0; border-radius: 7px; min-height: 38px; padding: .55rem 1rem; font-weight: 660; }
button.primary { background: var(--accent); color: white; }
button.primary:hover:enabled { background: #064832; }
button.quiet { border: 1px solid var(--line); background: transparent; color: inherit; }
button.quiet:hover:enabled { background: #edf1ed; }
.kicker { display: block; font-size: .67rem; font-weight: 800; letter-spacing: .14em; color: #4b6e60; margin-bottom: .46rem; }
.logo, .brand { display: flex; align-items: center; gap: .7rem; font-weight: 760; font-size: 1.27rem; }
.logo svg, .brand svg { width: 35px; height: 24px; color: #7be3ad; }
.login-screen { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(320px,.95fr); min-height: 100vh; }
.intro { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(2.2rem, 6vw, 6rem); background: var(--night); color: #f1f8f3; }
.intro h1 { font-size: clamp(3.4rem, 7vw, 6.2rem); }
.intro .kicker { color: #87d4a7; }
.intro p { max-width: 28rem; margin-top: 1.35rem; font-size: 1.15rem; color: #d5e4d9; }
.footnote { color: #bbcdc1; font-size: .82rem; }
.login-box { display: grid; place-items: center; padding: 2rem; }
.login-box form { display: grid; gap: 1.05rem; max-width: 360px; width: 100%; }
.login-box h2 { font-size: 2.05rem; line-height: 1.1; }
.login-box form>p:not(.alert) { color: var(--sub); }
.login-box .primary { display: flex; align-items: center; justify-content: space-between; }
.bar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem max(4vw, calc((100vw - 1250px)/2)); background: var(--night); color: #f3f7f1; }
.brand small { font-size: .82rem; font-weight: 510; padding-left: .7rem; border-left: 1px solid #627c71; color: #d5e6da; }
.user, .sync { display: flex; align-items: center; gap: .7rem; }
.user span, .sync { font-size: .8rem; }
.bar .quiet { color: #f1f6f1; border-color: #4b665b; min-height: 32px; }
.bar .quiet:hover:enabled { background: #254337; }
.desk-content { max-width: 1320px; margin: auto; padding: clamp(1.3rem,4vw,3.4rem) clamp(.9rem,3.2vw,3.3rem) 1.8rem; }
.page-title, .card-head, .account-head, footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.page-title { align-items: end; margin-bottom: 1.5rem; }
.sync { color: var(--sub); }
.context { display: flex; align-items: end; gap: 1rem; padding: 1rem 1.15rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.context label { min-width: min(195px,29%); }
.context-broker { margin: auto 0 auto auto; display: grid; gap: .25rem; text-align: right; }
.context small, .metrics small, .prices small { font-size: .76rem; color: var(--sub); }
.tabs { display: flex; margin: .6rem 0 1.45rem; border-bottom: 1px solid var(--line); gap: .7rem; }
.tabs button { color: var(--sub); border: 0; border-radius: 0; background: transparent; font-weight: 650; padding: .78rem .35rem; border-bottom: 3px solid transparent; }
.tabs [aria-current=page] { color: var(--accent); border-bottom-color: var(--accent); }
.account-head { margin-bottom: .8rem; }
.account-head .kicker, .card-head .kicker { margin-bottom: .2rem; }
.metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1rem; }
.metrics>div { padding: 1.05rem .9rem; display: grid; align-content: start; gap: .32rem; border-right: 1px solid var(--line); }
.metrics>div:last-child { border: none; }
.metrics strong, .prices strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics strong { font-size: clamp(1rem,1.7vw,1.4rem); }
.pill, .tag { display: inline-block; border-radius: 20px; font-size: .75rem; padding: .2rem .65rem; background: #eaf0ec; color: #465d51; white-space: nowrap; }
.pill[data-kind=good] { background: var(--soft); color: var(--accent); }
.pill[data-kind=warn] { background: #fff0d9; color: var(--warn); }
.pill[data-kind=bad] { background: #ffebe6; color: var(--danger); }
.trade-grid, .manager-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 1rem; }
.card { min-width: 0; padding: 1.15rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.card-head { margin-bottom: .9rem; }
.spaced { margin-top: 1rem; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: .8rem 0 1rem; }
.prices>div { display: grid; gap: .32rem; padding: .9rem; border-radius: 8px; background: #f1f6f1; }
.prices strong { font-size: clamp(1.4rem,2.8vw,2.2rem); letter-spacing: -.032em; }
.facts { margin: .15rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: .76rem 1rem; }
.facts div { display: grid; }
.facts dt, .help { font-size: .78rem; color: var(--sub); }
.facts dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
#trade { display: grid; gap: .8rem; }
.side { display: flex; padding: 0; border: none; margin: 0; position: relative; }
.side label { display: block; width: 50%; text-align: center; }
.side input { position: absolute; opacity: 0; width: 1px; }
.side span { display: block; padding: .57rem; cursor: pointer; border: 1px solid var(--line); }
.side label:first-of-type span { border-radius: 7px 0 0 7px; }
.side label:last-of-type span { border-radius: 0 7px 7px 0; }
.side input:checked+span { background: var(--soft); color: var(--accent); border-color: #73b391; }
.side label:last-of-type input:checked+span { background: #faeae5; color: #9b4733; border-color: #cfac9f; }
.side input:focus-visible+span { outline: 3px solid #3978a7; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .48rem; border-bottom: 1px solid #e1e7e1; text-align: left; vertical-align: middle; }
th { color: var(--sub); font-weight: 650; }
td { white-space: nowrap; }
.empty { padding: .65rem 0; color: var(--sub); font-size: .88rem; }
.alert { padding: .75rem .9rem; margin-bottom: 1rem; border-radius: 7px; background: var(--soft); color: #155439; }
.alert[data-error=true] { background: #fae8e3; color: var(--danger); }
#feed { color: var(--sub); }
#feed-symbols { margin-top: .65rem; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; align-items: end; margin: 1rem 0; }
.form-grid .wide, .form-grid .help { grid-column: 1/-1; }
details { border-top: 1px solid var(--line); }
summary { padding: .82rem 0; font-weight: 650; cursor: pointer; }
.pager, .dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; align-items: center; margin-top: 1rem; }
footer { margin: 1.3rem 0 0; color: var(--sub); font-size: .8rem; }
a { color: var(--accent); }
dialog { padding: 1.5rem; max-width: min(430px, 90vw); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px #132c2629; }
dialog::backdrop { background: #132c267a; }
dialog p { margin: .75rem 0; }
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .metrics>div:nth-child(3n) { border-right: 0; }
  .metrics>div:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .trade-grid, .manager-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .login-screen { display: flex; flex-direction: column; }
  .intro { padding: 1.55rem; gap: 1.4rem; }
  .intro h1 { font-size: 2.7rem; }
  .intro p { font-size: .95rem; margin-top: .65rem; }
  .footnote { display: none; }
  .login-box { padding: 1.5rem; }
  .bar { padding: .55rem .8rem; }
  .brand small { display: none; }
  .page-title { align-items: start; }
  .page-title h1 { font-size: 2rem; }
  .sync { flex-direction: column; align-items: end; white-space: nowrap; }
  .context { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
  .context-broker { display: none; }
  .tabs { justify-content: space-between; gap: .25rem; }
  .tabs button { font-size: .83rem; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics>div { border-bottom: 1px solid var(--line); }
  .metrics>div:nth-child(2n) { border-right: 0; }
  .metrics>div:nth-child(3) { border-right: 1px solid var(--line); }
  .metrics>div:nth-last-child(-n+2) { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
}

.setup { background: #e7eeeb; border-left: 3px solid var(--accent); padding: .7rem .9rem; margin-bottom: 1rem; }
footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }

.chart-legend { display:flex; gap:.85rem; white-space:nowrap; color:var(--sub); font-size:.8rem; }
.chart-legend span:before { content:""; display:inline-block; width:1rem; height:3px; background:#13765e; vertical-align:middle; margin-right:.3rem; }
.chart-legend span:last-child:before { background:#b55b35; }
.quote-chart svg { display:block; width:100%; min-height:145px; }
.quote-chart svg text { font-size:12px; fill:var(--sub); }
.quote-chart .gridline { stroke:#d8e1d9; stroke-dasharray:4 4; }
.quote-chart .series { stroke-width:2.1; }
.quote-chart .series.bid { stroke:#13765e; }
.quote-chart .series.ask { stroke:#b55b35; }
.quote-chart .dot.bid { fill:#13765e; }
.quote-chart .dot.ask { fill:#b55b35; }
#quote-caption { padding-top:.5rem; }
