/* LEG Procurement design system.
   Principles: content on a calm white canvas, structured by hairlines and space (no floating cards; shadows only on
   things that float above the page: menus, tooltips, dialogs, toasts). One accent (LEG terracotta) for primary
   actions, focus and "live" states. Motion is spring-based, short, interruptible, and off under reduced motion. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/static/fonts/inter-var-latin.woff2") format("woff2"); }

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #ffffff; --bg-sunken: #f7f6f4;
  --fill-1: rgba(52, 42, 32, .045); --fill-2: rgba(52, 42, 32, .08); --fill-3: rgba(52, 42, 32, .12);
  --line: rgba(52, 42, 32, .12); --line-2: rgba(52, 42, 32, .2); --line-3: rgba(52, 42, 32, .3);
  --fg: #1d1b19; --fg-2: #48433e; --muted: #706a63; --faint: #979189;
  --accent: #b75447; --accent-hover: #a94b3f; --accent-press: #963f34; --accent-fg: #fff; --accent-soft: rgba(183, 84, 71, .1); --accent-text: #a54739;
  --ok: #2b7a4b; --ok-soft: rgba(43, 122, 75, .11); --warn: #9a5f08; --warn-soft: rgba(190, 125, 20, .13); --bad: #b3261e; --bad-soft: rgba(179, 38, 30, .09); --info: #2a6191; --info-soft: rgba(42, 97, 145, .1);
  --pop-bg: rgba(255, 255, 255, .86); --hud-bg: rgba(32, 29, 27, .88); --hud-fg: #fff;
  --shadow-pop: 0 0 0 var(--hair) rgba(40, 30, 20, .16), 0 2px 6px rgba(40, 30, 20, .05), 0 14px 36px -6px rgba(40, 30, 20, .2);
  --shadow-thumb: 0 0 0 var(--hair) rgba(40, 30, 20, .1), 0 1px 3px rgba(40, 30, 20, .1), 0 3px 8px -2px rgba(40, 30, 20, .08);
  --ring: 0 0 0 3.5px color-mix(in srgb, var(--accent) 22%, transparent);
  --f: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --r-xs: 5px; --r-sm: 7px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --hair: 1px;
  /* motion: springs as linear() curves (response/damping in the comments), with matching durations */
  --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: var(--ease-out); --spring-smooth: var(--ease-out); --spring-bouncy: cubic-bezier(.3, 1.4, .5, 1);
  --d-fast: 130ms; --d: 200ms; --d-spring: 430ms; --d-smooth: 520ms; --d-bouncy: 600ms;
  --bar: 56px;
  color-scheme: light;
  /* compatibility aliases */
  --hover: var(--fill-1); --active: var(--fill-2); --well: var(--bg-sunken); --bg-2: var(--bg-sunken);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.013 2%, 0.058 4.5%, 0.155 8%, 0.518 19%, 0.657 24%, 0.767 29%, 0.856 34.5%, 0.921 40.5%, 0.969 48%, 0.997 58%, 1.005 78.5%, 1);              /* .32s, .86 */
    --spring-smooth: linear(0, 0.014 2%, 0.061 4.5%, 0.173 8.5%, 0.457 17.5%, 0.602 23%, 0.716 28.5%, 0.807 34.5%, 0.88 41.5%, 0.934 50%, 0.972 61.5%, 0.994 81.5%, 1);        /* .42s, 1.0 */
    --spring-bouncy: linear(0, 0.011 1.5%, 0.053 3.5%, 0.137 6%, 0.312 10%, 0.585 16%, 0.74 20%, 0.849 23.5%, 0.931 27%, 0.995 31%, 1.035 35.5%, 1.054 41%, 1.043 50.5%, 1.004 69.5%, 0.998 95.5%, 1); /* .40s, .68 */
  }
}
@media (min-resolution: 2dppx) { :root { --hair: .5px; --hair-scale: .5; --line: rgba(52, 42, 32, .2); --line-2: rgba(52, 42, 32, .28); } }
@media (min-resolution: 3dppx) { :root { --hair: .34px; --hair-scale: .34; --line: rgba(52, 42, 32, .24); --line-2: rgba(52, 42, 32, .32); } }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211; --bg-sunken: #1a1917;
    --fill-1: rgba(255, 244, 230, .06); --fill-2: rgba(255, 244, 230, .1); --fill-3: rgba(255, 244, 230, .15);
    --line: rgba(255, 244, 230, .13); --line-2: rgba(255, 244, 230, .2); --line-3: rgba(255, 244, 230, .3);
    --fg: #f1eeea; --fg-2: #d1ccc5; --muted: #a09a92; --faint: #746f69;
    --accent: #d9735f; --accent-hover: #e28370; --accent-press: #c96551; --accent-fg: #1c0d09; --accent-soft: rgba(217, 115, 95, .16); --accent-text: #ee9b89;
    --ok: #6cc08d; --ok-soft: rgba(108, 192, 141, .14); --warn: #e2a84e; --warn-soft: rgba(226, 168, 78, .14); --bad: #f2897e; --bad-soft: rgba(242, 137, 126, .14); --info: #7fb2de; --info-soft: rgba(127, 178, 222, .14);
    --pop-bg: rgba(40, 38, 35, .84); --hud-bg: rgba(60, 56, 52, .9);
    --shadow-pop: 0 0 0 var(--hair) rgba(255, 244, 230, .16), 0 16px 44px -8px rgba(0, 0, 0, .7);
    --shadow-thumb: 0 0 0 var(--hair) rgba(255, 244, 230, .12), 0 1px 3px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
@media (prefers-color-scheme: dark) and (min-resolution: 2dppx) { :root { --line: rgba(255, 244, 230, .2); --line-2: rgba(255, 244, 230, .28); } }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 64px); interpolate-size: allow-keywords; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 14px/1.5 var(--f); font-optical-sizing: auto; font-feature-settings: "calt", "ss03"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
main { flex: 1 0 auto; }
h1, h2, h3, h4 { margin: 0; color: var(--fg); font-weight: 600; text-wrap: balance; }
h1 { font-size: 28px; line-height: 1.16; letter-spacing: -.024em; font-weight: 650; }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.014em; }
h3 { font-size: 13px; line-height: 1.4; letter-spacing: -.003em; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; font-feature-settings: inherit; }
.link, .prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-3); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color var(--d-fast), text-decoration-color var(--d-fast); }
.link:hover, .prose a:hover { color: var(--accent-text); text-decoration-color: currentColor; }
.mono { font-family: var(--f-mono); font-size: .9em; letter-spacing: -.01em; font-feature-settings: normal; }
.num, td, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; } .note { font-size: 12.5px; color: var(--muted); }
.badline { color: var(--bad); } .nowrap { white-space: nowrap; }
.wrap { width: 100%; max-width: 1264px; margin: 0 auto; padding-inline: max(32px, env(safe-area-inset-left)) max(32px, env(safe-area-inset-right)); }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a:focus-visible { border-radius: var(--r-xs); }
:is(.seg, .tabs, .nav) :focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500; transition: top var(--d) var(--ease-out); }
.skip:focus { top: 12px; }
kbd { font: 500 11px/1 var(--f); color: var(--muted); background: var(--fill-1); box-shadow: inset 0 0 0 var(--hair) var(--line-2); border-radius: var(--r-xs); padding: 3px 5px; min-width: 19px; display: inline-block; text-align: center; font-feature-settings: normal; }

/* ------------------------------------------------------------------ page transitions (cross-document + in-place) */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: var(--d-spring); animation-timing-function: var(--spring); }
::view-transition-old(root) { animation: vt-out 110ms var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in 380ms var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
.appbar { view-transition-name: appbar; }
.nav-ind { view-transition-name: nav-ind; }
::view-transition-old(appbar) { display: none; }
::view-transition-new(appbar) { animation: none; }
::view-transition-group(appbar) { z-index: 3; } ::view-transition-group(nav-ind) { z-index: 4; }
/* In-place refreshes: only what changed should move, so the page itself swaps without the slide. */
html.vt-soft::view-transition-old(root) { animation: vt-out 140ms linear both; }
html.vt-soft::view-transition-new(root) { animation: vt-fade 140ms linear both; }
html.vt-rows::view-transition-old(root) { display: none; }
html.vt-rows::view-transition-new(root) { animation: none; }
@keyframes vt-fade { from { opacity: 0; } }

/* thin progress bar: only appears when an in-place load takes longer than a blink */
.loadbar { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 200; pointer-events: none; opacity: 0; }
.loadbar::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.loadbar.on { opacity: 1; }
.loadbar.on::before { transform: scaleX(.85); transition: transform 9s cubic-bezier(.05, .7, .1, 1); }
.loadbar.on.done { opacity: 0; transition: opacity 260ms ease 120ms; }
.loadbar.on.done::before { transform: scaleX(1); transition: transform 160ms ease-out; }

/* ------------------------------------------------------------------ app bar */
.appbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); padding-top: env(safe-area-inset-top); box-shadow: 0 var(--hair) 0 var(--line); transition: box-shadow var(--d) ease; }
html[data-scrolled] .appbar { box-shadow: 0 var(--hair) 0 var(--line-2); }
.appbar-in { display: flex; align-items: center; gap: 40px; height: var(--bar); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; border-radius: var(--r-sm); transition: opacity var(--d-fast); }
.brand:active { opacity: .6; }
/* LEG lockup: the "Lewis Energy Group | Procurement" lockup cut for the bar (brand/logo/…_horizontal_ui.svg):
   no ®, and a 1px divider snapped to the pixel grid at 38px. 38px tall = 2.6 x the type's 14.6px cap height.
   Nudged up so the logotype's baseline sits on the nav's baseline (the symbol's heavy ring also reads better a touch high).
   Narrower desktops get the same lockup at 30px so the nav never clips; phones get the symbol alone. */
.brand .lockup { display: block; line-height: 0; }
.brand .lockup-full { display: block; height: 38px; width: auto; transform: translateY(-2px); }
.brand .mark { display: none; height: 28px; width: auto; }
@media (max-width: 1099px) {
  .appbar-in { gap: 28px; }
  .brand .lockup-full { height: 30px; transform: translateY(-1px); }
}
.nav { display: flex; gap: 2px; align-self: stretch; align-items: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; display: flex; align-items: center; height: 32px; padding: 0 11px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color var(--d-fast), background var(--d-fast); }
.nav a:hover { color: var(--fg); background: var(--fill-1); }
.nav a:active { background: var(--fill-2); }
.nav a.on { color: var(--fg); }
.nav-ind { position: absolute; left: 11px; right: 11px; bottom: -12px; height: 2px; border-radius: 2px 2px 0 0; background: var(--accent); }
.appbar-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.searchbtn { display: inline-flex; align-items: center; gap: 8px; height: 32px; min-width: 220px; padding: 0 7px 0 10px; border: 0; border-radius: var(--r); background: var(--fill-1); color: var(--muted); font-size: 13.5px; cursor: pointer; transition: background var(--d-fast), color var(--d-fast), transform var(--d-spring) var(--spring); }
.searchbtn:hover { background: var(--fill-2); color: var(--fg-2); }
.searchbtn:active { transform: scale(.98); }
.searchbtn .ic { width: 15px; height: 15px; }
.searchbtn kbd { margin-left: auto; background: transparent; }

/* menus (details-based popovers) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--fg-2); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; user-select: none; transition: box-shadow var(--d) var(--ease-out), transform var(--d-spring) var(--spring); }
.avatar:hover, .menu[open] > .avatar { box-shadow: 0 0 0 3px var(--fill-2); }
.avatar:active { transform: scale(.94); }
.menu-pop, .pop { background: var(--pop-bg); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 5px; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 248px; z-index: 40; transform-origin: calc(100% - 16px) 0; animation: pop-in var(--d-spring) var(--spring); }
@keyframes pop-in { from { opacity: 0; transform: scale(.94) translateY(-6px); } }
.menu-head { padding: 9px 10px 10px; display: grid; gap: 1px; }
.menu-head b { font-weight: 600; font-size: 13.5px; } .menu-head span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu-pop hr { border: 0; height: var(--hair); background: var(--line); margin: 5px 10px; }
.menu-head { box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); margin: 0 0 5px; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--r-sm); font: inherit; font-size: 13.5px; color: var(--fg); background: none; border: 0; cursor: pointer; text-align: left; transition: background 80ms; }
.menu-pop a:hover, .menu-pop button:hover, .menu-pop :is(a, button):focus-visible { background: var(--fill-2); outline: none; }
.menu-pop .ic { color: var(--muted); }
.menu-pop kbd { margin-left: auto; }
.menu-pop form { margin: 0; }

/* ------------------------------------------------------------------ footer */
.foot { margin-top: 112px; color: var(--faint); font-size: 12px; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; padding-block: 20px calc(24px + env(safe-area-inset-bottom)); box-shadow: inset 0 var(--hair) 0 var(--line); }

/* ------------------------------------------------------------------ buttons */
.btn { font-size: 13.5px; font-weight: 550; line-height: 1; letter-spacing: -.003em; height: 36px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; cursor: pointer; user-select: none; position: relative;
  color: var(--accent-fg); background-color: var(--accent); border: 0; border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(120, 40, 25, .18), inset 0 1px 0 rgba(255, 255, 255, .14);
  transition: background-color var(--d-fast), color var(--d-fast), box-shadow var(--d-fast), opacity var(--d-fast), transform var(--d-spring) var(--spring); }
.btn:hover { background-color: var(--accent-hover); }
.btn:active { background-color: var(--accent-press); transform: scale(.97); transition-duration: 80ms; }
.btn .ic { width: 15px; height: 15px; margin-left: -2px; }
.btn.secondary, .btn.ghost, .btn.danger { background-image: none; box-shadow: none; }
.btn.secondary { color: var(--fg); background-color: var(--fill-2); }
.btn.secondary:hover { background-color: var(--fill-3); }
.btn.secondary:active { background-color: var(--line-2); }
.btn.secondary .ic { color: var(--fg-2); }
.btn.ghost { color: var(--fg-2); background-color: transparent; }
.btn.ghost:hover { background-color: var(--fill-1); color: var(--fg); }
.btn.ghost:active { background-color: var(--fill-2); }
.btn.danger { color: var(--bad); background-color: var(--bad-soft); }
.btn.danger:hover { background-color: color-mix(in srgb, var(--bad) 16%, transparent); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; gap: 6px; border-radius: var(--r-sm); }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 10%, var(--accent-fg)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); animation: spin .7s linear infinite; }
.btn.secondary.is-busy::after, .btn.ghost.is-busy::after { background: conic-gradient(from 0deg, transparent 10%, var(--fg-2)); }
.btn .kbd-hint { font-size: 11px; font-weight: 500; opacity: .72; margin-left: 2px; letter-spacing: .02em; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; transition: background var(--d-fast), color var(--d-fast), transform var(--d-spring) var(--spring); }
.icon-btn:hover { background: var(--fill-2); color: var(--fg); }
.icon-btn:active { transform: scale(.9); transition-duration: 80ms; }
.icon-btn .ic { transition: transform var(--d-spring) var(--spring); }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-xs); transition: opacity var(--d-fast); }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:active { opacity: .6; }
.linkbtn.quiet { color: var(--muted); } .linkbtn.quiet:hover { color: var(--fg); }
/* copy buttons confirm in place */
[data-copy] .ic { transition: transform var(--d-bouncy) var(--spring-bouncy); }
[data-copy].copied { color: var(--ok) !important; }
[data-copy].copied .ic { color: var(--ok); animation: tick var(--d-bouncy) var(--spring-bouncy); }
@keyframes tick { from { transform: scale(.4) rotate(-20deg); opacity: 0; } }

/* ------------------------------------------------------------------ form controls */
input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], select, textarea {
  font-size: 14px; color: var(--fg); background: var(--bg); border: 0; box-shadow: inset 0 0 0 1px var(--line-2); border-radius: var(--r); height: 38px; padding: 0 12px; width: 100%; min-width: 0;
  transition: box-shadow var(--d) var(--ease-out), background var(--d-fast); }
