/* CAC Digital Hub. One stylesheet, no build step.
   Look: a gallery's back office. Warm wall-white, ink, one brass accent.
   Colour carries meaning only (services, status). */

:root {
  --wall: #F7F5F0;
  --paper: #FFFFFF;
  --tint: #FBFAF7;
  --hover: #EFEBE3;
  --ink: #1B1A17;
  --ink-2: #55524B;
  --ink-3: #8E8A80;
  --line: #E7E3DA;
  --line-2: #D8D2C5;
  --brass: #9A7B4F;
  --brass-ink: #7A5E36;
  --brass-soft: #F3ECE0;
  --ok: #3F6B4E;   --ok-soft: #EAF1EC;
  --warn: #8A6A08; --warn-soft: #FBF3D6;   /* in progress: yellow */
  --hold: #3B5F8F; --hold-soft: #EAF0F8;   /* on hold: blue */
  --late: #9B3B2E; --late-soft: #FAEEEB;

  --c-framing: #9A7B4F;
  --c-installation: #3F5F7A;
  --c-repair: #8A4B5E;
  --c-crating: #5E6B45;
  --c-move: #6A5A84;
  --c-delivery: #2F6F73;
  --c-other: #A0624A;

  /* Named light-mode colours that the dark looks (html.dark, below) replace. */
  --on-fill: #FFFFFF;      /* text on ink, brass and service-colour fills */
  --ink-hover: #33312C;
  --line-brass: #E2D3B8; --brass-hover: #EDE2CF;
  --line-ok: #CFE0D4; --line-warn: #EADB9F; --line-hold: #C9D7EA; --line-late: #EBC9C2; --line-error: #D9A79C;
  --warn-mark: #D9B43C;
  --well: #F2EFE8; --well-2: #EEEAE2; --column: #EFECE5; --steps: #ECE8DF;
  --mat: #FFFFFF; --mat-ph: #E9E3D6; --frame-bg: #EDE8DE; --art-bg: #FFFFFF;
  --placeholder: #B3AEA3;
  --glass: rgba(255, 255, 255, .94);
  --pick-bg: #1B1A17;
  --st-client: #C9C2B3; --st-delivered: #7E8F6A;

  /* Digits come from EB Garamond (loaded with only 0-9): Cormorant's 1 looks like a capital I. */
  --serif: "EB Garamond", "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "Manrope", "Inter", system-ui, sans-serif;  /* numbers and codes (owner 2026-12-03: no dotted zero); not monospaced */
  --r: 8px;
  --r-lg: 12px;
}

/* --- Dark looks (sidebar → Appearance; staff only, saved with their login; base.html draws the class) -------------
   html.dark holds what all three share: lighter brass, status and service colours (same meanings as light), and
   the named colours above. Each look then sets its own neutrals: Graphite (grey, a trace of warmth), Charcoal
   (neutral), Slate (a touch cool). Art stands out on all of them. */
html.dark {
  color-scheme: dark;
  --brass: #C9A26B; --brass-ink: #DDBB86; --brass-soft: #353029;
  --ok: #8DBF9C;   --ok-soft: #24322A;
  --warn: #E3C25A; --warn-soft: #393119;
  --hold: #93B3DE; --hold-soft: #222C3A;
  --late: #EC8F7C; --late-soft: #3E2622;
  --c-framing: #C9A26B; --c-installation: #7FA4C4; --c-repair: #CF8EA4; --c-crating: #A9B784;
  --c-move: #AC9BD3; --c-delivery: #6DB7BA; --c-other: #D99C82;
  --line-brass: #4A3E2E; --brass-hover: #423727;
  --line-ok: #34493B; --line-warn: #4F4420; --line-hold: #33425A; --line-late: #5A3A33; --line-error: #8A4D42;
  --warn-mark: #E3C25A;
  --mat: #E9E5DC; --mat-ph: #4A4945; --frame-bg: #3A3935;
  --st-client: #6F6A60; --st-delivered: #93A57D;
}
html.dark, html.theme-graphite {
  --wall: #1E1E1C; --paper: #282826; --tint: #232321; --hover: #33322F;
  --ink: #EDEBE7; --ink-2: #BDBAB3; --ink-3: #8C8982; --line: #383734; --line-2: #4A4945;
  --on-fill: #1E1E1C; --ink-hover: #D6D3CC;
  --well: #33322F; --well-2: #262523; --column: #242422; --steps: #3A3936;
  --art-bg: #181816; --placeholder: #6E6B65; --glass: rgba(40, 40, 38, .94); --pick-bg: #3B3A36;
}
html.theme-charcoal {
  --wall: #1C1C1C; --paper: #262626; --tint: #212121; --hover: #303030;
  --ink: #ECECEC; --ink-2: #B8B8B8; --ink-3: #888888; --line: #363636; --line-2: #474747;
  --on-fill: #1C1C1C; --ink-hover: #D4D4D4;
  --well: #303030; --well-2: #242424; --column: #222222; --steps: #383838;
  --art-bg: #161616; --placeholder: #6B6B6B; --glass: rgba(38, 38, 38, .94); --pick-bg: #393939;
}
html.theme-slate {
  --wall: #1C1E21; --paper: #25282C; --tint: #212327; --hover: #2F3237;
  --ink: #EAECEE; --ink-2: #B4B9BF; --ink-3: #868C93; --line: #34383D; --line-2: #454A50;
  --on-fill: #1C1E21; --ink-hover: #D2D6DA;
  --well: #2F3237; --well-2: #23262A; --column: #212428; --steps: #383C42;
  --art-bg: #16181B; --placeholder: #6A7078; --glass: rgba(37, 40, 44, .94); --pick-bg: #383C42;
}
html.dark .pill.new, html.dark .pill.ok, html.dark .pill.warn, html.dark .pill.hold, html.dark .pill.late,
html.dark .pill.late-soft { border-color: transparent; }

/* Sidebar → Appearance: a quiet "Appearance" link; the four swatches slide out from behind it when it's pressed
   (nav.js adds .js-tucked so they start hidden; without script they simply show). Each swatch is its look's page
   colour with its card colour in the middle. */
.appearance { display: flex; align-items: center; gap: 6px; margin-top: auto; padding: 0 4px 0 10px; min-height: 32px; }
.appearance + .me { margin-top: 0; }
.appearance-toggle { font: 500 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
  background: none; border: 0; padding: 4px 0; cursor: pointer; }
.appearance-toggle:hover, .appearance.open .appearance-toggle { color: var(--ink-2); }
.swatches { display: flex; gap: 6px; padding: 5px 4px; }
.appearance.js-tucked .swatches { overflow: hidden; max-width: 0; opacity: 0; transform: translateX(-8px); pointer-events: none;
  transition: max-width .32s cubic-bezier(.2, .7, .2, 1), opacity .2s ease, transform .32s cubic-bezier(.2, .7, .2, 1); }
.appearance.js-tucked.open .swatches { max-width: 140px; opacity: 1; transform: none; pointer-events: auto; }
.swatch { width: 18px; height: 18px; flex: none; border-radius: 50%; padding: 0; cursor: pointer; border: 1px solid var(--line-2);
  box-shadow: 0 0 0 2px var(--wall); transition: box-shadow .15s, transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px var(--wall), 0 0 0 3.5px var(--brass); }
