/* Copyright 2026 Dualarte Services LLC.  All Rights Reserved. */

/* GraftStudio web app. Same palette as graftstudio.gg: green is what shipped, amber is what a patch changes, red is
   an error, and nothing else gets a colour. Plain CSS, light and dark through prefers-color-scheme, no inline styles
   anywhere (CSP). */
/* The site's fonts, vendored (latin subset, variable weight, SIL Open Font License: see fonts/*-LICENSE.txt). */
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/public-sans-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Public Sans"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("fonts/public-sans-latin-wght-italic.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  color-scheme: light dark;
  --ground: #f3f5f1;
  --surface: #ffffff;
  --surface-2: #e6ebe4;
  --ink: #17212c;
  --muted: #55616c;
  --line: #cfd8cf;
  --field-line: #78887e; /* form control borders: at least 3:1 against the surface (WCAG 1.4.11); --line is for rules */
  --sap: #2f6d22;
  --sap-soft: #dcebd3;
  --scion: #8a5600;
  --scion-fill: #e9a42c;
  --scion-soft: #fbeccb;
  --bad: #9e321b;
  --bad-soft: #f6e1dc;
  --code-bg: #17212c;
  --code-ink: #dce6dd;

  --f-body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-brand: "Bricolage Grotesque", var(--f-body);
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #10181f;
    --surface: #16212b;
    --surface-2: #1d2a36;
    --ink: #e3eae4;
    --muted: #9aa9b5;
    --line: #2a3a49;
    --field-line: #6f8394;
    --sap: #92cf70;
    --sap-soft: #1d3320;
    --scion: #f0b445;
    --scion-fill: #f0b445;
    --scion-soft: #3a2b0f;
    --bad: #ef8b70;
    --bad-soft: #3a1c16;
    --code-bg: #0a1118;
    --code-ink: #d6e2d8;
  }
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--sap); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
/* Prose keeps the underline, so a link is told apart without colour. In lists, tables and chip rows every item is a
   link anyway: no underline at rest, the underline comes back on hover and keyboard focus. */
table.grid a:not(.term), table.table a:not(.term), ul.plain a:not(.term), .chips a { text-decoration: none; }
table.grid a:not(.term):hover, table.grid a:not(.term):focus-visible, table.table a:not(.term):hover, table.table a:not(.term):focus-visible,
ul.plain a:not(.term):hover, ul.plain a:not(.term):focus-visible { text-decoration: underline; text-decoration-thickness: 1px; }
table.grid a.btn, table.table a.btn, ul.plain a.btn { text-decoration: none; }
:focus-visible { outline: 2px solid var(--sap); outline-offset: 2px; border-radius: 3px; }
code, pre, .mono { font-family: var(--f-mono); font-size: 0.88em; }
:not(pre) > code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
code.wrap { word-break: break-all; }
pre { background: var(--code-bg); color: var(--code-ink); border-radius: 6px; padding: 12px 14px; overflow: auto; max-height: 28rem; line-height: 1.6; tab-size: 4; margin: 0 0 12px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0.2rem 0 1rem; letter-spacing: -0.02em; }
h2 { font-size: 1.12rem; font-weight: 700; margin: 0 0 0.7rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1.1rem 0 0.4rem; }
h1 code, h3 code { font-size: 0.86em; }
p { margin: 0 0 0.8em; }
details > summary { cursor: pointer; color: var(--muted); }
details[open] > summary { margin-bottom: 6px; }
.muted { color: var(--muted); }
abbr.term, a.term { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; color: inherit; }
a.term:hover, a.term:focus-visible { color: var(--sap); }
details.disclosure > summary { color: var(--ink); font-weight: 700; font-size: 1.12rem; }
details.disclosure[open] > summary { margin-bottom: 0.7rem; }
.scopes { flex-direction: column; gap: 6px; }
.scope { display: flex; flex-direction: column; }
.foot { max-width: var(--max); margin: 0 auto; padding: 0 20px 24px; font-size: 0.88rem; }
.foot a { color: var(--muted); }
time { white-space: nowrap; }
dl.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; max-width: 62rem; }
dl.glossary dt { font-weight: 600; }
dl.glossary dd { margin: 0; }
@media (max-width: 520px) { dl.glossary { grid-template-columns: 1fr; gap: 0; } dl.glossary dd { margin-bottom: 10px; } }
h1 .muted { font-weight: 400; font-size: 0.7em; letter-spacing: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 30; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.lede { color: var(--muted); max-width: 62rem; }
.back { margin: 0 0 2px; font-size: 0.9rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--ink); }

