/* StockAnalyzerPHP — "Terminal Noir": a trading-desk instrument panel.
   One loud element (the recommendation gauge), everything else quiet and exact. */

:root {
  --void: #05080d;
  --panel: #0b1119;
  --panel-2: #0f1722;
  --rule: #1a2431;
  --rule-strong: #263344;
  --ink: #e4eaf2;
  --dim: #7c8a9b;
  --faint: #4f5d6e;
  --amber: #ffb000;
  --amber-soft: rgba(255, 176, 0, .12);
  --bull: #2bd47f;
  --bull-2: #8fdc4f;
  --hold: #8a97a8;
  --bear-2: #ff8a3d;
  --bear: #ff4d5e;
  --positive: var(--bull);
  --negative: var(--bear);

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 14px;
  --rail: 68px;
  font-size: 15px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  color: var(--ink);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
a { color: var(--amber); }
::selection { background: var(--amber); color: #000; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
kbd {
  font-family: var(--mono); font-size: .72rem; color: var(--dim);
  border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: var(--r-sm);
  padding: .05rem .35rem; background: var(--panel-2);
}

/* --- login ------------------------------------------------------------------ */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  position: relative; overflow: hidden;
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--void);
}
.login-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 45%, transparent 0%, var(--void) 85%);
}
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 380px;
  background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r-lg);
  padding: 2rem 2rem 1.6rem; display: flex; flex-direction: column; gap: 1rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.login-mark { color: var(--amber); }
.login-title { margin: 0; font-size: 1.9rem; font-variation-settings: "wdth" 125; font-weight: 800; letter-spacing: -.01em; }
.login-sub { margin: -.4rem 0 .4rem; color: var(--dim); font-size: .93rem; }
.login-error { color: var(--bear); font-size: .9rem; margin: 0; }

/* --- shell -------------------------------------------------------------------- */

.app { min-height: 100vh; display: flex; }
.app.is-logged-out { display: block; }
.rail {
  position: sticky; top: 0; height: 100vh; width: var(--rail); flex: 0 0 var(--rail);
  display: flex; flex-direction: column; align-items: center; gap: 1.4rem;
  padding: 1rem 0; border-right: 1px solid var(--rule); background: var(--void); z-index: 5;
}
.rail-mark { color: var(--amber); display: grid; place-items: center; width: 40px; height: 40px; }
.rail-nav { display: flex; flex-direction: column; gap: .35rem; }
.nav-item, .rail-btn {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r); color: var(--dim); background: transparent; border: 0; cursor: pointer;
  text-decoration: none;
}
.nav-item:hover, .rail-btn:hover { color: var(--ink); background: var(--panel-2); }
.nav-item.active { color: var(--amber); background: var(--amber-soft); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--amber);
}
.nav-item .tip {
  position: absolute; left: 54px; white-space: nowrap; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--rule-strong); color: var(--ink);
  font-size: .82rem; padding: .25rem .55rem; border-radius: var(--r-sm);
  opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s;
}
.nav-item:hover .tip, .nav-item:focus-visible .tip { opacity: 1; transform: none; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.key-status { display: flex; flex-direction: column; gap: .45rem; }
.key-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: block; }
.key-dot.on { background: var(--bull); box-shadow: 0 0 8px rgba(43, 212, 127, .6); }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 1rem;
  padding: .75rem 2rem; background: rgba(5, 8, 13, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.command {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: .7rem;
  background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r);
  color: var(--dim); padding: .55rem .7rem; font: inherit; cursor: text; text-align: left;
}
.command:hover { border-color: var(--faint); color: var(--ink); }
.command-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { margin-left: auto; color: var(--dim); font-size: .88rem; white-space: nowrap; }
.topbar-user strong { color: var(--ink); font-weight: 600; }

.main { width: 100%; max-width: 1320px; padding: 1.8rem 2rem 4rem; }
.page-title {
  margin: 0 0 .3rem; font-size: 1.9rem; font-weight: 800; letter-spacing: -.01em;
  font-variation-settings: "wdth" 118;
}
.page-sub { margin: 0 0 1.6rem; color: var(--dim); max-width: 68ch; }

/* --- palette ----------------------------------------------------------------------- */

