/* Thoroughbook Admin, glass edition (6 Nov 2026).
   Deep navy lit from behind by a brass and a blue glow; every surface is
   frosted glass. Brass is the one thing that matters on each screen.
   Palette, from the Thoroughbook logo (15 Nov 2026: navy and white with a hint of brass):
   #0B132B · #1C2541 · #2A3C6E · #3A5090 · white · brass #C9A24E (#8A6524 on light).
   Type: Unbounded (wide, confident) for titles, yard names and big numbers;
   Manrope does the reading. Cormorant and Inter stay for the phone preview only. */

:root {
  --bg: #0B132B;
  --bg-2: rgba(8, 14, 34, .55);
  --panel: rgba(28, 37, 65, .55);
  --panel-2: rgba(58, 80, 107, .34);
  --line: rgba(147, 163, 188, .13);
  --line-2: rgba(147, 163, 188, .26);
  --text: #F5F7FB;
  --text-2: #D4DAE4;
  --muted: #93A3BC;
  --faint: #68799A;
  --amber: #C9A24E;
  --amber-hi: #E0BE72;
  --amber-ink: #0B132B;
  --sky: #8EA4DF;
  --sand: #F1EFE7;
  --steel: #3A506B;

  --ok: #5CC99A;
  --warn: #F2C94C;
  --bad: #EF5D6B;
  --info: #8EA4DF;
  --onb: #A99CF0;

  --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .022) 62%);
  --glass-edge: rgba(255, 255, 255, .1);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 26px 60px -30px rgba(0, 0, 0, .75);
  --blur: blur(20px) saturate(150%);
  --glow-a: rgba(201, 162, 78, .22);
  --glow-b: rgba(58, 80, 144, .3);
  --glow-c: rgba(58, 80, 107, .42);

  --sans: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --side: 264px;
  --r: 8px;
  --rc: 18px;
  /* Motion (7 Nov 2026): things arriving ease out, things leaving ease in,
     anything you touch springs with a slight overshoot, and nothing moves linearly. */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --spring: cubic-bezier(.3, 1.32, .55, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease: var(--ease-out);
  --glass: rgba(11, 19, 43, .72);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* The light behind the glass: an amber glow low left, sky blue top right, drifting slowly. */
body::before {
  content: ""; position: fixed; inset: -12%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 34vmax at 6% 92%, var(--glow-a), transparent 70%),
    radial-gradient(42vmax 36vmax at 96% 4%, var(--glow-b), transparent 70%),
    radial-gradient(70vmax 50vmax at 55% 112%, var(--glow-c), transparent 72%);
  animation: aurora 38s ease-in-out infinite alternate;
}
@keyframes aurora { from { transform: translate3d(-2%, 1.5%, 0) scale(1); } to { transform: translate3d(2.5%, -2%, 0) scale(1.06); } }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--amber); color: var(--amber-ink); }
.boot { padding: 40vh 24px; text-align: center; color: var(--muted); }
.mute { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.k { font-size: 12.5px; color: var(--muted); }
.empty { padding: 22px 0; color: var(--muted); }

/* ---- Buttons and fields ----------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); color: var(--text);
  font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s var(--spring), border-color .15s var(--spring), color .15s var(--spring), transform .35s var(--spring);
}
.btn:hover { background: var(--panel-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 600; }
.btn--primary:hover { background: var(--amber-hi); border-color: var(--amber-hi); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { color: var(--text); background: var(--panel); border-color: transparent; }
.btn--danger:hover { border-color: var(--bad); color: var(--bad); background: transparent; }
.btn--sm { min-height: 30px; padding: 0 11px; font-size: 13px; }
.btn--big { min-height: 50px; padding: 0 24px; font-size: 16px; }

.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field small { color: var(--faint); font-size: 12px; }
.field > .seg { justify-self: start; }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg-2); color: var(--text); transition: border-color .15s var(--spring), background .15s var(--spring);
}
.input:hover { border-color: var(--faint); }
.input:focus { outline: none; border-color: var(--amber); background: var(--bg); }
.input[disabled] { color: var(--muted); }
textarea.input { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---- App frame: sidebar + main --------------------------------------------- */

.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: rgba(11, 19, 43, .42); border-right: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  display: flex; flex-direction: column; padding: 20px 14px 16px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; text-decoration: none; }
.sb-brand img { height: 28px; width: auto; }
.sb-brand b { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.sb-brand span { color: var(--faint); font-size: 13px; margin-left: 2px; }
.sb-nav { display: grid; gap: 1px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r); color: var(--text-2); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: background .12s var(--spring), color .12s var(--spring);
}
.sb-link svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.sb-link:hover { background: var(--panel); color: var(--text); }
.sb-link[aria-current="page"] { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--amber); }
.sb-link .count { margin-left: auto; }
.count[hidden] { display: none; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 600; }
.sb-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 10px 8px; font-size: 12.5px; color: var(--faint); font-weight: 500; }
.sb-head button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 4px; border-radius: 4px; font-size: 13px; }
.sb-head button:hover { color: var(--amber); }
.sb-filter { margin: 0 0 8px; min-height: 34px; font-size: 13.5px; padding: 6px 10px; }
.sb-yards { display: grid; gap: 1px; }
.sb-yard { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r); text-decoration: none; color: var(--text-2); font-size: 14px; transition: background .12s var(--spring); }
.sb-yard .crest { width: 24px; height: 24px; flex: none; }
.sb-yard span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-yard:hover { background: var(--panel); color: var(--text); }
.sb-yard[aria-current="page"] { background: var(--panel-2); color: var(--text); }
.sb-foot { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.sb-foot b { color: var(--amber); font-weight: 600; }

.main { min-width: 0; }
.main__in { width: min(100% - 80px, 1240px); margin: 0 auto; padding: 36px 0 120px; }
.main__in.fade { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.main.loading .main__in { opacity: .55; transition: opacity .2s var(--ease-out) .08s; }

.topbar { display: none; }
.scrim { display: none; }

/* ---- Status ---------------------------------------------------------------------- */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot--healthy { background: var(--ok); }
.dot--attention { background: var(--warn); }
.dot--critical { background: var(--bad); }
.dot--onboarding { background: var(--onb); }
.dot--paused { background: var(--faint); }
.state { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; color: var(--text-2); }
.state--healthy { color: var(--ok); }
.state--attention { color: var(--warn); }
.state--critical { color: var(--bad); }
.state--onboarding { color: var(--onb); }
.state--paused { color: var(--muted); }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sev { display: inline-block; width: 3px; align-self: stretch; border-radius: 2px; background: var(--info); flex: none; }
.sev--warning { background: var(--warn); }
.sev--critical { background: var(--bad); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tag--draft { border-color: color-mix(in srgb, var(--amber) 55%, transparent); color: var(--amber); text-decoration: none; }
.tag--demo { border-style: dashed; }
.tag--bad { border-color: color-mix(in srgb, var(--bad) 60%, transparent); color: var(--bad); }
.tag--ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); color: var(--ok); }
.prods { display: inline-flex; gap: 4px; }
.prod { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--panel-2); color: var(--faint); }
.prod--on { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }

/* ---- Overview --------------------------------------------------------------- */

.lead { padding: 28px 0 40px; max-width: 900px; }
.lead .k { margin-bottom: 14px; }
.lead h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.06; letter-spacing: -0.01em; }
.lead h1 span { color: var(--amber); }
.lead p { margin-top: 16px; color: var(--text-2); font-size: 17px; max-width: 62ch; }
.lead .row { margin-top: 26px; }

.focus { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 56px; }
.fcard {
  position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 6px 16px; padding: 22px 22px 20px; border-radius: var(--rc); text-decoration: none; transition: border-color .15s var(--spring), transform .35s var(--spring), background .15s var(--spring);
}
.fcard::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 2px 2px 0; background: var(--warn); }
.fcard--critical::before { background: var(--bad); }
.fcard:hover { border-color: var(--line-2); background: var(--panel-2); transform: translateY(-2px); }
.fcard .crest { width: 52px; height: 52px; grid-row: span 2; }
.fcard h3 { font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.1; }
.fcard p { color: var(--text-2); }
.fcard__more { grid-column: 2; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.fcard__more b { color: var(--amber); font-weight: 500; }

.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-h h2 { font-size: 18px; font-weight: 600; }

.ytable { width: 100%; border-collapse: collapse; }
.ytable th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--faint); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.ytable td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ytable tbody tr { cursor: pointer; transition: background .12s var(--spring); }
.ytable tbody tr:hover { background: var(--bg-2); }
.ytable tbody tr:hover .yname { color: var(--amber-hi); }
.ytable .num { text-align: right; }
.yid { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.yid .crest { width: 38px; height: 38px; flex: none; }
.yname { font-family: var(--display); font-size: 20px; line-height: 1.15; transition: color .12s var(--spring); }
.yplace { font-size: 13px; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 26px; width: 110px; }
.spark i { flex: 1; background: var(--line-2); border-radius: 1px; min-height: 2px; }
.spark i.warn { background: var(--warn); }
.spark i.bad { background: var(--bad); }
.store { width: 72px; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.store i { display: block; height: 100%; background: var(--muted); }
.store i.warn { background: var(--warn); }
.store i.bad { background: var(--bad); }

.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 56px; margin-top: 56px; }

/* ---- Crest -------------------------------------------------------------------------- */

.crest svg, .crest img { display: block; width: 100%; height: 100%; }
.crest { width: 56px; height: 56px; }
.crest img { object-fit: contain; }
.silks { display: inline-flex; height: 14px; width: 42px; border-radius: 2px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); vertical-align: middle; }
.silks i { flex: 1; }