.swatch:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.swatch-light { background: radial-gradient(circle, #FFFFFF 0 3.5px, #F7F5F0 4px); border-color: #D8D2C5; }
.swatch-graphite { background: radial-gradient(circle, #282826 0 3.5px, #1E1E1C 4px); border-color: #4A4945; }
.swatch-charcoal { background: radial-gradient(circle, #262626 0 3.5px, #1C1C1C 4px); border-color: #474747; }
.swatch-slate { background: radial-gradient(circle, #25282C 0 3.5px, #1C1E21 4px); border-color: #454A50; }
@media (prefers-reduced-motion: reduce) { .appearance.js-tucked .swatches { transition: none; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
/* Lining (full-height) figures everywhere; old-style ones read badly in a back office. */
html { font-variant-numeric: lining-nums; }
body {
  background: var(--wall); color: var(--ink);
  font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--brass-ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
a.link:hover { text-decoration-color: currentColor; }
h1, h2, .serif, .kpi .n, .loc b, .track .tot, .plate h3, .card .ttl { font-variant-numeric: lining-nums; }
h1 { font: 500 40px/1.1 var(--serif); letter-spacing: -.01em; margin: 4px 0 0; }
h2 { font: 500 22px/1.2 var(--serif); margin: 0; }
h3 { font: 600 13px/1.4 var(--sans); margin: 0; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.eyebrow, .label-caps {
  font: 500 10.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }
.small { font-size: 12.5px; }
.mono, .tag { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.serif { font-family: var(--serif); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- App shell: sidebar + page ------------------------------------------------ */

.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); padding: 26px 16px 16px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--wall);
}
/* The Custom Art Concepts logo, set in the site's fonts (templates/core/_app.html, _auth.html): an open frame,
   CUSTOM in Cormorant Garamond, ART CONCEPTS in Inter breaking the frame's bottom edge, the area name under it. */
.mark { --rule: 1.5px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 2px 10px 0; color: var(--ink); }
/* Everything is sized from .logo's font-size (CUSTOM's size): ART CONCEPTS is about half CUSTOM's letter height,
   tracked out to the same width, so the bottom edge keeps only short ends either side, as in the original logo. */
.logo {
  display: flex; flex-direction: column; align-items: stretch; width: 100%; font-size: 31px;
  border: var(--rule) solid currentColor; border-bottom: 0; padding-top: .36em;
}
.logo-top {
  font: 600 1em/1 "Cormorant Garamond", var(--serif); letter-spacing: .2em; text-indent: .2em;
  text-transform: uppercase; text-align: center;
}
.logo-sub {
  display: flex; align-items: center; gap: .3em; margin: .28em calc(-1 * var(--rule)) -.5em;
  font: 400 .4em/1 var(--sans); letter-spacing: .46em; text-transform: uppercase; white-space: nowrap;
}
.logo-sub::before, .logo-sub::after { content: ""; flex: 1; min-width: 6px; height: var(--rule); background: currentColor; }
.logo-sub::after { margin-left: -.46em; } /* the tracking after the last letter */
.logo-area { font: 500 9.5px/1 var(--sans); letter-spacing: .3em; text-indent: .3em; text-transform: uppercase; color: var(--ink-3); }
.side-search { position: relative; }
.side-search input[type=search] {
  width: 100%; padding: 8px 10px 8px 32px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--paper); font: 13px var(--sans); color: var(--ink);
}
.side-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav .grp { padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2);
}
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.on { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav .ct { margin-left: auto; font: 500 11px var(--mono); color: var(--ink-3); }
.nav .ct.hot { color: var(--brass); }
.ico { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.av {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brass-soft); color: var(--brass-ink);
  display: grid; place-items: center; font: 600 11px var(--sans); text-transform: uppercase; flex: none;
}
.me .who { min-width: 0; flex: 1; }
.me .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me form { margin: 0; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.page { padding: 36px 48px 80px; max-width: 1280px; width: 100%; }
.page.narrow-page { max-width: 980px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.head .sub { margin-top: 8px; color: var(--ink-2); max-width: 60ch; }
.crumbs { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }
.crumbs a:hover { color: var(--ink); }
.crumbs .back { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; padding-right: 12px; border-right: 1px solid var(--line-2); color: var(--ink-2); }
.crumbs .back .ico { width: 14px; height: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* --- Buttons --------------------------------------------------------------------- */

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r);
  padding: 9px 14px; font: 500 13px/1.2 var(--sans); border: 1px solid var(--line-2); background: var(--paper);
  color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-fill); }
.btn.primary:hover { background: var(--ink-hover); }
.btn.danger { color: var(--late); }
.btn.danger:hover { border-color: var(--late); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }
.linkish { display: inline-flex; align-items: center; gap: 5px; color: var(--brass-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
.linkish:hover { text-decoration-color: currentColor; }
.linkish .ico { width: 14px; height: 14px; }
button.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brass-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
button.linkish:hover { text-decoration-color: currentColor; }

/* --- Panels, KPI strip ----------------------------------------------------------- */

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.panel + .panel { margin-top: 20px; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.panel-h a { font-size: 12.5px; color: var(--ink-3); }
.panel-h a:hover { color: var(--ink); }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.cols.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); }
.cols > .panel + .panel { margin-top: 0; }  /* side by side: line the tops up */
.cols.side-right { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 20px; }
.kpi { padding: 20px 22px; border-left: 1px solid var(--line); display: block; }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--tint); }
.kpi .n { font: 500 38px/1 var(--serif); display: flex; align-items: baseline; gap: 8px; }
.kpi .n small { font: 500 12px var(--sans); color: var(--ink-3); }
.kpi .n small.warn { color: var(--warn); }
.kpi .n small.late { color: var(--late); }
.kpi .n small.ok { color: var(--ok); }
.kpi .l { margin-top: 8px; color: var(--ink-2); font-size: 13px; }
.kpi .s { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .s::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.kpi .s.warn { color: var(--warn); } .kpi .s.warn::before { background: var(--warn); }
.kpi .s.late { color: var(--late); } .kpi .s.late::before { background: var(--late); }
.kpi .s.ok { color: var(--ok); } .kpi .s.ok::before { background: var(--ok); }

.empty { padding: 28px 8px; text-align: center; color: var(--ink-3); }
.empty .serif { font-size: 22px; color: var(--ink-2); display: block; margin-bottom: 4px; }

/* --- Service dots, pills --------------------------------------------------------- */

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--ink-3); }
.c-framing { --c: var(--c-framing); }
.c-installation { --c: var(--c-installation); }
.c-repair { --c: var(--c-repair); }
.c-crating { --c: var(--c-crating); }
.c-move { --c: var(--c-move); }
.c-delivery { --c: var(--c-delivery); }
.c-other { --c: var(--c-other); }
.dot[class*="c-"] { background: var(--c); }
.svc { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.svc strong { color: var(--ink); font-weight: 500; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.5; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; background: var(--paper); }
.pill.new { border-color: var(--line-brass); background: var(--brass-soft); color: var(--brass-ink); }
.pill.ok { border-color: var(--line-ok); background: var(--ok-soft); color: var(--ok); }
.pill.warn { border-color: var(--line-warn); background: var(--warn-soft); color: var(--warn); }
.pill.hold { border-color: var(--line-hold); background: var(--hold-soft); color: var(--hold); }
.pill.late-soft { border-color: var(--line-late); color: var(--late); }
.pill.late { border-color: var(--line-late); background: var(--late-soft); color: var(--late); }
.pill.off { color: var(--ink-3); border-style: dashed; }

.due { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.due.late { color: var(--late); font-weight: 500; }
.lock { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 11px; letter-spacing: 0; text-transform: none; font-weight: 400; }
.lock svg { width: 11px; height: 11px; }

/* --- Dashboard: pipeline tracks, location bar, agenda ---------------------------- */

.track { display: grid; grid-template-columns: 140px minmax(0, 1fr) 40px; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.track:first-of-type { border-top: 0; padding-top: 0; }
.track .cat { display: flex; align-items: center; gap: 9px; font-weight: 500; }
.stages { display: flex; gap: 3px; }
.stg { flex: 1; min-width: 0; display: block; }
.stg .bar { height: 28px; border-radius: 4px; background: var(--well); display: flex; align-items: center; justify-content: center; font: 500 12px var(--mono); color: var(--ink-3); }
.stg .bar.has { background: var(--c); color: var(--on-fill); }
.stg:hover .bar { outline: 2px solid var(--line-2); outline-offset: 1px; }
.stg .nm { font-size: 10.5px; color: var(--ink-3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .tot { text-align: right; font: 500 20px var(--serif); }

.locbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 4px 0 16px; background: var(--well); }
.loc { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.loc:first-of-type { border-top: 0; }
.loc:hover span:nth-child(2) { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.loc .sw { width: 10px; height: 10px; border-radius: 2px; }
.loc b { font: 500 16px var(--serif); }
.st-with_client { background: var(--st-client); }
.st-in_transit { background: var(--c-installation); }
.st-in_shop { background: var(--ink); }
.st-at_vendor { background: var(--brass); }
.st-installed { background: var(--c-crating); }
.st-delivered { background: var(--st-delivered); }
.st-shipped { background: var(--c-move); }

.day { margin: 16px 0 4px; }
.day:first-child { margin-top: 0; }
.ev { display: grid; grid-template-columns: 58px 3px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.ev .t { font: 500 12px var(--mono); color: var(--ink-2); padding-top: 2px; }
.ev .rule { border-radius: 2px; background: var(--c, var(--ink-3)); }
.ev .w { font-weight: 500; }
.ev .s { color: var(--ink-3); font-size: 12.5px; }
.ev:hover .w { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.feed li:first-child { border-top: 0; }
.feed .when { color: var(--ink-3); font-size: 12px; }

/* --- Tables ---------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font: 500 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 0 12px 10px; white-space: nowrap; }
td { padding: 13px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--tint); }
tr.clickable { cursor: pointer; }
td .sub, .sub { color: var(--ink-3); font-size: 12.5px; }
td.num, th.num { text-align: right; }
.panel.flush { padding: 18px 12px 6px; }

/* --- Filter bar, segmented tabs ------------------------------------------------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input[type=search] { max-width: 340px; }
.filters select { width: auto; min-width: 160px; }
.result-h { padding: 4px 12px 0; margin-bottom: 14px; }
.result-h h2 { font-size: 26px; font-weight: 600; }
.search-jump { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.search-jump a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink); text-decoration: none; background: var(--paper); }
.search-jump a:hover { border-color: var(--brass); }
.search-jump b { font-weight: 600; margin-left: 4px; color: var(--ink-3); }
.seg { display: inline-flex; background: var(--well-2); border-radius: var(--r); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 12px; border-radius: 6px; font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 26, 23, .08); }
.seg .ct { font: 500 11px var(--mono); color: var(--ink-3); }

/* --- In progress board ----------------------------------------------------------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--column); border-radius: var(--r-lg); padding: 12px; min-height: 160px; }
.column-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 10px; }
.column-h .ct { font: 500 11px var(--mono); color: var(--ink-3); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 8px; font-size: 13px; }
.card .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.card .ttl { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.25; }
.card .meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; color: var(--ink-3); font-size: 12px; }
.card form { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.card select { padding: 5px 8px; font-size: 12.5px; }

/* --- Order page: pieces as gallery labels ---------------------------------------- */

.refs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.ref { font: 12px var(--mono); border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 4px 8px; color: var(--ink-2); }
.ref i { font-style: normal; color: var(--ink-3); margin-right: 6px; font-family: var(--sans); }
details.pop { position: relative; display: inline-block; }
details.pop > summary { list-style: none; cursor: pointer; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop .pop-body { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; width: 300px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px; box-shadow: 0 12px 28px -12px rgba(27, 26, 23, .25); }
.ref.add { border-style: dashed; color: var(--ink-3); font-family: var(--sans); cursor: pointer; }
.ref.add:hover { color: var(--ink); border-color: var(--ink-3); }

.piece { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 22px; padding: 22px 0; border-top: 1px solid var(--line); }
.piece:first-of-type { border-top: 0; padding-top: 2px; }
.frame-wrap { width: 96px; height: 120px; display: flex; align-items: flex-start; justify-content: center; }
.frame { width: 100%; max-height: 120px; background: var(--frame-bg); border: 6px solid var(--mat); box-shadow: 0 0 0 1px var(--line-2), 0 8px 18px -10px rgba(40, 30, 10, .35); display: grid; place-items: center; color: var(--ink-3); font-size: 10px; text-align: center; }
.frame-wrap.has-photo { height: auto; }
.frame-wrap.has-photo .gallery { margin: 0; }
.frame-wrap.has-photo img { width: auto; height: auto; max-width: 96px; max-height: 120px; object-fit: contain; border: 4px solid var(--mat); border-radius: 2px; box-shadow: 0 0 0 1px var(--line-2), 0 8px 18px -10px rgba(40, 30, 10, .35); }
.plate .tag { color: var(--ink-3); }
.plate h3 { font: italic 500 23px/1.2 var(--serif); margin: 4px 0 0; }
.plate .by { color: var(--ink-2); margin: 2px 0 12px; }
.specs { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 14px; }
.specs > div { min-width: 0; }
.specs b { display: block; font: 500 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.note { font-size: 13px; color: var(--ink-2); background: var(--tint); border-left: 2px solid var(--line-2); padding: 6px 10px; margin: 0 0 12px; white-space: pre-line; }

.jobs { display: flex; flex-direction: column; gap: 8px; }
.job { border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.job > .job-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; }
.job > details > summary { list-style: none; cursor: pointer; }
.job > details > summary::-webkit-details-marker { display: none; }
.job > details[open] > summary .job-row { border-bottom: 1px solid var(--line); }
.job .job-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; }
.job .now { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.job .chev { color: var(--ink-3); transition: transform .15s; }
.job details[open] .chev { transform: rotate(180deg); }
.job-body { padding: 12px 14px 14px; display: grid; gap: 12px; font-size: 13px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; }
.kv b { display: block; font: 500 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.kv div { white-space: pre-line; }
.steps { display: flex; gap: 4px; align-items: center; }
.steps i { height: 4px; flex: 1; border-radius: 2px; background: var(--steps); }
.steps i.d { background: var(--ink); }
.steps.hold i.d { background: var(--hold); }
.steps.cancelled i { background: repeating-linear-gradient(45deg, var(--steps) 0 4px, var(--wall) 4px 8px); }
.route { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.route .arrow { flex: 1; border-top: 1px dashed var(--line-2); min-width: 20px; }
.staff-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; padding-top: 12px; border-top: 1px dashed var(--line); }

dl.facts { margin: 0; }
dl.facts dt { margin-top: 16px; }
dl.facts dt:first-child { margin-top: 0; }
dl.facts dd { margin: 4px 0 0; white-space: pre-line; }
dl.facts dd .pop, dl.facts dd .resched { white-space: normal; }
dl.facts dd .pop { display: block; margin-top: 6px; }

.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 0 0 14px 20px; position: relative; font-size: 13px; }
.hist li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink-3); }
.hist li::after { content: ""; position: absolute; left: 6.5px; top: 16px; bottom: 0; width: 1px; background: var(--line-2); }
.hist li:last-child::after { display: none; }
.hist .when { color: var(--ink-3); font-size: 11.5px; }

/* --- Forms ----------------------------------------------------------------------- */

label, .flabel { display: block; font: 500 12.5px var(--sans); color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=datetime-local], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r); font: 14px var(--sans);
  background: var(--paper); color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 64px; resize: vertical; line-height: 1.45; }
/* Dropdowns draw their own chevron so it can sit with room around it (the browser's arrow hugs the edge). */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B665C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 14px;
}
.card select:not([multiple]) { padding-right: 32px; background-position: right 11px center; background-size: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
input[readonly] { background: var(--tint); color: var(--ink-2); }
::placeholder { color: var(--placeholder); }
.field { margin-bottom: 14px; min-width: 0; }
.field.req > label::after { content: " *"; color: var(--brass); }
.help, .helptext { color: var(--ink-3); font-size: 12px; margin-top: 4px; display: block; }
.errorlist { list-style: none; color: var(--late); margin: 6px 0 0; padding: 0; font-size: 12.5px; }
.errorlist.nonfield, .form-errors { background: var(--late-soft); border: 1px solid var(--line-late); border-radius: var(--r); padding: 10px 14px; margin-bottom: 18px; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--line-error); }
.grid { display: grid; gap: 0 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-size { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 96px; }
.g-place { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.form-section { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin-bottom: 20px; }
.form-section > .eyebrow { margin-bottom: 16px; display: block; }
.form-section > h2 { margin-bottom: 18px; }

.piece-form { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 22px 8px; margin-bottom: 16px; background: var(--paper); }
.piece-form-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.piece-form-h h2 { font-size: 24px; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.toggle { position: relative; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.toggle span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2);
  border-radius: 999px; font-size: 13px; color: var(--ink-2); background: var(--paper); transition: all .12s; user-select: none;
}
.toggle span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); opacity: .45; }
.toggle:hover span { border-color: var(--ink-3); color: var(--ink); }
.toggle input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--paper)); color: var(--ink); }
.toggle input:checked + span::before { opacity: 1; }
.toggle input:focus-visible + span { box-shadow: 0 0 0 3px var(--brass-soft); }

.svc-panel { border-left: 2px solid var(--c); background: var(--tint); border-radius: 0; padding: 16px 18px 4px; margin: 12px 0 14px; }
.svc-panel[hidden] { display: none; }
.svc-panel-h { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 12px; }
.svc-panel .sub-h { font: 500 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 8px; }
.from-box { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r); padding: 9px 11px; color: var(--ink-2); white-space: pre-line; min-height: 40px; }

.due-toggle { margin: -4px 0 14px; font-size: 13px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
details.optional > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: baseline; }
details.optional > summary::-webkit-details-marker { display: none; }
details.optional[open] > summary { margin-bottom: 18px; }
details.optional .chev { transition: transform .15s; color: var(--ink-3); }
details.optional[open] .chev { transform: rotate(180deg); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }

/* --- Messages -------------------------------------------------------------------- */

.messages { list-style: none; padding: 0; margin: 0 0 22px; }
.messages li { padding: 11px 14px; border-radius: var(--r); margin-bottom: 8px; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--ink-3); }
.messages li.success { border-left-color: var(--ok); }
.messages li.error { border-left-color: var(--late); }
.messages li.warning { border-left-color: var(--warn); }

/* --- Sign-in pages ----------------------------------------------------------------- */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .mark { width: 270px; margin: 0 auto 30px; padding: 0; gap: 16px; }
.auth-card .logo { font-size: 42px; }
.auth-card .logo-area { font-size: 11px; }
.auth-card .panel { padding: 30px; }
.auth-card h1 { font-size: 30px; margin-bottom: 6px; }
.auth-card .btn { width: 100%; margin-top: 6px; padding: 11px; }
.auth-card form p { margin-bottom: 14px; }
.auth-card ol { padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { width: 180px; height: 180px; background: #fff; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--ink-3); }

/* --- Status colours: yellow under way, green done, red overdue, grey cancelled, blue on hold --- */

.state { display: inline-flex; align-items: center; gap: 6px; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.state.warn { color: var(--warn); } .state.warn::before { background: var(--warn-mark); }
.state.ok { color: var(--ok); } .state.ok::before { background: var(--ok); }
.state.late { color: var(--late); font-weight: 500; } .state.late::before { background: var(--late); }
.state.off { color: var(--ink-3); text-decoration: line-through; } .state.off::before { background: var(--ink-3); }
.state.hold { color: var(--hold); font-weight: 500; } .state.hold::before { background: var(--hold); }
.card.warn { box-shadow: inset 3px 0 0 var(--warn-mark); }
.card.ok { box-shadow: inset 3px 0 0 var(--ok); }
.card.late { box-shadow: inset 3px 0 0 var(--late); }
.card.hold { box-shadow: inset 3px 0 0 var(--hold); }
.card.off { opacity: .6; }
.btn.hold { color: var(--hold); border-color: var(--line-hold); background: var(--hold-soft); }
tr.row-late td:first-child { box-shadow: inset 3px 0 0 var(--late); }

/* --- Photos --- */

.g-sku { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 96px; }
.photo-drop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--paper); cursor: pointer; color: var(--ink-2); font: 400 13px var(--sans); margin: 0; }
.photo-drop:hover { border-color: var(--ink-3); color: var(--ink); }
.photo-drop:focus-within { box-shadow: 0 0 0 3px var(--brass-soft); border-color: var(--brass); }
.photo-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.photo-drop-msg { display: inline-flex; align-items: center; gap: 8px; }
.photo-drop-msg .ico { width: 18px; height: 18px; color: var(--brass); }
.photo-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.gallery { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.gallery figure { position: relative; margin: 0; }
.gallery img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--tint); }
.gallery a:hover img { border-color: var(--ink-3); }
.gallery .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(27, 26, 23, .65); color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; opacity: 0; }
.gallery figure:hover .x, .gallery .x:focus-visible { opacity: 1; }
.add-photos { margin: -4px 0 12px; font-size: 13px; }

/* --- Due dates: reschedule and client notices --- */

.head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.head-actions p { margin: 0; max-width: 46ch; text-align: right; }
.resched { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line-2); white-space: normal; }
.resched.fresh { border-left-color: var(--late); }
.notice { background: var(--paper); border: 1px solid var(--line-late); border-left: 3px solid var(--late); border-radius: var(--r); padding: 12px 16px 6px; margin-bottom: 18px; }
.notice .eyebrow { color: var(--late); margin-bottom: 4px; }
.notice-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink); }
.notice-row:first-of-type { border-top: 0; }
.notice-row:hover { color: var(--brass-ink); }

/* --- Schedule calendar --- */

.seg .ico { width: 14px; height: 14px; }
.cal-legend { display: flex; gap: 18px; margin: -12px 0 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal-wd { background: var(--tint); padding: 8px 10px; font: 500 10.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.cal-day { background: var(--paper); min-height: 112px; padding: 6px 6px 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: var(--tint); }
.cal-day.out .cal-n { color: var(--line-2); }
.cal-n { font: 500 12px var(--mono); color: var(--ink-2); padding: 2px 4px 4px; }
.cal-day.today .cal-n { color: var(--on-fill); background: var(--ink); border-radius: 999px; align-self: flex-start; padding: 2px 7px; }
.cal-ev, .cal-due { display: block; font-size: 11.5px; line-height: 1.35; padding: 3px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.cal-ev { background: color-mix(in srgb, var(--c) 10%, var(--paper)); box-shadow: inset 2px 0 0 var(--c); }
.cal-ev:hover, .cal-due:hover { filter: brightness(.96); }
.cal-ev .t { font: 500 10.5px var(--mono); color: var(--ink-2); }
.cal-ev.ok { opacity: .55; }
.cal-ev.hold { box-shadow: inset 2px 0 0 var(--hold); }
.cal-due { background: var(--tint); border: 1px dashed var(--line-2); color: var(--ink-2); }
.cal-due[class*="c-"] { border-color: color-mix(in srgb, var(--c) 55%, var(--paper)); background: color-mix(in srgb, var(--c) 5%, var(--paper)); }
.cal-due.late { border-color: var(--line-late); background: var(--late-soft); }
.cal-due .dot { width: 6px; height: 6px; margin: 0 5px 1px 0; vertical-align: middle; }
.cal-who { font-weight: 500; color: var(--ink); }
.cal-due.late .cal-who { color: inherit; }
.cal-legend { flex-wrap: wrap; row-gap: 6px; }
.cal-legend-sep { padding-left: 18px; border-left: 1px solid var(--line); }
.cal-key-booked, .cal-key-due { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.cal-key-booked { background: color-mix(in srgb, var(--ink-3) 12%, var(--paper)); border-left: 2px solid var(--ink-3); border-radius: 2px; }
.cal-key-due { border: 1px dashed var(--line-2); background: var(--tint); }
.cal-due.late { border-color: var(--line-late); color: var(--late); background: var(--late-soft); }
.due-mark { font: 600 9.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; margin-right: 5px; color: inherit; opacity: .8; }

/* --- Responsive -------------------------------------------------------------------- */

/* Pieces in lists: thumbnail + name. Orders a piece is linked to, as chips. */
.piece-cell { display: flex; align-items: center; gap: 12px; color: inherit; min-width: 0; cursor: pointer; }
.piece-cell > span { display: flex; flex-direction: column; min-width: 0; }
.pname { font-style: italic; font-size: 16.5px; line-height: 1.25; color: var(--ink); }
/* Client names: upright and a little heavier than piece titles (italic is for artworks). */
.pname.cname { font-style: normal; font-weight: 600; font-size: 17px; letter-spacing: .005em; }
.pthumb { width: 44px; height: 44px; flex: none; border-radius: 4px; object-fit: cover; border: 1px solid var(--line); background: var(--tint); }
.pthumb.none { display: grid; place-items: center; color: var(--line-2); }
.pthumb.none .ico { width: 22px; height: 22px; }
.ochips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.ochip { display: inline-block; font: 11.5px/1.6 var(--mono); padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
/* Back can name its page ("Back to J-1008", a piece's title): keep it to one line. */
.back { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
a.ochip { transition: border-color .12s, background-color .12s, color .12s; }
a.ochip:hover { border-color: var(--ink-2); background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(27,26,23,.12); }
a.ochip.cac:hover { border-color: var(--brass); background: var(--paper); color: var(--brass-ink); }
.ochip.cac { border-color: var(--line-brass); background: var(--brass-soft); color: var(--brass-ink); }
.plink { color: inherit; }
.plink:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
table.pick td.ck, table.pick th.ck { width: 36px; padding-right: 0; }
table.pick input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ink); }
.piece-title { font-style: italic; }
.gallery.hero { display: block; margin-bottom: 10px; }
.gallery.hero figure { display: inline-block; max-width: 100%; }
.gallery.hero img { width: auto; height: auto; max-width: 100%; max-height: 520px; object-fit: contain; border-radius: 4px; }
.piece-photos { margin-bottom: 8px; }
.svc-line { gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.svc-line:first-of-type { border-top: 0; padding-top: 0; }
.order-link { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
aside.sticky { position: sticky; top: 20px; }

@media (max-width: 1150px) {
  .cols, .cols.flip, .cols.side-right { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-search, .nav .grp { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .nav a { padding: 6px 9px; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; }
  .me .who { display: none; }
  .page { padding: 24px 16px 60px; }
  h1 { font-size: 32px; }
  .track { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .track .tot { display: none; }
  .g2, .g3, .g-place { grid-template-columns: minmax(0, 1fr); }
  .g-sku { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 80px; }
  .g-sku > .field:first-child { grid-column: 1 / -1; }
  .head-actions { align-items: stretch; } .head-actions p { text-align: left; }
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-wd, .cal-day.out { display: none; }
  .cal-day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .cal-day:not(:has(a)) { display: none; }
  .piece { grid-template-columns: minmax(0, 1fr); }
  .frame-wrap { display: none; }
  .frame-wrap.has-photo { display: block; width: auto; }
  .job .job-row, .job > .job-row { grid-template-columns: minmax(0, 1fr) auto; }
  .job .job-row .steps { grid-column: 1 / -1; order: 3; }
  .feed li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .piece-form, .form-section { padding: 18px 16px 6px; }
}

/* Live updates: notices slide in at the top right, like a new mail on a Mac (templates/core/_live.html). */
.live-stack { position: fixed; top: 18px; right: 18px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: 340px; max-width: calc(100vw - 32px); pointer-events: none; }
.live-card { pointer-events: auto; display: block; color: var(--ink); text-decoration: none; background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px 13px; box-shadow: 0 12px 32px rgba(27,26,23,.14), 0 2px 6px rgba(27,26,23,.06); transform: translateX(calc(100% + 30px)); opacity: 0; transition: transform .42s cubic-bezier(.2,.9,.25,1.05), opacity .3s ease; }
.live-card.in { transform: none; opacity: 1; }
.live-card.out { transform: translateX(calc(100% + 30px)); opacity: 0; transition-duration: .26s; transition-timing-function: ease-in; }
.live-card:hover { border-color: var(--line-2); }
.live-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-3); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); flex: none; }
.live-title { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 10.5px; color: var(--brass-ink); }
.live-when { margin-left: auto; }
.live-x { border: 0; background: none; color: var(--ink-3); font-size: 17px; line-height: 1; padding: 0 2px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.live-card:hover .live-x, .live-x:focus-visible { opacity: 1; }
.live-name { font: 600 19px/1.2 var(--serif); margin-top: 6px; }
.live-body { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 640px) { .live-stack { top: 10px; right: 16px; left: 16px; width: auto; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .live-card, .live-card.out { transition: opacity .2s; transform: none; } }

/* Order form: copies of a piece, details copied from the piece above, "Use on all pieces". */
.copies-badge { margin-left: 10px; font: 500 13px var(--mono); color: var(--brass-ink); background: var(--brass-soft); border-radius: 999px; padding: 3px 9px; vertical-align: middle; }
.copied-note { margin: -4px 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--brass-soft); color: var(--brass-ink); border: 1px solid var(--line-brass); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.copied-note[hidden] { display: none; }
.copied-note > span:first-child::before { content: "✓  "; font-weight: 700; }
.copied-note .linkish { margin-left: auto; }
/* After "Add a piece with the same services": the copied location and services glow briefly. */
@keyframes copied-glow { from { box-shadow: 0 0 0 3px var(--brass-soft); border-color: var(--brass); } to { box-shadow: 0 0 0 0 transparent; } }
.piece-form.just-copied .js-location select, .piece-form.just-copied .js-location input, .piece-form.just-copied .js-location textarea,
.piece-form.just-copied .svc-panel:not([hidden]) input, .piece-form.just-copied .svc-panel:not([hidden]) select,
.piece-form.just-copied .svc-panel:not([hidden]) textarea, .piece-form.just-copied .toggle input:checked + span { animation: copied-glow 2.4s ease-out; }
/* Where the piece is now */
.loc-where { flex: 1; min-width: 0; }
.loc-where .js-where { max-width: 340px; }
.loc-where select.is-empty { color: var(--ink-3); }
.where-note { margin: -4px 0 14px; padding: 10px 14px; border-radius: 8px; background: var(--brass-soft); color: var(--brass-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.where-note[hidden], .where-who[hidden] { display: none; }
.where-note .btn { background: var(--paper); }
.where-note .small { flex-basis: 100%; }
.where-who { padding: 12px 14px 2px; border-left: 2px solid var(--line-2); margin: -4px 0 14px; }
.copied-note .linkish { font-size: inherit; }
.copies-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 2px 0 16px; }
.copies-row .flabel { margin: 0; }
.copies-row .help { margin: 0; }
.copies-row .errorlist { flex-basis: 100%; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--paper); overflow: hidden; }
.stepper button { border: 0; background: none; width: 34px; font-size: 16px; color: var(--ink-2); cursor: pointer; }
.stepper button:hover { background: var(--hover); color: var(--ink); }
.stepper input[type=number] { width: 52px; text-align: center; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; padding: 7px 4px; -moz-appearance: textfield; font: 500 14px var(--sans); }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.apply-wrap { position: relative; }
.apply-wrap .apply-all { position: absolute; top: -3px; right: 0; }
.apply-all { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-brass); background: var(--brass-soft); color: var(--brass-ink); border-radius: 999px; padding: 4px 11px 4px 9px; font: 500 12px var(--sans); cursor: pointer; white-space: nowrap; }
.apply-all .ico { width: 13px; height: 13px; }
.apply-all:hover { background: var(--brass-hover); border-color: var(--brass); }
.apply-all.done { background: var(--ok-soft); border-color: var(--line-ok); color: var(--ok); cursor: default; }
.svc-panel-h .apply-all { margin-left: auto; }
.add-bar { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 16px 18px; margin: 4px 0 22px; background: var(--tint); }
.add-bar-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.add-bar p { margin: 10px 0 0; }
.btn.copy-btn { background: var(--brass); border-color: var(--brass); color: var(--on-fill); }
.btn.copy-btn:hover { background: var(--brass-ink); border-color: var(--brass-ink); }
.btn.copy-btn .ico { stroke: currentColor; }
@media (max-width: 640px) { .add-bar-btns .btn { flex: 1 1 100%; justify-content: center; } .apply-wrap .apply-all { position: static; margin-bottom: 6px; } }
details.copies { border-bottom: 1px solid var(--line); }
details.copies > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 10px 0 12px 0; }
details.copies > summary::-webkit-details-marker { display: none; }
details.copies > summary .ico { transition: transform .15s; }
details.copies[open] > summary .ico { transform: rotate(180deg); }
details.copies .piece { opacity: .98; }

/* Next numbers: TAG's next order number on the order form, the next C number on a new outgoing order. */
.num-group { display: flex; gap: 8px; align-items: stretch; }
.num-group input { flex: 1 1 auto; min-width: 0; }
.btn.next-btn { flex: none; background: var(--brass); border-color: var(--brass); color: var(--on-fill); white-space: nowrap; }
.btn.next-btn:hover { background: var(--brass-ink); border-color: var(--brass-ink); }
.btn.next-btn b { font: 600 14px var(--mono); letter-spacing: .02em; margin-left: 2px; }
.num-card { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 12px 16px; border: 1px solid var(--line-brass); background: var(--brass-soft); border-radius: var(--r-lg); }
.num-card .eyebrow { color: var(--brass-ink); }
.num-card-n { font: 500 26px/1.1 var(--mono); color: var(--ink); letter-spacing: .02em; }

/* Portal "Your art": a grid of the client's pieces; tick some to start a new order for them. */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.art-card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.art-card:hover { border-color: var(--line-2); }
.art-card.ticked { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass-soft); }
.art-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: var(--tint); border-bottom: 1px solid var(--line); overflow: hidden; }
.art-img img { width: 100%; height: 100%; object-fit: cover; }
.frame-ph { font: 500 12px var(--mono); color: var(--ink-3); border: 6px solid var(--mat-ph); padding: 18px 14px; background: var(--paper); }
.art-tick { position: absolute; top: 10px; left: 10px; z-index: 1; background: var(--glass); border: 1px solid var(--line-2); border-radius: 7px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.art-tick input { margin: 0; width: 16px; height: 16px; accent-color: var(--brass); cursor: pointer; }
.art-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.art-name { font: 600 18px/1.25 var(--serif); color: var(--ink); text-decoration: none; }
.art-name:hover { text-decoration: underline; text-decoration-color: var(--line-2); }
.art-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: 4px; }
.where { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--hover); border-radius: 999px; padding: 2px 9px; }
.where.cac { color: var(--brass-ink); background: var(--brass-soft); }
.art-body .ochips { margin-top: 4px; }
.pick-bar { position: sticky; z-index: 45; bottom: 16px; margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; background: var(--pick-bg); color: #fff; border-radius: var(--r-lg); box-shadow: 0 10px 28px rgba(27,26,23,.2); }
.pick-bar .linkish { color: #E9DFC9; }
.pick-bar .btn { margin-left: 0; }
.pick-bar .pick-note { flex: 1; }  /* pushes the buttons to the right end */
.piece-order { padding: 14px 0; border-top: 1px solid var(--line); }
.piece-order:first-of-type { border-top: 0; }
.svc-lines { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.svc-lines li { display: inline-flex; align-items: center; gap: 7px; }

/* Order form: a piece CAC already has, and the picker for adding them. */
.existing-card { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line-brass); background: var(--brass-soft); border-radius: var(--r); margin-bottom: 16px; }
.existing-thumb { width: 64px; height: 64px; flex: none; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.existing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.existing-card .eyebrow { color: var(--brass-ink); }
.existing-name { font: 600 19px/1.25 var(--serif); }
.picker { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--paper); margin: 0 0 22px; box-shadow: 0 8px 24px rgba(27,26,23,.08); }
.picker-h { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.picker-h h3 { font: 600 22px var(--serif); margin: 2px 0 4px; }
.picker-h p { margin: 0; }
.picker-h .icon-btn { font-size: 22px; line-height: 1; }
.picker-search { display: flex; align-items: center; gap: 8px; margin: 10px 20px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); }
.picker-search input { border: 0; padding: 10px 0; flex: 1; background: none; }
.picker-search input:focus { outline: none; }
.picker-search:focus-within { border-color: var(--brass); }
.picker-list { max-height: 380px; overflow-y: auto; padding: 0 12px 6px; }
.picker-group { padding: 12px 8px 6px; }
.picker-item { display: grid; grid-template-columns: 20px 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: var(--r); cursor: pointer; }
.picker-item:hover { background: var(--tint); }
.picker-item input { accent-color: var(--brass); width: 16px; height: 16px; margin: 0; }
.picker-item input:disabled + .picker-thumb { opacity: .5; }
.picker-thumb { width: 48px; height: 48px; border-radius: 6px; background: var(--tint); border: 1px solid var(--line); overflow: hidden; }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker-txt { display: flex; flex-direction: column; min-width: 0; }
.picker-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-where { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.picker-where.cac { color: var(--brass-ink); }
.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--tint); border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (max-width: 640px) { .picker-item { grid-template-columns: 20px 40px minmax(0, 1fr); } .picker-where { grid-column: 3; } .art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.picker-search input[type="search"] { border: 0; box-shadow: none; background: none; padding: 10px 0; min-height: 0; }
.picker-search input[type="search"]:focus { box-shadow: none; }
.btn.copy-btn:disabled { opacity: .45; cursor: default; }

/* A piece the client says is already at CAC: staff match it to stock */
.stock-match { margin: 12px 0; padding: 12px 14px; border-radius: 8px; background: var(--brass-soft); color: var(--ink); display: grid; gap: 8px; }
.stock-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px; background: var(--paper); border-radius: 6px; }
.stock-thumb { width: 40px; height: 40px; flex: none; border-radius: 4px; background: var(--line); overflow: hidden; }
.stock-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stock-txt { flex: 1; min-width: 0; display: grid; }

/* --- Order form, service first ------------------------------------------------------------------- */
.order-top { padding-bottom: 10px; }
.svc-card.c-none { --c: var(--line-2); }
.svc-card { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r-lg); padding: 20px 24px 18px; margin-bottom: 20px; }
.svc-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.svc-card-h h2 { font-size: 26px; margin: 0; }
.svc-card-h .dot { width: 10px; height: 10px; }
.svc-card-h .js-card-remove { margin-left: auto; }
.svc-card .dot, .svc-tile .dot, .cat-btn .dot, .review-svc .dot { background: var(--c); border-radius: 50%; display: inline-block; width: 9px; height: 9px; flex: none; }
/* Which fields a card shows depends on its service. */
.svc-card [class*="only-"], .svc-card [class*="for-"] { display: none; }
.svc-card[data-category="framing"] .only-dated, .svc-card[data-category="repair"] .only-dated, .svc-card[data-category="crating"] .only-dated,
.svc-card[data-category="installation"] .only-timed, .svc-card[data-category="move"] .only-timed, .svc-card[data-category="delivery"] .only-timed,
.svc-card[data-category="delivery"] .only-delivery,
.svc-card[data-category="crating"] .only-crating, .svc-card[data-category="move"] .only-move,
.svc-card[data-category="framing"] .only-framing, .svc-card[data-category="repair"] .only-repair,
.svc-card[data-category="framing"] .only-perpiece, .svc-card[data-category="repair"] .only-perpiece,
.svc-card:not([data-category=""]) .only-any { display: block; }
.svc-card[data-category="installation"] .for-installation, .svc-card[data-category="move"] .for-move, .svc-card[data-category="delivery"] .for-delivery,
.svc-card[data-category="framing"] .for-framing, .svc-card[data-category="repair"] .for-repair { display: inline; }
.svc-card[data-category=""] .svc-when, .svc-card[data-category=""] .svc-details { display: none; }
.g-when { grid-template-columns: minmax(0, 220px) minmax(0, 160px); }
.cat-choose { padding: 4px 0 14px; }
.cat-choose[hidden] { display: none; }
.cat-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--paper); border-radius: 999px; padding: 7px 14px; font: 500 13px var(--sans); color: var(--ink); cursor: pointer; }
.cat-btn:hover { border-color: var(--c); background: var(--tint); }
.svc-details { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.svc-card .card-add { display: none; }
.svc-card:not([data-category=""]) .card-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.card-add .btn[hidden] { display: none; }
/* A piece in a card */
.line { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.line:first-child { border-top: 0; }
.line-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.line-num { font: 500 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.line-name { font: 500 19px var(--serif); color: var(--ink); }
.line-h .js-line-remove { margin-left: auto; }
.line[data-home="0"] { padding-bottom: 2px; }
.line-svc { margin-top: 4px; }
.line-svc .sub-h { display: flex; align-items: center; gap: 10px; }
.line-svc .apply-all { position: static; margin-left: auto; }
.line.just-copied .js-location select, .line.just-copied .js-location textarea, .line.just-copied .js-location input,
.line.just-copied .line-svc input, .line.just-copied .line-svc select { animation: copied-glow 2.4s ease-out; }
/* Pieces already on this order */
.onorder { border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; margin-top: 12px; background: var(--tint); }
.onorder[hidden] { display: none; }
.onorder-h, .onorder-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.onorder-list { display: grid; gap: 6px; margin: 10px 0; }
.onorder-item { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; cursor: pointer; }
.onorder-foot { justify-content: flex-end; }
/* The service tiles */
.svc-picker { background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 20px; }
.svc-picker h2 { margin: 0 0 4px; }
.svc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.svc-tile { display: grid; gap: 4px; justify-items: start; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--c); background: var(--paper); border-radius: var(--r); padding: 14px 14px 12px; cursor: pointer; font: inherit; color: var(--ink); }
.svc-tile:hover { background: var(--tint); border-color: var(--line-2); border-left-color: var(--c); }
.svc-tile .dot { display: none; }
.svc-tile-name { font: 500 20px var(--serif); }
.svc-picker.compact { padding: 16px 20px; }
.svc-picker.compact .svc-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.svc-picker.compact .svc-tile { padding: 10px 12px; }
.svc-picker.compact .svc-tile-name { font-size: 17px; }
.svc-picker.compact .svc-tile .small { display: none; }
/* Edition numbers */
.edition { border-left: 2px solid var(--brass); padding: 10px 0 6px 14px; margin: -6px 0 16px; }
.edition[hidden] { display: none; }
.edition-row { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 12px; }
.ed-grid { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ed-grid .ed { width: 38px; height: 30px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--paper); font: 500 12px var(--mono); color: var(--ink-2); cursor: pointer; }
.ed-grid .ed:hover { border-color: var(--brass); }
.ed-grid .ed.on { background: var(--brass); border-color: var(--brass); color: var(--on-fill); }
.js-ed-sum { color: var(--brass-ink); }
.js-ed-sum.bad { color: var(--late); }
.stepper button:disabled { opacity: .4; cursor: default; }
/* Review before sending */
.review { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.review[hidden], #entry[hidden] { display: none; }
.review-h h2 { margin: 2px 0 16px; }
.review-order { margin-bottom: 18px; }
.review-number { font: 500 24px var(--serif); }
.review-svc { border-top: 1px solid var(--line); padding: 16px 0 8px; }
.review-svc-h { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.review-when { margin-left: auto; font-weight: 500; color: var(--ink-2); }
.review-detail { color: var(--ink-2); margin: 6px 0 0 19px; white-space: pre-line; }
.review-pieces { list-style: none; padding: 0; margin: 10px 0 0 19px; display: grid; gap: 8px; }
.review-pieces li { display: flex; gap: 10px; }
.review-num { font: 500 12px var(--mono); color: var(--ink-3); min-width: 18px; padding-top: 2px; }
.review-piece { display: grid; gap: 2px; }
.review-piece b { font-weight: 500; }
.review-warn { margin-bottom: 14px; }
.review .form-foot { margin-top: 20px; }
@media (max-width: 640px) {
  .svc-card { padding: 16px 16px 14px; }
  .svc-card-h h2 { font-size: 22px; }
  .card-add .btn { flex: 1 1 100%; justify-content: center; }
  .g-when { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .review-svc-h { flex-wrap: wrap; } .review-when { margin-left: 19px; flex-basis: 100%; }
}

/* A piece's dates, one per service (order pages). */
.svc-dates { display: inline-flex; flex-wrap: wrap; gap: 2px 14px; }
.svc-date { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.svc-date .dot { background: var(--c); }
.svc-date.done { opacity: .55; }
.receive-one { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.same-as { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.same-as .js-same-list { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cat-btn.sm { padding: 4px 11px; font-size: 12.5px; }
.svc-card.just-copied .only-timed input, .svc-card.just-copied .only-timed textarea { animation: copied-glow 2.4s ease-out; }

/* Copies of one piece stacked in a list (Art inventory, Your art). Each copy is still its own piece. */
table.inv tbody.copy-stack .copy-row { display: none; }
table.inv tbody.copy-stack.open .copy-row { display: table-row; }
table.inv tbody.copy-stack.open .stack-head td { border-bottom-color: transparent; }
table.inv .copy-row td:first-child { padding-left: 34px; }
table.inv .copy-row td:first-child { box-shadow: inset 2px 0 0 var(--brass-soft); }
table.inv .copy-name { font: 500 13px var(--mono); color: var(--ink-2); }
table.inv .stack-head .pthumb { box-shadow: 3px -3px 0 -1px var(--paper), 3px -3px 0 0 var(--line-2), 6px -6px 0 -1px var(--paper), 6px -6px 0 0 var(--line); }
table.inv .stack-head .copies-badge { margin-left: 8px; font-size: 12px; padding: 1px 8px; }
.stack-toggle { white-space: nowrap; }
.stack-toggle .ico { transition: transform .15s; vertical-align: middle; }
tbody.copy-stack.open .stack-toggle .ico { transform: rotate(180deg); }
.art-card.art-stack { overflow: visible; margin: 6px 6px 0 0; box-shadow: 3px -3px 0 -1px var(--paper), 3px -3px 0 0 var(--line-2), 6px -6px 0 -1px var(--paper), 6px -6px 0 0 var(--line); }
.art-card.art-stack.ticked { box-shadow: 0 0 0 2px var(--brass-soft), 3px -3px 0 -1px var(--paper), 3px -3px 0 0 var(--brass), 6px -6px 0 -1px var(--paper), 6px -6px 0 0 var(--line-2); }
.art-card.art-stack .art-img { border: 0; border-bottom: 1px solid var(--line); padding: 0; width: 100%; cursor: pointer; position: relative; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; }
.art-card.art-stack .stack-badge { position: absolute; right: 8px; bottom: 8px; margin: 0; }
.art-card.art-stack .art-name { text-align: left; padding: 0; border: 0; background: none; cursor: pointer; }
.art-card.art-stack .stack-more { margin-top: 8px; align-self: flex-start; }
.art-card.art-stack .stack-more .ico { transition: transform .15s; vertical-align: middle; }
.art-card.art-stack.open .stack-more .ico { transform: rotate(180deg); }
.stack-members { grid-column: 1 / -1; border-left: 2px solid var(--brass); padding: 4px 0 6px 14px; }
.stack-members[hidden] { display: none; }
.stack-members-h { margin: 0 0 10px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.stack-members-h .js-stack-close { display: none; }
.pname-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 2px; }
table.inv .stack-head td:nth-child(3) { min-width: 120px; }

/* A service card with no pieces yet: "New piece" or "A piece CAC already has". */
.card-start { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.card-start[hidden], .card-add[hidden], .start-btn[hidden], .count-box[hidden] { display: none; }
/* "No specific pieces" on an install / move card: just how many. */
.count-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.count-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; }
.count-pick p { margin: 0 0 14px; flex: 1 1 260px; }
.card-start > p { margin: 0; }
.start-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 16px; }
.start-btn { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; text-align: left; border: 1px solid var(--line-2); background: var(--paper); border-radius: var(--r-lg); padding: 18px 18px 16px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.start-btn:hover { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); }
.start-btn .ico { grid-row: span 2; width: 22px; height: 22px; color: var(--brass-ink); }
.start-name { font: 600 20px/1.2 var(--serif); }
.svc-picker[hidden] { display: none; }

/* "Is this a piece CAC already has?" on a new piece. */
.dupe { border: 1px solid var(--brass); background: var(--brass-soft); border-radius: var(--r-lg); padding: 12px 14px; margin: 4px 0 14px; }
.dupe[hidden] { display: none; }
.dupe-h { margin-bottom: 8px; }
.dupe-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.dupe-item .picker-thumb { width: 44px; height: 44px; }
.dupe-foot { display: flex; justify-content: flex-end; margin-top: 4px; }


/* --- 2026-11-24: new clients, pickup flags, inventory selection, photo shapes ------------------------- */
.client-pick { margin-bottom: 6px; }
.client-pick > .field { max-width: 460px; }
.new-client { border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: var(--r); padding: 14px 16px; margin: 4px 0 16px; background: var(--tint); }
.new-client-h { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 10px; }
.seg-radio { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--paper); margin-bottom: 12px; }
.seg-opt { display: inline-flex; align-items: stretch; margin: 0; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: flex; align-items: center; padding: 5px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.seg-opt input:checked + span { background: var(--ink); color: var(--paper); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 1px; }
.btn.next-btn.alt { background: var(--paper); color: var(--brass-ink); }
.btn.next-btn.alt:hover { background: var(--brass-soft); color: var(--brass-ink); }
.flag-box { border: 1px solid var(--late); border-left-width: 4px; background: color-mix(in srgb, var(--late) 6%, var(--paper)); border-radius: var(--r); padding: 12px 16px; margin-bottom: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.notice-box { border: 1px solid var(--line-2); border-left: 4px solid var(--brass); background: var(--paper); border-radius: var(--r); padding: 12px 16px; margin-bottom: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.review-note { border: 1px solid var(--warn); border-left-width: 4px; background: color-mix(in srgb, var(--warn) 8%, var(--paper)); border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px; display: grid; gap: 4px; }

/* Art inventory: tick pieces to start an order for them. */
table.inv td.tick, table.inv th.tick { width: 34px; padding-right: 0; }
table.inv td.tick input { width: 16px; height: 16px; accent-color: var(--brass); cursor: pointer; }
table.inv tr.ticked td { background: var(--brass-soft); }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--tint); border: 1px solid var(--line); }
.chip-filter a { color: var(--ink-3); }
.pick-bar .pick-note { font-size: 12px; color: #CFC6B2; }

/* Grid / List switch (Your art). Grid photos are cropped; lists show the whole picture. */
.view-switches { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* Toggles look like the filter tabs (.seg): a soft tray with the chosen side raised in white, so they never
   compete with the black main button beside them. */
.view-switch { display: inline-flex; background: var(--well-2); border-radius: var(--r); padding: 3px; gap: 2px; }
.view-switch button { border: 0; background: none; padding: 5px 10px; border-radius: 6px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"],
html:not(.art-list) .view-switch [data-value="grid"], html.art-list .view-switch [data-value="list"],
html:not(.art-fit) .view-switch [data-value="fill"], html.art-fit .view-switch [data-value="fit"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 26, 23, .1); }
html.art-list .fit-switch { visibility: hidden; }  /* the list always shows whole pictures; keeps its space so Grid / List never moves */
/* Whole picture: each picture fitted inside the same box, white around it, so the grid stays even. */
html.art-fit:not(.art-list) .inv-grid .art-img { background: var(--art-bg); }
html.art-fit:not(.art-list) .inv-grid .art-img img { object-fit: contain; padding: 8px; }
.view-switch .ico { width: 15px; height: 15px; }
/* Staff Art inventory is a list: each photo whole, in its own shape. */
table.inv .pthumb { object-fit: contain; height: auto; max-height: 64px; width: auto; max-width: 64px; min-width: 20px; min-height: 20px; background: none; border: 0; border-radius: 2px; }
table.inv .pthumb.none { width: 44px; height: 44px; }
table.inv .piece-cell { min-height: 44px; }

/* Your art as a list (like Finder's list view). */
.art-list .art-grid { display: block; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); overflow: hidden; }
.art-list .art-grid .art-card { flex-direction: row; align-items: center; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: none; margin: 0; padding: 8px 12px 8px 44px; gap: 14px; }
.art-list .art-grid .art-card:last-child { border-bottom: 0; }
.art-list .art-grid .art-card.ticked { background: var(--brass-soft); box-shadow: none; }
.art-list .art-grid .art-img { width: 56px; height: 56px; min-height: 0; aspect-ratio: auto; flex: none; border: 1px solid var(--line); border-radius: 4px; padding: 0; }
.art-list .art-grid .art-img img { width: auto; height: auto; object-fit: contain; max-height: 54px; max-width: 54px; min-width: 20px; min-height: 20px; box-shadow: none; }
.art-list .art-grid .art-img .frame-ph { font-size: 9px; text-align: center; }
.art-list .art-grid .art-body { padding: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 2px 14px; align-items: center; }
.art-list .art-grid .art-foot { margin: 0; justify-self: end; }
.art-list .art-grid .art-tick { left: 12px; top: 50%; transform: translateY(-50%); }
.art-list .art-grid .art-card.art-stack .stack-badge { right: 2px; bottom: 2px; font-size: 10px; }
.art-list .art-grid .stack-more { grid-column: 1 / -1; }
.art-list .stack-members .art-grid { margin-left: 30px; }
@media (max-width: 640px) { .art-list .art-grid .art-body { grid-template-columns: minmax(0, 1fr); } .art-list .art-grid .art-foot { justify-self: start; } }
.card-pieces { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.card-pieces a { color: var(--ink-2); }
.card-pieces a:hover { color: var(--ink); }

/* Staff Art inventory: grid of cards or the table (list), by the Grid / List switch. */
html:not(.art-list) #inv .inv-list, html.art-list #inv .inv-grid { display: none; }
.inv-grid .art-foot .dots { gap: 3px; }
.inv-grid .art-body .ochips { margin-top: 2px; }

/* Sign-in: passkey button, "or" divider, the list of your passkeys. */
.passkey-btn { width: 100%; justify-content: center; }
.passkey-status:empty { display: none; }
.passkey-status { margin-top: 8px; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.send-code { margin-top: 14px; }
.passkey-list { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); }
.passkey-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; }
.passkey-list li + li { border-top: 1px solid var(--line); }
.passkey-list .ico { width: 15px; height: 15px; vertical-align: -2px; color: var(--brass-ink); }

/* Clients */
table.clients td.num, table.clients th.num { text-align: right; }
table.clients td:first-child { min-width: 13em; }  /* keep a name on one line where it fits */
.js-client-row[hidden], .js-client-none[hidden], .js-business-only[hidden] { display: none; }
ul.places { list-style: none; margin: 0 0 12px; padding: 0; }
ul.places li { padding: 10px 0; border-top: 1px solid var(--line); }
ul.places li:first-child { border-top: 0; padding-top: 0; }

/* Address autofill (Google Maps) and small maps */
.addr-wrap { position: relative; }
.addr-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 8px 24px rgba(27,26,23,.12); }
.addr-list[hidden], .addr-map[hidden] { display: none; }
.addr-list li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.addr-list li span { color: var(--ink-3); margin-left: 6px; font-size: 12.5px; }
.addr-list li:hover, .addr-list li[aria-selected="true"] { background: var(--hover); }
.addr-map { height: 170px; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--tint); }

/* Client changes: the portal's "Change this order" box, and staff notices */
.change-list { list-style: none; margin: 0 0 12px; padding: 0; }
.change-list li { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.change-list li:first-child { border-top: 0; }
.change-order .pop { margin-top: 10px; }
.client-changes { list-style: none; margin: 0; padding: 0; }
.client-changes li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.client-changes li:first-child { border-top: 0; padding-top: 0; }
.client-changes .why { white-space: pre-line; }
.cancel-ask { border: 1px solid var(--line-late); background: var(--late-soft); border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 18px; }
.cancel-ask .row { margin-top: 10px; }


/* Services as pills in their own colour ("Framing"), used in every list */
.svc-pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.svc-pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; line-height: 1.5; padding: 0 8px; border-radius: 999px; white-space: nowrap;
  color: var(--c, var(--ink-2)); background: color-mix(in srgb, var(--c, var(--ink-3)) 12%, var(--paper)); border: 1px solid color-mix(in srgb, var(--c, var(--ink-3)) 32%, var(--paper)); }
.art-foot .svc-pills { justify-content: flex-end; }

/* --- Client search on staff forms (core/_client_pick.html): a search box with "New client" always beside it --- */
.cpick-row { display: flex; gap: 8px; align-items: stretch; }
.cpick-box { position: relative; flex: 1; min-width: 0; }
.cpick-box > .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-3); pointer-events: none; }
.field .cpick-box input { width: 100%; padding-left: 34px; }
.cpick-row .btn { white-space: nowrap; }
.cpick-row .btn.is-on { background: var(--brass-soft); border-color: var(--brass); color: var(--brass-ink); }
.cpick-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  max-height: 300px; overflow-y: auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: 0 10px 28px rgba(27, 26, 23, .12);
}
.cpick-list li[role=option] { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.cpick-list li[role=option] b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cpick-list li[role=option] span { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.cpick-list li.is-active { background: var(--hover); }
.cpick-list li.is-chosen b::after { content: " ✓"; color: var(--brass-ink); }
.cpick-none { padding: 8px 10px; font-size: 13px; color: var(--ink-2); }
.cpick-list li.cpick-add { display: block; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 6px 6px; color: var(--brass-ink); font-weight: 500; }
.cpick-head { padding: 6px 10px 4px; font: 500 10.5px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* --- Grid view motion (core/_inventory.html): kept light (opacity and small moves only, no blur) ----------- */
html:not(.art-list) .inv-grid .art-grid > .art-card:not(.art-stack) { transition: border-color .15s, box-shadow .15s, transform .15s; }
html:not(.art-list) .inv-grid .art-grid > .art-card:not(.art-stack):hover { transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgba(27,26,23,.35); }
/* A stack shimmies a little on hover, its pile fanning out a touch. */
html:not(.art-list) .inv-grid .art-card.art-stack { transition: border-color .15s, box-shadow .2s; }
html:not(.art-list) .inv-grid .art-card.art-stack:not(.lifted):hover { animation: stack-shimmy .5s ease-in-out; }
html:not(.art-list) .inv-grid .art-card.art-stack:not(.lifted):not(.ticked):hover {
  box-shadow: 4px -4px 0 -1px var(--paper), 4px -4px 0 0 var(--line-2), 8px -8px 0 -1px var(--paper), 8px -8px 0 0 var(--line);
}
@keyframes stack-shimmy { 20% { transform: rotate(-1.2deg); } 45% { transform: rotate(1deg); } 70% { transform: rotate(-.5deg); } 100% { transform: none; } }
.inv-dim { position: fixed; inset: 0; z-index: 40; background: rgba(27, 26, 23, .38); opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.inv-dim.on { opacity: 1; pointer-events: auto; }
.art-card.art-stack.lifted { z-index: 41; }
.stack-members.spread {
  position: relative; z-index: 41; border-left: 0; padding: 14px 16px 16px; margin: -4px 0 6px;
  background: var(--wall); border-radius: var(--r-lg); box-shadow: 0 20px 44px -24px rgba(0, 0, 0, .5);
  animation: stack-in .16s ease-out;
}
@keyframes stack-in { from { opacity: 0; transform: translateY(-6px); } }
.stack-members.spread .js-stack-close { display: inline; }
/* Pictures fade in as they load (set by the inventory script, so without it they just show). */
html.img-fade .inv-grid .art-img img { opacity: 0; transition: opacity .2s ease; }
html.img-fade .inv-grid .art-img img.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html:not(.art-list) .inv-grid .art-card:hover { transform: none; }
  .stack-members.spread, html:not(.art-list) .inv-grid .art-card.art-stack:hover { animation: none; }
  html.img-fade .inv-grid .art-img img { transition: none; }
}

/* Measured size (piece page, framing order form) */
.measure-row { display: flex; align-items: center; gap: 5px; }
.measure-row input { width: 70px; padding: 5px 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.measure-row select { width: auto; padding: 5px 22px 5px 7px; font-size: 13px; }
.measure-row span { color: var(--ink-3); font-size: 13px; }
input.measure-note { margin-top: 5px; padding: 5px 7px; font-size: 12.5px; width: 100%; max-width: 230px; }
td.measure-cell { min-width: 220px; }
td.measure-cell .small.muted { margin-top: 3px; }
.kind-other .js-measured { display: none; }
b.measured { font-weight: 600; color: var(--ink); }
details.measure-pop { margin-top: 4px; }
details.measure-pop .pop-body { left: auto; right: 0; width: 280px; }
details.measure-pop input.measure-note { max-width: none; }
.not-here { color: var(--warn); font-weight: 500; }
table.pick tr.pick-sep td { background: var(--tint); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 8px; padding-bottom: 8px; }

/* A service's date on the staff order page: shown plainly, changed only with Reschedule */
.when-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; margin-bottom: 12px; background: var(--tint); border: 1px solid var(--line); border-radius: var(--r); }
.when-line > b { font-weight: 600; }
.when-line details.resched-pop { margin-left: auto; position: relative; }
details.resched-pop > summary { list-style: none; }
details.resched-pop > summary::-webkit-details-marker { display: none; }
details.resched-pop .pop-body { left: auto; right: 0; width: 340px; }
dd details.pop > summary.btn { list-style: none; margin-top: 6px; }
dd details.pop > summary.btn::-webkit-details-marker { display: none; }

/* Framing sheet (the framer's order form, hub/cac_order_sheet.html) */
.sheet-form .panel + .panel, .sheet-form .panel { margin-bottom: 18px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 18px; align-items: start; }
.sheet-grid .wide { grid-column: span 2; }
.sheet-grid .static { padding: 9px 0; }
.sheet-checks { align-self: end; }
.sh-opts { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.sh-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; cursor: pointer; margin: 0; }
.sh-opt input { width: auto; margin: 0; }
.sh-opt.none { color: var(--ink-3); }
.sheet-spec { padding: 6px 24px; }
.sh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.sh-row:first-child { border-top: 0; }
.sh-row > b { font: 600 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; min-width: 84px; color: var(--ink-2); }
.sh-row input[type=text] { width: 180px; padding: 6px 9px; }
.sh-trbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.sh-trbl input[type=text] { width: 64px; }
.sh-note { font-size: 11.5px; color: var(--late); letter-spacing: .03em; }
table.sheet-lines td { vertical-align: top; }
table.sheet-lines input.qty { width: 54px; }
table.sheet-lines input.price { width: 100px; }
table.sheet-lines td.sz { min-width: 230px; }
table.sheet-lines .measure-row input { width: 74px; }
.size-chips { margin-top: 6px; font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.size-chips .chip { font-size: 12px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); cursor: pointer; color: var(--ink); }
.size-chips .chip:hover { border-color: var(--brass); }
.sheet-actions { display: flex; gap: 10px; margin: 6px 0 30px; }
@media (max-width: 900px) { .sheet-grid { grid-template-columns: 1fr; } .sheet-grid .wide { grid-column: auto; } }
table.sheet-lines td.desc { min-width: 220px; width: 32%; }
table.sheet-lines td.what { min-width: 140px; }
table.sheet-lines td.what input { width: 100%; }
table.sheet-lines td.desc input { width: 100%; }

/* Sortable column headings (hub.sorting, {% sort_th %}) */
th.sortable a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--ink); }
th.sortable.on a { color: var(--ink); }
th.sortable .arrow { font-size: 8px; color: var(--brass); }

/* Photos on the order review (order-form.js reviewThumbs) */
.review-thumbs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.review-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--tint); }
.review-thumbs .more { font-size: 12px; color: var(--ink-3); }

/* Orders not sent yet (owner 2026-11-29): a dashed "Not sent" tag on the list and the form, never a status colour. */
.draft-tag { display: inline-block; padding: 2px 8px; margin-right: 8px; border: 1px dashed var(--ink-3);
  border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-2); background: transparent; vertical-align: 1px; white-space: nowrap; }
.drafts { border-style: dashed; margin-bottom: 22px; }
.drafts .panel-h { gap: 14px; flex-wrap: wrap; }
.draft-actions { white-space: nowrap; text-align: right; }
.draft-actions form { display: inline; margin-left: 6px; }
.draft-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 16px; padding: 10px 14px;
  border: 1px dashed var(--line-2); border-radius: 10px; font-size: 14px; }
.draft-name { white-space: nowrap; }
.js-cac-form:not(.kind-other) .only-kind-other, .kind-other .only-kind-framing { display: none; }
/* Needed by on a new outgoing order: words or a date, with a calendar to pick one. */
.needed-by { position: relative; display: flex; align-items: center; }
.needed-by input[type="text"] { padding-right: 44px; }
.needed-pick { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: var(--ink-2); cursor: pointer; }
.needed-pick:hover { background: var(--brass-soft); color: var(--brass-ink); }
.needed-pick .js-needed-pick { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }

/* Framing Order Form: which size a line's numbers are (Image / Opening, Finished / Outside), a small two-way switch. */
.sz-kind { display: inline-flex; background: var(--well-2); border-radius: 6px; padding: 2px; gap: 2px; margin-bottom: 5px; }
.sz-kind label { cursor: pointer; }
.sz-kind input { position: absolute; opacity: 0; pointer-events: none; }
.sz-kind span { display: block; font: 500 11px var(--sans); padding: 2px 8px; border-radius: 4px; color: var(--ink-3); }
.sz-kind input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.sz-kind input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 1px; }
.sh-row #id_mat_description { flex: 1; min-width: 220px; max-width: 380px; }
.sheet-add { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sheet-del { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; cursor: pointer; white-space: nowrap; }
.sheet-lines .sheet-del input { width: auto; margin: 0; flex: none; }
.sheet-desc { padding: 12px 16px 4px; border-bottom: 1px solid var(--line); max-width: 640px; }
.sheet-desc .field { margin-bottom: 4px; }
.form-records { list-style: none; margin: 0; padding: 0; }
.form-records li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.form-records li:first-child { border-top: 0; padding-top: 0; }

/* Charges on a job (hub/_charges.html) and the Framing Order Form's sub-total */
table.charges td.num, table.charges th.num { text-align: right; white-space: nowrap; }
table.charges td.nowrap { white-space: nowrap; }
table.charges tfoot td, table.sheet-lines tfoot td { border-top: 1px solid var(--line-2); font-weight: 600; padding-top: 10px; padding-bottom: 10px; }
table.charges .svc { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
table.sheet-lines tr.sheet-total td:first-child { text-align: right; font-weight: 500; }
table.sheet-lines .js-subtotal { white-space: nowrap; }
.charge-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(52px, .4fr) minmax(84px, .7fr) minmax(140px, 1fr); gap: 0 12px; align-items: end; }
.charge-fields .field > * { min-width: 0; max-width: 100%; }
table.charges tr.charge-edit td { background: var(--brass-soft); padding: 12px 16px 14px; }
.charge-add { padding: 14px 24px 18px; border-top: 1px dashed var(--line); }
.charge-costs { padding: 12px 24px 18px; border-top: 1px solid var(--line); }
.charge-costs ul { list-style: none; margin: 6px 0 0; padding: 0; }
.charge-costs li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.charge-costs li.charge-margin { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-weight: 600; }
@media (max-width: 900px) { .charge-fields { grid-template-columns: 1fr 1fr; } .charge-fields .wide { grid-column: 1 / -1; } }

/* "Beta" next to every billing part (hub/_beta.html), staff only */
.beta { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line-brass); background: var(--brass-soft); color: var(--brass-ink); font: 600 10px/1.6 var(--sans); letter-spacing: .06em; text-transform: uppercase; cursor: help; }

/* Art inventory: "Waiting to be checked" (pieces a client said are at CAC; owner 2026-12-03) */
.waiting-btn .ct { font: 500 11px var(--mono); background: var(--brass-soft); color: var(--brass-ink); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.waiting-btn.on { border-color: var(--brass); background: var(--brass-soft); color: var(--brass-ink); }
.waiting-btn.on .ct { background: var(--paper); }
.pick-bar .btn.confirm-btn { background: var(--brass-soft); border-color: var(--brass); color: var(--brass-ink); font-weight: 600; }

/* Staff note on one piece (piece page; owner 2026-12-03): staff only, never shown to the client */
.staff-note { background: var(--brass-soft); border-left: 3px solid var(--brass); border-radius: 4px; padding: 6px 10px; margin-bottom: 4px; font-size: 13.5px; }
details.measure-pop textarea { width: 100%; }
.note-mark { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--brass-ink); background: var(--brass-soft); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.note-row { display: flex; align-items: baseline; gap: 6px; }
.note-row details.measure-pop { margin-top: 0; }
