/* Amplify Social. Brand from amplifysocial.studio: ink and paper, a pink-lavender-cyan-lime
   spectrum used only as fills, Archivo for reading and DigiDecay (pixel) for titles and numbers.

   Type:    40/44 page title (display) · 20/28 section title · 16/24 card title · 14/22 body
            13/20 secondary · 12/16 caption · 11/16 label (caps)
   Spacing: 4 8 12 16 24 32 40

   One section per screen or component, in this order (search for the "----------" headings):
     Tokens · Base and type · Controls · App shell · Sidebar · Tab bar and More sheet · Focus mode ·
     Page header · Cards and layout · Stats · Chips, badges and dots · Notices · Tables, lists and
     feeds · Disclosures, menus and dialogs · Command palette · Phone-style post preview · Today ·
     Studio · Review mode · Post page · Calendar · Messages · Ideas · Clients · Client pages ·
     Business · Team · System · Account · Sign-in and error pages · Client-facing: the
     approval page · Client-facing: the content page · Monthly report · Client-facing: the invoice

   Order matters only where two rules of the same specificity style one element: element
   defaults and controls first, shared components next, screens last. */
@font-face { font-family: "Archivo"; src: url("/static/fonts/archivo.woff2") format("woff2-variations"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "DigiDecay"; src: url("/static/fonts/digidecay.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
/* Colour roles (one job per colour): the pipeline hues (lavender, cyan, pink, lime, then green
   for Live) mean a post's stage and nothing else. Signals: --danger act now, --warn take a look,
   --success healthy. The accent purple is for interaction only. Client colours appear only as
   small dots, badges and bars. */
:root {
  --bg: #f7f3f8;
  --surface: #fffafd;
  --sunken: #ece7ef;
  --text: #1b1521;
  --text-2: #3b3240;
  --muted: #655d69;
  --faint: #8f8694;
  --border: #e6dce9;
  --border-strong: #cfc4d3;
  --accent: #6844c4;
  --accent-hover: #4f2fa3;
  --accent-soft: #eee7ff;
  --accent-text: #ffffff;
  --pink: #f688ea;
  --lavender: #af8cff;
  --cyan: #73eef2;
  --lime: #d9ff72;
  /* A four-point blend: one colour in each corner, meeting softly in the middle (stacked
     radial gradients over a soft diagonal base, since CSS has no mesh gradient). */
  --spectrum:
    radial-gradient(circle at 0% 0%, var(--pink), transparent 65%),
    radial-gradient(circle at 100% 0%, var(--lavender), transparent 55%),
    radial-gradient(circle at 0% 100%, var(--cyan), transparent 70%),
    radial-gradient(circle at 100% 100%, var(--lime), transparent 85%),
    linear-gradient(135deg, var(--lavender), var(--cyan) 55%, var(--lime));
  /* For thin lines (underlines, progress, the next post on the day ribbon): left to right and
     back, so it can drift in a seamless loop. */
  --spectrum-line: linear-gradient(90deg, var(--pink), var(--lavender) 17%, var(--cyan) 33%, var(--lime) 50%, var(--cyan) 67%, var(--lavender) 83%, var(--pink));
  /* Pills: each status in its Studio column's hue (light tint, deep ink of the same hue). */
  --draft-bg: #eee7ff;
  --draft-text: #5631b4;
  --review-bg: #d6f7f8;
  --review-text: #00656b;
  --client-bg: #fde0f9;
  --client-text: #8c1b80;
  --ready-bg: #d9ff72;
  --ready-text: #1b1521;
  --ok-bg: #eefcc4;
  --ok-text: #2d4800;
  /* Solid signal colours for dots, bars and lights (the -bg/-text pairs are for pills). */
  --danger: #e5246b;
  --success: #5fa81a;
  /* Urgency, from the same palette: tangerine for "look at this", raspberry for "act now". */
  --warn-bg: #ffebe3;
  --warn-text: #a83a24;
  --warn: #f0704f;
  --error-bg: #ffe3ed;
  --error-text: #b0124e;
  --inverse: #1b1521;
  --inverse-text: #ffffff;
  --primary-bg: #1b1521;
  --primary-text: #ffffff;
  --night: #0d0a12;
  --night-surface: #17121f;
  --night-raised: #21182d;
  --night-line: #2a1f38;
  --night-line-strong: #554861;
  --night-text: #f7f4fa;
  --night-muted: #c6becb;
  --radius: 14px;
  --radius-sm: 9px;
  /* Sidebar width (the collapsed rail overrides it). */
  --nav-w: 256px;
  --shadow: 0 1px 2px rgba(27, 21, 33, 0.07);
  --shadow-button: 0 1px 2px rgba(27, 21, 33, 0.12), 0 1px 0 rgba(27, 21, 33, 0.04);
  --shadow-float: 0 16px 40px rgba(27, 21, 33, 0.11);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "DigiDecay", ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0a12;
    --surface: #17121f;
    --sunken: #21182d;
    --text: #f7f4fa;
    --text-2: #ddd5e2;
    --muted: #c6becb;
    --faint: #8f8496;
    --border: #2a1f38;
    --border-strong: #554861;
    --accent: #af8cff;
    --accent-hover: #c9b3ff;
    --accent-soft: #2a1f38;
    --accent-text: #0d0a12;
    --draft-bg: rgba(175, 140, 255, 0.18);
    --draft-text: #cdb8ff;
    --review-bg: rgba(115, 238, 242, 0.16);
    --review-text: #9df4f6;
    --client-bg: rgba(246, 136, 234, 0.16);
    --client-text: #f9b3f1;
    --ready-bg: #d9ff72;
    --ready-text: #0d0a12;
    --ok-bg: rgba(217, 255, 114, 0.14);
    --ok-text: #d9ff72;
    --warn-bg: rgba(245, 154, 116, 0.17);
    --warn-text: #ffb59b;
    --warn: #f59a74;
    --danger: #ff6b9c;
    --success: #a6e05a;
    --error-bg: rgba(255, 79, 135, 0.17);
    --error-text: #ff9cc0;
    --inverse: #f7f4fa;
    --inverse-text: #0d0a12;
    --primary-bg: #af8cff;
    --primary-text: #0d0a12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-button: 0 1px 2px rgba(0, 0, 0, 0.45);
    --shadow-float: 0 16px 40px rgba(3, 1, 7, 0.5);
    color-scheme: dark;
  }
}

/* ---------- Base and type ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/24px var(--font); -webkit-font-smoothing: antialiased; }
/* Changing pages: keep the scrollbar's space so content doesn't shift sideways, and cross-fade
   quickly with the sidebar held still (browsers without view transitions just navigate). */
html { scrollbar-gutter: stable; }
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 120ms; }
::view-transition-group(sidebar) { animation: none; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
h1 { font: 400 40px/44px var(--display); letter-spacing: 0; margin: 0; }
@media (max-width: 600px) { h1 { font-size: 32px; line-height: 36px; } }
h2 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0 0 16px; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; margin: 12px 0 4px; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
code { font-size: 0.9em; }
kbd { font: 13px/16px var(--font); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 6px; background: var(--surface); color: var(--muted); }
.section-title { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 16px; }
.overline { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.num { text-align: right; }
td.nowrap, .nowrap { white-space: nowrap; }
.error-text { color: var(--error-text); overflow-wrap: anywhere; }
.warn-text { color: var(--warn); font-weight: 600; }
.danger-text { color: var(--error-text) !important; }
.caption-text, .caption { white-space: pre-wrap; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Spacing overrides for one element (the policy allows no style attributes). Important, as the
   inline styles they replace were, so they win over the component's own margins. */
.flush { margin: 0 !important; }
.flush-top { margin-top: 0 !important; }
.flush-bottom { margin-bottom: 0 !important; }
.follow-line { margin: 8px 0 0 !important; }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.icon.sm { width: 16px; height: 16px; stroke-width: 1.9; vertical-align: -3px; }
.icon.xs { width: 14px; height: 14px; stroke-width: 2; vertical-align: -2px; }
.icon-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.icon-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; box-shadow: none; }
.icon-button:hover { transform: none; box-shadow: none; }

/* Spectrum lines drift slowly from left to right. */
@keyframes spectrum-drift { to { background-position-x: 200%; } }
.spectrum-underline { padding-bottom: 4px; background: var(--spectrum-line) 0 100% / 200% 4px repeat-x; animation: spectrum-drift 8s linear infinite; }
.day-ribbon .tick.next, .progress-track span, .review-top .progress span {
  background: var(--spectrum-line) 0 0 / 200% 100% repeat-x; animation: spectrum-drift 8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .spectrum-underline, .day-ribbon .tick.next, .progress-track span, .review-top .progress span { animation: none; } }

/* ---------- Controls ---------- */
/* These come before the shell and every component: the sidebar, menus and cards restyle buttons
   and inputs with selectors of the same specificity, and rely on coming later. */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; line-height: 20px; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 15px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; gap: 16px; flex-wrap: wrap; margin: 0; }
legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
input, select, textarea {
  font: 15px/22px var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--lavender) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; }
input[type="color"] { padding: 2px; height: 40px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; font-style: italic; }
.field-help { display: block; margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--muted); font-weight: 400; }
.inline-select { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.inline-select select { width: auto; }
.search-field { flex-direction: row; align-items: center; gap: 8px; min-width: 260px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 400; color: var(--muted); }
.search-field input { border: 0; padding: 8px 0; background: transparent; outline: none; }
.search-field:focus-within { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--lavender) 45%, transparent); }
.client-filter { display: inline-flex; }
.client-filter select { width: auto; min-height: 32px; padding: 4px 32px 4px 12px; border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; }
/* Drop zones for logos and photos. */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); color: var(--text-2); text-align: center; cursor: pointer; font-weight: 400; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { opacity: .6; pointer-events: none; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone .icon { color: var(--accent); width: 22px; height: 22px; }
/* Approval policy as choice cards. */
.choice-cards { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; }
.choice-cards legend { font-size: 14px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.choice-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 400; }
.choice-card:hover { border-color: var(--border-strong); }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-card input { margin-top: 3px; flex-shrink: 0; }
.choice-card > span { display: flex; flex-direction: column; gap: 2px; }
.choice-card strong { font-size: 14px; }
.choice-cards label.choice-card { flex-direction: row; align-items: flex-start; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  font: 600 15px/22px var(--font); cursor: pointer; border: 1px solid var(--primary-bg); border-radius: var(--radius-sm);
  background: var(--primary-bg); color: var(--primary-text); text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-button); transition: background-color 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.08s;
}
/* Hover moves the colour a step toward the page (lighter in light mode, darker in dark); a press sinks it. */
button:hover, .button:hover { color: var(--primary-text); background: color-mix(in srgb, var(--primary-bg) 86%, var(--bg)); border-color: color-mix(in srgb, var(--primary-bg) 86%, var(--bg)); }
button:active, .button:active { transform: translateY(1px); box-shadow: none; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-button); }
button.secondary:hover, .button.secondary:hover { color: var(--text); background: var(--sunken); border-color: var(--border-strong); }
button.danger, .button.danger { background: var(--error-bg); color: var(--error-text); border-color: var(--error-text); box-shadow: none; }
button.link { background: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; border: 0; box-shadow: none; transform: none; }
button.small, .button.small { min-height: 32px; padding: 0 12px; font-size: 14px; }
button.small.secondary, .button.small.secondary { box-shadow: none; }
button.link.small { min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
  button:active, .button:active { transform: none; }
}
button:disabled, .button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.icon-button.off { opacity: .3; pointer-events: none; }
button.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--accent); }
button.quiet:hover { background: var(--accent-soft); color: var(--accent-hover); transform: none; box-shadow: none; }
button.quiet.danger-text:hover { background: var(--error-bg); }
.link-like { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; font-size: 15px; }
.inline-form { display: inline; margin-left: 12px; }
[data-dirty-note] { color: var(--warn-text); font-weight: 600; align-self: center; margin-right: 8px; }
form.dirty > button[type="submit"]:last-child, form.dirty .toolbar button[type="submit"]:last-child { box-shadow: 0 0 0 3px var(--accent-soft); }
/* One strong action at a time: on pages with several forms, Save stays quiet until its form
   has changes. Ideas rows use outlined buttons that fill on hover. */
[data-multi-save] form:not(.dirty) button[type="submit"]:not(.danger):not(.link) { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
[data-multi-save] form:not(.dirty) button[type="submit"]:not(.danger):not(.link):hover { background: var(--sunken); color: var(--text); }
.draft-btn:hover { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary-bg); }