/* header: brand row, then the project's tabs (work on the left, setup on the right) */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; max-width: var(--max); margin: 0 auto; padding: 10px 20px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 1.2rem var(--f-brand); letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.brand img { display: block; }
.org { padding-left: 14px; border-left: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 6px; }
.bar a.navlink { text-decoration: none; color: var(--muted); padding: 2px 4px; font-size: 0.95rem; }
.bar a.navlink:hover, .bar a.navlink[aria-current="page"] { color: var(--ink); }
.bar a.navlink[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--scion-fill); text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* On a phone the address shortens with an ellipsis (full address in the tooltip) and, on the narrowest screens, the role
   badge goes, so the header stays on two short lines. */
@media (max-width: 700px) {
  .bar { padding: 8px 12px; }
  .bar .who { flex: 0 1 auto; min-width: 0; }
  .who .email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .org { border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) { .who .badge { display: none; } }
/* The tabs scroll sideways when they do not fit. A shadow at an edge says there are more tabs that way: the covers
   (background-attachment: local) move with the tabs and hide the shadow once the end is reached. No script. */
.tabs { display: flex; flex-wrap: nowrap; gap: 2px; max-width: var(--max); margin: 0 auto; padding: 0 12px; align-items: stretch; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-top: 1px solid var(--line); }
.tabs {
  --tabs-bg: var(--surface);
  background:
    linear-gradient(to right, var(--tabs-bg) 40%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--tabs-bg) 40%, transparent) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 38%, transparent), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 38%, transparent), transparent) right center / 14px 100% no-repeat scroll,
    var(--tabs-bg);
}
.tabs > * { flex: 0 0 auto; white-space: nowrap; }
.tabs .proj { font-weight: 700; padding: 9px 12px 9px 8px; color: var(--ink); }
.tabs a { padding: 9px 10px; text-decoration: none; color: var(--muted); font-size: 0.95rem; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--scion-fill); }
.tabs .gap { flex: 1 0 20px; }
.tabs a[aria-current="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--line); }
.tabs a.setup { font-size: 0.9rem; }
/* second row: the pages behind the Setup tab */
/* Right-aligned through an auto margin, not justify-content: flex-end, which would push the first tabs past the left
   edge where scrolling cannot reach them on a narrow screen. */
.subtabs { --tabs-bg: var(--ground); }
.subtabs > :first-child { margin-left: auto; }
.subtabs a { font-size: 0.9rem; padding: 7px 10px; }
@media (max-width: 1100px) { .tabs a { padding: 9px 7px; } }
main { max-width: var(--max); margin: 0 auto; padding: 16px 20px 64px; }
@media (max-width: 700px) { main { padding: 12px 12px 48px; } }

nav.breadcrumbs { max-width: var(--max); margin: 0 auto; padding: 12px 20px 0; color: var(--muted); font-size: 0.88rem; }
nav.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
nav.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
nav.breadcrumbs a { color: var(--muted); text-decoration: none; }
nav.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
nav.breadcrumbs [aria-current] { color: var(--ink); }

/* page head: title on the left, the page's main action on the right */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 12px; }
.page-head h1 { margin: 0.2rem 0; }
/* "On this page" links: a row of pills that stays at the top of the window while the page scrolls. */
.jump { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 8px 0; background: var(--ground); border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.jump a { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; white-space: nowrap; }
.jump a:hover, .jump a:focus-visible { color: var(--ink); border-color: var(--ink); }
/* On a phone the pills stay on one line and scroll sideways instead of covering half the screen. */
@media (max-width: 700px) { .jump { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } .jump a { flex: 0 0 auto; } }
/* a section the pills jump to lands below them, not under them */
.jump ~ [id], .jump ~ * [id] { scroll-margin-top: 3.5rem; }

/* patch page: where the patch is, then the one thing to do next */
.lifecycle { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 0; margin: 14px 0; padding: 0; font-size: 0.95rem; }
.lifecycle li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.lifecycle li + li::before { content: ""; width: 26px; height: 1px; background: var(--line); margin: 0 6px; }
.lifecycle li.done { color: var(--sap); }
.lifecycle li.current { color: var(--ink); font-weight: 700; }
.lifecycle li.current .step { border-bottom: 2px solid var(--scion-fill); padding-bottom: 1px; }
.lifecycle li.bad { color: var(--bad); font-weight: 600; }
.lifecycle li.skipped .step { text-decoration: line-through; }
.lifecycle .note { font-weight: 400; font-size: 0.86rem; }
.card.next { border-left: 3px solid var(--scion-fill); }
details.more { grid-column: 1 / -1; }
details.more > .form-grid { margin-top: 8px; }
.attention li { padding-left: 12px; border-left: 3px solid var(--scion-fill); margin: 4px 0; }
.attention li.bad { border-left-color: var(--bad); }
.attention li.bad a { color: var(--bad); }
.card.next .release-opt { display: flex; margin: 0 0 8px; }
details.tech { margin: -8px 0 12px; font-size: 0.92rem; }
details.tech .techfacts { margin: 6px 0 0; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin: 0 0 16px; }
.card > :last-child { margin-bottom: 0; }
.card.narrow, section.narrow { max-width: 420px; margin: 40px auto; }
.card.narrow form + h2, .card.narrow details { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.card.narrow form + .hint { margin-top: 16px; }
.danger-card { border-color: var(--bad); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols > .card { margin: 0 0 16px; }
.flash { border-radius: 0 6px 6px 0; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--line); border-left: 3px solid var(--muted); background: var(--surface); }
.flash.ok { border-left-color: var(--sap); background: var(--sap-soft); }
.flash.err { border-left-color: var(--bad); background: var(--bad-soft); }
.flash.warn { border-left-color: var(--scion-fill); background: var(--scion-soft); }

/* tables */
table.grid, table.table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 0.95rem; }
/* On a phone a wide table scrolls on its own instead of pushing the whole page sideways. */
@media (max-width: 700px) { table.grid { display: block; max-width: 100%; overflow-x: auto; } }
.grid th, .grid td, .table th, .table td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th:last-child, .grid td:last-child { padding-right: 0; }
.grid thead th[colspan] { border-bottom-color: var(--line); color: var(--ink); }
.grid thead th, .table thead th { font-size: 0.85rem; font-weight: 600; color: var(--muted); border-bottom-color: var(--ink); white-space: nowrap; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tr.revoked td { color: var(--muted); }
.grid tr.row-removed td { text-decoration: line-through; color: var(--muted); }
.grid input, .grid select { width: 100%; }
.grid input[type="checkbox"], .grid input[type="radio"] { width: auto; }
.grid .inline-form select { width: auto; }
/* shipped (green) to proposed (amber), as on the site */
.diff td.del { color: var(--sap); font-family: var(--f-mono); font-size: 0.88em; word-break: break-all; }
.diff td.add { color: var(--scion); font-family: var(--f-mono); font-size: 0.88em; font-weight: 600; word-break: break-all; }
.bad-text { color: var(--bad); font-weight: 600; }
.facts, .techfacts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 18px; margin: 0 0 16px; font-size: 0.95rem; }
.facts dt, .techfacts dt { color: var(--muted); }
.facts dd, .techfacts dd { margin: 0; min-width: 0; }
@media (max-width: 520px) { .facts, .techfacts { grid-template-columns: 1fr; gap: 0; } .facts dd, .techfacts dd { margin-bottom: 6px; } }
ul.plain { list-style: none; padding: 0; margin: 0 0 8px; }
ul.plain li { padding: 3px 0; }
ul.hits { list-style: none; padding: 0; margin: 6px 0; max-height: 16rem; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
ul.hits li { padding: 5px 10px; border-bottom: 1px solid var(--line); }
ul.hits li:last-child { border-bottom: 0; }
.hitsbox { margin-top: 6px; }
.timeline { list-style: none; padding: 0; margin: 0 0 14px 6px; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--line); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--sap); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline p { margin: 2px 0 0; white-space: pre-wrap; }

/* badges: outlined, coloured by state */
.badge { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; line-height: 1.6; border: 1px solid currentColor; color: var(--muted); vertical-align: middle; white-space: nowrap; letter-spacing: 0; }
.badge.ok { color: var(--sap); }
.badge.warn, .badge.chg { color: var(--scion); }
.badge.bad { color: var(--bad); }

/* forms */
label { font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: 6px; padding: 6px 9px; max-width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input[type="checkbox"], input[type="radio"] { padding: 0; accent-color: var(--sap); }
textarea { width: 100%; }
input[type="search"] { width: 100%; max-width: 420px; }
/* A rollout percentage (<input type="number" class="pct">) is short wherever it sits; these selectors outrank the
   width: 100% of .grid, .stack and editor fields. */
input.pct, .grid input.pct, .field .ctl > input.pct, .stack input.pct:not([type="checkbox"]):not([type="radio"]) { width: 6.5em; flex: none; }
.card form + form, .card .timeline + form, .card p + form { margin-top: 12px; }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; }
input[readonly], textarea[readonly] { background: var(--ground); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack input:not([type="checkbox"]):not([type="radio"]), .stack select { width: 100%; }
.form-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: baseline; max-width: 720px; }
.form-grid > button, .form-grid > .btn { justify-self: start; }
.form-grid > .hint { margin-top: -6px; }
.form-grid > .label, .form-grid > label, .form-grid > span[id] { font-weight: 600; }
.label { font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.checks label { font-weight: 400; }
fieldset.checks { border: 0; padding: 0; margin: 8px 0; }
fieldset.checks legend { font-weight: 600; padding: 0; }
.inline, .inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.filters a { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 0.9rem; }
.filters a:hover { color: var(--ink); border-color: var(--ink); }
.filters a[aria-current] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.filters-form { margin: 0 0 12px; gap: 10px; }
.chanbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: -4px 0 12px; }
.chanbar .chantabs { margin: 0; }
.verpick label { font-weight: 400; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.btn { display: inline-block; font: inherit; font-weight: 600; font-size: 0.95rem; cursor: pointer; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary, .btn.active { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn.primary:hover { background: var(--sap); border-color: var(--sap); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary:hover { color: var(--ground); } }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 2px 10px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 0.88rem; font-weight: 400; }
p.hint { margin: 6px 0 10px; max-width: 62rem; }

/* editor */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
#fields, #cfgwrap { min-width: 0; }
.field { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 12px; padding: 6px 8px; border-radius: 4px; align-items: start; }
.field > label { padding-top: 7px; word-break: break-word; font-weight: 400; color: var(--muted); }
.field .ctl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field .ctl > input, .field .ctl > select, .field .ctl > textarea { width: 100%; max-width: 420px; font-family: var(--f-mono); font-size: 0.9em; }
.field .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.82rem; color: var(--muted); }
.shipped code { color: var(--sap); background: none; padding: 0; }
/* a changed value carries the amber bar */
.field.changed .ctl > input, .field.changed .ctl > select, .field.changed .ctl > textarea, .field.changed .picker .path { border-color: var(--scion-fill); box-shadow: inset 3px 0 0 var(--scion-fill); }
.field.changed > label { color: var(--ink); font-weight: 600; }
fieldset.changed { border-left: 3px solid var(--scion-fill); }
.field.invalid .ctl > input { border-color: var(--bad); }
.field > .msgs { grid-column: 2; }
fieldset.group { border: 1px solid var(--line); border-radius: 6px; margin: 8px 0; padding: 6px 10px 10px; min-width: 0; }
fieldset.group legend { font-weight: 600; padding: 0 6px; }
.colorrow { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.colorpick { inline-size: 56px; block-size: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; }
.colorpick:disabled { cursor: default; }
.colorrow { flex-wrap: wrap; gap: 6px 20px; }
.colorside { display: inline-flex; align-items: center; gap: 8px; }
.colorhex, .colorside code { font-size: 0.85em; }
.swatch { inline-size: 1.6em; block-size: 1.1em; border: 1px solid var(--line); border-radius: 3px; vertical-align: middle; flex: none; }
.colorside .swatch { inline-size: 56px; block-size: 32px; border-radius: 6px; padding: 0; }
details.colorvals > summary { cursor: pointer; font-size: 0.86rem; margin: 2px 0 4px; }
.diffparts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.diffparts .plabel { font-family: var(--f-body); font-weight: 400; color: var(--muted); font-size: 0.85em; }
.diff td.add .part:not(.chg) { font-weight: 400; color: var(--muted); }
.diff td.add .part.chg { background: var(--scion-soft); border-radius: 3px; padding: 0 3px; }
.axes { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.axis { display: flex; flex-direction: column; gap: 2px; flex: 1 1 7em; max-width: 11em; min-width: 0; padding: 2px 4px; border-radius: 4px; }
.axis > label { font-size: 0.8rem; color: var(--muted); }
.axis > input:not([type]) { width: 100%; font-family: var(--f-mono); font-size: 0.9em; }
.axis > .axisrange { width: 100%; accent-color: var(--scion); }
.axis.changed { background: var(--scion-soft); }
.field .ctl > input.axespaste { max-width: 420px; font-size: 0.85em; }
.axespaste[aria-invalid="true"] { border-color: var(--bad); }
.ratiolock { font-size: 0.86rem; display: inline-flex; align-items: center; gap: 6px; }
.type { font-weight: 400; color: var(--muted); font-size: 0.78rem; font-family: var(--f-mono); }
.rowitem { display: flex; gap: 8px; align-items: flex-start; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.rowitem .keyfield { flex: 0 0 38%; }
.rowitem .valfield { flex: 1; min-width: 0; }
.rowitem .field { grid-template-columns: 70px minmax(0, 1fr); }
.msgs:empty { display: none; }
.msg { margin: 2px 0; font-size: 0.88rem; }
.msg.error { color: var(--bad); }
.msg.warning { color: var(--scion); }
.valpanel { border: 1px solid var(--line); border-left: 3px solid var(--muted); border-radius: 0 6px 6px 0; padding: 8px 12px; margin: 0 0 10px; }
.valpanel.ok { border-left-color: var(--sap); background: var(--sap-soft); }
.valpanel.warn { border-left-color: var(--scion-fill); background: var(--scion-soft); }
.valpanel.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.valpanel ul { margin: 6px 0 0; padding-left: 18px; }
.picker { display: block; }
.picker .path { width: 100%; max-width: 420px; font-family: var(--f-mono); font-size: 0.9em; }
.pickres { margin-top: 4px; }
.pickbox { border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: var(--surface); max-width: 520px; }
.pickbox input { width: 100%; }
.pickbox > div { max-height: 14rem; overflow: auto; margin-top: 4px; }
.hit { display: block; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 4px 6px; cursor: pointer; color: var(--ink); }
.hit:hover { background: var(--surface-2); }
.token { font-size: 1.05rem; word-break: break-all; white-space: pre-wrap; }

/* svg charts */
.spark { color: var(--sap); vertical-align: middle; }
.bars .svg-label { fill: var(--ink); font-size: 11px; font-family: var(--f-mono); }
.bars .svg-bar { fill: var(--sap); }

/* pager, copy blocks, onboarding */
.pager { display: flex; gap: 12px; align-items: center; margin: 8px 0 16px; }
.copyrow { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 12px; }
.copyrow .code, .copyrow pre { flex: 1; margin: 0; min-width: 0; }
.copyrow code.code { padding: 4px 8px; }
pre.code { white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.copyable { cursor: copy; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: baseline; }
.steps .badge { min-width: 4.5em; text-align: center; }
.setempty { display: block; font-weight: 400; margin: 4px 0; }
.confirm { display: block; font-weight: 400; margin: 8px 0; }
.linkbox { border: 2px solid var(--sap); }
.inline-note { font-weight: 400; color: var(--muted); }
.envcard h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.setting { margin: 0 0 12px; }
.setting > label, .setting > .label { display: block; margin-bottom: 3px; }
.setting .hint { display: block; margin-top: 3px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .field { grid-template-columns: 1fr; } .field > .msgs { grid-column: 1; } }

/* patch targets */
fieldset.builds { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.buildgroup { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.check { font-weight: 400; }
.tmsgs { margin: 4px 0 0; padding-left: 18px; }
.shipped.targets { color: var(--muted); }
.rowmissing { font-size: 0.84rem; color: var(--muted); }

/* logical channels: grids, matrix, plans */
.chanset h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.chan-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.chan-cell { display: block; min-width: 9.5em; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); color: var(--ink); text-decoration: none; }
.chan-cell:hover { border-color: var(--sap); }
.chan-cell strong, .chan-cell span { display: block; }
.chan-cell span { font-size: 0.84rem; color: var(--muted); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.cell-ok { color: var(--sap); font-weight: 600; }
.cell-none, .cell-off { color: var(--muted); }
.cell-bad { color: var(--bad); }
.plan-ok td:first-child { box-shadow: inset 3px 0 0 var(--sap); padding-left: 10px; }
.plan-skip td:first-child { box-shadow: inset 3px 0 0 var(--line); padding-left: 10px; }
.plan-error td:first-child { box-shadow: inset 3px 0 0 var(--bad); padding-left: 10px; }
.plan-skip { color: var(--muted); }
.plan-error .reason { color: var(--bad); }
.narrow-set { margin: 8px 0; }

/* carry forward */
.carry-grid td { min-width: 12em; }
.carry-reason { font-size: 0.86rem; color: var(--muted); margin: 2px 0; }
.carry-filters { flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 12px; }
.check-group { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; }
details.retire, details.desc, details.lasterr { margin: 4px 0; font-size: 0.88rem; }
.landnote { font-size: 0.86rem; color: var(--muted); }

/* element operations (Version 2): read-only block in the editors and the review diff */
.field > .flabel { padding-top: 7px; word-break: break-word; color: var(--muted); }
.opsblock { border: 1px solid var(--line); border-left: 3px solid var(--scion-fill); border-radius: 0 6px 6px 0; background: var(--scion-soft); padding: 6px 10px; }
.opsblock p { margin: 0 0 4px; }
ul.opslist { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
ul.opslist li { padding: 1px 0; word-break: break-word; }
ul.opslist code { background: none; padding: 0; }
.opsfield .btn { align-self: flex-start; }
.vernote { color: var(--muted); font-size: 0.88rem; }
.chips { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* Health and Overview: wide tables scroll inside their card; long error text wraps; a failure count stays red as a link. */
.scroll-x { overflow-x: auto; max-width: 100%; }
.grid td.wrap { overflow-wrap: anywhere; word-break: break-word; }
.grid td.wrap code { white-space: pre-wrap; }
.bad-text a { color: inherit; }