dialog.palette {
  width: min(620px, calc(100vw - 2rem)); max-width: none; margin: 12vh auto auto; padding: 0;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule-strong);
  border-radius: var(--r-lg); box-shadow: 0 40px 120px rgba(0, 0, 0, .75);
}
dialog.palette[open] { animation: palette-in .16s ease-out; }
@keyframes palette-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
dialog::backdrop { background: rgba(2, 4, 8, .7); backdrop-filter: blur(3px); }
.palette-form { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--rule); }
.palette-prompt { color: var(--amber); font-family: var(--mono); font-size: 1.4rem; line-height: 1; }
.palette-form input {
  flex: 1; background: transparent; border: 0; outline: 0; color: var(--ink);
  font-family: var(--mono); font-size: 1.25rem; text-transform: uppercase; letter-spacing: .02em; padding: .2rem 0;
}
.palette-form input::placeholder { text-transform: none; color: var(--faint); font-family: var(--font); font-size: 1.05rem; letter-spacing: 0; }
.palette-form input:focus { border: 0; box-shadow: none; }
.palette-list { max-height: 360px; overflow: auto; padding: .4rem; }
.palette-group { color: var(--faint); font-size: .78rem; padding: .55rem .7rem .3rem; }
.palette-item {
  display: grid; grid-template-columns: 7.5rem 1fr auto; align-items: center; gap: .8rem;
  padding: .55rem .7rem; border-radius: var(--r); cursor: pointer; color: var(--ink);
}
.palette-item.active { background: var(--amber-soft); }
.palette-item.active .palette-sym { color: var(--amber); }
.palette-sym { font-family: var(--mono); font-weight: 600; }
.palette-meta { color: var(--dim); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-foot { display: flex; gap: 1.2rem; padding: .6rem 1.1rem; border-top: 1px solid var(--rule); color: var(--faint); font-size: .78rem; }
.palette-foot kbd { margin-right: .2rem; }

/* --- controls --------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }
.field > span { color: var(--dim); }
input[type="text"], input[type="password"], input[type="search"], select, textarea, .select {
  background: var(--void); border: 1px solid var(--rule-strong); border-radius: var(--r);
  color: var(--ink); padding: .55rem .65rem; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
input[type="range"] { accent-color: var(--amber); width: 100%; }
input[type="file"] { color: var(--dim); font: inherit; font-size: .85rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid var(--rule-strong); background: var(--panel-2); color: var(--ink);
  border-radius: var(--r); padding: .55rem .95rem; font: inherit; font-weight: 500; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--faint); background: #142030; }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { flex: 0 0 auto; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: #120c00; font-weight: 650; }
.btn-primary:hover { background: #ffc233; border-color: #ffc233; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bear); border-color: rgba(255, 77, 94, .35); background: transparent; }
.btn-danger:hover { background: rgba(255, 77, 94, .1); border-color: var(--bear); }
.btn-block { width: 100%; }
.btn-sm { padding: .32rem .65rem; font-size: .84rem; }

/* --- generic surfaces ------------------------------------------------------------------ */

.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.2rem 1.35rem; }
.card h3 { margin: 0 0 .7rem; font-size: 1.02rem; font-weight: 650; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: .7rem; flex-wrap: wrap; align-items: center; }
.grid-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.badge { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .76rem; font-weight: 600; }
.badge-ok { background: rgba(43, 212, 127, .12); color: var(--bull); }
.badge-error { background: rgba(255, 77, 94, .12); color: var(--bear); }
.badge-muted { background: var(--panel-2); color: var(--dim); }
.note {
  border: 1px solid var(--rule-strong); border-left: 3px solid var(--amber); background: var(--panel);
  padding: .6rem .85rem; border-radius: var(--r); font-size: .9rem; color: var(--ink);
}
.note-warn { border-left-color: var(--bear-2); }
.muted { color: var(--dim); }
.small { font-size: .84rem; }
.mono { font-family: var(--mono); font-size: .88em; }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .9em; }
.pos { color: var(--positive); }
.neg { color: var(--negative); }
.hidden { display: none !important; }
.empty-hint { color: var(--dim); border: 1px dashed var(--rule-strong); border-radius: var(--r-lg); padding: 2rem; text-align: center; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block; vertical-align: -3px;
  border: 2px solid var(--rule-strong); border-top-color: var(--amber); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- tabs --------------------------------------------------------------------------------- */

.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--rule); margin: 0 0 1.2rem; overflow-x: auto; scrollbar-width: none; }
.tab {
  border: 0; background: transparent; padding: .65rem .9rem; font: inherit; color: var(--dim);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--amber); font-weight: 600; }

