/* v6 · The Record Card */

:root {
  --ground: #eef0f2;
  --panel: #f8f9fa;
  --paper: #fbfcfc;
  --line: #d6dbe0;
  --line-2: #b9c0c7;
  --ink: #1d2126;
  --ink-2: #3b4148;
  --muted: #5c636a;
  --faint: #8a9199;
  --hover: #e3e7eb;
  --red: #c8102e;
  --red-deep: #a00c24;
  --red-tint: #fbe8eb;
  --red-line: #efb6c0;
  --on-red: #ffffff;
  --brand: #00707a;
  --brand-deep: #005960;
  --on-brand: #ffffff;
  --on-brand-2: #d3eef0;
  --graphite: #3b4148;

  --ui: 'Selawik', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Cascadia Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gut: clamp(16px, 3.6vw, 56px);
  --rail: 0px;
  --gap: 32px;
  --aside: 300px;
  --bar: 48px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --t: 320ms;

  color-scheme: light;
}

@media (min-width: 1200px) { :root { --rail: 150px; } }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-padding-top: calc(var(--bar) + 64px);
  overflow-x: hidden;
  overflow-x: clip;
  scrollbar-color: #9aa1a8 var(--ground);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--ink);
}

::selection { background: var(--brand); color: var(--on-brand); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: #b0b7be; border: 3px solid var(--ground); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #8a9199; }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic--fill { fill: currentColor; stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.code { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--ground); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 8px; }

/* ── App bar ─────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--bar);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gut);
  background: var(--brand); color: var(--on-brand);
  view-transition-name: appbar;
}
.appbar :focus-visible, .dlg > .dlg__bar :focus-visible, .post .dlg__bar :focus-visible, .tb__c--title :focus-visible { outline-color: var(--on-brand); }
.appbar__l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.appbar__waffle { width: 18px; height: 18px; opacity: .85; }
.appbar__name { font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.appbar__env { font-size: 13px; color: var(--on-brand-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.35); }
.appbar__r { display: flex; align-items: center; gap: 6px; }
.tellme {
  display: inline-flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px; min-width: 300px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4); border-radius: 2px;
  color: var(--on-brand); font-size: 13px; cursor: pointer; text-align: left;
}
.tellme:hover { background: rgba(255,255,255,.2); }
.tellme__t { flex: 1; }
.tellme kbd { font-family: var(--mono); font-size: 12px; color: var(--on-brand-2); border: 1px solid rgba(255,255,255,.4); padding: 1px 5px; border-radius: 2px; }
.appbar__icon { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--on-brand); }
.appbar__icon:hover { background: rgba(255,255,255,.16); }
.appbar__icon .ic { width: 18px; height: 18px; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--on-brand); color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .02em; margin-left: 4px; }

/* Tell me */
.tm {
  position: absolute; top: calc(var(--bar) - 4px); right: var(--gut);
  width: min(520px, calc(100vw - 2 * var(--gut)));
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 3px;
  box-shadow: 0 18px 40px -14px rgba(29,33,38,.4), 0 2px 6px rgba(29,33,38,.12);
  padding: 6px;
}
.tm :focus-visible { outline-color: var(--ink); }
.tm input {
  width: 100%; height: 46px; padding: 0 12px;
  font: 16px var(--ui); color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid var(--ink); outline: none;
}
.tm input::placeholder { color: var(--muted); }
.tm ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 60vh; overflow: auto; }
.tm li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 44px; padding: 8px 12px; cursor: pointer; font-size: 15px;
}
.tm li span { font-family: var(--mono); font-size: 12.5px; color: var(--muted); text-align: right; }
.tm li[aria-selected="true"], .tm li:hover { background: var(--hover); }
.tm li[hidden] { display: none; }
.tm__none { padding: 12px; color: var(--muted); font-size: 14px; }

/* ── Navigation bar ──────────────────────────────────── */
.navbar {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 0 var(--gut);
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.navbar::-webkit-scrollbar { display: none; }
.navbar a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 12px; white-space: nowrap;
  font-size: 14px; text-decoration: none; color: var(--ink-2);
  box-shadow: inset 0 -2px 0 transparent;
}
.navbar a:hover { background: var(--hover); color: var(--ink); }
.navbar a.is-on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--brand); font-weight: 600; }
.navbar__draft { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px dashed var(--line-2); padding: 0 6px; }

