/* Software Builders: shared theme (phone-first). Light is the default; a remembered dark toggle ignores the device setting. Accent is used sparingly. The sidebar and phone tab bar stay black in both themes. */
@font-face { font-family: "Poppins"; src: url("fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
:root, html.theme-light {
  --bg: #F4F5F7; --card: #FFFFFF; --card-2: #EEF0F3; --input: #FFFFFF; --border: #E2E3E8;
  --text: #16161A; --muted: #5C5C66; --nav: #3F3F48;
  --accent: #FF3400; --accent-text: #C42700; --accent-ink: #FFFFFF; --accent-soft: rgba(255,52,0,.12);
  --ok: #0F7A4A; --bad: #C0172A; --warn: #8A6A00; --info: #3B4FBF;
  --glow: none; --card-shadow: 0 1px 2px rgba(16,16,20,.05);
  --sidebar: #FFFFFF; --topbar: rgba(244,245,247,.92); --tabbar: #FFFFFF;
  --toast: #FFFFFF; --toast-border: #E2E3E8;
  --tick: #C5C6CE; --sheet-dim: rgba(16,16,20,.45); --shadow: 0 18px 50px rgba(16,16,20,.14);
  --head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Fluid scale: 360px to 1920px. The shell and screens use these tokens. The typography retrofit completed in v2.79.0. The remaining spacing, corner and 44px tap retrofit completed in v2.97.0. Printed A4 invoice and Scope of Works output keeps fixed print sizes. */
  --step--2: clamp(0.75rem, 0.7212rem + 0.1282vw, 0.875rem);
  --step--1: clamp(0.875rem, 0.8462rem + 0.1282vw, 1rem);
  --step-0:  clamp(1rem, 0.9712rem + 0.1282vw, 1.125rem);
  --step-1:  clamp(1.125rem, 1.0673rem + 0.2564vw, 1.375rem);
  --step-2:  clamp(1.375rem, 1.2885rem + 0.3846vw, 1.75rem);
  --step-3:  clamp(1.625rem, 1.4808rem + 0.641vw, 2.25rem);
  --step-4:  clamp(1.875rem, 1.6731rem + 0.8974vw, 2.75rem);
  --step-5:  clamp(2rem, 1.7115rem + 1.2821vw, 3.25rem);
  --space-3xs: clamp(0.25rem, 0.2212rem + 0.1282vw, 0.375rem);
  --space-2xs: clamp(0.375rem, 0.3462rem + 0.1282vw, 0.5rem);
  --space-xs:  clamp(0.5rem, 0.4423rem + 0.2564vw, 0.75rem);
  --space-s:   clamp(0.75rem, 0.6923rem + 0.2564vw, 1rem);
  --space-m:   clamp(1rem, 0.8846rem + 0.5128vw, 1.5rem);
  --space-l:   clamp(1.5rem, 1.3846rem + 0.5128vw, 2rem);
  --space-xl:  clamp(2rem, 1.7692rem + 1.0256vw, 3rem);
  --space-2xl: clamp(3rem, 2.6538rem + 1.5385vw, 4.5rem);
  --space-3xl: clamp(3rem, 2.5385rem + 2.0513vw, 5rem);
  --space-gutter: clamp(1rem, 0.7692rem + 1.0256vw, 2rem);
  --space-10: clamp(0.625rem, 0.5673rem + 0.2564vw, 0.875rem);
  --space-14: clamp(0.875rem, 0.8173rem + 0.2564vw, 1.125rem);
  --space-18: clamp(1.125rem, 1.0385rem + 0.3846vw, 1.5rem);
  --space-20: clamp(1.25rem, 1.1635rem + 0.3846vw, 1.625rem);
  --space-28: clamp(1.75rem, 1.6346rem + 0.5128vw, 2.25rem);
  --space-40: clamp(2.5rem, 2.3558rem + 0.641vw, 3.125rem);
  --radius-s: clamp(0.375rem, 0.3173rem + 0.2564vw, 0.625rem);
  --radius-m: clamp(0.625rem, 0.5385rem + 0.3846vw, 1rem);
  --radius-l: clamp(1rem, 0.8846rem + 0.5128vw, 1.5rem);
  --icon-sm: clamp(0.875rem, 0.8462rem + 0.1282vw, 1rem);
  --icon-m:  clamp(1.125rem, 1.0673rem + 0.2564vw, 1.375rem);
  --icon-lg: clamp(1.5rem, 1.3846rem + 0.5128vw, 2rem);
  --btn-pad-y: clamp(0.625rem, 0.5673rem + 0.2564vw, 0.875rem);
  --btn-pad-x: clamp(1rem, 0.8846rem + 0.5128vw, 1.5rem);
  --btn-font:  clamp(0.9375rem, 0.8942rem + 0.1923vw, 1.125rem);
  --tap: 2.75rem;
  --measure:      clamp(32.5rem, 29.3846rem + 13.8462vw, 46rem);
  --measure-wide: clamp(40rem, 36.7692rem + 14.359vw, 54rem);
  --wrap:         clamp(80rem, 60rem + 25vw, 90rem);
  --gutter: var(--space-gutter);
}
html.theme-dark, body.theme-dark {
  --bg: #0B0B0D; --card: #16161A; --card-2: #1B1B20; --input: #101013; --border: #26262C;
  --text: #F2F2F3; --muted: #A4A4AD; --nav: #C9C9D0;
  --accent: #FF3400; --accent-text: #FF3400; --accent-soft: rgba(255,52,0,.16);
  --ok: #3DDC97; --bad: #FF5C6A; --warn: #F2C14E; --info: #8FA3FF;
  --glow: 0 0 18px rgba(255,52,0,.32); --card-shadow: none;
  --sidebar: #0E0E11; --topbar: rgba(11,11,13,.94); --tabbar: #0E0E11;
  --toast: #26262C; --toast-border: #36363E;
  --tick: #4A4A53; --sheet-dim: rgba(0,0,0,.6); --shadow: 0 24px 80px rgba(0,0,0,.6);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); overscroll-behavior-y: none; color-scheme: light; -webkit-text-size-adjust: 100%; }
html.theme-dark { color-scheme: dark; }
body { margin: 0; overscroll-behavior-y: none; background: var(--bg); color: var(--text); font: 400 var(--step-0)/1.5 var(--body); overflow-x: hidden; overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: var(--step-3); line-height: 1.15; } h2 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
h3 { font-size: var(--step-1); }
p { margin: 0; } a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: var(--step--1); } .tiny { font-size: var(--step--1); }
.bad { color: var(--bad); } .ok { color: var(--ok); } .accent { color: var(--accent-text); }
/* Bottom nav height = 60px tab + 1px border (+ the Android/iOS safe area, added on the nav itself). #app clears it plus 24px of air. */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Tab content height (icon + label + padding), not including the safe-area inset. */
  --tabbar-h: 64px;
}
/* min-height uses dvh (dynamic visual viewport) with svh/vh fallbacks, so the layout tracks the Chrome URL bar. */
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100svh; min-height: 100dvh; padding-bottom: calc(var(--tabbar-h) + var(--space-l) + var(--safe-bottom)); }
body.no-tabs #app { padding-bottom: var(--space-l); }
.topbar { position: sticky; top: 0; z-index: var(--z-topbar); display: flex; align-items: center; gap: 4px; box-sizing: border-box; height: calc(56px + var(--safe-top)); padding: var(--safe-top) var(--space-xs) 0 var(--space-s); background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .title { flex: 1; min-width: 0; font: 600 var(--step-2) var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: inline-flex; align-items: center; gap: var(--space-xs); }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: var(--glow); }
.iconbtn { width: var(--tap); height: var(--tap); display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--text); border-radius: var(--radius-m); cursor: pointer; padding: 0; text-decoration: none; position: relative; }
.iconbtn:active { background: var(--card); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.page { padding: var(--space-m) var(--space-m) var(--space-l); display: flex; flex-direction: column; gap: var(--space-20); }
.section { display: flex; flex-direction: column; gap: var(--space-xs); }
.section-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--card-shadow); }
.pad { padding: var(--space-14); }
.stack { display: flex; flex-direction: column; gap: var(--space-s); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-10); } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-10); }
.kv { display: flex; flex-direction: column; gap: 2px; padding: var(--space-s) var(--space-14); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-m); min-width: 0; }
.kv .k { font-size: var(--step--2); color: var(--muted); } .kv .v { font: 600 var(--step-1) var(--head); font-feature-settings: "tnum" 1; }
.row { display: flex; align-items: center; gap: var(--space-s); min-height: 56px; padding: var(--space-10) var(--space-14); color: inherit; text-decoration: none; border: 0; border-bottom: 1px solid var(--border); background: none; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.row:last-child { border-bottom: 0; } a.row:active, button.row:active { background: var(--card-2); }
@media (hover: hover) and (pointer: fine) { a.row:hover, button.row:hover { background: var(--card-2); } .stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--card-shadow); } }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .row .t { font-weight: 600; overflow-wrap: break-word; word-break: normal; } .row .s { font-size: var(--step--1); color: var(--muted); overflow-wrap: break-word; word-break: normal; }
.row .end { text-align: right; font-size: var(--step--1); color: var(--muted); flex: none; max-width: 40%; }
.chev { color: var(--muted); width: 18px; height: 18px; }
.empty { padding: var(--space-28) var(--space-18); text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); }
.empty .icon { width: 32px; height: 32px; color: var(--muted); opacity: .85; }
.empty-title { font: 600 var(--step-0) var(--head); color: var(--text); }
.empty p { max-width: 32ch; }
.avatar { width: 40px; height: 40px; border-radius: var(--radius-m); background: var(--card-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font: 600 var(--step-0) var(--head); color: var(--text); flex: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 var(--space-10); border-radius: 99px; background: var(--chip-bg, var(--card-2)); border: 1px solid var(--chip-border, var(--border)); font-size: var(--step--1); font-weight: 500; color: var(--chip-fg, var(--muted)); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--muted)); }
.badge.plain::before { display: none; }
.badge.sample { color: var(--warn); border-color: rgba(138,106,0,.3); --chip-bg: #FFF6D9; --chip-fg: #7A4E00; }
.s-lead { --dot: #6E6E78; --chip-bg: #F0F0F2; --chip-fg: #3C3C44; } .s-quoted { --dot: var(--info); --chip-bg: #E8F0FE; --chip-fg: #1543A0; } .s-in_progress { --dot: var(--accent); --chip-bg: #FFE8E0; --chip-fg: #9A1F00; } .s-review { --dot: var(--warn); --chip-bg: #FFF4D6; --chip-fg: #7A4E00; } .s-live { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; } .s-maintenance { --dot: #0F7A72; --chip-bg: #E6F7F5; --chip-fg: #0F5E57; }
.s-paid { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; } .s-sent { --dot: var(--info); --chip-bg: #E8F0FE; --chip-fg: #1543A0; } .s-draft { --dot: #6E6E78; --chip-bg: #F0F0F2; --chip-fg: #3C3C44; } .s-overdue { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); color: var(--bad); }
.s-invited { --dot: var(--warn); --chip-bg: #FFF4D6; --chip-fg: #7A4E00; } .s-active { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; } .s-disabled { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--tap); padding: 0 var(--space-m); border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--card); color: var(--text); font: 600 var(--btn-font) var(--body); cursor: pointer; text-decoration: none; }
.btn:active { background: var(--card-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: var(--glow); font-weight: 700; }
.btn.primary:hover, .btn.primary:focus-visible, .btn.primary:active { color: var(--accent-ink); background: var(--accent); }
.btn.primary:active { filter: brightness(.92); }
.btn.danger { color: var(--bad); } .btn.block { width: 100%; } .btn.quiet { background: none; border: 0; color: var(--accent-text); font-weight: 500; min-height: var(--tap); width: auto; padding: 0 var(--space-xs); box-shadow: none; } .btn.quiet:active { background: var(--card-2); } .btn[disabled] { opacity: .55; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xs); }
.quick .btn { padding: 0 var(--space-xs); font-size: var(--step--1); }
label.lbl { font-size: var(--step--1); color: var(--muted); display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 48px; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-m); padding: 0 var(--space-14); font: 400 var(--step-0) var(--body); appearance: none; -webkit-appearance: none; }
/* Checkboxes and radios: the rule above removes the native look, which also removes the checked state. Restore it with the brand accent. */
input[type=checkbox], input[type=radio] { appearance: auto; -webkit-appearance: auto; accent-color: #FF3400; width: 22px; height: 22px; min-height: 22px; padding: 0; flex: none; cursor: pointer; }
input[type=checkbox]:disabled, input[type=radio]:disabled { cursor: not-allowed; opacity: .6; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea { padding: var(--space-s) var(--space-14); min-height: 96px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field { display: flex; flex-direction: column; } .field .hint { font-size: var(--step--1); color: var(--muted); margin-top: 4px; } .field .err { font-size: var(--step--1); color: var(--bad); margin-top: 4px; }
.field.bad-field input, .field.bad-field select, .field.bad-field textarea { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: var(--space-s); min-height: var(--tap); cursor: pointer; }
.check input { width: 24px; height: 24px; min-height: 24px; flex: none; accent-color: var(--accent); }
.form-error { color: var(--bad); font-size: var(--step--1); min-height: 0; }
.alert { padding: var(--space-s) var(--space-14); border-radius: var(--radius-m); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); display: flex; gap: var(--space-10); align-items: center; }
.alert.bad { background: rgba(255,92,106,.1); border-color: rgba(255,92,106,.4); }
/* Truly fixed: no transform, transition or scroll-linked behaviour. Sits above the Android gesture or button bar via the safe-area padding. */
.tabbar { position: fixed; z-index: var(--z-tabbar); left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; display: flex; align-items: stretch; background: var(--tabbar); border-top: 1px solid var(--border); padding-bottom: calc(6px + var(--safe-bottom)); transform: none; transition: none; overflow: visible; }
.tab { flex: 1; min-height: 0; height: auto; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; color: var(--muted); text-decoration: none; font-size: var(--step--2); line-height: 1.15; font-weight: 500; position: relative; padding: var(--space-xs) 2px 4px; overflow: visible; }
.tab > span { display: block; line-height: 1.15; max-width: 100%; text-align: center; white-space: nowrap; overflow: visible; }
.tab.active { color: var(--accent-text); }
html.theme-dark .tab.active .icon { filter: drop-shadow(0 0 6px rgba(255,52,0,.6)); }
.tab .pip { position: absolute; top: 8px; left: calc(50% + 8px); width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: var(--glow); }
.progress { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; } .progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.progress.thin { height: 5px; }
.task { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 0 4px 0 0; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.tick { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; cursor: pointer; }
.tick i { width: 24px; height: 24px; border-radius: var(--radius-s); border: 2px solid var(--tick); display: inline-flex; align-items: center; justify-content: center; }
.tick i .icon { width: 16px; height: 16px; stroke-width: 3; opacity: 0; color: var(--accent-ink); }
.tick.on i { background: var(--ok); border-color: var(--ok); } .tick.on i .icon { opacity: 1; }
.task .tm { flex: 1; min-width: 0; padding: var(--space-xs) 0; } .task.done .tm .t { text-decoration: line-through; color: var(--muted); }
.task .t { font-size: var(--step-0); overflow-wrap: break-word; word-break: normal; } .task .s { font-size: var(--step--1); color: var(--muted); overflow-wrap: break-word; word-break: normal; }
.upd { padding: var(--space-s) var(--space-14); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-xs); } .upd:last-child { border-bottom: 0; }
.upd .body { white-space: pre-wrap; } .upd .meta { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; font-size: var(--step--1); color: var(--muted); }
.upd.unread { background: var(--accent-soft); } .upd.fromclient { border-left: 3px solid var(--info); }
.pill-btn { min-height: var(--tap); min-width: var(--tap); justify-content: center; display: inline-flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.sheet-bg { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--sheet-dim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; background: var(--card); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; padding: 0; max-height: 88dvh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: center; gap: var(--space-xs); flex: none; padding: var(--space-xs) var(--space-xs) 0 var(--space-m); }
.sheet-head .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto; }
.sheet-close { margin-left: auto; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px var(--space-xs) calc(var(--space-m) + var(--safe-bottom)); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto var(--space-10); }
.sheet .row { border-radius: var(--radius-m); border-bottom: 0; }
.sheet h3 { padding: 6px var(--space-s) var(--space-xs); }
.toast { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom)); transform: translateX(-50%); background: var(--toast); color: var(--text); padding: var(--space-s) var(--space-m); border-radius: var(--radius-m); border: 1px solid var(--toast-border); box-shadow: var(--shadow); max-width: calc(100vw - 32px); font-size: var(--step--1); }
.toast.bad { border-color: var(--bad); }
.linkbox { font: var(--step--1) ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--input); border: 1px dashed var(--border); border-radius: var(--radius-m); padding: var(--space-10) var(--space-s); word-break: break-all; user-select: all; }
.center-screen { min-height: 100vh; min-height: 100svh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: calc(var(--space-l) + var(--safe-top)) var(--space-20) calc(var(--space-l) + var(--safe-bottom)); max-width: 440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: var(--space-10); font: 600 var(--step-2) var(--head); }
.logo .brand-dot { width: 14px; height: 14px; border-radius: 4px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: var(--space-40) auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--border); }
.tag-soon { font-size: var(--step--2); color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 2px var(--space-xs); }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (min-width: 700px) { .page { padding-top: var(--space-l); } }

.sheet-pad { padding: var(--space-xs) var(--space-s) 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: var(--space-xs); }
.addrow { display: flex; gap: var(--space-xs); align-items: stretch; } .addrow input { flex: 1; min-width: 0; }
.addrow .btn { width: 48px; padding: 0; flex: none; min-height: 48px; }
.hstack { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.actions-row { display: flex; gap: var(--space-xs); flex-wrap: wrap; padding: var(--space-xs) var(--space-14) var(--space-14); } .actions-row .btn { flex: 1 1 auto; font-size: var(--step--1); }
.actions-row.tight { padding: 0; } .actions-row.tight .btn { flex: 0 1 auto; }
.sec-pad { padding: 4px var(--space-14) var(--space-14); }
.hstack > .progress { flex: 1; min-width: 0; }
a.inline { display: inline-flex; align-items: center; min-height: var(--tap); }


/* ===================== v1.1: responsive shell, focus, readability ===================== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a.row:focus-visible, button.row:focus-visible, .tab:focus-visible, .navitem:focus-visible, .tbl a:focus-visible { outline-offset: -3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); border: 0; white-space: nowrap; }
[hidden] { display: none !important; }
.skip { position: fixed; left: 8px; top: -60px; z-index: var(--z-top); background: var(--accent); color: var(--accent-ink); padding: var(--space-s) var(--space-m); border-radius: var(--radius-m); font-weight: 600; }
.skip:hover, .skip:focus-visible, .skip:active { color: var(--accent-ink); background: var(--accent); text-decoration: none; }
.skip:focus { top: 8px; }
#view:focus { outline: none; }
.alert.info { background: var(--card-2); border-color: var(--border); }
.alert.ok { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.4); }
.stack.tight { gap: var(--space-xs); } .big { font: 600 var(--step-2) var(--head); }
.brand-logo { height: 28px; max-width: 220px; width: auto; object-fit: contain; display: block; }
.brand-mark { display: inline-flex; align-items: center; }
.brand-mark .logo-on-dark { display: none; }
.brand-mark .logo-on-light { display: block; }
.brand-mark .brand-mark-icon { display: none; width: 28px; height: 28px; border-radius: 7px; }
/* Dark surfaces (and the dark theme) show the white wordmark. */
.on-dark .brand-mark .logo-on-light,
html.theme-dark .brand-mark .logo-on-light,
body.theme-dark .brand-mark .logo-on-light { display: none; }
.on-dark .brand-mark .logo-on-dark,
html.theme-dark .brand-mark .logo-on-dark,
body.theme-dark .brand-mark .logo-on-dark { display: block; }
.on-light .brand-mark .logo-on-dark { display: none; }
.on-light .brand-mark .logo-on-light { display: block; }
.logo.has-wordmark .logo-text { display: none; }
.center-screen .logo.has-wordmark .brand-logo { height: var(--tap); max-width: min(100%, 360px); }
.logo-previews { display: grid; gap: var(--space-10); grid-template-columns: 1fr; }
@media (min-width: 768px) { .logo-previews { grid-template-columns: 1fr 1fr; } }
.logo-prev.on-dark { background: #0B0B0D; }
.logo-prev.on-light { background: #F4F4F5; }
.avatar { overflow: hidden; } .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; } .avatar.favicon { background: #fff; padding: 4px; } .avatar.favicon img { object-fit: contain; }
.avatar.sm { width: 34px; height: 34px; border-radius: 50%; font-size: var(--step--1); } .avatar.lg { width: 48px; height: 48px; border-radius: 50%; } .avatar.xl { width: 84px; height: 84px; border-radius: 50%; font-size: var(--step-3); }
.profile-head { display: flex; gap: var(--space-m); align-items: center; }
.sidebar { display: none; }
.shell-main { min-width: 0; }
.wide-only { display: none; }
.phone-only { display: block; }
body.shell #app { max-width: none; margin: 0; padding-bottom: 0; }
.topbar .title { font-size: var(--step-2); }
.topbtn { min-height: 40px; padding: 0 var(--space-14); font-size: var(--step--1); }
.dgrid { display: grid; gap: var(--space-20); grid-template-columns: minmax(0, 1fr); align-items: start; }
.dcol { display: flex; flex-direction: column; gap: var(--space-20); min-width: 0; }
.fgrid { display: grid; gap: var(--space-14); grid-template-columns: minmax(0, 1fr); }
.fsec h3 { font-size: var(--step-0); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 6px; }
.fgrid > .fsec:first-child h3 { border-top: 0; margin-top: 0; padding-top: 0; }
.check.switch { padding: 4px 0; } 
.toast { display: flex; align-items: center; gap: var(--space-14); }
.toast-act { background: none; border: 0; color: var(--accent-text); font: 600 var(--step-0) var(--body); min-height: var(--tap); padding: 0 var(--space-xs); cursor: pointer; text-decoration: underline; }
.acct-card { display: flex; align-items: center; gap: var(--space-s); padding: var(--space-xs) var(--space-s) var(--space-s); } .acct-card .who { display: flex; flex-direction: column; min-width: 0; } .acct-card small, .side-user small { color: var(--muted); font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; }
.steps { margin: 0; padding-left: var(--space-20); display: flex; flex-direction: column; gap: 6px; }
.qrbox { background: #fff; padding: var(--space-10); border-radius: var(--radius-m); width: 220px; max-width: 100%; margin: 0 auto; } .qrbox svg { display: block; width: 100%; height: auto; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); } .codes code { background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--space-10); text-align: center; font: var(--step-0) ui-monospace, SFMono-Regular, Menlo, monospace; }
.ok-badge { color: var(--ok); border-color: rgba(61,220,151,.4); }
.dev .btn { min-height: var(--tap); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.tbl th { text-align: left; font: 500 var(--step--1) var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: var(--space-s) var(--space-m); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: var(--space-14) var(--space-m); border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; } .tbl tbody tr[data-href]:hover { background: var(--card-2); }
.tbl td.num, .tbl th.num { text-align: right; font-feature-settings: "tnum" 1; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.tbl a.cell-link { font-weight: 600; } .tbl a.cell-link:hover { color: var(--accent-text); }
.tbl .sub { display: block; font-size: var(--step--1); color: var(--muted); font-weight: 400; }
.tbl tr.archived td { opacity: .65; }
.badge.prio-urgent { color: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); border-color: rgba(192,23,42,.28); } .badge.prio-high { color: #7A4E00; --chip-bg: #FFF4D6; --chip-fg: #7A4E00; border-color: rgba(138,106,0,.3); } .badge.prio-low { opacity: .85; }
.s-rejected { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); } .s-pending { --dot: var(--warn); --chip-bg: #FFF4D6; --chip-fg: #7A4E00; } .s-approved { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; }
.timeline { display: flex; flex-direction: column; } .tl-item { padding: var(--space-s) var(--space-14) var(--space-s) 34px; border-bottom: 1px solid var(--border); position: relative; display: flex; flex-direction: column; gap: 6px; } .tl-item:last-child { border-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 14px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
.tl-item::after { content: ""; position: absolute; left: 18px; top: 32px; bottom: -12px; width: 1px; background: var(--border); } .tl-item:last-child::after { display: none; }
.tl-item .body { white-space: pre-wrap; } .tl-item .meta { font-size: var(--step--1); color: var(--muted); display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.archived-banner { display: flex; gap: var(--space-s); align-items: center; flex-wrap: wrap; justify-content: space-between; }
.contact { padding: var(--space-14); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-xs); } .contact:last-child { border-bottom: 0; }
.contact .ln { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; font-size: var(--step--1); color: var(--muted); } .contact .ln a { color: var(--text); display: inline-flex; align-items: center; min-height: 32px; gap: 6px; text-decoration: underline; text-decoration-color: var(--border); }
.contact .nm { font-weight: 600; font-size: var(--step-0); display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.kvlist { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-xs) var(--space-m); padding: var(--space-14); } .kvlist dt { color: var(--muted); font-size: var(--step--1); } .kvlist dd { margin: 0; overflow-wrap: break-word; }
.segmented { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; } .segmented.wrap { flex-wrap: wrap; overflow: visible; } .segmented a { flex: none; min-height: var(--tap); display: inline-flex; align-items: center; padding: 0 var(--space-m); border-radius: 99px; border: 1px solid var(--border); background: var(--card); font-weight: 500; }
.segmented a[aria-current=page] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.swatch { width: var(--tap); height: var(--tap); border-radius: var(--radius-m); border: 1px solid var(--border); flex: none; }
.colorrow { display: flex; gap: var(--space-10); align-items: flex-end; } .colorrow .field { flex: 1; }
input[type=color] { padding: 4px; min-width: 56px; width: 56px; flex: none; cursor: pointer; }
.logo-prev { background: var(--card-2); border: 1px dashed var(--border); border-radius: var(--radius-m); padding: var(--space-14); display: flex; align-items: center; justify-content: center; min-height: 80px; } .logo-prev img { max-height: 60px; max-width: 100%; }
.pri-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); } .pri-urgent { background: var(--bad); } .pri-high { background: var(--warn); }
.task .who { font-size: var(--step--1); color: var(--muted); }
.moremenu { display: flex; gap: var(--space-xs); flex-wrap: wrap; }
body.density-compact .row { min-height: var(--tap); padding-top: 6px; padding-bottom: 6px; } body.density-compact .page { gap: var(--space-14); } body.density-compact .tbl td { padding: var(--space-xs) var(--space-14); } body.density-compact .task { min-height: var(--tap); } body.density-compact .contact, body.density-compact .upd { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- Phone (< 768px): header with avatar, bottom tabs ---------- */
@media (max-width: 767px) {
  body.shell #app { padding-bottom: calc(var(--tabbar-h) + var(--space-l) + var(--safe-bottom)); }
  .segmented { gap: 4px; -webkit-overflow-scrolling: touch; }
  .segmented a { padding: 0 var(--space-s); font-size: var(--step--1); }
  .topbar .topbtn { display: none; }
  .wide-only { display: none; }
  .topbar .brand-mark .brand-logo { display: none !important; }
  .topbar .brand-mark .brand-mark-icon { display: block; width: 28px; height: 28px; border-radius: 7px; }
  .topbar .brand-logo.custom { height: 24px; max-width: 120px; }
  /* Menus are full screen on a phone (Carl, 16 Nov 2026): 100dvh, safe areas, close button, scroll only if the content overflows. */
  .sheet-bg { align-items: stretch; justify-content: stretch; }
  .sheet { height: 100dvh; height: 100%; max-height: 100dvh; max-height: 100%; max-width: none; border-radius: 0; border: 0; box-shadow: none; }
  .sheet-head { padding: calc(6px + var(--safe-top)) var(--space-xs) 6px var(--space-m); border-bottom: 1px solid var(--border); }
  .sheet-head .grab { display: none; }
  .sheet-body { padding: 4px var(--space-xs) calc(var(--space-s) + var(--safe-bottom)); display: flex; flex-direction: column; }
  .sheet-body .acct-card { padding: 4px var(--space-xs) var(--space-xs); }
  .sheet-body .row { min-height: var(--tap); padding: 6px var(--space-s); }
  .sheet-body .row .s { display: none; }
  .sheet-body .phone-only { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .sheet-body .phone-only .divider, .sheet-body .phone-only .sec-pad { grid-column: 1 / -1; }
  .sheet-body .phone-only .sec-pad { padding: var(--space-xs) var(--space-s) 2px; }
  .sheet-body .phone-only .row { min-height: var(--tap); padding: 6px var(--space-10); }
  .sheet-body .phone-only .row .chev { display: none; }
  .sheet-body .phone-only .row .t { font-size: var(--step--1); }
  /* Short phones (360x780): a slightly tighter row so the whole More menu still fits with no scrolling now that Activity is listed (v2.17.0). */
  @media (max-height: 800px) { .sheet-body .phone-only .row { min-height: 38px; padding-top: 3px; padding-bottom: 3px; } }
  .sheet-foot { margin-top: auto; flex: none; }
  .palette-bg { padding: 0; align-items: stretch; }
  .palette { height: 100dvh; height: 100%; max-height: 100dvh; max-height: 100%; border-radius: 0; padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); }
  .palette-q .kbd { display: none; }
  .palette-close { display: inline-flex; }
}
/* ---------- Tablet and up: sheets become centred dialogs ---------- */
@media (min-width: 768px) {
  body.shell #app { display: flex; align-items: stretch; min-height: 100dvh; }
  .sidebar { display: flex; flex: none; align-self: stretch; min-height: 100dvh; background: var(--sidebar); border-right: 1px solid var(--border); }
  .sidebar-inner { position: sticky; top: 0; height: 100dvh; max-height: 100dvh; display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box; overflow: hidden; }
  .shell-main { flex: 1; min-width: 0; margin-left: 0; }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 20px; border: 1px solid var(--border); max-width: 560px; max-height: 86vh; height: auto; padding: 0; margin: var(--space-l); box-shadow: var(--shadow); }
  .sheet-head { padding: var(--space-xs) var(--space-xs) 0 var(--space-m); border-bottom: 0; }
  .sheet-head .grab, .sheet .grab { display: none; }
  .sheet-body { padding: 0 var(--space-s) var(--space-m); overflow-y: auto; }
  .phone-only { display: none; }
  .toast { bottom: 28px; }
  .page { padding: var(--space-l) var(--space-28) var(--space-40); max-width: 1100px; margin: 0 auto; width: 100%; }
  .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-l); }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid > .full { grid-column: 1 / -1; }
  .formbtn { width: auto; align-self: flex-start; min-width: 200px; }
  .list-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-2 > .row:nth-child(odd), .list-2 > .contact:nth-child(odd) { border-right: 1px solid var(--border); }
  .list-2 > .empty { grid-column: 1 / -1; }
  .quick { max-width: 520px; }
}
/* ---------- Tablet (768 - 1199px): slim icon rail on the left, no bottom tabs ---------- */
@media (min-width: 768px) and (max-width: 1199px) {
  .tabbar { display: none; }
  body.shell #app { padding-bottom: 0; }
  .sidebar { width: 88px; }
  .sidebar-inner { align-items: center; padding: var(--space-14) 6px; }
  .side-brand { height: var(--tap); display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-xs); } .side-name { display: none; } .side-brand .brand-logo { height: 30px; max-width: 64px; } .side-brand .brand-dot { width: 18px; height: 18px; border-radius: 5px; }
  .side-brand .brand-mark .brand-logo { display: none !important; } .side-brand .brand-mark .brand-mark-icon { display: block; width: 36px; height: 36px; border-radius: 9px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; width: 100%; overflow-y: auto; }
  .navitem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 62px; border-radius: var(--radius-m); color: var(--muted); font-size: var(--step--2); font-weight: 500; text-decoration: none; padding: 6px 2px; }
  .navitem:hover { background: var(--card); color: var(--text); } .navitem.active { color: var(--accent-text); background: var(--accent-soft); }
  .side-sep { height: 1px; background: var(--border); margin: 6px var(--space-s); }
  .side-user { display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 6px; border-radius: var(--radius-m); cursor: pointer; color: var(--text); min-height: 52px; width: 100%; } .side-user:hover { background: var(--card); } .side-user .who { display: none; }
  .topbar { position: sticky; background: var(--topbar); padding: var(--safe-top) var(--space-20) 0; height: calc(64px + var(--safe-top)); }
  .topbar .brand, .topbar .acct { display: none; }
  .topbar .title { font-size: var(--step-2); }
  .page { padding: var(--space-l) var(--space-xl) var(--space-2xl); }
}
/* ---------- Desktop (>= 1200px): fixed left sidebar with labels, wide tables, multi-column detail pages ---------- */
@media (min-width: 1200px) {
  .tabbar { display: none; }
  .narrow-only { display: none; }
  .wide-only { display: block; }
  .sidebar { width: 288px; }
  .sidebar-inner { padding: var(--space-18) var(--space-m) var(--space-14); }
  .side-brand { display: flex; align-items: center; gap: var(--space-s); padding: 6px var(--space-s) var(--space-m); font: 600 var(--step-1) var(--head); } .side-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; } .side-name small { font: 500 var(--step--2) var(--body); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
  .side-brand .brand-dot { width: 16px; height: 16px; border-radius: 5px; flex: none; }
  .side-brand.has-wordmark { flex-direction: column; align-items: flex-start; gap: 4px; } .side-brand.has-wordmark .side-trading { display: none; } .side-brand.has-wordmark .brand-logo { height: 30px; max-width: 240px; }
  .side-brand.has-custom .brand-logo { height: 32px; max-width: 160px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
  .navitem { display: flex; align-items: center; gap: var(--space-14); min-height: 48px; padding: 0 var(--space-14); border-radius: var(--radius-m); color: var(--nav); font-size: var(--step-0); font-weight: 500; text-decoration: none; }
  .navitem:hover { background: var(--card); color: var(--text); } .navitem.active { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } .navitem .icon { width: 22px; height: 22px; }
  .side-sep { height: 1px; background: var(--border); margin: var(--space-xs) var(--space-xs); }
  .side-user { display: flex; align-items: center; gap: var(--space-s); text-align: left; background: var(--card); border: 1px solid var(--border); padding: var(--space-10) var(--space-s); border-radius: var(--radius-m); cursor: pointer; color: var(--text); min-height: 60px; width: 100%; font: inherit; } .side-user:hover { background: var(--card-2); }
  .side-user .who { display: flex; flex-direction: column; min-width: 0; flex: 1; } .side-user b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .side-user small { white-space: nowrap; }
  .topbar { position: sticky; height: calc(72px + var(--safe-top)); padding: var(--safe-top) var(--space-40) 0; background: var(--topbar); }
  .topbar .brand, .topbar .acct { display: none; }
  .topbar .title { font-size: var(--step-3); }
  .page { max-width: none; padding: var(--space-28) var(--space-40) 56px; }
  .page.narrow { max-width: 920px; margin: 0; }
  .dgrid.wide-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .dgrid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid3.six { grid-template-columns: repeat(6, 1fr); }
  .card.table-card { overflow-x: auto; }
}
@media (min-width: 1500px) { .page { padding-left: 56px; padding-right: 56px; } }

@media (min-width: 768px) { .phone-act { display: none; } .search-act { display: none; } }

.due { margin-left: var(--space-xs); white-space: nowrap; }

@media (pointer: coarse) { .contact .ln a { min-height: var(--tap); } .tl-item .pill-btn, .pill-btn { min-height: var(--tap); min-width: var(--tap); } }

.topbtn { min-height: var(--tap); }
@media (min-width: 768px) and (max-width: 1199px) { .taskmeta { grid-template-columns: 1fr; } }

button.tab { background: none; border: 0; font-family: inherit; cursor: pointer; }
@media (min-width: 768px) and (max-width: 1199px) { .dcol .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kv { min-width: 0; }
/* v2.11.0: a long status badge (for example Maintenance) inside a narrow stat tile on a phone is cut short with an ellipsis instead of pushing the page sideways */
.kv .k .badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; line-height: 24px; }
.kv .k .badge:not(.plain)::before { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; }

.toolbar .field.grow { flex: 1; max-width: 480px; min-width: 0; }

/* ===================== v1.3: avatars, stats, chips, empty states, skeletons ===================== */
.avatar.tone-0 { background: #FFE8E0; color: #9A1F00; border-color: #FFD0C4; }
.avatar.tone-1 { background: #E8F0FE; color: #1543A0; border-color: #C9D9F8; }
.avatar.tone-2 { background: #E3F6EA; color: #0B5C2E; border-color: #B9E4C8; }
.avatar.tone-3 { background: #F3E8FE; color: #5B21B6; border-color: #E0C8FA; }
.avatar.tone-4 { background: #FFF4D6; color: #7A4E00; border-color: #F3E0A8; }
.avatar.tone-5 { background: #E6F7F5; color: #0F5E57; border-color: #B9E4DE; }
.avatar.tone-6 { background: #FDE8F0; color: #9D174D; border-color: #F5C4D4; }
.avatar.tone-7 { background: #EEF0F5; color: #1E3A5F; border-color: #D2D8E6; }
html.theme-dark .avatar.favicon { background: #1B1B20; }
html.theme-dark .avatar.tone-0 { background: rgba(255,52,0,.18); color: #FFB199; border-color: rgba(255,52,0,.28); }
html.theme-dark .avatar.tone-1 { background: rgba(143,163,255,.16); color: #C5D0FF; border-color: rgba(143,163,255,.28); }
html.theme-dark .avatar.tone-2 { background: rgba(61,220,151,.14); color: #8BE8C0; border-color: rgba(61,220,151,.28); }
html.theme-dark .avatar.tone-3 { background: rgba(167,139,250,.16); color: #D4C4FF; border-color: rgba(167,139,250,.28); }
html.theme-dark .avatar.tone-4 { background: rgba(242,193,78,.16); color: #F7DC96; border-color: rgba(242,193,78,.28); }
html.theme-dark .avatar.tone-5 { background: rgba(76,201,192,.16); color: #9EE8E2; border-color: rgba(76,201,192,.28); }
html.theme-dark .avatar.tone-6 { background: rgba(255,92,106,.16); color: #FFB3BB; border-color: rgba(255,92,106,.28); }
html.theme-dark .avatar.tone-7 { background: rgba(200,210,230,.1); color: #D0D7E6; border-color: rgba(200,210,230,.2); }
html.theme-dark .s-lead, html.theme-dark .s-draft { --chip-bg: rgba(110,110,120,.2); --chip-fg: #C9C9D0; }
html.theme-dark .s-quoted, html.theme-dark .s-sent { --chip-bg: rgba(143,163,255,.16); --chip-fg: #C5D0FF; }
html.theme-dark .s-in_progress { --chip-bg: rgba(255,52,0,.16); --chip-fg: #FFB199; }
html.theme-dark .s-review, html.theme-dark .s-invited, html.theme-dark .s-pending { --chip-bg: rgba(242,193,78,.16); --chip-fg: #F7DC96; }
html.theme-dark .s-live, html.theme-dark .s-paid, html.theme-dark .s-active, html.theme-dark .s-approved { --chip-bg: rgba(61,220,151,.14); --chip-fg: #8BE8C0; }
html.theme-dark .s-maintenance { --chip-bg: rgba(76,201,192,.16); --chip-fg: #9EE8E2; }
html.theme-dark .s-overdue, html.theme-dark .s-disabled, html.theme-dark .s-rejected { --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }
/* v2.12.0 blocked chip: text on a pale red chip */
.badge.blocked { color: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); border-color: rgba(192,23,42,.28); --dot: var(--bad); }
html.theme-dark .badge.blocked { --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }
.pad-x { padding: var(--space-xs) var(--space-m) 0; }
html.theme-dark .badge.sample, html.theme-dark .badge.prio-high { --chip-bg: rgba(242,193,78,.16); --chip-fg: #F7DC96; }
html.theme-dark .badge.prio-urgent { --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-10); }
.stat { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: var(--space-14) var(--space-m); min-height: 76px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-l); box-shadow: var(--card-shadow); color: inherit; text-decoration: none; }
.stat-val { font: 700 var(--step-2)/1.1 var(--head); font-feature-settings: "tnum" 1; letter-spacing: -.02em; }
.stat-lbl { font-size: var(--step--1); color: var(--muted); }
.stat.bad .stat-val { color: var(--bad); }
.stat.warn .stat-val { color: #7A4E00; }
.stat.ok .stat-val { color: var(--ok); }
.stat.info .stat-val { color: var(--info); }
html.theme-dark .stat.warn .stat-val { color: var(--warn); }
@media (max-width: 767px) { .stats > :nth-child(3):last-child { grid-column: 1 / -1; } }
@media (min-width: 768px) { .stats, .stats.stats-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }

.due-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-xs); border-radius: 99px; font-size: var(--step--2); font-weight: 500; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.due-chip.bad { background: #FDE8EA; color: var(--bad); }
.due-chip.accent { background: #FFE8E0; color: var(--accent-text); }
html.theme-dark .due-chip.bad { background: rgba(255,92,106,.16); color: #FFB3BB; }
html.theme-dark .due-chip.accent { background: rgba(255,52,0,.16); color: #FFB199; }

.page-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-s); }
.page-hero .muted { margin-top: 4px; }
.cell-entity { display: flex; align-items: center; gap: var(--space-10); min-width: 0; } .cell-entity .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: var(--step--2); } .cell-entity .t { font-weight: 600; }

.contact { display: grid; grid-template-columns: 40px 1fr; gap: var(--space-xs) var(--space-s); align-items: start; }
.contact > .avatar { grid-row: 1 / span 4; margin-top: 2px; }
.contact .nm, .contact .ln, .contact .small, .contact .hstack { grid-column: 2; }

.skel-page { gap: var(--space-14); }
.skel { height: 14px; border-radius: var(--radius-s); background: linear-gradient(90deg, var(--card-2) 25%, var(--border) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel-title { height: 28px; width: 42%; }
.skel-line { width: 28%; }
.skel.short { width: 55%; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.tbl .progress { min-width: 72px; }
.profile-card .row { align-items: center; }

@media (min-width: 768px) and (max-width: 1199px) {
  .dcol .task .avatar { display: none; }
  .quick { max-width: none; }
}



/* ---------- Inbox accent button (top of admin nav) ---------- */
.nav-accent { position: relative; background: #D42B00; color: #fff !important; font-weight: 600; border-radius: var(--radius-m); box-shadow: none; }
.nav-accent .icon { color: #fff; stroke: #fff; }
.nav-accent:hover, .nav-accent:focus-visible { background: #BF2600; color: #fff !important; }
.nav-accent.active { background: #D42B00; color: #fff !important; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto; border-radius: 99px; background: #fff; color: #FF3400; font-size: var(--step--2); font-weight: 700; line-height: 1; font-style: normal; letter-spacing: 0; }
.tab.nav-accent { flex: 1; margin: 6px 4px; min-height: 48px; padding: 4px 0; }
.tab.nav-accent.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.tab.nav-accent .nav-count { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
@media (min-width: 700px) {
  .sidebar .nav-accent { margin: 0 0 var(--space-xs); }
}
@media (min-width: 1200px) {
  .sidebar .nav-accent { min-height: 48px; padding: 0 var(--space-14); }
}
html.sidebar-collapsed .nav-accent, body.sidebar-collapsed .nav-accent,
html.sidebar-collapsed .nav-accent.active, body.sidebar-collapsed .nav-accent.active { box-shadow: none; }
html.sidebar-collapsed .nav-accent, body.sidebar-collapsed .nav-accent { width: 64px; min-height: 48px; margin: 0 0 6px; padding: 0; justify-content: center; }
html.sidebar-collapsed .nav-count, body.sidebar-collapsed .nav-count { position: absolute; top: 2px; right: 2px; margin: 0; }

/* ===================== v1.4: collapsible sidebar, profile hero, contacts ===================== */
.side-toggle { display: none; }
.profile-hero { overflow: hidden; }
.profile-hero-shot-wrap { position: relative; background: var(--card-2); }
.profile-hero-shot { display: block; width: 100%; max-height: 180px; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 38%; background: var(--card-2); }
.profile-hero-shot-wrap .hero-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: var(--space-xs); }
.profile-hero-bar { display: flex; gap: var(--space-m); align-items: center; padding: var(--space-m) var(--space-18); border-top: 1px solid var(--border); }
.profile-hero-bar .main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profile-hero-bar .t { font-size: var(--step-2); font-weight: 600; overflow-wrap: break-word; }
.profile-hero-bar .s { color: var(--muted); font-size: var(--step--1); }
.profile-tabs { margin-bottom: 4px; }
.req { color: var(--accent-text); font-weight: 600; margin-left: 2px; }
.date-input { position: relative; display: block; width: 100%; }
.date-display { width: 100%; padding-right: 44px; font-variant-numeric: tabular-nums; }
.date-iso { position: absolute; top: 0; right: 0; bottom: 0; width: var(--tap) !important; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; background: transparent; }
.date-input::after { content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 15px; transform: translateY(-50%); border: 1.7px solid var(--muted); border-radius: 3px; pointer-events: none; box-shadow: inset 0 4px 0 0 var(--card-2); }
.board-col { min-height: 160px; }
.board-col .empty { padding: var(--space-l) var(--space-s); }
@media (hover: hover) and (pointer: fine) {
  .board-card .move { opacity: 0; transition: opacity .12s ease; }
  .board-card:hover .move, .board-card:focus-within .move { opacity: 1; }
}

.ln { display: flex; gap: var(--space-s); align-items: center; flex-wrap: wrap; font-size: var(--step--1); color: var(--muted); }
.ln a { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.contact-companies { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-companies a { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 768px) and (max-width: 1199px) {
  .side-toggle { display: none; }
}
@media (min-width: 1200px) {
  .side-toggle { display: flex; align-items: center; gap: var(--space-14); width: 100%; min-height: var(--tap); padding: 0 var(--space-14); margin-top: auto; border: 0; background: none; color: var(--muted); font: 500 var(--step--1) var(--body); border-radius: var(--radius-m); cursor: pointer; text-align: left; }
  .side-toggle:hover { background: var(--card); color: var(--text); }
  .side-toggle .icon { width: 22px; height: 22px; flex: none; }
  html.sidebar-collapsed .sidebar, body.sidebar-collapsed .sidebar { width: 88px; }
  html.sidebar-collapsed .sidebar-inner, body.sidebar-collapsed .sidebar-inner { align-items: center; padding: var(--space-18) 6px var(--space-14); }
  html.sidebar-collapsed .side-name, body.sidebar-collapsed .side-name,
  html.sidebar-collapsed .navitem span, body.sidebar-collapsed .navitem span,
  html.sidebar-collapsed .side-toggle span, body.sidebar-collapsed .side-toggle span,
  html.sidebar-collapsed .side-user .who, body.sidebar-collapsed .side-user .who { display: none; }
  html.sidebar-collapsed .side-brand, body.sidebar-collapsed .side-brand { justify-content: center; padding: 6px 0 var(--space-s); width: 100%; }
  html.sidebar-collapsed .side-brand.has-wordmark, body.sidebar-collapsed .side-brand.has-wordmark { align-items: center; flex-direction: column; }
  html.sidebar-collapsed .side-brand .brand-logo, body.sidebar-collapsed .side-brand .brand-logo { display: none !important; }
  html.sidebar-collapsed .side-brand .brand-mark .brand-mark-icon, body.sidebar-collapsed .side-brand .brand-mark .brand-mark-icon { display: block; width: 36px; height: 36px; border-radius: 9px; }
  html.sidebar-collapsed .navitem, body.sidebar-collapsed .navitem { flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 48px; padding: 0; box-shadow: none; }
  html.sidebar-collapsed .navitem.active, body.sidebar-collapsed .navitem.active { box-shadow: none; }
  html.sidebar-collapsed .side-toggle, body.sidebar-collapsed .side-toggle { justify-content: center; padding: 0; }
  html.sidebar-collapsed .side-user, body.sidebar-collapsed .side-user { justify-content: center; padding: 6px; }
  html.sidebar-collapsed .shell-main, body.sidebar-collapsed .shell-main { margin-left: 0; }
  html.sidebar-collapsed .side-sep, body.sidebar-collapsed .side-sep { margin: 6px var(--space-s); width: auto; align-self: stretch; }
}

/* ===================== v1.5: command palette ===================== */
.side-search { display: none; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 0 6px; height: 22px; border: 1px solid var(--border); border-radius: 6px; font: 500 var(--step--2) ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); background: var(--card-2); }
.palette-bg { position: fixed; inset: 0; z-index: var(--z-menu); background: rgba(15,15,18,.45); display: flex; align-items: flex-start; justify-content: center; padding: 12vh var(--space-m) var(--space-l); }
.palette { width: min(640px, 100%); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; max-height: min(72vh, 640px); }
.palette-q { display: flex; align-items: center; gap: var(--space-10); padding: var(--space-s) var(--space-14); border-bottom: 1px solid var(--border); }
.palette-close { display: none; }
.palette-q .icon { width: 22px; height: 22px; color: var(--muted); flex: none; }
.palette-q input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: 500 var(--step-0) var(--body); outline: none; min-height: 40px; }
.palette-list { overflow-y: auto; padding: var(--space-xs); }
.palette-sep { font: 600 var(--step--2) var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: var(--space-10) var(--space-10) 4px; }
.palette-item { display: flex; align-items: center; gap: var(--space-s); width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; border-radius: var(--radius-m); padding: var(--space-xs) var(--space-10); cursor: pointer; min-height: 48px; }
.palette-item:hover, .palette-item.active { background: var(--accent-soft); color: var(--text); }
.palette-item .main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.palette-item .t { font-weight: 600; overflow-wrap: break-word; }
.palette-item .s { color: var(--muted); font-size: var(--step--1); }
.palette-ico { flex: none; width: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.palette-ico .icon { width: 20px; height: 20px; }
.palette-empty { padding: var(--space-28) var(--space-m); text-align: center; color: var(--muted); }
.palette-foot { display: flex; justify-content: space-between; gap: var(--space-s); flex-wrap: wrap; padding: var(--space-xs) var(--space-14) var(--space-10); border-top: 1px solid var(--border); color: var(--muted); font-size: var(--step--2); }
html.theme-dark .palette-bg, body.theme-dark .palette-bg { background: rgba(0,0,0,.55); }
@media (min-width: 1200px) {
  .side-search { display: flex; align-items: center; gap: var(--space-14); width: 100%; min-height: var(--tap); padding: 0 var(--space-14); border: 0; background: var(--card); border: 1px solid var(--border); color: var(--muted); font: 500 var(--step--1) var(--body); border-radius: var(--radius-m); cursor: pointer; text-align: left; margin: 4px 0; }
  .side-search:hover { background: var(--card-2); color: var(--text); }
  .side-search .icon { width: 20px; height: 20px; flex: none; }
  .side-search .side-kbd { margin-left: auto; }
  html.sidebar-collapsed .side-search span, body.sidebar-collapsed .side-search span,
  html.sidebar-collapsed .side-search .kbd, body.sidebar-collapsed .side-search .kbd { display: none; }
  html.sidebar-collapsed .side-search, body.sidebar-collapsed .side-search { justify-content: center; padding: 0; width: 100%; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .side-search { display: flex; align-items: center; justify-content: center; width: 100%; min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--muted); border-radius: var(--radius-m); cursor: pointer; }
  .side-search span, .side-search .kbd { display: none; }
  .side-search:hover { background: var(--card); color: var(--text); }
}
@media (max-width: 767px) {
  .side-search { display: none; }
}

/* Health panel + activity feed (v1.6) */
.health-card { padding: var(--space-s) var(--space-14) var(--space-14); }
.health-backup { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-10) var(--space-m); margin-bottom: var(--space-s); }
.health-backup-form { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; }
.health-backup-form .date-input { width: auto; min-width: 11rem; flex: 0 0 auto; }
.health-backup-form .lbl { margin: 0; font-size: var(--step--1); }
.health-backup-form .date-display { min-height: var(--tap); padding: 0 44px 0 var(--space-10); border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--input); color: var(--text); font: 500 var(--step--1) var(--body); }
.health-row { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-s) 0; border-top: 1px solid var(--border); }
.health-host .t { display: block; font-weight: 600; }
.health-host .s { color: var(--muted); font-size: var(--step--1); }
.health-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.health-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 var(--space-10); border-radius: 99px; font-size: var(--step--2); font-weight: 600; border: 1px solid var(--border); background: var(--card-2); color: var(--muted); }
.health-pill.t-ok { color: var(--ok); background: #E3F6EA; border-color: rgba(15,122,74,.28); }
.health-pill.t-warn { color: #7A4E00; background: #FFF4D6; border-color: rgba(138,106,0,.3); }
.health-pill.t-bad { color: var(--bad); background: #FDE8EA; border-color: rgba(192,23,42,.28); }
.health-pill.t-muted { color: var(--muted); }
html.theme-dark .health-pill.t-ok { background: rgba(61,220,151,.14); color: #8BE8C0; border-color: rgba(61,220,151,.28); }
html.theme-dark .health-pill.t-warn { background: rgba(242,193,78,.16); color: #F7DC96; border-color: rgba(242,193,78,.28); }
html.theme-dark .health-pill.t-bad { background: rgba(255,92,106,.16); color: #FFB3BB; border-color: rgba(255,92,106,.28); }
.tl-kind { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: 4px; }
.tl-kind .icon { width: 16px; height: 16px; color: var(--muted); }
.tl-item .body .s { margin-top: 4px; color: var(--text); white-space: pre-wrap; }

/* Quotes, invoices, board, time, files (v1.7) */
.lines { width: 100%; border-collapse: collapse; }
.lines th, .lines td { padding: 6px var(--space-xs); text-align: left; vertical-align: top; }
.lines th { font-size: var(--step--2); font-weight: 600; color: var(--muted); }
.lines input { width: 100%; min-height: 40px; padding: 0 var(--space-xs); border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--input); color: var(--text); font: 500 var(--step--1) var(--body); }
.lines .num, .lines .num input { text-align: right; white-space: nowrap; }
.lines .qty { width: 88px; } .lines .unit { width: 110px; } .lines .amt { width: 110px; white-space: nowrap; font-weight: 600; }
.doc table.lines { table-layout: fixed; }
.doc table.lines th:nth-child(1), .doc table.lines td:nth-child(1) { width: auto; }
.doc table.lines th:nth-child(2), .doc table.lines td:nth-child(2) { width: 72px; }
.doc table.lines th:nth-child(3), .doc table.lines td:nth-child(3),
.doc table.lines th:nth-child(4), .doc table.lines td:nth-child(4) { width: 120px; }
.lines-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-s); padding: var(--space-10) 0 0; flex-wrap: wrap; }
.doc { padding: var(--space-28); }
.doc-head { display: flex; justify-content: space-between; gap: var(--space-l); align-items: flex-start; margin-bottom: var(--space-l); }
.doc-head h1 { margin: 0 0 4px; font-size: 28px; }
.doc-meta { text-align: right; }
.doc table.lines { margin: var(--space-m) 0; }
.doc .totals { margin-left: auto; max-width: 280px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-14); align-items: start; }
.board-col { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-l); min-height: 280px; padding: var(--space-10); }
.board-col h3 { margin: 0 var(--space-xs) var(--space-10); font-size: var(--step--1); display: flex; justify-content: space-between; }
.board-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-m); padding: var(--space-10) var(--space-s); margin-bottom: var(--space-xs); cursor: grab; box-shadow: var(--card-shadow); }
.board-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.board-card .t { font-weight: 600; }
.board-card .s { font-size: var(--step--1); color: var(--muted); margin-top: 2px; }
.board-card .move { display: flex; gap: 4px; margin-top: var(--space-xs); flex-wrap: wrap; }
.board-col.dragover { outline: 2px dashed var(--accent); }
.timer-chip { display: inline-flex; align-items: center; gap: var(--space-xs); }
.file-row { display: flex; align-items: center; gap: var(--space-10); }
.file-row .main { flex: 1; min-width: 0; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
/* v2.87.0: stack the Tasks filter toolbar and the DNS add form on a phone so they do not squeeze at 360. */
@media (max-width: 767px) {
  .dns-add .grid2, .grid3.toolbar { grid-template-columns: 1fr; }
}
@media (min-width: 768px) and (max-width: 899px) {
  .grid3.toolbar { grid-template-columns: 1fr; }
}
/* v2.87.0: voice note players stay inside the card at 360. */
.vn-list .row { align-items: flex-start; flex-wrap: wrap; }
.vn-list .end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs, 0.35rem); min-width: 0; }
.vn-list audio { max-width: 100%; width: min(100%, 16rem); height: 2.25rem; }
/* v2.88.0: invoice line tables scroll sideways on a phone instead of spilling off the page. */
.inv-lines { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.inv-lines table.lines th, .inv-lines table.lines td { overflow-wrap: anywhere; }


@media print {
  .sidebar, .topbar, .tabbar, .hero-actions, .actions-row, .no-print, .btn, nav, .segmented, [data-act] { display: none !important; }
  body, html, #app, #view, .page, .main, .content { background: #fff !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; max-width: none !important; }
  .doc { padding: 0; }
}
.s-accepted, .s-doing { --dot: var(--info); --chip-bg: #E8F0FE; --chip-fg: #1543A0; }
.s-declined, .s-expired { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); }
.s-todo { --dot: #6E6E78; --chip-bg: #F0F0F2; --chip-fg: #3C3C44; }

/* ---- company website screenshot empty state ---- */
.profile-hero-empty { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:var(--space-xs); min-height:180px; padding:22px var(--space-l); background:var(--card-2); }
.profile-hero-empty svg { width:28px; height:28px; color:var(--accent); }
.profile-hero-empty .empty-title { font-weight:600; font-size: var(--step-0); }
.profile-hero-caption { padding:0 var(--space-18) var(--space-s); color:var(--muted); font-size: var(--step--1); }

/* ---- mail ---- */
.mail-app { display:grid; grid-template-columns: 200px minmax(0, 1fr); gap:var(--space-m); align-items:start; }
.mail-folders { position:sticky; top:12px; }
.mail-folders .folder { display:flex; align-items:center; gap:var(--space-xs); width:100%; text-align:left; padding:var(--space-xs) var(--space-10); border-radius:var(--radius-m); border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.mail-folders .folder[aria-current="page"], .mail-folders .folder.is-on { background:var(--card-2); font-weight:600; }
.mail-folders .folder .n { margin-left:auto; color:var(--muted); font-size: var(--step--2); }
.mail-toolbar { display:flex; gap:var(--space-xs); flex-wrap:wrap; align-items:center; margin-bottom:var(--space-10); }
.mail-toolbar .grow { flex:1; min-width:160px; }
.mail-chips { display:none; }
.mail-row { display:grid; grid-template-columns: 12px minmax(0, 1fr) 32px; gap:4px var(--space-10); align-items:start; padding:var(--space-10) var(--space-14); border-bottom:1px solid var(--border); color:inherit; }
.mail-row:last-child { border-bottom:0; }
@media (hover: hover) { .mail-row:hover { background:var(--card-2); } }
.mail-pip { width:8px; height:8px; border-radius:50%; background:transparent; margin-top:var(--space-xs); }
.mail-row.unseen .mail-pip { background:var(--accent); }
.mail-main { display:grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; grid-template-areas:"from subj meta" "flags snip snip"; gap:2px var(--space-s); min-width:0; color:inherit; text-decoration:none; }
.mail-main .from { grid-area:from; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-main .subj { grid-area:subj; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-main .meta { grid-area:meta; color:var(--muted); font-size: var(--step--1); white-space:nowrap; }
.mail-main .snip { grid-area:snip; color:var(--muted); font-size: var(--step--1); font-weight:400; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-flags { grid-area:flags; display:flex; flex-wrap:wrap; align-items:center; gap:6px; color:var(--muted); font-size: var(--step--2); min-width:0; }
.mail-asgn, .mail-box { background:var(--card-2); border-radius:999px; padding:1px var(--space-xs); }
.mail-row.unseen .from, .mail-row.unseen .subj { font-weight:600; }
.mail-row .star { border:0; background:transparent; color:var(--muted); padding:4px; cursor:pointer; border-radius:var(--radius-s); min-height:32px; min-width:32px; display:inline-flex; align-items:center; justify-content:center; }
.mail-row .star.on, .mail-row .star.on svg { color:var(--accent); }
.mail-read { display:flex; flex-direction:column; gap:0; }
.mail-read-head { padding:var(--space-m) var(--space-18); border-bottom:1px solid var(--border); display:flex; flex-direction:column; gap:var(--space-xs); }
.mail-read-head h1 { font-size: var(--step-2); font-weight:600; margin:0; overflow-wrap:break-word; }
.mail-read-head .main, .mail-box-row .main, .mail-from-line .main { display:flex; flex-direction:column; gap:2px; min-width:0; }
.mail-from-line { display:flex; gap:var(--space-10); align-items:flex-start; justify-content:space-between; }
.mail-assign { display:flex; flex-direction:column; gap:var(--space-xs); }
.mail-assign .task-inline { margin-top:0; }
.mail-read-actions { display:none; }
.mail-read-body { padding:var(--space-18); overflow:auto; max-width:100%; }
.mail-read-body .mail-html { font-size: var(--step-0); line-height:1.55; overflow-wrap:break-word; }
.mail-read-body .mail-html img { max-width:100%; height:auto; }
.mail-read-body .mail-html a { color:var(--accent); }
.mail-atts { display:flex; flex-wrap:wrap; gap:var(--space-xs); padding:0 var(--space-18) var(--space-m); }
.mail-atts a { display:inline-flex; align-items:center; gap:6px; }
.mail-compose textarea.body { min-height:220px; }
.mail-box-row .t { font-weight:600; }
.mailbox-pass { display:flex; gap:var(--space-xs); align-items:end; flex-wrap:wrap; }
.mail-team-notes { padding:0 var(--space-18) var(--space-18); }
.mail-team-notes h3 { margin:var(--space-s) 0 var(--space-xs); font-size: var(--step-0); }
.mail-replybar { margin: 0 var(--space-18) var(--space-18); padding:var(--space-s) 0 0; border-top:1px solid var(--border); }
.mail-reply-row { display:flex; gap:var(--space-xs); align-items:flex-end; }
.mail-reply-row textarea { flex:1; min-width:0; min-height:56px; }
.mail-replybar .lbl { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
@media (max-width: 767px) {
  .mail-hero, .mail-desk-filters, .mail-folders, .mail-desk-actions { display:none !important; }
  .mail-chips { display:flex; gap:var(--space-xs); overflow-x:auto; -webkit-overflow-scrolling:touch; padding:0 0 var(--space-xs); scrollbar-width:none; }
  .mail-chips::-webkit-scrollbar { display:none; }
  .mail-chip { flex:none; display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:0 var(--space-s); border-radius:999px; border:1px solid var(--border); background:var(--card); color:inherit; font: 500 var(--step--1) var(--body); text-decoration:none; }
  .mail-chip.is-on, .mail-chip[aria-current="page"] { background:var(--accent-soft); border-color:color-mix(in srgb, var(--accent) 45%, transparent); color:var(--accent-text); font-weight:600; }
  .mail-chip .n { font-weight:600; }
  .mail-app { display:block; }
  .mail-toolbar { margin-bottom:var(--space-xs); }
  .mail-toolbar .btn { display:none; }
  .mail-list-card { border-radius:var(--radius-l); overflow:hidden; }
  .mail-row { grid-template-columns: 12px minmax(0, 1fr) 32px; padding:var(--space-s) var(--space-s); }
  .mail-main { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas:"from meta" "subj subj" "snip snip" "flags flags"; gap:2px var(--space-xs); }
  .mail-main .from { font-size: var(--step-0); }
  .mail-main .subj { font-size: var(--step--1); }
  .mail-read-actions { display:flex; gap:var(--space-xs); flex-wrap:wrap; }
  .mail-replybar { position:fixed; left:0; right:0; bottom:calc(var(--tabbar-h) + var(--safe-bottom)); z-index:41; margin:0; padding:var(--space-10) var(--space-s) calc(var(--space-10)); background:var(--card); border-top:1px solid var(--border); box-shadow:0 -8px 20px rgba(16,16,20,.06); }
  .mail-reply-hint { display:none; }
  body:has(.mail-replybar) .fab { visibility:hidden; }
  body:has(.mail-replybar) #app { padding-bottom:calc(var(--tabbar-h) + 168px + var(--safe-bottom)); }
  .mail-team-notes { padding-bottom:var(--space-l); }
  .mail-assign [data-act=thread-save] { display:none; }
}

.sig-frame { display:block; width:100%; min-height:220px; border:1px solid var(--line); border-radius:var(--radius-m); background:#fff; }
.sig-assign { width:100%; border-collapse:collapse; }
.sig-assign th, .sig-assign td { text-align:left; vertical-align:middle; padding:var(--space-xs) var(--space-10) var(--space-xs) 0; border-bottom:1px solid var(--line); }
.sig-assign th { font-size: var(--step--2); color:var(--muted); font-weight:600; }
.sig-assign input, .sig-assign select { width:100%; }
#compose-sig-card { margin-top:var(--space-m); }
.mail-read-body .mail-html table { border-collapse:collapse; }
.mail-read-body .mail-html td { vertical-align:top; }


/* v2.1 products & pricing */
.product-settings { display:flex; flex-direction:column; gap:var(--space-m); }
.product-grid { display:grid; gap:var(--space-s); }
@media (min-width: 860px) { .product-grid { grid-template-columns: 1fr 1fr; } }
.product-card h3 { margin:0; font-size: var(--step-0); }
.product-card .product-head { align-items:flex-start; justify-content:space-between; gap:var(--space-s); }
.product-card .product-desc { margin:var(--space-xs) 0 var(--space-10); white-space:pre-wrap; color:var(--muted); font-size: var(--step--1); }
.product-card .product-price { margin:0 0 var(--space-s); }
.product-card .product-annual { display:block; margin-top:2px; color:var(--muted); font-weight:500; font-size: var(--step--1); }
.product-card.is-recommended { border-color: var(--accent, #e85d04); }
.product-card.is-inactive { opacity:0.72; }
.field.is-disabled { opacity:0.5; }
.field.is-disabled input { pointer-events:none; }
.line-row .line-desc select,
.line-row .unit select { width:100%; margin-bottom:6px; }
.line-row .line-hint { margin-top:4px; }
@media print {
  .line-row select[data-line="product"],
  .line-row select[data-line="cycle"] { display:none; }
}

/* Credit check & FlexiPay eligibility (phase two) */
.credit-flags { display: flex; flex-direction: column; gap: var(--space-xs); }
.credit-flag { padding: var(--space-10) var(--space-s); border-radius: var(--radius-m); border: 1px solid var(--border); background: var(--card-2); }
.credit-flag.fail { background: rgba(255,92,106,.1); border-color: rgba(255,92,106,.4); }
.credit-flag.refer { background: #FFF4D6; border-color: #F3E0A8; }
html.theme-dark .credit-flag.refer { background: rgba(242,193,78,.16); border-color: rgba(242,193,78,.28); }
.credit-flag .t { display: block; font-weight: 600; }
.credit-outcome { padding: var(--space-14) var(--space-m); border-radius: var(--radius-m); border: 1px solid var(--border); margin-bottom: var(--space-s); }
.credit-outcome.pass { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.4); }
.credit-outcome.refer { background: #FFF4D6; border-color: #F3E0A8; }
.credit-outcome.fail { background: rgba(255,92,106,.1); border-color: rgba(255,92,106,.4); }
.credit-outcome.in_progress { background: var(--card-2); }
.credit-outcome h3 { margin: 0 0 4px; font-size: 1.05rem; }
.credit-check-row { display: grid; grid-template-columns: 1fr auto; gap: var(--space-xs) var(--space-m); padding: var(--space-s) 0; border-bottom: 1px solid var(--border); align-items: start; }
.credit-check-row:last-child { border-bottom: 0; }
.credit-check-row .s { display: block; margin-top: 2px; }
.credit-details { margin-top: var(--space-xs); }
.credit-details .kvlist { margin: 0; }

/* Password strength indicator (REQ-020) */
.pwmeter { margin-top: var(--space-xs); display: flex; flex-direction: column; gap: 6px; }
.pwbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pwbar i { height: 6px; border-radius: 3px; background: var(--border); }
.pwmeter[data-level="1"] .pwbar i:nth-child(-n+1) { background: var(--bad); }
.pwmeter[data-level="2"] .pwbar i:nth-child(-n+2) { background: var(--warn); }
.pwmeter[data-level="3"] .pwbar i:nth-child(-n+3) { background: var(--ok); }
.pwmeter[data-level="4"] .pwbar i { background: var(--ok); }
.pwword { margin: 0; font-size: var(--step--1); font-weight: 600; color: var(--muted); min-height: 1.2em; }
.pwrules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 2px; font-size: var(--step--1); color: var(--muted); }
@media (min-width: 520px) { .pwrules { grid-template-columns: 1fr 1fr; column-gap: var(--space-s); } }
.pwrules li.ok { color: var(--ok); } .pwrules li.no { color: var(--muted); }
.pwmark { display: inline-block; width: 1.4em; font-weight: 700; }

/* Automated staff avatars: brand initials (#FF3400) and a small robot badge. Overflow is visible so the badge is not clipped. */
.avatar.tone-bot { background: #FFE8E0; color: #FF3400; border-color: #FFC4B3; font-weight: 700; }
.avatar.is-bot { position: relative; overflow: visible; }
.avatar .bot-badge { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; background: #FF3400; color: #fff; border: 2px solid var(--card, #fff); display: flex; align-items: center; justify-content: center; box-sizing: content-box; }
.avatar.sm .bot-badge { width: 13px; height: 13px; right: -2px; bottom: -2px; border-width: 1.5px; }
.avatar.lg .bot-badge, .avatar.xl .bot-badge { width: 18px; height: 18px; }
.avatar .bot-badge svg { width: 10px; height: 10px; fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; display: block; }
.avatar.sm .bot-badge svg { width: 8px; height: 8px; }
.tl-item .tl-who { display: flex; align-items: center; gap: var(--space-xs); font-weight: 600; }
.tl-item .tl-quote { margin-top: 6px; padding: var(--space-xs) var(--space-10); background: var(--card-2); border-radius: var(--radius-s); white-space: pre-wrap; }
.theme-dark .avatar.tone-bot { background: #3A1510; color: #FF6A45; border-color: #5A241C; }

/* List view (REQ-018): every list can show as a table or as cards. Table by default on a wide screen, cards on a phone. */
.lv-table { display: none; } .lv-cards { display: block; }
html[data-list="table"] .lv-table { display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; contain: inline-size; } html[data-list="table"] .lv-cards { display: none; }
.lv-table .table-card { width: 100%; max-width: 100%; overflow-x: auto; contain: inline-size; }
.lv-table .tbl { width: 100%; max-width: 100%; table-layout: fixed; }
.lv-table .tbl th, .lv-table .tbl td { overflow: hidden; text-overflow: ellipsis; }
#view, .page { max-width: 100%; min-width: 0; overflow-x: clip; contain: inline-size; }
.card.table-card { overflow-x: auto; }
.lvbar { display: flex; justify-content: flex-end; margin-bottom: -8px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--card); }
.seg-b { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-s); border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 var(--step--1) var(--body); cursor: pointer; }
.seg-b .icon { width: 18px; height: 18px; }
.seg-b[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.seg-b:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; }
@media (min-width: 640px) {
  .lvc.card { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-s); background: none; border: 0; box-shadow: none; overflow: visible; }
  .lvc > .row, .lvc > .contact { background: var(--card); border: 1px solid var(--border) !important; border-radius: var(--radius-m); box-shadow: var(--card-shadow); }
}
.rowact { display: inline-flex; align-items: center; gap: 6px; }
.tbl td:last-child .rowact { justify-content: flex-end; }

/* Add new (REQ-019): round button and side panel */
.fab { position: fixed; right: 20px; bottom: calc(var(--tabbar-h) + 20px + var(--safe-bottom)); z-index: var(--z-fab); width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow), 0 8px 24px rgba(16,16,20,.22); cursor: pointer; font-weight: 700; }
.fab .icon { width: 26px; height: 26px; color: inherit; stroke: currentColor; }
.fab:hover, .fab:focus-visible, .fab:active { color: var(--accent-ink); background: var(--accent); }
.fab:hover { filter: brightness(1.05); } .fab:active { filter: brightness(.92); }
.fab:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
@media (min-width: 768px) { .fab { bottom: 28px; right: 28px; } }
body.oc-open { overflow: hidden; } body.oc-open .fab { visibility: hidden; }
.oc-bg { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--sheet-dim); display: flex; justify-content: flex-end; }
.oc { width: 100%; height: 100%; height: 100dvh; max-height: 100dvh; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; animation: ocin .2s ease-out; }
@keyframes ocin { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .oc { animation: none; } }
@media (min-width: 768px) { .oc { width: 460px; max-width: 100vw; border-left: 1px solid var(--border); box-shadow: var(--shadow); } }
.oc-head { display: flex; align-items: center; gap: var(--space-xs); padding: var(--space-s) var(--space-14) calc(var(--space-s)) var(--space-m); border-bottom: 1px solid var(--border); background: var(--card); padding-top: calc(var(--space-s) + var(--safe-top)); }
.oc-head h2 { flex: 1; margin: 0; font-size: var(--step-2); }
.oc-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-xs) 0 calc(var(--space-l) + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
.oc-body .page { padding: var(--space-s) var(--space-m) var(--space-l); max-width: none; }
.oc-pick { margin: var(--space-xs) var(--space-s); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; }
.oc-pick .row { width: 100%; text-align: left; }
.oc-loading { padding: var(--space-l); color: var(--muted); }
.oc-body .fgrid, .oc-body .grid2 { grid-template-columns: 1fr; } .oc-body .fgrid > * { grid-column: auto; }
.oc-head h2 { text-transform: none; letter-spacing: 0; color: var(--text); font-size: var(--step-2); }

/* Task archive and task page (v2.10.0) */
.task-page { display: flex; flex-direction: column; gap: 4px; padding-bottom: var(--space-l); }
.task-desc-edit { margin-top: var(--space-10); }
.task-desc-edit summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.task-desc-edit[open] summary { margin-bottom: var(--space-10); }
.task-hero { margin-bottom: var(--space-xs); }
.task-title { font: 600 var(--step-2) var(--head); margin: 4px 0 0; overflow-wrap: break-word; }
.task-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-top: 4px; }
.task-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-s); margin-top: var(--space-m); }
@media (min-width: 768px) {
  .task-title { font-size: var(--step-3); }
  .task-inline { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* v2.23.0 dark mode, finished: every light only colour that the full screen audit (tests/shot_dark.mjs) found gets a dark partner. */
html.theme-dark .seg-b[aria-pressed="true"], html.theme-dark .segmented a[aria-current=page] { color: #FFB199; }
html.theme-dark .badge.prio-high, html.theme-dark .badge.sysh-warn { color: #F7DC96; border-color: rgba(242,193,78,.3); }
html.theme-dark .badge.prio-urgent { color: #FFB3BB; border-color: rgba(255,92,106,.3); }
html.theme-dark .s-todo { --chip-bg: rgba(110,110,120,.2); --chip-fg: #C9C9D0; }
html.theme-dark .s-accepted, html.theme-dark .s-doing { --chip-bg: rgba(143,163,255,.16); --chip-fg: #C5D0FF; }
.skip { font-weight: 700; }
html.theme-dark .s-declined, html.theme-dark .s-expired { --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }
html.theme-dark .badge.sysh-bad { color: #FFB3BB; --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }
html.theme-dark .credit-flag.refer, html.theme-dark .credit-outcome.refer { background: rgba(242,193,78,.12); border-color: rgba(242,193,78,.3); }

/* Sidebar and phone tab bar stay black with light text in both themes (Carl, 18 Nov 2026). */
.sidebar,
.tabbar {
  --sb-bg: #000000;
  --sb-text: #F5F5F6;
  --sb-muted: #B4B4BC;
  --sb-hover: #161616;
  --sb-line: #2A2A30;
  --sb-active: #FF3400;
  --sb-active-ink: #FFFFFF;
  background: var(--sb-bg);
  color: var(--sb-text);
  border-color: var(--sb-line);
}
.sidebar { border-right: 1px solid var(--sb-line); }
.tabbar { border-top: 1px solid var(--sb-line); }
.sidebar .side-name,
.sidebar .side-trading,
.sidebar .side-toggle,
.sidebar .side-search,
.sidebar .side-user,
.sidebar .side-user b,
.sidebar .side-user small { color: var(--sb-text); }
.sidebar .side-toggle span,
.sidebar .side-search span,
.sidebar .navitem { color: var(--sb-muted); }
.sidebar .navitem:hover,
.sidebar .side-toggle:hover,
.sidebar .side-search:hover,
.sidebar .side-user:hover { background: var(--sb-hover); color: var(--sb-text); }
.sidebar .navitem.active {
  color: var(--sb-active-ink);
  background: var(--sb-active);
  font-weight: 700;
  box-shadow: none;
}
.sidebar .side-sep { background: var(--sb-line); }
.sidebar .side-user { background: var(--sb-hover); border-color: var(--sb-line); }
.sidebar .side-search { color: var(--sb-muted); background: var(--sb-hover); border: 1px solid var(--sb-line); }
.sidebar .side-search .kbd,
.sidebar .kbd { color: var(--sb-muted); border-color: var(--sb-line); background: transparent; }
.sidebar .brand-mark .logo-on-light { display: none !important; }
.sidebar .brand-mark .logo-on-dark { display: block !important; }
.tabbar .tab { color: var(--sb-muted); }
.tabbar .tab.active { color: var(--sb-active); font-weight: 700; }
.tabbar .tab.active .icon { filter: drop-shadow(0 0 6px rgba(255,52,0,.6)); }
/* The Inbox shortcut on the black sidebar is an outlined orange button, so it never looks like the active item (solid orange). */
.sidebar .nav-accent, .sidebar .navitem.nav-accent { background: #17110F; border: 1px solid #FF3400; color: #fff !important; font-weight: 600; }
.sidebar .nav-accent .icon { color: #FF3400; stroke: #FF3400; }
.sidebar .nav-accent:hover, .sidebar .nav-accent:focus-visible { background: #2A1510; }
.sidebar .nav-accent.active { background: #2A1510; box-shadow: none; }

/* v2.32.1: the sidebar nav scrollbar is thin and barely there (faint grey on black, a touch brighter on hover); the nav still scrolls with wheel, touch and keyboard. */
.sidebar .side-nav { scrollbar-width: thin; scrollbar-color: #26262B transparent; }
.sidebar .side-nav:hover { scrollbar-color: #3A3A41 transparent; }
.sidebar .side-nav::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
.sidebar .side-nav::-webkit-scrollbar-track, .sidebar .side-nav::-webkit-scrollbar-corner { background: transparent; }
.sidebar .side-nav::-webkit-scrollbar-thumb { background: #26262B; border-radius: 6px; }
.sidebar .side-nav:hover::-webkit-scrollbar-thumb { background: #3A3A41; }
.sidebar .side-nav::-webkit-scrollbar-thumb:hover { background: #55555D; }
/* v2.32.1: the phone tab bar Inbox shortcut is outlined orange (not a solid fill), so it never looks more selected than the current tab. */
.tabbar .tab.nav-accent { background: #17110F; border: 1px solid #FF3400; color: #fff !important; font-weight: 600; box-shadow: none; border-radius: var(--radius-m); }
.tabbar .tab.nav-accent .icon { color: #FF3400; stroke: #FF3400; filter: none; }
.tabbar .tab.nav-accent:hover, .tabbar .tab.nav-accent:focus-visible { background: #2A1510; }
.tabbar .tab.nav-accent.active { background: #2A1510; border-color: #FF3400; box-shadow: none; }
.tabbar .tab.nav-accent .nav-count { background: #FF3400; color: #fff; }

/* ===================== v2.33.0: grouped sidebar, solid Inbox, orange icon hover, smooth minimise, square rail, bigger logo ===================== */
.sidebar { --nav-ease: cubic-bezier(.4, 0, .2, 1); --nav-t: 220ms; }
.sidebar .side-nav { gap: 2px; padding-bottom: 6px; }
.nav-group { display: flex; flex-direction: column; }
.nav-ghead { display: flex; align-items: center; gap: var(--space-xs); width: 100%; min-height: 36px; padding: 0 var(--space-14); margin-top: var(--space-xs); border: 0; background: none; color: var(--sb-muted); font: 600 var(--step--2) var(--body); letter-spacing: .09em; text-transform: uppercase; border-radius: var(--radius-m); cursor: pointer; text-align: left; transition: color 150ms ease, background-color 150ms ease; }
.nav-ghead:hover, .nav-ghead:focus-visible { color: var(--sb-text); background: var(--sb-hover); }
.nav-ghead .nav-chev { margin-left: auto; width: 16px; height: 16px; flex: none; transition: transform var(--nav-t) var(--nav-ease); }
.nav-group.open > .nav-ghead .nav-chev { transform: rotate(90deg); }
.nav-gdot { width: 6px; height: 6px; border-radius: 50%; background: #FF3400; opacity: 0; margin-left: 2px; transition: opacity 150ms ease; }
.nav-group.has-active:not(.open) > .nav-ghead .nav-gdot { opacity: 1; }
.nav-group.has-active > .nav-ghead { color: var(--sb-text); }
.nav-gbody { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--nav-t) var(--nav-ease), visibility 0s linear var(--nav-t); }
.nav-group.open > .nav-gbody { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--nav-t) var(--nav-ease), visibility 0s; }
.nav-gin { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }

/* items: 44px tall, icons turn orange on hover or keyboard focus, the current page has an orange bar and a soft orange tint */
body.shell .sidebar .navitem { position: relative; width: 100%; box-sizing: border-box; min-height: var(--tap); gap: var(--space-14); padding: 0 var(--space-14); font-size: var(--step-0); white-space: nowrap; transition: background-color 150ms ease, color 150ms ease, width var(--nav-t) var(--nav-ease), padding var(--nav-t) var(--nav-ease), gap var(--nav-t) var(--nav-ease); }
body.shell .sidebar .navitem > span:not(.nav-count) { flex: 1 1 auto; min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 1; transition: opacity 140ms ease 70ms, max-width var(--nav-t) var(--nav-ease); }
body.shell .sidebar .navitem .icon, body.shell .sidebar .side-toggle .icon, body.shell .sidebar .side-search .icon { flex: none; width: 22px; height: 22px; transition: color 150ms ease, stroke 150ms ease; }
body.shell .sidebar .navitem:hover .icon, body.shell .sidebar .navitem:focus-visible .icon, body.shell .sidebar .side-toggle:hover .icon, body.shell .sidebar .side-toggle:focus-visible .icon, body.shell .sidebar .side-search:hover .icon, body.shell .sidebar .side-search:focus-visible .icon { color: #FF3400; stroke: #FF3400; }
body.shell .sidebar .navitem.active { background: rgba(255, 52, 0, .16); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 #FF3400; }
body.shell .sidebar .navitem.active .icon { color: #FF3400; stroke: #FF3400; }
body.shell .sidebar .navitem:hover { background: var(--sb-hover); color: #fff; }
body.shell .sidebar .navitem.active:hover { background: rgba(255, 52, 0, .22); }
/* Inbox: a solid #FF3400 button with white bold text and icon; when it is the current page it gets a white ring */
body.shell .sidebar .navitem.nav-accent { background: #FF3400; border: 0; color: #fff !important; font-weight: 700; margin: 0 0 var(--space-xs); box-shadow: none; min-height: 48px; }
body.shell .sidebar .navitem.nav-accent .icon, body.shell .sidebar .navitem.nav-accent:hover .icon, body.shell .sidebar .navitem.nav-accent:focus-visible .icon, body.shell .sidebar .navitem.nav-accent.active .icon { color: #fff; stroke: #fff; }
body.shell .sidebar .navitem.nav-accent:hover, body.shell .sidebar .navitem.nav-accent:focus-visible { background: #FF3400; filter: brightness(1.1); }
body.shell .sidebar .navitem.nav-accent.active { background: #FF3400; box-shadow: inset 0 0 0 2px #fff; }
body.shell .sidebar .navitem.nav-accent .nav-count { background: #fff; color: #FF3400; }

/* smooth minimise and expand: the sidebar width and the page next to it move together; labels fade without wrapping */
.sidebar { transition: width var(--nav-t) var(--nav-ease); }
.sidebar-inner { transition: padding var(--nav-t) var(--nav-ease); }
.side-name, .side-toggle > span, .side-search > span, .side-user .who { max-width: 240px; transition: opacity 140ms ease 70ms, max-width var(--nav-t) var(--nav-ease); white-space: nowrap; }
.side-toggle, .side-search, .side-user { transition: background-color 150ms ease, width var(--nav-t) var(--nav-ease), padding var(--nav-t) var(--nav-ease), gap var(--nav-t) var(--nav-ease); }
.sidebar .brand-mark .brand-mark-icon, .sidebar .brand-logo { animation: navfade 220ms ease both; }
@keyframes navfade { from { opacity: 0; } to { opacity: 1; } }

/* logo 15% larger when the sidebar is expanded (30px to 34.5px, custom 32px to 36.8px) */
@media (min-width: 1200px) {
  html:not(.sidebar-collapsed) .side-brand.has-wordmark .brand-logo { height: 34.5px; max-width: 100%; }
  html:not(.sidebar-collapsed) .side-brand.has-custom .brand-logo { height: 36.8px; max-width: 184px; }
  html:not(.sidebar-collapsed) .side-brand .brand-dot { width: 18.4px; height: 18.4px; }
}

/* the rail (minimised on desktop, always on tablets): every button is a 48px square */
/* tablet: the extra :not() terms only raise the specificity above the grouped item rules */
@media (min-width: 768px) and (max-width: 1199px) {
html:not(.zz):not(.yy) body.shell .sidebar { width: 88px; }
html:not(.zz):not(.yy) body.shell .sidebar-inner { align-items: center; padding: var(--space-18) 6px var(--space-14); }
html:not(.zz):not(.yy) body.shell .side-nav { align-items: center; }
html:not(.zz):not(.yy) body.shell .nav-group { width: 100%; align-items: center; }
html:not(.zz):not(.yy) body.shell .nav-group + .nav-group { border-top: 1px solid var(--sb-line); margin-top: 6px; padding-top: 6px; }
html:not(.zz):not(.yy) body.shell .nav-ghead { display: none; }
html:not(.zz):not(.yy) body.shell .nav-gbody { grid-template-rows: 1fr; visibility: visible; }
html:not(.zz):not(.yy) body.shell .nav-gin { align-items: center; width: 100%; padding: 2px 0; overflow: visible; }
html:not(.zz):not(.yy) body.shell .navitem { flex: none; align-self: center; width: 48px; height: 48px; min-height: 48px; padding: 0 var(--space-s); gap: 0; margin-left: auto; margin-right: auto; justify-content: flex-start; flex-direction: row; box-shadow: none; }
html:not(.zz):not(.yy) body.shell .navitem.active { box-shadow: inset 3px 0 0 #FF3400; }
html:not(.zz):not(.yy) body.shell .navitem.nav-accent { width: 48px; margin: 0 auto var(--space-xs); }
html:not(.zz):not(.yy) body.shell .navitem.nav-accent.active { box-shadow: inset 0 0 0 2px #fff; }
html:not(.zz):not(.yy) body.shell .navitem > span:not(.nav-count) { max-width: 0; opacity: 0; }
html:not(.zz):not(.yy) body.shell .navitem .nav-count { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: var(--step--2); }
html:not(.zz):not(.yy) body.shell .side-name, html:not(.zz):not(.yy) body.shell .side-toggle > span, html:not(.zz):not(.yy) body.shell .side-search > span, html:not(.zz):not(.yy) body.shell .side-search .kbd, html:not(.zz):not(.yy) body.shell .side-user .who { display: flex; max-width: 0; opacity: 0; overflow: hidden; }
html:not(.zz):not(.yy) body.shell .side-toggle, html:not(.zz):not(.yy) body.shell .side-search { width: 48px; height: var(--tap); padding: 0 13px; gap: 0; justify-content: flex-start; align-self: center; }
html:not(.zz):not(.yy) body.shell .side-user { width: 48px; min-height: 48px; padding: 6px; justify-content: center; align-self: center; }
}
@media (min-width: 1200px) {
html.sidebar-collapsed body.shell .sidebar { width: 88px; }
html.sidebar-collapsed body.shell .sidebar-inner { align-items: center; padding: var(--space-18) 6px var(--space-14); }
html.sidebar-collapsed body.shell .side-nav { align-items: center; }
html.sidebar-collapsed body.shell .nav-group { width: 100%; align-items: center; }
html.sidebar-collapsed body.shell .nav-group + .nav-group { border-top: 1px solid var(--sb-line); margin-top: 6px; padding-top: 6px; }
html.sidebar-collapsed body.shell .nav-ghead { display: none; }
html.sidebar-collapsed body.shell .nav-gbody { grid-template-rows: 1fr; visibility: visible; }
html.sidebar-collapsed body.shell .nav-gin { align-items: center; width: 100%; padding: 2px 0; overflow: visible; }
html.sidebar-collapsed body.shell .navitem { flex: none; align-self: center; width: 48px; height: 48px; min-height: 48px; padding: 0 var(--space-s); gap: 0; margin-left: auto; margin-right: auto; justify-content: flex-start; flex-direction: row; box-shadow: none; }
html.sidebar-collapsed body.shell .navitem.active { box-shadow: inset 3px 0 0 #FF3400; }
html.sidebar-collapsed body.shell .navitem.nav-accent { width: 48px; margin: 0 auto var(--space-xs); }
html.sidebar-collapsed body.shell .navitem.nav-accent.active { box-shadow: inset 0 0 0 2px #fff; }
html.sidebar-collapsed body.shell .navitem > span:not(.nav-count) { max-width: 0; opacity: 0; }
html.sidebar-collapsed body.shell .navitem .nav-count { position: absolute; top: 3px; right: 3px; margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: var(--step--2); }
html.sidebar-collapsed body.shell .side-name, html.sidebar-collapsed body.shell .side-toggle > span, html.sidebar-collapsed body.shell .side-search > span, html.sidebar-collapsed body.shell .side-search .kbd, html.sidebar-collapsed body.shell .side-user .who { display: flex; max-width: 0; opacity: 0; overflow: hidden; }
html.sidebar-collapsed body.shell .side-toggle, html.sidebar-collapsed body.shell .side-search { width: 48px; height: var(--tap); padding: 0 13px; gap: 0; justify-content: flex-start; align-self: center; }
html.sidebar-collapsed body.shell .side-user { width: 48px; min-height: 48px; padding: 6px; justify-content: center; align-self: center; }
}
@media (min-width: 768px) and (max-width: 1199px) { body.shell .sidebar .navitem > span:not(.nav-count) { display: none; } }

/* phone: the More sheet uses the same groups */
.more-group { grid-column: 1 / -1; }
.more-ghead { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); width: 100%; min-height: 38px; padding: 0 var(--space-m); border: 0; background: none; color: var(--muted); font: 600 var(--step--2) var(--body); letter-spacing: .09em; text-transform: uppercase; cursor: pointer; text-align: left; }
.more-ghead .nav-chev { width: 16px; height: 16px; transition: transform var(--nav-t, 220ms) cubic-bezier(.4, 0, .2, 1); }
.more-group.open > .more-ghead .nav-chev { transform: rotate(90deg); }
.more-gbody { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 220ms cubic-bezier(.4, 0, .2, 1), visibility 0s linear 220ms; }
.more-group.open > .more-gbody { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 220ms cubic-bezier(.4, 0, .2, 1), visibility 0s; }
.more-gin { min-height: 0; overflow: hidden; }
.more-group .row.current { background: rgba(255, 52, 0, .12); box-shadow: inset 3px 0 0 #FF3400; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar-inner, .nav-gbody, .more-gbody, .nav-chev, .more-ghead .nav-chev, body.shell .sidebar .navitem, body.shell .sidebar .navitem > span, .side-name, .side-toggle, .side-toggle > span, .side-search, .side-search > span, .side-user, .side-user .who, .nav-ghead, .nav-gdot, body.shell .sidebar .navitem .icon { transition: none !important; }
  .sidebar .brand-mark .brand-mark-icon, .sidebar .brand-logo { animation: none; }
}

/* v2.34.0 row actions: icon buttons on a wide screen, kebab menu for overflow, one compact menu on a phone */
.tbl th.ra-th, .tbl td.ra-cell { width: 1%; white-space: nowrap; text-align: right; padding-left: var(--space-xs); padding-right: var(--space-s); }
.ra { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.ra-inline { display: inline-flex; align-items: center; gap: 2px; }
.ra-more { position: relative; display: inline-flex; }
.ra-phone, .ra-cardk { display: none; }
.ra-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-m); background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; transition: background .15s, color .15s; }
.ra-btn .icon { width: 18px; height: 18px; }
.ra-btn:hover, .ra-btn:focus-visible { background: var(--card-2); color: var(--accent-text); }
.ra-btn.is-danger:hover, .ra-btn.is-danger:focus-visible { color: var(--bad, #c0342b); }
.ra-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ra-menu { position: fixed; z-index: var(--z-menu); min-width: 200px; max-width: calc(100vw - 16px); padding: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: 0 12px 32px rgba(0,0,0,.22); text-align: left; }
.ra-menu[hidden] { display: none; }
.ra-item { display: flex; align-items: center; gap: var(--space-10); width: 100%; min-height: var(--tap); padding: var(--space-xs) var(--space-s); border: 0; border-radius: var(--radius-m); background: transparent; color: var(--text); font: 500 var(--step-0) var(--body); text-align: left; cursor: pointer; text-decoration: none; }
.ra-item .icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ra-item:hover, .ra-item:focus-visible { background: var(--card-2); outline: 0; }
.ra-item:hover .icon, .ra-item:focus-visible .icon { color: var(--accent-text); }
.ra-item.is-danger, .ra-item.is-danger .icon { color: var(--bad, #c0342b); }
a.row.has-cardk { position: relative; padding-right: 56px; }
.ra-cardk { display: inline-flex; align-items: center; position: absolute; right: 6px; top: 0; bottom: 0; }
@media (max-width: 640px) {
  .ra-inline { display: none; }
  .ra-phone { display: inline-flex; }
  .ra-btn { width: var(--tap); height: var(--tap); }
}
@media (prefers-reduced-motion: reduce) { .ra-btn { transition: none; } }

/* v2.34.0 stacked sections replace tab sets */
.stack-secs { display: flex; flex-direction: column; gap: var(--space-28); }
.stack-sec { scroll-margin-top: 72px; display: flex; flex-direction: column; gap: var(--space-14); }
.stack-h { margin: 0; font: 600 var(--step-2)/1.25 var(--display, var(--body)); }

/* v2.34.0 filters are selects */
.filter-sel { display: inline-flex; align-items: center; gap: var(--space-10); }
.filter-sel select { min-height: var(--tap); padding: 0 36px 0 var(--space-14); border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--card); color: var(--text); font: 500 var(--step-0) var(--body); max-width: 100%; }
.filter-sel select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* v2.34.0 pills are for real statuses only. Metadata badges in the admin app become plain text. */
body.shell .badge.plain, body.shell .badge.sample { height: auto; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-weight: 400; }
body.shell .badge.plain + .badge.plain::before, body.shell .badge.sample::before { display: none; }
body.shell .badge.plain:not(:first-child)::before { content: "\00b7\00a0"; width: auto; height: auto; background: none; border-radius: 0; display: inline; }
body.shell .due-chip:not(.bad):not(.accent) { height: auto; padding: 0; border-radius: 0; background: none; color: var(--muted); font-size: var(--step--1); }

/* ===================== v2.34.1: rail categories with a flyout to the right, grouped phone menu ===================== */
.nav-gic, .nav-flyhead { display: none; }
@media (min-width: 768px) and (max-width: 1199px) {
html:not(.zz):not(.yy) body.shell .nav-group { position: relative; }
html:not(.zz):not(.yy) body.shell .nav-group + .nav-group { border-top: 0; margin-top: 4px; padding-top: 0; }
html:not(.zz):not(.yy) body.shell .nav-ghead { display: flex; position: relative; width: 48px; height: 48px; min-height: 48px; margin: 0 auto; padding: 0; gap: 0; justify-content: center; align-items: center; border-radius: var(--radius-m); }
html:not(.zz):not(.yy) body.shell .nav-ghead .nav-gic { display: flex; }
html:not(.zz):not(.yy) body.shell .nav-ghead .nav-gic .icon { width: 22px; height: 22px; transition: color 150ms ease, stroke 150ms ease; }
html:not(.zz):not(.yy) body.shell .nav-ghead .nav-gl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html:not(.zz):not(.yy) body.shell .nav-ghead .nav-gdot, html:not(.zz):not(.yy) body.shell .nav-ghead .nav-chev { display: none; }
html:not(.zz):not(.yy) body.shell .nav-ghead:hover, html:not(.zz):not(.yy) body.shell .nav-ghead:focus-visible, html:not(.zz):not(.yy) body.shell .nav-group.fly > .nav-ghead { background: var(--sb-hover); color: #fff; }
html:not(.zz):not(.yy) body.shell .nav-ghead:hover .icon, html:not(.zz):not(.yy) body.shell .nav-ghead:focus-visible .icon, html:not(.zz):not(.yy) body.shell .nav-group.fly > .nav-ghead .icon { color: #FF3400; stroke: #FF3400; }
html:not(.zz):not(.yy) body.shell .nav-group.has-active > .nav-ghead { background: rgba(255, 52, 0, .16); color: #fff; box-shadow: inset 3px 0 0 #FF3400; }
html:not(.zz):not(.yy) body.shell .nav-group.has-active > .nav-ghead .icon { color: #FF3400; stroke: #FF3400; }
html:not(.zz):not(.yy) body.shell .nav-gbody { position: fixed; z-index: var(--z-flyout); left: 84px; top: 0; display: block; grid-template-rows: none; visibility: hidden; opacity: 0; transform: translateX(-8px); pointer-events: none; padding-left: var(--space-xs); transition: opacity 160ms ease, transform 160ms var(--nav-ease), visibility 0s linear 160ms; }
html:not(.zz):not(.yy) body.shell .nav-group.fly > .nav-gbody { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity 160ms ease, transform 160ms var(--nav-ease), visibility 0s; }
html:not(.zz):not(.yy) body.shell .nav-gbody .nav-gin { width: 252px; max-height: calc(100dvh - 16px); overflow: hidden auto; align-items: stretch; padding: var(--space-xs); gap: 2px; background: var(--sb-bg, #000); border: 1px solid var(--sb-line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
html:not(.zz):not(.yy) body.shell .nav-flyhead { display: block; padding: var(--space-xs) var(--space-s) 6px; font: 600 var(--step--2) var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--sb-muted); }
html:not(.zz):not(.yy) body.shell .nav-gbody .navitem { width: 100%; height: var(--tap); min-height: var(--tap); padding: 0 var(--space-14); gap: var(--space-14); margin: 0; justify-content: flex-start; align-self: stretch; }
html:not(.zz):not(.yy) body.shell .nav-gbody .navitem > span:not(.nav-count) { display: block; max-width: 240px; opacity: 1; }
html:not(.zz):not(.yy) body.shell .nav-gbody .navitem.active { box-shadow: inset 3px 0 0 #FF3400; }
}
@media (min-width: 1200px) {
html.sidebar-collapsed body.shell .nav-group { position: relative; }
html.sidebar-collapsed body.shell .nav-group + .nav-group { border-top: 0; margin-top: 4px; padding-top: 0; }
html.sidebar-collapsed body.shell .nav-ghead { display: flex; position: relative; width: 48px; height: 48px; min-height: 48px; margin: 0 auto; padding: 0; gap: 0; justify-content: center; align-items: center; border-radius: var(--radius-m); }
html.sidebar-collapsed body.shell .nav-ghead .nav-gic { display: flex; }
html.sidebar-collapsed body.shell .nav-ghead .nav-gic .icon { width: 22px; height: 22px; transition: color 150ms ease, stroke 150ms ease; }
html.sidebar-collapsed body.shell .nav-ghead .nav-gl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.sidebar-collapsed body.shell .nav-ghead .nav-gdot, html.sidebar-collapsed body.shell .nav-ghead .nav-chev { display: none; }
html.sidebar-collapsed body.shell .nav-ghead:hover, html.sidebar-collapsed body.shell .nav-ghead:focus-visible, html.sidebar-collapsed body.shell .nav-group.fly > .nav-ghead { background: var(--sb-hover); color: #fff; }
html.sidebar-collapsed body.shell .nav-ghead:hover .icon, html.sidebar-collapsed body.shell .nav-ghead:focus-visible .icon, html.sidebar-collapsed body.shell .nav-group.fly > .nav-ghead .icon { color: #FF3400; stroke: #FF3400; }
html.sidebar-collapsed body.shell .nav-group.has-active > .nav-ghead { background: rgba(255, 52, 0, .16); color: #fff; box-shadow: inset 3px 0 0 #FF3400; }
html.sidebar-collapsed body.shell .nav-group.has-active > .nav-ghead .icon { color: #FF3400; stroke: #FF3400; }
html.sidebar-collapsed body.shell .nav-gbody { position: fixed; z-index: var(--z-flyout); left: 84px; top: 0; display: block; grid-template-rows: none; visibility: hidden; opacity: 0; transform: translateX(-8px); pointer-events: none; padding-left: var(--space-xs); transition: opacity 160ms ease, transform 160ms var(--nav-ease), visibility 0s linear 160ms; }
html.sidebar-collapsed body.shell .nav-group.fly > .nav-gbody { visibility: visible; opacity: 1; transform: none; pointer-events: auto; transition: opacity 160ms ease, transform 160ms var(--nav-ease), visibility 0s; }
html.sidebar-collapsed body.shell .nav-gbody .nav-gin { width: 252px; max-height: calc(100dvh - 16px); overflow: hidden auto; align-items: stretch; padding: var(--space-xs); gap: 2px; background: var(--sb-bg, #000); border: 1px solid var(--sb-line); border-radius: var(--radius-m); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
html.sidebar-collapsed body.shell .nav-flyhead { display: block; padding: var(--space-xs) var(--space-s) 6px; font: 600 var(--step--2) var(--body); letter-spacing: .09em; text-transform: uppercase; color: var(--sb-muted); }
html.sidebar-collapsed body.shell .nav-gbody .navitem { width: 100%; height: var(--tap); min-height: var(--tap); padding: 0 var(--space-14); gap: var(--space-14); margin: 0; justify-content: flex-start; align-self: stretch; }
html.sidebar-collapsed body.shell .nav-gbody .navitem > span:not(.nav-count) { display: block; max-width: 240px; opacity: 1; }
html.sidebar-collapsed body.shell .nav-gbody .navitem.active { box-shadow: inset 3px 0 0 #FF3400; }
}
/* phone More sheet: each category is a clear row with its icon; open one to see its links */
.more-ghead { justify-content: flex-start; gap: var(--space-14); min-height: 46px; padding: 0 var(--space-m); color: var(--text); font: 600 var(--step-0) var(--body); letter-spacing: 0; text-transform: none; }
.more-ghead .more-gic { width: 22px; height: 22px; color: var(--muted); flex: none; transition: color 150ms ease; }
.more-ghead .more-gl { flex: 1; min-width: 0; }
.more-ghead .nav-chev { margin-left: auto; flex: none; }
.more-group.open > .more-ghead .more-gic { color: #FF3400; }
.more-group { border-top: 1px solid var(--border); }
.more-gin { margin-left: 27px; border-left: 2px solid var(--border); }

.more-gin .row { min-height: 40px; padding-top: 4px; padding-bottom: 4px; }

/* Tab strip with panels (v2.35.0, bordered equal width tabs with icons v2.35.1): the company page. A full width bordered bar under the top bar, sticky while the page scrolls. Every tab is the same width, icon over a centred label; the selected tab has an accent underline (no pills). On a phone the equal tabs scroll sideways. */
:root { --topbar-h: calc(56px + var(--safe-top)); }
@media (min-width: 768px) and (max-width: 1199px) { :root { --topbar-h: calc(64px + var(--safe-top)); } }
@media (min-width: 1200px) { :root { --topbar-h: calc(72px + var(--safe-top)); } }
.tabset { display: flex; flex-direction: column; gap: var(--space-20); min-width: 0; }
.tabstrip { position: sticky; top: calc(var(--topbar-h) - 1px); z-index: 9; display: flex; align-items: stretch; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-m); box-shadow: 0 -10px 0 var(--bg), var(--card-shadow); }
.tabstrip::-webkit-scrollbar { display: none; }
.tabstrip-tab { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: var(--space-xs) 4px; box-sizing: border-box; overflow: hidden; color: var(--muted); font-size: var(--step--1); line-height: 1.2; font-weight: 500; text-align: center; text-decoration: none; transition: color .15s, background-color .15s, box-shadow .15s; }
.tabstrip-tab + .tabstrip-tab { border-left: 1px solid var(--border); }
.tabstrip-tab .tab-ico { width: 22px; height: 22px; flex: 0 0 auto; }
.tabstrip-tab .tab-txt { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 4px; max-width: 100%; overflow: hidden; }
.tabstrip-tab .tab-lbl { overflow-wrap: anywhere; }
.tabstrip-tab:hover { color: var(--text); background: var(--card-2); }
.tabstrip-tab[aria-selected="true"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }
.tabstrip-tab[aria-selected="true"] .tab-ico { color: var(--accent-text); }
.tabstrip-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.tabstrip-tab .tab-count { font-size: var(--step--2); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabstrip-tab[aria-selected="true"] .tab-count { color: var(--accent-text); }
.tabpanel { display: flex; flex-direction: column; gap: var(--space-20); min-width: 0; }
.tabpanel[hidden] { display: none; }
.tabpanel:focus { outline: none; }
@media (max-width: 767px) { .tabstrip-tab { flex: 1 0 76px; min-width: 76px; } }
@media (prefers-reduced-motion: reduce) { .tabstrip-tab { transition: none; } }

/* ===================== v2.37.3: stacking scale, header search and Inbox, collapse button beside the logo ===================== */
/* One scale for every layer, so nothing sits above something it should sit below. Sidebar and its flyouts stay above page content and below every modal, menu and toast. */
:root { --z-topbar: 10; --z-tabbar: 20; --z-fab: 40; --z-sidebar: 100; --z-flyout: 1000; --z-modal: 2000; --z-menu: 2100; --z-toast: 3000; --z-top: 4000; }
@media (min-width: 768px) { .sidebar { position: relative; z-index: var(--z-sidebar); } }
.hdr-search .hs-label, .hdr-search .hs-kbd { display: none; }
@media (min-width: 768px) {
  .search-act { display: inline-flex; }
  .hdr-search { width: var(--tap); }
}
@media (min-width: 1100px) {
  .hdr-search { width: clamp(220px, 22vw, 320px); height: 40px; justify-content: flex-start; gap: var(--space-10); padding: 0 var(--space-10) 0 var(--space-s); margin-right: 6px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font: 500 var(--step--1) var(--body); }
  .hdr-search:hover { background: var(--card-2); color: var(--text); }
  .hdr-search .hs-label { display: inline; flex: 1; text-align: left; }
  .hdr-search .hs-kbd { display: inline-flex; }
}
.hdr-mail .nav-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; margin: 0; padding: 0 5px; border-radius: 99px; background: #FF3400; color: #fff; font: 700 var(--step--2)/18px var(--body); font-style: normal; text-align: center; box-sizing: border-box; }
.hdr-mail.active { background: var(--accent-soft); color: var(--accent-text); }
.side-brand { position: relative; }
.side-collapse { display: none; }
@media (min-width: 1200px) {
  html:not(.sidebar-collapsed) .side-brand { padding-right: 52px; }
  .side-collapse { display: inline-flex; position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; color: var(--sb-muted); border-radius: var(--radius-m); }
  .side-collapse:hover { background: var(--sb-hover); color: var(--sb-text); }
  .side-collapse:focus-visible { outline: 2px solid var(--sb-active); outline-offset: 2px; }
  .side-collapse .icon { width: 20px; height: 20px; }
  html.sidebar-collapsed .side-brand, body.sidebar-collapsed .side-brand { flex-direction: column; align-items: center; gap: var(--space-xs); padding: 6px 0 var(--space-10); }
  html.sidebar-collapsed .side-collapse, body.sidebar-collapsed .side-collapse { position: static; }
}
/* Mailbox groups in the Inbox (My inbox, Shared) */
.mail-grp { align-self: center; padding: 0 4px 0 var(--space-10); font: 700 var(--step--2) var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.mail-grp-h { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: var(--step--2); }

/* ===================== v2.38.2 / v2.39.1: page purpose, title wrap, tab fade, desktop Create, 16px on orange ===================== */
.btn.primary { font-size: var(--btn-font); font-weight: 700; }
.page-head { margin: 0 0 var(--space-m); }
.page-head .page-purpose { margin: 0; color: var(--muted); font-size: var(--step-0); line-height: 1.45; max-width: 42em; }

/* v2.38.3: next-step strip on quotes and projects, portal need-you and first-visit card */
.next-steps { margin: var(--space-m) 0; }
.next-steps .h3 { margin: 0 0 4px; font: 700 var(--step-0)/1.3 var(--head); }
.next-steps .actions-row { margin-top: var(--space-10); flex-wrap: wrap; gap: var(--space-xs); }
.need-you { margin: 0 0 var(--space-m); }
.portal-tour { margin: 0 0 var(--space-m); }
@media (max-width: 980px) {
  .topbar { height: auto; min-height: calc(56px + var(--safe-top)); align-items: flex-start; }
  .topbar .title {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25;
    font-size: var(--step-1);
    padding: var(--space-xs) 0 6px;
  }
  .page-head { margin: 0 0 var(--space-s); }
}
@media (min-width: 981px) {
  .fab { display: none; }
}
.tabstrip-wrap { position: sticky; top: calc(var(--topbar-h) - 1px); z-index: 9; }
.tabstrip-wrap .tabstrip { position: relative; top: auto; }
.tabstrip-wrap.is-overflow::before,
.tabstrip-wrap.is-overflow::after {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 32px;
  pointer-events: none;
  z-index: 2;
}
.tabstrip-wrap.is-overflow::before { left: 0; border-radius: var(--radius-m) 0 0 var(--radius-m); background: linear-gradient(to right, var(--card), transparent); }
.tabstrip-wrap.is-overflow::after { right: 0; border-radius: 0 var(--radius-m) var(--radius-m) 0; background: linear-gradient(to left, var(--card), transparent); }
@media (max-width: 1279px) {
  .tbl .col-phone { display: none; }
}
.tbl .col-email, .tbl .col-company { max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* v2.38.4 Settings regroup (NAV-4): a grouped left menu and search, instead of wrapping pills. */
.settings-layout { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); gap: var(--space-l); align-items: start; }
.settings-nav { position: sticky; top: 12px; }
.settings-search { display: block; margin: 0 0 var(--space-xs); }
.settings-search input { width: 100%; min-height: var(--tap); box-sizing: border-box; }
.settings-ghead { font-size: var(--step--2); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: var(--space-14) 0 4px; }
.settings-link { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-s); border-radius: var(--radius-m); color: inherit; text-decoration: none; }
.settings-link:hover { background: var(--hover); }
.settings-link[aria-current="page"] { background: var(--card); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.settings-empty { margin: var(--space-s) 0 0; }
@media (max-width: 980px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
}

/* Client portal sign-in, reset and set-password: form on a white left column, photo on the right. */
.hp{position:absolute;left:-10000px;height:0;overflow:hidden}
.pw-wrap{position:relative}
.pw-wrap input{padding-right:4.2rem}
.pw-toggle{position:absolute;right:8px;top:50%;transform:translateY(-50%);border:0;background:none;color:var(--muted);font:600 .8rem inherit;cursor:pointer;min-height:var(--tap);min-width:var(--tap);padding:0 var(--space-xs)}
.pw-toggle:hover,.pw-toggle[aria-pressed=true]{color:var(--text)}
.auth-forgot{margin:.8rem 0 0;font-size:.9rem}
.auth-split-page{background:#fff}
.auth-split-page #app{padding:0;max-width:none}
.auth-split{display:flex;min-height:100dvh;background:#fff;color:#16151c}
.auth-panel{flex:0 0 auto;width:min(440px,100%);background:#fff;display:flex;align-items:center;padding:calc(var(--space-40) + var(--safe-top)) 36px calc(var(--space-40) + var(--safe-bottom))}
.auth-panel-inner{width:100%;max-width:360px;margin:0 auto}
.auth-hero{flex:1 1 auto;min-height:100dvh;background:#1a2330 url(brand/portal-signin.webp) center/cover no-repeat}
html.theme-dark .auth-split-page,html.theme-dark .auth-split{background:var(--bg);color:var(--text)}
html.theme-dark .auth-panel{background:var(--card)}
@media (max-width: 800px){
  .auth-split{flex-direction:column}
  .auth-hero{min-height:0;height:140px;flex:0 0 auto;order:-1}
  .auth-panel{width:100%;padding:calc(var(--space-28) + var(--safe-top)) 22px calc(var(--space-2xl) + var(--safe-bottom));align-items:flex-start}
}

/* v2.89.0: remaining staff lists and forms stack on a phone; invoice and quote line tables already use .inv-lines. */
@media (max-width: 767px) {
  .grid2.toolbar, .taskmeta { grid-template-columns: 1fr; }
  .hstack.toolbar { flex-direction: column; align-items: stretch; }
  .hstack.toolbar .field.grow { max-width: none; }
  .actions-row { flex-wrap: wrap; }
}

/* v2.96.0: remaining staff and portal forms stack at 360, and two-column grids do not squeeze fields. */
@media (max-width: 479px) {
  .task-inline { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid2 > .full, .grid3 > .full { grid-column: 1 / -1; }
}