/* --- tables --------------------------------------------------------------------------------- */

table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: left; font-weight: 500; font-size: .8rem; color: var(--faint);
  border-bottom: 1px solid var(--rule-strong); padding: .5rem .6rem;
}
table.data th.num { text-align: right; font-family: var(--font); }
table.data td { border-bottom: 1px solid var(--rule); padding: .55rem .6rem; vertical-align: top; }
table.data tr:hover td { background: rgba(255, 255, 255, .015); }
table.data a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
table.data a:hover { color: var(--amber); border-color: var(--amber); }
.table-wrap { overflow-x: auto; }

/* --- analysis: hero ----------------------------------------------------------------------- */

.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 1.2rem;
}
.hero > * { background: var(--panel); }
.quote { padding: 1.6rem 1.7rem 1.4rem; display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.quote-head { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.quote-symbol {
  font-family: var(--font); font-variation-settings: "wdth" 125; font-weight: 800;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: .95; letter-spacing: -.02em; margin: 0;
}
.quote-name { color: var(--dim); font-size: 1.05rem; }
.quote-price { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; }
.quote-last { font-family: var(--mono); font-size: 2rem; font-weight: 500; letter-spacing: -.02em; }
.quote-ccy { color: var(--dim); font-family: var(--mono); font-size: 1rem; margin-left: .3rem; }
.quote-chg { font-family: var(--mono); font-size: 1rem; padding: .15rem .5rem; border-radius: var(--r-sm); }
.quote-chg.pos { background: rgba(43, 212, 127, .1); }
.quote-chg.neg { background: rgba(255, 77, 94, .1); }
.quote-date { color: var(--faint); font-size: .85rem; }
.perf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); padding-top: 1rem; gap: .6rem; }
.perf-cell .k { color: var(--faint); font-size: .8rem; }
.perf-cell .v { font-family: var(--mono); font-size: 1.02rem; margin-top: .1rem; }
.range { display: flex; flex-direction: column; gap: .4rem; }
.range-track { position: relative; height: 6px; border-radius: 3px; background: linear-gradient(90deg, rgba(255, 77, 94, .45), var(--rule-strong) 50%, rgba(43, 212, 127, .45)); }
.range-pin {
  position: absolute; top: 50%; width: 3px; height: 16px; border-radius: 2px; background: var(--ink);
  transform: translate(-50%, -50%); box-shadow: 0 0 0 3px var(--panel);
}
.range-legend { display: flex; justify-content: space-between; color: var(--faint); font-size: .8rem; font-family: var(--mono); }
.range-legend span:nth-child(2) { font-family: var(--font); }

.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }

/* --- analysis: gauge (the one loud element) ---------------------------------------------- */