:is(input, select, textarea):hover { box-shadow: inset 0 0 0 1px var(--line-3); }
:is(input, select, textarea):focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
textarea[data-grow] { resize: none; } /* app.js sizes it to its text */
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input[type="number"] { font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { display: none; }
/* every form control is one size (38px, 14px text) and every dropdown looks like this, wherever it sits */
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23908a82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 10 4-4 4 4M8 14l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
input:is([type="date"], [type="datetime-local"], [type="time"])::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; transition: opacity var(--d-fast); }
input:is([type="date"], [type="datetime-local"], [type="time"])::-webkit-calendar-picker-indicator:hover { opacity: .8; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
input:-webkit-autofill { -webkit-text-fill-color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 0 0 100px var(--bg-sunken); }
label.f { display: grid; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--fg-2); align-content: start; }
label.f .hint { font-weight: 400; color: var(--faint); }
/* checkbox: drawn, with a spring on check */
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--fg-2); cursor: pointer; user-select: none; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer; border-radius: 6px; background: var(--bg) center / 12px no-repeat; box-shadow: inset 0 0 0 1.5px var(--line-3); transition: background-color var(--d-fast), box-shadow var(--d-fast), transform var(--d-bouncy) var(--spring-bouncy); }
.check:hover input { box-shadow: inset 0 0 0 1.5px var(--muted); }
.check input:checked { background-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.check input:active { transform: scale(.86); }
.check input:focus-visible { outline: none; box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
/* switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; font-size: 14px; color: var(--fg); cursor: pointer; user-select: none; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.switch:last-of-type { box-shadow: none; }
.switch small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 12px; background: var(--fill-3); cursor: pointer; position: relative; transition: background var(--d) var(--ease-out); }
.switch input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 2px 6px rgba(0, 0, 0, .12); transition: transform var(--d-spring) var(--spring), width var(--d) var(--ease-out); }
.switch input:checked { background: var(--ok); }
.switch input:checked::before { transform: translateX(16px); }
.switch input:active::before { width: 24px; }
.switch input:checked:active::before { transform: translateX(12px); }
.switch input:focus-visible { outline: none; box-shadow: var(--ring); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px 20px; }
.fields .wide { grid-column: 1 / -1; }
.fields .span2 { grid-column: span 2; }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-actions .note { margin-left: 6px; }
.form-actions .spacer, .spacer { flex: 1; }
.searchbox { position: relative; }
.searchbox .ic { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--faint); pointer-events: none; width: 15px; height: 15px; transition: color var(--d-fast); }
.searchbox input { padding-left: 34px; padding-right: 36px; height: 34px; font-size: 13.5px; background: var(--fill-1); box-shadow: none; }
.searchbox input:hover { box-shadow: none; background: var(--fill-2); }
.searchbox input:focus { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
.searchbox:focus-within .ic { color: var(--accent-text); }
.searchbox kbd { position: absolute; right: 8px; top: 50%; translate: 0 -50%; pointer-events: none; background: transparent; transition: opacity var(--d-fast); }
.searchbox input[type=search]:focus ~ kbd, .searchbox input[type=search]:not(:placeholder-shown) ~ kbd { opacity: 0; }
.searchbox input[type=search]:not(:placeholder-shown) { padding-right: 10px; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin: 0 0 0 6px; border-radius: 50%; cursor: pointer; background: var(--fill-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6a63' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M17 7 7 17M7 7l10 10'/%3E%3C/svg%3E") center / 9px no-repeat; }
input[type="search"]::-webkit-search-cancel-button:hover { background-color: var(--line-3); }
mark { background: color-mix(in srgb, var(--accent) 17%, transparent); color: inherit; border-radius: 3px; padding: 1px 1px; margin: 0 -1px; }
.result-line { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); padding: 0 0 14px; margin-top: -6px; }

/* collapse: animates height by opening a grid row, so it follows the content with no measuring */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-smooth) var(--spring-smooth); }
.collapse > .collapse-in { min-height: 0; overflow: hidden; opacity: 0; transition: opacity 140ms ease; padding-inline: 4px; margin-inline: -4px; }
.collapse[data-open] { grid-template-rows: 1fr; }
.collapse[data-open] > .collapse-in { opacity: 1; transition: opacity 240ms ease 70ms; }
.collapse.flip, .collapse.flip > .collapse-in { transition: none; } /* app.js fold(): layout snaps, the motion is transforms */
.no-anim .collapse,.no-anim .collapse > .collapse-in, .no-anim .opt-more, .no-anim .opt-detail, .no-anim .chev, .no-anim .tab-ind { transition: none !important; }
/* disclosures open and close smoothly where the browser can animate to height:auto (not the popover menus) */
details:not(.menu)::details-content { block-size: 0; overflow: clip; opacity: 0; transition: block-size var(--d-smooth) var(--spring-smooth), opacity var(--d) ease, content-visibility var(--d-smooth) allow-discrete; }
details:not(.menu)[open]::details-content { block-size: auto; opacity: 1; }

/* ------------------------------------------------------------------ status, tags */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--fg-2); white-space: nowrap; line-height: 1.4; }
.status i, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
:is(.status, .t-neutral).neutral i, .t-neutral .dot, .dot.neutral { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.status.live { color: var(--accent-text); }
.status.live i, .dot.live { background: var(--accent); animation: breathe 1.8s ease-in-out infinite; }
.status.warn i, .dot.warn { background: #d08a1f; } .status.info i, .dot.info { background: var(--info); } .status.ok i, .dot.ok { background: var(--ok); }
.status.muted { color: var(--muted); } .status.muted i, .dot.muted { background: var(--line-3); }
.dot.bad { background: var(--bad); }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 34%, transparent); } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent); } }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11.5px; font-weight: 550; line-height: 1; white-space: nowrap; background: var(--fill-2); color: var(--fg-2); vertical-align: 1px; }
.tag .ic { width: 11px; height: 11px; stroke-width: 2.2; }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag .ic.solid { fill: currentColor; stroke-width: 1.2; }
.tag.top { gap: 3px; padding-left: 6px; } /* the star sits close to the words: one badge, not icon + label */
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }

/* ------------------------------------------------------------------ the agent's mark
   One mark, six styles. Which one is drawn is a FEATURE FLAG: Settings › Agent mark (the `agent_orb` setting), or
   AGENT_ORB in .env; see src/views/orb.ts. `.orb` is the box every style shares. The mark is still when the agent
   has spoken and alive while it works (.live). */
.orb { --s: 22px; display: inline-block; flex: none; width: var(--s); height: var(--s); position: relative; isolation: isolate; vertical-align: middle; }
.orb.sm { --s: 16px; } .orb.lg { --s: 44px; }

/* --- ember: the original mark and the default, kept as it was. Drawn here in CSS, so it is crisp at any size and can move:
   while it works its two colour layers turn against each other and the glow breathes. */
.orb.ember { border-radius: 50%; box-shadow: 0 0 0 var(--hair) rgba(165, 70, 50, .3), 0 1px 2px rgba(150, 60, 45, .12), 0 2px 10px -2px rgba(215, 105, 75, .45); }
.orb.ember i { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.orb.ember i::before, .orb.ember i::after { content: ""; position: absolute; inset: -34%; border-radius: 50%; }
.orb.ember i::before { background: radial-gradient(at 30% 28%, #f8cfab 0, transparent 46%), radial-gradient(at 74% 30%, #ee9a62 0, transparent 50%), radial-gradient(at 72% 76%, #a8404a 0, transparent 54%), radial-gradient(at 26% 76%, #d35f50 0, transparent 58%), #cd6351; }
.orb.ember i::after { background: radial-gradient(at 40% 36%, rgba(255, 238, 218, .5) 0, transparent 30%), radial-gradient(at 64% 68%, rgba(150, 52, 70, .3) 0, transparent 34%); }
.orb.ember::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 var(--hair) rgba(255, 255, 255, .3); }
.orb.ember.live { animation: orb-glow 2.6s ease-in-out infinite; }
.orb.ember.live i::before { animation: orb-turn 5.5s linear infinite; }
.orb.ember.live i::after { animation: orb-turn 3.4s linear infinite reverse; }
@keyframes orb-turn { to { transform: rotate(360deg); } }
@keyframes orb-glow { 50% { box-shadow: 0 0 0 var(--hair) rgba(165, 70, 50, .3), 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent), 0 2px 16px -1px rgba(215, 105, 75, .7); } }

/* --- the five alternates built from the LEG symbol (.orb.ob): titanium, garnet, obsidian, lantern, layered.
   The drawing is SVG (src/views/orb.ts: shapes and gradients once per page, each mark a few <use>s); motion, shadows
   and the light/dark differences are here. --fo (where the flame is anchored), --at (the ring's centre) and --ring
   (its outline, as a mask) come from a small <style> the page shell writes from the same geometry. */
.orb.ob { line-height: 0; }
.ob > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.ob svg * { transform-box: view-box; }
.ob .flick, .ob .ghost { transform-origin: var(--fo); }
.ob .turn { transform-origin: 50px 50px; }
.ob .opt { transform-origin: 50px 56px; }
.ob.round { border-radius: 50%; }
.ob-garnet { box-shadow: 0 0 0 .5px rgba(110, 30, 34, .5), 0 calc(var(--s) * .03) calc(var(--s) * .07) rgba(120, 38, 30, .22), 0 calc(var(--s) * .1) calc(var(--s) * .42) calc(var(--s) * -.08) rgba(214, 96, 62, .6); }
.ob-layered { box-shadow: 0 0 0 .5px rgba(150, 58, 44, .4), 0 calc(var(--s) * .03) calc(var(--s) * .07) rgba(120, 38, 30, .18), 0 calc(var(--s) * .1) calc(var(--s) * .4) calc(var(--s) * -.08) rgba(214, 104, 74, .55); }
.ob-lantern { box-shadow: 0 0 0 .5px rgba(165, 70, 50, .34), 0 calc(var(--s) * .03) calc(var(--s) * .07) rgba(150, 60, 45, .14), 0 calc(var(--s) * .1) calc(var(--s) * .42) calc(var(--s) * -.08) rgba(222, 112, 78, .6); }
.ob-obsidian { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .6), 0 calc(var(--s) * .03) calc(var(--s) * .08) rgba(20, 10, 6, .3), 0 calc(var(--s) * .12) calc(var(--s) * .4) calc(var(--s) * -.1) rgba(214, 96, 62, .5); }
/* optical sizes: below 44px the fine highlights go and the flame is drawn larger, so it stays a flame */
.ob:not(.lg) .fine, .ob:not(.lg) .ti-brush { display: none; }
.ob:not(.lg) .opt { transform: scale(1.2); }
.ob-lantern .opt { transform: scale(1.1); }
.ob-lantern:not(.lg) .opt { transform: scale(1.26); }
.ob:not(.lg) .fres { opacity: .55; }
/* titanium: the ring is a conic gradient (the bow-tie sheen of circular-brushed metal) masked to the ring's outline */
.ob-titanium { --gh: .16; }
/* the symbol is taller than it is wide, so it is drawn past its box to carry the same weight as a round mark */
.ob-titanium > svg, .ob-titanium .ti-sh { transform: scale(1.26); }
.ti-sh { position: absolute; inset: 0; filter: drop-shadow(0 calc(var(--s) * .012) calc(var(--s) * .012) rgba(40, 26, 18, .4)) drop-shadow(0 calc(var(--s) * .05) calc(var(--s) * .07) rgba(60, 36, 24, .22)); }
.ti-metal { position: absolute; inset: 0; overflow: hidden; -webkit-mask: var(--ring) 0 0 / 100% 100% no-repeat; mask: var(--ring) 0 0 / 100% 100% no-repeat;
  background: conic-gradient(from -50deg at var(--at), #eee7de 0deg, #c3b9ad 15deg, #978b7f 48deg, #7b7065 90deg, #9d9185 128deg, #cec4b9 165deg, #e2dad0 180deg, #b9aea2 197deg, #908478 232deg, #766b60 270deg, #978b7f 308deg, #c8beb2 345deg, #eee7de 360deg); }
.ti-brush { position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at var(--at), rgba(255, 255, 255, .045) 0deg 1.1deg, rgba(40, 28, 20, .03) 1.1deg 2.3deg); mix-blend-mode: overlay; }
/* the heat that travels round the ring while the agent works: ember red, to orange, to a white-hot leading edge */
.ti-heat { position: absolute; inset: 0; opacity: 0; transform-origin: var(--at); transition: opacity 1.3s ease;
  background: conic-gradient(from 0deg at var(--at), rgba(190, 60, 36, 0) 0deg, rgba(190, 60, 36, 0) 110deg, rgba(196, 66, 38, .34) 200deg, rgba(226, 92, 44, .72) 280deg, rgba(255, 150, 74, .92) 326deg, rgba(255, 214, 150, .97) 346deg, rgba(255, 244, 222, .96) 352deg, rgba(255, 244, 222, 0) 360deg); }
.ob-titanium .bloom { fill: #ee8a5c; opacity: .26; }
.ob-titanium .glow { opacity: .6; }
@media (prefers-color-scheme: dark) {
  .ob-titanium { --gh: .5; }
  .ob-titanium .bloom { fill: #f47c48; opacity: .5; }
  .ob-titanium .glow { opacity: .9; }
  /* black glass on a dark page: a slightly lighter body and a warm hairline keep the bead from disappearing */
  .ob-obsidian { box-shadow: 0 0 0 .5px rgba(255, 190, 150, .22), 0 calc(var(--s) * .12) calc(var(--s) * .42) calc(var(--s) * -.1) rgba(214, 96, 62, .5); }
  .ob-ob-b0 { stop-color: #3d2b24; } .ob-ob-b1 { stop-color: #271c18; } .ob-ob-b2 { stop-color: #191310; } .ob-ob-b3 { stop-color: #120d0b; }
}
/* motion, only while working. Every movement is scaled by --amp, which eases 0 to 1 when work starts and back when
   it ends, so the flame settles and the ring cools instead of snapping. At rest the animations are paused. */
@property --amp { syntax: '<number>'; inherits: true; initial-value: 0; }
.orb.ob { --amp: 0; transition: --amp 1.2s cubic-bezier(.3, .7, .3, 1); }
.orb.ob.live { --amp: 1; }
.ob .flick { animation: ob-flick 2.4s ease-in-out infinite paused; }
.ob .ghost { opacity: 0; animation: ob-ghost 1.7s ease-in-out infinite paused; }
.ob .core { animation: ob-core 1.3s ease-in-out infinite paused; }
.ob .breathe { animation: ob-breathe 2.6s ease-in-out infinite paused; }
.ob .turn { animation: ob-spin 6s linear infinite paused; }
.ob .turn.rev { animation: ob-spin 4s linear infinite reverse paused; }
.ob .float { animation: ob-float 3.2s ease-in-out infinite paused; }
.ob .ti-heat { animation: ob-spin 2.6s linear infinite paused; }
.ob.round { animation: ob-glow 2.6s ease-in-out infinite paused; }
.ob.live, .ob.live .flick, .ob.live .ghost, .ob.live .core, .ob.live .breathe, .ob.live .turn, .ob.live .float, .ob.live .ti-heat { animation-play-state: running; }
.ob.live .ti-heat { opacity: 1; }
.ob-lantern { --gh: .7; }
@keyframes ob-spin { to { transform: rotate(360deg); } }
@keyframes ob-flick { 0%, 100% { transform: none; }
  17% { transform: scale(calc(1 + .015 * var(--amp)), calc(1 + .04 * var(--amp))) skewX(calc(-1.5deg * var(--amp))); }
  36% { transform: scale(calc(1 - .012 * var(--amp)), calc(1 - .025 * var(--amp))) skewX(calc(1deg * var(--amp))); }
  55% { transform: scale(calc(1 + .01 * var(--amp)), calc(1 + .03 * var(--amp))) skewX(calc(-.7deg * var(--amp))); }
  77% { transform: scale(calc(1 - .006 * var(--amp)), calc(1 - .012 * var(--amp))) skewX(calc(.8deg * var(--amp))); } }
@keyframes ob-ghost { 0%, 100% { transform: scale(1.03, 1.06); opacity: calc(var(--gh, .5) * .7 * var(--amp)); } 40% { transform: scale(.97, 1.1) skewX(2.5deg); opacity: calc(var(--gh, .5) * var(--amp)); } 70% { transform: scale(1.04, .98) skewX(-2deg); opacity: calc(var(--gh, .5) * .55 * var(--amp)); } }
@keyframes ob-core { 0%, 100% { opacity: 1; } 45% { opacity: calc(1 - .18 * var(--amp)); } 70% { opacity: calc(1 - .05 * var(--amp)); } }
@keyframes ob-breathe { 50% { opacity: calc(1 - .36 * var(--amp)); } }
@keyframes ob-float { 50% { transform: translateY(calc(-.9px * var(--amp))); } }
@keyframes ob-glow { 0%, 100% { filter: brightness(calc(1 + .03 * var(--amp))); } 50% { filter: brightness(calc(1 + .09 * var(--amp))) saturate(calc(1 + .08 * var(--amp))); } }
/* Settings › Agent mark: the six styles as a picker */
.orb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-width: 860px; }
.orb-opt { display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; column-gap: 14px; padding: 14px 16px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow var(--d-fast), background var(--d-fast); }
.orb-opt:hover { background: var(--fill-1); }
.orb-opt:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); }
.orb-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.orb-opt input { position: absolute; opacity: 0; pointer-events: none; }
.orb-opt .orb { justify-self: center; }
.orb-opt b { display: block; font-weight: 600; font-size: 13.5px; }
.orb-opt small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.orb-pick-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 6px; }

