/*
 * M&M Shop, the staff portal.
 *
 * A work tool first: a light, quiet workspace where names, numbers and what needs
 * doing are easy to read all day, with M&M's ink and brass carried by the sidebar,
 * the buttons and anything that wants attention. Dark follows the device, or the
 * person's own choice. Geist for reading, Geist Mono for record numbers, Big Shoulders
 * only for the M&M mark itself.
 */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/geist-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Big Shoulders Display'; font-weight: 800; font-display: swap; src: url('/fonts/big-shoulders-display-latin-800-normal.woff2') format('woff2'); }

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light;
  /* The wordmark is one shape in two weights; the theme picks which file is fetched. */
  --logo: url('/img/logo-ink.webp');
  --ink: #0b1920;
  --brass: #b68012;
  --brass-hi: #d4a03a;
  --brass-press: #a3730f;

  --bg: #f2f4f5;
  --surface: #ffffff;
  --surface-2: #f7f9f9;
  --surface-3: #eceff1;
  --line: rgba(11, 25, 32, 0.1);
  --line-2: rgba(11, 25, 32, 0.06);
  --line-strong: rgba(11, 25, 32, 0.17);
  --text: #0f1d26;
  --text-2: #4a5a66;
  --text-3: #66767f;
  --field: #ffffff;
  --field-line: rgba(11, 25, 32, 0.16);
  --link: #8a5e0b;
  --on-brass: #0b1920;
  --accent-soft: rgba(182, 128, 18, 0.12);

  --good: #1f7a4c;
  --good-soft: rgba(31, 122, 76, 0.1);
  --bad: #b3423a;
  --bad-soft: rgba(179, 66, 58, 0.09);
  --warn: #8a5e0b;
  --warn-soft: rgba(182, 128, 18, 0.13);
  --info: #2f5f96;
  --info-soft: rgba(47, 95, 150, 0.1);
  --quiet: #55656f;
  --quiet-soft: rgba(11, 25, 32, 0.06);

  --side-bg: #0b1920;
  --side-line: rgba(238, 241, 244, 0.08);
  --side-text: rgba(238, 241, 244, 0.72);
  --side-dim: rgba(238, 241, 244, 0.42);
  --side-hover: rgba(238, 241, 244, 0.06);
  --side-active: rgba(212, 160, 58, 0.15);

  --shadow-sm: 0 1px 2px rgba(11, 25, 32, 0.05);
  --shadow: 0 1px 2px rgba(11, 25, 32, 0.04), 0 10px 28px -14px rgba(11, 25, 32, 0.14);
  --shadow-lg: 0 2px 6px rgba(11, 25, 32, 0.06), 0 28px 64px -24px rgba(11, 25, 32, 0.38);
  --ring: 0 0 0 3px rgba(212, 160, 58, 0.35);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --side-w: 248px;
  --bar-h: 60px;
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --logo: url('/img/logo-white.webp');
    --bg: #0a171e;
    --surface: #11212c;
    --surface-2: #0e1c26;
    --surface-3: #182b38;
    --line: rgba(238, 241, 244, 0.1);
    --line-2: rgba(238, 241, 244, 0.06);
    --line-strong: rgba(238, 241, 244, 0.18);
    --text: #eef1f4;
    --text-2: #a9b8c6;
    --text-3: #8699ab;
    --field: #0d1b25;
    --field-line: rgba(238, 241, 244, 0.15);
    --link: #d9ab4e;
    --accent-soft: rgba(212, 160, 58, 0.14);
    --good: #5bbb8a;
    --good-soft: rgba(91, 187, 138, 0.13);
    --bad: #ef8178;
    --bad-soft: rgba(239, 129, 120, 0.13);
    --warn: #dcae52;
    --warn-soft: rgba(212, 160, 58, 0.15);
    --info: #92b7ea;
    --info-soft: rgba(146, 183, 234, 0.12);
    --quiet: #a3b3c2;
    --quiet-soft: rgba(238, 241, 244, 0.07);
    --side-bg: #07121a;
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 14px 34px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 70px -24px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --logo: url('/img/logo-white.webp');
  --bg: #0a171e;
  --surface: #11212c;
  --surface-2: #0e1c26;
  --surface-3: #182b38;
  --line: rgba(238, 241, 244, 0.1);
  --line-2: rgba(238, 241, 244, 0.06);
  --line-strong: rgba(238, 241, 244, 0.18);
  --text: #eef1f4;
  --text-2: #a9b8c6;
  --text-3: #8699ab;
  --field: #0d1b25;
  --field-line: rgba(238, 241, 244, 0.15);
  --link: #d9ab4e;
  --accent-soft: rgba(212, 160, 58, 0.14);
  --good: #5bbb8a;
  --good-soft: rgba(91, 187, 138, 0.13);
  --bad: #ef8178;
  --bad-soft: rgba(239, 129, 120, 0.13);
  --warn: #dcae52;
  --warn-soft: rgba(212, 160, 58, 0.15);
  --info: #92b7ea;
  --info-soft: rgba(146, 183, 234, 0.12);
  --quiet: #a3b3c2;
  --quiet-soft: rgba(238, 241, 244, 0.07);
  --side-bg: #07121a;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 14px 34px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 30px 70px -24px rgba(0, 0, 0, 0.8);
}

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: 'ss01' on, 'cv11' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
p { margin: 0 0 12px; color: var(--text-2); }
h1, h2, h3 { margin: 0; color: var(--text); font-family: var(--font); letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 26px; line-height: 1.15; font-weight: 620; letter-spacing: -0.022em; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 600; }
b, strong { font-weight: 600; }
small { font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
img { max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: 0.92em; }
.i { flex: none; display: inline-block; vertical-align: -0.2em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-inline: 20px; }
.mono, .eyebrow { font: 600 11.5px/1.2 var(--font); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.num-id { font-family: var(--mono); font-size: 0.93em; letter-spacing: -0.01em; white-space: nowrap; }
.muted { color: var(--text-2); font-size: 14px; }
.meta { font-size: 13px; line-height: 1.45; color: var(--text-3); }
.hint { font-size: 13px; line-height: 1.45; color: var(--text-3); margin: 6px 0 0; }
.empty { color: var(--text-3); font-size: 14px; margin: 2px 0; }
.inline { display: inline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
::selection { background: rgba(212, 160, 58, 0.3); }

/* ------------------------------------------------------------------- shell */

.skip { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--brass); color: var(--on-brass); padding: 10px 14px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top 0.2s var(--ease); }
.skip:focus { top: 12px; }

.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--side-bg);
  color: var(--side-text);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-right: 1px solid var(--side-line);
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 8px 14px; }
.brand { display: inline-flex; align-items: baseline; gap: 7px; text-decoration: none; color: #eef1f4; font: 800 21px/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; }
.brand span { color: var(--brass-hi); }
.side .side-close { display: none; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 2px 0 12px; scrollbar-width: thin; scrollbar-color: rgba(238, 241, 244, 0.14) transparent; }
.side-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--side-text);
  text-decoration: none;
  font: 500 14px/1.2 var(--font);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.side-nav a .i { color: rgba(238, 241, 244, 0.5); transition: color 0.18s var(--ease); }
