/* PolyWorks Account: customer dashboard and administration. Light docs style, no external resources. */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --bg: #f6f5f0; --paper: #fcfbf8; --surface: #ffffff;
  --ink: #16201d; --ink-2: #3b4743; --muted: #66716d; --faint: #8b9691;
  --line: #dedfd8; --line-strong: #c7cbc3; --mint: #edf3ee; --accent: #315c53; --accent-ink: #26493f;
  --ok: #2c6a4c; --ok-bg: #eaf3ec; --ok-line: #c3dccb;
  --warn: #7a5410; --warn-bg: #fbf3e2; --warn-line: #ead7ae;
  --err: #9a2f25; --err-bg: #fbeceA; --err-line: #ecc4be;
  --info: #3a5560; --info-bg: #eef3f3; --info-line: #cfdcdc;
  --radius: 6px; --side: 236px; --top: 56px;
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; font-weight: 620; }
h1 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); }
h2 { font-size: 1.02rem; }
h3 { font-size: .95rem; }
p { margin: 0; }
p + p { margin-top: .6em; }
h1[tabindex="-1"]:focus { outline: none; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 4px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- frame ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(252, 251, 248, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--top); padding-inline: clamp(16px, 3vw, 28px); }
.brand { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 620; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.brand-logo { width: 24px; height: auto; flex: none; }
.brand-sub { color: var(--muted); font-weight: 450; }
.brand-sub.admin { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.topnav a, .topnav button { white-space: nowrap; font: 500 .88rem var(--font); color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 4px; background: none; border: 0; cursor: pointer; }
.topnav a:hover, .topnav button:hover { background: var(--mint); color: var(--ink); }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--mint); }
.who { color: var(--muted); font-size: .85rem; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 6px; }

.banner { border-bottom: 1px solid var(--warn-line); background: var(--warn-bg); color: var(--warn); font-size: .9rem; }
.banner > div { padding: 10px clamp(16px, 3vw, 28px); }

.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.shell.bare { display: block; }
.sidebar { border-right: 1px solid var(--line); background: var(--paper); padding: 22px 14px 32px; position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto; }
.sidebar[hidden] { display: none; }
.side-group + .side-group { margin-top: 22px; }
.side-title { font: 600 .68rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: 0 10px 8px; }
.side-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 4px; color: var(--ink-2); text-decoration: none; font-size: .9rem; border-left: 2px solid transparent; }
.side-nav a:hover { background: var(--mint); color: var(--ink); }
.side-nav a[aria-current="page"] { color: var(--ink); background: var(--mint); border-left-color: var(--accent); font-weight: 560; }
.side-nav .count { font: 500 .72rem var(--mono); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; }
.side-foot { margin-top: 26px; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); display: grid; gap: 4px; }
.side-foot a { color: var(--muted); text-decoration: none; }
.side-foot a:hover { color: var(--ink); text-decoration: underline; }