/* ------------------------------------------------------------------ page structure */
.crumbs { display: flex; align-items: center; gap: 6px; padding-top: 28px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 3px; margin-left: -6px; padding: 3px 8px 3px 4px; border-radius: var(--r-sm); transition: color var(--d-fast), background var(--d-fast); }
.crumbs a:hover { color: var(--fg); background: var(--fill-1); }
.crumbs a:hover .ic { transform: translateX(-2px); }
.crumbs .ic { width: 15px; height: 15px; color: var(--faint); transition: transform var(--d-spring) var(--spring); }
.crumbs a { max-width: 100%; min-width: 0; }
.crumbs a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .ic { flex: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; padding: 44px 0 24px; }
.crumbs + .page-head { padding-top: 12px; }
.page-head > .ph-text { display: grid; gap: 8px; min-width: 0; flex: 1 1 480px; }
.page-head .sub { font-size: 15px; color: var(--muted); max-width: 68ch; letter-spacing: -.006em; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.section { padding-top: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; min-height: 32px; padding-bottom: 12px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.section-head .meta, .meta { font-size: 12.5px; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0 64px; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
.narrow { max-width: 620px; }
.stack { display: grid; gap: 18px; padding-top: 20px; }

/* underline tabs with a sliding indicator; segmented filters with a sliding thumb */
.tabs { position: relative; display: flex; gap: 26px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > a, .tabs > button { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0; font: inherit; font-size: 14px; font-weight: 550; letter-spacing: -.006em; color: var(--muted); background: none; border: 0; cursor: pointer; white-space: nowrap; transition: color var(--d-fast); }
.tabs > a:hover, .tabs > button:hover { color: var(--fg); }
.tabs > .on, .tabs > [aria-selected="true"] { color: var(--fg); }
.tabs:not(.has-ind) > [aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--fg); border-radius: 2px 2px 0 0; }
.tab-ind { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--w, 0); transform: translateX(var(--x, 0)); background: var(--fg); border-radius: 2px 2px 0 0; pointer-events: none; transition: transform var(--d-spring) var(--spring), width var(--d-spring) var(--spring); }
.count { font-size: 11.5px; font-weight: 600; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--fill-2); color: var(--muted); font-variant-numeric: tabular-nums; transition: background var(--d), color var(--d); }
.on .count, [aria-selected="true"] .count { background: var(--fill-3); color: var(--fg); }
.seg { display: inline-flex; padding: 3px; gap: 1px; border-radius: 11px; background: var(--fill-2); overflow-x: auto; scrollbar-width: none; max-width: 100%; isolation: isolate; }
.seg::-webkit-scrollbar { display: none; }
.seg > :is(a, button) { border: 0; background: none; font-family: inherit; cursor: pointer; position: relative; z-index: 0; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--fg-2); white-space: nowrap; transition: color var(--d-fast), opacity var(--d-fast); }
.seg > :is(a, button):not(.on):hover { color: var(--fg); }
.seg > :is(a, button):not(.on):active { opacity: .6; }
.seg > :is(a, button).on { color: var(--fg); font-weight: 550; }
.seg.sm { padding: 2px; border-radius: 9px; }
.seg.sm > :is(a, button) { height: 26px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.seg.sm .seg-thumb { border-radius: 7px; }
.seg-thumb { position: absolute; inset: 0; z-index: -1; border-radius: 8px; background: var(--bg); box-shadow: var(--shadow-thumb); }
@media (prefers-color-scheme: dark) { .seg-thumb { background: var(--fill-3); } }
.seg a .n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.seg a.on .n { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 0 0 20px; }
.toolbar .searchbox { width: min(300px, 100%); }
/* column filters under the toolbar: quiet pills that turn accent when set */
.inv-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 20px; }
.inv-filters select { width: auto; height: 30px; font-size: 13px; padding: 0 30px 0 12px; border-radius: 999px; background-color: var(--fill-1); box-shadow: none; color: var(--muted); background-position: right 9px center; background-size: 14px; }
.inv-filters select:hover { background-color: var(--fill-2); box-shadow: none; }
.inv-filters select:focus { box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
.inv-filters select.on { color: var(--accent-text); background-color: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 500; }
.inv-filters .linkbtn { font-size: 13px; margin-left: 4px; }

/* ------------------------------------------------------------------ tables: rows with an inset rounded highlight */
.tbl-wrap { overflow-x: auto; margin-inline: -12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 0 14px 10px; white-space: nowrap; }
td { padding: 14px 14px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 12px; }
th:last-child, td:last-child { padding-right: 12px; }
td.r, th.r { text-align: right; white-space: nowrap; }
/* hairlines are drawn per cell so they can stop 12px short at each end and vanish around the hovered row */
th, td { background-image: linear-gradient(var(--line), var(--line)); background-repeat: no-repeat; background-size: 100% var(--hair); background-position: 0 100%; }
:is(th, td):first-child { background-size: calc(100% - 12px) var(--hair); background-position: 100% 100%; }
:is(th, td):last-child { background-size: calc(100% - 12px) var(--hair); background-position: 0 100%; }
:is(th, td):only-child { background-size: calc(100% - 24px) var(--hair); background-position: 50% 100%; }
tbody tr:last-child td { background-image: none; }
tr.click { cursor: pointer; }
tr.click td { transition: background-color 90ms; }
/* The highlight's rounded ends are cut into the end cells with corner masks in the page colour. Rounding or
   layering the cells themselves makes Chrome drop or double their half-pixel hairline on retina screens. */
tr.click:is(:hover, :has(.rowlink:focus-visible)) td { background-color: var(--fill-1); background-image: none; }
tr.click:active td { background-color: var(--fill-2); }
tr.click:is(:hover, :has(.rowlink:focus-visible)) td:is(:first-child, :last-child) { background-size: var(--r) var(--r); --cut: transparent calc(var(--r) - .5px), var(--bg) var(--r); }
tr.click:is(:hover, :has(.rowlink:focus-visible)) td:first-child { background-image: radial-gradient(circle at 100% 100%, var(--cut)), radial-gradient(circle at 100% 0, var(--cut)); background-position: 0 0, 0 100%; }
tr.click:is(:hover, :has(.rowlink:focus-visible)) td:last-child { background-image: radial-gradient(circle at 0 100%, var(--cut)), radial-gradient(circle at 0 0, var(--cut)); background-position: 100% 0, 100% 100%; }
tr.click:is(:hover, :has(.rowlink:focus-visible)) td:only-child { background-image: radial-gradient(circle at 100% 100%, var(--cut)), radial-gradient(circle at 100% 0, var(--cut)), radial-gradient(circle at 0 100%, var(--cut)), radial-gradient(circle at 0 0, var(--cut)); background-position: 0 0, 0 100%, 100% 0, 100% 100%; }
tr:has(+ tr.click:hover) td, thead:has(+ tbody > tr.click:first-child:hover) th { background-image: none; }
.rowlink { font-weight: 550; color: var(--fg); letter-spacing: -.006em; }
.cell-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
tfoot td { background-image: linear-gradient(var(--line), var(--line)); background-position: 50% 0; padding-top: 14px; }
.inline-note { font-size: 12px; color: var(--faint); padding-top: 16px; }

/* ------------------------------------------------------------------ empty, banners, skeletons */
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 88px 16px; color: var(--muted); }
.empty-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--fill-1); color: var(--muted); margin-bottom: 8px; }
.empty-ic .ic { width: 22px; height: 22px; stroke-width: 1.5; }
.empty-orb { display: block; margin-bottom: 14px; line-height: 0; }
.empty h2 { font-size: 17px; }
.empty p { max-width: 44ch; font-size: 14px; }
.empty .btn { margin-top: 12px; }
.banner { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--warn-soft); color: var(--fg); font-size: 13.5px; }
.banner > .btn { margin: -5px 0 -5px auto; flex: none; }
.banner .ic { color: var(--warn); margin-top: 2px; }
.banner.bad { background: var(--bad-soft); } .banner.bad .ic { color: var(--bad); }
.banner .linkbtn { margin-left: 4px; }
.skel { display: block; border-radius: 6px; background: linear-gradient(100deg, var(--fill-1) 35%, var(--fill-3) 50%, var(--fill-1) 65%) 0 0 / 220% 100%; animation: skel 1.7s ease-in-out infinite; }
@keyframes skel { from { background-position: 120% 0; } to { background-position: -100% 0; } }

/* ------------------------------------------------------------------ floating: tooltip, popover menu, toasts, dialogs, palette */
.tip { position: fixed; z-index: 120; left: 0; top: 0; pointer-events: none; display: flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 8px; background: var(--hud-bg); color: var(--hud-fg); font-size: 12px; font-weight: 500; line-height: 1.35; white-space: nowrap; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 4px 14px -2px rgba(0, 0, 0, .22); opacity: 0; scale: .94; transition: opacity 110ms ease, scale var(--d-spring) var(--spring); }
.tip.show { opacity: 1; scale: 1; }
.tip kbd { color: rgba(255, 255, 255, .78); background: rgba(255, 255, 255, .14); box-shadow: none; padding: 2px 5px; min-width: 17px; }
.menu-btn { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 7px 0 10px; border: 0; border-radius: 14px; background: var(--fill-2); color: var(--fg); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background var(--d-fast), transform var(--d-spring) var(--spring), opacity var(--d-fast); }
.menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--fill-3); }
.menu-btn:active { transform: scale(.96); }
.menu-btn .ic { width: 13px; height: 13px; color: var(--muted); stroke-width: 2; margin-left: auto; transition: transform var(--d-spring) var(--spring); }
.menu-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.menu-btn.is-saving { opacity: .55; pointer-events: none; }
.menu-btn.quiet { background: transparent; color: var(--fg-2); padding: 0 6px 0 8px; gap: 6px; justify-self: start; }
.menu-btn.quiet .ic { margin-left: 0; opacity: .55; transition: transform var(--d-spring) var(--spring), opacity var(--d-fast); }
.menu-btn.quiet:hover, .menu-btn.quiet[aria-expanded="true"] { background: var(--fill-2); color: var(--fg); }
.menu-btn.quiet:hover .ic, .menu-btn.quiet[aria-expanded="true"] .ic { opacity: 1; }
select[data-menu].enhanced { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; padding: 0; }
.pop { position: fixed; z-index: 110; left: 0; top: 0; min-width: 180px; max-height: min(360px, calc(100vh - 24px)); overflow-y: auto; opacity: 0; scale: .94; transition: opacity 100ms ease, scale 100ms ease; }
.pop.show { opacity: 1; scale: 1; transition: opacity 90ms ease, scale var(--d-spring) var(--spring); }
.pop-item { display: grid; grid-template-columns: 16px auto 1fr; align-items: center; gap: 9px; height: 32px; padding: 0 12px 0 8px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--fg); cursor: pointer; white-space: nowrap; user-select: none; }
.pop-item .ic { width: 14px; height: 14px; stroke-width: 2.4; color: var(--accent-text); opacity: 0; }
.pop-item[aria-selected="true"] .ic { opacity: 1; }
.pop-item[data-active] { background: var(--fill-2); }
.pop-item .dot { justify-self: center; }
.toasts { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 130; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px)); padding: 9px 16px 9px 10px; border-radius: 22px; background: var(--hud-bg); color: var(--hud-fg); font-size: 13.5px; font-weight: 500; line-height: 1.4; letter-spacing: -.003em; backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .12); pointer-events: auto; cursor: default; animation: toast-in var(--d-bouncy) var(--spring-bouncy) both; }
.toast .t-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #34a065; color: #fff; }
.toast.bad .t-ic { background: #e5534b; }
.toast .t-ic .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.toast.out { animation: toast-out 180ms var(--ease-io) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }
dialog { color: var(--fg); }
.dlg, .palette { border: 0; padding: 0; background: var(--bg); box-shadow: var(--shadow-pop), 0 30px 80px -20px rgba(20, 14, 8, .35); opacity: 0; transform: scale(.96) translateY(10px); transition: opacity 130ms ease, transform 160ms var(--ease-io), overlay 160ms allow-discrete, display 160ms allow-discrete; }
.dlg { border-radius: var(--r-xl); width: min(440px, calc(100vw - 32px)); }
:is(.dlg, .palette)[open] { opacity: 1; transform: none; transition: opacity 140ms ease, transform var(--d-spring) var(--spring), overlay var(--d-spring) allow-discrete, display var(--d-spring) allow-discrete; }
@starting-style { :is(.dlg, .palette)[open] { opacity: 0; transform: scale(.96) translateY(10px); } }
:is(.dlg, .palette)::backdrop { background: rgba(24, 18, 12, 0); transition: background 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete; }
:is(.dlg, .palette)[open]::backdrop { background: rgba(24, 18, 12, .3); }
@starting-style { :is(.dlg, .palette)[open]::backdrop { background: rgba(24, 18, 12, 0); } }
.confirm { width: min(380px, calc(100vw - 32px)); }
.confirm h2 { font-size: 17px; }
.confirm p { font-size: 14px; margin-top: -8px; }
.confirm .form-actions { padding-top: 6px; }
.confirm .btn.danger { background-color: var(--bad); color: #fff; }
.confirm .btn.danger:hover { background-color: color-mix(in srgb, var(--bad) 88%, #000); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 14px 14px 22px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.dlg-b { padding: 20px 22px 22px; display: grid; gap: 16px; }
.keys { margin: 0; padding: 6px 22px 14px; display: grid; }
.keys div { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); font-size: 13.5px; }
.keys div:last-child { box-shadow: none; }
.keys dd { margin: 0; color: var(--fg-2); }
.keys dt { display: flex; gap: 4px; order: 2; }
/* command palette */
.palette { margin-top: min(16vh, 140px); width: min(640px, calc(100vw - 24px)); border-radius: var(--r-xl); background: var(--pop-bg); backdrop-filter: blur(40px) saturate(180%); -webkit-backdrop-filter: blur(40px) saturate(180%); overflow: hidden; }
.pal-search { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px; height: 58px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.pal-search .ic { width: 19px; height: 19px; color: var(--muted); }
.pal-search input { flex: 1; height: 100%; padding: 0; border: 0; box-shadow: none !important; background: transparent; font-size: 17px; letter-spacing: -.012em; border-radius: 0; }
.pal-list { max-height: min(420px, 52vh); overflow-y: auto; padding: 6px 8px 8px; overscroll-behavior: contain; scroll-padding-block: 36px 8px; }
.pal-group { padding: 10px 12px 5px; font-size: 12px; font-weight: 550; color: var(--muted); }
.pal-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px; padding: 6px 12px 6px 8px; border-radius: var(--r); cursor: pointer; user-select: none; scroll-margin-block: 4px; }
.pal-item[aria-selected="true"] { background: var(--fill-2); }
.pal-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--fill-2); color: var(--fg-2); transition: background var(--d-fast), color var(--d-fast); }
.pal-item[aria-selected="true"] .pal-ic { background: var(--accent); color: var(--accent-fg); }
.pal-ic .ic { width: 15px; height: 15px; }
.pal-t { font-size: 14.5px; font-weight: 500; letter-spacing: -.008em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-t mark { background: none; color: inherit; font-weight: 700; }
.pal-s { font-size: 12.5px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.pal-item .ret { opacity: 0; transition: opacity var(--d-fast); }
.pal-item[aria-selected="true"] .ret { opacity: 1; }
.pal-empty { padding: 36px 16px 40px; text-align: center; color: var(--muted); font-size: 14px; }
.pal-foot { display: flex; align-items: center; gap: 18px; padding: 9px 16px; font-size: 12px; color: var(--muted); box-shadow: inset 0 var(--hair) 0 var(--line); }
.pal-foot span { display: inline-flex; align-items: center; gap: 5px; }
.pal-foot .pal-status { margin-left: auto; }

/* ------------------------------------------------------------------ investigations list */
.inv-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; font-size: 14.5px; }
.who-cell { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--fg-2); }
.mini-av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--fill-2); color: var(--fg-2); font-size: 9.5px; font-weight: 650; letter-spacing: .02em; flex: none; }
/* owner first (accent ring), then the people it's shared with, overlapping; +N past the first few */
.mini-av.own { background: var(--accent-soft); color: var(--accent-text); }
.mini-av.more { font-size: 9px; color: var(--muted); }
.faces { display: inline-flex; align-items: center; vertical-align: middle; }
.faces .mini-av { box-shadow: 0 0 0 2px var(--bg); }
.faces .mini-av + .mini-av { margin-left: -6px; }
.toolbar-l { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; min-width: 0; }
.empty .btn + .btn { margin-left: 8px; }

/* ------------------------------------------------------------------ sharing */
.share-btn .faces { margin-right: 2px; }
.share-btn .faces .mini-av { width: 20px; height: 20px; font-size: 8.5px; box-shadow: 0 0 0 2px var(--bg); }
.share-dlg { width: min(520px, calc(100vw - 32px)); }
.dlg.instant, .dlg.instant::backdrop { transition: none; }
.share-add { display: flex; gap: 8px; }
.share-add select { flex: 1; min-width: 0; }
.members { list-style: none; margin: 0; padding: 0; display: grid; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.member + .member { box-shadow: inset 0 var(--hair) 0 var(--line); }
.member .mini-av { width: 30px; height: 30px; font-size: 11px; }
.member-t { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 14px; }
.member-t b { font-weight: 550; }
.member-t .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-a { display: flex; align-items: center; gap: 4px; flex: none; }

/* ------------------------------------------------------------------ activity log */
.log-filter select { min-width: 220px; }
.pager { display: flex; justify-content: flex-end; margin-top: 16px; }
a.who-cell { text-decoration: none; }
a.who-cell:hover { color: var(--fg); }

/* ------------------------------------------------------------------ new investigation */
.compose { max-width: 820px; }
.need { border-radius: var(--r-xl); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow var(--d) var(--ease-out), background var(--d); }
.need:hover { box-shadow: inset 0 0 0 1px var(--line-3); }
.need:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
.need.over { box-shadow: inset 0 0 0 2px var(--accent), var(--ring); background: var(--accent-soft); }
.need textarea { box-shadow: none !important; background: transparent; font-size: 17px; line-height: 1.5; letter-spacing: -.012em; padding: 20px 22px 10px; min-height: 132px; resize: none; border-radius: var(--r-xl); display: block; }
.need-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 12px 14px; flex-wrap: wrap; }
.need-bar .note { flex: 1; min-width: 160px; }
.thumb { display: inline-flex; align-items: center; gap: 8px; padding: 3px 4px 3px 3px; border-radius: var(--r); background: var(--fill-2); font-size: 12.5px; color: var(--fg-2); max-width: 280px; animation: pop-up var(--d-bouncy) var(--spring-bouncy); }
@keyframes pop-up { from { opacity: 0; transform: scale(.8); } }
.thumb img { width: 30px; height: 30px; border-radius: var(--r-sm); object-fit: cover; }
.thumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb .icon-btn { width: 24px; height: 24px; }
.thumb-open { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: zoom-in; border-radius: var(--r-sm); }
.thumb-open img { transition: transform var(--d-spring) var(--spring); }
.thumb-open:hover img { transform: scale(1.06); }
.thumb-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb img.lb-src { visibility: hidden; }
.compose .section { padding-top: 40px; }
.compose .section-head { box-shadow: none; padding-bottom: 6px; }
.submit-bar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding-top: 28px; margin-top: 32px; box-shadow: inset 0 var(--hair) 0 var(--line); }
.submit-bar .note { flex: 1; min-width: 220px; }