/* ---- Yard page ---------------------------------------------------------------- */

.crumb { font-size: 13px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--text); }
.yard-head { display: grid; grid-template-columns: 84px 1fr auto; gap: 22px; align-items: center; padding: 18px 0 26px; }
.yard-head .crest { width: 84px; height: 84px; }
.yard-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 4vw, 50px); line-height: 1.05; }
.yard-head .row { margin-top: 10px; gap: 14px; }
.yard-head .bandwrap { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 10; background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.tabs a { padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .12s var(--spring); }
.tabs a:hover { color: var(--text); }
.tabs a[aria-selected="true"] { color: var(--text); border-color: var(--amber); }
.panel { padding: 32px 0 0; }

.verdict { padding: 0 0 30px; max-width: 760px; }
.verdict h2 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; }
.verdict p { color: var(--text-2); margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 44px; }
.stat { padding: 16px 18px; border-radius: 14px; }
.stat .k { display: block; }
.stat b { display: block; font-size: 24px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; margin-top: 4px; }
.stat .small { color: var(--faint); }
.bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.bar i.warn { background: var(--warn); }
.bar i.bad { background: var(--bad); }

.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; }
.sect { margin-bottom: 44px; }
.sect > h2, .sect__h { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.sect > p.mute { margin-bottom: 16px; font-size: 14px; }
.sect__top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }

.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list li > div { flex: 1; min-width: 0; }
.list li b { font-weight: 500; }
.list li.done { opacity: .5; }
.list .meta { color: var(--faint); font-size: 13px; margin-top: 2px; }
.list .n { font-weight: 500; font-size: 16px; min-width: 40px; text-align: right; color: var(--text-2); }

.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.notice { padding: 18px 20px; border-radius: 14px; }

/* ---- Version editor ---------------------------------------------------------------- */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.editor__preview { position: sticky; top: 64px; }
.fs { border: 0; margin: 0 0 40px; padding: 0; display: grid; gap: 16px; }
.fs legend { float: left; width: 100%; margin-bottom: 4px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
.fs legend small { display: block; font-size: 14px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.colour { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2); padding: 4px; }
.colour input[type="color"] { width: 38px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.colour input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(255,255,255,.14); border-radius: 4px; }
.colour input[type="text"] { border: 0; background: none; width: 100%; min-width: 0; font-family: var(--mono); font-size: 13.5px; text-transform: lowercase; }
.colour input[type="text"]:focus { outline: none; }
.colour:focus-within { border-color: var(--amber); }
.hint { font-size: 13px; color: var(--warn); }
.hint.ok { color: var(--faint); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; border-radius: 5px; transition: background .12s var(--spring), color .12s var(--spring); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--text); }
.seg svg { width: 16px; height: 16px; }

.mod { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); transition: border-color .15s var(--spring); }
.mod + .mod { margin-top: 10px; }
.mod:not(.mod--off) { border-color: var(--line-2); }
.mod--off { background: transparent; }
.mod__h { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.mod__h b { font-size: 15.5px; font-weight: 600; }
.mod__h .small { color: var(--muted); }
.mod__f { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; padding: 6px 16px 12px; border-top: 1px solid var(--line); }
.mod--off .mod__f { display: none; }
.check { display: flex; gap: 9px; align-items: center; padding: 7px 0; cursor: pointer; font-size: 14px; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--amber); margin: 0; }

.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--line-2); transition: background .2s var(--spring); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform .35s var(--spring); }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