.main { padding: clamp(22px, 3.5vw, 40px) clamp(16px, 3.5vw, 44px) 64px; min-width: 0; }
.main.narrow { max-width: 1120px; }
.feed { display: none; }
@media (min-width: 1480px) {
  .shell.with-feed { grid-template-columns: var(--side) minmax(0, 1fr) 320px; }
  .shell.with-feed .feed:not([hidden]) { display: block; border-left: 1px solid var(--line); background: var(--paper); padding: 22px 16px 32px; position: sticky; top: var(--top); align-self: start; height: calc(100vh - var(--top)); overflow-y: auto; }
}
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; }
.feed-head .side-title { padding: 0; }
.feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.feed-item { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; padding: 9px 11px; color: var(--ink); text-decoration: none; font-size: .85rem; }
.feed-item:hover { border-color: var(--line-strong); background: var(--mint); }
.feed-item.warn { border-left-color: var(--warn, #a86b12); }
.feed-kind { display: flex; justify-content: space-between; gap: 8px; font: 600 .66rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.feed-title { display: block; margin-top: 3px; font-weight: 560; overflow-wrap: anywhere; }
.feed-text { display: block; margin-top: 2px; color: var(--ink-2); overflow-wrap: anywhere; }
.feed-empty { color: var(--muted); font-size: .85rem; }
.loading { color: var(--muted); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; overflow-x: auto; }
  .side-group { display: flex; align-items: center; gap: 8px; }
  .side-group + .side-group { margin-top: 0; border-top: 1px solid var(--line); padding-top: 6px; margin-top: 6px; }
  .side-title { padding: 0 4px; white-space: nowrap; }
  .side-nav { display: flex; gap: 2px; }
  .side-nav a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 9px; }
  .side-nav a[aria-current="page"] { border-bottom-color: var(--accent); background: none; }
  .side-foot { display: none; }
  .who { display: none; }
}
@media (max-width: 560px) { .brand-sub { display: none; } .topnav .hide-narrow { display: none; } }

/* ---------- page structure ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: .92rem; }
.eyebrow { display: block; font: 600 .68rem/1 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.crumbs { font-size: .85rem; margin-bottom: 10px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.section { padding-block: 4px 26px; }
.section + .section { border-top: 1px solid var(--line); padding-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: .88rem; }
.cols > .section, .cols > section { border-top: 0; padding-top: 4px; }
.cols { display: grid; gap: 22px 36px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.prose-s { color: var(--ink-2); font-size: .92rem; max-width: 68ch; }
.prose-s + .prose-s { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: var(--mono); font-size: .86em; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 18px; } .mt-3 { margin-top: 28px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* Key figures: plain numbers on a thin rule, no cards. Row-start borders are clipped by the container. */
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); margin: 0 0 26px; overflow: hidden; }
.figure { padding: 14px 16px; min-width: 0; border-left: 1px solid var(--line); margin-left: -1px; border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.figure dt { font-size: .78rem; color: var(--muted); }
.figure dd { margin: 4px 0 0; font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.figure dd small { display: block; font-size: .78rem; font-weight: 450; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.figure a { color: inherit; text-decoration: none; }
.figure a:hover { color: var(--accent); }
@media (max-width: 560px) { .figures { grid-template-columns: 1fr 1fr; } .figure { padding: 12px; } .figure dd { font-size: 1.25rem; } }

dl.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 7px 18px; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { font: 600 .68rem/1.2 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); background: var(--paper); white-space: nowrap; position: sticky; top: 0; }
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafaf6; }
table.data td.num, table.data th.num { text-align: right; }
table.data a { font-weight: 520; }
table.data .sub { display: block; color: var(--muted); font-size: .8rem; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 2px 0; font-size: .84rem; color: var(--muted); }
.empty { color: var(--muted); padding: 18px 14px; font-size: .9rem; }
.table-wrap .empty { text-align: center; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { font-size: .78rem; gap: 4px; }
.filters input, .filters select { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.filters .grow { flex: 1 1 240px; }

/* ---------- forms ---------- */
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 560; font-size: .88rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input, select, textarea { font: 400 .95rem var(--font); padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); width: 100%; min-height: 42px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(49, 92, 83, .14); }
input[aria-invalid="true"] { border-color: var(--err); }
input.code { font-family: var(--mono); letter-spacing: .06em; }
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.form-narrow { max-width: 520px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 450; }
.check input { width: auto; min-height: 0; margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 4px; font: 560 .9rem var(--font); cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover:not([disabled]) { background: #24312d; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not([disabled]) { background: var(--accent-ink); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not([disabled]) { border-color: var(--ink-2); }
.btn-danger { background: var(--surface); color: var(--err); border-color: var(--err-line); }
.btn-danger:hover:not([disabled]) { border-color: var(--err); }
.btn-danger-solid { background: var(--err); color: #fff; }
.btn-small { min-height: 30px; padding: 0 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }

.alert { border-radius: 4px; padding: 10px 12px; font-size: .9rem; border: 1px solid; border-left-width: 3px; }
.alert-error { background: var(--err-bg); color: var(--err); border-color: var(--err-line); border-left-color: var(--err); }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); border-left-color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); border-left-color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); border-left-color: var(--info); }
.alert strong { display: block; margin-bottom: 2px; }
.alerts { display: grid; gap: 8px; margin-bottom: 22px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font: 600 .66rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 3px; border: 1px solid; white-space: nowrap; vertical-align: 1px; }
.chip-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.chip-err { color: var(--err); background: var(--err-bg); border-color: var(--err-line); }
.chip-soon, .chip-info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.chip-neutral { color: var(--ink-2); background: var(--paper); border-color: var(--line-strong); }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list .meta { display: grid; gap: 2px; min-width: 0; }
.list .meta strong { overflow-wrap: anywhere; font-weight: 560; }

.license { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.license + .license { margin-top: 14px; }
.license-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.license-body { padding: 14px 16px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 760px) { .license-body { grid-template-columns: 1fr; } }
.seats { display: flex; gap: 3px; margin-top: 6px; }
.seats span { width: 14px; height: 6px; border-radius: 1px; background: var(--line); }
.seats span.on { background: var(--accent); }

.auth { max-width: 420px; margin: clamp(10px, 5vw, 48px) auto 0; }
.auth h1 { margin-bottom: 6px; }
.auth > p.lede { color: var(--ink-2); margin-bottom: 22px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 24px); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: .9rem; }

.qr { display: grid; gap: 16px; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); align-items: start; }
.qr img { width: 190px; height: 190px; border: 1px solid var(--line); border-radius: 4px; image-rendering: pixelated; background: #fff; }
@media (max-width: 560px) { .qr { grid-template-columns: 1fr; } }
.secret { font: 500 .92rem var(--mono); background: var(--paper); border: 1px dashed var(--line-strong); padding: 10px 12px; border-radius: 4px; overflow-wrap: anywhere; user-select: all; }
.secret.big { font-size: 1.05rem; letter-spacing: .03em; padding: 14px; background: var(--mint); border-style: solid; border-color: var(--accent); }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font: 500 .95rem var(--mono); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; margin: 0; list-style: none; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: .92rem; }