/* ------------------------------------------------------------------ investigation workspace */
.ws-head { display: flex; gap: 16px 32px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 12px 0 0; }
.ws-head .ph-text { flex: 1 1 560px; min-width: 0; display: grid; gap: 14px; }
.ws-head h1 { max-width: 780px; font-size: 26px; line-height: 1.2; }
.ws-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 13.5px; color: var(--muted); }
.ws-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ws-meta .ic { width: 14px; height: 14px; color: var(--faint); }
.ws-head .actions { display: flex; gap: 8px; padding-top: 2px; }

/* request details */
.req { margin-top: 26px; box-shadow: inset 0 var(--hair) 0 var(--line); }
.req-head { display: flex; align-items: center; gap: 12px; }
.req-head h2 { flex: 1; min-width: 0; font-size: 13px; font-weight: inherit; letter-spacing: 0; }
.req-toggle { display: grid; grid-template-columns: 22px auto minmax(0, 1fr); column-gap: 18px; align-items: center; width: 100%; height: 48px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--r-sm); }
.req-toggle > .ic { justify-self: center; width: 14px; height: 14px; color: var(--faint); stroke-width: 2; transition: transform var(--d-spring) var(--spring), color var(--d-fast); }
.req-toggle .t { font-size: 13px; font-weight: 600; color: var(--fg-2); letter-spacing: -.003em; transition: color var(--d-fast); }
.req-toggle:hover .t { color: var(--fg); } .req-toggle:hover > .ic { color: var(--fg-2); }
.req-sum { min-width: 0; font-size: 13px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--d) ease; }
.req[data-open="1"] .req-toggle > .ic, .req[data-editing] .req-toggle > .ic { transform: rotate(90deg); }
.req[data-open="1"] .req-sum, .req[data-editing] .req-sum { opacity: 0; }
.req[data-editing] .req-toggle { pointer-events: none; }
.req-head .meta { display: inline-flex; gap: 10px; align-items: center; flex: none; }
#save-state { transition: opacity var(--d); }
.req-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; padding: 0 0 18px 40px; }
.req-body.has-photo { grid-template-columns: minmax(0, 1fr) 132px; }
.props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 -10px; }
.prop { display: grid; gap: 2px; align-content: start; text-align: left; padding: 8px 10px; margin: 0; border: 0; background: none; font: inherit; color: inherit; border-radius: var(--r); cursor: pointer; min-width: 0; transition: background var(--d-fast), transform var(--d-spring) var(--spring); }
.prop:hover, .prop-long:hover { background: var(--fill-1); }
.prop:active, .prop-long:active { background: var(--fill-2); transform: scale(.985); }
.prop .k { font-size: 12px; color: var(--muted); }
.prop .v { font-size: 14px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prop .v .muted { font-size: 13px; }
.prop .add { color: var(--faint); transition: color var(--d-fast); }
.prop:hover .add { color: var(--accent-text); }
.prop-long { display: grid; grid-template-columns: calc(25% - 11px) minmax(0, 1fr); gap: 2px 16px; padding: 7px 10px; margin: 0 -10px; border-radius: var(--r); text-align: left; width: calc(100% + 20px); border: 0; background: none; font: inherit; color: inherit; cursor: pointer; transition: background var(--d-fast), transform var(--d-spring) var(--spring); }
.prop-long .k { font-size: 12px; color: var(--muted); padding-top: 2px; }
.prop-long .v { font-size: 14px; line-height: 1.55; max-width: 96ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.longs { box-shadow: inset 0 var(--hair) 0 var(--line); margin-top: 8px; padding-top: 6px; }
.orig { margin: 0 -10px; padding: 7px 10px; display: grid; grid-template-columns: calc(25% - 11px) minmax(0, 1fr); gap: 2px 16px; }
.orig .k { font-size: 12px; color: var(--muted); padding-top: 2px; }
.orig .v { font-size: 13.5px; color: var(--muted); line-height: 1.55; max-width: 96ch; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.orig .v.full { -webkit-line-clamp: unset; display: block; cursor: auto; }
.req-photo { display: block; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-sunken); align-self: start; margin-top: 8px; transition: transform var(--d-spring) var(--spring), opacity var(--d-fast); }
.req-photo:hover { transform: scale(1.02); }
.req-photo img { width: 100%; height: 132px; object-fit: cover; display: block; }
.req-photo.lb-src { visibility: hidden; } /* the viewer's copy is standing in for it */
/* several photos: a tight grid in the same column, the first one large when there are three */
.req-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; align-self: start; margin-top: 8px; }
.req-photos .req-photo { margin: 0; border-radius: var(--r); }
.req-photos .req-photo img { height: 64px; }
.req-photos.n3 .req-photo:first-child { grid-column: 1 / -1; } .req-photos.n3 .req-photo:first-child img { height: 132px; }
.req-photos.n2 .req-photo img { height: 132px; }
.tpl { padding: 0 0 20px 40px; }
.tgroup { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px 24px; padding: 18px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.tgroup:first-child { padding-top: 6px; }
.tgroup h3 { font-size: 13px; color: var(--fg); padding-top: 28px; }
.tgroup .fields { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }

/* request form: a 12-column grid per group, every row ending flush (spans in investigations.ts requestForm).
   Each field: label row (with its changed mark, a hint or a counter), the control, then one note line that
   carries its help or its problem. */
.tfields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 16px; }
.tf { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tf.s3 { grid-column: span 3; } .tf.s4 { grid-column: span 4; } .tf.s5 { grid-column: span 5; } .tf.s6 { grid-column: span 6; } .tf.s8 { grid-column: span 8; } .tf.s12 { grid-column: 1 / -1; }
.tf-l { display: flex; align-items: baseline; gap: 8px; min-height: 18px; font-size: 12.5px; font-weight: 500; color: var(--fg-2); }
.tf-l label, .tf-lbl { display: inline-flex; align-items: baseline; gap: 7px; }
.tf-req { font-size: 11.5px; font-weight: 400; color: var(--faint); }
.tf.changed .tf-l label::after, .tf.changed .tf-lbl::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); align-self: center; }
.tf-rel, .tf-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-rel.past { color: var(--warn); } .tf-count.bad { color: var(--bad); }
.tf-note { margin: -1px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.tf-note:empty { display: none; }
.tf-note.bad { color: var(--bad); font-weight: 500; }
.tf [aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--bad); background-color: var(--bad-soft); }
.tf [aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1.5px var(--bad), 0 0 0 3.5px color-mix(in srgb, var(--bad) 20%, transparent); }
.tpl textarea { padding-block: 7.5px; }               /* one line of text is exactly an input's height */
.tpl input:disabled { background: var(--fill-1); box-shadow: none; cursor: not-allowed; }
.tpl input:disabled::placeholder { color: var(--faint); }
[data-num] { font-variant-numeric: tabular-nums; }
/* number with a unit beside it: quantity + unit, $ price per unit */
.pair { display: flex; align-items: center; gap: 8px; }
.pair > input, .pair > .affix { flex: 1 1 0; min-width: 0; }
.pair > input:is([name=unit], [name=quoted_unit]) { flex: 0 1 42%; }
.pair-mid { flex: none; font-size: 13px; color: var(--muted); }
.affix { position: relative; display: block; }
.affix .pre { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }
.affix input { padding-left: 25px; }
/* urgency: three choices, one tap */
.choices { display: inline-flex; align-self: start; gap: 2px; padding: 3px; border-radius: 11px; background: var(--fill-2); }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: color var(--d-fast), background var(--d-fast), box-shadow var(--d-fast); }
.choice:hover span { color: var(--fg); }
.choice input:checked + span { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-thumb); }
.choice input[value=Urgent]:checked + span { color: var(--warn); }
.choice input[value=Emergency]:checked + span { color: var(--bad); }
.choice input:focus-visible + span { box-shadow: var(--shadow-thumb), var(--ring); }
/* ISN: a switch with what it does written beside it */
.switch.sw-card { position: relative; display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--fill-1); box-shadow: none; }
.switch.sw-card input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sw { flex: none; position: relative; width: 34px; height: 20px; margin-top: 1px; border-radius: 10px; background: var(--fill-3); transition: background var(--d-fast), box-shadow var(--d-fast); }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .22); transition: transform var(--d) var(--ease-out); }
.sw-card input:checked + .sw { background: var(--accent); }
.sw-card input:checked + .sw::after { transform: translateX(14px); }
.sw-card input:focus-visible + .sw { box-shadow: var(--ring); }
.sw-t { display: grid; gap: 2px; font-size: 13.5px; line-height: 1.4; }
.sw-t b { font-weight: 550; color: var(--fg); }
.sw-t > span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
/* save bar: stays on screen while the form is taller than it */
#tpl-wrap > .collapse-in { overflow: clip; }          /* clip, not hidden: hidden would stop the bar sticking */
.tpl-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: inset 0 var(--hair) 0 var(--line); }
.tpl-state { min-width: 0; font-size: 12.5px; color: var(--muted); }
.tpl-state.on { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-2); font-weight: 500; }
.tpl-state.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
@media (max-width: 1100px) {
  .tfields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tf.m3 { grid-column: span 3; } .tf.m6 { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .tfields { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tf.m3, .tf.m6 { grid-column: 1 / -1; }
  .choices { align-self: stretch; } .choice { flex: 1; } .choice span { width: 100%; justify-content: center; padding: 0 8px; }
  .tpl-state:not(.on) { display: none; }
}

/* workspace tabs (sticky under the app bar) + panels */
.ws-tabs { margin: 0 -12px 0; padding-inline: 12px; position: sticky; top: calc(var(--bar) + env(safe-area-inset-top)); z-index: 12; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: none; }
.ws-tabs::before, .ws-tabs::after { content: ""; position: absolute; left: 12px; right: 12px; height: 1px; background: var(--line); transform: scaleY(var(--hair-scale, 1)); pointer-events: none; }
.ws-tabs::before { top: 0; transform-origin: 0 0; } .ws-tabs::after { bottom: 0; transform-origin: 0 100%; }
.panel { padding-top: 24px; }
.panel.entering { animation: panel-in 360ms var(--ease-out) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }
.panel-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; min-height: 32px; }

/* the agent's note, on its own tab: its mark in the margin, a byline, then the text in full. The mark and
   the step dots share the margin. */
.brief { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 18px; align-items: start; padding: 4px 0 2px; }
.brief > .orb, .brief > .brief-ic { grid-column: 1; grid-row: 1; }
.brief > :not(.orb, .brief-ic) { grid-column: 2; }
.brief > .steps, .brief > #agentlog { grid-column: 1 / -1; }
.brief-ic { width: 22px; height: 22px; display: grid; place-items: center; color: var(--bad); }
.brief-ic .ic { width: 18px; height: 18px; }
.brief-h { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-height: 22px; font-size: 13px; line-height: 1.4; }
.brief-h b { font-weight: 600; color: var(--fg); letter-spacing: -.004em; }
.brief-meta, .run-stats { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.brief-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-3); flex: none; }
.log-toggle { margin: 0 -4px 0 auto; padding: 3px 4px 3px 8px; gap: 3px; font-size: 12.5px; transition: color var(--d-fast), background var(--d-fast); }
.log-toggle:hover { text-decoration: none; background: var(--fill-1); }
.log-toggle .ic { width: 13px; height: 13px; stroke-width: 2; transition: transform var(--d-spring) var(--spring); }
.log-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }
/* Measure: 34em is about 72 characters of Inter at this size: inside the 50-75 range readability research recommends
   (Bringhurst, Baymard) and under WCAG 1.4.8's 80. Sized in em so it holds if the text size changes. */
