:root {
  color-scheme: light;
  --bg: #F4F6F8; --panel: #FFFFFF; --sunk: #EEF1F4; --ink: #151A21; --muted: #5B6673; --line: #DDE2E8; --line-strong: #C3CBD4;
  --accent: #0B6B6B; --accent-hover: #095757; --accent-soft: #E0F1F0; --on-accent: #FFFFFF;
  --danger: #B3261E; --danger-soft: #FBE9E7; --good: #17693F; --good-soft: #E3F4EA; --warn-ink: #6B4A00; --warn-soft: #FFF3D1;
  --rev: #3538CD; --cost: #D8344F; --bar: #0B6B6B;
  --r: 10px; --r-sm: 7px;
  --shadow: 0 1px 2px rgba(21, 26, 33, .06);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #12161B; --panel: #1A2027; --sunk: #232A32; --ink: #E9EDF1; --muted: #9AA6B2; --line: #2D353E; --line-strong: #434D58;
  --accent: #4CC4BD; --accent-hover: #6FD6D0; --accent-soft: #17393A; --on-accent: #08201F;
  --danger: #FF9C94; --danger-soft: #3D1F1D; --good: #6FD6A2; --good-soft: #163325; --warn-ink: #F6DE9A; --warn-soft: #3B3010;
  --rev: #7375F2; --cost: #E8506A; --bar: #4CC4BD;
  --shadow: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 Figtree, system-ui, sans-serif; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 0 0 1.25rem; }
