:root {
  --bg: #07090b; --panel: #0e1216; --fg: #e7ebee; --muted: #9aa6ae;
  --line: #1f272d; --ember: #ff7a3d; --ice: #b9d6e6; --aurora: #3fb39a; --bad: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 52rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
a { color: var(--ice); }
main > pre { max-width: 100%; overflow-x: auto; padding: 1rem; background: var(--panel);
             border: 1px solid var(--line); border-radius: 6px; }
#api-key { flex: 1 1 22rem; min-width: 0; max-width: 100%; font-family: ui-monospace, monospace; }
#copy-status { display: block; margin-top: 0.5rem; color: var(--ice); }
.brand { letter-spacing: 0.3em; color: var(--ember); font-weight: 600; margin: 0 0 2.5rem; }
.brand span { color: var(--muted); letter-spacing: 0.1em; font-weight: 400; margin-left: 0.5rem; }
h1 { color: var(--ice); font-size: 1.8rem; margin: 0 0 0.5rem; }
h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ember); margin: 2.5rem 0 0.75rem; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.notice { background: var(--panel); border-left: 3px solid var(--aurora); padding: 0.75rem 1rem; border-radius: 6px; }
form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
input { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 6px;
        padding: 0.6rem 0.75rem; font: inherit; }
#link-key { flex: 1 1 18rem; font-family: ui-monospace, monospace; }
#switch-account { flex: 1 1 10rem; min-width: 0; max-width: 100%; }
#amount { width: 8rem; }
form.stack { flex-direction: column; align-items: stretch; }
.inline { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
select, textarea { background: var(--panel); color: var(--fg); border: 1px solid var(--line);
                   border-radius: 6px; padding: 0.6rem 0.75rem; font: inherit; }
textarea { width: 100%; resize: vertical; }
button:disabled { opacity: 0.5; cursor: wait; }
details { margin: 0; }
summary { cursor: pointer; margin-bottom: 0.4rem; }
.small { font-size: 0.85rem; margin: 0.3rem 0 0; }
.answer { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--aurora);
          border-radius: 6px; padding: 0.25rem 1rem; margin: 0.75rem 0 0.25rem; color: var(--fg);
          overflow-wrap: anywhere; }
.answer.streaming { white-space: pre-wrap; padding: 1rem; }
.answer h3, .answer h4, .answer h5 { color: var(--ice); margin: 1rem 0 0.4rem; }
.answer h3 { font-size: 1.25rem; }
.answer h4 { font-size: 1.1rem; }
.answer h5 { font-size: 1rem; }
.answer strong { color: var(--ice); font-weight: 700; }
.answer p { margin: 0.6rem 0; }
.answer code { font-family: ui-monospace, monospace; font-size: 0.9em; background: var(--bg);
               border-radius: 4px; padding: 0.05rem 0.3rem; }
.answer pre { background: var(--bg); border-radius: 6px; padding: 0.75rem; overflow-x: auto; }
.answer pre code { padding: 0; background: none; }
.answer table { margin: 0.6rem 0; }
.answer td, .answer th { white-space: normal; }
.answer hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.answer a { color: var(--ember); }
button, a.button { background: var(--ember); color: #1a0c05; border: 0; border-radius: 6px; padding: 0.6rem 1rem;
         font: inherit; font-weight: 600; cursor: pointer; }
a.button { display: inline-block; text-decoration: none; }
button.link { background: none; color: var(--muted); padding: 0; font-weight: 400; text-decoration: underline; }
.row { display: flex; flex-wrap: wrap; gap: 1rem 3rem; }
.label { color: var(--muted); font-size: 0.85rem; margin: 0; }
.value { margin: 0.2rem 0 0; color: var(--ice); }
.big { font-size: 1.6rem; font-weight: 600; }
.scroll { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; }
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 999px;
        padding: 0.1rem 0.7rem; background: var(--panel); }
.pill .enforced { color: var(--muted); }
.routing { background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
           padding: 0.5rem 1rem; margin: 0.5rem 0; }
.routing dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1.25rem; margin: 0.25rem 0; }
.routing dt { color: var(--muted); }
.routing dd { margin: 0; }
.routing code { font-family: ui-monospace, monospace; font-size: 0.85rem; }
.routing .selected { color: var(--aurora); }
.routing .refused { color: var(--bad); }
#recent tr.request { cursor: pointer; }
#recent tr.request:hover td { background: var(--panel); }
#recent td.detail { white-space: normal; }
footer { margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }

/* Customer instruments. The rune is Eldrim's existing fire/ice mark. */
.console-main { max-width: 76rem; }
.console-header { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-bottom: 3.5rem; }
.console-brand { display: flex; align-items: center; gap: 0.8rem; color: var(--fg); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.24em; text-decoration: none; }
.console-brand img { flex: none; }
.console-brand small { display: block; font-size: 0.67rem; font-weight: 400; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted); }
.console-header nav { display: flex; gap: 1.5rem; font-size: 0.85rem; }
.console-header nav a { text-underline-offset: 0.25em; }
.console-main #login { max-width: 42rem; }
.overview-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.eyebrow { color: var(--ember); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; margin: 0 0 0.45rem; }
.overview-heading h1 { color: var(--fg); font-weight: 500; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.035em; }
button.secondary { background: var(--panel); border: 1px solid #455661; color: var(--ice); font-size: 0.85rem; }
.account-context { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 0.75rem 0; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0 0.75rem; }
.meter-card { min-width: 0; padding: 1.4rem; position: relative; border: 1px solid #2b3942; border-radius: 12px; background: radial-gradient(ellipse at 50% 22%, #b9d6e60b, transparent 60%), var(--panel); overflow: hidden; }
.spend-card { border-color: #523626; background: radial-gradient(ellipse at 50% 22%, #ff7a3d0e, transparent 60%), var(--panel); }
.tokens-card { background: radial-gradient(ellipse at 75% 22%, #ff7a3d09, transparent 50%), radial-gradient(ellipse at 20% 22%, #b9d6e60b, transparent 50%), var(--panel); }
.meter-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.4rem; }
.meter-heading h2 { font-size: 0.72rem; color: var(--ice); margin: 0; letter-spacing: 0.14em; }
.spend-card h2 { color: var(--ember); }
.meter-index { color: var(--muted); font: 0.64rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.dial { display: block; width: min(100%, 230px); height: auto; margin: 0.5rem auto -1rem; overflow: visible; }
.dial-halo { fill: none; stroke: #28313a; stroke-width: 1; }
.dial-track { stroke: #27313b; }
.dial-fill { stroke-linecap: butt; }
.dial-fill.ice { stroke: var(--ice); filter: drop-shadow(0 0 4px #b9d6e640); }
.dial-fill.fire { stroke: var(--ember); filter: drop-shadow(0 0 4px #ff7a3d50); }
.dial-ticks { fill: none; stroke: #53626c; stroke-width: 1; }
.dial text { fill: var(--muted); font: 10px ui-monospace, monospace; letter-spacing: 0.13em; text-transform: uppercase; }
.meter-value { margin: 0.15rem 0 0.4rem; font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 500; letter-spacing: -0.045em; line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.reserve-card .meter-value { color: var(--ice); }
.spend-card .meter-value { color: #ffac76; }
.meter-subtitle { font-size: 0.87rem; margin: 0; min-height: 2.7em; }
.meter-detail, .meter-scale { color: var(--muted); font-size: 0.77rem; margin: 0.8rem 0; }
.meter-scale { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.meter-note { color: var(--muted); font-size: 0.78rem; line-height: 1.6; margin: 0.9rem 0; }
.meter-action { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.8rem; text-decoration: none; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.meter-action:hover { text-decoration: underline; }
.budget-settings { font-size: 0.8rem; border-top: 1px solid #38291f; padding-top: 0.75rem; }
.budget-settings summary { color: #ffac76; }
.budget-settings input { min-width: 0; width: 100%; }
.budget-settings form { margin: 0.75rem 0; }
.token-split { display: grid; grid-template-columns: 1fr 1fr; margin: 0.8rem 0; padding-top: 0.7rem; border-top: 1px solid var(--line); font-size: 0.77rem; gap: 1rem; }
.token-split dt { color: var(--muted); }
.token-split dd { margin: 0.25rem 0 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 0.3rem; vertical-align: middle; }
.ice-dot { background: var(--ice); }
.fire-dot { background: var(--ember); }
.meter-card.over-target { border-color: var(--ember); }
.over-target #budget-status { color: #ffac76; }
.meters.stale { opacity: 0.6; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 4px; }
.console-main .routing dd { min-width: 0; overflow-wrap: anywhere; }
.console-main #model { max-width: 100%; }
@media (max-width: 900px) {
  .meter-card { padding: 1rem; }
  .meter-index { display: none; }
  .meter-heading h2 { font-size: 0.68rem; }
}
@media (max-width: 680px) {
  .console-main { padding-top: 1.5rem; }
  .console-header { align-items: flex-start; margin-bottom: 2.25rem; }
  .console-header nav { flex-direction: column; gap: 0.6rem; font-size: 0.73rem; }
  .console-brand { font-size: 1.1rem; gap: 0.45rem; }
  .console-brand img { width: 44px; height: 44px; }
  .console-brand small { font-size: 0.55rem; }
  .meters { grid-template-columns: minmax(0, 1fr); }
  .meter-card { padding: 1.35rem; }
  .meter-index { display: inline; }
  .meter-value { font-size: 1.9rem; }
  .meter-subtitle { min-height: 0; }
  .dial { width: 210px; }
}
@media (prefers-reduced-motion: no-preference) {
  .dial-fill { transition: stroke-dasharray 450ms ease-out; }
}

/* API keys (ELD-41). */
.keys { margin: 1.5rem 0 0.5rem; }
.keys-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.keys-heading h2 { margin: 0; }
.key-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem 1rem; align-items: end;
            margin: 1rem 0; padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.key-form .field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.key-form label { color: var(--muted); font-size: 0.85rem; }
.key-form input, .key-form select { width: 100%; min-width: 0; }
.key-form .inline, .key-form p { grid-column: 1 / -1; }
.key-created { margin: 1rem 0; }
.key-created p { margin: 0.25rem 0 0.75rem; }
.key-table .cell-note { display: block; color: var(--muted); font-size: 0.8rem; }
.key-table td.key-actions { white-space: normal; min-width: 7rem; }
.key-table td.key-actions span { color: var(--muted); }
.key-table tr.key-expired td, .key-table tr.key-revoked td { color: var(--muted); }
button.danger { background: var(--bad); color: #1a0505; margin-right: 0.5rem; }
.request-filter { margin: 0.5rem 0; }
#request-key { flex: 1 1 14rem; min-width: 0; max-width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 680px) {
  .key-form { grid-template-columns: minmax(0, 1fr); }
}
