:root {
  color-scheme: light;
  --bg: #fff7fa;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #fff;
  --panel-soft: #fff0f5;
  --line: rgba(184, 61, 110, .15);
  --line-strong: rgba(232, 62, 125, .38);
  --text: #3f1727;
  --muted: #896474;
  --pink: #f05b96;
  --rose: #dd3f78;
  --berry: #8e2852;
  --blush: #ffd7e4;
  --peach: #ffb8ca;
  --green: #188b66;
  --red: #c93f66;
  --amber: #a96a0a;
  --shadow: 0 24px 70px rgba(142, 40, 82, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 183, 204, .55), transparent 29%),
    radial-gradient(circle at 94% 13%, rgba(240, 91, 150, .18), transparent 25%),
    linear-gradient(155deg, #fff9fb 0%, #fff4f8 46%, #fffaf8 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: .42;
  background-image: radial-gradient(rgba(213, 83, 132, .16) .7px, transparent .7px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.ambient { position: fixed; z-index: -1; width: 430px; height: 430px; border-radius: 50%; filter: blur(105px); opacity: .27; pointer-events: none; }
.ambient-one { top: 10%; left: -250px; background: #ff91b8; }
.ambient-two { right: -230px; bottom: 3%; background: #ffc1d1; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 34px; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.hero-copy { max-width: 780px; }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.preference-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px 16px; }
.eyebrow, .status-kicker { display: inline-flex; align-items: center; gap: 9px; color: var(--berry); font-size: 12px; font-weight: 800; letter-spacing: .17em; }
.eyebrow { padding: 9px 14px; border: 1px solid rgba(221, 63, 120, .2); border-radius: 999px; background: rgba(255, 255, 255, .7); box-shadow: 0 10px 28px rgba(180, 45, 98, .08); }
.eyebrow span, .status-kicker span { width: 9px; height: 9px; border-radius: 3px 50% 50%; transform: rotate(45deg); background: linear-gradient(135deg, var(--pink), var(--peach)); box-shadow: 0 0 0 5px rgba(240, 91, 150, .1); }
h1 { margin: 16px 0 9px; color: var(--berry); font-size: clamp(38px, 6vw, 68px); line-height: 1.03; letter-spacing: -.047em; }
.hero h1 { background: linear-gradient(110deg, #752044, #dc3e78 58%, #f277a7); background-clip: text; color: transparent; }
.hero p, .status-head p { margin: 0; color: var(--muted); line-height: 1.7; }

.preference-picker { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.preference-picker select, .list-actions select { height: 38px; min-width: 142px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--text); background: rgba(255, 255, 255, .86); }
.theme-picker select { min-width: 124px; }
.preference-picker select:focus, .list-actions select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 4px rgba(240, 91, 150, .1); }
.api-docs-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--berry); background: rgba(255, 255, 255, .78); box-shadow: 0 7px 18px rgba(142, 40, 82, .06); font-size: 12px; font-weight: 800; text-decoration: none; transition: transform .16s, border-color .16s, background .16s; }
.api-docs-link:hover { transform: translateY(-2px); border-color: var(--line-strong); background: #fff1f6; }
.service-card { min-width: 250px; display: flex; align-items: center; gap: 13px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, .76); box-shadow: 0 16px 45px rgba(142, 40, 82, .1); backdrop-filter: blur(18px); }
.service-card strong, .service-card small { display: block; }
.service-card small { margin-top: 4px; color: var(--muted); }
.service-dot { width: 12px; height: 12px; border-radius: 50%; background: #b79aa6; box-shadow: 0 0 0 7px rgba(137, 100, 116, .1); }
.service-dot.online { background: var(--green); box-shadow: 0 0 16px rgba(24, 139, 102, .4), 0 0 0 7px rgba(24, 139, 102, .1); }
.service-dot.offline { background: var(--red); box-shadow: 0 0 16px rgba(201, 63, 102, .35), 0 0 0 7px rgba(201, 63, 102, .1); }

.status-panel, .panel { border: 1px solid var(--line); border-radius: 29px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.status-panel { position: relative; margin-bottom: 22px; padding: 25px; overflow: hidden; }
.status-panel::after { content: ""; position: absolute; top: -100px; right: -70px; width: 230px; height: 230px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 183, 202, .3), transparent 70%); pointer-events: none; }
.status-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.status-head h2 { margin: 7px 0 4px; font-size: 27px; }
.legend { display: flex; gap: 17px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend b { font-weight: 500; }
.legend i { width: 10px; height: 10px; border-radius: 4px; }
.legend-ok { background: var(--pink); box-shadow: 0 0 10px rgba(240, 91, 150, .45); }
.legend-empty { background: #ead7de; }
.status-grid { min-height: 108px; display: grid; grid-template-columns: repeat(48, minmax(6px, 1fr)); grid-auto-flow: row; grid-template-rows: repeat(3, 24px); gap: 5px; margin: 18px 0 13px; padding: 15px; border: 1px solid rgba(195, 83, 127, .14); border-radius: 19px; background: linear-gradient(135deg, rgba(255, 239, 245, .82), rgba(255, 250, 252, .9)); overflow: hidden; }
.status-cell { border-radius: 7px; background: #ead9df; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.status-cell.ok { background: linear-gradient(135deg, #ec4e89, #ff8bb5); box-shadow: 0 4px 12px rgba(219, 61, 119, .3); }
.status-cell:focus { outline: 2px solid var(--rose); outline-offset: 2px; }
.grid-loading { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-items: center; color: var(--muted); }
.bucket-detail { min-height: 24px; margin: -2px 2px 10px; color: var(--berry); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.metrics div { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .72); }
.metrics small { display: block; color: var(--muted); }
.metrics strong { display: block; margin-top: 5px; color: var(--berry); font-size: 19px; }

.workspace { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 20px; align-items: start; }
.panel { padding: 24px; }
.panel-head, .panel-head > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 20px; }
.step { display: inline-grid; place-items: center; min-width: 40px; height: 36px; border: 1px solid rgba(221, 63, 120, .2); border-radius: 13px; color: var(--berry); background: linear-gradient(135deg, #ffe4ed, #fff3f7); font-weight: 800; }
.badge, .mini-pill, .zero-pill { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.badge { min-height: 30px; padding: 5px 11px; color: var(--muted); background: rgba(255, 255, 255, .54); font-size: 12px; }
.badge.ok { color: #116b50; border-color: rgba(24, 139, 102, .24); background: rgba(24, 139, 102, .08); }
.badge.running { color: var(--berry); border-color: rgba(240, 91, 150, .28); background: rgba(240, 91, 150, .09); }
.badge.bad { color: #a72d52; border-color: rgba(201, 63, 102, .25); background: rgba(201, 63, 102, .08); }

.field { display: grid; gap: 9px; margin-top: 24px; }
.field > span, .link-block > span { color: #654050; font-size: 13px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid var(--line); outline: 0; color: var(--text); background: rgba(255, 255, 255, .8); transition: border-color .18s, box-shadow .18s, background .18s; }
input { height: 50px; padding: 0 15px; border-radius: 14px; }
textarea { min-height: 190px; padding: 14px 15px; resize: vertical; border-radius: 16px; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--line-strong); background: #fff; box-shadow: 0 0 0 4px rgba(240, 91, 150, .1); }
input::placeholder, textarea::placeholder { color: #b79ca7; }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.field-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.field-meta em { font-style: normal; }
.cdk-metrics { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.mini-pill { padding: 4px 9px; color: var(--muted); background: rgba(255, 255, 255, .55); font-size: 11px; }
.mini-pill.locked { color: var(--amber); border-color: rgba(169, 106, 10, .25); background: rgba(255, 213, 141, .14); }
.email-card { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 15px; border: 1px solid rgba(240, 91, 150, .18); border-radius: 18px; background: linear-gradient(120deg, rgba(255, 225, 235, .7), rgba(255, 250, 252, .78)); }
.email-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--rose), #f983ae); box-shadow: 0 9px 22px rgba(221, 63, 120, .22); font-size: 20px; }
.email-card div { min-width: 0; flex: 1; }
.email-card small, .email-card strong { display: block; }
.email-card small { color: var(--muted); }
.email-card strong { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.privacy-note { margin: 13px 2px 0; color: #9a7785; font-size: 11px; line-height: 1.6; }

.button { border: 0; cursor: pointer; transition: transform .16s, box-shadow .16s, opacity .16s, border-color .16s, background .16s; }
.button:hover:not(:disabled) { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button.primary { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 55px; margin-top: 17px; border-radius: 17px; color: #fff; background: linear-gradient(105deg, #d93672, #f15f99 58%, #ff8cb4); font-weight: 800; box-shadow: 0 15px 32px rgba(217, 54, 114, .22); }
.button.primary:hover:not(:disabled) { box-shadow: 0 18px 38px rgba(217, 54, 114, .3); }
.button.secondary { min-height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--berry); background: rgba(255, 255, 255, .78); box-shadow: 0 7px 18px rgba(142, 40, 82, .05); }
.button.secondary:hover:not(:disabled), .button.ghost:hover { border-color: var(--line-strong); background: #fff1f6; }
.button.ghost { padding: 7px 11px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; }
.error-box { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(201, 63, 102, .25); border-radius: 14px; color: #a52f53; background: rgba(255, 224, 234, .48); line-height: 1.5; font-size: 13px; }

.stage-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding: 17px; border: 1px solid rgba(240, 91, 150, .16); border-radius: 18px; background: linear-gradient(115deg, rgba(255, 226, 236, .6), rgba(255, 255, 255, .6)); }
.stage-card small, .stage-card strong { display: block; }
.stage-card small { color: var(--muted); }
.stage-card strong { margin-top: 4px; }
.stage-card p { max-width: 54%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.result-card { margin-top: 18px; padding: 19px; border: 1px solid rgba(24, 139, 102, .17); border-radius: 21px; background: rgba(246, 255, 251, .65); }
.result-top, .expiry-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-top small, .result-top strong { display: block; }
.result-top small { color: var(--muted); }
.result-top strong { margin-top: 3px; }
.zero-pill { padding: 6px 10px; color: #116b50; border-color: rgba(24, 139, 102, .22); background: rgba(24, 139, 102, .08); font-size: 11px; }
.qr-layout { display: grid; grid-template-columns: 184px 1fr; gap: 16px; margin-top: 16px; }
.qr-box { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 10px; border: 1px solid rgba(221, 63, 120, .12); border-radius: 19px; color: #a98d99; background: #fff; box-shadow: 0 12px 30px rgba(142, 40, 82, .09); overflow: hidden; }
.qr-box img { display: none; width: 100%; height: 100%; object-fit: contain; }
.qr-box img.ready { display: block; }
.qr-box img.ready + span { display: none; }
.expiry-card { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .7); }
.expiry-card span, .expiry-card small { color: var(--muted); }
.expiry-card strong { color: var(--rose); font-size: 25px; font-variant-numeric: tabular-nums; }
.countdown-track { height: 7px; margin: 15px 0 12px; border-radius: 99px; background: #efdce3; overflow: hidden; }
.countdown-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), #ff8bb4); transition: width .8s linear; }
.expiry-card small { line-height: 1.55; }
.link-block { display: grid; gap: 8px; margin-top: 16px; }
.link-block input { height: 44px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.result-actions .button { width: 100%; }
.regenerate-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px; border: 1px solid rgba(240, 91, 150, .18); border-radius: 16px; background: rgba(255, 226, 236, .5); }
.regenerate-actions .button { flex: 0 0 auto; }
.regenerate-actions small { color: var(--muted); line-height: 1.45; }

.progress-panel { margin-top: 20px; }
.progress-card { margin-top: 18px; padding: 20px; border: 1px solid rgba(240, 91, 150, .15); border-radius: 18px; background: linear-gradient(110deg, rgba(255, 231, 239, .54), rgba(255, 255, 255, .65)); }
.progress-copy { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.progress-copy small, .progress-copy strong { display: block; }
.progress-copy small { color: var(--muted); }
.progress-copy div strong { margin-top: 4px; font-size: 18px; }
.progress-copy > strong { color: var(--rose); font-size: 28px; font-variant-numeric: tabular-nums; }
.task-progress-track { height: 12px; margin-top: 17px; border-radius: 999px; background: #efdae2; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(173, 67, 108, .06); }
.task-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #d93b74, #ff87b1); box-shadow: 0 0 18px rgba(240, 91, 150, .25); transition: width .45s ease; }
.progress-card p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 4px 0; color: #a88694; font-size: 11px; letter-spacing: .04em; }
footer span { color: var(--berry); font-weight: 800; letter-spacing: .15em; }
footer p { margin: 0; }
.hidden { display: none !important; }

html[data-theme="cosmic"] {
  color-scheme: dark;
  --bg: #080313;
  --panel: rgba(13, 5, 31, .78);
  --panel-solid: #160826;
  --panel-soft: rgba(42, 12, 64, .78);
  --line: rgba(220, 118, 255, .25);
  --line-strong: rgba(244, 106, 255, .68);
  --text: #fff7ff;
  --muted: #c9b5d6;
  --pink: #ff55df;
  --rose: #e45dff;
  --berry: #f3c6ff;
  --blush: #4a235f;
  --peach: #8b79ff;
  --green: #55e6b4;
  --red: #ff709e;
  --amber: #ffc766;
  --shadow: 0 26px 80px rgba(1, 0, 10, .52), 0 0 34px rgba(212, 72, 255, .08);
}
html[data-theme="cosmic"] body {
  background:
    linear-gradient(180deg, rgba(5, 1, 16, .62), rgba(10, 3, 23, .9)),
    url("/assets/cosmic-tunnel.webp") center top / cover fixed no-repeat,
    #080313;
}
html[data-theme="cosmic"] body::before {
  opacity: .7;
  background-image:
    radial-gradient(circle at 16% 18%, rgba(112, 91, 255, .24), transparent 26%),
    radial-gradient(circle at 82% 12%, rgba(255, 73, 224, .22), transparent 24%),
    radial-gradient(rgba(255, 222, 255, .25) .65px, transparent .8px);
  background-size: auto, auto, 19px 19px;
  mask-image: linear-gradient(to bottom, #000, rgba(0, 0, 0, .35) 74%, transparent);
}
html[data-theme="cosmic"] .ambient { opacity: .36; filter: blur(115px); }
html[data-theme="cosmic"] .ambient-one { background: #4234ff; }
html[data-theme="cosmic"] .ambient-two { background: #ff3fc9; }
html[data-theme="cosmic"] .hero h1 { background: linear-gradient(105deg, #fff 4%, #c9b6ff 38%, #ff73e7 76%, #fff); background-clip: text; color: transparent; text-shadow: 0 0 38px rgba(225, 93, 255, .13); }
html[data-theme="cosmic"] .eyebrow { border-color: rgba(235, 139, 255, .32); background: rgba(15, 5, 35, .72); box-shadow: 0 0 26px rgba(224, 78, 255, .15); }
html[data-theme="cosmic"] .eyebrow span,
html[data-theme="cosmic"] .status-kicker span { background: linear-gradient(135deg, #7d79ff, #ff5ddd); box-shadow: 0 0 13px rgba(239, 90, 255, .75), 0 0 0 5px rgba(218, 82, 255, .1); }
html[data-theme="cosmic"] .preference-picker select,
html[data-theme="cosmic"] .list-actions select,
html[data-theme="cosmic"] .service-card,
html[data-theme="cosmic"] .api-docs-link { color: var(--text); background: rgba(12, 4, 29, .78); box-shadow: 0 14px 42px rgba(2, 0, 10, .4); backdrop-filter: blur(20px); }
html[data-theme="cosmic"] .api-docs-link:hover { background: rgba(66, 21, 91, .86); }
html[data-theme="cosmic"] select option { color: var(--text); background: #150824; }
html[data-theme="cosmic"] .status-panel,
html[data-theme="cosmic"] .panel { background: var(--panel); }
html[data-theme="cosmic"] .status-panel::after { background: radial-gradient(circle, rgba(220, 80, 255, .22), transparent 70%); }
html[data-theme="cosmic"] .status-grid { border-color: rgba(223, 121, 255, .22); background: linear-gradient(135deg, rgba(26, 8, 54, .86), rgba(10, 4, 27, .92)); }
html[data-theme="cosmic"] .status-cell { background: rgba(130, 88, 161, .24); box-shadow: inset 0 0 0 1px rgba(230, 192, 255, .08); }
html[data-theme="cosmic"] .status-cell.ok { background: linear-gradient(135deg, #8f71ff, #ff4cda); box-shadow: 0 0 13px rgba(240, 73, 255, .65); }
html[data-theme="cosmic"] .legend-empty { background: rgba(158, 117, 183, .35); }
html[data-theme="cosmic"] .metrics div,
html[data-theme="cosmic"] .badge,
html[data-theme="cosmic"] .mini-pill { background: rgba(25, 9, 45, .68); }
html[data-theme="cosmic"] .step { border-color: rgba(229, 122, 255, .28); background: linear-gradient(135deg, rgba(95, 44, 130, .75), rgba(33, 11, 58, .78)); }
html[data-theme="cosmic"] .field > span,
html[data-theme="cosmic"] .link-block > span { color: #ead7f3; }
html[data-theme="cosmic"] input,
html[data-theme="cosmic"] textarea { color: var(--text); background: rgba(11, 4, 27, .75); }
html[data-theme="cosmic"] input:focus,
html[data-theme="cosmic"] textarea:focus { background: rgba(24, 8, 45, .95); box-shadow: 0 0 0 4px rgba(220, 83, 255, .13); }
html[data-theme="cosmic"] input::placeholder,
html[data-theme="cosmic"] textarea::placeholder { color: #927ca2; }
html[data-theme="cosmic"] .email-card,
html[data-theme="cosmic"] .stage-card,
html[data-theme="cosmic"] .regenerate-actions,
html[data-theme="cosmic"] .progress-card { border-color: rgba(225, 109, 255, .24); background: linear-gradient(115deg, rgba(61, 18, 87, .64), rgba(13, 5, 31, .72)); }
html[data-theme="cosmic"] .button.primary { background: linear-gradient(105deg, #704eff, #d347f3 56%, #ff55c8); box-shadow: 0 15px 34px rgba(172, 55, 239, .3); }
html[data-theme="cosmic"] .button.primary:hover:not(:disabled) { box-shadow: 0 18px 42px rgba(214, 69, 244, .4); }
html[data-theme="cosmic"] .button.secondary { color: #f5d9ff; background: rgba(31, 10, 53, .78); box-shadow: 0 8px 24px rgba(2, 0, 9, .25); }
html[data-theme="cosmic"] .button.secondary:hover:not(:disabled),
html[data-theme="cosmic"] .button.ghost:hover { background: rgba(66, 21, 91, .86); }
html[data-theme="cosmic"] .result-card { border-color: rgba(85, 230, 180, .25); background: rgba(7, 35, 35, .62); }
html[data-theme="cosmic"] .expiry-card { background: rgba(20, 7, 38, .75); }
html[data-theme="cosmic"] .countdown-track,
html[data-theme="cosmic"] .task-progress-track { background: rgba(129, 86, 151, .28); }
html[data-theme="cosmic"] .countdown-track span,
html[data-theme="cosmic"] .task-progress-track span { background: linear-gradient(90deg, #7567ff, #ed53ff, #ff61c8); box-shadow: 0 0 18px rgba(232, 82, 255, .4); }
html[data-theme="cosmic"] .privacy-note,
html[data-theme="cosmic"] footer { color: #a991b8; }

@media (max-width: 900px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; align-items: stretch; }
  .preference-controls { justify-content: flex-end; }
  .service-card { width: 100%; }
  .status-head { flex-direction: column; }
  .status-grid { grid-template-columns: repeat(36, minmax(7px, 1fr)); grid-template-rows: repeat(4, 21px); }
  .workspace { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 25px; }
  h1 { font-size: 40px; }
  .preference-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .preference-picker { display: grid; gap: 6px; }
  .preference-picker select { width: 100%; min-width: 0; }
  .api-docs-link { grid-column: 1 / -1; width: 100%; }
  .status-panel, .panel { padding: 17px; border-radius: 22px; }
  .legend { flex-wrap: wrap; }
  .status-grid { grid-template-columns: repeat(24, minmax(6px, 1fr)); grid-template-rows: repeat(6, 18px); gap: 4px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics div { padding: 11px; }
  .inline-field { grid-template-columns: 1fr; }
  .inline-field .button { width: 100%; }
  .field-meta, .stage-card { align-items: flex-start; flex-direction: column; }
  .cdk-metrics { justify-content: flex-start; }
  .stage-card p { max-width: none; }
  .qr-layout { grid-template-columns: 1fr; }
  .qr-box { width: min(230px, 100%); margin: 0 auto; }
  .result-actions { grid-template-columns: 1fr; }
  .regenerate-actions { align-items: stretch; flex-direction: column; }
  .progress-copy { align-items: flex-start; }
  footer { align-items: flex-start; flex-direction: column; }
}