/* Bars: proportional fills set through CSSOM (allowed by the CSP, unlike style attributes). */
.meter { height: 6px; background: var(--line); border-radius: 1px; overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter.warn > span { background: #b0812a; }
.meter.err > span { background: var(--err); }
.bars { display: grid; gap: 4px; font-size: .82rem; }
.bars .bar-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 40px; gap: 10px; align-items: center; }
.bars .bar { height: 8px; background: var(--accent); border-radius: 1px; min-width: 2px; }
.bars .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.timeline { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.timeline li { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr auto; } .timeline time { grid-column: 1 / -1; } }

dialog { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; color: var(--ink); background: var(--surface); box-shadow: 0 18px 60px rgba(22, 32, 29, .18); }
dialog::backdrop { background: rgba(22, 32, 29, .35); }
dialog form { padding: 20px; }
dialog h2 { font-size: 1.05rem; }

.soon { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; background: var(--paper); }
.foot { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 22px clamp(16px, 3vw, 28px) calc(22px + env(safe-area-inset-bottom, 0px)); font-size: .82rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* engines */
.engine-grid { display: grid; gap: 22px 36px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.engine-card { border-top: 2px solid var(--ink); padding-top: 14px; }
.engine-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.engine-name { font-size: 26px; font-weight: 650; letter-spacing: .12em; }
.engine-role { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list li .sub { display: block; margin-top: 2px; }
.attribution { font-size: 13px; color: var(--muted); margin-top: 12px; }
.engine-grid > * { min-width: 0; }
.engine-card .kv dd { overflow-wrap: anywhere; min-width: 0; }
.engine-card .mono { overflow-wrap: anywhere; word-break: break-all; }
.engine-card .chip { white-space: normal; }

/* Seats on a license (owner view), manual-review disclosure, inline invite form */
.license-note { padding: 12px 16px 0; }
.license-seats { padding: 14px 16px 16px; border-top: 1px solid var(--line); }
.seat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.seat-head h4 { margin: 0; font-size: .95rem; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 260px; }
details.disclosure { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 16px; }
details.disclosure > summary { cursor: pointer; font-weight: 560; }
details.disclosure[open] > summary { margin-bottom: 4px; }

/* ---------- admin: GAIA build upload ---------- */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper); padding: 28px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--accent); background: var(--mint); }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.dropzone p { margin: 0; }
.dropzone-label { font-weight: 600; color: var(--ink); margin-bottom: 4px !important; overflow-wrap: anywhere; }
.upload-progress { width: 100%; height: 8px; accent-color: var(--accent); }
.mode-select { max-width: 320px; }
.linkish.danger { color: var(--err); }

/* ---------- customer engine cards: one status line ---------- */
.engine-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 4px; font-size: .92rem; }

