/*
 * One visual system for the whole builder, taken from the approved app page mockup (docs/design/mockups/app-landing-mockup.html):
 * tokens for light and dark, pill buttons, roomy cards. The page follows the system theme; the top bar's toggle cycles
 * System, Light and Dark and remembers the choice (see theme.ts). Every colour below comes from a token. The editor
 * (docs/design/mockups/app-editor-mockup.html) uses the same tokens, plus a few for code (--code-bg, --hl, --k, --s ...).
 */
:root {
  color-scheme: light;
  --bg: #f8fafd; --surface: #ffffff; --soft: #f0f4f9; --line: #e3e8ef;
  --text: #1f1f1f; --muted: #5f6368; --faint: #80868b;
  --primary: #0b57d0; --primary-soft: #d3e3fd; --on-primary: #ffffff; --on-primary-soft: #0b57d0;
  --ok: #146c2e; --ok-soft: #e6f4ea; --warn: #8a5300; --warn-soft: #fef3e0; --bad: #b3261e; --bad-soft: #fbe3e1;
  --eval: #c5221f; --eval-dot: #d93025; --eval-soft: #fce8e6; --eval-text: #c5221f;
  --scrim: rgba(32, 33, 36, .45); --shadow: rgba(0, 0, 0, .16);
  --radius: 16px;
  --on-fill: #1f1f1f;
  --hl: #eaf6ee; --code-bg: #fbfcfe; --k: #8430ce; --s: #188038; --f: #1967d2; --n: #b06000; --c: #80868b; --t: #c5221f; --g: #1f1f1f;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131314; --surface: #1e1f20; --soft: #282a2c; --line: #3c4043;
  --text: #e3e3e3; --muted: #c4c7c5; --faint: #8e918f;
  --primary: #a8c7fa; --primary-soft: #004a77; --on-primary: #062e6f; --on-primary-soft: #d3e3fd;
  --ok: #6dd58c; --ok-soft: #0f3d1f; --warn: #ffb951; --warn-soft: #3d2b00; --bad: #f2b8b5; --bad-soft: #4a1d1a;
  --eval: #f28b82; --eval-dot: #f28b82; --eval-soft: #3c1f1e; --eval-text: #f6aea9;
  --scrim: rgba(0, 0, 0, .6); --shadow: rgba(0, 0, 0, .5);
  --on-fill: #d3e3fd;
  --hl: rgba(109, 213, 140, .10); --code-bg: #191a1b; --k: #c58af9; --s: #81c995; --f: #8ab4f8; --n: #fcad70; --c: #8e918f; --t: #f28b82; --g: #e3e3e3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131314; --surface: #1e1f20; --soft: #282a2c; --line: #3c4043;
    --text: #e3e3e3; --muted: #c4c7c5; --faint: #8e918f;
    --primary: #a8c7fa; --primary-soft: #004a77; --on-primary: #062e6f; --on-primary-soft: #d3e3fd;
    --ok: #6dd58c; --ok-soft: #0f3d1f; --warn: #ffb951; --warn-soft: #3d2b00; --bad: #f2b8b5; --bad-soft: #4a1d1a;
    --eval: #f28b82; --eval-dot: #f28b82; --eval-soft: #3c1f1e; --eval-text: #f6aea9;
    --scrim: rgba(0, 0, 0, .6); --shadow: rgba(0, 0, 0, .5);
    --on-fill: #d3e3fd;
    --hl: rgba(109, 213, 140, .10); --code-bg: #191a1b; --k: #c58af9; --s: #81c995; --f: #8ab4f8; --n: #fcad70; --c: #8e918f; --t: #f28b82; --g: #e3e3e3;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.55 "Google Sans Text", "Google Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
#root { min-height: 100%; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.sp, .spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
[hidden] { display: none !important; }

/* Buttons: pills. Bare <button> in the editor chrome gets the same look. */
button, .btn, a.button { font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 18px; white-space: nowrap; text-decoration: none; display: inline-block; line-height: 1.4; }
button:hover:not(:disabled), .btn:hover, a.button:hover { background: var(--soft); text-decoration: none; }
button.primary, .btn.primary, a.button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.primary:hover:not(:disabled), .btn.primary:hover, a.button.primary:hover { background: var(--primary); filter: brightness(1.08); }
button.tonal, .btn.tonal { background: var(--primary-soft); border-color: transparent; color: var(--on-primary-soft); }
button.text, .btn.text { border-color: transparent; background: transparent; color: var(--primary); padding: 6px 10px; }
button.text:hover:not(:disabled), .btn.text:hover { background: var(--soft); }
button.danger, .btn.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled), button.ghost.active { background: var(--primary-soft); color: var(--on-primary-soft); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input, textarea, select { font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
input[type=checkbox] { padding: 0; accent-color: var(--primary); }
input:disabled, textarea:disabled, select:disabled { opacity: .65; }
textarea { width: 100%; }

.badge, .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--muted); font-weight: 500; white-space: nowrap; }
.pill.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.green, .pill.green { background: var(--ok-soft); color: var(--ok); }
.badge.red, .pill.red { background: var(--bad-soft); color: var(--bad); }
.badge.amber, .pill.amber { background: var(--warn-soft); color: var(--warn); }
.badge.gray, .pill.gray { background: var(--soft); color: var(--muted); }
.badge { font-size: 12px; padding: 1px 8px; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 32px; }
.topbar .brand { font-weight: 500; font-size: 17px; color: var(--text); }
.topbar .env { font-size: 11px; background: var(--warn-soft); color: var(--warn); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.topbar .who { color: var(--muted); font-size: 14px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 999px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #c2e7ff; color: #001d35; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }

.page { padding: 8px 32px 64px; max-width: 1000px; margin: 0 auto; width: 100%; }
.login { margin: 12vh auto; width: 360px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; }
.login h1 { margin: 0 0 4px; font-size: 22px; font-weight: 400; }
.login .note { margin-top: 14px; font-size: 13px; color: var(--muted); }
.err { color: var(--bad); margin-top: 10px; }

/* App list */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin-top: 20px; }
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; cursor: pointer; }
.app-card:hover { border-color: var(--primary); }
.app-card h3 { margin: 0 0 2px; font-size: 17px; font-weight: 500; }
.app-card .meta { color: var(--muted); font-size: 13px; margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.newapp { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; flex-wrap: wrap; }
.newapp input { flex: 1; min-width: 140px; }
.page h2.title { margin: 24px 0 16px; font-size: 28px; font-weight: 400; letter-spacing: -.01em; }

/* App page */
header.app { display: flex; gap: 20px; align-items: center; padding: 24px 0 8px; flex-wrap: wrap; }
.app-icon { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, #4285f4, #34a853); display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 500; flex: none; }
header.app h1 { font-size: 28px; font-weight: 400; margin: 0; letter-spacing: -.01em; }
header.app h1 .pill { margin-left: 10px; vertical-align: middle; }
.desc { color: var(--muted); margin: 2px 0 0; }
.actions { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 24px 0 32px; overflow-x: auto; }
nav.tabs a { padding: 12px 16px; color: var(--muted); font-weight: 500; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
nav.tabs a:hover { text-decoration: none; color: var(--text); }
nav.tabs a.on { color: var(--primary); border-color: var(--primary); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 12px; line-height: 20px; text-align: center; margin-left: 4px; }
.ob-title { font-size: 14px; font-weight: 500; margin: 22px 0 6px; }
.choice.two { grid-template-columns: repeat(2, 1fr); margin: 14px 0 6px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; }
.domain.mono { font-size: 14px; }
.ob-calls td { vertical-align: top; }
.add-host { display: flex; gap: 10px; align-items: center; margin: 12px 0 4px; }
.add-host input[type=text] { flex: 1; min-width: 160px; }
nav.tabs a.on .count { background: var(--primary-soft); color: var(--on-primary-soft); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 20px; }
.card h2 { font-size: 18px; font-weight: 500; margin: 0 0 4px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.live { display: flex; align-items: center; gap: 16px; }
.live .url { font-size: 18px; overflow-wrap: anywhere; }
.live .meta { color: var(--muted); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.stat .n { font-size: 28px; font-weight: 400; }
.stat .n.ok { color: var(--ok); }
.stat .n.warn { color: var(--warn); }
.stat .l { color: var(--muted); font-size: 14px; }
.stat a { font-size: 13px; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
ul.plain li:first-child { border-top: 0; }
.when { color: var(--faint); font-size: 13px; min-width: 110px; }
.timeline li { align-items: center; }
.vdot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--faint); flex: none; }
.vdot.live { border-color: var(--ok); background: var(--ok); }
.domain { font-size: 16px; overflow-wrap: anywhere; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.opt { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; text-align: left; background: transparent; font-weight: 400; white-space: normal; display: block; }
.opt b { display: block; font-weight: 500; }
.opt span { color: var(--muted); font-size: 13px; }
.opt.on { border: 2px solid var(--primary); background: var(--primary-soft); padding: 13px 15px; }
.opt.on span { color: var(--on-primary-soft); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.chip { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 13px; background: var(--soft); }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.field input[type=text], .field select { width: 100%; }
.field .help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: none; border-radius: 0; background: transparent; color: var(--muted); padding: 6px 14px; font-size: 13px; }
.seg button.active { background: var(--primary-soft); color: var(--on-primary-soft); font-weight: 500; }
.seg button:disabled { opacity: .4; }
nav.subnav { display: flex; gap: 6px; margin: -8px 0 20px; flex-wrap: wrap; }
nav.subnav a { padding: 6px 16px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 500; }
nav.subnav a:hover { background: var(--soft); text-decoration: none; }
nav.subnav a.on { background: var(--primary-soft); color: var(--on-primary-soft); }
.person { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person select { width: 150px; padding: 7px 10px; }
.recs { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 4px; }
.recs th { text-align: left; color: var(--faint); font-weight: 500; padding: 6px 8px; font-size: 12px; }
.recs td { padding: 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.recs td.v { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.copy { border: 1px solid var(--line); background: var(--surface); color: var(--primary); border-radius: 8px; padding: 3px 10px; font-size: 12px; }
.empty-state { text-align: center; padding: 40px 24px; color: var(--muted); }
.empty-state h2 { color: var(--text); font-size: 18px; font-weight: 500; margin: 0 0 6px; }
.hint-row { background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.ga { display: flex; gap: 14px; align-items: center; padding: 8px 0; }
.ga .ic { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; flex: none; }
.ga select { width: auto; border: 0; padding: 0; font-weight: 500; background: transparent; }
.add-people { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.add-people input[type=email] { flex: 1; min-width: 180px; }
.add-people label { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.manifest-source { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 280px; resize: vertical; }
.diagnostics { margin-top: 10px; font-size: 13px; color: var(--bad); }

/* Alerts */
.alerts { padding: 0 32px; max-width: 1000px; margin: 0 auto; width: 100%; }
.alert { margin-top: 8px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--bad); background: var(--bad-soft); color: var(--text); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.alert.warning { border-color: var(--warn); background: var(--warn-soft); }
.alert .msg { flex: 1; min-width: 220px; }
.alert details { width: 100%; font-size: 13px; color: var(--muted); }
.lock { margin: 12px 32px 0; padding: 10px 16px; background: var(--warn-soft); border: 1px solid var(--warn); border-radius: 14px; }

/* Dialogs and menus */
.overlay { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 20; }
.dialog { background: var(--surface); border-radius: 28px; width: min(560px, 94vw); max-height: 84vh; overflow: auto; padding: 28px 32px; box-shadow: 0 8px 32px var(--shadow); }
.dialog.share { width: min(600px, 94vw); }
.dialog h2, .dialog h3 { font-size: 22px; font-weight: 400; margin: 0 0 16px; }
.dialog-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.dialog .section-title { font-weight: 500; margin: 20px 0 4px; }
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 16px; line-height: 1.3; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { color: var(--primary); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.menu-list button { border: none; text-align: left; background: transparent; padding: 9px 12px; border-radius: 8px; font-weight: 400; }
.menu-list button:hover:not(:disabled) { background: var(--soft); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; z-index: 40; max-width: 80vw; }
.toast.error { background: var(--bad); color: #fff; }
.waking { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); padding: 8px 16px; border-radius: 999px; z-index: 41; box-shadow: 0 2px 8px var(--shadow); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--muted); padding: 16px; text-align: center; }

/* Panels inside the editor's drawers (Checks, Scheduled task runs, AI use). */
.panel .lead { margin: 0 0 16px; color: var(--muted); }
.panel h4 { margin: 24px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.panel th, .panel td { padding: 9px 8px; }
.panel .diag { padding: 10px 0; font-size: 13.5px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.diag { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.meter { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.meter div { height: 100%; background: var(--primary); }

/* Preview links: the app page's Previews tab. */
.plinks li { align-items: center; padding: 16px 0; }
.plinks .t { font-weight: 500; }
.plinks .m { color: var(--muted); font-size: 13px; margin-top: 2px; }
.plinks .tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); margin-left: 6px; font-weight: 500; vertical-align: 1px; }
.plinks .tag.main { background: var(--primary-soft); color: var(--on-primary-soft); }
.plinks .exp { color: var(--muted); font-size: 13px; min-width: 96px; text-align: right; }
.plinks .exp.soon { color: var(--warn); }
.plinks .menu summary { border-color: transparent; background: transparent; color: var(--primary); font-size: 14px; font-weight: 500; padding: 6px 10px; }
.rel { position: relative; }

@media (max-width: 900px) {
  .topbar, .page, .alerts { padding-left: 16px; padding-right: 16px; }
  .stats, .choice { grid-template-columns: 1fr; }
  .actions { margin-left: 0; }
}

/* ---- Editor (docs/design/mockups/app-editor-mockup.html) -------------------------------------- */
body.in-editor { overflow: hidden; }
body.in-editor #root { height: 100%; }
.ed { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ed .alerts { padding: 0 24px; }
.ed .lock { margin: 0 24px 12px; }
.etop { display: flex; align-items: center; gap: 14px; padding: 12px 24px; flex: none; }
.etop .btn { padding: 9px 18px; }
.crumb { color: var(--muted); font-size: 14px; }
.crumb:hover { text-decoration: none; }
.crumb b { color: var(--text); font-weight: 500; font-size: 16px; }
.mini-icon { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #4285f4, #34a853); display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 500; }
.ed .pill { padding: 3px 10px; }
.ed button.vpill { border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; padding: 3px 10px; margin-left: 10px; }
.ed button.pill.amber:hover:not(:disabled) { background: var(--warn-soft); filter: brightness(.97); }
.ed button.pill.green:hover:not(:disabled) { background: var(--ok-soft); filter: brightness(.97); }
.ed button.pill.gray:hover:not(:disabled) { background: var(--soft); filter: brightness(.97); }
.main { flex: 1; display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; padding: 0 24px 20px; min-height: 0; }
.ed .pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; }

.msgs { flex: 1; overflow: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 14px; }
.me { align-self: flex-end; background: var(--primary-soft); color: var(--on-fill); padding: 10px 14px; border-radius: 18px 18px 4px 18px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.bot { max-width: 100%; }
.bot p { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bot.fail { background: var(--bad-soft); color: var(--bad); padding: 10px 14px; border-radius: 14px; }
.review { margin-top: 10px; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); border-radius: 14px; }
.review ul { margin: 6px 0 10px 18px; padding: 0; }
.meta { color: var(--faint); font-size: 12px; }
.meta a { color: var(--primary); }
.steps2 { list-style: none; margin: 6px 0 0; padding: 0; }
.steps2 li { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; color: var(--muted); }
.steps2 .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; flex: none; }
.steps2 .done .ic { background: var(--ok-soft); color: var(--ok); }
.steps2 .run .ic { border: 2px solid var(--primary); border-right-color: transparent; animation: spin .8s linear infinite; }
.steps2 .run { color: var(--text); font-weight: 500; }
.steps2 .todo .ic { border: 2px solid var(--line); }
.changes { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-top: 8px; background: var(--bg); }
.changes .h { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.changes ul { list-style: none; margin: 8px 0 10px; padding: 0; font-size: 13px; }
.changes li { display: flex; gap: 8px; padding: 2px 0; color: var(--muted); }
.changes li .fn { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.changes .add { color: var(--ok); }
.changes .del { color: var(--bad); }
.chiprow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sugg { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 400; color: var(--muted); background: var(--surface); }
.acts { display: flex; gap: 2px; margin-top: 6px; position: relative; flex-wrap: wrap; }
.act { border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 13px; font-weight: 500; padding: 4px 8px; border-radius: 999px; }
.act:hover:not(:disabled) { background: var(--soft); }
.act.bad { color: var(--bad); }
.welcome { margin: auto; text-align: center; padding: 24px; max-width: 320px; }
.welcome h3 { margin: 0 0 8px; font-size: 20px; font-weight: 400; }
.welcome p { margin: 0 0 20px; color: var(--muted); }
.chips { display: flex; flex-direction: column; gap: 10px; }
.chips button { background: var(--soft); }

.composer { border-top: 1px solid var(--line); padding: 14px 16px 12px; margin: 0; }
.cbox { border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px; background: var(--bg); }
.cbox:focus-within { border-color: var(--primary); }
.cbox textarea { display: block; border: 0; background: transparent; padding: 0; min-height: 44px; max-height: 160px; width: 100%; resize: none; color: var(--text); outline: none; line-height: 1.55; }
.cbox textarea::placeholder { color: var(--faint); }
.cbox textarea:disabled { opacity: 1; }
.cbox .row { gap: 8px; }
.ibtn { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; padding: 0; }
.ibtn:hover:not(:disabled) { background: var(--soft); }
.ibtn:disabled { opacity: 1; cursor: not-allowed; }
.send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); font-size: 16px; padding: 0; }
.send:hover:not(:disabled) { background: var(--primary); filter: brightness(1.08); }
.stop { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); padding: 0; display: grid; place-items: center; }
.stop::after { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--text); }
.foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 12px; margin-top: 8px; }

.ptabs { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex: none; }
.ptabs .t { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 14px; }
.ptabs .t:hover:not(.on) { background: var(--soft); }
.ptabs .t.on { background: var(--primary-soft); color: var(--on-fill); }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg2 button { border: 0; border-radius: 0; background: transparent; padding: 5px 12px; font-size: 13px; font-weight: 400; color: var(--muted); }
.seg2 button.on { background: var(--soft); color: var(--text); font-weight: 500; }
.seg2 button:disabled { opacity: .4; }
.urlbar { display: flex; align-items: center; gap: 8px; background: var(--soft); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); min-width: 0; margin-right: 4px; }
.urlbar .u { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.center-body > .empty { padding: 48px 24px; }
.stage { flex: 1; background: var(--bg); display: flex; justify-content: center; padding: 20px; overflow: hidden; position: relative; min-height: 0; }
.frame { background: #fff; color: #1f1f1f; border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 100%; height: 100%; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.frame.mobile { width: 390px; }
.preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.updating { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); z-index: 1; }

.emenu { position: absolute; right: 16px; top: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px var(--shadow); padding: 6px; width: 260px; display: none; z-index: 5; }
.emenu.on { display: block; }
.emenu .mi { display: block; width: 100%; text-align: left; border: 0; border-radius: 8px; background: transparent; padding: 9px 12px; font-size: 14px; font-weight: 400; color: var(--text); white-space: normal; }
.emenu .mi:hover { background: var(--soft); text-decoration: none; }
.emenu .sep { border-top: 1px solid var(--line); margin: 4px 0; }
.pop { position: absolute; left: 0; top: 34px; width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px var(--shadow); padding: 14px 16px; z-index: 6; display: none; }
.pop.on { display: block; }
.pop.share { left: auto; right: 0; top: 46px; width: 400px; }
.pop .link { display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; margin: 8px 0; }
.pop .link span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 32px var(--shadow); padding: 22px 24px; overflow: auto; z-index: 10; }
.drawer h2 { font-size: 20px; font-weight: 400; margin: 0 0 4px; }
.vrow { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.vrow:first-of-type { border-top: 0; }
.vrow .vdot { margin-top: 7px; }
.vdot.cur { border-color: var(--primary); background: var(--primary); }

.code-tab { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.tree { border-right: 1px solid var(--line); padding: 12px 8px; overflow: auto; font-size: 13.5px; display: flex; flex-direction: column; gap: 0; }
.tf { display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 400; text-align: left; white-space: nowrap; line-height: 1.55; }
.tf:hover:not(:disabled) { background: var(--soft); }
.tf.dir { color: var(--muted); }
.tf.on { background: var(--primary-soft); color: var(--on-fill); }
.tf.gone { text-decoration: line-through; opacity: .7; }
.tf .mark { margin-left: auto; font-size: 11px; font-weight: 600; padding-left: 8px; }
.tf .mark.modified { color: var(--warn); }
.tf .mark.added { color: var(--ok); }
.tf .mark.removed { color: var(--bad); }
.code-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--code-bg); }
.etabs { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--surface); flex-wrap: wrap; }
.etabs b { color: var(--text); font-weight: 500; }
.etabs select { padding: 2px 6px; font-size: 12px; }
.code-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.code-body .cm-editor { flex: 1; min-height: 0; font-size: 12.5px; }
.code-body .cm-scroller { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; }
.code-body .empty { color: #7f848e; }
.code-body .diff { background: #282c34; color: #abb2bf; padding: 4px 0; font-size: 12.5px; }
.code-body .diff .add, .diff .add { background: #1e3a2a; color: #b5e8c4; }
.code-body .diff .del, .diff .del { background: #43262a; color: #f3b8b8; }
.code-body .diff .sep, .diff .sep { background: #21252b; color: #7f848e; padding: 2px 12px; }
.diff-notes { padding: 6px 12px; background: #21252b; border-bottom: 1px solid #181a1f; font-size: 12.5px; }
.note { padding: 2px 0; color: #9da5b4; }
.note.warn { color: #f0d27a; }

/* Settings > Variables: the list, the Add, Edit, Set and Replace dialogs, and the Provided by PGA card. */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.sechead { align-items: flex-start; margin-bottom: 12px; }
.sechead h2 { margin: 0; }
.lockbar { display: flex; gap: 10px; align-items: flex-start; background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--muted); margin: 0 0 14px; }
table.vars { width: 100%; border-collapse: collapse; font-size: 14px; }
.vars th { text-align: left; color: var(--faint); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.vars td { padding: 12px 10px; border-top: 1px solid var(--line); border-bottom: 0; vertical-align: top; }
.vars tr:first-child td { border-top: 0; }
.vname { font-weight: 500; overflow-wrap: anywhere; }
.vars td.upd { white-space: nowrap; }
.vars td.acts2 { text-align: right; white-space: nowrap; }
.vars .val { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.btn.set { padding: 6px 14px; }
.kind { font-size: 12px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.kind.sec { border-color: transparent; background: var(--primary-soft); color: var(--on-primary-soft); }
.mask { letter-spacing: 2px; color: var(--muted); }
.need { color: var(--warn); font-weight: 500; }
.sub2 { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.sub2.block { display: block; }
.var-foot { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.meter-wrap { display: inline-flex; align-items: center; gap: 8px; }
.var-foot .meter { width: 120px; margin: 0; height: 6px; display: inline-block; }
.meter i { display: block; height: 100%; background: var(--primary); }
table.pga-list { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.pga-list td { padding: 7px 10px; border-top: 1px solid var(--line); border-bottom: 0; }
.pga-list td:first-child { width: 34%; }
.pga-list td:last-child { overflow-wrap: anywhere; }
.pga-list tr:first-child td { border-top: 0; }

.dialog.var { width: min(600px, 94vw); }
.dialog.var:not(.is-secret) .secret-only { display: none; }
.dialog .toggle-row { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
button.switch { width: 40px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: var(--primary); position: relative; flex: none; }
button.switch::after { content: ""; position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
button.switch:hover:not(:disabled) { background: var(--primary); }
button.switch.off, button.switch.off:hover:not(:disabled) { background: var(--line); }
button.switch.off::after { left: 3px; right: auto; }
.dialog .secure { display: flex; gap: 10px; align-items: center; background: var(--ok-soft); color: var(--ok); border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 18px; }
.dialog .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.dialog .two .field { margin-bottom: 8px; min-width: 0; }
.dialog .pw { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 0 6px 0 14px; background: var(--surface); }
.dialog .pw:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.dialog .pw input { border: 0; padding: 10px 0; flex: 1; min-width: 0; width: auto; background: transparent; color: var(--text); font: inherit; outline: none; }
.dialog .pw input[type=password]:not(:placeholder-shown) { letter-spacing: 3px; }
.dialog .check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 10px 0; }
.dialog .check input { margin-top: 4px; }
.dialog .field input[readonly] { background: var(--soft); }
@media (max-width: 600px) { .dialog .two { grid-template-columns: 1fr; } }
/* Observability (docs/design/mockups/observability-mockup.html and observability-settings-mockup.html), same tokens as above.
   Trace span colours are the one fixed palette: they are data colours, the same in light and dark. */
.page.wide { max-width: 1120px; }
.topbar .navlink { color: var(--muted); font-weight: 500; font-size: 14px; padding: 6px 10px; border-radius: 999px; }
.topbar .navlink:hover { background: var(--soft); text-decoration: none; }
.admin-icon { background: linear-gradient(135deg, #5f6368, #0b57d0); }
nav.subnav.views { align-items: center; margin: -12px 0 24px; }
nav.subnav.views a { padding: 6px 14px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
nav.subnav.views a:hover { color: var(--text); background: var(--surface); }
nav.subnav.views a.on { border-color: transparent; background: var(--primary-soft); color: var(--on-primary-soft); }
nav.subnav.views .seg { margin-left: 4px; }
.curset { display: flex; justify-content: flex-end; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); margin: -14px 0 18px; flex-wrap: wrap; }
.curset a { font-weight: 500; }
.obs-empty { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.obs-empty b { color: var(--text); font-weight: 500; font-size: 15px; }
.opt .cost.none { font-size: 14px; color: var(--muted); margin: 8px 0 4px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stats.five { grid-template-columns: repeat(5, 1fr); gap: 16px; }
.stat .n.s { font-size: 24px; }
.stat .d { font-size: 12px; margin-top: 2px; }
.good { color: var(--ok); } .bad { color: var(--bad); } .flat { color: var(--faint); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid2 > .card, .grid32 > .card { margin-bottom: 0; }
.grid32 { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; margin-bottom: 20px; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; color: var(--faint); font-weight: 500; padding: 8px; font-size: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.t tr:first-child td { border-top: 0; }
table.t td.r, table.t th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.sel td { background: var(--soft); }
table.t tr.sum td { font-weight: 500; }
table.t tr.gap td { color: var(--warn); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); font-weight: 500; white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.bad { background: var(--soft); color: var(--bad); }
.tag.p { background: var(--primary-soft); color: var(--on-primary-soft); }
.hbar { height: 8px; border-radius: 999px; background: var(--soft); overflow: hidden; min-width: 80px; }
.hbar b { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.banner { display: flex; gap: 24px; flex-wrap: wrap; background: var(--soft); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin: 0 0 14px; }
.banner b { font-weight: 500; color: var(--text); } .banner span { color: var(--muted); }
.wf { font-size: 13px; }
.wf .hd, .wf .rw { display: grid; grid-template-columns: minmax(200px, 380px) 1fr 70px; align-items: center; gap: 10px; }
.wf .hd { color: var(--faint); font-size: 12px; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.wf .rw { padding: 6px 0; border-top: 1px solid var(--line); }
.wf .hd + .rw { border-top: 0; }
.wf .rw.sel { background: var(--soft); border-radius: 8px; }
.wf .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf .trk { position: relative; height: 16px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%); }
.wf .bar { position: absolute; top: 3px; height: 10px; border-radius: 4px; }
.wf .du { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.c-browser { background: #7b61ff; } .c-edge { background: #9aa0a6; } .c-platform { background: var(--primary); } .c-app { background: #34a853; }
.c-db { background: #f29900; } .c-egress { background: #12a4af; } .c-ai { background: #d93025; } .c-tool { background: #a142f4; }
:root[data-theme="dark"] .c-ai { background: #f28b82; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-ai { background: #f28b82; } }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
.obs-lock { display: flex; gap: 10px; align-items: center; background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .chip { background: var(--surface); }
.filters input { width: 260px; padding: 7px 12px; border-radius: 999px; font-size: 13px; }
.log { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.log .ln { display: grid; grid-template-columns: 96px 52px 150px 1fr 90px; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); align-items: baseline; }
.log .ln:first-child { border-top: 0; }
.lv { font-weight: 600; } .lv.e { color: var(--bad); } .lv.w { color: var(--warn); } .lv.i { color: var(--muted); }
.fun .st { padding: 6px 0; }
.fun .st .lb { display: flex; font-size: 14px; margin-bottom: 4px; }
.fun .st .lb span:last-child { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.fun .fb { height: 22px; border-radius: 8px; background: var(--primary); }
.fun .drop { font-size: 12px; color: var(--faint); margin-top: 8px; }
table.ret { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; width: 100%; }
table.ret th { color: var(--faint); font-weight: 500; font-size: 12px; text-align: center; padding: 4px; }
table.ret th:first-child { text-align: left; }
table.ret td { text-align: center; padding: 7px 4px; border-radius: 6px; font-variant-numeric: tabular-nums; }
table.ret td.c0 { text-align: left; color: var(--muted); }
.gauge { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; margin: 8px 0 4px; }
.gauge b { display: block; height: 100%; background: var(--ok); }
.gate { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.gate:first-of-type { border-top: 0; }
.gate .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 15px; }
.gate .ic.bad { background: var(--soft); color: var(--bad); } .gate .ic.ok { background: var(--ok-soft); color: var(--ok); } .gate .ic.warn { background: var(--warn-soft); color: var(--warn); }
.spark { vertical-align: middle; }

/* Observability settings: big choices that show their monthly cost. */
.opt { position: relative; cursor: pointer; font: inherit; }
div.opt { cursor: default; }
/* A button centres its content; a choice card reads from the top. */
button.opt { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: left; }
button.opt.on:hover:not(:disabled) { background: var(--primary-soft); }
.presets.ev button.opt.on:hover:not(:disabled) { background: var(--eval-soft); }
.opt .cost { display: block; font-size: 20px; font-weight: 400; margin: 4px 0 2px; color: var(--text); }
.opt.on .cost { color: var(--primary); }
.opt .cost small { font-size: 13px; color: var(--muted); }
.opt .def { position: absolute; top: 10px; right: 12px; }
:root[data-theme="dark"] .opt.on .cost { color: var(--on-primary-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .opt.on .cost { color: var(--on-primary-soft); } }
.choice.two { grid-template-columns: repeat(2, 1fr); }
.caps { display: flex; gap: 10px; align-items: center; margin-top: 14px; font-size: 14px; flex-wrap: wrap; }
.caps .opt { padding: 8px 18px; border-radius: 999px; }
.caps .opt.on { padding: 7px 17px; }
.drv td { padding: 10px 8px; vertical-align: top; }
.drv td.why { color: var(--muted); font-size: 13px; }
.drv tr.sum td { border-top: 2px solid var(--line); }
.ro li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ro li:first-child { border-top: 0; } .ro li span:last-child { margin-left: auto; color: var(--muted); text-align: right; }
.stat .l .tag { margin-left: 6px; vertical-align: 1px; }

/* Platform admin settings */
.setgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 16px; margin-top: 58px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.presets .opt .cost { margin: 6px 0 2px; }
.presets.ev .opt.on { border-color: var(--eval); background: var(--eval-soft); }
.presets.ev .opt.on .cost { color: var(--eval); }
.presets.ev .opt.on span { color: var(--eval-text); }
.lv-row { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); align-items: start; }
.obs-settings .card > .lv-row:first-child { border-top: 0; padding-top: 0; }
.obs-settings .card > .lv-row:last-child { padding-bottom: 0; }
.lv-row .nm { font-weight: 500; font-size: 14px; }
.lv-row .help { color: var(--muted); font-size: 13px; margin-top: 3px; }
.lv-row .ctl select { width: 100%; padding: 8px 12px; font-size: 14px; }
.lv-row .est { font-size: 12px; color: var(--faint); margin-top: 6px; text-align: right; font-variant-numeric: tabular-nums; }
.lv-row .est b { color: var(--muted); font-weight: 500; }
.lv-row.locked .nm::before { content: "🔒 "; font-size: 12px; }
.lockval { display: block; background: var(--soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; color: var(--muted); }
.why { display: block; font-size: 12px; color: var(--warn); margin-top: 4px; }
.ptag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--on-primary-soft); margin-left: 6px; vertical-align: 1px; }
.sw { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; border: 0; background: transparent; padding: 0; border-radius: 0; }
.sw:hover:not(:disabled) { background: transparent; }
.switch { width: 40px; height: 24px; border-radius: 999px; background: var(--primary); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.switch.off { background: var(--line); } .switch.off::after { left: 3px; right: auto; }
h3.grp { font-size: 13px; font-weight: 500; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 28px 0 10px; }
.sbar { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 16px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.tile .n { font-size: 34px; font-weight: 400; letter-spacing: -.01em; line-height: 1.15; margin-top: 4px; }
.tile .n small { font-size: 14px; color: var(--muted); }
.tile .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tile.t .n { color: var(--primary); } .tile.e .n { color: var(--eval); }
.tile .dot, .sumblock .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.evrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.evrow .nm { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.evrow .help { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.warnline { font-size: 12.5px; color: var(--warn); margin-top: 10px; min-height: 18px; }
.drivers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; margin-top: 6px; }
.drivers div { font-size: 13px; color: var(--muted); } .drivers b { display: block; color: var(--text); font-weight: 500; font-size: 13.5px; }
.sumblock { padding: 10px 0; border-top: 1px solid var(--line); } .sumblock:first-of-type { border-top: 0; }
.sumblock .hdr { display: flex; align-items: baseline; gap: 8px; }
.sumblock .hdr .v { margin-left: auto; font-size: 24px; font-weight: 400; }
.brk { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.brk td { padding: 5px 0; vertical-align: middle; }
.brk td.r { text-align: right; font-variant-numeric: tabular-nums; width: 70px; }
.brk td.b { width: 110px; padding: 0 10px; }

@media (max-width: 900px) {
  .grid2, .grid32, .setgrid, .evrow, .drivers { grid-template-columns: 1fr; }
  .stats.four, .stats.five, .tiles, .presets { grid-template-columns: repeat(2, 1fr); }
  .lv-row { grid-template-columns: 1fr; }
  .sticky { position: static; margin-top: 0; }
  .log .ln { grid-template-columns: 80px 48px 1fr; }
  .log .ln span:nth-child(4), .log .ln a, .log .ln > span:last-child { grid-column: 1 / -1; }

.code-body .cm-editor { flex: 1; min-height: 0; }
.code-body .empty { color: var(--faint); }
.code-body .diff { font: 13px/1.65 "Google Sans Mono", "Roboto Mono", ui-monospace, Menlo, monospace; padding: 14px 0; overflow: auto; flex: 1; color: var(--g); }
.diff div { padding: 0 14px; white-space: pre; }
.diff .add { background: var(--hl); box-shadow: inset 3px 0 0 var(--ok); }
.diff .del { background: var(--bad-soft); box-shadow: inset 3px 0 0 var(--bad); }
.diff .sep { color: var(--c); font-style: italic; }
.diff-notes { padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 12.5px; }
.note { padding: 2px 0; color: var(--muted); }
.note.warn { color: var(--warn); }

@media (max-width: 900px) {
  body.in-editor { overflow: auto; }
  .ed { height: auto; min-height: 100%; }
  .etop { flex-wrap: wrap; padding: 12px 16px; }
  .main { grid-template-columns: 1fr; padding: 0 16px 24px; }
  .ed .pane { min-height: 480px; }
  .code-tab { grid-template-columns: 1fr; }
}