.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 400 14px/20px var(--font); text-decoration: none; cursor: pointer;
  box-shadow: none; transform: none;
}
.pill:hover { background: var(--bg); color: var(--text); box-shadow: none; transform: none; }
.pill:active { box-shadow: none; transform: none; }
.pill.on { background: var(--inverse); border-color: var(--inverse); color: var(--inverse-text); }
/* Small count inside a tab pill. */
.pill-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px; background: var(--sunken); color: var(--text-2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill.on .pill-count { background: color-mix(in srgb, var(--inverse-text) 22%, transparent); color: inherit; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented a, .segmented button {
  gap: 4px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 0; background: var(--surface); color: var(--text-2); font-weight: 400;
  font-size: 14px; display: inline-flex; align-items: center; text-decoration: none; box-shadow: none; transform: none;
}
.segmented.small button, .segmented.small a { min-height: 30px; padding: 0 12px; font-size: 13px; }
.segmented .on, .segmented a.on, .segmented button.on { background: var(--sunken); color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
:root.nav-collapsed { --nav-w: 72px; }
.content { flex: 1; min-width: 0; padding: 32px 40px 56px; }
.content > .wrap { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; container: page / inline-size; }
.content > .wrap:has(.inbox3), .content > .wrap:has(.board), .content > .wrap:has(.cal) { max-width: none; }
/* Skip link: hidden until a keyboard user tabs to it. */
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--inverse); color: var(--inverse-text); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
#main:focus { outline: none; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--nav-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 24px 14px 18px; background: var(--night); color: var(--night-text); border-right: 1px solid var(--night-line);
  display: flex; flex-direction: column; gap: 4px; view-transition-name: sidebar;
  /* Above the page, so the client menu (beside the collapsed rail) isn't painted under it. */
  z-index: 30;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 18px; color: var(--night-text); text-decoration: none; border-radius: 12px; }
.brand-mark { width: 32px; height: 32px; flex-shrink: 0; }
.wordmark { font: 400 17px/17px var(--display); letter-spacing: 0.02em; text-transform: uppercase; }
.sidebar .brand .brand-mark { width: 48px; height: 48px; transition: transform .2s; }
.sidebar .brand:hover .brand-mark { transform: rotate(-8deg) scale(1.04); }
.sidebar .brand .wordmark { font-size: 24px; line-height: 23px; }
.search-button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin-bottom: 16px; padding: 0 12px;
  border: 1px solid var(--night-line); border-radius: var(--radius-sm); background: var(--night-surface); color: var(--night-muted);
  font: inherit; font-weight: 400; cursor: pointer; text-align: left; box-shadow: none;
}
.search-button:hover { background: var(--night-raised); color: var(--night-text); }
.sidebar kbd { background: transparent; border-color: var(--night-line-strong); color: var(--night-muted); }
.search-button span:first-of-type { flex: 1; }
.sidebar .search-button { margin-bottom: 12px; min-height: 42px; }
.sidebar .icon-button { color: var(--night-muted); }
.sidebar .icon-button:hover { background: var(--night-surface); color: var(--night-text); }
.sidebar .muted { color: #a59cab; }
.sidebar button.link { color: var(--night-muted); }
.sidebar button.link:hover { color: var(--night-text); }

.context-wrap { position: relative; margin: 0 0 18px; }
.sidebar .context-wrap { margin: 0 0 10px; }
.switcher {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px;
  border: 1px solid var(--night-line); border-radius: 12px; background: var(--night-surface); color: var(--night-text);
}
.switcher::-webkit-details-marker { display: none; }
.switcher:hover { background: var(--night-surface); border-color: var(--night-line); }
.context[open] > .switcher { background: var(--night-surface); border-color: var(--night-line); }
.sw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.switcher.on { background: color-mix(in srgb, var(--focus) 18%, var(--night-surface)); border-color: color-mix(in srgb, var(--focus) 55%, transparent); padding-right: 44px; }
.switcher.on .ctx-chevron { display: none; }
.switcher .ctx-badge { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.sw-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-muted); line-height: 14px; }
.sw-client { font-size: 14px; font-weight: 600; color: var(--night-text); line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher.on .sw-label { color: var(--night-text); }
.ctx-badge { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--focus, var(--night-raised)); color: #1b1521; font-weight: 700; font-size: 15px; }
.ctx-badge.all { background: var(--spectrum); color: #1b1521; }
.ctx-chevron { color: var(--night-muted); transition: transform .15s; transform: rotate(90deg); }
.context[open] .ctx-chevron { transform: rotate(-90deg); }
.context-menu { margin-top: 6px; padding: 6px; border-radius: 12px; border: 1px solid var(--night-line); background: var(--night-surface); display: flex; flex-direction: column; gap: 4px; }
.ctx-search { flex-direction: row; align-items: center; gap: 6px; padding: 0 8px; border-radius: 8px; background: var(--night); border: 1px solid var(--night-line); color: var(--night-muted); font-weight: 400; }
.ctx-search input { border: 0; background: transparent; color: var(--night-text); padding: 7px 0; font-size: 14px; outline: none; min-width: 0; }
.ctx-search:focus-within { border-color: var(--lavender); }
.ctx-list { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.ctx-option { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--night-muted); box-shadow: none; font: 500 14px/1.2 var(--font); text-align: left; cursor: pointer; }
.ctx-option:hover, .ctx-option:focus-visible { background: var(--night-raised); color: var(--night-text); transform: none; box-shadow: none; }
.ctx-option.on { color: var(--night-text); font-weight: 700; }
.ctx-option .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-option.all { border-bottom: 1px solid var(--night-line); border-radius: 7px 7px 0 0; margin-bottom: 2px; }
.ctx-count { min-width: 20px; padding: 0 6px; border-radius: 9px; background: var(--night-line); color: var(--night-text); font-size: 12px; line-height: 18px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.ctx-exit { position: absolute; top: 8px; right: 6px; }
.ctx-exit .icon-button { color: var(--night-text); background: color-mix(in srgb, var(--focus, #fff) 25%, transparent); }
.ctx-exit .icon-button:hover { background: color-mix(in srgb, var(--focus, #fff) 45%, transparent); }
.sidebar .ctx-exit { top: 12px; }

.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--night-muted); text-decoration: none; font-weight: 500;
}
.nav-item:hover { background: var(--night-surface); color: var(--night-text); }
.nav-item.current { background: var(--night-raised); color: var(--night-text); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }
.nav-item .grow { flex: 1; }
.nav-badge { min-width: 22px; padding: 1px 7px; border-radius: 9px; background: var(--night-line); color: var(--night-text); font-size: 12px; line-height: 18px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.nav-alert { width: 8px; height: 8px; border-radius: 4px; background: var(--danger); }
/* Urgent means raspberry everywhere, including the Today badge (pink is With client). */
.nav-badge.hot { background: var(--danger); color: #ffffff; }
.nav-item.quiet { min-height: 34px; font-size: 14px; font-weight: 400; }
.nav-item.quiet svg { width: 16px; height: 16px; }
.sidebar .nav-item { min-height: 44px; position: relative; }
.sidebar .nav-item.quiet { min-height: 38px; }
/* Messages: a dot, not a number (Today already counts who's waiting). */
.nav-dot { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; background: var(--accent); }
/* Agency: folded at the bottom. */
.nav-agency { margin-top: auto; }
.nav-agency > summary { list-style: none; cursor: pointer; }
.nav-agency > summary::-webkit-details-marker { display: none; }
.agency-chevron { width: 14px; height: 14px; transition: transform .15s; }
.nav-agency[open] .agency-chevron { transform: rotate(90deg); }
.nav-agency[open] > summary .nav-alert { display: none; }
.nav-agency > a.nav-item { padding-left: 22px; }
.sidebar .nav-agency + .me { margin-top: 10px; }

/* The account menu. */
.sidebar .me { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--night-line); display: flex; align-items: center; gap: 12px; position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 16px; background: var(--spectrum); color: #1b1521; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar .avatar { text-decoration: none; }
.me .who { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.me .who a { color: var(--night-text); text-decoration: none; font-weight: 600; }
.me-menu > summary { list-style: none; cursor: pointer; }
.me-menu > summary::-webkit-details-marker { display: none; }
.me-pop { position: absolute; z-index: 60; left: 0; right: 0; bottom: calc(100% + 8px); display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--night-line); background: var(--night-surface); box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.me-pop form { margin: 0; }
.me-pop a, .me-pop button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; color: var(--night-muted); font: 500 14px/1.2 var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.me-pop a:hover, .me-pop button:hover, .me-pop a:focus-visible, .me-pop button:focus-visible { background: var(--night-raised); color: var(--night-text); transform: none; box-shadow: none; }
.me-pop kbd { font-size: 11px; }
.me-pop .when-collapsed { display: none; }

/* In light mode the sidebar is light too: its night colours are swapped for light ones,
   for the sidebar only (Review mode keeps its night look). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .sidebar, :root:not([data-theme="dark"]) .more-sheet {
    --night: #fffafd; --night-surface: #f4eef6; --night-raised: #ece4f1; --night-line: #e6dce9; --night-line-strong: #cfc4d3;
    --night-text: #1b1521; --night-muted: #655d69;
  }
  :root:not([data-theme="dark"]) .sidebar .muted { color: #776f7c; }
}
:root[data-theme="light"] .sidebar, :root[data-theme="light"] .more-sheet {
  --night: #fffafd; --night-surface: #f4eef6; --night-raised: #ece4f1; --night-line: #e6dce9; --night-line-strong: #cfc4d3;
  --night-text: #1b1521; --night-muted: #655d69;
}
:root[data-theme="light"] .sidebar .muted { color: #776f7c; }

/* The collapsed icon rail. */
:root.nav-collapsed .sidebar { padding: 18px 10px; overflow: visible; align-items: stretch; }
:root.nav-collapsed .sidebar .wordmark,
:root.nav-collapsed .search-button span, :root.nav-collapsed .search-button kbd, :root.nav-collapsed .ctx-chevron, :root.nav-collapsed .ctx-exit,
:root.nav-collapsed .nav-item .grow,
:root.nav-collapsed .me .who, :root.nav-collapsed .me form { display: none; }
:root.nav-collapsed .search-button { justify-content: center; padding: 0; }
:root.nav-collapsed .context-menu { position: absolute; z-index: 60; top: 0; left: calc(100% + 10px); width: 290px; box-shadow: 0 18px 48px rgba(0, 0, 0, .45); }
:root.nav-collapsed .sidebar .nav-item { justify-content: center; padding: 0; }
:root.nav-collapsed .nav-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; padding: 0 4px; font-size: 10px; line-height: 16px; }
:root.nav-collapsed .nav-alert { position: absolute; top: 8px; right: 12px; }
:root.nav-collapsed .sidebar .me { justify-content: center; flex-direction: column; gap: 8px; }
:root.nav-collapsed .sidebar .brand { justify-content: center; padding: 0 0 14px; }
:root.nav-collapsed .sidebar .brand .brand-mark { width: 40px; height: 40px; }
:root.nav-collapsed .sw-text, :root.nav-collapsed .sidebar .ctx-chevron { display: none; }
:root.nav-collapsed .switcher, :root.nav-collapsed .switcher.on { justify-content: center; padding: 6px; }
:root.nav-collapsed .nav-dot { position: absolute; top: 9px; right: 12px; }
:root.nav-collapsed .nav-agency > a.nav-item { padding-left: 0; }
:root.nav-collapsed .sidebar .me .me-menu, :root.nav-collapsed .me-pop form { display: block; }
:root.nav-collapsed .me-pop { left: calc(100% + 10px); right: auto; bottom: 0; width: 240px; }
:root.nav-collapsed .me-pop .when-open { display: none; }
:root.nav-collapsed .me-pop .when-collapsed { display: inline; }

/* ---------- Tab bar and More sheet (phones) ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar { display: none; }
  .content { padding: 24px 16px 96px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--border); padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; color: var(--muted); text-decoration: none; font-size: 12px; }
  .tabbar a.current { color: var(--accent-hover); font-weight: 600; }
}
/* The "More" tab and its sheet. */
.tab-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 48px; border: 0; background: transparent; box-shadow: none; color: var(--muted); font: 400 12px/1.2 var(--font); cursor: pointer; }
.tab-more:hover { transform: none; box-shadow: none; }
.tabbar .tab-more .icon { width: 22px; height: 22px; }
.more-sheet { width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); background: var(--night); color: var(--night-text); border-color: var(--night-line); }
.more-sheet .sheet-head h2 { color: var(--night-text); }
.more-sheet .icon-button { color: var(--night-muted); }
.more-search { margin: 14px 0 8px; }
.more-links { display: flex; flex-direction: column; gap: 2px; }
/* Phones: the More sheet copies the account block; the menu there opens downwards. */
.more-account .me { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--night-line); flex-wrap: wrap; }
.more-account .me .who { display: flex; flex-direction: column; flex: 1; }
.more-account .me .who a { color: var(--night-text); font-weight: 600; text-decoration: none; }
.more-account .avatar { text-decoration: none; }
.more-account .me-menu { flex-basis: 100%; }
.more-account .me-menu > summary { display: none; }
.more-account .me-pop { position: static; box-shadow: none; margin-top: 4px; padding: 0; border: 0; background: transparent; }
/* Collapse means nothing on a phone. */
.more-account .me-pop [data-nav-collapse] { display: none; }

/* ---------- Focus mode ---------- */
/* The focus bar: on every screen while in focus, full width at the top of the content. */
.focus-bar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  box-sizing: border-box; height: 50px; margin: -32px -40px 32px; padding: 0 40px; overflow: hidden;
  background: color-mix(in srgb, var(--focus) 28%, var(--night)); color: #f7f4fa;
  border-bottom: 2px solid var(--focus); font-size: 14px;
}
.fb-mode { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.fb-swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--focus); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.fb-text { flex: 1; min-width: 200px; color: rgba(247, 244, 250, 0.85); }
.fb-text a { color: #fff; font-weight: 700; }
.fb-text strong { color: #fff; }
.fb-exit { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: #fff; color: #1b1521; font: 700 14px/1 var(--font); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); cursor: pointer; }
.fb-exit:hover { background: #f1eef5; color: #1b1521; border-color: transparent; }
.fb-exit kbd { background: transparent; border-color: rgba(27, 21, 33, 0.25); color: #655d69; font-size: 12px; }
/* A rail in the client's colour down the content's edge, so the mode stays visible while scrolling. */
.focus-bar::before { content: ""; position: fixed; top: 0; bottom: 0; left: var(--nav-w); width: 4px; background: var(--focus); z-index: 16; pointer-events: none; }
/* Messages fills the window: leave room for the bar. */
.content:has(> .focus-bar) .inbox3 { height: calc(100dvh - 50px); }
@media (max-width: 860px) {
  .focus-bar { margin: -24px -16px 24px; padding: 8px 16px; }
  .focus-bar::before { left: 0; }
  .content:has(> .focus-bar) .inbox3 { height: calc(100dvh - 65px - 50px - env(safe-area-inset-bottom)); }
  .fb-exit kbd { display: none; }
}
.focus-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; border: 1px dashed var(--border-strong); }
.focus-empty p { margin: 0; flex: 1; min-width: 200px; color: var(--text-2); }

.toolbar.centered { justify-content: center; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .context, .post-head .context { margin: 0 0 4px; font-size: 14px; line-height: 20px; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head .context a, .post-head .context a { text-decoration: none; }
.page-head .subtitle { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.toolbar .grow { flex: 1; }
.crumbs { margin: 0 0 4px; font-size: 14px; }
.crumbs span { color: var(--muted); }

/* ---------- Cards and layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card.compact { padding: 16px; }
.columns > .card, .columns > .stack > .card { container: card / inline-size; }
.card > h2:last-child, .card > p:last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.loose { gap: 24px; }
.columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@container page (max-width: 820px) { .columns:not(.today-columns) { grid-template-columns: 1fr; } }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > label { flex: 1 1 180px; }
.row.align-top { align-items: flex-start; }
.spaced { margin-bottom: 16px; }
.narrow-card { max-width: 600px; }
/* Empty states: one card with the message and the action inside. */
.empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.empty-state p { margin: 0; }
.empty-state form { margin-top: 8px; }
.empty-inline { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.empty-inline p { margin: 0; }

/* ---------- Stats ---------- */
/* Numbers are set in the text face, not the display one: Digital Decay is for headings. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; padding: 16px 20px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat .label { order: -1; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.stat .value { font: 700 32px/40px var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 8px; }
.stat.warn .value { color: var(--warn); }
a.stat:hover { box-shadow: var(--shadow-float); border-color: var(--accent); }
.stats.compact .stat { padding: 12px 16px; }
.stats.compact .value { font-size: 28px; line-height: 34px; }
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 12px 16px; }
}

/* ---------- Chips, badges and dots ---------- */
/* Status chips read as words, not shouting: sentence case everywhere. Overlines stay uppercase. */
.chip, .badge {
  display: inline-flex; align-items: center; gap: 4px; line-height: 16px; padding: 2px 8px; border-radius: 6px; background: var(--sunken);
  color: var(--text-2); white-space: nowrap; text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 12px;
}
.chip.risk, .badge.failed, .badge.partial, .badge.cancelled, .badge.high { background: var(--error-bg); color: var(--error-text); }
.chip.review, .badge.internal_review, .badge.running, .badge.pending, .badge.launching { background: var(--review-bg); color: var(--review-text); }
.chip.client, .badge.client_review { background: var(--client-bg); color: var(--client-text); }
.chip.draft, .badge.drafted, .badge.changes_requested { background: var(--draft-bg); color: var(--draft-text); }
.chip.money, .badge.medium { background: var(--warn-bg); color: var(--warn-text); }
.badge.idea { background: var(--sunken); color: var(--text-2); }
.chip.ai { background: var(--accent-soft); color: var(--accent-hover); }
.chip.ok, .badge.done, .badge.approved, .badge.scheduled, .badge.launched { background: var(--ready-bg); color: var(--ready-text); }
.badge.discarded, .badge.stopped, .badge.dismissed { opacity: 0.7; }
.badge.waiting { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-hover); }
.chip.live, .badge.published, .badge.measured { background: var(--ok-bg); color: var(--ok-text); }
.chip.tiny { padding: 0 5px; line-height: 16px; border-radius: 4px; text-transform: none; letter-spacing: 0; font-size: 11px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; background: var(--faint); }
.dot.sm { width: 8px; height: 8px; border-radius: 4px; }
.client-badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #1b1521; font-weight: 700; font-size: 17px; flex-shrink: 0; }
.client-badge.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }
.score.up { color: var(--ok-text); }
.score.down { color: var(--error-text); }
.score.flat, .score.none { color: var(--muted); }

.meter { display: block; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
/* Meters and spend bars are quantities, not links: neutral ink; tangerine near a limit. */
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--text-2); }
.meter.thin { height: 4px; }
.meter.hot span { background: var(--warn); }
.ring { flex-shrink: 0; }
.progress-track { display: block; height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: 4px; }

/* ---------- Notices ---------- */
.notice { margin: 0; padding: 12px 16px; border-radius: var(--radius-sm); }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice.error { background: var(--error-bg); color: var(--error-text); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.story-note { border: 1px solid var(--border); }
/* Success messages float over the top of the page instead of pushing it down, and leave on
   their own (app.js times them by length, pauses them on hover and adds the close button).
   Centered over the content, not the sidebar. Without JS they simply stay. */
.notice.toast {
  position: fixed; top: 16px; left: 50%; z-index: 40; translate: -50% 0; width: max-content; max-width: min(560px, calc(100vw - 32px));
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 12px 12px 16px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.28); border: 1px solid color-mix(in srgb, var(--ok-text) 25%, transparent);
  animation: toast-in 0.2s ease-out; transition: opacity 0.3s, translate 0.3s;
  /* The success tint is translucent in dark mode: lay it on the solid surface so nothing shows through. */
  background: linear-gradient(var(--ok-bg), var(--ok-bg)), var(--surface);
}
.notice.toast.leaving { opacity: 0; translate: -50% -8px; }
.notice.toast .toast-close { flex-shrink: 0; margin: -4px -4px -4px 0; width: 28px; height: 28px; min-height: 0; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; box-shadow: none; color: inherit; opacity: 0.7; font-size: 18px; line-height: 1; cursor: pointer; }
.notice.toast .toast-close:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
@media (min-width: 861px) { body:has(.shell) .notice.toast { left: calc(50% + var(--nav-w) / 2); } }
@media (max-width: 860px) { .notice.toast { top: 12px; } }
@keyframes toast-in { from { opacity: 0; translate: -50% -8px; } }
@media (prefers-reduced-motion: reduce) { .notice.toast { animation: none; transition: none; } }
.notice > strong:first-child { font-weight: 700; }
.notice.spaced { margin-bottom: 16px; }
/* The pre-flight check's findings, just above the review controls. */
.notice.preflight { margin: 16px 0 0; }
.notice.preflight ul { margin: 4px 0 0; padding-left: 20px; }
.board-card .flag.check { color: var(--warn-text); }
/* Earned trust: one calm line on a client's Overview with its two answers. */
.trust-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
/* Ready-made fixes on the presence audit: code and texts with a copy button. */
.copyable { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.copyable textarea { width: 100%; font-size: 13px; }
.copyable textarea.code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.copyable p { margin: 0; overflow-wrap: anywhere; }
.copyable button { align-self: flex-start; }
ul.plain { list-style: none; margin: 4px 0 0; padding: 0; }
.finding-links li { padding: 2px 0; }
/* What an AI draft for a customer stands on, and owner-question / suggested-fact notes. */
.draft-grounds { margin-top: -4px; overflow-wrap: anywhere; }
.side-note { margin: 12px 0; overflow-wrap: anywhere; }
.suggested-facts { margin-bottom: 12px; }
.suggested-facts form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; }
.suggested-facts .grow { flex: 1; min-width: 12rem; }

/* Plain-language problems keep the technical detail one click away. */
.tech-details { margin-top: 6px; font-size: 13px; }
.tech-details > summary { cursor: pointer; color: inherit; width: fit-content; text-decoration: underline dotted; text-underline-offset: 3px; }
.tech-details[open] > summary { margin-bottom: 4px; }
.tech-details code { font-size: 12px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--error-bg); color: var(--error-text); }
.banner .grow { flex: 1; min-width: 200px; }
.banner .button { background: var(--error-text); color: #ffffff; }

/* ---------- Tables, lists and feeds ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.table-scroll { overflow-x: auto; }
tr.inactive td { opacity: 0.5; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table-card th { position: sticky; top: 0; background: var(--surface); }
.table-card th:first-child, .table-card td:first-child { padding-left: 20px; }
.table-card th:last-child, .table-card td:last-child { padding-right: 20px; }
.table-card tbody tr:last-child td { border-bottom: 0; }
.table-card td { vertical-align: middle; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--bg); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.card-link { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; background: var(--surface); }
.card-link:hover { border-color: var(--accent); }
.card-link .badge { align-self: flex-start; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plain-list .grow a { color: var(--text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plain-list .when { font-size: 14px; line-height: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Disclosures, menus and dialogs ---------- */
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary h2 { margin: 0; flex: 1; }
.disclosure > summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--muted); }
.disclosure[open] > summary { margin-bottom: 16px; }
.disclosure[open] > summary::after { content: "–"; }
/* Generic disclosure for cards (History, "How it works"). */
details.disclosure > summary > span:first-child { font-weight: 600; flex: 1; }
details.disclosure > summary .count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
details.card.disclosure[open] > summary { margin-bottom: 12px; }
.card > details.disclosure { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.card > details.disclosure[open] > summary { margin-bottom: 10px; }
.inline-disclosure { margin-top: 16px; }
.inline-disclosure > summary::after { content: none; }
.inline-disclosure[open] > summary { margin-bottom: 12px; }
.inline-details { display: inline; }
.inline-details > summary { display: inline; }

.person-menu { position: relative; }
.person-menu > summary { list-style: none; cursor: pointer; font-size: 18px; color: var(--muted); }
.person-menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 190px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 14px 36px rgba(13, 10, 18, .28); }
.menu-pop form { margin: 0; }
.menu-item { display: block; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); box-shadow: none; font: 500 14px/1 var(--font); text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--bg); transform: none; box-shadow: none; }
.menu-pop.up { top: auto; bottom: calc(100% + 6px); }
.menu-pop .menu-item { white-space: nowrap; }

dialog.sheet { width: min(480px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(13, 10, 18, 0.35); }
dialog.sheet::backdrop { background: rgba(13, 10, 18, 0.45); backdrop-filter: blur(2px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; }
/* The keyboard shortcuts dialog. */
.shortcut-list { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shortcut-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: baseline; }
.shortcut-list dt { white-space: nowrap; }
.shortcut-list dd { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- Command palette ---------- */
.palette-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(20, 20, 18, 0.45); display: none; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-backdrop.open { display: flex; }
.palette { width: 100%; max-width: 640px; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); overflow: hidden; }
.palette .p-input { display: flex; flex-direction: row; align-items: center; font-weight: 400; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.palette .p-input input { border: 0; padding: 0; font-size: 17px; outline: none; background: transparent; }
.palette .p-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.palette .p-group { margin: 8px 12px 4px; }
.palette .p-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.palette .p-item.active { background: var(--accent-soft); }
.palette .p-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #ffffff; font-weight: 700; font-size: 14px; flex-shrink: 0; background: var(--faint); }
.palette .p-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.palette .p-text span { font-size: 13px; color: var(--muted); }
.palette .p-foot { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--bg); font-size: 13px; color: var(--muted); }
.palette .p-empty { padding: 32px; text-align: center; color: var(--muted); }
/* Client colours are mid-tone brand hues: initials on them use dark ink. */
.palette .p-icon.glyph { color: #1b1521; }

/* ---------- Phone-style post preview ---------- */
.phone { width: 340px; max-width: 100%; background: #ffffff; color: #1d1d1b; border-radius: 24px; padding: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }
.phone .ph-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; font-size: 14px; font-weight: 600; }
.phone .ph-head .grow { flex: 1; }
.phone .ph-avatar { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #1b1521; }
.phone img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; }
.phone .ph-placeholder { aspect-ratio: 4 / 5; border-radius: 6px; display: flex; align-items: flex-end; padding: 18px; font-weight: 800; font-size: 26px; line-height: 1.05; color: #1b1521; }
.phone .ph-caption { margin: 12px 4px 4px; font-size: 14px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
/* A carousel swipes (or steps with the arrows); a story is tall. */
.phone .ph-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 6px; }
.phone .ph-slides::-webkit-scrollbar { display: none; }
.phone .ph-slides > a { flex: 0 0 100%; scroll-snap-align: start; }
.phone .ph-slides img { border-radius: 0; }
.phone .ph-steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; }
.phone .ph-dot { width: 6px; height: 6px; border-radius: 3px; background: currentColor; opacity: 0.25; }
.phone .ph-dot.on { opacity: 0.9; background: #3d8bfd; }
.phone .ph-step { background: none; border: 0; color: inherit; font-size: 20px; line-height: 1; padding: 2px 8px; min-height: 0; cursor: pointer; opacity: 0.7; }
.phone .ph-step:hover { opacity: 1; }
.phone .ph-story img, .phone .ph-story-img { aspect-ratio: 9 / 16; }
.phone .story-no-caption { font-style: italic; }
.carousel-note, .story-link { margin: 6px 0 0; }
.story-link { display: flex; align-items: center; gap: 6px; }
.story-make { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 0; }
.slide-fields { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 12px; margin: 0; display: grid; gap: 6px; }
.slide-fields.new { border-style: dashed; }
.slide-fields legend { padding: 0 4px; }
.ro-slides { margin: 0; padding-left: 22px; display: grid; gap: 4px; }
/* Phone previews follow dark mode, as the apps themselves do (post page and Review mode). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .phone { background: #121016; color: #f2eff5; box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0, 0, 0, 0.4); }
  :root:not([data-theme="light"]) .phone .ph-caption strong { color: #ffffff; }
}
:root[data-theme="dark"] .phone { background: #121016; color: #f2eff5; box-shadow: 0 0 0 1px var(--border), 0 12px 40px rgba(0, 0, 0, 0.4); }

/* ---------- Today ---------- */
/* Today keeps two columns while the page has room for them; below that it is one column,
   with Needs you first. */
.today-columns { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
@container page (max-width: 860px) {
  .today-columns { grid-template-columns: 1fr; }
  .today-columns > .stack { display: contents; }
  .today-columns .needs-card { order: -1; }
  /* Both columns flow into one: what needs you, the day, waiting on others, then the week. */
  .today-columns .week-card { order: 1; }
}

/* Going out today: one line for the whole day, the next post up front, the rest compact, and
   what's out folded away. Everything sizes from the card's own width. */
.day-card .card-head { margin-bottom: 12px; }
.day-count { font: 700 17px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.day-ribbon { display: flex; gap: 3px; margin-bottom: 16px; }
.day-ribbon .tick { flex: 1; height: 6px; border-radius: 3px; background: var(--sunken); min-width: 3px; }
.day-ribbon .tick.late { background: var(--danger); }
.day-ribbon .tick.done { background: var(--success); }
.ribbon-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.ribbon-key li { display: inline-flex; align-items: center; gap: 6px; }
.ribbon-key .key { width: 10px; height: 6px; border-radius: 3px; background: var(--sunken); }
.ribbon-key .key.late { background: var(--danger); }
.ribbon-key .key.done { background: var(--success); }
.next-up { display: flex; gap: 16px; align-items: stretch; padding: 14px; margin-bottom: 8px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--bg); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.next-up:hover { border-color: var(--text); }
.next-thumb { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; color: #1b1521; font-weight: 700; font-size: 28px; }
.next-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.next-label { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.next-title { font-size: 17px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.next-time { font: 700 20px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.day-label { margin: 12px 0 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.day-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.day-row:hover { background: var(--bg); }
.day-row + .day-row { box-shadow: 0 -1px 0 var(--border); }
.day-row:hover, .day-row:hover + .day-row { box-shadow: none; }
.day-row .time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.day-row .what { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.day-row .what strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row .what .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-row.late .time { color: var(--error-text); font-weight: 700; }
.day-row.late.single { margin-bottom: 8px; background: var(--error-bg); }
.day-row.done { opacity: .55; }
.day-row.done:hover { opacity: 1; }
.day-row.done .icon { color: var(--ok-text); }
/* The pill says the status; a red time says it's not ready. */
.day-row .time.urgent, .next-time.urgent { color: var(--error-text); font-weight: 700; }
.day-more > summary, .day-done > summary { list-style: none; cursor: pointer; }
.day-more > summary::-webkit-details-marker, .day-done > summary::-webkit-details-marker { display: none; }
.day-more > summary { padding: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--accent); }
.day-more[open] > summary { display: none; }
.day-finished { margin: 4px 0 0; }
.day-done { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.day-done > summary { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.day-done[open] > summary { margin-bottom: 4px; }
.day-done[open] .link-like { visibility: hidden; }
.thumb-stack { display: inline-flex; flex-shrink: 0; }
.thumb-stack > * { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; border: 2px solid var(--surface); margin-left: -8px; display: block; }
.thumb-stack > :first-child { margin-left: 0; }
.day-card .grow { flex: 1; min-width: 0; }
@container card (max-width: 340px) {
  .next-up { gap: 12px; padding: 12px; }
  .next-thumb { width: 64px; height: 64px; font-size: 20px; }
  .next-time { font-size: 18px; }
  .day-row { grid-template-columns: minmax(0, 1fr) auto; }
  .day-row .time { grid-column: 1 / -1; font-size: 13px; line-height: 14px; }
  .thumb-stack > :nth-child(n+5) { display: none; }
}
@container card (max-width: 240px) {
  .next-up { flex-direction: column; }
  .next-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}
@container card (min-width: 520px) { .next-thumb { width: 120px; height: 120px; } }

/* This week, as readiness per day. */
.week-card .card-head { margin-bottom: 4px; }
.week-total { margin: 0 0 12px; font-size: 14px; color: var(--text-2); }
.week-total strong { font: 700 20px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); margin-right: 4px; }
.gap-note { color: var(--warn-text); font-weight: 600; }
.week-legend { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.week-legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key.gap, .seg.gap { background: repeating-linear-gradient(135deg, var(--border-strong) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--border-strong); }
/* The week chart and its legend use the pipeline order. */
.key.out, .seg.out { background: var(--success); }
.key.ready, .seg.ready { background: var(--lime); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent); }
.key.waiting, .seg.waiting { background: var(--cyan); }
.key.not-ready, .seg.not-ready { background: var(--lavender); }
.week-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.week-rows a { display: grid; grid-template-columns: 52px minmax(0, 1fr) 48px; align-items: center; gap: 10px; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.week-rows a:hover { background: var(--bg); }
.week-rows .wd { display: flex; align-items: baseline; gap: 6px; }
.week-rows .name { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.week-rows .date { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stack-bar { display: flex; gap: 2px; height: 12px; }
.stack-bar .seg { border-radius: 3px; min-width: 4px; }
.week-rows .n { text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.week-rows .n .gap-note { font-size: 12px; }
.week-rows li.past a { opacity: .5; }
.week-rows li.past a:hover { opacity: 1; }
.week-rows li.today a { background: var(--accent-soft); }
.week-rows li.today .name { color: var(--accent); }

/* Needs you: count tiles over one list of triage rows. */
.needs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0 0 16px; }
.needs-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: var(--sunken); color: var(--text); text-align: left; font-weight: 400; min-height: 0; height: auto; }
.needs-tile:hover { background: var(--bg); border-color: var(--border); }
.needs-tile.on { background: var(--surface); border-color: var(--border-strong); box-shadow: 0 1px 0 var(--border); }
.nt-count { font-size: 24px; line-height: 28px; font-weight: 700; }
.nt-label { font-size: 13px; line-height: 16px; color: var(--text-2); }
.nt-hint { font-size: 12px; line-height: 16px; color: var(--muted); min-height: 16px; }
.nt-hint.hot { color: var(--error-text); font-weight: 600; }
.triage-group + .triage-group { margin-top: 20px; }
.triage-head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.triage-head .count { padding: 0 6px; border-radius: 6px; background: var(--sunken); color: var(--text-2); font-variant-numeric: tabular-nums; }
.triage-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 16px; margin: 0 -8px; border-radius: 10px; color: var(--text); text-decoration: none; }
.triage-row.risk::before, .triage-row.money::before { content: ""; position: absolute; left: 3px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.triage-row.money::before { background: var(--warn); }
.triage-row + .triage-row { box-shadow: 0 -1px 0 var(--border); }
.triage-row:hover { background: var(--bg); box-shadow: none; }
.triage-row:hover + .triage-row { box-shadow: none; }
.tr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
/* Titles wrap to two lines instead of hiding behind their tag. */
.tr-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.tr-top strong { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tr-tag { flex-shrink: 0; padding: 0 6px; border-radius: 4px; background: var(--error-bg); color: var(--error-text); font-size: 12px; line-height: 18px; font-weight: 700; }
.tr-meta { font-size: 13px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-quote { font-size: 14px; line-height: 19px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-quote::before { content: "“"; }
.tr-quote::after { content: "”"; }
.tr-action { flex-shrink: 0; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--accent); }
.triage-row:not(:hover) .tr-action { color: var(--muted); }
.triage-more > summary { list-style: none; cursor: pointer; padding: 8px 0 0 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
.triage-more > summary::-webkit-details-marker { display: none; }
.triage-more[open] > summary { display: none; }
@container card (max-width: 420px) { .tr-action .label { display: none; } }
/* With the tiles working, one group shows at a time and the tile is its heading. */
.needs-card.tiled .triage-group { display: none; margin-top: 0; }
.needs-card.tiled .triage-group.on { display: block; }
.needs-card.tiled .triage-head { display: none; }
/* Time column: a countdown before a deadline, or how long someone has waited. */
.triage-row.timed { padding-left: 8px; }
.triage-row.timed::before { display: none; }
.tr-when { flex: 0 0 68px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.tr-when strong { font-size: 14px; line-height: 18px; font-weight: 700; white-space: nowrap; }
.tr-when small { font-size: 11px; line-height: 14px; color: var(--muted); }
.tr-when.hot strong { color: var(--error-text); }
.tr-bar { flex: 0 0 3px; align-self: stretch; background: var(--c); border-radius: 2px; }
/* Posts to review, per client: each opens Review mode for that client. */
.review-clients { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 16px; }
.review-clients a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.review-clients a:hover { background: var(--bg); }
.review-clients .rc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-clients .rc-count { color: var(--muted); font-weight: 600; }
.needs-card .setup-group { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.needs-card.tiled .setup-group { display: block; }
.needs-card.tiled .setup-group .triage-head { display: flex; }
.waiting-item { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; padding: 8px; margin: 0 -8px; border-radius: var(--radius-sm); }
.waiting-item:hover { background: var(--bg); }
.waiting-item .dot { margin-top: 6px; }
.waiting-item .body { display: flex; flex-direction: column; min-width: 0; }

/* Coming up and Worth knowing. */
.up-label { margin-top: 20px; }
.up-empty { margin: 16px 0 0; }
.up-list { list-style: none; margin: 0; padding: 0; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; margin: 0 -8px; border-radius: 10px; color: var(--text); text-decoration: none; }
.up-list li + li .up-row { box-shadow: 0 -1px 0 var(--border); }
.up-row:hover { background: var(--bg); box-shadow: none; }
.up-row:not(:hover) .tr-action { color: var(--muted); }
.up-day { flex: 0 0 88px; white-space: nowrap; font-size: 13px; font-weight: 700; color: var(--text-2); border-left: 3px solid var(--c); padding-left: 8px; }
.up-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.up-body strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@container page (max-width: 700px) {
  .up-day { flex-basis: 64px; white-space: normal; }
  .up-body strong { white-space: normal; }
}
.gap-idea { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px 18px; padding: 8px 10px; border-radius: 10px; background: var(--sunken); }
.gap-idea > svg { color: var(--accent); flex-shrink: 0; }
.gi-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; }
.gi-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.gap-idea button { flex-shrink: 0; white-space: nowrap; }
.up-list li:has(.gap-idea) + li .up-row { box-shadow: none; }
.win-hero { display: flex; gap: 14px; align-items: center; padding: 8px; margin: 4px -8px 6px; border-radius: 12px; color: var(--text); text-decoration: none; }
.win-hero:hover, .win-row:hover { background: var(--bg); }
.win-thumb { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex-shrink: 0; display: block; }
.win-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.win-body strong { font-weight: 600; line-height: 1.3; }
.win-ratio { font-size: 26px; line-height: 30px; font-weight: 700; color: var(--ok-text); }
.win-ratio.sm { font-size: 15px; line-height: 20px; }
.win-numbers { color: var(--text-2); }
.win-row { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 10px; color: var(--text); text-decoration: none; box-shadow: 0 -1px 0 var(--border); }
.win-line { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.win-line strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-note { margin: 10px 0 0; }
@container page (max-width: 700px) {
  .gap-idea { flex-wrap: wrap; margin-left: 0; }
  .gap-idea button { margin-left: 26px; }
}

/* ---------- Studio ---------- */
.studio-head { align-items: center; }
.studio-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.studio-tools .client-filter select { min-height: 38px; }
.approvals-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.approvals-bar > svg { color: var(--muted); }
.ab-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--sunken); color: var(--text-2); font-size: 13px; line-height: 22px; list-style: none; cursor: default; }
.ab-chip.info { background: var(--review-bg); color: var(--review-text); }
.ab-chip.warn { background: var(--warn-bg); color: var(--warn-text); font-weight: 600; }
.ab-menu { position: relative; }
.ab-menu > summary { cursor: pointer; }
.ab-menu > summary::-webkit-details-marker { display: none; }
.ab-menu[open] > summary svg { transform: rotate(180deg); }
.ab-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 48px)); padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 48px rgba(27, 21, 33, .16); display: flex; flex-direction: column; }
.ab-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border-radius: 8px; }
.ab-row + .ab-row { box-shadow: 0 -1px 0 var(--border); }
.ab-row .dot { margin-top: 6px; }
.ab-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ab-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ab-send { margin-left: auto; }
.filter-chip { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-hover); font-size: 13px; }
.filter-chip form { margin: 0; }

.board-scroll { overflow-x: auto; padding-bottom: 8px; }
/* Each column scrolls on its own within the window, its heading pinned, so every drop target
   stays in view while dragging. */
/* The work stages share the room; Ideas, Ready and Live fold into slim rails. */
.board {
  display: flex; gap: 12px; min-width: 900px; align-items: stretch;
  /* Only once the board becomes a grid (860px and below, see the end of this section). */
  grid-template-columns: minmax(150px, .85fr) minmax(170px, 1fr) minmax(200px, 1.25fr) minmax(190px, 1.1fr) minmax(170px, 1fr) minmax(150px, .85fr);
}
.board-col {
  display: flex; flex-direction: column; gap: 8px; min-height: 360px; max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
  padding: 0 6px 10px; margin: 0 -6px; border-radius: 12px; scrollbar-width: thin; transition: background .12s, opacity .12s; flex: 1 1 0;
  min-width: 190px;
}
.board-col.col-review { flex-grow: 1.25; }
.board-col .col-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 8px; padding: 2px 2px 10px; margin-bottom: 4px;
  background: var(--bg); border-bottom: 2px solid var(--col, var(--border-strong)); flex-wrap: wrap; row-gap: 6px;
}
.board-col .col-head h2 { margin: 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.board-col .col-head .count { font-size: 13px; line-height: 16px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-col .col-head .link { margin-left: auto; font-size: 13px; }
.board-col .col-empty { margin: 0; padding: 20px 8px; text-align: center; font-size: 13px; line-height: 16px; color: var(--faint); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.board-col .col-add { display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.board-col .col-add:hover { color: var(--accent); }
.board-col .col-head .unsent-badge { margin-left: 0; }
.day-group { margin: 6px 2px 0; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.day-group:first-of-type { margin-top: 0; }

.board-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.board-card:hover { border-color: var(--border-strong); }
.board-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.board-card .row-top { display: flex; gap: 10px; align-items: flex-start; }
.board-card .title { flex: 1; min-width: 0; color: var(--text); font-weight: 600; font-size: 14px; line-height: 18px; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-card .title::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.board-card .thumb-img, .board-card .thumb-color { width: 32px; aspect-ratio: 4 / 5; border-radius: 4px; flex-shrink: 0; object-fit: cover; background: var(--client, var(--sunken)); }
.board-card .thumb-color { font-size: 0; }
.board-card .thumb { position: relative; display: block; flex-shrink: 0; line-height: 0; }
/* A carousel's "1/6", a story's "9:16": on the thumbnail's corner. */
.board-card .thumb-badge { position: absolute; right: -5px; bottom: -4px; padding: 1px 3px; border-radius: 4px; background: var(--text); color: var(--surface); font-size: 10px; line-height: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-card .meta-line { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; line-height: 16px; color: var(--muted); }
.board-card .meta-line .client { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card .meta-line .when { flex-shrink: 0; font-variant-numeric: tabular-nums; }
/* A post being rewritten is a Drafting state, not a link. */
.board-card .flag { margin: 0; font-size: 13px; line-height: 16px; font-weight: 600; color: var(--draft-text); }
/* The select box sits in the card's free bottom-right corner, not on the thumbnail. */
.board-card .select {
  position: absolute; z-index: 1; display: grid; place-items: center; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity 0.1s;
  top: auto; bottom: 6px; right: 6px; width: 24px; height: 24px; box-shadow: none; background: transparent;
}
.board-card .select input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.board-card:hover .select, .board-card:focus-within .select, .board-card.selected .select, [data-board].selecting .select { opacity: 1; }
@media (hover: none) { .board-card .select { opacity: 1; } }
.board-card .flag.unsent { color: var(--warn-text); }
.board-card:has(.select) .meta-line { padding-right: 28px; }
/* Compact cards where there's nothing to decide: ideas and what's already live. */
.col-ideas .board-card, .col-live .board-card { gap: 2px; padding: 7px 8px 7px 11px; }
.col-ideas .board-card .thumb-img, .col-ideas .board-card .thumb-color, .col-live .board-card .thumb-img, .col-live .board-card .thumb-color { width: 24px; }
.col-live .board-card { opacity: .8; }
.col-live .board-card:hover { opacity: 1; }

.rail-summary {
  display: none; flex: 1; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 10px 0; border: 1px solid var(--border);
  border-top: 3px solid var(--col); border-radius: 10px; background: var(--surface); color: var(--text-2); box-shadow: none; cursor: pointer;
}
.rail-summary:hover { background: var(--sunken); color: var(--text); transform: none; box-shadow: none; }
.rail-count { font: 700 16px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.rail-title { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
/* The waiting count reads horizontally, as a small tangerine badge. */
.rail-alert {
  min-width: 20px; border-radius: 9px; font-weight: 700; text-align: center; white-space: nowrap; writing-mode: horizontal-tb; transform: none;
  padding: 0 6px; font-size: 11px; line-height: 18px; background: var(--warn-bg); color: var(--warn-text);
}
.rail-close { margin-left: auto; width: 24px; height: 24px; color: var(--muted); }
.rail-open { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin-top: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.rail-summary:hover .rail-open { color: var(--accent); }
@media (min-width: 861px) {
  .board-col.rail:not(.open) { flex: 0 0 52px; min-width: 52px; padding: 0; margin: 0; overflow: hidden; }
  .board-col.rail:not(.open) > :not(.rail-summary) { display: none; }
  .board-col.rail:not(.open) > .rail-summary { display: flex; }
}

/* Dragging between stages: allowed columns light up, the rest fade. */
.board-card.movable { cursor: grab; }
.board-card.movable:active { cursor: grabbing; }
.board-card.dragging { opacity: .35; }
[data-board].dragging .board-col { opacity: .45; }
[data-board].dragging .board-col.can-drop { opacity: 1; background: color-mix(in srgb, var(--col) 10%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--col) 45%, transparent); }
[data-board].dragging .board-col.drop { background: color-mix(in srgb, var(--col) 22%, transparent); box-shadow: inset 0 0 0 2px var(--col); }
[data-board].dragging .board-col.can-drop .col-head { background: transparent; }
.drop-hint { display: none; margin: 4px 0; padding: 14px 8px; border: 2px dashed var(--col); border-radius: 10px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-2); }
[data-board].dragging .board-col.can-drop .drop-hint { display: block; }
[data-board].dragging .board-col.rail.can-drop .rail-summary { border-color: var(--col); background: color-mix(in srgb, var(--col) 15%, var(--surface)); }
[data-board].dragging .board-col.rail.drop .rail-summary { background: color-mix(in srgb, var(--col) 30%, var(--surface)); }

.selection-bar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--inverse); color: var(--inverse-text); }
.selection-bar .grow { flex: 1; font-weight: 600; }
.selection-bar button.secondary { background: transparent; color: var(--inverse-text); border-color: var(--faint); }
/* The main action on the bar: light on the dark bar. */
.selection-bar button.secondary.inverse { background: var(--inverse-text); color: var(--inverse); }
/* Posts not yet sent for approval, as one line and a picker. */
.unsent-badge { margin-left: auto; padding: 0 8px; min-height: 0; border: 0; border-radius: 99px; background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn-text); font: 700 12px/18px var(--font); box-shadow: none; cursor: pointer; }
.unsent-badge:hover { background: color-mix(in srgb, var(--warn) 35%, transparent); transform: none; box-shadow: none; }
.send-picker { width: min(520px, calc(100vw - 32px)); }
.picker-tools { display: flex; align-items: center; gap: 12px; }
.picker-tools .search-field { flex: 1; min-width: 0; }
.pick-list { display: flex; flex-direction: column; max-height: min(420px, 55vh); overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.pick-row { flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; font-weight: 500; font-size: 15px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--bg); }
.pick-row input { margin: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.pick-row .grow { flex: 1; min-width: 0; }
.pick-count { font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* Studio as a full-window view: the page stays put and each column scrolls on its own, so
   there's one scroll per place instead of a scrolling page full of scrolling columns. */
@media (min-width: 861px) {
  .content:has(.board) { height: 100dvh; padding-bottom: 20px; overflow: hidden; display: flex; flex-direction: column; }
  .content:has(.board) > .focus-bar { flex-shrink: 0; }
  .content:has(.board) > .wrap { flex: 1; min-height: 0; width: 100%; }
  .content:has(.board) > .wrap > :not([data-board]) { flex-shrink: 0; }
  .content:has(.board) [data-board] { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
  .content:has(.board) .board-scroll { flex: 1; min-height: 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 0; }
  .content:has(.board) .board { height: 100%; align-items: stretch; }
  .content:has(.board) .board-col { max-height: none; min-height: 0; height: 100%; }
  .content:has(.board) .selection-bar { position: static; }
}
/* Phones: one scrolling page; the columns swipe sideways and don't scroll on their own. */
@media (max-width: 860px) {
  .board-col { max-height: none; overflow: visible; }
  .board { display: grid; grid-auto-flow: column; grid-auto-columns: 80vw; min-width: 0; }
  .board-col.rail { min-width: 0; }
  .rail-close { display: none; }
}
@media (max-width: 700px) {
  .board-scroll { scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .board { grid-template-columns: repeat(6, 80vw); }
  .board-col { scroll-snap-align: start; min-height: 0; }
}

/* ---------- Review mode ---------- */
.review-mode { min-height: 100vh; background: var(--night); color: var(--night-text); display: flex; flex-direction: column; outline: none; }
.review-mode a { color: var(--lavender); }
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 16px 32px; border-bottom: 1px solid var(--night-line); }
.review-top .progress { flex: 1; max-width: 420px; height: 6px; border-radius: 3px; background: var(--night-line); overflow: hidden; }
.review-top .progress span { display: block; height: 100%; border-radius: 3px; }
.review-top .overline { color: var(--night-muted); }
.review-mode .pill { background: transparent; color: var(--night-muted); border-color: var(--night-line-strong); }
.review-mode .pill.on { background: var(--night-text); color: var(--night); border-color: var(--night-text); font-weight: 600; }
.review-mode .phone { box-shadow: 0 0 0 1px var(--night-line), 0 30px 80px rgba(175, 140, 255, 0.2); }
.review-mode textarea { background: var(--night-surface); color: var(--night-text); border-color: var(--night-line-strong); }
.review-mode .notice.warn { background: #3a2a14; color: #ffc078; }
.review-mode .decision-client .muted { color: var(--night-muted); }
.review-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 64px 32px; text-align: center;
  background-image: linear-gradient(var(--night-surface) 1px, transparent 1px), linear-gradient(90deg, var(--night-surface) 1px, transparent 1px); background-size: 56px 56px; }
.review-done h1 { font: 400 56px/56px var(--display); }
.review-done p { color: var(--night-muted); max-width: 440px; font-size: 17px; line-height: 24px; }
.review-stage { flex: 1; display: grid; grid-template-columns: 360px minmax(0, 520px); justify-content: center; gap: 48px; align-items: start; padding: 36px 32px 24px; }
.review-stage .phone { width: 360px; }
.review-preview { display: flex; flex-direction: column; gap: 10px; max-width: 100%; }
.review-slides-hint { margin: 0; max-width: 360px; color: var(--night-muted); }
.decision { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--night-line); border-radius: 18px; background: var(--night-surface); }
.decision h1 { margin: 0; color: var(--night-text); font: 700 26px/33px var(--font); letter-spacing: -0.01em; }
.decision-client { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--night-muted); font-size: 14px; }
.checks { list-style: none; margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-radius: 12px; background: var(--night); border: 1px solid var(--night-line); font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 10px; color: var(--night-text); }
.checks li .icon { flex-shrink: 0; }
.checks li.ok .icon { color: var(--lime); }
.checks li.bad { color: #ffaba2; }
.checks li.bad .icon { color: var(--danger); }
.checks li.route { color: var(--night-muted); padding-top: 8px; border-top: 1px solid var(--night-line); }
.decision-brief { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--night-raised); color: var(--night-text); font-size: 15px; line-height: 22px; display: flex; flex-direction: column; gap: 4px; }
.decision-brief .overline { margin: 0; color: var(--night-muted); }
.changes-box label { color: var(--night-muted); }
.send-changes { background: var(--pink); border-color: var(--pink); color: #1b1521; box-shadow: none; }
.quiet-night { background: transparent !important; color: var(--night-text) !important; border-color: var(--night-line-strong) !important; box-shadow: none !important; }
.decision-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.decision-actions form { margin: 0; }
.decision-actions .approve, .decision-actions .changes { width: 100%; min-height: 52px; justify-content: center; font-size: 16px; }
.decision-actions .approve { background: var(--lime); border-color: var(--lime); color: #1b1521; box-shadow: none; }
.decision-actions .approve:hover { background: color-mix(in srgb, var(--lime) 88%, #fff); border-color: color-mix(in srgb, var(--lime) 88%, #fff); color: #1b1521; }
.decision-actions .changes { background: transparent; border: 1px solid var(--pink); color: var(--pink); box-shadow: none; }
.decision-actions .changes:hover { background: color-mix(in srgb, var(--pink) 15%, transparent); }
.decision-minor { display: flex; gap: 8px; }
.decision-minor .button { flex: 1; justify-content: center; min-height: 42px; background: transparent; color: var(--night-text); border-color: var(--night-line-strong); box-shadow: none; }
.decision-minor .button[data-prev] { flex: 0 0 48px; }
.decision kbd, .decision-actions kbd { background: transparent; border-color: currentColor; color: inherit; opacity: 0.7; }
.up-next { display: flex; align-items: center; gap: 16px; padding: 14px 32px 18px; border-top: 1px solid var(--night-line); }
.up-next .overline { margin: 0; color: var(--night-muted); flex-shrink: 0; }
.up-next-strip { display: flex; gap: 10px; overflow-x: auto; align-items: stretch; }
.up-next-item { display: grid; grid-template-columns: 40px 150px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 10px; border: 1px solid var(--night-line); background: var(--night-surface); text-decoration: none; }
.up-next-item:hover { border-color: var(--night-line-strong); }
.up-next-item img, .up-next-item .blank { grid-row: 1 / 3; width: 40px; height: 48px; border-radius: 6px; object-fit: cover; background: color-mix(in srgb, var(--client) 40%, var(--night-raised)); }
.up-next-title { color: var(--night-text); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-next-client { color: var(--night-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-next-more { align-self: center; color: var(--night-muted); font-size: 13px; white-space: nowrap; padding: 0 8px; }
@media (max-width: 960px) {
  .review-stage { grid-template-columns: 1fr; justify-items: center; padding: 20px 16px; gap: 24px; }
  .review-stage .phone { width: min(360px, 100%); }
  .decision { width: 100%; max-width: 560px; }
  .up-next { padding: 12px 16px; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .review-mode .phone { box-shadow: 0 0 0 1px var(--night-line-strong), 0 30px 80px rgba(175, 140, 255, 0.22); } }
:root[data-theme="dark"] .review-mode .phone { box-shadow: 0 0 0 1px var(--night-line-strong), 0 30px 80px rgba(175, 140, 255, 0.22); }
/* Toasts keep clear of the top bar (Exit review, progress). */
body:has(.review-mode) .notice.toast { top: 64px; }

.review-top .review-count { color: var(--night-text); }
.review-notice { margin: 16px 32px 0; }
.review-done-mark { width: 160px; height: 160px; }
/* On the dark "all done" screen: a light button and a quiet outlined one. */
.button.on-night { background: var(--night-text); border-color: var(--night-text); color: var(--night); }
.button.on-night-quiet { background: transparent; color: var(--night-text); border-color: var(--night-line-strong); box-shadow: none; }

/* ---------- Post page ---------- */
.post-head { display: flex; flex-direction: column; gap: 14px; }
.post-head-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.post-head-top .titles { min-width: 0; }
.post-head-top h1 { margin: 0; }
/* Previous / next post. */
.post-seq { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.post-seq .seq-pos { padding: 0 8px; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-seq .seq-step:hover { background: var(--sunken); }
.post-seq .seq-step.off { opacity: .3; }
.post-stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; counter-reset: step; }
.post-stepper li { flex: 1; position: relative; padding-top: 12px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-stepper li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--sunken); }
.post-stepper li.done { color: var(--text-2); }
.post-stepper li.done::before { background: color-mix(in srgb, var(--lavender) 55%, var(--sunken)); }
.post-stepper li.current { color: var(--text); font-weight: 700; }
.post-stepper li.current::before { background: var(--spectrum); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.meta-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; }
.meta-chip.plain { border-style: dashed; color: var(--text-2); }
.meta-chip.note { background: transparent; color: var(--text-2); border-color: transparent; padding-left: 4px; }
.meta-chip.note.client { color: var(--text); }
.meta-chip .icon { color: var(--muted); }
.meta-pop { position: relative; }
.meta-pop > summary { list-style: none; cursor: pointer; }
.meta-pop > summary::-webkit-details-marker { display: none; }
.meta-pop > summary:hover, .meta-pop[open] > summary { border-color: var(--accent); }
.meta-pop-body { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 280px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 40px rgba(13, 10, 18, .3); }
.meta-select { padding-right: 4px; }
.meta-select label { flex-direction: row; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.meta-select select { border: 0; background: transparent; padding: 4px 26px 4px 0; min-height: 0; font: inherit; color: inherit; width: auto; }
.meta-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.meta-chip.editable { cursor: pointer; }
.meta-chip.editable:hover { border-color: var(--accent); }
.meta-chip .edit-hint { color: var(--muted); margin-left: 2px; }

.editor { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.editor .preview-col { flex: 1 1 300px; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.editor .copy-col { flex: 2 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.post-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
.post-layout .preview-col { max-width: none; position: sticky; top: 16px; }
.post-layout .copy-col { max-width: 760px; }
/* "Change visual" sits beside the preview's network switch. */
.preview-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.preview-bar .preview-note { margin: 0; }
.change-visual { margin-left: auto; font-weight: 600; }
.preview-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.link-pill { min-height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 99px; background: transparent; color: var(--text-2); box-shadow: none; font: 500 13px/1 var(--font); cursor: pointer; }
.link-pill.on { background: var(--inverse); border-color: var(--inverse); color: var(--inverse-text); }
.link-pill:hover { transform: none; box-shadow: none; }
.visual-panel { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.visual-head { display: flex; align-items: center; justify-content: space-between; }
.visual-head .overline { margin: 0; }
.visual-panel:target { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.tpl-option { position: relative; display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 12px; color: var(--text-2); cursor: pointer; min-width: 0; }
.tpl-option input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-option img { border-radius: 8px; border: 2px solid transparent; background: var(--sunken); width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.tpl-option:hover img { border-color: var(--border-strong); }
.tpl-option:has(input:checked) img { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tpl-option:has(input:checked) { color: var(--text); font-weight: 700; }
.tpl-option:has(input:focus-visible) img { outline: 2px solid var(--accent); outline-offset: 2px; }
.tpl-option span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tpl-option > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.surface-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; border: 0; }
.surface-strip legend { width: 100%; margin-bottom: 6px; padding: 0; }
.surface-option { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.surface-option input { position: absolute; opacity: 0; pointer-events: none; }
.surface-option .swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); }
.surface-option:has(input:checked) { color: var(--text); font-weight: 700; }
.surface-option:has(input:checked) .swatch { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.surface-option:has(input:focus-visible) .swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.visual-words > summary { cursor: pointer; color: var(--muted); }
.visual-words[open] > summary { margin-bottom: 10px; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.photo-strip legend { width: 100%; margin-bottom: 6px; padding: 0; }
.photo-option { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 2px solid var(--border); cursor: pointer; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.photo-option input { position: absolute; opacity: 0; pointer-events: none; }
.photo-option img { width: 100%; height: 100%; object-fit: cover; }
.photo-option:has(input:checked) { border-color: var(--accent); }
.photo-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.platform-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.platform-tabs button { box-shadow: none; transform: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font-weight: 500; }
.platform-tabs button:hover { background: transparent; color: var(--text); }
.platform-tabs button.on { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.char-count { font-size: 13px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.char-count.over { color: var(--error-text); font-weight: 600; }
.post-video { width: 100%; max-width: 320px; border-radius: 8px; background: #000; }
.lang-role { font-weight: 400; opacity: .7; }
.lang-also { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.post-warning { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.post-warning .icon { flex-shrink: 0; margin-top: 2px; }
.ro-field { display: flex; flex-direction: column; gap: 2px; margin: 0 0 8px; }
.ro-label { font-size: 12px; font-weight: 600; color: var(--muted); }

.action-bar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; margin: 0 -40px -56px; padding: 16px 40px; background: var(--surface); border-top: 1px solid var(--border); }
/* A short page still puts its bar at the bottom of the screen, not under the last card. */
.content > .wrap:has(> .action-bar) { min-height: calc(100dvh - 88px); }
.content > .wrap > .action-bar { margin-top: auto; }
.action-bar .grow { flex: 1; min-width: 200px; color: var(--muted); font-size: 14px; }
.action-bar form { margin: 0; }
.action-more { position: relative; }
.action-more > summary { list-style: none; width: 40px; height: 40px; font-size: 20px; color: var(--muted); }
.action-more > summary::-webkit-details-marker { display: none; }
.state-note { margin: 6px 0 0; text-align: right; }
/* Phones: the bar sits on the tab bar (65px), short page or long. */
@media (max-width: 860px) {
  .action-bar { bottom: calc(65px + env(safe-area-inset-bottom)); margin: 0 -16px -31px; padding: 12px 16px; }
  .content > .wrap:has(> .action-bar) { min-height: calc(100dvh - 120px); }
}
@media (max-width: 700px) {
  .action-bar > .grow { flex: 1 1 0; min-width: 0; font-size: 0; }
  .action-bar { padding-top: 10px; padding-bottom: 10px; gap: 8px; flex-wrap: nowrap; }
  .action-bar form button, .action-bar > button { padding: 0 12px; }
  .state-note { text-align: left; }
  .action-bar:has([data-changes]:not([hidden])) { flex-wrap: wrap; }
}

@media (max-width: 1000px) {
  .post-layout { grid-template-columns: 1fr; }
  .post-layout .preview-col { position: static; max-width: 420px; }
}
/* Tablets: the post page keeps preview and copy side by side down to 720px. */
@media (min-width: 720px) and (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; }
  .post-layout .preview-col { position: sticky; top: 16px; max-width: none; }
}
@media (max-width: 640px) {
  .post-stepper li { font-size: 0; }
  .post-stepper li.current { font-size: 12px; flex: 3; }
}

.post-video.full { max-width: 100%; }
.clip-tips { margin: 0; padding-left: 20px; }
.changes-form { flex: 1 0 100%; }

/* ---------- Calendar ---------- */
/* Past days fold into narrow columns (date, count, a dot per post) and open on click; today and
   the days ahead share the room, with each post's picture. Cards drag onto any day ahead. */
.cal-scroll { overflow-x: auto; }
.cal { display: flex; min-width: 760px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.cal-day { flex: 1 1 0; min-width: 150px; display: flex; flex-direction: column; gap: 6px; min-height: 480px; padding: 10px 8px 12px; border-left: 1px solid var(--border); transition: background .12s; }
.cal-day:first-child { border-left: 0; }
.cal-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "dow count" "dom count"; align-items: end; margin: 0 2px 6px; }
.cal-head .dow { grid-area: dow; font-size: 12px; line-height: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.cal-head .dom { grid-area: dom; font: 700 22px/26px var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.cal-head .count { grid-area: count; align-self: end; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-empty { margin: 8px 2px; font-size: 13px; color: var(--muted); }

/* Today is widest, tomorrow wide, later days narrower with one-line rows. */
.cal-day.rich { flex: 1.45 1 0; min-width: 180px; }
.cal-day.today { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); flex-grow: 1.7; }
.cal-day.today .dow { color: var(--accent); }
.cal-day.today .dom { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cal-day.compact { flex: 1 1 0; min-width: 118px; padding: 10px 6px 12px; }
.cal-day.past { background: var(--bg); }
.cal-day.past .dow, .cal-day.past .dom { color: var(--muted); }
.cal-day.past .cal-row { opacity: .65; }
.cal-day.compact .dom { font-size: 20px; line-height: 22px; }
.ready-line { display: flex; align-items: center; gap: 4px; margin: -2px 2px 2px; font-size: 12px; font-weight: 700; color: var(--ok-text); }
.cal:not(.work-only) .ready-line { display: none; }
.cal.work-only .cal-card:not(.pending), .cal.work-only .cal-row:not(.pending) { display: none; }
.cal.work-only .cal-more > summary { display: none; }
.cal.work-only .cal-more:not(.gaps) { display: contents; }
.cal-mode { margin-left: 8px; }
.cal-mode button { min-height: 32px; font-size: 13px; }

/* Compact rows for the days after tomorrow. */
/* The client sits on its own line with its colour, so long names don't eat the time. */
.cal-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 5px 6px 6px; border-radius: 6px; color: var(--text);
  text-decoration: none; font-size: 13px; line-height: 16px; grid-template-areas: "when" "title" "who" "state";
}
.cal-row:hover { background: var(--bg); }
/* Time and client (cut short when tight), the title, then a word for what's missing (ready posts have none). */
.cal-row .when { grid-area: when; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; line-height: 16px; }
.cal-row .chip { grid-area: state; justify-self: start; margin-top: 2px; }
.cal-row .who { grid-area: who; display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-row .who .dot { background: var(--client); flex-shrink: 0; }
.cal-row .title { grid-area: title; font-weight: 500; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; -webkit-line-clamp: 3; }
.cal-row + .cal-row { margin-top: 1px; }
.cal-row.movable { cursor: grab; }
.cal-row.dragging { opacity: .35; }
.cal-day.compact .cal-gap { padding: 4px 6px 5px 8px; font-size: 12px; }
.cal-day.compact .cal-more > summary { padding: 4px 6px; }

/* Post cards: picture, time and client, title. */
.cal-card { position: relative; display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 9px; background: var(--surface); color: var(--text); text-decoration: none; border: 1px solid var(--border); }
.cal-card:hover { border-color: var(--border-strong); }
.cal-card.movable { cursor: grab; }
.cal-card.movable:active { cursor: grabbing; }
.cal-card.dragging { opacity: .35; }
.cal-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--sunken); }
.cal-thumb.blank { display: grid; place-items: center; background: color-mix(in srgb, var(--client) 30%, var(--sunken)); color: var(--text); font-weight: 700; font-size: 15px; }
.cal-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cal-card .when { font-size: 12px; line-height: 15px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-card .who {
  font-weight: 500; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.cal-card .title { font-weight: 600; font-size: 14px; line-height: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cal-card .chip { align-self: flex-start; margin-top: 3px; font-size: 11px; padding: 1px 6px; }
.cal-card.pending { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); border-style: dashed; }
.cal-card .who .dot { background: var(--client); flex-shrink: 0; }

/* Empty slots sit at the top of their day (they need doing), in tangerine. */
.cal-gap {
  color: var(--text-2); line-height: 16px; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px dashed color-mix(in srgb, var(--warn) 60%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--warn-bg) 60%, transparent); font-size: 13px;
}
.cal-gap .when { font-size: 12px; font-weight: 700; color: var(--warn-text); }
.cal-gap .link { font-size: 13px; font-weight: 600; }
.cal-gap .who { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.cal-gap .who .dot { background: var(--client); }
.cal-gap form { margin: 0; }
.gap-draft { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.gap-idea-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.gap-idea-text svg { color: var(--accent); margin-right: 4px; vertical-align: -1px; }
.gap-draft button { align-self: flex-start; }
.cal-more > summary { cursor: pointer; padding: 6px 2px; font-size: 13px; line-height: 16px; font-weight: 600; color: var(--accent); list-style: none; }
.cal-more > summary::-webkit-details-marker { display: none; }
.cal-more[open] { display: flex; flex-direction: column; gap: 6px; }

/* Dragging: the days ahead light up as targets; empty slots of the same client too. */
.cal.dragging .cal-day[data-drop] { background: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.cal.dragging .cal-day.past { opacity: .5; }
.cal-day.drop { outline: 2px dashed var(--accent); outline-offset: -4px; background: color-mix(in srgb, var(--accent-soft) 70%, transparent) !important; }
.cal.dragging .cal-gap.match { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.cal-gap.drop { outline: 2px solid var(--accent); }

/* Hover preview. */
.cal-peek { position: fixed; z-index: 40; width: 280px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 18px 48px rgba(13, 10, 18, .28); pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
.cal-peek img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.cal-peek .pk-client { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cal-peek .pk-title { font-weight: 700; font-size: 16px; line-height: 20px; }
.cal-peek .pk-caption { font-size: 14px; line-height: 19px; color: var(--text-2); white-space: pre-line; }
.cal-peek .pk-meta { font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  .cal { flex-direction: column; min-width: 0; }
  .cal-day, .cal-day.rich, .cal-day.compact { flex: none; min-width: 0; min-height: 0; border-left: 0; border-top: 1px solid var(--border); padding: 12px; }
  .cal-day:first-child { border-top: 0; }
}

.cal-range { min-width: 170px; text-align: center; }

/* ---------- Messages ---------- */
/* The messages screen is a fixed, full-height app view: the list and the conversation scroll on their own,
   and the reply box stays at the bottom of the window. */
.inbox3 { display: flex; height: 100vh; height: 100dvh; margin: -32px -40px -56px; overflow: hidden; }
.inbox3 .list { position: relative; flex: 0 1 360px; min-width: 260px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.inbox3 .list-head { position: sticky; top: 0; z-index: 1; background: var(--surface); padding: 32px 16px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.inbox3 .list-title { display: flex; flex-direction: column; gap: 4px; }
.inbox3 .row-link { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.inbox3 .row-link:hover { background: var(--bg); }
.inbox3 .row-link.on { background: var(--accent-soft); }
.inbox3 .row-avatar { flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--sunken); color: var(--text-2); font-size: 13px; font-weight: 700; }
.inbox3 .row-avatar.client { background: var(--accent-soft); color: var(--accent-hover); }
.inbox3 .row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.inbox3 .row-top { display: flex; align-items: center; gap: 8px; }
.inbox3 .row-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.inbox3 .row-link.unread .row-top strong { font-weight: 700; }
.inbox3 .row-top .ago { margin-left: auto; flex-shrink: 0; font-size: 13px; line-height: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inbox3 .row-source { font-size: 13px; line-height: 16px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox3 .row-preview { font-size: 14px; line-height: 20px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox3 .row-link.unread .row-preview { color: var(--text); }
.inbox3 .unread-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); flex-shrink: 0; margin-top: 8px; }
.inbox3 .pane { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.inbox3 .pane-head { flex-shrink: 0; padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.inbox3 .pane-head .grow { flex: 1; min-width: 200px; }
.inbox3 .pane-back { display: none; }
.inbox3 .pane-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.inbox3 .pane-scroll .thread { max-height: none; overflow: visible; margin-top: auto; padding: 0; }
.inbox3 .pane-foot { flex-shrink: 0; padding: 16px 24px 20px; background: var(--surface); border-top: 1px solid var(--border); }
.inbox3 .reply { display: flex; flex-direction: column; gap: 8px; max-width: 880px; margin: 0 auto; }
.inbox3 .reply p { margin: 0; }
.inbox3 .reply textarea { resize: vertical; min-height: 64px; max-height: 40vh; }
.inbox3 .empty { margin: auto; color: var(--muted); text-align: center; padding: 48px; }
/* Risky conversations sit under one heading instead of a tag on every row. */
.list-group { margin: 0; padding: 10px 16px 4px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.list-group.risky { color: var(--error-text); }
/* Phones: one column at a time. The tab bar opens the list; a conversation fills the screen above the tab bar. */
@media (max-width: 860px) {
  .inbox3 { margin: -24px -16px -96px; height: calc(100dvh - 65px - env(safe-area-inset-bottom)); }
  .inbox3 .list { flex: 1; min-width: 0; border-right: 0; }
  .inbox3 .list-head { padding-top: 24px; }
  .inbox3:not(.listing) .list, .inbox3.listing .pane { display: none; }
  .inbox3 .pane-head { padding: 12px 16px; gap: 8px; }
  /* The name and its line take the row beside the back arrow; the mode and its button wrap below. */
  .inbox3 .pane-head .grow { min-width: 0; flex: 1 1 calc(100% - 56px); }
  .inbox3 .pane-head > .chip { margin-left: 32px; }
  .inbox3 .pane-head > form:last-child { margin-left: auto; }
  .inbox3 .pane-back { display: inline-grid; margin-left: -8px; }
  .inbox3 .pane-scroll { padding: 16px; }
  .inbox3 .pane-foot { padding: 12px 16px; }
}

.inbox3 .pane-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.inbox3 .pane-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.inbox3 .pane-side { display: flex; flex-direction: column; gap: 18px; padding: 22px 20px; border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.side-person { display: flex; align-items: center; gap: 12px; }
.side-person > div { display: flex; flex-direction: column; min-width: 0; }
.side-person strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sunken); color: var(--text); font-weight: 700; font-size: 17px; flex-shrink: 0; }
.side-stars { margin: -6px 0 0; font-size: 20px; letter-spacing: 2px; color: var(--border-strong); }
.side-stars .on { color: #f5b301; }
.side-risk { padding: 12px 14px; border-radius: 10px; background: var(--sunken); }
.side-risk.high { background: var(--error-bg); color: var(--error-text); }
.side-risk.medium { background: var(--warn-bg); color: var(--warn-text); }
.side-risk .overline { margin: 0; color: inherit; text-transform: none; letter-spacing: 0; font-size: 14px; line-height: 20px; }
.side-risk p { margin: 4px 0 0; font-size: 14px; line-height: 20px; }
/* With nothing to explain, just the label, sized to it. */
.side-risk.bare { align-self: flex-start; padding: 4px 10px; border-radius: 6px; }
.side-facts { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.side-facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.side-facts dd { margin: 2px 0 0; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.side-links { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-replies { display: flex; gap: 6px; padding-bottom: 2px; scrollbar-width: none; flex-wrap: wrap; overflow: visible; }
.quick-reply {
  display: inline-block; min-height: 30px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); box-shadow: none;
  font: 400 13px/1 var(--font); overflow: hidden; text-overflow: ellipsis; cursor: pointer; white-space: normal; max-width: 100%; line-height: 18px;
  padding: 6px 12px; border-radius: 12px; flex-shrink: 1; text-align: left;
}
.quick-reply:hover { border-color: var(--accent); color: var(--text); transform: none; box-shadow: none; }
@container page (max-width: 1100px) {
  .inbox3 .pane-split { grid-template-columns: 1fr; }
  .inbox3 .pane-side { display: none; }
}
.handler-switch { display: inline-flex; align-items: center; gap: 8px; }
.last-reply { margin: 0 0 6px; }
.reply-kind { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .handler-switch > .small { display: none; } }
/* Nobody waiting. */
.empty-pane { height: 100%; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 24px; color: var(--text-2); }
.empty-pane p { margin: 0; }
.empty-pane .icon { width: 28px; height: 28px; color: var(--ok-text); margin-bottom: 6px; }

/* Threads: WhatsApp chats and customer conversations. */
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: min(80%, 520px); padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.bubble.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--primary-bg); color: var(--primary-text); border-color: transparent; }
.bubble.out .bubble-meta { color: inherit; opacity: 0.75; }
.bubble p { margin: 0; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-meta { font-size: 13px; line-height: 16px; color: var(--muted); margin-top: 4px !important; }
.bubble img, .bubble video { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin-bottom: 4px; }
.bubble audio { max-width: 100%; }
.status-failed { color: var(--error-text); font-weight: 600; }
.status-read { color: inherit; }
.assistant-note { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 16px; margin-top: 8px !important; padding: 8px 10px; border-radius: 6px; background: var(--bg); color: var(--text-2); }
.assistant-note .note-head { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.assistant-note .note-action { display: inline-flex; align-items: center; gap: 4px; }
.assistant-note.risk-medium { background: var(--warn-bg); color: var(--warn-text); }
.assistant-note.risk-high { background: var(--error-bg); color: var(--error-text); }
.bubble-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px !important; }
.bubble-buttons span { font-size: 13px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

/* ---------- Ideas ---------- */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; align-items: start; }
.story { display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.story.lead { border-color: color-mix(in srgb, var(--lavender) 45%, var(--border)); }
.story-head { display: flex; gap: 14px; align-items: flex-start; }
.story-head p { margin: 4px 0 0; }
.story-title { margin: 0; font-size: 17px; line-height: 23px; }
.story-title a { color: var(--text); text-decoration: none; }
.story-title a:hover { text-decoration: underline; }
.story-score { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 17px/1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; background: var(--sunken); color: var(--text-2); }
.story-score.good { background: color-mix(in srgb, var(--lavender) 22%, var(--sunken)); color: var(--text); }
.story-score.hot { background: var(--lime); color: #1b1521; }
.story-why { margin: 0; color: var(--text-2); font-size: 14px; line-height: 21px; }
.idea-text { font-size: 14px; line-height: 20px; color: var(--text-2); }
.score-pill { padding: 0 6px; border-radius: 6px; background: var(--sunken); color: var(--text-2); font-size: 11px; line-height: 17px; font-weight: 700; }
.score-pill.good { background: color-mix(in srgb, var(--lavender) 25%, transparent); color: var(--text); }
.score-pill.hot { background: var(--lime); color: #1b1521; }
.idea-more > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.idea-more[open] > summary { margin-bottom: 4px; }
.idea-group { padding: 12px 0 0; border-top: 1px solid var(--border); margin-top: 12px; }
.idea-group:first-of-type { margin-top: 4px; }
.idea-group .idea-text { margin: 0 0 8px; font-size: 14px; line-height: 20px; color: var(--text); }
.idea-group .idea-text .overline { display: block; margin-bottom: 2px; }
.idea-clients { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.idea-client-row { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.idea-client-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; font-weight: 500; flex: 1 1 auto; }
.idea-client-row .grow:hover { color: var(--accent); }
.idea-client-row form { margin: 0; }
.gap-chip { background: var(--warn-bg); color: var(--warn-text); }
@media (max-width: 640px) { .story-grid { grid-template-columns: 1fr; } }

/* ---------- Clients ---------- */
.client-card { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); }
.client-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-float); }
.client-card .top { display: flex; align-items: center; gap: 12px; }
.client-card .name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.client-card .name strong { font-size: 17px; line-height: 24px; font-weight: 600; }
.client-card .ring { flex-shrink: 0; }
.client-pipe { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; align-items: center; }
.client-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; align-items: flex-end; }
.client-card .meter { margin-top: -8px; }
.ring-wrap { display: inline-flex; flex-direction: column; align-items: center; gap: 0; flex-shrink: 0; }
.ring-label { font-size: 10px; line-height: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.client-foot > .small { display: flex; flex-direction: column; gap: 0; line-height: 18px; }
.client-foot > .small:last-child { text-align: right; }
.client-views[data-view="cards"] [data-view-pane="table"], .client-views[data-view="table"] [data-view-pane="cards"] { display: none; }
.client-cell { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 200px; }
.client-cell > span:last-child { display: flex; flex-direction: column; }
.meter-row { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.meter-row .meter { flex: 1; min-width: 48px; }
.list-tools { gap: 8px 12px; }
/* Phones always get the cards; the table needs the width. */
@media (max-width: 640px) {
  .list-tools .segmented { display: none; }
  .client-views[data-view] [data-view-pane="cards"] { display: grid; }
  .client-views[data-view] [data-view-pane="table"] { display: none; }
  .list-tools .search-field { min-width: 0; flex: 1 1 100%; }
}
dialog#new-client { width: min(560px, calc(100vw - 32px)); }

/* ---------- Client pages ---------- */
.workspace { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.workspace .section-nav { flex: 1 1 180px; max-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.workspace .section-nav a { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; }
.workspace .section-nav a:hover { background: var(--surface); }
.workspace .section-nav a.current { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow); }
.workspace .section-nav .grow { flex: 1; }
.workspace .section-body { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
/* A section's sub-pages sit under it in the side menu (one place to navigate); on narrow
   screens, where the menu is a single row, the pill row under the title does it. */
.workspace .section-nav a.sub { min-height: 32px; padding-left: 26px; font-size: 14px; color: var(--muted); }
.workspace .section-nav a.sub.on { color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.workspace .section-nav a.current:has(+ a.sub) { box-shadow: none; background: transparent; }
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; }
.subtabs .pill .icon { margin-left: 2px; opacity: .7; }
/* Narrow screens: the sections and their sub-tabs become one scrolling row each, never two. */
@media (max-width: 860px) {
  .workspace .section-nav {
    max-width: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 40px;
  }
  .workspace .section-nav a { flex-shrink: 0; }
  .workspace .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .workspace .subtabs .pill { flex-shrink: 0; }
  .workspace .section-nav a.sub { display: none; }
}
@media (min-width: 861px) { .workspace .section-body > .subtabs { display: none; } }
.client-jump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.client-jump button { display: inline-flex; align-items: center; gap: 6px; }

/* Setup. */
.overview-facts { margin: 0 0 12px; color: var(--text-2); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 24px; height: 24px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; border: 2px solid var(--border-strong); }
.checklist li.done .tick { background: var(--lime); border-color: var(--lime); color: #1b1521; }
.checklist .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.checklist .what a { color: var(--text); text-decoration: none; font-weight: 600; }
.done-steps { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.done-steps > summary { cursor: pointer; }
.done-steps[open] > summary { margin-bottom: 8px; }

/* Brand: swatches and the logo. */
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.logo-preview { max-height: 96px; max-width: 100%; display: block; margin-bottom: 12px; background: repeating-conic-gradient(var(--border) 0 25%, transparent 0 50%) 50% / 16px 16px; border-radius: 8px; }
/* Brand system: the feed of its templates, palette rows, photo looks and template cards. */
.problem-list { margin: 8px 0 0; padding-left: 20px; }
.brand-feed img { display: block; width: 100%; max-width: 560px; height: auto; border-radius: 12px; border: 1px solid var(--border); background: var(--sunken); }
.palette-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.palette-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 8px 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.palette-row .inline { grid-column: 2; }
.swatch-chip { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border-strong); }
.look { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.look h3 { margin: 0; }
.look-sheet { display: block; width: 100%; max-width: 1340px; height: auto; border-radius: 8px; background: var(--sunken); }
.look-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }
.look-amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.brand-templates { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.brand-template { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-template img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); background: var(--sunken); }
.brand-template ul { margin: 0; padding-left: 18px; }
.brand-references { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.brand-references img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); background: var(--sunken); }
.brand-draft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brand-draft-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brand-draft-palette { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; }
.brand-draft-palette li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.draft-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; align-items: start; }
.draft-actions h3 { margin: 0; }
.brand-json { font: 13px/18px ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: pre; overflow: auto; resize: vertical; }
/* Feed: the client's posts three across, as their profile shows them. */
.feed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 760px; }
.feed-tile { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--sunken); color: var(--text); text-decoration: none; }
.feed-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-tile:hover { box-shadow: none; outline: 2px solid var(--accent); outline-offset: -2px; }
.feed-blank { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.feed-meta { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 6px; }
.feed-when { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(13, 10, 18, .72); color: #fff; }
.feed-flag { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--warn-text); color: var(--surface); font-weight: 700; font-size: 14px; }
.feed-carousel { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(13, 10, 18, .72); color: #fff; }
.feed-tile.repeats { outline: 2px solid var(--warn-text); outline-offset: -2px; }
/* Assets and social accounts. */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; }
.gallery figcaption .photo-description { display: block; margin-top: 4px; color: var(--text); }
.gallery figcaption .photo-tags { display: block; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
/* Photos: the whole picture is shown, with a dot on the point crops keep in view. */
.focus-target { position: relative; display: block; width: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; cursor: crosshair; border-radius: 8px; overflow: hidden; }
.focus-target:hover { transform: none; box-shadow: none; }
.focus-target img { display: block; aspect-ratio: auto; height: auto; object-fit: contain; }
.focus-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid #fff; background: var(--accent); box-shadow: 0 0 0 1px rgba(13, 10, 18, .5), 0 2px 6px rgba(13, 10, 18, .4); pointer-events: none; transition: left .15s, top .15s; }
.focus-target.saving .focus-dot { opacity: .5; }
.connect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.connect-grid button { width: 100%; }

/* Plan: the week as seven columns (scrolls sideways when narrow rather than wrapping). */
.slot-week-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px 4px; }
.slot-week { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 6px; }
.slot-day { display: flex; flex-direction: column; gap: 8px; min-height: 168px; border-radius: var(--radius-sm); background: var(--sunken); min-width: 0; padding: 6px; }
.slot-day .day { font-size: 12px; line-height: 16px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 4px; }
.slot-day.empty .day { color: var(--muted); }
.slot {
  position: relative; display: flex; flex-direction: column; gap: 2px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border);
  min-width: 0; padding: 6px 8px; overflow-wrap: break-word; word-break: normal;
}
.slot .time { font: 700 17px/22px var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.slot .what { font-size: 14px; line-height: 18px; font-weight: 600; }
.slot-remove { position: absolute; top: 2px; right: 2px; opacity: 0; transition: opacity .12s; }
.slot-remove .icon-button { width: 24px; height: 24px; color: var(--muted); }
.slot:hover .slot-remove, .slot:focus-within .slot-remove { opacity: 1; }
@media (hover: none) { .slot-remove { opacity: 1; } }
.slot-add {
  margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 32px; padding: 0 8px;
  border: 1px dashed var(--border-strong); border-radius: 8px; background: transparent; color: var(--muted); box-shadow: none; font: 500 13px/1 var(--font); cursor: pointer;
}
.slot-add:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); transform: none; box-shadow: none; }
.slot-day.empty .slot-add { margin-top: 0; flex: 1; }
.slot .small { font-size: 12px; line-height: 16px; }
/* Pillars as cards; the add form opens inline. */
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pillar { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.pillar.inactive { opacity: 0.55; }
.pillar p { margin: 0; flex: 1; }
.pillar-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pillar-top .num { flex-shrink: 0; white-space: nowrap; }
.pillar form { margin-top: 4px; }
.pillar-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.pillar-form label { flex: 1 1 160px; }
.pillar-form label.wide { flex: 3 1 280px; }
.pillar-form label:has(input[type="number"]) { flex: 0 0 96px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 12px; }
.disabled-action { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* Results: headline numbers, a weekly reach chart and the best post. */
.perf-hero { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2.2fr) minmax(220px, 1.1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.perf-hero > * { background: var(--surface); padding: 20px; }
.perf-stats { display: flex; flex-direction: column; gap: 16px; }
.perf-stat { display: flex; flex-direction: column; gap: 2px; }
.perf-stats .label, .best-post .label { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.perf-stats .value { font: 700 26px/32px var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.delta { font-size: 13px; font-weight: 600; }
.delta.up { color: var(--ok-text); }
.delta.down { color: var(--error-text); }
.perf-chart { display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
.perf-chart .bars { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; border-bottom: 1px solid var(--border); }
.perf-chart .bar-col { height: 100%; display: flex; align-items: flex-end; }
.perf-chart .bar { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--lavender) 55%, var(--surface)); transition: background .12s; }
.perf-chart .bar-col:hover .bar { background: var(--lavender); }
.perf-chart .bar.current { background: var(--spectrum); }
.bar-axis { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.best-post { display: flex; flex-direction: column; gap: 12px; color: var(--text); text-decoration: none; }
.best-post:hover strong { color: var(--accent); }
.best-post img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; max-height: 160px; }
.best-body { display: flex; flex-direction: column; gap: 4px; }
.best-body .score { align-self: flex-start; }
@media (max-width: 1100px) {
  .perf-hero { grid-template-columns: 1fr 2fr; }
  .best-post { grid-column: 1 / -1; flex-direction: row; }
  .best-post img { width: 96px; height: 96px; }
}
@media (max-width: 640px) {
  .perf-hero { grid-template-columns: 1fr; }
  .perf-stats { flex-direction: row; flex-wrap: wrap; }
}
.chart-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
td.post-cell { min-width: 220px; }
/* Four tables (pillar, format, time of day, layout): two by two, one column on phones. */
.perf-groups.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .perf-groups.four { grid-template-columns: 1fr; } }
.perf-groups.four table { table-layout: fixed; width: 100%; }
.perf-groups.four td:first-child, .perf-groups.four th:first-child { width: 42%; }
.perf-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.presence-score { display: flex; align-items: baseline; gap: 4px; }
.presence-number { font-size: 40px; line-height: 48px; font-weight: 700; font-variant-numeric: tabular-nums; }
.finding h3 { margin: 8px 0 4px; }
.finding p { margin: 4px 0; }
.finding.high { border-color: color-mix(in srgb, var(--error-text) 45%, var(--border)); background: color-mix(in srgb, var(--error-bg) 45%, var(--surface)); }
.finding.medium { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn-bg) 45%, var(--surface)); }
.finding-detail { overflow-wrap: anywhere; }

/* Settings: cards in two columns when there's room. */
.settings-grid { columns: 2 380px; column-gap: 16px; }
.settings-grid > .card { break-inside: avoid; margin-bottom: 16px; }
.settings-jump { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 8px; }
.settings-group { margin: 24px 0 12px; font-size: 18px; }
.settings-group:first-of-type { margin-top: 8px; }
.settings-intro { margin: -6px 0 12px; }
.settings-grid + .settings-group { margin-top: 32px; }

.client-badge.lg { width: 48px; height: 48px; font-size: 20px; }
.card.setup-first { order: -1; }
summary.clickable { cursor: pointer; }
.head-start-title { margin: 0 0 4px; }
.head-start-text { flex: 1; min-width: 240px; }
.strategy-follow { margin-top: 12px; }
.months-input { width: 5em; }

/* ---------- Business ---------- */
.month-label { min-height: 36px; padding: 0 16px; display: inline-flex; align-items: center; font-size: 14px; }
.biz-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center; padding: 22px 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.biz-figures { display: flex; gap: 32px; }
.biz-figures > div { display: flex; flex-direction: column; gap: 4px; }
.biz-summary .label { font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.biz-figures .figure { font: 700 30px/36px var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.biz-figures .accent .figure { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; }
.biz-shares { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.share-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--sunken); }
.share-bar span { display: block; min-width: 3px; }
.share-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.share-legend li { display: inline-flex; align-items: center; gap: 6px; }
.share-legend i { width: 9px; height: 9px; border-radius: 3px; }
.biz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.biz-tools { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.biz-tools .search-field { min-width: 0; width: 240px; }
.biz-tools .pill .count { margin-left: 4px; opacity: .7; }
.biz-table tbody tr.no-fee .money-input { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.biz-table.missing-only tbody tr:not(.no-fee) { display: none; }
.money-input { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 14px; font-weight: 400; flex-direction: row; }
.money-input:focus-within { border-color: var(--accent); }
.money-input input { width: 6.5em; border: 0; padding: 6px 0; background: transparent; outline: none; font-variant-numeric: tabular-nums; }
.money-input.small-input input { width: 4em; padding: 4px 0; font-size: 13px; }
.money-input.small-input { font-size: 12px; }
.ai-cell { display: flex; align-items: center; gap: 8px; min-width: 210px; }
.ai-cell .meter { width: 56px; flex-shrink: 0; }
.biz-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.biz-side .card { padding: 20px; }
.biz-side h2 { margin: 0; }
.biz-side label { font-weight: 500; }
.biz-side .money-input input { width: 100%; }
.biz-side .money-input { width: 100%; margin-top: 4px; }
.save-bar { position: sticky; bottom: 16px; grid-column: 1 / -1; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--inverse); color: var(--inverse-text); box-shadow: 0 12px 32px rgba(13, 10, 18, .3); }
.save-bar .grow { flex: 1; font-weight: 600; }
.save-bar button.secondary { background: transparent; color: var(--inverse-text); border-color: var(--faint); box-shadow: none; }
@media (max-width: 1100px) {
  .biz-layout { grid-template-columns: 1fr; }
  .biz-side { position: static; }
  .biz-summary { grid-template-columns: 1fr; }
}
@media (max-width: 640px) { .biz-figures { flex-wrap: wrap; gap: 16px 24px; } }
/* The month's invoices: totals, the list with its actions, and "Create invoice". */
.biz-invoices { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.biz-invoices-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.biz-invoices-head h2 { margin: 0; flex-basis: 100%; }
.biz-invoices-head .label { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.biz-invoices-head .figure { font-size: 22px; line-height: 28px; }
.invoice-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.invoice-row-actions form { margin: 0; }
.invoice-paid-form { display: inline-flex; gap: 4px; }
.invoice-paid-form input { width: 150px; padding-block: 4px; font-size: 13px; }
.invoice-create { flex-wrap: wrap; align-items: end; gap: 12px; }
.badge.invoice-draft { background: var(--draft-bg); color: var(--draft-text); }
.badge.invoice-open { background: var(--review-bg); color: var(--review-text); }
.badge.invoice-overdue { background: var(--warn-bg); color: var(--warn-text); }
.badge.invoice-paid { background: var(--ok-bg); color: var(--ok-text); }
.badge.invoice-void { opacity: 0.7; text-decoration: line-through; }
.badge.invoice-refunded { background: var(--draft-bg); color: var(--draft-text); }
.invoice-flag { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.invoice-flag p, .invoice-flag form { margin: 0; }
.invoice-client-list, .invoice-edit-lines { list-style: none; margin: 0; padding: 0; }
.invoice-client-list li, .invoice-edit-lines li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); }
.invoice-client-list li:first-child, .invoice-edit-lines li:first-child { border-top: 0; }
.invoice-edit-lines form { margin: 0; }
.invoice-preview { background: var(--sunken); }
.month-switch { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.month-switch .month-label { min-width: 120px; text-align: center; font-size: 14px; }

/* ---------- Team ---------- */
.people { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.person { display: flex; flex-direction: column; gap: 16px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.person.off { opacity: .6; }
.person-head { display: flex; align-items: center; gap: 12px; }
.person-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--spectrum); color: #1b1521; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.person-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-id strong { font-size: 16px; }
.person-id .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-load { display: flex; flex-direction: column; gap: 8px; }
.load-row { display: grid; grid-template-columns: 86px minmax(0, 1fr) 36px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.load-row strong { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.load-bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.load-bar i { display: block; height: 100%; border-radius: 4px; }
.load-bar i.review { background: var(--cyan); }
.load-bar i.client { background: var(--pink); }
.load-bar i.ready { background: var(--lime); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 35%, transparent); }
/* Replies aren't a post stage: neutral ink. */
.load-bar i.replies { background: var(--text-2); }
.person-clients { display: flex; flex-direction: column; gap: 6px; }
.client-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.client-chip { display: inline-flex; align-items: center; max-width: 150px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--border); font-size: 12px; line-height: 20px; color: var(--text-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-chip:hover { color: var(--text); border-color: var(--border-strong); }
.person-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; gap: 6px; flex-wrap: wrap; }
.person.add { align-items: center; justify-content: center; flex-direction: row; gap: 8px; min-height: 200px; border-style: dashed; background: transparent; color: var(--muted); box-shadow: none; font: 600 15px/1 var(--font); cursor: pointer; }
.person.add:hover { color: var(--accent); border-color: var(--accent); transform: none; box-shadow: none; }
.disabled-people > summary { cursor: pointer; margin-bottom: 12px; }

/* ---------- System ---------- */
.sys-banner { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.sys-banner.ok { border-color: color-mix(in srgb, var(--lime) 45%, var(--border)); background: color-mix(in srgb, var(--lime) 7%, var(--surface)); }
.sys-banner.warn { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); }
.sys-state { display: flex; align-items: center; gap: 16px; }
.sys-state h2 { margin: 0 0 2px; font-size: 22px; line-height: 28px; }
.sys-state p { margin: 0; color: var(--text-2); }
.sys-state a { color: inherit; }
.sys-light { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.sys-banner.ok .sys-light { background: var(--success); box-shadow: 0 0 0 6px color-mix(in srgb, var(--success) 22%, transparent); }
.sys-banner.warn .sys-light { background: var(--danger); box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 22%, transparent); }
.sys-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sys-items a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 500; }
.sys-items li.urgent a { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); background: color-mix(in srgb, var(--error-bg) 45%, var(--surface)); }
.sys-items li.warning a { border-color: color-mix(in srgb, var(--warn) 50%, var(--border)); background: color-mix(in srgb, var(--warn-bg) 45%, var(--surface)); }
.sys-items a:hover { border-color: var(--border-strong); }
.sys-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.sys-heading { margin: 0 0 12px; }
.sys-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.service { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
/* Not connected: drawn quieter (muted text on the page colour), not faded, so it stays readable. */
.service.off { background: var(--bg); border-style: dashed; color: var(--muted); }
.service.off header strong, .service.off .service-tally dd { color: var(--text-2); }
.service header { display: flex; align-items: center; gap: 8px; }
.service header strong { flex: 1; }
.service p { margin: 0; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.service.ok .health-dot { background: var(--success); }
.service.warn .health-dot { background: var(--warn); }
.service.bad .health-dot { background: var(--danger); }
.service-tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 0; }
.service-tally dt { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.service-tally dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.service-error { padding-top: 8px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.sys-total { font: 700 22px/1 var(--font); font-variant-numeric: tabular-nums; }
.spend-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.spend-bars li { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(0, 2fr) 64px 76px; align-items: center; gap: 10px; font-size: 14px; }
.spend-bars .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spend-bars .bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.spend-bars .bar i { display: block; height: 100%; border-radius: 4px; background: var(--text-2); }
.spend-bars .cost { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.spend-bars .calls { text-align: right; }
.spend-more { margin-top: 8px; }
.spend-more > summary, .ai-check > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.spend-more[open] > summary { margin-bottom: 8px; }
.ai-check { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.ai-check[open] > summary { margin-bottom: 10px; }
.sys-activity { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 1100px) {
  .sys-layout { grid-template-columns: 1fr; }
  .sys-activity { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .spend-bars li { grid-template-columns: 1fr 64px; }
  .spend-bars .bar, .spend-bars .calls { display: none; }
}
.health { padding: 2px 8px; border-radius: 10px; font-size: 13px; border: 1px solid var(--border); }
.health.bad { background: var(--error-bg); color: var(--error-text); border-color: transparent; }
.health.warn { font-weight: 600; }
.health.off { color: var(--muted); border-style: dashed; }

/* ---------- Account ---------- */
.qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }
.recovery-codes { columns: 2; list-style: none; padding: 0; font-size: 17px; }
.recovery-codes li { padding: 4px 0; }
#notifications fieldset { flex-direction: column; gap: 8px; }
.push-category { align-items: flex-start; }
.push-category input { width: auto; margin-top: 4px; }
.push-category .muted { display: block; font-size: 13px; }

/* ---------- Sign-in and error pages ---------- */
body.night { background: var(--night); color: var(--night-text); min-height: 100vh;
  background-image: linear-gradient(var(--night-surface) 1px, transparent 1px), linear-gradient(90deg, var(--night-surface) 1px, transparent 1px); background-size: 56px 56px; }
body.night a { color: var(--lavender); }
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px 80px; padding: 48px 24px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 420px; }
.auth-brand .mark { width: 120px; height: 120px; }
.auth-brand .wordmark { font-size: 64px; line-height: 60px; }
.auth-brand .tagline { margin: 0; font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--night-muted); }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 20px; padding: 32px; border-radius: var(--radius); background: var(--night-surface); border: 1px solid var(--night-line); }
.auth-card h1, .auth-card h2 { font: 400 32px/36px var(--display); margin: 0; }
.auth-card label { color: var(--night-muted); font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; gap: 8px; }
.auth-card input { background: var(--night); color: var(--night-text); border-color: var(--night-line-strong); min-height: 44px; font-size: 16px; letter-spacing: 0; text-transform: none; }
.auth-card button { background: var(--night-text); border-color: var(--night-text); color: var(--night); min-height: 48px; box-shadow: none; }
.auth-card button:hover { background: color-mix(in srgb, var(--night-text) 85%, var(--night)); border-color: transparent; color: var(--night); }
.auth-card .muted { color: var(--night-muted); }
.auth-card .notice.error { background: #3a1c19; color: #ffaba2; }
.auth-card .overline { color: var(--night-muted); margin: 0; }
.auth-hint { margin: -6px 0 0; color: var(--night-muted); text-align: center; }

.auth-card.centered { text-align: center; align-items: center; }
.auth-card .brand-mark.lg { width: 56px; height: 56px; }
.auth-rule { width: 48px; border: 0; border-top: 1px solid var(--night-line); margin: 8px 0; }
.auth-alt-heading { margin: 0 0 4px; font-weight: 700; }

/* ---------- Client-facing: the approval page (what clients open from WhatsApp) ---------- */
main.preview { max-width: 600px; margin: 0 auto; padding: 32px 16px 56px; }
.preview-post img.render { max-width: 100%; }
.preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.preview-number { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 14px; }
img.render { width: 100%; max-width: 420px; display: block; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 12px; }
.preview-progress { margin: -4px 0 16px; font-weight: 600; color: var(--muted); }
.preview-passed { margin: 0 0 12px; }
/* Titles, and "Approve all" stays in reach. */
.preview-title { margin: 4px 0 8px; font-weight: 600; }
/* A decision under each post, and the state once decided. */
.preview-decide { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: flex-start; }
.preview-decide > form { margin: 0; }
.preview-decide > form button { min-width: 120px; }
.preview-change { flex: 1 1 160px; }
.preview-change > summary { list-style: none; display: inline-flex; cursor: pointer; }
.preview-change > summary::-webkit-details-marker { display: none; }
.preview-change[open] { flex-basis: 100%; }
.preview-change[open] > summary { display: none; }
.preview-change textarea { width: 100%; }
.preview-change form button { align-self: flex-start; }
.preview-state { margin: 16px 0 0; font-weight: 600; color: var(--muted); }
.preview-state.ok { color: var(--ok-text); }
.preview-post.is-approved, .preview-post.is-changing { opacity: 0.8; }
.preview-post.is-approved .render, .preview-post.is-changing .render { max-height: 220px; width: auto; }
.preview-post { scroll-margin-top: 16px; }
/* A carousel on the approval page: the slides side by side, swiped. */
.render.slides { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border: 0; border-radius: 8px; margin-bottom: 4px; }
.render.slides img { flex: 0 0 88%; max-width: 420px; scroll-snap-align: start; border-radius: 8px; border: 1px solid var(--border); }
.slides-hint { margin: 0 0 12px; }
.preview-post.is-approved .slides-hint, .preview-post.is-changing .slides-hint { display: none; }
.preview-all { margin: 24px 0 0; }
.preview-all button { width: 100%; min-height: 48px; }
/* While the client writes a change, Approve steps aside and Send leads. */
.preview-decide:has(.preview-change[open]) > form { display: none; }
.preview-change-actions { display: flex; align-items: center; gap: 16px; }
.preview-change .preview-change-actions button { align-self: center; margin: 0; }
/* Decided posts fold to their title and state. */
.preview-post.is-approved .render, .preview-post.is-changing .render,
.preview-post.is-approved .caption, .preview-post.is-changing .caption { display: none; }
.sticky-approve { position: sticky; bottom: 0; z-index: 5; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.sticky-approve button { width: 100%; }
/* The closing card says what to tap. */
.preview-outro { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.preview-outro p { margin: 0; }
@media (min-width: 900px) {
  main.preview.approval { max-width: 860px; }
  /* Image beside the words, so four posts aren't 4,000px of scrolling. */
  main.preview.approval .preview-post:not(.is-approved):not(.is-changing):has(.render) {
    display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    grid-template-rows: repeat(5, auto) 1fr; column-gap: 24px; align-items: start;
  }
  main.preview.approval .preview-post:has(.render) > * { grid-column: 2; }
  main.preview.approval .preview-post:has(.render) > .render { grid-column: 1; grid-row: 1 / -1; margin: 0; }
  main.preview.approval .preview-post:has(.render) > .caption { margin-top: 0; }
}

/* ---------- Client-facing: the content page ---------- */
/* The client's page: sections with room between them, posts as rows (picture, when, caption). */
main.preview.share { display: flex; flex-direction: column; gap: 32px; }
.share h1 { margin: 0 0 8px; }
.share header p, .share h2 { margin: 0; }
.share h2 { margin-bottom: 12px; }
.share-callout { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.share-list { list-style: none; margin: 0; padding: 0 20px; }
.share-post { display: grid; grid-template-columns: 80px 1fr; gap: 16px; align-items: start; padding: 16px 0; }
.share-post + .share-post { border-top: 1px solid var(--border); }
.share-post img, .share-post .share-thumb { width: 80px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--sunken); }
.share-post p { margin: 0; }
.share-when { font-size: 14px; font-weight: 600; margin-bottom: 4px !important; }
.share-post .caption { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); }
.share-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px !important; }
.share-reports { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.share-reports a { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; }
/* Captions expand; images open full size. */
.share-caption > summary { list-style: none; cursor: pointer; }
.share-caption > summary::-webkit-details-marker { display: none; }
.share-caption[open] > summary { display: none; }
.share-caption[open] > p.caption { -webkit-line-clamp: unset; display: block; }
.share-networks { margin: 2px 0 4px !important; }
.share-img { display: block; }
.share-callout .button { margin-left: 8px; vertical-align: middle; }

/* ---------- Monthly report (the client's view, and its preview in the app) ---------- */
.report-month { margin-bottom: 4px; }
.report-headline { font-size: 17px; line-height: 24px; margin: 0 0 16px; }
.report .stat .small { margin-top: 4px; }
.report-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
/* The report reads top to bottom with room between its parts. */
.report { display: flex; flex-direction: column; gap: 24px; }
.report > .muted:first-child { margin: 0 0 -20px; }
.report .report-month { margin: 0; }
.report .report-headline, .report .spaced { margin: 0; }
.report h2 { margin: 0 0 12px; }
/* Best posts: ranked rows, the picture beside its numbers. */
.report-top { list-style: none; margin: 0; padding: 4px 20px; counter-reset: top; }
.report-top li { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; padding: 16px 0; counter-increment: top; position: relative; }
.report-top li + li { border-top: 1px solid var(--border); }
.report-top img, .report-top .report-thumb { width: 88px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--sunken); }
.report-top li::before { content: counter(top); position: absolute; left: -6px; top: 10px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; }
.report-top p { margin: 0; }
.report-post-title { font-weight: 700; line-height: 22px; }
.report-post-numbers { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 2px !important; }
.report-post-numbers strong { font-size: 18px; font-variant-numeric: tabular-nums; }
/* Phones: two stats a row, and an odd last one takes the whole row. */
@media (max-width: 600px) { .report .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.report-preview { background: var(--bg); }
/* Three stats sit on one row; phones get cards per network. */
.report .stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .report .stats.stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.report-note { margin: -4px 0 10px; }
.network-cards { display: none; list-style: none; margin: 0; padding: 0; }
.network-cards li { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.network-cards li:first-child { border-top: 0; }
.network-cards li strong { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .network-table { display: none; }
  .network-cards { display: block; }
}
.client-foot-note { margin: 32px 0 8px; text-align: center; }

/* Head start on the Brand Brain (Overview): the website draft and the WhatsApp interview. */
.head-start-way { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 12px 0; }
.head-start-way + .head-start-way { border-top: 1px solid var(--border); }
.head-start-way h3 { margin: 0 0 4px; font-size: 15px; }
.interview-answers { margin: 8px 0 0; }
.interview-answers dt { margin-top: 10px; }
.interview-answers dd { margin: 2px 0 0; white-space: pre-line; }

/* What the client told us is coming up (Plan page). */
.planning-notes { list-style: none; margin: 0; padding: 0; }
.planning-notes li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.planning-notes li:first-child { border-top: 0; }
.planning-notes form.note-edit { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.planning-notes form.note-edit input { flex: 1; }
.planning-month { margin: 16px 0 4px; font-size: 15px; }

/* ---------- Prospects: the list, a prospect's page and its proposal ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 0; }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.proposal-preview { display: flex; flex-direction: column; gap: 8px; }
.proposal-preview h2 { margin: 0; }

/* ---------- Client-facing: a prospect's proposal ---------- */
/* Made for phones, and (like the invoice) dark ink on white paper whatever the theme. */
.proposal-main { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.proposal { background: #ffffff; color: #1b1521; border-radius: var(--radius); padding: 32px 24px; box-shadow: 0 1px 2px rgba(13, 10, 18, .08), 0 8px 24px rgba(13, 10, 18, .08); font-size: 16px; line-height: 24px; }
.proposal h1 { margin: 0; font-size: 26px; line-height: 32px; color: #1b1521; }
.proposal h2 { margin: 0 0 12px; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #655d69; }
.proposal p { margin: 0; }
.proposal a { color: #4f2fa3; word-break: break-all; }
.proposal-agency { font-weight: 700; color: #655d69; margin-bottom: 4px !important; }
.proposal-head { margin-bottom: 28px; }
.proposal-section { padding-top: 24px; margin-top: 24px; border-top: 1px solid #e6dce9; }
.proposal-score { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 12px !important; }
.proposal-score strong { font-size: 44px; line-height: 44px; font-variant-numeric: tabular-nums; }
.proposal-score span { color: #655d69; }
.proposal-score em { flex-basis: 100%; font-style: normal; font-size: 14px; color: #655d69; }
.proposal-score-good strong { color: #2c4a00; }
.proposal-score-ok strong { color: #8a5b00; }
.proposal-score-low strong { color: #8a2e0b; }
.proposal-summary { margin-bottom: 16px !important; }
.proposal-findings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.proposal-findings li { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 3px solid #e6dce9; }
.proposal-findings li.urgent { border-left-color: #c44a1f; }
.proposal-why { color: #3b3240; font-size: 15px; line-height: 22px; }
.proposal-tag { display: inline-block; margin-left: 4px; padding: 0 8px; border-radius: 99px; background: #ffe1d4; color: #8a2e0b; font-size: 12px; font-weight: 700; line-height: 20px; }
.proposal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.proposal-grid img { display: block; width: 100%; height: auto; aspect-ratio: auto 4 / 5; background: #ece7ef; }
.proposal-note { margin-top: 10px !important; font-size: 14px; line-height: 20px; color: #655d69; }
.proposal-included { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.proposal-price { margin-top: 16px !important; font-size: 24px; line-height: 30px; font-weight: 700; }
.proposal-foot { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- Client-facing: the invoice (and its preview in the app) ---------- */
/* A document, so always dark ink on white paper whatever the theme; it prints as one page
   with nothing around it ("Print / Save as PDF" in the browser is the PDF). */
.invoice-main { max-width: 760px; margin: 0 auto; padding: 32px 16px 56px; }
.invoice-paper { background: #ffffff; color: #1b1521; border-radius: var(--radius); padding: 40px; box-shadow: 0 1px 2px rgba(13, 10, 18, .08), 0 8px 24px rgba(13, 10, 18, .08); font-size: 14px; line-height: 21px; }
.invoice-paper h1 { margin: 0; font-size: 28px; line-height: 34px; color: #1b1521; }
.invoice-paper h2 { margin: 0 0 6px; font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #655d69; }
.invoice-paper p { margin: 0; }
.invoice-paper a { color: #4f2fa3; word-break: break-all; }
.invoice-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 32px; }
.invoice-agency { font-weight: 700; color: #655d69; margin-bottom: 4px !important; }
.invoice-number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-state { padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 13px; background: #ece7ef; color: #3b3240; }
.invoice-state-paid { background: #e3f7c0; color: #2c4a00; }
.invoice-state-overdue { background: #ffe1d4; color: #8a2e0b; }
.invoice-state-void { background: #ece7ef; color: #655d69; text-decoration: line-through; }
.invoice-state-refunded { background: #ece7ef; color: #3b3240; }
.invoice-card-pay { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 20px; text-align: center; }
.invoice-pay-button { display: inline-block; min-width: 240px; padding: 14px 24px; font-size: 16px; font-weight: 700; text-align: center; }
.invoice-parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 24px; }
.invoice-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 24px; margin: 0 0 24px; padding: 16px 0; border-block: 1px solid #e6dce9; }
.invoice-dates dt { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #655d69; }
.invoice-dates dd { margin: 2px 0 0; font-weight: 600; }
.invoice-lines { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.invoice-lines th, .invoice-lines td { text-align: left; padding: 10px 0; border-bottom: 1px solid #e6dce9; color: #1b1521; background: none; }
.invoice-lines thead th { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #655d69; }
.invoice-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 16px; }
.invoice-lines tfoot th, .invoice-lines tfoot td { border-bottom: 0; font-size: 18px; padding-top: 16px; }
.invoice-pay { padding: 16px; border-radius: 10px; background: #f7f3f8; }
.invoice-pay p + p { margin-top: 4px; }
.invoice-banner { margin: 0 0 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn-text); }
.invoice-banner-payment { background: #e3f7c0; color: #2c4a00; }
.invoice-actions { display: flex; justify-content: center; margin-top: 20px; }
@media (max-width: 600px) {
  .invoice-main { padding: 16px 12px 40px; }
  .invoice-paper { padding: 24px 18px; }
  .invoice-paper h1 { font-size: 22px; line-height: 28px; }
}
@media print {
  @page { size: auto; margin: 16mm; }
  body.invoice-page { background: #ffffff; }
  body.invoice-page .invoice-actions, body.invoice-page .client-foot-note, body.invoice-page .invoice-card-pay, body.invoice-page .invoice-banner-payment { display: none; }
  body.invoice-page .invoice-main { max-width: none; padding: 0; }
  body.invoice-page .invoice-paper { box-shadow: none; border-radius: 0; padding: 0; break-inside: avoid; }
  body.invoice-page .invoice-banner { border: 1px solid #8a2e0b; background: none; color: #8a2e0b; }
  body.invoice-page .invoice-paper a { color: #1b1521; text-decoration: none; }
  body.invoice-page .invoice-state, body.invoice-page .invoice-pay { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Competitors (client › Results) */
.competitor-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.competitor-add input { flex: 1 1 240px; }
.competitor-table td { vertical-align: top; }
.competitor-table .own-row td { background: var(--sunken); }
.sparkline { display: block; width: 120px; height: 28px; overflow: visible; }
.sparkline polyline { stroke: var(--text-2); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.delta.flat { color: var(--muted); }
.standout-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.standout-list li:last-child { border-bottom: 0; }
.report-neighbourhood .you td { font-weight: 600; }

/* A short video's subtitle editor: times narrow, words wide. */
.subtitles { border-top: 1px solid var(--border); padding-top: 12px; }
.subtitle-lines .row { gap: 8px; flex-wrap: nowrap; }
.subtitle-lines .time { flex: 0 0 84px; }
.subtitle-lines .time input { width: 100%; }
.subtitle-lines .words { flex: 1 1 auto; min-width: 0; }
@media (max-width: 520px) {
  .subtitle-lines .row { flex-wrap: wrap; }
  .subtitle-lines .words { flex-basis: 100%; }
}

/* ---------- Time tracking ---------- */
/* The timer in the sidebar. */
.timer { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }
.timer-start > summary { list-style: none; cursor: pointer; }
.timer-start > summary::-webkit-details-marker { display: none; }
.timer-form { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 6px; padding: 10px; border: 1px solid var(--night-line); border-radius: 12px; background: var(--night-surface); }
.timer-form label { display: flex; flex-direction: column; gap: 4px; color: var(--night-muted); font-weight: 500; }
.timer-form select, .timer-form input { background: var(--night); color: var(--night-text); border-color: var(--night-line); }
.timer-actions { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.timer-actions a { color: var(--night-muted); }
.timer-running { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid color-mix(in srgb, var(--c) 55%, var(--night-line)); border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, var(--night-surface)); }
.timer-dot { width: 10px; height: 10px; border-radius: 5px; flex-shrink: 0; background: var(--c); animation: timer-pulse 2s ease-in-out infinite; }
@keyframes timer-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .timer-dot { animation: none; } }
.timer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.timer-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--night-text); }
.timer-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-check { padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-text); text-decoration: none; line-height: 1.3; }
:root.nav-collapsed .timer-text, :root.nav-collapsed .timer-check, :root.nav-collapsed .timer-stop { display: none; }
:root.nav-collapsed .timer-running { justify-content: center; padding: 10px 0; }
:root.nav-collapsed .timer-start .nav-item { justify-content: center; padding: 0; }

/* Quick-log on a post and in a chat. */
.quick-time { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.quick-time-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.meta-chip.meta-time { padding-right: 6px; }
.pane-side .quick-time { margin: 12px 0; }

/* The Time page. */
.time-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.time-side { display: flex; flex-direction: column; gap: 16px; }
.time-side .load-row { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 52px; }
.time-table tr.running td { background: color-mix(in srgb, var(--review-bg) 45%, transparent); }
.time-edit > summary { cursor: pointer; color: var(--accent); }
.time-edit[open] { min-width: 280px; }
.time-edit-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 8px 0; }
.time-edit-form label { display: flex; flex-direction: column; gap: 2px; }
.time-check-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
@media (max-width: 900px) { .time-layout { grid-template-columns: minmax(0, 1fr); } .time-side { order: -1; } }

/* Team: hours and hourly cost. */
.person-load .load-row { grid-template-columns: 112px minmax(0, 1fr) 52px; }
.load-bar i.hours { background: var(--lavender); }
.person-cost { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.person-cost label { color: var(--text-2); }

/* ---------- Client health ---------- */
/* Always a number and a word; the colour only repeats them. */
.health-badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 99px; font-size: 12px; line-height: 20px; font-weight: 600; background: var(--sunken); color: var(--text); white-space: nowrap; }
.health-badge.big { font-size: 14px; line-height: 26px; padding: 0 12px; }
.health-dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; flex-shrink: 0; }
.health-badge.good { background: var(--ok-bg); color: var(--ok-text); }
.health-badge.watch { background: var(--draft-bg); color: var(--draft-text); }
.health-badge.risk { background: var(--warn-bg); color: var(--warn-text); }
.health-badge.bad { background: var(--error-bg); color: var(--error-text); }
.health-card { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.health-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.health-factors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.health-factors li { color: var(--text-2); }
.health-factors li strong { color: var(--muted); font-weight: 600; margin-right: 4px; }
.health-factors li.took strong { color: var(--error-text); }
.health-trend { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.health-bars { display: flex; align-items: flex-end; gap: 4px; height: 72px; padding: 4px; border-radius: 10px; background: var(--sunken); }
.health-bar { flex: 1; min-height: 3px; border-radius: 3px 3px 1px 1px; background: var(--success); }
.health-bar.watch { background: var(--lavender); }
.health-bar.risk { background: var(--warn); }
.health-bar.bad { background: var(--danger); }
@media (max-width: 760px) { .health-body { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Client-facing: a client's link-in-bio page (and its preview in Settings) ---------- */
/* Colours and type come from the client's brand system, set on .lp as variables. */

body.lp-page { background: #ffffff; }
.lp { --lp-radius: 14px; background: var(--lp-bg); color: var(--lp-ink); font-family: var(--lp-body), system-ui, sans-serif; font-size: 16px; line-height: 24px; min-height: 100vh; padding: 40px 16px 48px; box-sizing: border-box; display: flex; flex-direction: column; gap: 24px; }
.lp > * { width: 100%; max-width: 528px; margin-inline: auto; }
.lp a { color: inherit; text-decoration: none; }
.lp-head { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.lp-logo { width: 88px; height: 88px; object-fit: contain; border-radius: 50%; background: #ffffff; }
.lp-name { margin: 0; font-family: var(--lp-display), var(--lp-body), sans-serif; font-weight: 700; font-size: 30px; line-height: 36px; color: var(--lp-ink); }
.lp-name.upper { text-transform: uppercase; letter-spacing: 0.02em; }
.lp-headline { margin: 0; opacity: .85; max-width: 40ch; }
.lp-links, .lp-contacts, .lp-grid { list-style: none; margin: 0; padding: 0; }
.lp-links { display: flex; flex-direction: column; gap: 12px; }
.lp-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 20px; border-radius: var(--lp-radius); background: var(--lp-button); color: var(--lp-button-ink) !important; font-weight: 700; text-align: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.lp-button:hover, .lp-button:focus-visible { filter: brightness(1.08); }
.lp-button .icon { vertical-align: 0; }
.lp-contacts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.lp-contacts a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 2px solid var(--lp-accent); border-radius: 99px; font-weight: 700; color: var(--lp-ink); }
.lp-posts h2 { margin: 0 0 10px; font-size: 13px; line-height: 16px; letter-spacing: 0.08em; text-transform: uppercase; opacity: .75; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.lp-grid a { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--lp-button); color: var(--lp-button-ink) !important; }
.lp-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp-tile-text { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; font-size: 13px; line-height: 17px; text-align: center; box-sizing: border-box; }
/* The preview in Settings: a phone-sized frame. */
.lp-preview { max-width: 380px; border-radius: 28px; overflow: hidden; border: 8px solid #1b1521; }
.lp-preview .lp { min-height: 560px; padding-top: 28px; }
/* Settings → Link page: the list of links being edited. */
.link-page-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px; align-items: start; }
.link-page-grid > .stack { gap: 16px; }
@media (max-width: 1100px) { .link-page-grid { grid-template-columns: minmax(0, 1fr); } }
.link-editor { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.link-editor li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.link-editor li:last-child { border-bottom: 0; }
.link-editor li.off .link-row input { opacity: .6; }
.link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; }
.link-row input[name="url"] { grid-column: 1 / -1; grid-row: 2; }
.link-row-actions { gap: 2px; justify-content: flex-end; }
.link-row-actions form { margin: 0; }
/* Results → Link clicks: counts with a faint bar for each one's share. */
.perf-hero.click-hero { grid-template-columns: minmax(180px, 1fr) minmax(0, 3.3fr); }
@media (max-width: 720px) { .perf-hero.click-hero { grid-template-columns: 1fr; } }
.click-table { width: 100%; }
.click-table td:first-child { position: relative; }
.click-bar { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--accent); opacity: .5; }
.report-clicks-total { margin: 4px 0 12px; font-size: 28px; line-height: 34px; }

/* ---------- Brand system forms: every part adjusted without JSON, with live previews ---------- */
.brand-controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 16px; align-items: start; }
.brand-control { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.brand-control.brand-words, .brand-control.brand-checks { grid-column: 1 / -1; }
.brand-control > label:not(.inline) { font-weight: 600; font-size: 14px; line-height: 20px; }
.brand-control .field-help { margin-top: 0; }
.brand-check { align-self: end; }
.brand-checks { gap: 6px 16px; }
.brand-select { display: flex; align-items: center; gap: 8px; }
.brand-select select { flex: 1; min-width: 0; }
.brand-swatch { width: 28px; height: 28px; flex-shrink: 0; border-radius: 6px; }
.swatch-chip.empty { background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 4px, var(--border) 4px, var(--border) 8px); }
/* A grid, not a flex column: a fieldset laid out as a flex column sized its control grid as if
   it were one column wide, and the grid's rows stretched to fill that height. */
.brand-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 16px; }
.brand-group > legend { padding: 0 6px; }
.brand-group .brand-group { border-style: dashed; }
/* An optional part shows its controls only while its switch is on. */
.optional-part:not(:has(> legend input:checked)) > :not(legend) { display: none; }
.brand-row { display: block; padding: 12px 16px; }
.brand-row > legend { font-weight: 700; }
.brand-item { display: flex; flex-direction: column; gap: 8px; }
.brand-item-ops { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.brand-live:empty { display: none; }
.brand-figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.brand-live-feed { display: block; width: 100%; max-width: 420px; height: auto; border-radius: 12px; border: 1px solid var(--border); background: var(--sunken); }
.look-sheet-box .brand-figure { gap: 0; }
.palette-row .brand-colour-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.brand-template-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.brand-template-actions form { margin: 0; }
.brand-new { padding-top: 16px; border-top: 1px solid var(--border); }
.brand-new h3 { margin: 0; }
.brand-draft-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
/* Pressed by Enter in a field (it comes first in its form); out of sight and out of reach. */
.brand-default-submit { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.brand-editor-bar { position: sticky; top: 0; z-index: 10; display: flex; flex-direction: column; gap: 8px; padding: 16px 24px; }
.brand-editor-bar h2 { margin: 0; }
.brand-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 440px); gap: 24px; align-items: start; }
.brand-editor-preview { position: sticky; top: 120px; }
.brand-preview-picture { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: var(--sunken); }
@media (max-width: 1000px) {
  .brand-editor-grid { grid-template-columns: minmax(0, 1fr); }
  /* On a phone the preview comes first, under the bar, and scrolls with the page. */
  .brand-editor-preview { position: static; order: -1; }
  .brand-editor-bar { position: static; }
}
/* Rows that open on their forms: type styles (each set in itself), photo looks, template layers. */
.type-styles, .brand-layers { display: flex; flex-direction: column; gap: 8px; }
.type-style, .brand-layer, details.look { border: 1px solid var(--border); border-radius: var(--radius-sm); }
details.look { display: block; gap: 0; padding: 0; }
.type-style > summary, .brand-layer > summary, details.look > summary { cursor: pointer; padding: 10px 14px; }
.type-style[open] > summary, .brand-layer[open] > summary, details.look[open] > summary { border-bottom: 1px solid var(--border); }
.brand-layer[open] { border-color: var(--border-strong); }
.type-style > summary { display: grid; grid-template-columns: minmax(96px, 160px) minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; }
.type-style-name, .look-name { font-weight: 600; font-size: 14px; }
.type-specimen { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 22px; line-height: 1.35; }
.type-w100 { font-weight: 100; } .type-w200 { font-weight: 200; } .type-w300 { font-weight: 300; }
.type-w400 { font-weight: 400; } .type-w500 { font-weight: 500; } .type-w600 { font-weight: 600; }
.type-w700 { font-weight: 700; } .type-w800 { font-weight: 800; } .type-w900 { font-weight: 900; }
.type-italic { font-style: italic; }
.type-upper { text-transform: uppercase; }
.type-style > .brand-controls { padding: 12px 14px 14px; }
@media (max-width: 640px) { .type-style > summary { grid-template-columns: minmax(0, 1fr); } }
details.look > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.look-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 14px 14px; }
.brand-layer-head { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.brand-layer-body { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 14px; }
.brand-more .brand-layer-body { padding: 0; }
.brand-place { padding: 8px 12px 12px; }
.brand-four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; align-items: end; }
@media (max-width: 520px) { .brand-four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.brand-control[hidden], .layer-outline[hidden] { display: none; }
/* The editor's preview, with the open layer's box drawn over it. */
.preview-stage { position: relative; }
.preview-stage img { cursor: crosshair; }
.layer-outline { position: absolute; pointer-events: none; border: 2px solid var(--lavender); border-radius: 2px; box-shadow: 0 0 0 1px rgba(20, 20, 18, 0.55), inset 0 0 0 1px rgba(20, 20, 18, 0.55); }
/* A palette colour: one swatch that is its picker, its name and code, and what uses it. */
.palette-row { grid-template-columns: 56px minmax(0, 1fr); }
.palette-picker { width: 56px; height: 56px; padding: 0; border: 1px solid var(--border-strong); border-radius: 10px; background: none; cursor: pointer; }
.palette-picker::-webkit-color-swatch-wrapper { padding: 0; }
.palette-picker::-webkit-color-swatch { border: 0; border-radius: 9px; }
.palette-picker::-moz-color-swatch { border: 0; border-radius: 9px; }

/* The page's sections folded, each saying what it holds, and a jump list to them. */
.card.fold-card { padding: 14px 24px; }
.card > details.fold { margin: 0; padding: 0; border: 0; }
.fold > summary { flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.disclosure.fold > summary h2 { flex: 0 1 auto; }
.fold-state { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.brand-jump { position: sticky; top: 8px; z-index: 6; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 12px rgba(13, 10, 18, 0.06); }
:root:has(.focus-bar) .brand-jump { top: 58px; }
.brand-jump ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; line-height: 22px; }
.brand-page > section, .brand-page > details { scroll-margin-top: 96px; }
@media (max-width: 720px) {
  .brand-jump { position: static; box-shadow: none; }
  .brand-page > section, .brand-page > details { scroll-margin-top: 8px; }
}
#subtitles .brand-controls { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
/* The files' names: one line per row, the labels said on the first row only. */
.brand-rows-compact { display: flex; flex-direction: column; }
.brand-rows-compact .brand-row { margin: 0; padding: 6px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.brand-rows-compact .brand-row:not(.brand-row-new) > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand-rows-compact .brand-row-new { border-bottom: 0; padding-top: 10px; }
.brand-rows-compact .brand-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.brand-rows-compact .brand-control { flex: 1 1 140px; }
.brand-rows-compact .brand-control.brand-check { flex: 0 0 auto; padding-bottom: 10px; }
.brand-rows-compact .brand-row:not(:first-child):not(.brand-row-new) .brand-control > label:not(.inline) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.brand-rows-compact .field-help { display: none; }

/* ---------- Starter looks (the Brand system page) ---------- */
/* The top card: where the look stands, what became of the client's colour, and the ways on. */
.look-status { display: flex; flex-direction: column; gap: 4px; }
.look-status > p:first-child { font-size: 17px; line-height: 24px; font-weight: 600; }
.look-colour { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--sunken); }
.look-colour form { margin: 0; }
.look-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.starter-looks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.starter-look { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.starter-look img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: var(--sunken); }
.starter-look h3 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.starter-look form { margin: 0; margin-top: auto; }
/* With the client's colour or as designed: the picture is the one the choice saves. */
.starter-look img.starter-as-designed { display: none; }
.starter-look:has(input[value="designed"]:checked) img.starter-as-designed { display: block; }
.starter-look:has(input[value="designed"]:checked) img.starter-with-colour { display: none; }
/* Once the client has a system the gallery is a way back: smaller cards. */
.starter-looks-small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.starter-looks-small .starter-look h3 { font-size: 15px; }
.starter-looks-small .starter-look > p.muted { font-size: 12px; line-height: 16px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.starter-choice { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.starter-choice legend { padding: 0; margin-bottom: 4px; font-weight: 600; }

/* ---------- Post, queue and setup ---------- */
/* The post page's "As it will go out": each network's final text and pictures. */
.going-out { display: flex; flex-direction: column; gap: 8px; }
.going-out-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; }
.going-out-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.going-out-post { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border); min-width: 0; }
.going-out-head { display: flex; align-items: center; gap: 8px; }
.going-out-pictures { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.going-out-pictures img { flex: none; width: 72px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: var(--sunken); }
.going-out-text { margin: 0; font-size: 14px; }
.held-approval { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.held-approval form { margin: 0; }
/* The Studio's queue: ready posts of the next two weeks, in time order. */
.queue-day { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.queue-row { border: 1px solid var(--border); border-left: 3px solid var(--client, var(--border)); border-radius: 10px; background: var(--surface, transparent); }
.queue-link { display: flex; gap: 12px; padding: 10px 12px; color: inherit; text-decoration: none; min-width: 0; }
.queue-link:hover .queue-title, .queue-link:focus-visible .queue-title { text-decoration: underline; }
.queue-thumb { flex: none; width: 64px; height: 80px; object-fit: cover; border-radius: 6px; background: var(--sunken); }
.queue-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.queue-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.queue-time { font-variant-numeric: tabular-nums; }
.queue-title { font-weight: 600; overflow-wrap: anywhere; }
.queue-row .who { display: flex; align-items: center; gap: 5px; color: var(--muted); }
.queue-row .who .dot { background: var(--client); flex-shrink: 0; }
.queue-caption { color: var(--muted); overflow-wrap: anywhere; }
.queue-caption strong { color: var(--text, inherit); font-weight: 600; margin-right: 4px; }
@media (max-width: 560px) {
  .queue-thumb { width: 48px; height: 60px; }
}
/* "Add a client": the starter looks by name, each one's line under the select. */
.look-field { display: flex; flex-direction: column; gap: 6px; }
.look-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.look-notes strong { color: var(--text, inherit); }