/* ── Pinned compact header ───────────────────────────── */
.pin {
  position: fixed; left: 0; right: 0; top: var(--bar); z-index: 50;
  background: rgba(248,249,250,.97); border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 16px -10px rgba(29,33,38,.35);
  transform: translateY(-120%); visibility: hidden;
  transition: transform var(--t) var(--ease), visibility 0s linear var(--t);
}
.pin.is-on { transform: none; visibility: visible; transition: transform var(--t) var(--ease), visibility 0s; }
.pin__in { max-width: 1440px; margin: 0 auto; padding: 8px var(--gut); display: flex; align-items: center; gap: 12px; min-height: 56px; }
.pin__t { font-size: 17px; font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; white-space: nowrap; }
.pin__go { margin-left: auto; }

/* ── Sheet layout ────────────────────────────────────── */
.sheet {
  position: relative;
  max-width: 1440px; margin: 0 auto;
  padding: 36px var(--gut) 72px;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--aside); gap: 0 40px;
  outline: none;
}
@media (min-width: 1200px) { .sheet { padding-left: calc(var(--gut) + var(--rail) + var(--gap)); } }
.rec { position: relative; min-width: 0; }
.ink {
  position: absolute; top: 0; bottom: 0; right: 0;
  left: calc(-1 * (var(--rail) + var(--gap)));
  width: calc(100% + var(--rail) + var(--gap)); height: 100%;
  pointer-events: none; z-index: 12; overflow: visible;
}