.brief-body { margin-top: 8px; font-size: 15px; max-width: 34em; display: flex; flex-direction: column; }
/* one column: lead and context, the call order, then the closing advice */
.bb-text, .bb-outro { display: contents; }
.bb-text > * { order: 1; } .bb-list { order: 2; } .bb-outro > * { order: 3; }
.bb-outro > :first-child { margin-top: 12px; }
.brief-lead { font-size: 1.0667em; line-height: 1.5; font-weight: 600; color: var(--fg); letter-spacing: -.012em; text-wrap: pretty; }
.brief-p { font-size: 1em; line-height: 1.65; color: var(--fg-2); letter-spacing: -.004em; margin-top: 6px; }
.brief-lead + .brief-p { margin-top: 4px; }
.brief-list-h { margin-top: 16px; font-size: 12px; font-weight: 600; color: var(--muted); }
.brief-list { list-style: none; counter-reset: bl; margin: 6px 0 4px; padding: 0; display: grid; }
.brief-list li { counter-increment: bl; display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; padding: 6px 0; font-size: 1em; line-height: 1.55; color: var(--fg-2); box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.brief-list li:last-child { box-shadow: none; }
.brief-list li::before { content: counter(bl); width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--fg-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.brief-list li:first-child::before { background: var(--accent-soft); color: var(--accent-text); }
.bi-name { border: 0; padding: 0; background: none; font: inherit; font-weight: 600; color: var(--fg); cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color var(--d-fast), text-decoration-color var(--d-fast); border-radius: 3px; }
.bi-name:hover { color: var(--accent-text); text-decoration-color: currentColor; }
.opt.flash > .opt-row { animation: flash 1.4s ease-out; }
@keyframes flash { 0%, 30% { background: var(--accent-soft); } }
.brief-err { margin-top: 4px; font-size: 13px; color: var(--bad); max-width: 84ch; }
.spinner { width: 15px; height: 15px; border-radius: 50%; flex: none; background: conic-gradient(from 0deg, transparent 12%, var(--accent)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.2px), #000 calc(100% - 2px)); animation: spin .8s linear infinite; }
.btn .spinner { background: conic-gradient(from 0deg, transparent 12%, currentColor); }
.shimmer { background: linear-gradient(90deg, var(--fg) 0%, var(--fg) 38%, var(--faint) 50%, var(--fg) 62%, var(--fg) 100%) 0 0 / 240% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shimmer 2.4s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* folded groups in the timeline */
.agentlog { margin-top: 6px; }
.agentlog > summary { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); cursor: pointer; list-style: none; border-radius: var(--r-xs); margin-left: -4px; padding: 3px 8px 3px 4px; transition: color var(--d-fast), background var(--d-fast); }
.agentlog > summary::-webkit-details-marker { display: none; }
.agentlog > summary:hover { color: var(--fg); background: var(--fill-1); }
.agentlog > summary .ic { width: 14px; height: 14px; transition: transform var(--d-spring) var(--spring); }
.agentlog[open] > summary .ic { transform: rotate(90deg); }
/* what the agent did, step by step: dots run down the margin under its mark */
.steps { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; font-size: 13px; color: var(--fg-2); max-width: 820px; }
.steps li { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 18px; padding: 4.5px 0; align-items: baseline; }
.steps li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); justify-self: center; transform: translateY(-1px); position: relative; z-index: 1; outline: 3px solid var(--bg); }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 10.5px; top: 17px; bottom: -9px; width: 1px; background: var(--line); }
.steps li.search::before, .steps li.fetch::before { background: var(--muted); }
.steps li.candidate::before, .steps li.done::before { background: var(--ok); }
.steps li.error { color: var(--bad); } .steps li.error::before { background: var(--bad); }
.steps li.live { color: var(--fg); }
.steps li.live::before { background: var(--accent); animation: breathe 1.8s ease-in-out infinite; }
.steps li.enter { animation: step-in var(--d-smooth) var(--spring-smooth) both; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } }
.steps li time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.live-run { padding-bottom: 8px; }
.skel-rows { box-shadow: inset 0 var(--hair) 0 var(--line); }
.skel-row { display: grid; grid-template-columns: 22px minmax(0, 2.4fr) 76px minmax(0, 1.4fr) minmax(0, 1fr) 172px; gap: 0 18px; align-items: center; padding: 18px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.skel-row .skel { height: 12px; }
.skel-row:nth-child(2) { opacity: .7; } .skel-row:nth-child(3) { opacity: .4; }
.skel-cap { font-size: 12.5px; color: var(--muted); padding-top: 14px; }

/* options: a ranked list. Rank in the margin, the company first, facts in columns, one quiet status control. */
.opts { list-style: none; margin: 0; padding: 0; overflow-anchor: none; }
.opts-bar { display: none; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
/* Facts / Scores rides the right end of the tab bar, only while Options is open (narrow screens use the options bar). */
.ws-tabs > .tab-view { margin-left: auto; align-self: center; flex: none; transition: opacity var(--d-fast), visibility var(--d-fast); }
.ws-tabs:not(:has(#tab-options[aria-selected="true"])) > .tab-view { opacity: 0; visibility: hidden; pointer-events: none; }
.ob-l { font-size: 12.5px; color: var(--muted); }
.opts-head { margin-top: 0; }
.oh { display: inline-flex; align-items: center; gap: 3px; justify-self: start; margin: -4px 0 -4px -6px; padding: 4px 6px; border: 0; border-radius: var(--r-xs); background: none; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; transition: color var(--d-fast), background var(--d-fast); }
.oh:hover { color: var(--fg); background: var(--fill-1); }
.oh .oh-ic { width: 12px; height: 12px; stroke-width: 2.2; opacity: 0; transform: translateY(-1px); transition: opacity var(--d-fast), transform var(--d-fast); }
.oh.asc .oh-ic { transform: translateY(-1px) rotate(180deg); }
.oh.on { color: var(--fg); }
.oh.on .oh-ic, .oh:hover .oh-ic { opacity: 1; }
.oh:not(.on):hover .oh-ic { opacity: .4; }
/* Facts or Scores: both sets of cells are in the row; the list shows one */
.cs, .c-substats { display: none !important; }
.v-scores .cs { display: grid !important; }
.v-scores .cf { display: none !important; }
.c-sub { gap: 6px; min-width: 0; }
.opts-head.v-scores .c-sub { display: inline-flex !important; }
.c-sub b { font-size: 14px; font-weight: 550; color: var(--fg-2); font-variant-numeric: tabular-nums; line-height: 1; }
.c-sub.on b { color: var(--fg); font-weight: 650; }
.c-sub .meter { width: 48px; height: 3px; }
.c-sub .meter i { background: color-mix(in srgb, var(--fg) 44%, transparent); }
.c-sub.best b { color: var(--ok); }
.c-sub.best .meter i { background: var(--ok); }
.opt.declined .c-sub b { color: var(--faint); }
.opts-head, .opt-row { display: grid; grid-template-columns: 22px minmax(0, 2.4fr) 76px minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .9fr) 172px; gap: 0 18px; align-items: center; }
.opts-head.no-price, .opts.no-price .opt-row { grid-template-columns: 22px minmax(0, 2.4fr) 76px minmax(0, 1.4fr) minmax(0, 1fr) 172px; }
.opts-head.v-scores, .opts.v-scores .opt-row { grid-template-columns: 22px minmax(0, 2.4fr) 76px repeat(4, minmax(0, .62fr)) 172px; }
.opts-head { font-size: 12px; font-weight: 500; color: var(--muted); padding: 0 0 10px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); transition: box-shadow 90ms; }
.opts-head .c-status { padding-left: 8px; }
.opt { box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); transition: box-shadow 90ms; }
.opt-row { margin: 0 -12px; padding: 14px 12px; border-radius: var(--r-lg); cursor: pointer; transition: background-color 90ms; }
.opt-row:hover { background: var(--fill-1); }
.opt-row:active:not(:has(:is(a, button, select):active)) { background: var(--fill-2); }
/* the dividers either side of the row under the pointer step aside, as they do in tables */
@media (hover: hover) {
  .opt:not(.open):has(> .opt-row:hover), .opt:has(+ .opt > .opt-row:hover), .opts-head:has(+ .opts > .opt:first-child > .opt-row:hover) { box-shadow: inset 0 calc(-1 * var(--hair)) 0 transparent; }
}
.opt.enter { animation: opt-in var(--d-smooth) var(--spring-smooth) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes opt-in { from { opacity: 0; transform: translateY(14px); } }
.rk { font-size: 13px; font-weight: 500; color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; }
.opt-name { font-size: 15px; line-height: 1.35; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-name .nm { font-weight: 600; color: var(--fg); }
/* Chips first; the source line drops under them when the column can't hold both, and only truncates if it alone is wider than the column. */
.opt-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 20px; margin-top: 3px; min-width: 0; font-size: 12.5px; color: var(--muted); }
.opt-sub > span:last-child { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-sub .tag { flex: none; vertical-align: 0; }
/* The outcome chip is the long one: it truncates instead of pushing past the name column. */
.opt-sub .tag.pend { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.tag.pend > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; line-height: 16px; } /* .tag's line-height: 1 would clip descenders (g, y) once overflow is hidden */
.score { display: grid; gap: 6px; }
.score b { font-size: 16px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.meter { height: 4px; width: 52px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--fg-2); transform-origin: 0 50%; }
.meter.hi i { background: var(--ok); }
.opts.reveal .meter i, .opts.reveal .breakdown .track i { animation: grow 900ms var(--spring-smooth) both; animation-delay: calc(var(--i, 0) * 55ms + 120ms); }
@keyframes grow { from { transform: scaleX(0); } }
.ostat { font-size: 13px; color: var(--fg-2); min-width: 0; }
.ostat .s2 { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ostat .s2.badline { color: var(--bad); }
.ostat .price { font-weight: 550; color: var(--fg); font-variant-numeric: tabular-nums; }
.opt-actions { display: grid; grid-template-columns: minmax(0, 1fr) 30px 30px; gap: 4px; align-items: center; }
.cand-status { width: 100px; height: 28px; font-size: 13px; padding-left: 10px; background-color: transparent; box-shadow: none; }
.opt .chev { transition: transform var(--d-spring) var(--spring); }
.opt.open .chev { transform: rotate(180deg); }
.opt.declined .nm, .opt.declined .score b { color: var(--faint); }
.opt.declined .nm { text-decoration: line-through; text-decoration-color: var(--line-3); }
.opt-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--d-smooth) var(--spring-smooth); }
.opt.open .opt-more { grid-template-rows: 1fr; }
.opt-clip { overflow: hidden; min-height: 0; }
.opt-detail { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 26px 64px; padding: 4px 0 28px 40px; opacity: 0; transform: translateY(-6px); transition: opacity 140ms ease, transform var(--d-smooth) var(--spring-smooth); }
.opt.open .opt-detail { opacity: 1; transform: none; transition: opacity 260ms ease 70ms, transform var(--d-smooth) var(--spring-smooth); }
.od-main, .od-side { min-width: 0; }
.lbl { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 30px; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--fg-2); }
.lbl:not(:first-child) { margin-top: 18px; }
.why { font-size: 14px; line-height: 1.6; color: var(--fg-2); max-width: 76ch; }
.lbl-act { display: inline-flex; gap: 2px; margin-right: -8px; }
.od-main:has(.script-form) [data-script-edit] { display: none; }
.script-body { position: relative; }
.script.empty { color: var(--muted); font-size: 14px; cursor: text; }
.script.empty:hover { color: var(--fg-2); box-shadow: inset 2px 0 0 var(--line-3); }
.script-form textarea { display: block; margin: -9px 0 0; padding: 8px 14px 8px 16px; font-size: 15px; line-height: 1.62; letter-spacing: -.006em; resize: none; max-width: 76ch; min-height: 96px; animation: script-in var(--d) var(--ease-out); }
@keyframes script-in { from { box-shadow: inset 2px 0 0 var(--line-2); } }
.script-form .form-actions { padding-top: 12px; }
.script-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.script-meta .ic { width: 13px; height: 13px; color: var(--faint); }
.script-meta .linkbtn { font-size: 12.5px; }
.script { font-size: 15px; line-height: 1.62; letter-spacing: -.006em; color: var(--fg); padding: 1px 0 1px 16px; box-shadow: inset 2px 0 0 var(--line-2); white-space: pre-wrap; max-width: 76ch; }
.contacts { list-style: none; margin: 0 0 0 -8px; padding: 0; display: grid; gap: 1px; }
.contacts li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-height: 32px; padding: 0 4px 0 8px; border-radius: var(--r-sm); transition: background var(--d-fast); }
.contacts li:has(a):hover { background: var(--fill-1); }
.contacts li .ic { color: var(--faint); width: 15px; height: 15px; }
.contacts li.none { color: var(--muted); font-size: 13px; }
.contacts a { min-width: 0; color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contacts a:hover { color: var(--accent-text); }
.contacts .lab { min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Addresses and hours are information, not labels: wrap them in full, icon on the first line. */
.contacts li.wrap { align-items: flex-start; padding-block: 7px; line-height: 1.45; }
.contacts li.wrap > span { min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.contacts li.wrap > .ic { flex: none; margin-top: 2px; }
.contacts .phone a { font-variant-numeric: tabular-nums; }
.contacts .icon-btn { margin-left: auto; width: 26px; height: 26px; opacity: 0; transition: opacity var(--d-fast), background var(--d-fast), color var(--d-fast), transform var(--d-spring) var(--spring); }
.contacts li:hover .icon-btn, .contacts .icon-btn:focus-visible, .contacts .icon-btn.copied { opacity: 1; }
.contacts .icon-btn .ic { width: 14px; height: 14px; color: inherit; }
@media (hover: none) { .contacts .icon-btn { opacity: 1; } }
.score-key { font-size: 12px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.breakdown { display: grid; gap: 9px; padding-top: 2px; }
.breakdown > div { display: grid; grid-template-columns: 88px 30px minmax(0, 1fr) 26px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--fg-2); }
.breakdown .w { font-size: 12px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.breakdown .track { height: 3px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.breakdown .track i { display: block; height: 100%; background: color-mix(in srgb, var(--fg) 44%, transparent); border-radius: 2px; transform-origin: 0 50%; }
.breakdown b { font-weight: 550; color: var(--fg); text-align: right; font-variant-numeric: tabular-nums; }
.breakdown .nd b, .breakdown .off b { font-weight: 400; color: var(--faint); }
.breakdown .nd .track i { opacity: .4; }
.breakdown .off > span:first-child { color: var(--faint); }
.bd-sum { margin-top: 10px; font-variant-numeric: tabular-nums; }
.bd-note { margin-top: 10px; }
.bd-sum + .bd-note { margin-top: 4px; }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.sources a { color: var(--fg-2); display: inline-flex; align-items: center; gap: 6px; max-width: 100%; transition: color var(--d-fast); }
.sources a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources a:hover { color: var(--accent-text); }
.sources .ic { width: 12px; height: 12px; color: var(--faint); }
.sources .plain { color: var(--muted); line-height: 1.45; }
.opt-cta { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.opt-cta .btn.ghost .ic { margin: 0 -4px 0 0; transition: transform var(--d-spring) var(--spring); }
.opt-cta .btn.ghost:hover .ic { transform: translateX(2px); }
.factline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--fg-2); margin-top: 10px; }
.factline span { display: inline-flex; gap: 5px; align-items: center; }

/* feedback: thumbs on options and the recommendation, reasons in a popover */
.fb { display: inline-flex; align-items: center; gap: 2px; }
.fb-l { font-size: 12.5px; color: var(--muted); margin-right: 4px; }
.fb-btn { width: 28px; height: 28px; }
.fb-btn .ic { width: 15px; height: 15px; }
.fb-btn[aria-pressed="true"][data-fb="1"] { color: var(--ok); background: var(--ok-soft); }
.fb-btn[aria-pressed="true"][data-fb="-1"] { color: var(--bad); background: var(--bad-soft); }
.fb-btn[aria-pressed="true"] .ic { fill: currentColor; fill-opacity: .18; }
.brief-h .fb { margin-left: auto; }
.brief-h .fb + .log-toggle { margin-left: 6px; }
.opt-cta .fb { margin-right: 6px; }
.fb-pop { width: min(360px, calc(100vw - 16px)); padding: 14px; display: grid; gap: 12px; }
.fb-h { display: grid; gap: 2px; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.fb-h span { font-size: 12px; font-weight: 400; color: var(--muted); }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 11px; border: 0; border-radius: 14px; background: var(--fill-2); color: var(--fg-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background var(--d-fast), color var(--d-fast), box-shadow var(--d-fast), transform var(--d-spring) var(--spring); }
.chip:hover { background: var(--fill-3); color: var(--fg); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.fb-note { min-height: 60px; font-size: 13.5px; resize: none; }
.fb-a { display: flex; align-items: center; gap: 8px; }
.fb-a .linkbtn { font-size: 12.5px; }
/* research again: two clear choices */
.research-dlg { width: min(520px, calc(100vw - 32px)); }
.research-dlg textarea { min-height: 84px; font-size: 14px; }
.rd-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rd-choice { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 12px 14px; border: 0; border-radius: var(--r-lg); background: var(--fill-1); box-shadow: inset 0 0 0 1px var(--line); font: inherit; color: var(--fg); cursor: pointer; transition: background var(--d-fast), box-shadow var(--d-fast), transform var(--d-spring) var(--spring); }
.rd-choice:hover { background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.rd-choice:active { transform: scale(.98); }
.rd-choice b { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.rd-choice b .ic { width: 15px; height: 15px; color: var(--accent-text); }
.rd-choice span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rd-choice[value="more"] { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.rd-choice.is-busy { color: transparent; }
@media (max-width: 480px) { .rd-choices { grid-template-columns: 1fr; } .fb-l { display: none; } }

/* calls: composer + timeline */
.composer { border-radius: var(--r-lg); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow var(--d) var(--ease-out); margin-top: 2px; }
.composer:hover { box-shadow: inset 0 0 0 1px var(--line-3); }
.composer:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
.composer textarea { background: transparent; box-shadow: none !important; resize: none; padding: 13px 16px; min-height: 48px; font-size: 14.5px; display: block; border-radius: var(--r-lg); }
.composer-more { display: grid; gap: 14px; padding: 14px 16px 14px; box-shadow: inset 0 var(--hair) 0 var(--line); }
.composer-more .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.timeline { list-style: none; margin: 24px 0 0; padding: 0; }
.timeline > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 22px; }
.timeline > li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 4px; width: 1px; background: var(--line); }
.timeline > li.enter { animation: step-in var(--d-smooth) var(--spring-smooth) both; }
.tl-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--muted); }
.tl-ic .ic { width: 14px; height: 14px; }
.tl-ic.call { background: var(--info-soft); color: var(--info); }
.tl-ic.agent { background: none; }
.tl-ic.order { background: var(--ok-soft); color: var(--ok); }
/* an edit's fields, before → after */
.tl-changes { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.tl-changes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.tl-changes .k { color: var(--fg-2); font-weight: 500; }
.tl-changes .k::after { content: ":"; }
.tl-changes .from { text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.tl-changes .to { color: var(--fg-2); }
.tl-changes .arrow { color: var(--faint); }
.plainlist .tl-changes { margin-top: 3px; }
.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding-top: 4px; font-size: 13.5px; }
.tl-top b { font-weight: 600; }
.tl-top .meta { margin-left: auto; white-space: nowrap; }
.tl-body { font-size: 14px; line-height: 1.55; color: var(--fg-2); margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 90ch; }
.tl-sys .tl-top { font-size: 13px; color: var(--muted); }
.tl-sys .tl-top b { font-weight: 500; color: var(--fg-2); }
.tl-group { margin-top: 0; padding-top: 2px; }
.plainlist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--fg-2); max-width: 640px; }
.plainlist li { display: flex; justify-content: space-between; gap: 16px; }

/* orders */
.olist { list-style: none; margin: 16px 0 0; padding: 0; }
.olist li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.olist li.enter { animation: step-in var(--d-smooth) var(--spring-smooth) both; }
.olist .total { font-size: 16px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.oform { padding: 20px 0 24px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.oform .form-actions { padding-top: 20px; }

/* ------------------------------------------------------------------ invoices */
#orders-empty .empty { padding: 64px 16px 56px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); box-shadow: inset 0 var(--hair) 0 var(--line), inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.kpi { padding: 22px 28px; display: grid; gap: 6px; box-shadow: inset var(--hair) 0 0 var(--line); }
.kpi:first-child { box-shadow: none; padding-left: 0; }
.kpi .k { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.drop { margin-top: 32px; }
.drop label { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 44px 20px; border-radius: var(--r-xl); cursor: pointer; color: var(--fg-2); background: transparent; outline: 1.5px dashed var(--line-2); outline-offset: -1.5px; transition: background var(--d), outline-color var(--d), transform var(--d-spring) var(--spring); }
.drop label:hover { background: var(--fill-1); outline-color: var(--line-3); }
.drop label:active { transform: scale(.995); }
.drop.over label { background: var(--accent-soft); outline-color: var(--accent); transform: scale(1.008); }
.drop .drop-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--fill-2); color: var(--fg-2); margin-bottom: 6px; transition: transform var(--d-bouncy) var(--spring-bouncy), color var(--d); }
.drop .drop-ic .ic { width: 19px; height: 19px; }
.drop label:hover .drop-ic { transform: translateY(-2px); }
.drop.over .drop-ic { transform: translateY(-6px) scale(1.08); color: var(--accent); background: var(--bg); box-shadow: var(--shadow-thumb); }
.drop b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.drop .linkish { color: var(--accent-text); font-weight: 500; }
.drop .note { max-width: 60ch; margin-top: 2px; }
.drop.busy label { pointer-events: none; }
.drop.busy .drop-ic { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.drop-msg { margin-top: 10px; font-size: 13px; color: var(--muted); }
.drop-msg.bad { color: var(--bad); }

/* ------------------------------------------------------------------ insights */
.ins { padding-top: 40px; }
.toolbar + .ins { padding-top: 8px; }
.ins-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; padding-bottom: 12px; }
.ins-h h2 { font-size: 15px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi .v { font-variant-numeric: normal; }
.kpi .s { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.kpi.is-empty .v { color: var(--faint); }
.kpi .k[data-tip] { justify-self: start; cursor: help; text-decoration: underline dotted var(--line-3); text-underline-offset: 4px; border-radius: 3px; }
.kpi .dl { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.kpi .dl.good { color: var(--ok); } .kpi .dl.bad { color: var(--bad); }
.kpi .dl .muted { font-weight: 400; }
.tag.small-n { height: 18px; padding: 0 6px; font-size: 11px; background: var(--warn-soft); color: var(--warn); vertical-align: 0; }
.toolbar > .meta { margin-left: auto; }
th[data-tip] { cursor: help; text-decoration: underline dotted var(--line-3); text-underline-offset: 4px; }
.none { color: var(--faint); }
.ins-note { font-size: 13px; color: var(--muted); padding-top: 14px; max-width: 96ch; }
.ins-empty { font-size: 13.5px; color: var(--muted); padding: 14px 0; max-width: 72ch; box-shadow: inset 0 var(--hair) 0 var(--line); }
/* weekly columns: single series, hairline grid, rounded data ends */
.wchart { margin: 0; }
.wc-plot { position: relative; height: 168px; margin-left: 28px; }
.wc-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.wc-grid span { position: relative; height: 0; box-shadow: 0 var(--hair) 0 var(--line); }
.wc-grid span:last-child { box-shadow: 0 var(--hair) 0 var(--line-3); }
.wc-grid span::before { content: attr(data-v); position: absolute; right: calc(100% + 10px); top: -8px; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.wc-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.wc-col { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; border-radius: var(--r-sm) var(--r-sm) 0 0; outline-offset: -2px; cursor: default; transition: background var(--d-fast); }
.wc-col:hover, .wc-col:focus-visible { background: var(--fill-1); }
.wc-col i { display: block; width: min(24px, 56%); min-height: 0; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--fg) 30%, transparent); transform-origin: 50% 100%; animation: grow-up 700ms var(--spring-smooth) both; }
.wc-col.now i { background: var(--accent); }
.wc-col:hover i { background: color-mix(in srgb, var(--fg) 46%, transparent); } .wc-col.now:hover i { background: var(--accent-hover); }
@keyframes grow-up { from { transform: scaleY(0); } }
.wc-x { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin-left: 28px; padding-top: 8px; font-size: 11.5px; color: var(--faint); }
.wc-x span { text-align: center; white-space: nowrap; }
/* meter list: one ratio per row, bars aligned */
.meters { list-style: none; margin: 0; padding: 0; box-shadow: inset 0 var(--hair) 0 var(--line); }
.meters li { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(120px, 1fr) 150px; gap: 6px 24px; align-items: center; padding: 13px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.m-t { display: grid; gap: 2px; min-width: 0; }
.m-t b { font-size: 13.5px; font-weight: 550; }
.m-t span { font-size: 12.5px; color: var(--muted); }
.m-bar { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 3px; background: var(--muted); }
.m-bar.ok { background: var(--ok-soft); } .m-bar.ok i { background: var(--ok); }
.m-bar.warn { background: var(--warn-soft); } .m-bar.warn i { background: #d08a1f; }
.m-bar.bad { background: var(--bad-soft); } .m-bar.bad i { background: var(--bad); }
.m-v { font-size: 13.5px; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }
.m-v .muted { font-weight: 400; }

.fbs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 40px; padding: 18px 0; box-shadow: inset 0 var(--hair) 0 var(--line); }
.fbs-k { display: grid; gap: 4px; align-content: start; }
.fbs-k .v { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.fbs-k .s { font-size: 12.5px; color: var(--muted); }
.fbs-t { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.meters.slim { box-shadow: none; }
.meters.slim li { grid-template-columns: minmax(0, 1fr) minmax(80px, 1.2fr) 40px; padding: 7px 0; box-shadow: none; }
.meters.slim .m-bar { height: 5px; } .meters.slim .m-bar i { background: color-mix(in srgb, var(--fg) 40%, transparent); }
.fbs-c { list-style: none; margin: 0; padding: 0; box-shadow: inset 0 var(--hair) 0 var(--line); }
.fbs-c li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; padding: 12px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); font-size: 13.5px; }
.fbs-c p { color: var(--fg); line-height: 1.5; }
.fbs-d { font-size: 12px; font-weight: 600; } .fbs-d.up { color: var(--ok); } .fbs-d.down { color: var(--bad); }
@media (max-width: 760px) { .fbs { grid-template-columns: 1fr; gap: 14px; } .fbs-c li { grid-template-columns: 1fr; gap: 2px; } }

/* contact the app saw but nobody logged; a vendor's record with LEG; deliveries */
.tag.pend { border: 0; cursor: pointer; font-family: inherit; transition: background var(--d-fast); }
.tag.pend:hover { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.resp { font-size: 13px; line-height: 1.55; color: var(--fg-2); }
.deliv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--fg-2); }
.deliv > .ic { width: 14px; height: 14px; color: var(--ok); stroke-width: 2.2; }
/* one-tap outcome after contact: sits where toasts appear */
.ask { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 131; display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 24px); padding: 6px 6px 6px 16px; border-radius: 26px; background: var(--hud-bg); color: var(--hud-fg); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .12); animation: toast-in var(--d-bouncy) var(--spring-bouncy) both; font-size: 13.5px; }
.ask.out { animation: toast-out 180ms var(--ease-io) forwards; }
.ask .q { font-weight: 500; margin-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ask button { flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--d-fast), transform var(--d-spring) var(--spring); }
.ask button:hover { background: rgba(255, 255, 255, .22); }
.ask button:active { transform: scale(.95); }
.ask button.x { width: 32px; padding: 0; display: grid; place-items: center; background: none; color: rgba(255, 255, 255, .7); }
.ask button.x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ask button .ic { width: 14px; height: 14px; }
.ask button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
body:has(.ask) .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* invoices list: selection, bulk actions, pager */
.inv-toolbar { padding-top: 4px; }
.inv-table th.sel, .inv-table td.sel, .ven-table th.sel, .ven-table td.sel { width: 36px; padding-right: 0; }
.inv-table td.sel .check, .inv-table th.sel .check, .ven-table td.sel .check, .ven-table th.sel .check { display: flex; padding: 4px; margin: -4px; }
.inv-table th.sel, .ven-table th.sel { vertical-align: middle; }
/* what the selected filter means, in a sentence: the tabs alone don't explain themselves to a new buyer */
.seg-note { font-size: 13px; color: var(--muted); margin: -6px 0 14px; max-width: 80ch; }
tr.picked td { background-color: var(--accent-soft); }
tr.click.picked:hover td { background-color: color-mix(in srgb, var(--accent) 14%, transparent); }
.bulk { position: sticky; top: calc(var(--bar) + 8px); z-index: 11; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 6px 6px 14px; border-radius: var(--r-lg); background: var(--hud-bg); color: var(--hud-fg); font-size: 13.5px; font-weight: 500; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .35); animation: pop-in var(--d-spring) var(--spring); }
.bulk .btn.ghost { color: rgba(255, 255, 255, .8); } .bulk .btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.bulk .btn.secondary { background: rgba(255, 255, 255, .14); color: #fff; } .bulk .btn.secondary .ic { color: #fff; }
.bulk .btn.danger { background: #e5534b; color: #fff; }
.pager { display: flex; align-items: center; gap: 2px; padding-top: 14px; font-variant-numeric: tabular-nums; }
.pg { min-width: 32px; height: 32px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; color: var(--fg-2); transition: background var(--d-fast), color var(--d-fast); }
a.pg:hover { background: var(--fill-1); color: var(--fg); }
.pg.on { background: var(--fill-2); color: var(--fg); font-weight: 600; }
.pg.off { color: var(--faint); opacity: .5; }
.pg .ic { width: 15px; height: 15px; }
.pg-gap { width: 24px; text-align: center; color: var(--faint); }
.status.warn { color: var(--warn); }
.status.bad-t { color: var(--bad); } .status.bad-t i { background: var(--bad); }
.toast .t-act { margin: -4px -8px -4px 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.toast .t-act:hover { background: rgba(255, 255, 255, .26); }
.btn.ghost.danger-t { color: var(--bad); } .btn.ghost.danger-t .ic { color: var(--bad); } .btn.ghost.danger-t:hover { background: var(--bad-soft); }

/* invoice: the document beside what was read, editable */
main:has(.inv-split) { max-width: 1680px; }
.inv-head { padding-bottom: 16px; }
.inv-head .inv-no { font-weight: 400; font-size: .72em; margin-left: 4px; }
.inv-head .sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13.5px; }
.inv-head .sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line-3); }
.inv-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 0 32px; align-items: start; margin-top: 8px; }
.inv-doc { position: sticky; top: calc(var(--bar) + 12px); height: calc(100vh - var(--bar) - 28px); height: calc(100dvh - var(--bar) - 28px); display: grid; grid-template-rows: auto minmax(0, 1fr); border-radius: var(--r-lg); background: var(--bg-sunken); box-shadow: inset 0 0 0 var(--hair) var(--line-2); overflow: hidden; }
.doc-bar { display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 6px 0 14px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); font-size: 13px; color: var(--fg-2); }
.doc-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-name .ic { color: var(--faint); flex: none; }
.doc-view { position: relative; min-height: 0; }
.doc-name span { overflow: hidden; text-overflow: ellipsis; }
.pv-pg { font-size: 12.5px; color: var(--muted); margin-left: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pv-found { font-size: 12px; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.pv-zoom { display: inline-flex; align-items: center; }
.pv-pct { min-width: 44px; text-align: center; font-size: 12.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.doc-bar .icon-btn { width: 28px; height: 28px; }
.pv-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; outline: none; }
.pv-pages { display: grid; justify-items: center; gap: 16px; padding: 16px; width: max-content; min-width: 100%; }
.pv-page { position: relative; background: #fff; box-shadow: 0 0 0 var(--hair) rgba(0, 0, 0, .12), 0 2px 10px -2px rgba(0, 0, 0, .14); }
.pv-page > * { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.pv-canvas, .pv-img { display: block; }
.pv-boxes { pointer-events: none; }
.pv-load, .pv-err { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.pv-err { padding: 24px; text-align: center; }
/* a box over each value that was read: faint until its field is in focus or the pointer is on it */
.pvb { position: absolute; border-radius: 3px; pointer-events: auto; cursor: pointer; background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent); transition: background var(--d-fast), box-shadow var(--d-fast), opacity var(--d-fast); }
.pvb:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent); }
.pvb.approx { background: transparent; box-shadow: none; outline: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -1px; }
.pvb.flag { background: color-mix(in srgb, #d08a1f 14%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #d08a1f 70%, transparent); }
.pvb.on { z-index: 2; background: color-mix(in srgb, var(--accent) 20%, transparent); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: pvb-in var(--d-spring) var(--spring); }
@keyframes pvb-in { from { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent); } }
.inv-doc:not(:hover) .pvb:not(.on):not(.flag) { opacity: .55; }
label.f.pv-hot input, td.pv-hot input, td.pv-hot textarea { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent); }
.inv-data { min-width: 0; padding-bottom: 24px; }
.inv-review { margin-bottom: 18px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--warn-soft); font-size: 13.5px; }
.inv-review > b { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--fg); }
.inv-review > b .ic { color: var(--warn); }
.inv-review ul { margin: 6px 0 0 24px; padding: 0; display: grid; gap: 3px; }
.inv-review .linkbtn { color: var(--fg-2); font-weight: 400; text-align: left; } .inv-review .linkbtn:hover { color: var(--fg); }
.inv-sec { padding: 4px 0 18px; }
.inv-sec + .inv-sec { padding-top: 18px; box-shadow: inset 0 var(--hair) 0 var(--line); }
.inv-sec h2 { font-size: 13px; font-weight: 600; color: var(--fg-2); margin-bottom: 10px; }
.inv-sec-h { display: flex; justify-content: space-between; align-items: baseline; }
.inv-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
label.f.flag input, td.flag input { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warn) 70%, transparent); background: var(--warn-soft); }
label.f.flag { color: var(--warn); }
/* line items: a quiet spreadsheet; cells look like text until you touch them */
.ln-wrap { margin: 0 -8px; overflow-x: auto; }
.ln-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13.5px; }
.ln-table th { padding: 0 8px 6px; background: none; font-size: 12px; }
/* rows breathe: a field's outline (on hover or focus) never meets the row's divider */
.ln-table td { padding: 8px 2px; vertical-align: top; background-image: none; }
.ln-table thead th { padding-bottom: 8px; }
.ln-table tr.ln td { box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.ln-table tr.ln.enter { animation: step-in var(--d-smooth) var(--spring-smooth) both; }
.ln-table input, .ln-table textarea, .ln-table select { width: 100%; min-width: 0; height: 30px; padding: 0 6px; font-size: 13.5px; background: transparent; box-shadow: none; border-radius: var(--r-sm); }
.ln-table input:hover, .ln-table textarea:hover, .ln-table select:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.ln-table input:focus, .ln-table textarea:focus, .ln-table select:focus { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--accent), var(--ring); }
.ln-table td.r input { text-align: right; font-variant-numeric: tabular-nums; }
.ln-table { table-layout: fixed; }
.ln-table th:nth-child(2) { width: 76px; } .ln-table th:nth-child(3) { width: 56px; } .ln-table th:nth-child(4) { width: 96px; } .ln-table th:nth-child(5) { width: 112px; } .ln-table th:nth-child(6) { width: 92px; } .ln-table th:nth-child(7) { width: 34px; }
.ln-d { width: auto; }
.ln-d textarea { height: auto; min-height: 30px; padding: 5px 6px; line-height: 1.4; resize: none; display: block; }
.ln-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; margin-top: 4px; }
.ln-d .ln-code { height: 26px; font-size: 12px; color: var(--muted); font-family: var(--f-mono); font-feature-settings: normal; }
.ln-d .ln-code::placeholder { color: transparent; font-family: var(--f); transition: color var(--d-fast); }
tr.ln:hover .ln-code::placeholder, tr.ln:focus-within .ln-code::placeholder, .ln-code:focus::placeholder { color: var(--faint); }
.ln-d .ln-code:not(:focus):not(:hover) { box-shadow: none; background: transparent; }
.ln-table input { text-overflow: ellipsis; } .ln-k select { padding-right: 24px; background-position: right 4px center; }
.ln-x .icon-btn { width: 26px; height: 26px; opacity: 0; transition: opacity var(--d-fast), background var(--d-fast), color var(--d-fast); }
tr.ln:hover .ln-x .icon-btn, .ln-x .icon-btn:focus-visible { opacity: 1; }
td.calc-off input { color: var(--bad); }
td.calc-off { position: relative; }
td.calc-off::after { content: attr(data-calc); position: absolute; right: 8px; bottom: -14px; font-size: 10.5px; color: var(--bad); white-space: nowrap; pointer-events: none; }
#ln-add { margin-top: 8px; margin-left: -6px; }
.inv-totals { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.tot-fields { display: grid; gap: 10px; }
.tot-fields label.f { grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 10px; }
.tot-fields input { text-align: right; font-variant-numeric: tabular-nums; }
.tot-fields label.f:last-child input { font-weight: 650; }
.tot-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--fg-2); line-height: 1.5; padding-top: 6px; }
.tot-check .ic { flex: none; margin-top: 2px; }
.tot-check.ok .ic { color: var(--ok); } .tot-check.off .ic { color: var(--bad); } .tot-check.off { color: var(--fg); }
.inv-save { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 8px 8px 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); box-shadow: var(--shadow-pop); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity var(--d) ease, transform var(--d-spring) var(--spring); }
.inv-data.dirty .inv-save { opacity: 1; transform: none; pointer-events: auto; }
/* while the save bar shows, nothing scrolls or focuses behind it */
.inv-data.dirty { padding-bottom: 72px; }
html:has(.inv-data.dirty) { scroll-padding-bottom: 88px; }
.inv-data.dirty .inv-save { margin-bottom: -64px; }
.inv-data[inert] { opacity: .6; }
@media (max-width: 1100px) {
  .inv-split { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .inv-doc { position: relative; top: 0; height: 62vh; }
}
@media (max-width: 600px) { .inv-fields { grid-template-columns: minmax(0, 1fr); } .inv-totals { grid-template-columns: minmax(0, 1fr); } .pager .meta { display: none; } }

/* ------------------------------------------------------------------ vendor detail, settings */
.th-sort { display: inline-flex; align-items: center; gap: 3px; color: inherit; border-radius: var(--r-xs); transition: color var(--d-fast); }
.th-sort .ic { width: 12px; height: 12px; stroke-width: 2.2; opacity: 0; transition: opacity var(--d-fast); }
.th-sort:hover { color: var(--fg); } .th-sort:hover .ic { opacity: .4; }
.th-sort.on { color: var(--fg); } .th-sort.on .ic { opacity: 1; }
.fbc { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; font-variant-numeric: tabular-nums; color: var(--muted); }
.fbc .ic { width: 13px; height: 13px; }
.fbc.up .ic { color: var(--ok); } .fbc.down .ic { color: var(--bad); }
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 12px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); font-size: 13.5px; }
.fb-list .fbc { margin: 2px 0 0; }
.fb-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fb-q { color: var(--fg); line-height: 1.5; }
.fb-list .meta { display: block; margin-top: 4px; }
.ven-notes { padding-top: 12px; font-size: 14px; line-height: 1.6; color: var(--fg); white-space: pre-wrap; max-width: 80ch; }
.ven-form { padding: 18px 0 24px; display: grid; gap: 18px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); margin-bottom: 8px; }
.ven-form .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ven-pref { display: grid; gap: 12px; }
.ven-pref .switch { padding: 2px 0; box-shadow: none; max-width: 640px; }
.ph-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
#ven-phone-add { margin-left: -6px; }
.contacts li.none { color: var(--muted); font-size: 13px; display: block; padding: 6px 8px; line-height: 1.5; }
@media (max-width: 600px) { .ven-form .fields { grid-template-columns: minmax(0, 1fr); } .ph-row { grid-template-columns: minmax(0, 1fr) 30px; } .ph-row [name=ph_label] { grid-column: 1; } }