h2 { font-size: 1.1rem; font-weight: 700; margin: 1.75rem 0 .5rem; }
h3 { font-size: 1rem; font-weight: 600; margin: 1.1rem 0 .25rem; }
p { margin: .35rem 0; }
a { color: var(--accent); text-underline-offset: 2px; }
code, pre, .mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; font-size: .85em; }
code { background: var(--sunk); padding: .08em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { overflow-x: auto; background: var(--sunk); border-radius: var(--r-sm); padding: .8rem 1rem; }
pre code { background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
small { font-weight: 400; color: var(--muted); font-size: .82rem; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 1rem .75rem; display: flex; flex-direction: column; gap: .9rem; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; padding: 0 .5rem; margin: 0; }
.mark { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); box-shadow: inset -6px -6px 0 rgba(255, 255, 255, .28); }
.switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--sunk); border-radius: var(--r-sm); padding: 3px; }
.switch a { text-align: center; padding: .25rem; border-radius: 5px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .88rem; }
.switch a.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.navlist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .9rem; min-height: 0; }
.navset { display: flex; flex-direction: column; gap: 2px; }
.navhead { color: var(--muted); font-size: .78rem; font-weight: 600; padding: 0 .6rem; margin: 0 0 .15rem; }
.navset a { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; padding: .42rem .6rem; border-radius: var(--r-sm); font-weight: 500; }
.navset a .ic { color: var(--muted); }
.navset a:hover { background: var(--sunk); }
.navset a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navset a.on .ic { color: var(--accent); }
.sidefoot { display: flex; align-items: center; gap: .25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.who { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-size: .85rem; padding: .3rem; border-radius: var(--r-sm); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover { background: var(--sunk); }
.sideacts { display: flex; }
.iconbtn { display: grid; place-items: center; width: 32px; height: 32px; background: none; border: 0; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; }
.iconbtn:hover { background: var(--sunk); color: var(--ink); }
.main { padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1240px; width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--r-sm); padding: .46rem .95rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { background: var(--panel); color: var(--danger); border-color: var(--line-strong); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: .2rem .6rem; font-size: .88rem; }
.btn[disabled] { opacity: .55; cursor: progress; }
.linkish { background: none; border: 0; padding: .1rem .25rem; font: inherit; font-weight: 600; font-size: .9rem; color: var(--accent); cursor: pointer; border-radius: 4px; }
.linkish:hover { background: var(--accent-soft); }
.linkish.danger { color: var(--danger); }
.linkish.danger:hover { background: var(--danger-soft); }

/* Forms */
label { display: block; font-weight: 500; font-size: .9rem; }
label small { display: block; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .46rem .65rem; font: inherit; font-weight: 400; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
::placeholder { color: var(--muted); opacity: .8; }
select { appearance: none; padding-right: 2rem; text-overflow: ellipsis; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
textarea.mono, input.mono { font-family: "Geist Mono", ui-monospace, Menlo, monospace; font-size: .83rem; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 16px; height: 16px; margin: 0 .45rem 0 0; padding: 0; accent-color: var(--accent); flex: none; }
input[type=range] { padding: 0; border: 0; accent-color: var(--accent); background: none; }
input[type=file] { padding: .35rem; cursor: pointer; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; font-size: .88rem; margin-right: .7rem; padding: .25rem .7rem; color: var(--ink); background: var(--sunk); border: 1px solid var(--line-strong); border-radius: 5px; cursor: pointer; }
input.short { width: 7rem; display: inline-block; margin: 0; }
td select, td input[type=date] { display: inline-block; width: auto; margin: 0; }
.check { display: flex; align-items: center; font-weight: 500; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.stack h2 { margin: .9rem 0 -.3rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.stack > h2:first-child, .stack > input[type=hidden] + h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.stack > p { margin: 0; }
.narrow { max-width: 600px; }
.inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-bottom: 1rem; }
.inline input, .inline select { min-width: 10rem; }
.inlineform { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.pagehead p { margin: 0; }
.grid3, .grid4 { display: grid; gap: .9rem; align-items: start; }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.twocol { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem; box-shadow: var(--shadow); }
.main > form.stack, .twocol > form.stack, .main > .prose { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.flash { padding: .55rem .85rem; border-radius: var(--r-sm); background: var(--good-soft); color: var(--good); font-weight: 500; }
.flash.bad { background: var(--danger-soft); color: var(--danger); }
.note { padding: .65rem .9rem; border-radius: var(--r-sm); background: var(--sunk); margin: .75rem 0; }
.note.strong { background: var(--warn-soft); color: var(--warn-ink); }
.note.strong a { color: inherit; font-weight: 600; }

/* Numbers */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stats > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1.05rem; box-shadow: var(--shadow); min-width: 0; }
.stats > div.lead { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stats > div.lead .muted { color: inherit; opacity: .85; }
.stats p { margin: 0; }
.hero { font-size: 2rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.big { font-size: 1.45rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Tables */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); box-shadow: var(--shadow); margin-bottom: .75rem; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; font-weight: 600; font-size: .83rem; color: var(--muted); white-space: nowrap; background: var(--panel); }
th, td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loss { color: var(--danger); font-weight: 600; }
.st { display: inline-flex; align-items: center; gap: .35em; font-weight: 500; }
.st::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.st.succeeded, .st.active { color: var(--good); } .st.failed, .st.disabled { color: var(--danger); } .st.running, .st.finalizing { color: var(--muted); }
.rowlink { color: var(--ink); font-weight: 600; text-decoration: none; }
.rowlink:hover { color: var(--accent); text-decoration: underline; }
.routes { list-style: none; padding: 0; margin: .25rem 0 .75rem; }
.routes li { padding: .4rem 0; }

/* Model cards */
.cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin: 0 0 1rem; padding: 0; list-style: none; }
.card { display: flex; flex-direction: column; gap: .35rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: var(--shadow); min-width: 0; }
.card p { margin: 0; }
.card .foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card .name { font-weight: 600; font-size: 1.02rem; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: .3rem; width: fit-content; font-size: .8rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: .08rem .45rem; }
.badge .ic { width: 14px; height: 14px; }
.plans { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 1rem 0; padding: 0; list-style: none; }
.plans li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem; display: flex; flex-direction: column; gap: .35rem; box-shadow: var(--shadow); }
.plans li.current { border: 2px solid var(--accent); }
.plans h2 { margin: 0; }
.plans p { margin: 0; }
.plans form, .plans .cur { margin-top: auto; padding-top: .75rem; }
.plans .btn { width: 100%; }
.price { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.price small { letter-spacing: 0; }
.copy { display: block; padding: .6rem .8rem; background: var(--panel); color: var(--ink); border: 1px dashed var(--line-strong); border-radius: var(--r-sm); cursor: copy; margin-top: .4rem; }
.codes { max-height: 16rem; color: var(--ink); background: var(--panel); }
.prose { max-width: 820px; }

/* Customer panel */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(21, 26, 33, .14); overflow-y: auto; padding: 1.25rem; z-index: 10; display: flex; flex-direction: column; gap: 1.1rem; }
.drawerhead { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; }
.drawerhead h2 { margin: 0; overflow-wrap: anywhere; }
.drawer section { border-top: 1px solid var(--line); padding-top: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.drawer h3 { margin: 0; }
.drawer .rowform { display: flex; gap: .5rem; align-items: flex-end; }
.drawer .rowform label { flex: 1; }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.minis div { background: var(--sunk); border-radius: var(--r-sm); padding: .5rem .7rem; min-width: 0; overflow-wrap: anywhere; }
.minis p { margin: 0; }
.scrim { position: fixed; inset: 0; background: rgba(21, 26, 33, .35); z-index: 9; display: block; }

/* Wizard */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: 0; margin: 0 0 1.25rem; counter-reset: st; }
.steps li { counter-increment: st; display: flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 500; }
.steps li::before { content: counter(st); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--sunk); font-size: .82rem; font-weight: 600; }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on::before, .steps li.done::before { background: var(--accent); color: var(--on-accent); }
.wizstep { display: flex; flex-direction: column; gap: .9rem; }
.wizstep h2 { margin: 0; border: 0; padding: 0; }
.wiznav { display: flex; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.summary { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem 1rem; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }

/* Route editor */
.signal { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.signal li { padding: .65rem .8rem; font-size: .88rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); }
.signal strong { display: block; }
.chip { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 .35rem; margin: .1rem .1rem 0 0; cursor: pointer; }
.testout { max-height: 28rem; white-space: pre-wrap; overflow-wrap: anywhere; }
#varbuilder input:not([type=checkbox]), #varbuilder select { margin: 0; min-width: 6.5rem; }

/* Playground */
.pgfilter { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.pill { font: inherit; font-size: .88rem; font-weight: 500; background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 999px; padding: .15rem .75rem; cursor: pointer; }
.pill:hover { background: var(--sunk); }
.pill[aria-pressed=true] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pgpick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: .75rem; margin-bottom: .5rem; }
.pg { display: grid; grid-template-columns: minmax(290px, 400px) minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: .75rem; }
.pg > form.stack { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1.15rem; box-shadow: var(--shadow); }
.filefield input[type=file] { border-style: dashed; padding: .8rem .6rem; background: var(--bg); }
.filefield input[type=url] { margin-top: .15rem; }
.filefield > label + label { margin-top: .4rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: .4rem; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--r-sm); margin-top: .4rem; }
.seg { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; border: 0; padding: 0; }
.seg legend { padding: 0 0 .25rem; font-weight: 500; font-size: .9rem; }
.seg label { font-weight: 400; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.seg span { display: block; padding: .22rem .7rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; background: var(--panel); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rangeval { display: flex; align-items: center; gap: .6rem; }
.rangeval input { flex: 1; margin: 0; }
.pgside { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.pgout { min-height: 340px; max-height: 72vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; overflow-wrap: anywhere; box-shadow: var(--shadow); }
.pgout img, .pgout video { max-width: 100%; height: auto; display: block; border-radius: var(--r-sm); }
.pgout audio { width: 100%; }
.pgerr { color: var(--danger); }
.msg { margin: 0 0 .8rem; white-space: pre-wrap; }
.msg.user { background: var(--sunk); padding: .45rem .75rem; border-radius: var(--r-sm); width: fit-content; max-width: 90%; margin-left: auto; }
.result { margin: 0 0 1rem; }
.result figcaption { font-size: .9rem; margin-top: .3rem; }
.recentlist { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .5rem; }
.recent { width: 100%; font: inherit; font-size: .8rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .35rem; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.recent:hover { border-color: var(--accent); }
.recent img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 4px; margin-bottom: .25rem; }
.pgside h2 { margin: 0; font-size: 1rem; }

/* Charts */
.chart { margin: 0 0 .5rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; box-shadow: var(--shadow); }
.chart svg { width: 100%; height: auto; display: block; }
.chart figcaption { font-size: .88rem; }
.grid { stroke: var(--line); stroke-width: 1; }
.axis, .endlabel { fill: var(--muted); font-size: 12px; }
.endlabel { fill: var(--ink); font-weight: 600; }
.ln { fill: none; stroke-width: 2; stroke-linejoin: round; }
.ln.rev { stroke: var(--rev); } .ln.cost { stroke: var(--cost); }
.dot { stroke: var(--panel); stroke-width: 2; }
.dot.rev { fill: var(--rev); } .dot.cost { fill: var(--cost); }
.barmark { fill: var(--bar); }
.hit { fill: transparent; }
.hit:hover { fill: var(--line); fill-opacity: .4; }
.legend { display: flex; gap: .5rem 1rem; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: .35rem; }
.key { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-right: -.5rem; vertical-align: middle; }
.key.rev { background: var(--rev); } .key.cost { background: var(--cost); }
details summary { cursor: pointer; font-weight: 500; margin: .35rem 0; }

/* Sign in */
.authpage { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.authcard { width: 100%; max-width: 410px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; box-shadow: 0 12px 32px rgba(21, 26, 33, .08); }
.authcard .logo { padding: 0; margin-bottom: 1.25rem; }
.authcard h1 { font-size: 1.4rem; margin-bottom: 1rem; }
.authcard .btn { width: 100%; }
.authcard > .muted { margin-top: 1rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: .75rem; gap: .5rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .navlist { flex-direction: row; overflow-x: auto; gap: .25rem; flex: none; }
  .navset { flex-direction: row; gap: .25rem; }
  .navset a { white-space: nowrap; }
  .navhead { display: none; }
  .sidefoot { border-top: 0; padding-top: 0; }
  .main { padding: 1.25rem 1rem 3rem; }
  .pg, .pgpick { grid-template-columns: minmax(0, 1fr); }
  .pgside { position: static; }
  .signal { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) { .btn, .navset a, .pill { transition: background-color .12s; } }
.aspect .aspectsize { flex-basis: 100%; margin: .25rem 0 0; font-size: .85rem; }
.aspect span { display: flex; align-items: center; gap: .35rem; }
.aspect svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.aspectcfg { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: flex-end; padding: .1rem 0 .35rem; }
.aspectcfg label { width: 9.5rem; }
.aspectcfg small { flex-basis: 100%; }
.aspectbox { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .9rem; }
.aspectbox h3 { margin: 0; }
.aspectbox .actions { justify-content: space-between; }
.aspectbox .actions input { max-width: 15rem; margin: 0; }
.ratios { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .35rem; }
.ratio { display: flex; align-items: center; gap: .2rem; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.ratio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ratio span { font-weight: 600; margin-right: auto; }
.ratio small { white-space: nowrap; }
.ratebox { display: flex; flex-direction: column; gap: .5rem; }
.ratebox h3 { margin: 0; }
.tablewrap code { white-space: nowrap; }
.lineform { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .35rem; }
.lineform input { width: 8rem; margin: 0; }
.lineform select { width: auto; min-width: 13rem; margin: 0; }
.lineform .money { min-width: 3rem; font-weight: 600; }
[data-lines] h3 { margin: 0 0 .35rem; }
.pill { text-decoration: none; }
.pill[aria-current] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pghead { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .4rem; }
.pghead h2 { margin: 0; }

.logfilters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(120px, 1fr)) repeat(2, minmax(130px, 1fr)) auto; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.logfilters .actions { flex-wrap: nowrap; }
.logtable td { vertical-align: top; }
.logtable .sub { display: block; color: var(--muted); font-size: .82rem; font-weight: 400; white-space: nowrap; }
.logtable .primary { font-weight: 600; }
.logtable tfoot td { border-top: 2px solid var(--line-strong); border-bottom: 0; font-weight: 700; background: var(--bg); }
.logtable tr.errrow td { padding-top: 0; }
.logtable tr.errrow:hover { background: none; }
.logtable tr.hasdetail td { border-bottom: 0; }
.logtable details summary { font-size: .85rem; color: var(--muted); margin: 0; }
.logtable details pre { margin: .35rem 0 0; font-size: .8rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .5rem; }
@media (max-width: 1100px) { .logfilters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.logtable th, .logtable td { padding-left: .6rem; padding-right: .6rem; }
.stats .big { font-size: 1.2rem; overflow-wrap: normal; white-space: nowrap; }
.stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.kcstats { margin-bottom: .75rem; }
.kcfilters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: .75rem; }
.kcfilters input, .kcfilters select { min-width: 10rem; margin-top: .25rem; }
.pill b { font-weight: 700; margin-left: .25rem; }
.kctable td { vertical-align: top; }
.kctable .name { font-weight: 600; display: block; }
.kctable .sub { display: block; color: var(--muted); font-size: .82rem; }
.kctable progress { display: block; width: 100%; min-width: 11rem; height: 8px; margin-bottom: .2rem; border: 0; border-radius: 4px; overflow: hidden; background: var(--line); accent-color: var(--accent); }
.kctable progress::-webkit-progress-bar { background: var(--line); }
.kctable progress::-webkit-progress-value { background: var(--accent); }
.kctable progress::-moz-progress-bar { background: var(--accent); }
.kctable .meter + .meter { margin-top: .4rem; }
.kctable .meter span { font-size: .82rem; }
.kctable .state { font-weight: 600; white-space: nowrap; }
.kctable tbody tr.kc-active, .kctable tbody tr.kc-active:hover { background: var(--accent-soft); }
.kctable tbody tr.kc-active .state { color: var(--accent); }
.kctable tbody tr.kc-finished, .kctable tbody tr.kc-finished:hover { background: var(--sunk); }
.kctable tbody tr.kc-finished .name, .kctable tbody tr.kc-finished code { color: var(--muted); }
.kctable tbody tr.kc-expired, .kctable tbody tr.kc-expired:hover { background: var(--warn-soft); }
.kctable tbody tr.kc-expired .state { color: var(--warn-ink); }
.kctable tbody tr.kc-disabled, .kctable tbody tr.kc-disabled:hover { background: var(--danger-soft); }
.kctable tbody tr.kc-disabled .state { color: var(--danger); }
.kcactions { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.kcactions form { display: flex; gap: .3rem; align-items: center; }
.kcactions input.short { width: 5.5rem; padding: .15rem .4rem; }
.kctable code { user-select: all; }
.kctable .sub { white-space: nowrap; }
.kctable td:nth-child(3) { min-width: 13rem; }