.side-nav a:hover { background: var(--side-hover); color: #fff; }
.side-nav a:hover .i { color: rgba(238, 241, 244, 0.85); }
.side-nav a[aria-current] { background: var(--side-active); color: #fff; }
.side-nav a[aria-current] .i { color: var(--brass-hi); }
.side-nav a[aria-current]::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass-hi); }
.side-label { margin: 16px 10px 6px; font: 600 11px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--side-dim); }
.count-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: rgba(212, 160, 58, 0.2); color: #f1cf86; font: 600 11.5px/20px var(--font); text-align: center; font-variant-numeric: tabular-nums; }
.count-badge.alert { background: rgba(239, 129, 120, 0.22); color: #ffc3bd; }

.side-foot { border-top: 1px solid var(--side-line); padding-top: 10px; }
.me-menu { position: relative; }
.me-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; color: #eef1f4; transition: background-color 0.18s var(--ease); }
.me-menu > summary::-webkit-details-marker { display: none; }
.me-menu > summary:hover, .me-menu[open] > summary { background: var(--side-hover); }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #d4a03a, #9a6c10); color: #0b1920; font: 700 13px/1 var(--font); letter-spacing: 0.02em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.me-menu .who { min-width: 0; flex: 1; }
.me-menu .who b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-menu .who small { display: block; font-size: 12px; color: var(--side-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-menu > summary .i { color: var(--side-dim); }
.me-menu .pop { bottom: calc(100% + 8px); left: 0; right: 0; top: auto; min-width: 0; }

.frame { margin-left: var(--side-w); min-height: 100dvh; display: flex; flex-direction: column; }
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 32px 0;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line-2);
}
.bar .brand { display: none; font-size: 19px; color: var(--text); }
.bar .brand span { color: var(--brass); }
.bar-spacer { flex: 1; }
.bar .menu-btn, .bar .search-link { display: none; }
.search {
  position: relative;
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
}
.search .i { position: absolute; left: 13px; color: var(--text-3); pointer-events: none; }
.search input[type='search'] {
  height: 40px;
  min-height: 0;
  padding: 0 64px 0 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.search input[type='search']::placeholder { color: var(--text-3); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-3); font: 500 11.5px/1.5 var(--font); pointer-events: none; }
.search input::-webkit-search-cancel-button { display: none; }

.main { flex: 1; padding: 28px 36px 72px; }
.page { width: 100%; max-width: 1280px; margin: 0 auto; }
.page.narrow { max-width: 880px; }

.tabbar { display: none; }
.scrim { display: none; }
#nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

/* -------------------------------------------------------- menus and buttons */

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 45;
  min-width: 240px;
  padding: 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  transform-origin: top right;
  animation: pop-in 0.18s var(--ease);
}
.pop a, .pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: 500 14px/1.2 var(--font);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.pop a .i, .pop button .i { color: var(--text-3); }
.pop a:hover, .pop button:hover { background: var(--surface-3); }
.pop .pop-label { margin: 8px 10px 4px; font: 600 11px/1 var(--font); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.pop hr { margin: 6px 4px; border-top-color: var(--line-2); }
.pop form { margin: 0; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 2px 4px 4px; background: var(--surface-3); border-radius: 10px; }
.theme-pick button { justify-content: center; min-height: 32px; padding: 0 6px; font-size: 12.5px; gap: 6px; color: var(--text-2); }
.theme-pick button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.theme-pick button:hover { background: var(--surface); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--brass);
  color: var(--on-brass);
  font: 600 14px/1.1 var(--font);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(11, 25, 32, 0.12);
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.12s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover { background: var(--brass-hi); }
.btn:active { transform: scale(0.98); background: var(--brass-press); }
.btn .i { margin-left: -3px; }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.btn.ghost:active { background: var(--surface-3); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text-2); box-shadow: none; }
.btn.quiet:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); box-shadow: none; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { min-height: 32px; padding: 0 13px; font-size: 13px; gap: 6px; }
.btn.big { width: 100%; min-height: 56px; font-size: 16px; border-radius: 16px; }
.btn[disabled], .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.go { padding-right: 6px; }
.btn.go .go-i { display: grid; place-items: center; width: 30px; height: 30px; margin-left: 4px; border-radius: 50%; background: rgba(11, 25, 32, 0.12); transition: transform 0.25s var(--ease); }
.btn.go.small .go-i { width: 24px; height: 24px; }
.btn.go:hover .go-i { transform: translateX(2px); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none; transition: background-color 0.18s var(--ease), color 0.18s var(--ease); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.side .icon-btn { color: var(--side-text); }
.side .icon-btn:hover { background: var(--side-hover); color: #fff; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* -------------------------------------------------------------- page head */

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin: 0 0 24px; }
.head > div:first-child { min-width: 0; flex: 1 1 360px; }
.head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.head p { margin: 6px 0 0; max-width: 72ch; color: var(--text-2); }
.head .mono { display: block; margin-bottom: 8px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 8px; font-size: 13px; color: var(--text-3); }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .i { color: var(--text-3); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: 14px; }
.facts li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.facts li .i { color: var(--text-3); }
.facts a { color: var(--text-2); text-decoration: none; }
.facts a:hover { color: var(--link); text-decoration: underline; }

/* --------------------------------------------------------------- surfaces */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card.flat { box-shadow: none; }
.card.flush, .card:has(> .scroll:first-child:last-child), .card:has(> .sec-head:first-child + .scroll:last-child) { padding-bottom: 6px; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; min-height: 24px; }
.sec-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.sec-head h2 .i { color: var(--text-3); }
.sec-head .count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: 600 12px/1 var(--font); font-variant-numeric: tabular-nums; }
.sec-head a { font-size: 13px; font-weight: 500; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Two plates, one inside the other: kept for the few surfaces that are the point of the page. */
.bezel { padding: 6px; border-radius: 22px; background: color-mix(in srgb, var(--surface-3) 70%, transparent); border: 1px solid var(--line-2); }
.bezel > .card { border-radius: 17px; box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.5); }