/* ---------- Cloud Bakes preview ---------- */
.cc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.cc > *, .cc .section, .cc .cols > * { min-width: 0; }
.cc-preview { display: grid; gap: 10px; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--paper); }
.cc-preview > p { margin: 0; color: var(--ink-2); font-size: .9rem; max-width: 70ch; }
.cc-preview > .chip { justify-self: start; }
.cc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.cc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cc-label { font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cc-top { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .cc-top { grid-template-columns: 1fr; } }

.cc-amount { margin: 10px 0 14px; font-size: 2.1rem; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cc-amount span { font-size: .95rem; font-weight: 450; letter-spacing: 0; color: var(--muted); }
.cc-bar { height: 8px; border-radius: 999px; background: var(--mint); overflow: hidden; }
.cc-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s cubic-bezier(.2, .7, .2, 1), background-color .3s; }
.cc-bar.low .cc-bar-fill { background: var(--warn); }
.cc-bar.low { background: var(--warn-bg); }
.cc-bar.empty { background: var(--err-bg); }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; font-size: .86rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-meta span:first-child { color: var(--ink); font-weight: 600; }
.cc-side-n { margin: 6px 0 0; font-size: 2.1rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.1; }

.cc-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cc-seg { font: inherit; font-size: .84rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.cc-seg:hover { border-color: var(--accent); color: var(--accent); }
.cc-seg.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.section .cc-filters { margin-bottom: 10px; }

.cc-mini-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 110px; }
.cc-mini { flex: 1; height: 5px; border-radius: 999px; background: var(--mint); overflow: hidden; }
.cc-mini-fill { display: block; height: 100%; background: var(--accent); }
.cc-mini.failed .cc-mini-fill { background: var(--err); }
.cc-mini.queued .cc-mini-fill { background: var(--faint); }

.cc-pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.cc-pkg { display: grid; gap: 6px; align-content: start; }
.cc-pkg h3 { margin: 0; font-size: 1rem; }
.cc-pkg.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cc-pkg-credits { margin: 6px 0 0; font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cc-pkg-credits span { font-size: .85rem; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.cc-pkg-hours { margin: 0; font-size: .86rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cc-price { margin: 8px 0 0; font-size: 1.15rem; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cc-placeholder { font: 600 .62rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn-line); background: var(--warn-bg); padding: 3px 6px; border-radius: 3px; }
.cc-pkg .btn { margin-top: 8px; }
.cc-custom input { max-width: 160px; }
.cc-plus { color: var(--ok); }

.cc-wizard { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .cc-wizard { grid-template-columns: 1fr; } }
.cc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.cc-step { display: grid; gap: 8px; }
.cc-step-head { display: flex; align-items: center; gap: 10px; }
.cc-step-head h3 { margin: 0; font-size: .98rem; }
.cc-step-n { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 .78rem var(--mono); background: var(--mint); color: var(--accent-ink); border: 1px solid var(--line-strong); }
.cc-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.cc-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 450; }
.cc-choice:has(input:checked) { border-color: var(--accent); background: var(--mint); }
.cc-choice input { margin-top: 3px; width: auto; min-height: 0; accent-color: var(--accent); }
.cc-choice .sub { display: block; font-size: .8rem; color: var(--muted); }
.cc-frames { max-width: 200px; }
.cc-review { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 10px; }
@media (max-width: 860px) { .cc-review { position: static; } }
@media (prefers-reduced-motion: reduce) { .cc-bar-fill { transition: none; } }