.savebar {
  position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 30; background: var(--glass); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-2); transform: translateY(100%); transition: transform .35s var(--ease-in);
}
.savebar.on { transform: none; transition: transform .5s var(--ease-out); }
.savebar__in { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 40px; max-width: 1320px; margin: 0 auto; }
.savebar__msg { flex: 1; min-width: 0; }
.savebar__msg b { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.savebar__msg .small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.savebar .dot { background: var(--amber); }

/* Phone preview */
.phone { width: 290px; margin: 0 auto; border-radius: 42px; padding: 9px; background: #03070e; box-shadow: 0 0 0 1px #24344f, 0 28px 60px rgba(0,0,0,.45); }
.phone__screen { border-radius: 34px; overflow: hidden; height: 500px; display: flex; flex-direction: column; position: relative; }
.phone__bar { display: flex; justify-content: space-between; padding: 13px 24px 0; font-size: 12px; font-weight: 600; }
.phone__top { padding: 18px 18px 16px; display: flex; gap: 12px; align-items: center; }
.phone__top .crest { width: 44px; height: 44px; }
.phone__top b { font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1; display: block; }
.phone__top small { font-size: 11px; opacity: .72; }
.phone__body { flex: 1; padding: 10px 14px; display: grid; gap: 8px; align-content: start; }
.phone__tile { border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.phone__tile small { font-weight: 400; opacity: .62; font-size: 11px; }
.phone__tabs { display: flex; justify-content: space-around; padding: 10px 8px 6px; font-size: 10px; font-weight: 600; }
.phone__tabs span { display: grid; justify-items: center; gap: 4px; opacity: .5; }
.phone__tabs span.on { opacity: 1; }
.phone__tabs span::before { content: ""; width: 18px; height: 18px; border-radius: 5px; background: currentColor; opacity: .85; }
.phone__powered { text-align: center; font-size: 10px; padding: 2px 0 12px; opacity: .55; }
.springboard { margin-top: 18px; display: flex; gap: 22px; justify-content: center; }
.appicon { width: 62px; text-align: center; font-size: 11px; color: var(--text-2); }
.appicon .ic { width: 62px; height: 62px; border-radius: 14px; overflow: hidden; margin-bottom: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.appicon .ic svg { width: 100%; height: 100%; display: block; }
.note { font-size: 13px; color: var(--text-2); border-left: 2px solid var(--warn); padding: 3px 0 3px 12px; margin-top: 16px; }
.note.ok { border-color: var(--ok); }

/* Roles matrix */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.matrix { border-collapse: collapse; width: 100%; min-width: 680px; }
.matrix th, .matrix td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix th:first-child, .matrix td:first-child { text-align: left; padding-left: 16px; position: sticky; left: 0; background: var(--bg-2); z-index: 1; min-width: 190px; white-space: nowrap; color: var(--text-2); }
.matrix thead th { vertical-align: bottom; font-weight: 500; padding-top: 14px; background: var(--bg-2); }
.matrix thead input { width: 140px; min-height: 34px; text-align: center; font-weight: 500; }
.matrix .grp td { padding-top: 20px; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--amber); background: var(--bg); }
.matrix .grp td:first-child { background: var(--bg); }
.matrix tr.offrow td:first-child { color: var(--faint); }
.lvl { width: 62px; height: 28px; border-radius: 5px; border: 1px solid var(--line-2); background: none; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--faint); transition: background .12s var(--spring), color .12s var(--spring), border-color .12s var(--spring); }
.lvl--view { background: color-mix(in srgb, var(--info) 16%, transparent); border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); }
.lvl--edit { background: color-mix(in srgb, var(--amber) 22%, transparent); border-color: color-mix(in srgb, var(--amber) 70%, transparent); color: var(--amber-hi); }
.lvl:disabled { opacity: .25; cursor: not-allowed; }
.lvl:hover:not(:disabled) { border-color: var(--text-2); }
.roles-preview { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }

/* Dialogs, toasts, tables */
dialog { border: 1px solid var(--glass-edge); border-radius: var(--rc); background: rgba(22, 32, 60, .9); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: var(--text); padding: 0; width: min(540px, calc(100% - 32px)); box-shadow: 0 40px 100px rgba(0,0,0,.55); }
dialog[open] { animation: rise .25s var(--ease); }
dialog::backdrop { background: rgba(3, 8, 16, .66); backdrop-filter: blur(3px); }
.dlg { padding: 26px; display: grid; gap: 16px; }
.dlg h2 { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.12; }
.dlg ul { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }
.dlg .row { justify-content: flex-end; }
.secret { font: 500 14px/1.6 var(--mono); background: var(--bg); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px 14px; word-break: break-all; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
#toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 8px; font-weight: 500; transition: opacity .2s var(--ease-in), transform .3s var(--ease-in); z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
#toast.on { opacity: 1; transform: translate(-50%, 0); transition: opacity .25s var(--ease-out), transform .5s var(--ease-out); }
#toast.bad { background: var(--bad); color: #fff; }
.page-h { padding: 28px 0 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-h h1 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.05; }
.page-h p { color: var(--muted); margin-top: 8px; max-width: 62ch; }

/* Sign-in and the overview dashboard live in glass.css. */

/* ---- Smaller screens --------------------------------------------------------------- */

@media (max-width: 1180px) {
  .editor { grid-template-columns: 1fr; }
  .editor__preview { position: static; order: -1; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 24px; }
  .ytable .col-spark, .ytable .col-store { display: none; }
}
@media (max-width: 900px) {
  :root { --side: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; z-index: 50; transform: translateX(-100%); transition: transform .3s var(--ease-in); }
  .app.nav-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0,0,0,.5); transition: transform .45s var(--ease-out); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(3,8,16,.6); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .topbar .sb-brand { padding: 0; }
  .topbar button { margin-left: auto; }
  .main__in { width: calc(100% - 32px); padding-top: 20px; }
  .tabs { top: 57px; }
  .cols, .roles-preview { grid-template-columns: 1fr; gap: 0; }
  .savebar { left: 0; }
  .savebar__in { padding: 10px 16px; }
  .ytable .col-users, .ytable .col-ver { display: none; }
  .yard-head { grid-template-columns: 60px 1fr; }
  .yard-head .crest { width: 60px; height: 60px; }
  .yard-head .bandwrap { grid-column: 1 / -1; align-items: flex-start; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .lead { padding: 10px 0 28px; }
  .lead p { font-size: 15.5px; }
  .focus { grid-template-columns: 1fr; margin-bottom: 40px; }
  .ytable thead { display: none; }
  .ytable .col-used, .ytable .col-prod { display: none; }
  .ytable td { padding: 12px 8px 12px 0; }
  .yname { font-size: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .phone { transform: scale(.92); transform-origin: top center; margin-bottom: -38px; }
  .savebar__in { flex-wrap: wrap; gap: 8px; }
  .savebar__msg { flex-basis: 100%; }
  .codes { grid-template-columns: 1fr; }
  .verdict h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Motion --------------------------------------------------------------------- */

.sb-nav, .tabs, .chips { position: relative; }
.glide { position: absolute; left: 0; top: 0; border-radius: var(--r); pointer-events: none; z-index: 0;
  transition: transform .38s var(--spring), width .38s var(--spring), height .38s var(--spring), opacity .2s var(--spring); }
.sb-nav .glide { background: var(--panel-2); box-shadow: inset 2px 0 0 var(--amber); }
.sb-nav .sb-link { position: relative; z-index: 1; }
.sb-nav .sb-link[aria-current="page"] { background: transparent; box-shadow: none; }
.tabs .glide { border-radius: 0; background: none; border-bottom: 2px solid var(--amber); }
.tabs a { position: relative; z-index: 1; }
.tabs a[aria-selected="true"] { border-color: transparent; }
.chips .glide { background: var(--panel-2); box-shadow: 0 0 0 1px var(--line-2); border-radius: 999px; }

[data-stagger] > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.grow-y { transform-origin: bottom; animation: growY .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.grow-x { transform-origin: left; animation: growX .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes growY { from { transform: scaleY(0); } to { transform: none; } }
@keyframes growX { from { transform: scaleX(0); } to { transform: none; } }
.spark i, .chart rect.b { transform-box: fill-box; }

.loadbar { position: fixed; top: 0; left: var(--side); right: 0; height: 2px; z-index: 60; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s var(--ease-out); }
.loadbar::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--amber), transparent); animation: sweep 1.1s var(--ease-io) infinite; }
.main.loading ~ .loadbar, .app.loading .loadbar { opacity: 1; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.skel { background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Money --------------------------------------------------------------------------- */

.chips { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); flex-wrap: wrap; }
.chips a, .chips button { position: relative; z-index: 1; border: 0; background: none; color: var(--muted); padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer; transition: color .15s var(--spring); }
.chips a:hover, .chips button:hover { color: var(--text); }
.chips [aria-current="page"], .chips [aria-pressed="true"] { color: var(--text); }
.chips .n { color: var(--faint); margin-left: 4px; font-weight: 400; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 44px; }
.kpi { padding: 18px 20px; border-radius: 14px; }
.kpi .k { display: block; }
.kpi b { display: block; font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; margin-top: 6px; }
.kpi .small { color: var(--faint); }
.kpi--hi b { color: var(--amber-hi); }
.kpi--bad b { color: var(--bad); }

.bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 10px; border-bottom: 1px solid var(--line-2); }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.bars i { display: block; width: 100%; max-width: 54px; border-radius: 4px 4px 0 0; background: var(--line-2); min-height: 2px; }
.bars > div:last-child i { background: var(--amber); }
.bars span { font-size: 12px; color: var(--faint); }
.bars .v { font-size: 12px; color: var(--text-2); }
.bar-labels { display: flex; gap: 14px; margin-top: 8px; }
.bar-labels span { flex: 1; text-align: center; font-size: 12px; color: var(--faint); }

.ageing { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); gap: 2px; margin: 12px 0 10px; }
.ageing i { display: block; height: 100%; }
.ageing-key { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; font-size: 13px; }
.ageing-key b { display: block; font-weight: 500; font-size: 15px; color: var(--text); }
.ageing-key span { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ageing-key span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 70px; align-items: center; gap: 12px; font-size: 14px; }
.hbar > span:first-child { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 4px; background: var(--amber); }
.hbar > span:last-child { text-align: right; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--draft { color: var(--muted); }
.pill--sent { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.pill--overdue { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill--paid { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill--void { color: var(--faint); text-decoration: line-through; }
.pill--active { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill--planned { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.pill--cancel { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill--cancelled { color: var(--faint); }

.itable { width: 100%; border-collapse: collapse; }
.itable th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--faint); padding: 0 14px 10px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.itable td { padding: 13px 14px 13px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.itable tbody tr { cursor: pointer; transition: background .12s var(--spring); }
.itable tbody tr:hover { background: var(--bg-2); }
.itable .num { text-align: right; }
.itable .who { display: flex; align-items: center; gap: 10px; }
.itable .who .crest { width: 26px; height: 26px; flex: none; }
.itable .mono { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.chipset { display: flex; gap: 4px; flex-wrap: wrap; }
.chipset span { font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.est { font-size: 11.5px; color: var(--warn); border: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); border-radius: 4px; padding: 0 6px; margin-left: 6px; }

/* Invoice page: the paper is the editor and the printout */
.inv { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.inv__side { position: sticky; top: 24px; display: grid; gap: 14px; }
.paper { background: #fbfaf6; color: #1a1d24; border-radius: 4px; padding: 56px 60px 48px; box-shadow: 0 30px 70px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.04); font-size: 13.5px; position: relative; overflow: hidden; }
.paper h2 { font-family: var(--display); font-weight: 400; font-size: 40px; color: #0a1424; line-height: 1; }
.paper .ph { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 40px; }
.paper .ph img { height: 44px; width: auto; }
.paper .from { text-align: right; color: #4a5160; white-space: pre-line; line-height: 1.55; }
.paper .from b { color: #0a1424; font-size: 15px; display: block; }
.paper .meta { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; margin-bottom: 34px; }
.paper .meta dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.paper dt { color: #7a8190; }
.paper dd { margin: 0; color: #1a1d24; font-weight: 500; }
.paper .to { white-space: pre-line; line-height: 1.55; color: #4a5160; }
.paper .to b { color: #0a1424; }
.paper .lbl { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #8a8f99; margin-bottom: 6px; display: block; }
.paper table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.paper th { text-align: left; font-weight: 500; color: #7a8190; font-size: 12px; padding: 8px 8px 8px 0; border-bottom: 1px solid #1a1d24; }
.paper td { padding: 10px 8px 10px 0; border-bottom: 1px solid #e3e0d7; vertical-align: top; }
.paper .r { text-align: right; }
.paper .total { display: flex; justify-content: flex-end; gap: 40px; font-size: 18px; padding: 10px 0 30px; }
.paper .total b { font-family: var(--display); font-weight: 400; font-size: 28px; color: #0a1424; }
.paper .foot { border-top: 1px solid #e3e0d7; padding-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; color: #4a5160; line-height: 1.55; }
.paper .foot b { color: #1a1d24; }
.paper .stamp { position: absolute; top: 34px; right: -46px; transform: rotate(35deg); padding: 6px 60px; font-weight: 600; letter-spacing: .14em; font-size: 12px; color: #fff; }
.paper .stamp--demo { background: #8d9bb0; }
.paper .stamp--paid { background: #3f9a6b; }
.paper .stamp--overdue { background: #d4543f; }
.paper input, .paper textarea { font: inherit; color: inherit; width: 100%; border: 1px solid transparent; background: transparent; padding: 3px 5px; border-radius: 4px; transition: border-color .15s var(--spring), background .15s var(--spring); }
.paper input:hover, .paper textarea:hover { border-color: #d9d5c9; }
.paper input:focus, .paper textarea:focus { outline: none; border-color: #b8462a; background: #fff; }
.paper input.r { text-align: right; }
.paper .rm { border: 0; background: none; color: #a3a8b2; cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.paper .rm:hover { color: #d4543f; background: #f3e4df; }
.paper .addline { display: flex; gap: 8px; margin: 0 0 22px; }
.paper .addline select, .paper .addline button { font: inherit; font-size: 13px; border: 1px dashed #c9c4b6; background: none; color: #4a5160; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.paper .addline button:hover, .paper .addline select:hover { border-color: #b8462a; color: #0a1424; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 14px; position: relative; font-size: 13.5px; }
.timeline li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; background: var(--line-2); box-shadow: 0 0 0 3px var(--bg); }
.timeline li.on::before { background: var(--amber); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.timeline .faint { display: block; font-size: 12.5px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chips label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--text-2); transition: border-color .12s var(--spring), background .12s var(--spring); }
.check-chips input { accent-color: var(--amber); margin: 0; }
.check-chips label:has(input:checked) { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--text); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inv { grid-template-columns: 1fr; }
  .inv__side { position: static; order: -1; }
}
@media (max-width: 900px) {
  .loadbar { left: 0; }
  .paper { padding: 32px 22px 28px; }
  .paper .ph, .paper .meta, .paper .foot { grid-template-columns: 1fr; display: grid; }
  .paper .from { text-align: left; }
  .itable .col-hide { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 21px; }
  .hbar { grid-template-columns: 110px 1fr 58px; }
  .form-grid { grid-template-columns: 1fr; }
  .ageing-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .loadbar, .inv__side, .crumb, .page-h, .chips, #toast, .paper .rm, .paper .addline, .no-print { display: none !important; }
  .app { display: block; }
  .main__in { width: 100%; padding: 0; animation: none !important; }
  .inv { display: block; }
  .paper { box-shadow: none; padding: 0; border-radius: 0; }
  .paper input, .paper textarea { border: 0; padding: 0; }
  @page { margin: 18mm; }
}
@media (prefers-reduced-motion: reduce) {
  .glide { transition: none !important; }
}

/* ---- Grouped roles grid and products -------------------------------------------- */

.matrix tr.sub td { padding-top: 14px; padding-bottom: 6px; background: var(--bg); font-weight: 600; font-size: 13.5px; color: var(--text); }
.matrix tr.sub td:first-child { background: var(--bg); }
.matrix tr.feat td:first-child { padding-left: 30px; }
.matrix tr.grp td { border-bottom-color: var(--line-2); }
.lvl--bulk { width: auto; min-width: 74px; height: 24px; padding: 0 9px; font-size: 11.5px; border-radius: 999px; }
.lvl--mixed { border-style: dashed; color: var(--muted); }
.mod__f { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 22px; padding-top: 12px; }
.fgroup { display: grid; align-content: start; }
.fgroup__h { font-weight: 600; color: var(--text); border-bottom: 1px solid var(--line); margin-bottom: 2px; }

/* Theme switch in the sidebar foot */
.theme-switch { display: flex; width: max-content; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 999px; margin-top: 10px; }
.theme-switch button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.theme-switch button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); }

/* ---- Light version: white, navy ink, deep brass; the sidebar stays navy glass ---- */

:root[data-theme="light"] {
  --bg: #F5F6F9;
  --bg-2: rgba(255, 255, 255, .6);
  --panel: rgba(255, 255, 255, .62);
  --panel-2: rgba(255, 255, 255, .9);
  --line: rgba(11, 19, 43, .09);
  --line-2: rgba(11, 19, 43, .17);
  --text: #0B132B;
  --text-2: #1C2541;
  --muted: #3A506B;
  --faint: #6B7A91;
  --amber: #8A6524;
  --amber-hi: #6E4F1A;
  --amber-ink: #ffffff;
  --sky: #2A3C6E;
  --ok: #23845A;
  --warn: #9A6700;
  --bad: #B42343;
  --info: #2A3C6E;
  --onb: #6656CC;
  --glass-bg: linear-gradient(155deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .55) 62%);
  --glass-edge: rgba(255, 255, 255, .8);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 22px 50px -32px rgba(11, 19, 43, .4);
  --glow-a: rgba(184, 137, 59, .14);
  --glow-b: rgba(42, 60, 110, .14);
  --glow-c: rgba(201, 212, 236, .5);
  --glass: rgba(245, 246, 249, .8);
  color-scheme: light;
}
:root[data-theme="light"] .sidebar { background: rgba(11, 19, 43, .9); border-right-color: transparent; --text: #F5F7FB; --text-2: #D4DAE4; --muted: #93A3BC; --faint: #68799A; --panel: rgba(28, 37, 65, .7); --panel-2: rgba(58, 80, 107, .45); --line: rgba(147, 163, 188, .13); --line-2: rgba(147, 163, 188, .26); --amber: #C9A24E; --bg-2: rgba(8, 14, 34, .55); color: var(--text); }
:root[data-theme="light"] .lvl--edit { background: color-mix(in srgb, var(--amber) 14%, transparent); color: var(--amber-hi); }
:root[data-theme="light"] .paper { box-shadow: 0 18px 50px rgba(11, 19, 43, .14), 0 0 0 1px var(--line); }
:root[data-theme="light"] dialog { background: rgba(255, 255, 255, .94); }
:root[data-theme="light"] dialog::backdrop { background: rgba(11, 19, 43, .35); }
:root[data-theme="light"] .tag--demo { color: var(--muted); }
:root[data-theme="light"] #toast { background: var(--text); color: #F5F6F9; }

/* ---- Phone preview: the yard's app as a role opens it (preview.js) ---------------- */

.pv-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.seg--sm button { padding: 4px 10px; font-size: 12.5px; }
.pv { font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 12px; }
.pv-status { display: flex; justify-content: space-between; padding: 12px 22px 2px; font-size: 11.5px; font-weight: 600; }
.pv-top { display: grid; grid-template-columns: 26px 1fr 26px; align-items: center; gap: 8px; padding: 8px 14px 10px; border-bottom: 1px solid; }
.pv-top .crest { width: 26px; height: 26px; }
.pv-top b { text-align: center; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 19px; }
.pv-bell { position: relative; display: grid; place-items: center; }
.pv-bell i { position: absolute; top: 0; right: 2px; width: 6px; height: 6px; border-radius: 50%; }
.pv-body { flex: 1; overflow: hidden; padding: 10px 11px 0; display: grid; gap: 8px; align-content: start; }
.pv-hero { border-radius: 14px; padding: 13px 14px 14px; display: grid; gap: 3px; }
.pv-hero small { font-size: 10px; opacity: .75; }
.pv-hero b { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; font-size: 22px; line-height: 1.05; }
.pv-hero span { font-size: 11px; opacity: .85; }
.pv-hero--sm b { font-size: 19px; }
.pv-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pv-tiles div { border: 1px solid; border-radius: 10px; padding: 6px 6px 7px; display: grid; gap: 1px; }
.pv-tiles b { font-family: "Cormorant Garamond", Georgia, serif; font-size: 17px; font-weight: 600; line-height: 1; }
.pv-tiles small { font-size: 8.5px; line-height: 1.15; }
.pv-card { border: 1px solid; border-radius: 12px; padding: 8px 10px 4px; }
.pv-k { font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.pv-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid; font-size: 11.5px; }
.pv-row:first-of-type { border-top: 0; }
.pv-row > span { flex: 1; min-width: 0; line-height: 1.25; }
.pv-row small { font-size: 10px; }
.pv-lot { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; flex: none; }
.pv-silk { flex: none !important; width: 16px; height: 16px; border-radius: 4px; }
.pv-mark { letter-spacing: 1px; }
.pv-empty { padding: 30px 16px; text-align: center; font-size: 12px; }
.pv-powered { text-align: center; font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; padding: 6px 0 4px; }
.pv-menu { display: grid; gap: 1px; padding: 2px 4px; }
.pv-sec { font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 10px 6px 4px; }
.pv-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; }
.pv-hidden { font-size: 10.5px; line-height: 1.5; padding: 0 6px; }
.pv-tabs { display: flex; justify-content: space-around; padding: 7px 6px calc(10px + 4px); border-top: 1px solid; }
.pv-tabs span { display: grid; justify-items: center; gap: 2px; }
.pv-tabs small { font-size: 9px; font-weight: 600; }

/* Live tab: the three apps side by side, a problem report's own words, the banner now showing */
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats--3 .stat .small { display: block; margin-top: 2px; }
.bad-ink { color: var(--bad) !important; }
.issue-text { margin: 4px 0 2px; color: var(--text-2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.live-banner { padding: 12px 14px; margin-bottom: 14px; border-left: 3px solid var(--amber); }
@media (max-width: 720px) { .stats--3 { grid-template-columns: 1fr; } }