.props-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.props-grid div { padding: 13px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); display: grid; gap: 3px; }
.props-grid span { font-size: 12px; color: var(--muted); }
.props-grid b { font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; padding: 12px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); font-size: 13.5px; }
.list > li .meta { white-space: nowrap; }
.list a { font-weight: 500; transition: color var(--d-fast); }
.list a:hover { color: var(--accent-text); }
.disclosure > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 13px 0; font-size: 14px; font-weight: 550; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); transition: color var(--d-fast); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .ic { color: var(--muted); transition: transform var(--d-spring) var(--spring); }
.disclosure[open] > summary .ic { transform: rotate(90deg); }
.disclosure > summary .meta { margin-left: auto; font-weight: 400; }
.disclosure > summary:hover { color: var(--accent-text); }
.isnform { display: grid; gap: 14px; padding: 18px 0 4px; max-width: 860px; }
.isnform textarea { font-family: var(--f-mono); font-size: 12.5px; font-feature-settings: normal; }
#isn-detail { line-height: 1.6; }
#isn-detail b { color: var(--fg-2); font-weight: 500; }
dl.raw { margin: 4px 0 0; display: grid; }
dl.raw div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 8px 0; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); font-size: 13px; }
dl.raw dt { color: var(--muted); } dl.raw dd { margin: 0; overflow-wrap: anywhere; }
.switches { display: grid; padding-top: 2px; }