/* Numbers across the top of Today: one strip, not a wall of boxes. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.kpi { position: relative; display: grid; gap: 4px; align-content: start; padding: 18px 20px; color: inherit; text-decoration: none; border-left: 1px solid var(--line-2); transition: background-color 0.2s var(--ease); }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--surface-2); }
.kpi .kpi-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi .kpi-label .i { color: var(--text-3); }
.kpi b { font: 600 27px/1.15 var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi small { font-size: 12.5px; color: var(--text-3); }
.kpi.alert b { color: var(--bad); }
.tile b { display: block; font: 600 27px/1.1 var(--font); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.tile span { display: block; margin-top: 6px; font-size: 13px; color: var(--text-2); }
a.tile { color: inherit; text-decoration: none; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
a.tile:hover { border-color: var(--line-strong); }

/* ------------------------------------------------------------ lists, data */

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: left; padding: 10px 12px; font: 500 12.5px/1.3 var(--font); color: var(--text-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); color: var(--text-2); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 0.15s var(--ease); }
tbody tr:hover td { background: var(--surface-2); }
tr[data-href] { cursor: pointer; }
td b, td a.strong { color: var(--text); font-weight: 600; text-decoration: none; }
td a.strong:hover { color: var(--link); text-decoration: underline; }
td .meta { display: block; margin-top: 2px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num b { font-weight: 600; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card > .scroll:first-child, .card > .sec-head + .scroll { margin: -6px -20px 0; }
.card > .scroll:first-child th:first-child, .card > .scroll:first-child td:first-child,
.card > .sec-head + .scroll th:first-child, .card > .sec-head + .scroll td:first-child { padding-left: 20px; }
.card > .scroll:first-child th:last-child, .card > .scroll:first-child td:last-child,
.card > .sec-head + .scroll th:last-child, .card > .sec-head + .scroll td:last-child { padding-right: 20px; }
.card > .scroll:first-child:last-child { margin-bottom: -6px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 14px; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list > li:first-child { padding-top: 4px; }
.list > li:last-child { border-bottom: 0; padding-bottom: 2px; }
.list .what { min-width: 0; flex: 1; }
.list .what b { display: block; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.list .what b a { color: inherit; text-decoration: none; }
.list .what b a:hover { color: var(--link); text-decoration: underline; }
.list .what > span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--text-2); }
.list .what > span a { color: var(--text-2); }
.list .end { display: flex; align-items: center; gap: 8px; flex: none; }
.list.compact > li { padding: 9px 0; gap: 12px; }
.list.compact > li:first-child { padding-top: 2px; }
.list.compact .amount { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.kv dt { font-size: 13px; color: var(--text-3); padding-top: 1px; }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; font-size: 14px; }
.kv dd a { color: var(--text); }
.line-detail { display: block; color: var(--text-2); font-size: 13.5px; margin-top: 3px; white-space: pre-wrap; }

.empty-state { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; color: var(--text-2); }
.empty-state .i { color: var(--text-3); margin-bottom: 4px; }
.empty-state b { color: var(--text); font-weight: 600; }
.empty-state p { margin: 0; max-width: 46ch; font-size: 14px; }
.empty-state .btn { margin-top: 8px; }
.all-clear { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-2); font-size: 14px; }
.all-clear .i { color: var(--good); }
.all-clear span.sep { color: var(--text-3); }

/* ------------------------------------------------------------ pills, dates */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  background: var(--quiet-soft);
  color: var(--quiet);
  font: 550 12px/1 var(--font);
  letter-spacing: 0;
  white-space: nowrap;
  vertical-align: middle;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.pill.plain::before { display: none; }
.pill.tone-brass, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.tone-steel, .pill.info { background: var(--info-soft); color: var(--info); }
.pill.tone-good, .pill.on, .pill.good { background: var(--good-soft); color: var(--good); }
.pill.tone-bad, .pill.off, .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.live::before { animation: breathe 1.8s ease-in-out infinite; }
h1 .pill { font-size: 12.5px; height: 25px; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.due.today { color: var(--warn); }
.due.overdue { color: var(--bad); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font: 550 11.5px/1.2 var(--font); background: rgba(11, 25, 32, 0.72); color: #fff; }

/* --------------------------------------------------------- tabs, toolbar */

.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); max-width: 100%; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 13px; border-radius: 999px; color: var(--text-2); text-decoration: none; font: 500 13.5px/1 var(--font); white-space: nowrap; transition: background-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-2); }
.tabs a .n { color: var(--text-3); font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar form { display: flex; gap: 8px; flex: 1 1 320px; max-width: 560px; }
.toolbar form input[type='search'], .toolbar form input[type='text'] { flex: 1; }
.toolbar > input[type='search'], .toolbar > input[type='text'] { flex: 1 1 280px; width: auto; }

/* ------------------------------------------------------------------ forms */

label { display: block; margin-bottom: 6px; font: 500 13.5px/1.35 var(--font); color: var(--text); }
input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='date'], input[type='time'], input[type='search'], input[type='number'], input[type='url'], select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font: 400 15px/1.4 var(--font);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 0.85; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 28%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); box-shadow: var(--ring); }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%2366767f'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
input[type='date'], input[type='time'] { min-width: 0; }
input[type='checkbox'], input[type='radio'] { width: 18px; height: 18px; margin: 0; accent-color: var(--brass); flex: none; }
input[type='file'] { font: 400 14px/1.4 var(--font); color: var(--text-2); max-width: 100%; }
input[type='file']::file-selector-button { margin-right: 12px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; transition: background-color 0.18s var(--ease); }
input[type='file']::file-selector-button:hover { background: var(--surface-3); }
.field { margin-bottom: 16px; }
.fgrid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 14px; cursor: pointer; }
.check input { margin-top: 1px; }
.check span { color: var(--text-2); font-weight: 400; }
.check span b { color: var(--text); }
fieldset.slot { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px 14px; margin: 0; min-width: 0; display: grid; gap: 10px; }
fieldset.slot legend { padding: 0 6px; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }

details.more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
details.more > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font: 500 13.5px/1.3 var(--font); color: var(--link); border-radius: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.25s var(--ease);
}
details.more[open] > summary::before { transform: rotate(45deg); }
details.more[open] > summary { margin-bottom: 14px; }
details.more > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
td details.more { border-top: 0; margin-top: 4px; padding-top: 0; }
td details.more[open] { min-width: 280px; }

/* -------------------------------------------------------- notes and toasts */

.note { display: block; margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); color: var(--text); font-size: 14px; line-height: 1.5; }
.note.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.note.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.note.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.note:has(> svg.i:first-child) { display: flex; gap: 10px; align-items: flex-start; }
.note > .i { margin-top: 1px; color: var(--warn); }
.note.bad > .i { color: var(--bad); }
.note.good > .i { color: var(--good); }
.note.info > .i { color: var(--info); }
.note a { color: inherit; font-weight: 600; }

.toasts { position: fixed; z-index: 55; top: calc(var(--bar-h) + 14px + env(safe-area-inset-top, 0px)); right: 24px; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 13px 14px 13px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); color: var(--text); font-size: 14px; line-height: 1.45; animation: toast-in 0.45s var(--ease) both; }
.toast > .i { margin-top: 1px; }
.toast.good > .i { color: var(--good); }
.toast.bad { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.toast.bad > .i { color: var(--bad); }
.toast .toast-text { flex: 1; }
.toast .icon-btn { width: 26px; height: 26px; border-radius: 8px; margin: -3px -4px -3px 0; }
.toast.leaving { animation: toast-out 0.3s var(--ease) forwards; }

/* --------------------------------------------------------------- timeline */

.composer { display: grid; gap: 10px; }
.composer .kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.composer .kinds label { margin: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease); }
.composer .kinds label:hover { border-color: var(--line-strong); color: var(--text); }
.composer .kinds input { position: absolute; opacity: 0; pointer-events: none; }
.composer .kinds label:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--brass) 45%, transparent); color: var(--text); }
.composer .kinds label:has(input:focus-visible) { box-shadow: var(--ring); }
.composer .kinds label .i { color: var(--text-3); }
.composer .kinds label:has(input:checked) .i { color: var(--warn); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline > li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 10px 0; }
.timeline .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--text-3); }
.timeline .dot .i { width: 15px; height: 15px; }
.timeline li.human .dot { background: var(--accent-soft); border-color: color-mix(in srgb, var(--brass) 35%, transparent); color: var(--warn); }
.timeline li.k-quote .dot { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.timeline .entry { min-width: 0; padding-top: 5px; }
.timeline .kind { display: inline-block; font: 600 12px/1.2 var(--font); color: var(--text-2); margin-right: 6px; }
.timeline .body { margin: 4px 0 4px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.timeline li.human .body { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.timeline li.system .entry { padding-top: 7px; }
.timeline li.system .body { display: inline; margin: 0; color: var(--text-2); font-size: 13.5px; }
.timeline li.system .meta { display: inline; margin-left: 6px; }
.timeline li.system { padding: 6px 0; }
.timeline li.system .dot { width: 32px; height: 26px; border: 0; background: transparent; }
.timeline li.system .dot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 4px var(--surface); }
.timeline li.system .dot .i { display: none; }
.timeline .meta a { color: var(--text-3); }
.timeline.old-style > li { display: block; padding: 12px 0 12px 16px; border-left: 2px solid var(--line); }
.tl-filter { margin-bottom: 8px; }
.timeline[data-show='people'] > li.system { display: none; }

/* ---------------------------------------------------------- pipeline board */

.board { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.column { background: color-mix(in srgb, var(--surface-3) 60%, transparent); border: 1px solid var(--line-2); border-radius: 18px; padding: 10px; }
.column-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 8px 12px; }
.column-head h2 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.column-head h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--col, var(--quiet)); }
.column-head span { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.column-new { --col: var(--brass); }
.column-contacted { --col: var(--info); }
.column-quoted { --col: var(--good); }
.deal { display: block; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease); }
.deal + .deal { margin-top: 8px; }
.deal:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.deal b { display: block; color: var(--text); font-weight: 600; font-size: 14.5px; }
.deal .title { display: block; color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.deal .row { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; align-items: center; }
.deal .value { font: 600 16px/1 var(--font); letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.deal .row .meta { text-align: right; }
.deal.unassigned { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.deal.unassigned::after { content: 'No owner'; position: absolute; top: 12px; right: 12px; padding: 2px 7px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); font: 600 11px/1.4 var(--font); }

/* ------------------------------------------------- builds: stages, photos */

.stages { list-style: none; margin: 0; padding: 0; position: relative; }
.stage { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; }
.stage + .stage::before { content: ''; position: absolute; left: 10px; top: -9px; height: 18px; width: 2px; background: var(--line); }
.stage.s-done + .stage::before { background: var(--brass); }
.stage .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); justify-self: center; display: grid; place-items: center; }
.stage.s-done .dot { background: var(--brass); border-color: var(--brass); }
.stage.s-done .dot::after { content: ''; width: 10px; height: 6px; border-left: 2px solid var(--on-brass); border-bottom: 2px solid var(--on-brass); transform: translateY(-1px) rotate(-45deg); }
.stage.s-active .dot { border-color: var(--brass); box-shadow: 0 0 0 5px var(--accent-soft); }
.stage.s-active .dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); animation: breathe 1.8s ease-in-out infinite; }
.stage .what b { display: block; color: var(--text); font-weight: 600; font-size: 14.5px; }
.stage.s-pending .what b { color: var(--text-2); font-weight: 500; }
.stage .what .meta { display: block; }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; }
.photo { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 2px solid transparent; margin: 0; box-shadow: var(--shadow-sm); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.photo a { display: block; width: 100%; height: 100%; }
.photo a:hover img { transform: scale(1.03); }
.photo .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(8, 19, 25, 0.55); display: block; padding: 0; backdrop-filter: none; border: 0; }
.photo .bar i { display: block; height: 100%; width: 0; background: var(--brass-hi); transition: width 0.3s var(--ease); }
.photo .note { position: absolute; left: 6px; bottom: 10px; margin: 0; padding: 3px 7px; border: 0; border-radius: 6px; background: rgba(8, 19, 25, 0.85); color: #fff; font: 550 11px/1.3 var(--font); max-width: calc(100% - 12px); display: block; }
.photo.ready .bar, .photo.ready .note:empty { display: none; }
.photo.pending img { opacity: 0.55; }
.photo.failed { border-color: var(--bad); }
.photo input { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; accent-color: var(--brass); }
.photo:has(input:checked) { border-color: var(--brass-hi); box-shadow: 0 0 0 3px var(--accent-soft); }
.photo .badge { position: absolute; top: 8px; left: 8px; z-index: 1; }
.photo .pill.badge { background: rgba(11, 25, 32, 0.78); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.photo .pill.badge::before { background: #6fd39c; }
.photo .hide-btn { position: absolute; bottom: 8px; left: 8px; }

.progress { display: block; width: 100%; max-width: 160px; height: 5px; margin: 6px 0 3px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brass), var(--brass-hi)); }
.progress.wide { max-width: none; height: 6px; margin: -4px 0 12px; }
.capture { max-width: 640px; margin: 0 auto; }
.cap-title { font-size: 26px; margin: 6px 0 18px; }
.cap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.cap-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 108px; margin: 0; padding: 14px; border-radius: 20px; background: var(--brass); color: var(--on-brass); font: 600 15px/1.2 var(--font); text-align: center; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow); transition: transform 0.12s var(--ease), background-color 0.2s var(--ease); }
.cap-btn:hover { background: var(--brass-hi); }
.cap-btn.ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); }
.cap-btn:active { transform: scale(0.98); }
.cap-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(11, 25, 32, 0.12); font-size: 22px; line-height: 1; }
.cap-btn.ghost .cap-icon { background: var(--surface-3); }
.cap-status { font-size: 14px; color: var(--text-2); margin: 4px 0 14px; min-height: 1.4em; }
.cap-publish { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.cap-go { width: 100%; min-height: 56px; margin-top: 10px; border-radius: 16px; font-size: 16px; }
.cap-go:disabled { opacity: 0.45; cursor: not-allowed; }

.bigpicks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bigpick { display: grid; gap: 6px; align-content: start; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.bigpick:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bigpick b { font: 620 20px/1.2 var(--font); letter-spacing: -0.02em; }
.bigpick span { color: var(--text-2); font-size: 14px; }
.bigpick .go { margin-top: 10px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 52px; border-radius: 14px; background: var(--brass); color: var(--on-brass); font: 600 15px/1 var(--font); }

/* ----------------------------------------------------------- service thread */

.thread { display: grid; gap: 12px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.msg header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; align-items: baseline; }
.msg header b { color: var(--text); }
.msg p { white-space: pre-wrap; color: var(--text); margin: 0; overflow-wrap: anywhere; }
.msg.ours { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); border-color: color-mix(in srgb, var(--brass) 30%, transparent); }
.msg.note-msg { background: repeating-linear-gradient(135deg, var(--info-soft) 0 10px, transparent 10px 20px), var(--surface-2); border: 1px dashed color-mix(in srgb, var(--info) 45%, transparent); }
.msg .photos { margin-top: 12px; }

/* ------------------------------------------------------- pits, parts, misc */

.qrbox { background: #fff; border-radius: 14px; padding: 12px; width: 220px; max-width: 100%; margin-bottom: 12px; border: 1px solid var(--line); }
.qrbox svg { display: block; width: 100%; height: auto; }
.thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--surface-3); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb { display: grid; place-items: center; }
.thumb .thumb-i { color: var(--text-3); }
.thumb.big { width: 100%; height: auto; aspect-ratio: 4/3; margin-bottom: 12px; border-radius: 14px; }
.fits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 14px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; padding-left: 1.4em; font: 500 16px/1.4 var(--mono); }
code.key { font: 500 15px/1.5 var(--mono); letter-spacing: 0.02em; word-break: break-all; color: var(--text); }
pre.snippet { margin: 0 0 6px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; font: 500 12.5px/1.6 var(--mono); color: var(--text); white-space: pre; }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent); border-radius: 12px; padding: 10px 12px; font: 500 13px/1.45 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.totals { margin-left: auto; max-width: 380px; }
.totals div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; color: var(--text-2); font-variant-numeric: tabular-nums; }
.totals div.grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; color: var(--text); font: 620 21px/1.1 var(--font); letter-spacing: -0.02em; }
.totals div.deposit { color: var(--warn); font-weight: 550; }
.sitephotos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.sitephoto { margin: 0; padding: 0; overflow: hidden; }
.sitephoto img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.sitephoto figcaption { padding: 12px 14px; display: grid; gap: 4px; }
.sitephoto .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sitephoto .acts form { display: flex; flex-wrap: wrap; gap: 6px; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.push-actions [hidden] { display: none; }

/* ------------------------------------------------------------- visits week */

.week { display: grid; gap: 12px; grid-template-columns: repeat(var(--days, 5), minmax(0, 1fr)); align-items: start; }
.day { background: color-mix(in srgb, var(--surface-3) 55%, transparent); border: 1px solid var(--line-2); border-radius: 16px; padding: 10px; display: grid; gap: 8px; min-width: 0; }
.day.today { background: var(--surface); border-color: color-mix(in srgb, var(--brass) 55%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.day h2 { font-size: 14.5px; display: flex; gap: 6px; align-items: baseline; padding: 4px 6px 2px; }
.day h2 span { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.day h2 em { font: 600 11.5px/1 var(--font); color: var(--warn); font-style: normal; margin-left: auto; }
.day .nothing { font-size: 13px; color: var(--text-3); margin: 0 6px; }
.day .add { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 500; color: var(--text-3); text-decoration: none; padding: 6px; border-radius: 8px; }
.day .add:hover { color: var(--link); background: var(--surface); }
.visit { display: grid; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: 12px; padding: 10px 11px; text-decoration: none; color: var(--text-2); font-size: 13.5px; min-width: 0; box-shadow: var(--shadow-sm); transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.visit:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.visit b { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.visit .when { font: 600 12px/1.4 var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
.visit .who { font-size: 12.5px; color: var(--text-3); }
.visit .pill { justify-self: start; margin-top: 4px; }
.visit.s-on_the_way, .visit.s-on_site { border-left-color: var(--brass); }
.visit.s-done { border-left-color: var(--good); opacity: 0.8; }
.visit.s-cancelled { border-left-color: var(--line-strong); opacity: 0.55; }
.visit.s-cancelled b { text-decoration: line-through; }
.visit-go { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); align-items: start; }
.visit-go form { margin: 0; }

/* --------------------------------------------------------------- lightbox */

.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(4, 10, 14, 0.94); display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; animation: fade-in 0.2s var(--ease); }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 10px; padding: 20px 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 90px); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: rgba(238, 241, 244, 0.75); font-size: 14px; }
.lightbox button { background: none; border: 0; color: #eef1f4; font-size: 2.4rem; cursor: pointer; height: 100%; }
.lightbox .lb-close { position: absolute; top: 10px; right: 14px; height: auto; font-size: 2rem; }

/* --------------------------------------------------------------- search */

.results { display: grid; gap: 20px; }
.hit { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: inherit; text-decoration: none; }
.hit:hover, .hit[aria-selected='true'] { background: var(--surface-3); }
.hit .hit-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); }
.hit .hit-text { min-width: 0; flex: 1; }
.hit .hit-text b { display: block; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit .hit-text span { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit .hit-kind { font-size: 12px; color: var(--text-3); flex: none; }
.hit mark { background: rgba(212, 160, 58, 0.3); color: inherit; border-radius: 3px; padding: 0 1px; }

.palette { position: fixed; inset: 0; z-index: 65; display: grid; justify-items: center; align-items: start; padding: 11vh 16px 16px; background: rgba(8, 16, 22, 0.44); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in 0.18s var(--ease); }
.palette[hidden] { display: none; }
.palette-box { width: min(660px, 100%); max-height: min(560px, 78vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: palette-in 0.28s var(--ease); }
.palette-input { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.palette-input .i { position: absolute; left: 18px; color: var(--text-3); }
.palette-input input[type='search'] { height: 58px; border: 0; border-radius: 0; padding: 0 60px 0 50px; background: transparent; font-size: 16.5px; box-shadow: none; }
.palette-input input[type='search']:focus { box-shadow: none; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-input kbd { position: absolute; right: 16px; padding: 2px 7px; border-radius: 7px; border: 1px solid var(--line); color: var(--text-3); font: 500 11.5px/1.5 var(--font); }
.palette-list { overflow-y: auto; padding: 8px; }
.palette-group { margin: 8px 10px 4px; font: 600 11px/1 var(--font); letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); }
.palette-empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 14px; }
.palette-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--text-3); }
.palette-foot kbd { padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); font: 500 11px/1.4 var(--font); }

/* ----------------------------------------------------------- signed out */

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: #eef1f4; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
/* Raw steel on the shop floor, behind the ink and the gradients rather than beside them: a
   negative layer inside this panel's own stacking context, so the grid and the words stay on top. */
.auth-art > .auth-art__photo { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: 0.66; }
/* Dark at the top and bottom where the words sit, open through the middle so the steel shows. */
.auth-art::before { content: ''; position: absolute; inset: 0; background: linear-gradient(190deg, rgba(11, 25, 32, 0.62), rgba(11, 25, 32, 0.2) 38%, rgba(11, 25, 32, 0.88)), radial-gradient(120% 80% at 10% 110%, rgba(212, 160, 58, 0.24), transparent 62%), radial-gradient(90% 60% at 100% 0%, rgba(40, 70, 107, 0.4), transparent 60%); }
.auth-art::after { content: ''; position: absolute; inset: 0; opacity: 0.08; background-image: linear-gradient(rgba(238, 241, 244, 0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(238, 241, 244, 0.5) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 85%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand { font-size: 26px; }
.auth-art__head { display: grid; gap: 12px; justify-items: start; }
.auth-art__head img { width: min(260px, 62%); height: auto; }
.auth-art blockquote { margin: 0; max-width: 30ch; font: 560 30px/1.15 var(--font); letter-spacing: -0.03em; color: #fff; }
.auth-art blockquote span { color: var(--brass-hi); }
.auth-art p { color: rgba(238, 241, 244, 0.6); font-size: 14px; margin: 14px 0 0; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
/* These four numbers are shared with the customer portal's sign-in (customer/layout.ts), so the
   box, the card and the dial above it land in the same place on both. Change one, change both. */
.auth .box { width: 100%; max-width: 420px; }
.auth .field input { min-height: 48px; }
/* Whatever sits under the card — a phone number on one portal, a "staff only" line on the
   other — is normalised to the same height, so both boxes end level and the dial above them
   starts level. */
.auth .box > :last-child { margin: 18px 0 0; font-size: 13px; line-height: 20px; }
/* The floor for the boxed part, so a sign-in, a password reset and the customer portal's card
   are all the same height and the dial above them starts at the same line. Here it goes on the
   bezel, which is the edge you see; on the customer side, on the card itself. A flash message
   pushes past it, which is the one time the two are allowed to differ. */
.auth .bezel { min-height: 410px; }
.auth .box .brand { display: none; margin-bottom: 22px; color: var(--text); }
.auth .box .brand span { color: var(--brass); }
/* Which half of the page names the portal changes with the width: the photograph does it on a
   desktop, and on a phone, where the photograph is gone, the card does. */
.portal-tag { font: 600 11px/14px var(--font); letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass-hi); }
.auth-mark { display: none; margin-bottom: 22px; gap: 10px; justify-items: center; text-align: center; }
.auth-mark__logo { display: block; width: min(232px, 72%); aspect-ratio: 720 / 114; background: var(--logo) center / contain no-repeat; }
.auth .card { padding: 28px 26px; }
.auth h1 { font-size: 24px; margin-bottom: 4px; }
.auth .sub { margin: 0 0 22px; color: var(--text-2); font-size: 15px; }
.auth form .btn { width: 100%; min-height: 48px; }
.foot { margin-top: 18px; font-size: 13px; color: var(--text-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ motion */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes palette-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.8); } }

@media (prefers-reduced-motion: no-preference) {
  .page > * { animation: rise 0.55s var(--ease) both; }
  .page > *:nth-child(2) { animation-delay: 0.035s; }
  .page > *:nth-child(3) { animation-delay: 0.07s; }
  .page > *:nth-child(4) { animation-delay: 0.105s; }
  .page > *:nth-child(5) { animation-delay: 0.14s; }
  .page > *:nth-child(n + 6) { animation-delay: 0.17s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 1180px) {
  .main { padding: 24px 24px 64px; }
  .bar { padding-inline: 24px; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
}
@media (max-width: 1100px) {
  .week { grid-template-columns: minmax(0, 1fr); }
  .day.empty-day { grid-template-columns: auto 1fr auto; align-items: center; }
  .day.empty-day .nothing { margin: 0; }
}
@media (max-width: 1023px) {
  .side { transform: translateX(-102%); transition: transform 0.35s var(--ease); box-shadow: none; width: min(300px, 86vw); }
  #nav-toggle:checked ~ .side, .side.open { transform: none; box-shadow: 30px 0 60px -20px rgba(0, 0, 0, 0.5); }
  #nav-toggle:checked ~ .scrim, .scrim.open { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8, 16, 22, 0.45); animation: fade-in 0.2s var(--ease); }
  .side .side-close { display: inline-grid; }
  .frame { margin-left: 0; }
  .bar { padding-inline: 16px 12px; gap: 6px; }
  .bar .menu-btn { display: inline-grid; margin-left: -6px; }
  .bar .brand { display: inline-flex; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  body { font-size: 15.5px; }
  .bar { height: calc(56px + env(safe-area-inset-top, 0px)); }
  .bar .search { display: none; }
  .bar .search-link { display: inline-grid; }
  .bar .create-label { display: none; }
  .bar .create > summary.btn { width: 40px; padding: 0; }
  .bar .create > summary.btn .i { margin: 0; }
  .main { padding: 18px 16px calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 23px; }
  .head { margin-bottom: 18px; gap: 12px; }
  .head > div:first-child { flex-basis: 100%; }
  .head .actions { width: 100%; }
  .head .actions .btn { flex: 1 1 auto; }
  .card { padding: 16px; border-radius: 14px; }
  .card > .scroll:first-child, .card > .sec-head + .scroll { margin-inline: -16px; }
  .card > .scroll:first-child th:first-child, .card > .scroll:first-child td:first-child, .card > .sec-head + .scroll th:first-child, .card > .sec-head + .scroll td:first-child { padding-left: 16px; }
  .card > .scroll:first-child th:last-child, .card > .scroll:first-child td:last-child, .card > .sec-head + .scroll th:last-child, .card > .sec-head + .scroll td:last-child { padding-right: 16px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; border-left: 0; border-top: 1px solid var(--line-2); }
  .kpi:nth-child(even) { border-left: 1px solid var(--line-2); }
  .kpi:nth-child(-n + 2) { border-top: 0; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi b { font-size: 23px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .toasts { left: 16px; right: 16px; width: auto; top: calc(64px + env(safe-area-inset-top, 0px)); }
  .tabbar {
    position: fixed;
    z-index: 33;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    height: var(--tabbar-h);
    padding: 6px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--side-bg) 90%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    border: 1px solid rgba(238, 241, 244, 0.1);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }
  .tabbar a, .tabbar label { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; border-radius: 16px; color: rgba(238, 241, 244, 0.62); text-decoration: none; font: 550 11px/1 var(--font); cursor: pointer; transition: color 0.2s var(--ease), background-color 0.2s var(--ease); }
  .tabbar a[aria-current] { color: #fff; background: rgba(212, 160, 58, 0.16); }
  .tabbar a[aria-current] .i { color: var(--brass-hi); }
  .tabbar .count-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 17px; padding: 0 5px; font-size: 10.5px; line-height: 17px; }
  .timeline li.system .meta { display: block; margin: 2px 0 0; }
  .list > li { flex-wrap: wrap; }
  .toolbar form { flex-basis: 100%; max-width: none; }
  /* On a phone the photograph goes and the card takes the whole screen, centred, with the
     wordmark and the portal's name above it so it is obvious which of the two you are opening. */
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-main { padding: 24px 20px; }
  .auth-mark { display: grid; }
  .codes { grid-template-columns: minmax(0, 1fr); }
  .cap-title { font-size: 24px; }
}
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 38px; }
  input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='date'], input[type='time'], input[type='search'], input[type='number'], input[type='url'], select, textarea { min-height: 46px; font-size: 16px; }
  .search input[type='search'] { min-height: 40px; }
  .side-nav a { min-height: 44px; }
}
@media print {
  .side, .bar, .tabbar, .toasts, .no-print, .noprint { display: none !important; }
  .frame { margin: 0; }
  .main { padding: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #ccc; }
}