/* ── Record head ─────────────────────────────────────── */
.head { position: relative; }
.tw { width: fit-content; }
.title {
  font-weight: 600;
  font-size: clamp(50px, 7vw, 96px);
  line-height: .9;
  letter-spacing: -.04em;
  text-transform: uppercase;
  width: min-content;
  view-transition-name: rec-title;
}
.dim { display: flex; align-items: center; gap: 10px; margin-top: 12px; height: 14px; color: var(--graphite); position: relative; }
.dim::before, .dim::after { content: ""; position: absolute; top: -3px; width: 1px; height: 20px; background: currentColor; }
.dim::before { left: 0; } .dim::after { right: 0; }
.dim i { flex: 1; height: 1px; background: currentColor; position: relative; }
.dim i:first-child::before, .dim i:last-child::after {
  content: ""; position: absolute; top: -3px; width: 8px; height: 7px; background: currentColor;
}
.dim i:first-child::before { left: 0; clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.dim i:last-child::after { right: 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.dim span { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }

.head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 2px;
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.badge--status { color: var(--ink); background: var(--paper); }
.is-released .badge--status { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.badge--err { color: var(--on-red); border-color: var(--red); background: var(--red); }
.badge--err.is-zero { color: var(--ink-2); border-color: var(--line-2); background: var(--paper); }
.badge--err.is-zero .ic { display: none; }
a.badge--err:hover { background: var(--red-deep); border-color: var(--red-deep); }
a.badge--err.is-zero:hover { background: var(--hover); }

.actionbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  margin-top: 22px; padding: 4px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.act {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 12px;
  font-size: 14px; color: var(--ink); text-decoration: none;
  background: none; border: 0; border-radius: 2px; cursor: pointer;
}
.act:hover:not([disabled]) { background: var(--hover); }
.act[disabled] { color: var(--faint); cursor: not-allowed; }
.act--pri { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.act--pri:hover:not([disabled]) { background: var(--brand-deep); }
.act__why { font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 0 10px 0 2px; }
.act__more { display: contents; }
.act--more, .show-s { display: none; }
.is-released .act[data-release] { color: var(--ink); cursor: default; }

/* ── FastTabs ────────────────────────────────────────── */
.ft { margin-top: 44px; border-top: 1px solid var(--line-2); position: relative; }
.ft__h { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
.ft__h button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 8px 0 0; margin-left: -2px;
  background: none; border: 0; cursor: pointer; font-weight: 600; letter-spacing: inherit;
}
.ft__h button { text-align: left; text-wrap: balance; }
.ft__h button:hover { text-decoration: underline; text-underline-offset: 4px; }
.ft__h .ic { transition: transform var(--t) var(--ease); }
.ft__h button[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.ft__promo { font-size: 13px; font-weight: 400; color: var(--muted); opacity: 0; transition: opacity var(--t) var(--ease); text-align: right; }
.ft.is-collapsed .ft__promo { opacity: 1; }
.ft__b[hidden] { display: none; }
.ft__lede { max-width: 64ch; color: var(--ink-2); font-size: 16px; margin: 4px 0 18px; }
.ft__cmd {
  margin-top: 26px; padding-top: 12px; border-top: 2px solid var(--brand);
  font-weight: 700; font-size: 20px; line-height: 1.2; letter-spacing: .05em; text-transform: uppercase; color: var(--brand);
}
.ft__cmd--in { margin: 0; padding: 14px 22px 16px; border-top: 2px solid var(--brand); }
.ft__foot { margin-top: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* General fields */
.fields { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; row-gap: 12px; margin-top: 6px; }
.f { display: grid; grid-template-columns: 148px minmax(0, 1fr) 22px; align-items: end; gap: 0 10px; min-height: 44px; position: relative; }
.f__c { color: var(--muted); font-size: 14px; padding-bottom: 7px; }
.f__v {
  position: relative;
  min-height: 34px; padding: 7px 2px 6px;
  border-bottom: 1px solid var(--line-2);
  font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color var(--t) var(--ease), color var(--t) var(--ease);
}
.f[data-err] .f__v { border-bottom: 2px solid var(--red); background: var(--red-tint); padding-left: 8px; }
.f__flag { color: var(--red); padding-bottom: 9px; display: inline-flex; }
.f__flag, .f__rev { grid-column: 3; grid-row: 1; }
.f__rev[hidden] { display: none !important; }
.f__rev { padding-bottom: 7px; display: inline-flex; align-items: center; justify-content: center; position: relative; color: var(--graphite); font-family: var(--mono); font-size: 11px; font-weight: 600; width: 22px; height: 22px; }
.f__rev::before { content: ""; position: absolute; inset: 0 0 4px; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%, 50% 0, 50% 12%, 11% 93%, 89% 93%, 50% 12%); }
.f__rev b { position: relative; top: 1px; font-weight: 600; }
.f.is-fixed .f__v { border-bottom: 1px solid var(--line-2); background: transparent; padding-left: 2px; }
.f.is-fixed .f__flag { display: none; }
.f.is-fixed .f__rev { display: inline-flex; }
.f__empty { display: inline-block; width: 1px; }
.f__v.is-changed { animation: changed 900ms var(--ease); }
@keyframes changed { from { background: #dfe3e7; } to { background: transparent; } }

/* Error dialog */
.dlg {
  position: absolute; z-index: 20;
  top: 44px; right: calc(-1 * (var(--aside) + 40px) + 44px);
  width: min(520px, 56vw);
  background: var(--paper);
  border: 1px solid #c3c9cf; border-radius: 3px;
  box-shadow: 0 30px 60px -24px rgba(29,33,38,.45), 0 4px 12px -2px rgba(29,33,38,.14);
  transform-origin: 100% 0;
}
@media (prefers-reduced-motion: no-preference) {
  .dlg { animation: dlgIn 520ms var(--ease) 120ms both; }
}
@keyframes dlgIn { from { opacity: 0; transform: translateY(14px) scale(.975); } }
.dlg.is-gone { display: none; }
.dlg__bar { display: flex; align-items: center; gap: 10px; padding: 6px 6px 0 22px; min-height: 50px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dlg__icon { color: var(--red); width: 20px; height: 20px; }
.dlg > .dlg__bar { background: var(--red); color: var(--on-red); margin: -1px -1px 0; padding: 0 4px 0 18px; min-height: 50px; border-radius: 3px 3px 0 0; }
.dlg > .dlg__bar .dlg__icon, .dlg > .dlg__bar .dlg__x { color: var(--on-red); }
.dlg > .dlg__bar .dlg__x:hover { background: rgba(255,255,255,.18); }
.dlg > .dlg__t { padding-top: 20px; }

/* Record alert bar: loud while the record has errors, quiet once it is released */
.alertbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 14px; padding: 10px 14px; min-height: 48px;
  background: var(--red-tint); border: 1px solid var(--red-line); border-radius: 2px;
  font-size: 14px; color: var(--ink);
}
.alertbar .ic { color: var(--red); width: 18px; height: 18px; }
.alertbar p { flex: 1 1 280px; }
.alertbar b { color: var(--red-deep); font-weight: 700; }
.alertbar .lnk { min-height: 32px; color: var(--red-deep); }
.alertbar.is-clear { background: var(--panel); border-color: var(--line-2); }
.alertbar.is-clear .ic, .alertbar.is-clear b, .alertbar.is-clear .lnk { color: var(--ink); }
/* while the error dialog is up it owns the one red primary, and nothing hides under it */
@media (min-width: 1024px) {
  .rec:has(.dlg:not(.is-gone)) .alertbar { margin-right: 256px; }
}
.sheet:has(.dlg:not(.is-gone)) .fbx .btn--pri { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.sheet:has(.dlg:not(.is-gone)) .fbx .btn--pri:hover { background: var(--hover); }
.dlg__bar--calm .dlg__icon { color: var(--ink); }
.dlg__x { margin-left: auto; width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; color: var(--ink-2); border-radius: 2px; }
.dlg__x:hover { background: var(--hover); }
.dlg__t {
  padding: 6px 22px 0;
  font-weight: 300; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.02; letter-spacing: -.03em;
  text-wrap: balance;
}
.dlg__p { padding: 16px 22px 0; font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.dlg__btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 22px 22px 20px; }
.dlg__more { border-top: 1px solid var(--line); padding: 0 22px 12px; }
.dlg__more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 13px; color: var(--muted); list-style-position: inside; }
.dlg__more code { display: block; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: var(--ink-2); padding-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  font: 600 14px var(--ui); text-decoration: none; white-space: nowrap;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink); border-radius: 2px; cursor: pointer;
  transition: background var(--t) var(--ease);
}
.btn:hover { background: var(--hover); }
.btn--pri { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--pri:hover { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn--block { display: flex; width: 100%; }

/* Validation errors (the pains) */
.errs { list-style: none; margin: 0; padding: 0; }
.err { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 6px 24px; padding: 26px 0 28px; border-bottom: 1px solid var(--line); }
.err:first-child { padding-top: 12px; }
.err__code { display: inline-flex; align-items: center; gap: 8px; align-self: start; padding-top: 8px; font-family: var(--mono); font-size: 13px; color: var(--red); transition: color var(--t) var(--ease); }
.err__m { font-weight: 300; font-size: clamp(28px, 3.3vw, 46px); line-height: 1.1; letter-spacing: -.025em; max-width: 21ch; text-wrap: balance; transition: color var(--t) var(--ease); }
.err__fix { grid-column: 2; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.err.is-fixed .err__code { color: var(--graphite); }
.err.is-fixed .err__code .ic { visibility: hidden; }
.err.is-fixed .err__m { color: var(--muted); }

/* Grids (lines, systems, ledger) */
.grid__hd {
  display: grid; gap: 0 20px; align-items: end;
  padding: 10px 0 8px; border-bottom: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.grid--lines .grid__hd, .line { grid-template-columns: 70px minmax(0, 1fr) 70px 104px; }
.grid--sys .grid__hd, .sys { grid-template-columns: 70px minmax(0, 1fr) 76px 104px; }
.grid--led .grid__hd, .led { grid-template-columns: 136px minmax(0, 1fr); }

.line { display: grid; gap: 0 20px; padding: 28px 0 32px; border-bottom: 1px solid var(--line); position: relative; }
.line__no, .line__c { padding-top: 10px; color: var(--muted); }
.line h3 { font-weight: 600; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.08; letter-spacing: -.025em; }
.line p { margin-top: 12px; font-size: 16px; line-height: 1.6; color: #2b3036; max-width: 64ch; }
.line__s { padding-top: 8px; }
.chg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-family: var(--mono); font-size: 12.5px !important; line-height: 1.5 !important; color: var(--muted) !important; }
.chg + .chg { margin-top: 6px !important; }
.chg del { color: var(--red); text-decoration-thickness: 1px; transition: color var(--t) var(--ease); }
.chg__to { color: var(--ink); display: inline-flex; align-items: center; gap: 10px; }
.chg__to::before { content: ""; width: 18px; height: 7px; background: var(--graphite); clip-path: polygon(0 3px, 13px 3px, 13px 0, 18px 3.5px, 13px 7px, 13px 4px, 0 4px); }
.line.is-posted .chg del { color: var(--muted); }
.lnk { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-height: 44px; }

.st {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 2px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--paper);
  white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease);
}
.st.is-done, .st--live { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.st.is-done::before, .st--live::before {
  content: ""; width: 12px; height: 12px; background: currentColor;
  clip-path: polygon(8% 52%, 20% 40%, 40% 60%, 82% 18%, 94% 30%, 40% 84%);
}
.st--done { color: var(--ink); border-color: var(--ink); }

.sys { display: grid; gap: 0 20px; padding: 20px 0 22px; border-bottom: 1px solid var(--line); align-items: start; }
.sys > .code, .sys > span:not(.code) { padding-top: 4px; font-size: 14px; color: var(--muted); }
.sys > .code { font-size: 13px; }
.sys h3 { font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.sys p { margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 66ch; }
.sys--kanso { background: var(--panel); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.sys--kanso h3 { font-size: clamp(30px, 3vw, 40px); line-height: 1; letter-spacing: -.03em; }
.sys--kanso p { font-size: 16px; }

/* Ledger + dimension chain */
.chain { position: relative; height: 82px; margin: 14px 0 6px; color: var(--graphite); font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.chain span, .chain__all {
  position: absolute; left: calc(var(--a) / 9 * 100%); width: calc((var(--b) - var(--a)) / 9 * 100%);
  height: 17px; border-bottom: 1px solid currentColor; text-align: center; line-height: 14px; font-weight: 600;
}
.chain span { top: 34px; }
.chain__all { --a: 0; --b: 9; top: 0; letter-spacing: .12em; text-transform: uppercase; }
.chain span::before, .chain span::after, .chain__all::before, .chain__all::after {
  content: ""; position: absolute; bottom: -8px; width: 1px; height: 16px; background: currentColor;
}
.chain span::before, .chain__all::before { left: 0; }
.chain span::after, .chain__all::after { right: 0; }
.chain em { position: absolute; top: 60px; left: calc(var(--a) / 9 * 100%); transform: translateX(-50%); font-style: normal; color: var(--muted); white-space: nowrap; }
.chain em:first-of-type { transform: none; }
.chain em:last-of-type { transform: translateX(-100%); }

.led { display: grid; gap: 0 20px; padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.led > .code { padding-top: 4px; color: var(--muted); }
.led h3 { font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.led__at { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.led p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 66ch; }

.quals { margin-top: 30px; }
.quals__h { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.quals ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.quals li { background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.quals b { font-size: 15px; font-weight: 600; }
.quals span { font-size: 13px; color: var(--muted); }

/* Post */
.ft--post { border-top: 0; margin-top: 56px; }
.post {
  position: relative;
  background: var(--paper); border: 1px solid #c3c9cf; border-radius: 3px;
  box-shadow: 0 24px 50px -30px rgba(29,33,38,.4), 0 2px 6px rgba(29,33,38,.08);
  max-width: 820px;
}
.post .dlg__bar { padding: 0 14px 0 22px; min-height: 52px; background: var(--brand); color: var(--on-brand); margin: -1px -1px 0; border-radius: 3px 3px 0 0; }
.post .dlg__bar .dlg__icon { color: var(--on-brand); }
.dlg__state { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--on-brand); }
.dlg__state .badge--status { background: var(--on-brand); color: var(--ink); border-color: var(--on-brand); }
.is-released .dlg__state .badge--status { background: var(--ink); color: var(--on-brand); border-color: var(--ink); }
.dlg__state .badge--draft { color: var(--on-brand); border-color: var(--on-brand); }
.post__t { margin-top: 16px; }
.post__t { padding: 10px 22px 0; font-weight: 300; font-size: clamp(34px, 4.6vw, 64px); line-height: 1; letter-spacing: -.035em; max-width: 15ch; text-wrap: balance; }
.post__p { padding: 18px 22px 0; font-size: 16px; line-height: 1.6; color: var(--ink-2); max-width: 62ch; }
.post__mail { display: inline-block; margin: 22px 22px 0; font-weight: 600; font-size: clamp(22px, 3vw, 40px); letter-spacing: -.02em; text-underline-offset: 7px; text-decoration-thickness: 2px; overflow-wrap: anywhere; }
.post .dlg__btns { justify-content: flex-start; }
.post__facts { margin: 0; padding: 14px 22px 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 14px; }
.post__facts div { display: flex; gap: 10px; }
.post__facts dt { color: var(--muted); }
.post__facts dd { margin: 0; }

/* ── FactBox pane ────────────────────────────────────── */
.fbx { min-width: 0; }
.fbx__in { position: sticky; top: calc(var(--bar) + 72px); display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - var(--bar) - 88px); overflow: auto; scrollbar-width: thin; padding-bottom: 4px; }
.fb { background: var(--panel); border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px 12px; }
.fb__h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.fb__n { font-family: var(--mono); font-size: 12.5px; font-weight: 400; color: var(--red); font-variant-numeric: tabular-nums; }
.fb__n.is-zero, .fb--pic .fb__n { color: var(--muted); }
.val { list-style: none; margin: 0; padding: 0; }
.val li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 34px; border-top: 1px solid var(--line); font-size: 14px; position: relative; }
.val li:first-child { border-top: 0; }
.val .ic--err { color: var(--red); grid-column: 1; grid-row: 1; transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.val__rev { grid-column: 1; grid-row: 1; position: relative; width: 22px; height: 20px; color: var(--graphite); opacity: 0; transform: scale(.6); transition: opacity 280ms var(--ease), transform 380ms var(--ease); }
.val__rev .ic { width: 22px; height: 22px; position: absolute; left: 0; top: -2px; stroke-width: 1.2; }
.val__rev i { position: absolute; inset: 8px 0 0; text-align: center; font: 600 10px/1 var(--mono); font-style: normal; }
.val__t { grid-column: 2; }
.val__s { grid-column: 3; font-size: 12px; color: var(--muted); }
.val li.is-fixed .ic--err { opacity: 0; transform: scale(.4); }
.val li.is-fixed .val__rev { opacity: 1; transform: none; }
.val li.is-fixed .val__t { color: var(--ink-2); }
.walk { display: block; width: 100%; height: auto; }
.stat { margin: 0; }
.stat div { display: flex; justify-content: space-between; gap: 12px; min-height: 30px; align-items: center; border-top: 1px solid var(--line); font-size: 14px; }
.stat div:first-child { border-top: 0; }
.stat dt { color: var(--muted); }
.stat dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Drawing-office notes (margin rail) ──────────────── */
.note {
  font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--graphite);
  max-width: 34ch; margin-top: 14px;
}
.note--owner { padding-left: 158px; }
@media (min-width: 1200px) {
  .note, .note--owner {
    position: absolute; margin: 0; padding: 0;
    left: calc(-1 * (var(--rail) + var(--gap)));
    width: calc(var(--rail) - 6px);
    top: var(--ny, 0px);
  }
}

/* ── Title block ─────────────────────────────────────── */
.tb { max-width: 1440px; margin: 0 auto; padding: 0 var(--gut) 40px; }
.tb__grid {
  display: grid; grid-template-columns: 2.2fr 1fr 1fr .6fr .8fr;
  border: 1.5px solid var(--graphite); color: var(--graphite);
  background: var(--ground);
}
.tb__c { padding: 10px 12px 12px; border-right: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); min-width: 0; }
.tb__c:nth-child(5), .tb__c--revs, .tb__c--nav { border-right: 0; }
.tb__c > span { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tb__c b { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tb__c--title { background: var(--brand); }
.tb__c--title > span { color: var(--on-brand-2); }
.tb__c--title b { font-size: 24px; text-transform: uppercase; letter-spacing: -.02em; color: var(--on-brand); }
.tb__c--who { grid-column: 1 / 2; border-bottom: 0; }
.tb__c--revs { grid-column: 2 / 5; border-bottom: 0; border-right: 1px solid var(--graphite); }
.tb__c--nav { grid-column: 5 / 6; border-bottom: 0; }
.tb__c--nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; color: var(--ink); }
.revs { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.revs li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 28px; }
.revs li.revs__empty { display: block; color: var(--muted); }
.revs .tri { position: relative; width: 26px; height: 23px; display: inline-grid; place-items: end center; font-size: 11.5px; font-weight: 600; padding-bottom: 2px; line-height: 1; }
.revs .tri::before { content: ""; position: absolute; inset: 0; background: currentColor; clip-path: polygon(50% 0, 100% 100%, 0 100%, 50% 0, 50% 14%, 10% 93%, 90% 93%, 50% 14%); }
.revs .by { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .revs li.is-new { animation: revIn 480ms var(--ease); }
}
@keyframes revIn { from { opacity: 0; transform: translateX(-6px); } }

/* ── Page to page ────────────────────────────────────── */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: 260ms var(--ease) both vtOut; }
  ::view-transition-new(root) { animation: 460ms var(--ease) both vtIn; }
  ::view-transition-group(rec-title) { animation-duration: 460ms; animation-timing-function: var(--ease); }
}
@keyframes vtOut { to { opacity: 0; transform: translateX(-2%) scale(.985); } }
@keyframes vtIn { from { opacity: 0; transform: translateX(4%); } }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1199px) {
  .dlg { right: calc(-1 * var(--aside) - 8px); }
}
@media (max-width: 1023px) {
  :root { --aside: 260px; }
  .tellme { min-width: 0; }
  .tellme__t { display: none; }
  .fields { grid-template-columns: 1fr; }
  .dlg { position: relative; top: auto; right: auto; width: auto; margin: 28px 0 0; }
  .f[data-err="E1"] { order: -3; }
  .f:first-child { order: -2; }
  .note--owner { padding-left: 0; }
}
@media (max-width: 899px) {
  .sheet { display: flex; flex-direction: column; padding-top: 24px; }
  .rec { display: contents; }
  .rec > * { order: 6; }
  .rec > .head { order: 1; } .rec > .dlg { order: 2; } .rec > #general { order: 3; } .rec > #errors { order: 4; }
  .fbx { order: 5; margin-top: 44px; }
  .rec > #lines, .rec > #formats { order: 6; } .rec > #shipped, .rec > #day { order: 7; } .rec > #record { order: 8; } .rec > #post, .rec > #request { order: 9; }
  .ink { display: none; }
  .fbx__in { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: 1fr 1fr; }
  .fbx__in > .btn { grid-column: 1 / -1; }
  .fb--pic { grid-row: span 2; }
}
@media (max-width: 719px) {
  .hide-s { display: none; }
  .appbar__env { display: none; }
  .appbar { gap: 8px; }
  .title { font-size: clamp(44px, 13.5vw, 64px); }
  .show-s { display: inline; }
  .actionbar { position: relative; flex-wrap: nowrap; gap: 4px; margin-top: 18px; }
  .act { flex: none; padding: 0 10px; white-space: nowrap; }
  .act--more { display: inline-flex; margin-left: auto; }
  .act--more[aria-expanded="true"] { background: var(--hover); }
  .act__more {
    display: none; position: absolute; z-index: 30; right: 0; top: calc(100% + 4px);
    min-width: 232px; padding: 6px; flex-direction: column; align-items: stretch;
    background: var(--paper); border: 1px solid var(--line-2); border-radius: 3px;
    box-shadow: 0 18px 40px -14px rgba(29,33,38,.4), 0 2px 6px rgba(29,33,38,.12);
  }
  .act__more.is-open { display: flex; }
  .act__more .act { justify-content: flex-start; }
  .act__more .act__why { padding: 0 12px 8px 36px; }
  .head__meta { margin-top: 16px; }
  .dlg { margin-top: 20px; }
  .dlg__more { display: none; }
  .rec:has(.dlg:not(.is-gone)) .alertbar { display: none; }
  .dlg__p { font-size: 15px; padding-top: 12px; }
  .dlg__btns { padding: 16px 16px 16px; }
  .dlg__t, .dlg__p { padding-left: 16px; padding-right: 16px; }
  .dlg__bar { padding-left: 16px; }
  .ft { margin-top: 30px; }
  .dlg__t { font-size: 30px; }
  .dlg__btns { justify-content: stretch; }
  .dlg__btns .btn { flex: 1 1 auto; }
  .err { grid-template-columns: 1fr; padding: 20px 0 22px; }
  .err__fix { grid-column: 1; }
  .err__code { padding-top: 0; }
  .err__m { font-size: 28px; }
  .grid--lines .grid__hd, .grid--sys .grid__hd, .grid--led .grid__hd { display: none; }
  .line, .sys { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "no st" "d d" "c c"; }
  .line__no, .sys > .code { grid-area: no; padding-top: 0; }
  .line__s, .sys > span:last-child { grid-area: st; padding-top: 0; }
  .line__d, .sys > div { grid-area: d; margin-top: 10px; }
  .line__c, .sys > span:nth-child(3) { grid-area: c; padding-top: 10px; }
  .line__c::before { content: "Clears "; }
  .sys--kanso { margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
  .led { grid-template-columns: 1fr; }
  .quals ul { grid-template-columns: 1fr; }
  .fbx__in { grid-template-columns: 1fr; }
  .fb--pic { grid-row: auto; }
  .pin__in { gap: 8px; }
  .pin__t { font-size: 15px; }
  .pin .code, .pin .badge--status, .pin .badge--err.is-zero { display: none; }
  .pin__go .hide-s { display: none; }
  .f__v { white-space: normal; overflow: visible; }
  .tb__grid { grid-template-columns: 1fr 1fr; }
  .tb__c { border-right: 1px solid var(--graphite) !important; }
  .tb__c:nth-child(even) { border-right: 0 !important; }
  .tb__c--title, .tb__c--who, .tb__c--revs, .tb__c--nav { grid-column: 1 / -1; border-right: 0 !important; border-bottom: 1px solid var(--graphite); }
  .tb__c--nav { border-bottom: 0; }
}
@media (max-width: 380px) {
  .chain { font-size: 11px; }
}

/* ── Draft record (workshops) ────────────────────────── */
.badge--draft { color: var(--ink-2); background: transparent; border: 1px dashed var(--ink-2); }
.badge--quiet { color: var(--muted); background: transparent; border-color: var(--line-2); font-weight: 400; }
.infobar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 14px; padding: 10px 14px;
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 2px;
  font-size: 14px; color: var(--ink-2);
}
.infobar .ic { color: var(--ink); }
.infobar p { flex: 1 1 420px; line-height: 1.5; max-width: 80ch; }
.infobar .lnk { min-height: 36px; }
.hold { position: relative; margin-top: 10px; padding: 0 2px; }
.hold__tag {
  position: absolute; top: -14px; right: 6px; z-index: 13;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--graphite); background: var(--ground); padding: 2px 8px; border: 1px solid var(--graphite);
}
.grid--ws .grid__hd, .grid--ws .line { grid-template-columns: 70px minmax(0, 1fr) 96px 104px; }
.st--prop { border-style: dashed; border-color: var(--ink-2); background: transparent; }
.f--tbc .f__v { color: var(--muted); font-style: italic; border-bottom-style: dashed; }
.val--ok li, .val--hold li { grid-template-columns: 22px minmax(0, 1fr); }
.val--ok .ic { color: var(--ink); }
.val__dash { width: 14px; height: 0; border-top: 1.5px dashed var(--ink-2); justify-self: start; }
.fb__n--quiet { color: var(--muted); }
.fb__link { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-weight: 600; }
.fb__link .code { font-weight: 400; color: var(--muted); }
.tri--p { font-size: 10px !important; }
@media (max-width: 719px) {
  .grid--ws .grid__hd { display: none; }
  .grid--ws .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line__c::before { content: "Clears "; }
  [data-page="workshops"] .line__c::before { content: "Length, draft: "; }
  .hold__tag { right: 0; }
}
@media (max-width: 899px) { .hold { border: 1px dashed var(--graphite); padding: 16px 12px 4px; margin-top: 22px; } }

/* ── Search: a found row flashes once ────────────────── */
@keyframes found { 0%, 35% { background-color: #d3eef0; } 100% { background-color: transparent; } }
.is-found { animation: found 1600ms var(--ease); scroll-margin: 120px; }
.tm li.tm__dyn span { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── External link (Kanso) ───────────────────────────── */
.ext { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.ext .ic { width: 18px; height: 18px; color: var(--brand); flex: none; }
.ext:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--brand); }

/* ── Email fallback, as a Business Central notification ─ */
.mailnote {
  position: fixed; z-index: 80; right: 20px; bottom: 20px; width: min(420px, calc(100vw - 32px));
  padding: 14px 44px 14px 16px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-2); border-top: 3px solid var(--brand); border-radius: 3px;
  box-shadow: 0 18px 40px -14px rgba(29,33,38,.45), 0 2px 6px rgba(29,33,38,.12);
  font-size: 14px;
}
.mailnote[hidden] { display: none; }
.mailnote__t { line-height: 1.45; }
.mailnote__addr { margin-top: 6px; font-family: var(--mono); font-size: 13px; user-select: all; }
.mailnote__a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.mailnote__a > * { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 2px; background: var(--paper); color: var(--ink); font: 600 13px var(--ui); text-decoration: none; cursor: pointer; }
.mailnote__a > *:first-child { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.mailnote__a > *:hover { background: var(--hover); }
.mailnote__a > *:first-child:hover { background: var(--brand-deep); }
.mailnote__x { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; background: none; border: 0; border-radius: 2px; cursor: pointer; color: var(--ink-2); }
.mailnote__x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.mailnote__x:hover { background: var(--hover); }