/* ------------------------------------------------------------------ login */
body.bare .foot { display: none; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(440px, 1fr); }
.auth-art { position: relative; overflow: hidden; background: #2a211c; color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px; }
.auth-art::before { content: ""; position: absolute; inset: -4%; background: url("/brand/rig-sunrise.jpg") center / cover no-repeat; animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
.auth-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 14, 10, .5) 0%, rgba(20, 14, 10, .04) 38%, rgba(20, 14, 10, .74) 100%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .wm { height: calc(16px * 159 / 152); width: auto; align-self: flex-start; filter: brightness(0) invert(1); opacity: .95; }
.auth-art blockquote { margin: 0; max-width: 20ch; font-size: 34px; line-height: 1.12; font-weight: 650; letter-spacing: -.028em; text-wrap: balance; }
.auth-art .cap { margin-top: 16px; font-size: 13px; opacity: .78; }
.auth-form { display: grid; place-items: center; padding: 48px 32px; }
.auth-card { width: min(348px, 100%); display: grid; gap: 6px; }
.auth-card > * { animation: rise 700ms var(--spring-smooth) both; }
.auth-card > :nth-child(2) { animation-delay: 50ms; } .auth-card > :nth-child(3) { animation-delay: 100ms; } .auth-card > :nth-child(4) { animation-delay: 150ms; } .auth-card > :nth-child(5) { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.auth-card .flame { width: auto; height: 40px; margin-bottom: 20px; }
.auth-card h1 { font-size: 28px; }
.auth-card .sub { color: var(--muted); font-size: 15px; }
.auth-card form { display: grid; gap: 16px; margin-top: 28px; }
.auth-card .btn { height: 44px; margin-top: 6px; font-size: 15px; border-radius: 12px; }
.auth-card input { height: 44px; font-size: 15px; border-radius: 12px; }
.auth-err { display: flex; gap: 8px; align-items: center; padding: 11px 12px; border-radius: 12px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; animation: shake 420ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.auth-foot { margin-top: 28px; font-size: 12.5px; color: var(--faint); }

/* ------------------------------------------------------------------ errors */
.errorpage { padding: 16vh 0 8vh; }
.errorpage .code { font: 500 13px/1 var(--f-mono); color: var(--faint); letter-spacing: .04em; }
.errorpage h1 { font-size: 26px; }

/* ------------------------------------------------------------------ responsive */
.c-stats { display: none !important; }
@media (max-width: 1180px) {
  .hide-md { display: none; }
  .searchbtn { min-width: 0; width: 32px; padding: 0; justify-content: center; border-radius: 50%; }
  .opts-head, .opt-row { grid-template-columns: 22px minmax(0, 1fr) 58px 100px 136px 124px 172px; column-gap: 14px; }
  .opts-head.no-price, .opts.no-price .opt-row { grid-template-columns: 22px minmax(0, 1fr) 58px 150px 132px 172px; }
  .opts-head.v-scores, .opts.v-scores .opt-row { grid-template-columns: 22px minmax(0, 1fr) 58px repeat(4, 74px) 172px; }
  .c-sub .meter { width: 40px; }
  .opts-head > :nth-child(2), .opt-row > .c-name { margin-left: 4px; }
  .skel-row { grid-template-columns: 22px minmax(0, 1fr) 58px 150px 132px 172px; column-gap: 14px; }
  .opt-detail { gap: 26px 44px; }
}
@media (max-width: 960px) {
  /* four tiles become two rows of two: a line between the columns and between the rows */
  .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k4 .kpi { padding: 18px 0 18px 20px; box-shadow: inset var(--hair) 0 0 var(--line); }
  .kpis.k4 .kpi:nth-child(odd) { padding-left: 0; padding-right: 16px; box-shadow: none; }
  .kpis.k4 .kpi:nth-child(3) { box-shadow: inset 0 var(--hair) 0 var(--line); }
  .kpis.k4 .kpi:nth-child(4) { box-shadow: inset 0 var(--hair) 0 var(--line), inset var(--hair) 0 0 var(--line); }
  .brand .lockup-full { display: none; }
  .brand .mark { display: block; }
  .appbar-in { gap: 14px; }
  .opts-head { display: none; }
  .opts-bar { display: flex; } .ws-tabs > .tab-view { display: none; }
  .opts { margin-top: 22px; box-shadow: inset 0 var(--hair) 0 var(--line); transition: box-shadow 90ms; }
  .opts:has(> .opt:first-child > .opt-row:hover) { box-shadow: none; }
  .opt-row, .opts.no-price .opt-row { grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "rk name score" "rk stats stats" "rk act act"; gap: 8px 18px; align-items: start; }
  .opt-row .rk { grid-area: rk; padding-top: 2px; } .opt-row > .c-name { grid-area: name; margin-left: 0; } .opt-row .score { grid-area: score; justify-items: end; }
  .opt-row .c-price, .opt-row .c-avail, .opt-row .c-safety { display: none; }
  .opt-row .c-stats { grid-area: stats; display: flex !important; margin-top: 0; }
  .v-scores .opt-row .cs, .opts.v-scores .opt-row .c-stats { display: none !important; }
  .opts.v-scores .opt-row .c-substats { grid-area: stats; display: flex !important; margin-top: 0; }
  .c-substats b { font-weight: 600; color: var(--fg); }
  .opts-bar .spacer { display: none; }
  .opt-row .opt-actions { grid-area: act; display: flex; margin-left: -8px; }
  .opt-row .opt-actions .chev-btn { margin-left: auto; }
  .opt-detail { grid-template-columns: minmax(0, 1fr); padding-left: 40px; }
  .tgroup { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tgroup h3 { padding-top: 0; }
  .skel-row { grid-template-columns: 22px minmax(0, 1fr) 64px; column-gap: 18px; } .skel-row > :nth-child(n+4) { display: none; }
}
@media (max-width: 760px) {
  .wrap { padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  h1, .ws-head h1 { font-size: 24px; }
  .hide-sm { display: none; }
  .appbar-in { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 0 12px; }
  .nav { order: 3; flex-basis: 100%; height: 44px; margin-left: -11px; }
  .nav-ind { bottom: -6px; }
  .appbar-end { order: 2; }
  :root { --bar: 86px; }
  .page-head { padding-top: 28px; }
  .page-head .actions, .page-head .actions .searchbox { width: 100%; }
  .props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prop-long, .orig { grid-template-columns: minmax(0, 1fr); }
  .req-body.has-photo { grid-template-columns: minmax(0, 1fr); }
  .req-photo { order: -1; margin: 8px 0 6px; } .req-photo img { height: 180px; }
  .req-photos { order: -1; margin: 8px 0 6px; } .req-photos .req-photo { order: 0; margin: 0; } .req-photos .req-photo img, .req-photos.n2 .req-photo img { height: 120px; } .req-photos.n3 .req-photo:first-child img { height: 180px; }
  .composer-more .fields { grid-template-columns: minmax(0, 1fr); }
  .fields .span2 { grid-column: auto; }
  .opt-detail { padding-left: 0; }
  .req-body, .tpl { padding-left: 0; }
  .req-sum { display: none; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpis.k4 .kpi:nth-child(-n+2) { padding-top: 14px; } .kpi .v { font-size: 26px; }
  .meters li { grid-template-columns: minmax(0, 1fr) auto; } .m-bar { grid-column: 1 / -1; grid-row: 2; }
  .ask { left: 12px; right: 12px; translate: none; flex-wrap: wrap; border-radius: 20px; padding: 10px; } .ask .q { flex-basis: 100%; margin: 0 0 6px 6px; } .kpi { box-shadow: inset 0 var(--hair) 0 var(--line); padding: 16px 0; } .kpi:first-child { box-shadow: none; }
  .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; }
  .ws-head .actions { width: 100%; } .ws-head .actions .btn { flex: 1; }
  .toolbar .searchbox { width: 100%; }
  .tl-top .meta { margin-left: 0; width: 100%; }
  .palette { margin-top: 12px; }
  input[type="text"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], select, textarea { font-size: 16px; } /* no zoom-on-focus on iOS */
}
@media (max-width: 600px) {
  .brief-h { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 12px; }
  .brief-h .brief-meta { grid-column: 1 / -1; grid-row: 2; }
  #reco .brief-meta > :nth-last-child(-n+2) { display: none; }
}
@media (max-width: 400px) { .ws-tabs { gap: 16px; } } /* four tabs on a small phone */
@media (max-width: 480px) { .hide-xs { display: none; }.appbar-end .btn.sm { width: 32px; padding: 0; border-radius: 50%; } .appbar-end .btn .ic { margin: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  @view-transition { navigation: none; }
}
@media print { .appbar, .foot, .actions, .opt-actions, .ws-tabs, .composer, .toasts { display: none !important; } }
.spinner.sm { width: 12px; height: 12px; display: inline-block; vertical-align: -2px; margin-right: 6px; }

/* ---------------------------------------------------------------- photo viewer and markup (request photos) */
/* Always dark, whatever the theme: photos read best on near-black, and the controls are white on it. */
html.lb-on { overflow: hidden; }
.lightbox { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; outline: none; color: #fff; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lb-scrim { position: absolute; inset: 0; background: rgba(16, 12, 9, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lb-img { position: relative; display: block; width: auto; height: auto; max-width: calc(100vw - 160px); max-height: calc(100dvh - 128px); border-radius: 12px; transform-origin: 50% 50%; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 0 24px; font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .72); pointer-events: none; }
.lb-bar > * { pointer-events: auto; }
.lb-acts { display: flex; align-items: center; gap: 8px; }
.lb-btn { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background var(--d-fast), transform var(--d-spring) var(--spring); }
.lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-btn .ic { width: 18px; height: 18px; }
.lb-pill { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 13.5px; font-weight: 550; letter-spacing: -.005em; cursor: pointer; white-space: nowrap; transition: background var(--d-fast), transform var(--d-spring) var(--spring); }
.lb-pill:hover { background: rgba(255, 255, 255, .2); }
.lb-pill .ic { width: 15px; height: 15px; }
.lb-pill.ghost { background: transparent; color: rgba(255, 255, 255, .82); }
.lb-pill.ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lb-pill.primary { min-width: 76px; background: #fff; color: #1d1a17; }
.lb-pill.primary:hover { background: #ece7e2; }
.lb-pill.is-busy { color: transparent; pointer-events: none; }
.lb-pill.is-busy > * { visibility: hidden; }
.lb-pill.is-busy::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: conic-gradient(from 0deg, transparent 10%, currentColor); color: #fff; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px)); animation: spin .7s linear infinite; }
.lb-pill.primary.is-busy::after { color: #1d1a17; }
:is(.lb-btn, .lb-pill, .lb-tool, .lb-swatch):active:not(:disabled) { transform: scale(.92); }
:is(.lb-btn, .lb-pill, .lb-tool, .lb-swatch):focus-visible { outline: 2px solid rgba(255, 255, 255, .9); outline-offset: 2px; }
.lb-nav { position: absolute; top: 50%; margin-top: -20px; display: none; }
.lightbox.multi .lb-nav { display: grid; }
.lb-nav.prev { left: 24px; }
.lb-nav.next { right: 24px; }
.lb-edit, .lb-stage, .lb-tools { display: none; }
/* markup: top bar, the photo, the toolbar */
.lightbox.editing[open] { grid-template-rows: auto minmax(0, 1fr) auto; place-items: stretch; }
.lightbox.editing :is(.lb-img, .lb-view, .lb-nav) { display: none; }
.lightbox.editing .lb-bar { position: relative; grid-row: 1; padding-bottom: 10px; }
.lightbox.editing .lb-edit { display: flex; }
.lightbox.editing .lb-stage { grid-row: 2; position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; }
.lb-paper { position: relative; line-height: 0; }
.lb-canvas { display: block; border-radius: 10px; touch-action: none; cursor: crosshair; transform-origin: 50% 50%; }
.lb-canvas[data-tool="text"] { cursor: text; }
.lb-label { position: absolute; translate: 0 -50%; display: inline-flex; align-items: center; min-width: 2ch; white-space: pre; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; font-weight: 600; line-height: 1; outline: none; caret-color: currentColor; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 4px 14px rgba(0, 0, 0, .35); cursor: text; }
.lightbox.editing .lb-tools { grid-row: 3; justify-self: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; max-width: calc(100vw - 24px); margin: 6px 12px max(18px, env(safe-area-inset-bottom)); padding: 5px; border-radius: 16px; background: rgba(48, 43, 39, .78); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 30px -8px rgba(0, 0, 0, .5); }
.lb-grp { display: flex; align-items: center; gap: 2px; }
.lb-grp + .lb-grp { padding-left: 5px; margin-left: 1px; box-shadow: inset 1px 0 rgba(255, 255, 255, .12); }
.lb-tool { height: 36px; min-width: 36px; padding: 0; border: 0; border-radius: 11px; display: grid; place-items: center; background: transparent; color: rgba(255, 255, 255, .84); cursor: pointer; transition: background var(--d-fast), color var(--d-fast), transform var(--d-spring) var(--spring); }
.lb-tool:hover:not(:disabled) { background: rgba(255, 255, 255, .1); color: #fff; }
.lb-tool[aria-checked="true"] { background: #fff; color: #1d1a17; }
.lb-tool:disabled { opacity: .32; cursor: default; }
.lb-tool .ic { width: 19px; height: 19px; }
.lb-tool.flip .ic { transform: scaleX(-1); }
.lb-tool.lb-reset { padding: 0 12px; font: inherit; font-size: 13px; font-weight: 550; }
.lb-swatch { position: relative; width: 32px; height: 36px; padding: 0; border: 0; border-radius: 11px; background: transparent; cursor: pointer; transition: transform var(--d-spring) var(--spring); }
.lb-swatch::before { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); transition: box-shadow var(--d-fast), scale var(--d-spring) var(--spring); }
.lb-swatch:hover::before { scale: 1.08; }
.lb-swatch[aria-checked="true"]::before { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 0 0 2px rgba(48, 43, 39, 1), 0 0 0 4px #fff; }
@media (max-width: 640px) {
  .lb-img { max-width: calc(100vw - 24px); max-height: calc(100dvh - 176px); }
  .lb-nav { top: auto; bottom: max(24px, env(safe-area-inset-bottom)); margin-top: 0; }
  .lb-nav.prev { left: calc(50% - 52px); }
  .lb-nav.next { right: calc(50% - 52px); }
  .lb-bar { padding-left: 16px; padding-right: 12px; }
  .lb-tool { height: 40px; min-width: 40px; }
  .lb-swatch { height: 40px; }
}

/* ---------------------------------------------------------------- price check (invoice page) */
.pc .inv-sec-h .meta { display: inline-flex; align-items: baseline; gap: 4px; }
.pc-sum { font-size: 14px; color: var(--fg-2); line-height: 1.5; }
.pc-bad { color: var(--bad); font-weight: 600; }
.pc-stale { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); margin-bottom: 8px; }
.pc-stale .ic { color: var(--warn); }
.pc-list { list-style: none; margin: 12px 0 0; padding: 0; }
.pc-item { padding: 12px 0; box-shadow: inset 0 var(--hair) 0 var(--line); }
.pc-item:last-child { padding-bottom: 0; }
.pc-main { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pc-main .linkbtn { font-weight: 500; color: var(--fg); text-align: left; }
.pc-amt { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--bad); white-space: nowrap; }
.pc-amt.struck { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.pc-note { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.pc-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 0 -10px; }
.pc-acts .status, .pc-acts .meta { margin-left: 10px; }
.pc-acts .meta { font-size: 12.5px; color: var(--muted); }
.pc-info { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.pc-info li { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--muted); }
.pc-info li > span:first-child, .pc-info .linkbtn { color: var(--fg-2); text-align: left; }
.pc-row-r { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-set { margin-top: 12px; }
.pc-set .note { margin: 8px 0 4px; }

/* agreed prices (vendor page) */
.rate-table td { vertical-align: top; }
.rate-table td.r .icon-btn { margin-left: 2px; }
.rate-add { margin: 10px 0 0 -10px; }
.rate-form { margin-top: 14px; padding-top: 14px; box-shadow: inset 0 var(--hair) 0 var(--line); }

/* ================================================================ detail pass: optical alignment, rhythm, colour
   Each rule fixes one measured defect. They live together here so the pass can be read (or reverted) as a whole. */

/* Page actions sit on the title's line on every page (they used to hang between the title and the line under it).
   An h1 line is 32.5px tall; a 36px button centres on it when lifted 2px. */
.page-head { align-items: flex-start; }
.page-head .actions { min-height: 36px; margin-top: -2px; }

/* A page that widens its content (the invoice, side by side with its document) widens the bar and footer with it, so
   the logo and the page's left edge stay on one line. */
html:has(main .inv-split) :is(.appbar-in, .foot > .wrap) { max-width: 1680px; }

/* KPI tiles: label, value and note start from the top, so values share a baseline across a row whatever the length
   of the note under them. "No data" is a light dash, not a heavy bar. */
.kpi { align-content: start; }
.kpi .v { min-height: 33px; }
.kpi.is-empty .v { font-weight: 300; color: var(--faint); }
.kpi .s { text-wrap: pretty; }

/* An empty section's rule runs the full width, like every other section's; only its text keeps a readable measure. */
.ins-empty { max-width: none; padding-right: max(0px, 100% - 72ch); }
.m-v .none { font-size: 12.5px; font-weight: 400; }

/* Chart grid: real hairlines (a shadow on a zero-height box doesn't paint at half a pixel). */
.wc-grid span { box-shadow: none; border-top: var(--hair) solid var(--line); }
.wc-grid span:last-child { box-shadow: none; border-top-color: var(--line-3); }

/* Tables. A right-aligned sortable heading keeps its label flush with the column's numbers: the arrow goes on the
   inside. A section whose content is a table is ruled once, under the column headings, not twice. */
th.r .th-sort { flex-direction: row-reverse; }
.section-head:has(+ .tbl-wrap) { box-shadow: none; padding-bottom: 8px; }
.rate-table td { vertical-align: baseline; }
.rate-table td:last-child { vertical-align: top; padding-block: 9px; }
.inv-table td:nth-child(2) { max-width: 300px; }
.inv-table td:nth-child(2) .rowlink { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Invoice lines: the description sits on the same baseline as the numbers beside it (its line box is now the
   inputs' 30px, centred the same way), and a line with no part number or ticket doesn't hold an empty second row
   open. The two fields appear when the line is being edited. */
.ln-d textarea { line-height: 20px; padding: 5px 6px; }
tr.ln:not(:focus-within) .ln-meta:not(:has(.ln-code:not(:placeholder-shown))) { display: none; }

/* Price check: decisions are real buttons, flush with the text above them; the re-check link is quiet so the only
   red in the block is the money. */
.pc-acts { margin: 10px 0 0; gap: 6px; }
.pc-acts .status { margin: 0 4px 0 0; }
.pc-acts .meta { margin: 0 6px 0 0; }
.pc .inv-sec-h .linkbtn { color: var(--fg-2); }
.pc .inv-sec-h .linkbtn:hover { color: var(--fg); }

/* Colour: "wrong" is a cooler, cleaner red than the brand's terracotta, so a Delete or an overbilled amount never
   reads as just another accent. */
:root { --bad: #c21f2d; --bad-soft: rgba(194, 31, 45, .08); }
@media (prefers-color-scheme: dark) { :root { --bad: #ff8a8a; --bad-soft: rgba(255, 138, 138, .14); } }

/* Invoice lines, continued. Row rules stop at the text's edges, in line with the section rules above and below
   (cells pad their inputs by 8px, which used to push the rules 8px past both margins). With only a ticket and no
   part number, the ticket starts at the left edge instead of floating in the second column. */
.ln-table tr.ln td { box-shadow: none; background: linear-gradient(var(--line), var(--line)) 0 100% / 100% var(--hair) no-repeat; }
.ln-table tr.ln td:first-child { background-position: 8px 100%; background-size: calc(100% - 8px) var(--hair); }
.ln-table tr.ln td:last-child { background-size: calc(100% - 8px) var(--hair); }
.ln-meta { display: flex; gap: 4px; margin-top: -2px; }
.ln-meta .ln-code { flex: 1 1 0; }
tr.ln:not(:focus-within) .ln-meta .ln-code:placeholder-shown { display: none; }

/* A section's title and its note share a baseline (they were centred on each other, 1.5px apart). */
.section-head { align-items: baseline; }

/* A status's dot no longer sets its baseline: the label sits on the same baseline as the text beside it (it rode
   0.7px low wherever a status shared a row with other text). */
.status { align-items: baseline; }
.section-head > :is(.status, .btn, .seg, .icon-btn, .linkbtn) { align-self: center; }

/* The workspace's actions centre on its title line, as on every other page. */
.ws-head .actions { padding-top: 0; margin-top: -2px; }
/* Two-line subtitles break evenly instead of leaving a short last line. */
.page-head .sub { text-wrap: balance; }
/* Empty dates read as placeholders. */
input[type="date"][data-empty]:not(:focus)::-webkit-datetime-edit { color: var(--faint); }
/* Where an invoice was billed to: one line, cut with an ellipsis, never broken inside a well name. */
.inv-table td:nth-child(5) { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* A field label and its hint ("Item code · optional") sit on one line. The hint used to drop to a line of its own,
   which pushed that field 26px below its neighbours in the same row. */
label.f { display: flex; flex-wrap: wrap; align-items: baseline; align-content: flex-start; gap: 7px 5px; }
label.f > :not(.hint) { flex: 1 0 100%; min-width: 0; }
.rate-form .form-actions { margin-top: 16px; }
/* The best option's name stays on one line in the investigations list. */
.inv-list td:nth-child(5) { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- texted requests */
.text-hint { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.text-hint .ic { width: 14px; height: 14px; color: var(--faint); align-self: center; }
.text-hint b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.how-steps { margin: 10px 0 4px; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--fg-2); max-width: 78ch; line-height: 1.55; list-style: decimal; }
.how-steps li { padding: 0; }
.how-steps li::before, .how-steps li::after { content: none; }
.how-steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.sms-table td { vertical-align: top; }
.sms-table .sms-body { display: block; max-width: 60ch; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- "Text a request" demo */
.td { display: grid; grid-template-columns: 392px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 4px; }
.td-phone { display: flex; flex-direction: column; height: min(700px, calc(100dvh - 236px)); min-height: 460px; border-radius: 28px; background: var(--bg); box-shadow: 0 0 0 var(--hair) var(--line-2); overflow: hidden; }
.td-top { display: flex; align-items: center; gap: 10px; padding: 14px 18px; box-shadow: inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.td-av { width: 34px; height: 34px; border-radius: 50%; background: var(--fill-1); display: grid; place-items: center; flex: none; }
.td-av img { height: 19px; width: auto; }
.td-who { display: grid; gap: 1px; line-height: 1.25; }
.td-who b { font-size: 14px; font-weight: 600; }
.td-who span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-thread { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.td-time { align-self: center; font-size: 11.5px; color: var(--faint); margin: 12px 0 6px; }
.td-time:first-child { margin-top: 2px; }
.td-msg { max-width: 82%; padding: 8px 13px; border-radius: 19px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.td-msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: 7px; }
.td-msg.them { align-self: flex-start; background: var(--fill-2); color: var(--fg); border-bottom-left-radius: 7px; }
.td-msg.me + .td-msg.them, .td-msg.them + .td-msg.me { margin-top: 9px; }
.td-msg a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
.td-msg.them a { color: var(--accent-text); }
.td-msg.pending { opacity: .6; }
.td-msg.failed { opacity: 1; box-shadow: 0 0 0 1.5px var(--bad); }
.td-pic { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.td-pic .ic { width: 15px; height: 15px; }
.td-pic + span { display: block; margin-top: 4px; }
.td-typing { display: inline-flex; gap: 4px; padding: 13px 14px; }
.td-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: td-dot 1.2s ease-in-out infinite; }
.td-typing i:nth-child(2) { animation-delay: .15s; } .td-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes td-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: .9; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .td-typing i { animation: none; } }
.td-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13.5px; max-width: 30ch; line-height: 1.5; }
.td-attach { padding: 0 14px 4px; }
.td-attach-in { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--fg-2); background: var(--fill-1); border-radius: 10px; padding: 2px 2px 2px 10px; max-width: 100%; }
.td-attach-in > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-attach-in .ic { width: 14px; height: 14px; color: var(--muted); flex: none; }
.td-attach-in .icon-btn { width: 26px; height: 26px; }
.td-compose { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px 12px 8px; box-shadow: inset 0 var(--hair) 0 var(--line); }
.td-compose textarea { flex: 1; height: 36px; min-height: 36px; max-height: 140px; resize: none; border-radius: 18px; padding: 8px 14px; font-size: 14.5px; line-height: 20px; }
.td-photo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; flex: none; transition: background var(--d-fast), color var(--d-fast); }
.td-photo:hover { background: var(--fill-1); color: var(--fg); }
.td-photo .ic { width: 19px; height: 19px; }
.td-send { width: 32px; height: 32px; margin: 0 0 2px 2px; border-radius: 50%; border: 0; padding: 0; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; cursor: pointer; flex: none; transition: background var(--d-fast), transform var(--d-spring) var(--spring); }
.td-send:hover:not(:disabled) { background: var(--accent-hover); }
.td-send:active:not(:disabled) { transform: scale(.9); }
.td-send:disabled { background: var(--fill-3); color: var(--bg); cursor: default; }
.td-send .ic { width: 17px; height: 17px; stroke-width: 2.4; }
.td-side { padding-top: 6px; max-width: 60ch; }
.td-side h2 { font-size: 15px; margin-bottom: 12px; }
.td-side h2:not(:first-child) { margin-top: 36px; }
.td-try { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.td-chip { font: inherit; font-size: 13.5px; line-height: 1.4; text-align: left; border: 0; cursor: pointer; color: var(--fg-2); background: var(--fill-1); padding: 9px 14px; border-radius: 17px 17px 17px 7px; transition: background var(--d-fast), color var(--d-fast), transform var(--d-spring) var(--spring); }
.td-chip:hover { background: var(--fill-2); color: var(--fg); }
.td-chip:active { transform: scale(.98); }
.td-side .how-steps { margin-top: 0; }
.td-side .note { margin-top: 16px; line-height: 1.55; }
.td-side .note b { font-weight: 600; color: var(--fg-2); }
@media (max-width: 960px) { .td { grid-template-columns: minmax(0, 1fr); gap: 32px; } .td-phone { height: 72dvh; max-width: 480px; } }

/* ---------------------------------------------------------------- list polish
   The investigations list: a calmer header row, tabular times, and empty cells that recede. */
.page-head { padding-top: 40px; }
.inv-list th { font-size: 11.5px; letter-spacing: .01em; color: var(--faint); padding-bottom: 9px; }
.inv-list td { padding-block: 15px; }
.inv-list td.r { font-variant-numeric: tabular-nums; font-size: 13px; }
.inv-list .inv-title { line-height: 1.38; }
.inv-list .cell-sub { margin-top: 3px; }
.inv-list tr.click:hover .inv-title { color: var(--accent-text); }
.inv-list .inv-title { transition: color var(--d-fast); }

/* ---------------------------------------------------------------- settings
   A section list on the left (sticky; a row of pills on smaller screens) and one column of connections. Every
   connection has the same shape: heading and state, one line on what it does, figures, form, the address the other
   side calls, setup steps. */
.set-layout { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 0 64px; align-items: start; padding-top: 4px; }
.set-nav { position: sticky; top: calc(var(--bar) + 28px); display: grid; gap: 1px; padding-top: 6px; }
.set-nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 32px; padding: 0 10px; margin-inline: -10px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--muted); text-decoration: none; transition: background var(--d-fast), color var(--d-fast); }
.set-nav a:hover { background: var(--fill-1); color: var(--fg); }
.set-nav a[aria-current="true"] { background: var(--fill-2); color: var(--fg); font-weight: 550; }
.set-nav a:focus-visible { outline: none; box-shadow: var(--ring); }
.set-nav .dot { width: 7px; height: 7px; }
.set-main { min-width: 0; max-width: 760px; }
.set-sec { scroll-margin-top: calc(var(--bar) + 20px); }
.set-main > .set-sec:first-child { padding-top: 0; }
.set-main > .set-sec + .set-sec { padding-top: 64px; }
.set-sub { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); max-width: 70ch; line-height: 1.55; text-wrap: pretty; }
.set-sub b, .how-steps b, .set-sec .small b { font-weight: 550; color: var(--fg-2); }
.set-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 32px; margin: 20px 0 0; padding: 16px 0; box-shadow: inset 0 var(--hair) 0 var(--line), inset 0 calc(-1 * var(--hair)) 0 var(--line); }
.set-stats div { display: grid; gap: 3px; align-content: start; min-width: 0; }
.set-stats dt { font-size: 12px; color: var(--muted); }
.set-stats dd { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.015em; line-height: 1.35; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.set-stats dd .mono { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.set-stats dd .of { font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.set-stats dd.s { font-size: 12.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.set-stats .bad-t { color: var(--bad); }
.set-sec .banner { margin-top: 18px; }
.set-form { display: grid; gap: 18px; padding-top: 24px; }
.set-form .form-actions { padding-top: 2px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
input.mono { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0; }
input.mono::placeholder { font-family: var(--f); font-size: 14px; }
.url-row { display: flex; gap: 10px; align-items: flex-end; }
.url-row label { flex: 1; min-width: 0; }
.url-row .btn { height: 38px; }
.set-note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.set-form .set-note { margin-top: -6px; }
.set-note .mono { color: var(--fg-2); }
.set-note.warn { display: flex; gap: 7px; align-items: flex-start; color: var(--warn); }
.set-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.copy-field { display: grid; gap: 7px; margin-top: 28px; }
.copy-field .k { font-size: 12.5px; font-weight: 500; color: var(--fg-2); }
.cf-box { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 4px 0 12px; border-radius: var(--r-sm); background: var(--fill-1); }
.cf-box .mono { flex: 1; min-width: 0; padding: 9px 0; font-size: 12.5px; line-height: 1.45; color: var(--fg-2); overflow-wrap: anywhere; }
.cf-note { font-size: 12px; color: var(--muted); }
.set-setup { margin-top: 20px; }
.set-setup + .set-setup { margin-top: 0; }
.set-setup .tbl-wrap { padding-top: 8px; }
.meter { display: block; width: 100%; max-width: 220px; height: 4px; margin-top: 7px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.meter.warn i { background: #d08a1f; } .meter.bad i { background: var(--bad); }
.set-sec .orb-pick { padding-top: 22px; max-width: none; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.sms-table td.m-who { white-space: nowrap; }
.sms-table .m-name { display: block; }
@media (max-width: 1000px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 32px; padding: 2px 18px; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-nav a { flex: none; flex-direction: row-reverse; gap: 7px; height: 30px; margin: 0; padding: 0 12px; border-radius: 15px; background: var(--fill-1); font-size: 13px; color: var(--fg-2); }
  .set-main { max-width: none; }
}
@media (max-width: 640px) {
  .fields.two { grid-template-columns: minmax(0, 1fr); }
  .set-main > .set-sec + .set-sec { padding-top: 48px; }
  .set-setup > summary .meta { display: none; }
  .url-row .btn { height: 38px; }
  .sms-table thead { display: none; }
  .sms-table, .sms-table tbody { display: block; }
  .sms-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 12px; background: linear-gradient(var(--line), var(--line)) no-repeat 0 100% / 100% var(--hair); }
  .sms-table td { display: block; padding: 0; background: none; }
  .sms-table td.m-who { grid-area: 1 / 1; white-space: normal; }
  .sms-table td.m-when { grid-area: 1 / 2; text-align: right; }
  .sms-table td.m-body { grid-column: 1 / -1; margin-top: 6px; }
  .sms-table td.m-st { grid-column: 1 / -1; margin-top: 6px; text-align: left; }
}