.verdict { padding: 1.4rem 1.5rem 1.3rem; display: flex; flex-direction: column; align-items: center; position: relative; }
.gauge { width: 100%; max-width: 380px; display: block; overflow: visible; }
.gauge .band { fill: none; stroke-width: 18; }
.gauge .tick { stroke: var(--void); stroke-width: 3; }
.gauge .scale-label { fill: var(--faint); font-family: var(--mono); font-size: 10px; }
.gauge .needle { transform-origin: 160px 170px; transform: rotate(-90deg); transition: transform 1.5s cubic-bezier(.22, 1.35, .36, 1); }
.gauge .needle-line { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.gauge .hub { fill: var(--panel); stroke: var(--ink); stroke-width: 3; }
.verdict-label {
  margin-bottom: .1rem;
  margin-top: .35rem; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 2rem;
  letter-spacing: -.01em; color: var(--verdict, var(--ink));
}
.verdict-meta { display: flex; gap: 1.4rem; margin-top: .5rem; color: var(--dim); font-size: .88rem; }
.verdict-meta b { color: var(--ink); font-family: var(--mono); font-weight: 500; margin-left: .3rem; }
.confidence { width: 100%; max-width: 300px; margin-top: .9rem; }
.confidence-track { height: 4px; border-radius: 2px; background: var(--rule-strong); overflow: hidden; }
.confidence-fill { height: 100%; width: 0; background: var(--ink); transition: width 1.2s .3s cubic-bezier(.2, .8, .2, 1); }
.confidence-legend { display: flex; justify-content: space-between; color: var(--faint); font-size: .78rem; margin-top: .3rem; }

/* --- analysis: drivers ----------------------------------------------------------------------- */

.drivers { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 1.2rem; margin-bottom: 1.6rem; }
.contrib { padding: 1.2rem 1.35rem; }
.contrib-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .9rem; }
.contrib-head h3 { margin: 0; }
.contrib-axis { display: grid; grid-template-columns: 9.5rem 1fr 4.2rem; color: var(--faint); font-size: .76rem; margin-bottom: .2rem; }
.contrib-axis .ends { display: flex; justify-content: space-between; }
.contrib-row { display: grid; grid-template-columns: 9.5rem 1fr 4.2rem; align-items: center; gap: 0; padding: .42rem 0; border-top: 1px solid var(--rule); }
.contrib-name { font-size: .9rem; }
.contrib-name small { display: block; color: var(--faint); font-size: .76rem; font-family: var(--mono); }
.contrib-track { position: relative; height: 22px; }
.contrib-track::before { content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px; width: 1px; background: var(--rule-strong); }
.contrib-bar {
  position: absolute; top: 4px; height: 14px; width: 0; border-radius: 2px;
  transition: width 1.1s cubic-bezier(.2, .8, .2, 1);
}
.contrib-bar.up { left: 50%; background: var(--bull); }
.contrib-bar.down { right: 50%; background: var(--bear); }
.contrib-val { text-align: right; font-family: var(--mono); font-size: .88rem; }
.contrib-row.missing .contrib-name { color: var(--faint); }
.contrib-row.missing .contrib-val { color: var(--faint); font-family: var(--font); font-size: .8rem; }

.signals { padding: 1.2rem 1.35rem; display: flex; flex-direction: column; gap: .7rem; }
.signals h3 { margin: 0; }
.signal-line { display: flex; gap: .6rem; font-size: .9rem; line-height: 1.45; }
.signal-line::before { content: ""; flex: 0 0 6px; height: 6px; margin-top: .5em; border-radius: 50%; background: var(--amber); }
.signal-line.warn::before { background: var(--bear-2); }
.signal-line.ok::before { background: var(--bull); }

/* --- analysis: pipeline ---------------------------------------------------------------------- */

.run-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 2rem; }
.run-head .quote-symbol { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.run-clock { font-family: var(--mono); color: var(--dim); }
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.stage { position: relative; padding: 1rem 1rem 1.2rem 0; }
.stage::before {
  content: ""; position: absolute; left: 22px; right: 0; top: 30px; height: 2px; background: var(--rule-strong);
}
.stage::after {
  content: ""; position: absolute; left: 22px; top: 30px; height: 2px; width: 0; background: var(--amber);
  transition: width .5s ease-out;
}
.stage.ok::after, .stage.error::after { width: calc(100% - 22px); }
.stage.ok::after { background: var(--bull); }
.stage.error::after { background: var(--bear); }
.stage:nth-child(5n)::before, .stage:nth-child(5n)::after, .stage:last-child::before, .stage:last-child::after { display: none; }
.stage-node {
  position: relative; z-index: 1; width: 30px; height: 30px; border-radius: 50%; margin-left: 7px;
  border: 2px solid var(--rule-strong); background: var(--void); display: grid; place-items: center;
  color: var(--faint); font-family: var(--mono); font-size: .72rem; transition: border-color .2s, color .2s, background .2s;
}
.stage-name { margin-top: .7rem; font-size: .92rem; color: var(--dim); transition: color .2s; }
.stage-detail { margin-top: .2rem; font-size: .78rem; color: var(--faint); font-family: var(--mono); min-height: 1.1em; overflow-wrap: anywhere; }
.stage.running .stage-node { border-color: var(--amber); color: var(--amber); animation: pulse 1.1s ease-in-out infinite; }
.stage.running .stage-name { color: var(--ink); }
.stage.ok .stage-node { border-color: var(--bull); background: var(--bull); color: #03140a; }
.stage.ok .stage-name { color: var(--ink); }
.stage.error .stage-node { border-color: var(--bear); background: var(--bear); color: #1a0306; }
.stage.error .stage-name { color: var(--bear); }
.stage.error .stage-detail { color: var(--bear); opacity: .85; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 176, 0, .45); } 50% { box-shadow: 0 0 0 8px rgba(255, 176, 0, 0); } }
.run-error { margin-top: 1.6rem; }

/* --- analysis: start screen -------------------------------------------------------------------- */

.launch { padding: 3.5rem 0 2.5rem; max-width: 720px; }
.launch h1 { font-variation-settings: "wdth" 125; font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.02em; margin: 0 0 1rem; }
.launch p { color: var(--dim); font-size: 1.05rem; max-width: 56ch; margin: 0 0 1.8rem; }
.launch-form { display: flex; gap: .6rem; max-width: 520px; }
.launch-form input { font-family: var(--mono); font-size: 1.15rem; text-transform: uppercase; padding: .75rem .9rem; }
.launch-form input::placeholder { text-transform: none; font-family: var(--font); font-size: 1rem; }
.launch-form .btn { padding: .75rem 1.3rem; }
.section-title { font-size: 1rem; font-weight: 650; margin: 2.2rem 0 .8rem; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.tile {
  display: flex; flex-direction: column; gap: .5rem; text-align: left; cursor: pointer;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 1rem 1.1rem; color: var(--ink); font: inherit; border-left: 3px solid var(--tone, var(--rule-strong));
}
.tile:hover { border-color: var(--rule-strong); border-left-color: var(--tone, var(--faint)); background: var(--panel-2); }
.tile-sym { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; }
.tile-label { color: var(--tone, var(--dim)); font-weight: 600; font-size: .9rem; }
.tile-meta { color: var(--faint); font-size: .8rem; display: flex; justify-content: space-between; font-family: var(--mono); }

/* --- report and charts ------------------------------------------------------------------------- */

.report { line-height: 1.65; font-size: .97rem; }
.report p, .report li, .report blockquote { max-width: 78ch; }
.report h1 { font-size: 1.4rem; margin: 0 0 .3rem; font-variation-settings: "wdth" 112; }
.report h2 { font-size: 1.1rem; margin: 2rem 0 .5rem; color: var(--amber); font-weight: 650; }
.report h3 { font-size: 1rem; margin: 1.4rem 0 .4rem; }
.report p { margin: .55rem 0; }
.report ul { margin: .4rem 0; padding-left: 1.2rem; }
.report li { margin: .2rem 0; }
.report li::marker { color: var(--faint); }
.report img { max-width: 100%; border-radius: var(--r); margin: .6rem 0; }
.report table { border-collapse: collapse; margin: .7rem 0; font-size: .88rem; display: block; overflow-x: auto; }
.report th, .report td { border-bottom: 1px solid var(--rule); padding: .4rem .6rem; text-align: left; }
.report th { color: var(--faint); font-weight: 500; border-bottom-color: var(--rule-strong); }
.report blockquote { border-left: 2px solid var(--amber); margin: .8rem 0; padding: .2rem 1rem; color: var(--dim); }
.report code { font-family: var(--mono); background: var(--panel-2); border-radius: var(--r-sm); padding: 0 .3rem; font-size: .86em; }
.report hr { border: 0; border-top: 1px solid var(--rule); margin: 1.5rem 0; }
.report a { color: var(--ink); text-decoration-color: var(--faint); }
.report a:hover { color: var(--amber); }
/* server-rendered charts are white PNGs: flip lightness, keep hues */
.chart-img, .report img { filter: invert(.92) hue-rotate(180deg) saturate(1.3); background: #fff; }
.chart-frame { padding: .6rem; }
.chart-frame img { width: 100%; display: block; border-radius: var(--r); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .45rem; }
.reasons li { display: flex; gap: .6rem; font-size: .92rem; }
.reasons li::before { content: ""; flex: 0 0 6px; height: 6px; margin-top: .5em; background: var(--faint); border-radius: 50%; }
.kv { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: baseline; }
.kv div { color: var(--dim); font-size: .88rem; }
.kv b { display: block; color: var(--ink); font-family: var(--mono); font-weight: 500; font-size: 1.15rem; }
.news-item { display: grid; grid-template-columns: 10px 1fr; gap: .2rem .8rem; padding: .8rem 0; border-top: 1px solid var(--rule); }
.news-item:first-of-type { border-top: 0; }
.news-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: .45em; background: var(--hold); }
.news-dot.positive { background: var(--bull); }
.news-dot.negative { background: var(--bear); }
.news-item a { color: var(--ink); text-decoration: none; font-weight: 500; }
.news-item a:hover { color: var(--amber); }
.news-meta { grid-column: 2; color: var(--faint); font-size: .8rem; }
.news-point { grid-column: 2; color: var(--dim); font-size: .88rem; }
pre.mono { background: var(--void); border: 1px solid var(--rule); border-radius: var(--r); padding: 1rem; color: var(--dim); }

/* --- settings ----------------------------------------------------------------------------------- */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.settings-section h3 { margin: 0 0 .6rem; font-size: 1.05rem; }
.settings-section h3 + p { margin-top: -.3rem; }
.color-input { display: flex; align-items: center; gap: .6rem; }
.color-input input[type="color"] { width: 44px; height: 34px; border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 2px; background: var(--void); }
.slider-row { display: grid; grid-template-columns: 11rem 1fr 3.2rem; gap: .9rem; align-items: center; font-size: .92rem; margin: .55rem 0; }
.slider-row output { color: var(--ink); font-family: var(--mono); text-align: right; font-size: .88rem; }
.toggle { display: flex; align-items: center; gap: .7rem; padding: .45rem 0; font-size: .94rem; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--amber); }
.model-pick { display: flex; flex-direction: column; gap: .3rem; margin: .5rem 0 1rem; }
.model-pick .hint { font-size: .78rem; color: var(--faint); }
.model-pick > div[style*="max-height"] { background: var(--void); border-color: var(--rule-strong) !important; }
.model-option { border-bottom-color: var(--rule) !important; }
.model-option:hover { background: var(--amber-soft); }
.logo-preview { max-height: 84px; max-width: 220px; border: 1px solid var(--rule-strong); border-radius: var(--r); padding: 6px; background: #fff; }

/* --- admin usage bars ------------------------------------------------------------------------------ */

.bars { display: flex; align-items: flex-end; gap: .45rem; height: 150px; padding-top: .4rem; border-bottom: 1px solid var(--rule-strong); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 0; }
.bar { width: 100%; max-width: 48px; background: var(--amber); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar-col .bar-label { font-size: .72rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-family: var(--mono); }

dialog:not(.palette) {
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule-strong);
  border-radius: var(--r-lg); padding: 1.2rem 1.4rem; max-width: 460px;
}

/* --- responsive & motion ----------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .hero, .drivers { grid-template-columns: 1fr; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage:nth-child(5n)::before, .stage:nth-child(5n)::after { display: block; }
  .stage:nth-child(2n)::before, .stage:nth-child(2n)::after { display: none; }
}
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .rail {
    position: sticky; top: 0; height: auto; width: 100%; flex: 0 0 auto; flex-direction: row;
    padding: .5rem 1rem; border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .rail-nav { flex-direction: row; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; }
  .key-status { flex-direction: row; }
  .nav-item.active::before { display: none; }
  .nav-item .tip { display: none; }
  .topbar { position: static; padding: .7rem 1rem; }
  .topbar-user, .command-kbd { display: none; }
  .main { padding: 1.2rem 1rem 3rem; }
  .perf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contrib-axis, .contrib-row { grid-template-columns: 7rem 1fr 3.6rem; }
  .launch-form { flex-direction: column; }
  .slider-row { grid-template-columns: 1fr 3rem; }
  .slider-row > :first-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* gauge band emphasis once the needle has landed */
.gauge .band { transition: opacity .6s .9s, filter .6s .9s; }
.verdict.is-live .band.dim { opacity: .22; }
.verdict.is-live .band.active { filter: drop-shadow(0 0 7px currentColor); }
