/* Brand: simplegrowth.agency's palette and type (Inter, Inter Tight), self-hosted
   so the dashboard makes no request to Google Fonts. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter.woff2) format("woff2-variations");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/inter-tight.woff2) format("woff2-variations");
}

:root {
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* simplegrowth.agency tokens */
  --sg-dark: #190f36;
  --purple-50: #f8f5ff;
  --purple-100: #ebe2ff;
  --purple-300: #b49dff;
  --purple-500: #6e57b8;
  --purple-700: #49338b;
  --pink-200: #fac8ff;

  /* Calm by default: a near-white page, white surfaces, hairlines instead of
     boxes, and the brand purple kept for the data itself. Pink appears in one
     place only, the period you are looking at. */
  --page: #fafafc;
  --surface: #ffffff;
  --text: var(--sg-dark);
  --text-2: #47425c;
  --muted: #6c687e;
  --grid: #f0eff4;
  --axis: #dddbe5;
  --border: #ebe9f1;
  --border-strong: rgba(25, 15, 54, 0.14);
  --hover: rgba(25, 15, 54, 0.04);
  --accent: var(--purple-700);
  --accent-soft: rgba(73, 51, 139, 0.08);
  --accent-text: #ffffff;
  --button: var(--sg-dark);
  --button-text: #ffffff;
  --current: var(--sg-dark);
  --current-text: var(--pink-200);
  --series-1: var(--purple-500);
  --series-1-wash: rgba(110, 87, 184, 0.08);
  --series-prev: #a8a4b8;
  --ramp-1: var(--purple-300);
  --ramp-2: #8f78e0;
  --ramp-3: var(--purple-500);
  --ramp-4: var(--purple-700);
  --good-text: #0b7a3e;
  --bad-text: #b3261e;
  --good: #13a052;
  --sample: var(--sg-dark);
  --sample-soft: var(--pink-200);
  --notice-soft: rgba(250, 200, 255, 0.45);
  --warn-text: #9a3f00;
  --error: #b3261e;
  --error-soft: rgba(179, 38, 30, 0.08);
  --shadow: 0 8px 24px rgba(25, 15, 54, 0.08), 0 1px 2px rgba(25, 15, 54, 0.06);
  /* One shape system: cards 16px, inputs and popovers 10px, controls full pill. */
  --radius: 16px;
  --radius-sm: 10px;
  /* Motion: strong ease-out for things arriving, the iOS drawer curve for sheets. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

/* The website has no dark mode; this is the same palette turned round, for
   people whose phone is set to dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0d0b16;
    --surface: #15121f;
    --text: #f4f2fa;
    --text-2: #cbc6da;
    --muted: #9893ab;
    --grid: #221e30;
    --axis: #34304a;
    --border: rgba(244, 242, 250, 0.08);
    --border-strong: rgba(244, 242, 250, 0.18);
    --hover: rgba(244, 242, 250, 0.05);
    --accent: var(--purple-300);
    --accent-soft: rgba(180, 157, 255, 0.14);
    --accent-text: var(--sg-dark);
    --button: #f4f2fa;
    --button-text: var(--sg-dark);
    --current: var(--pink-200);
    --current-text: var(--sg-dark);
    --series-1: #a58df7;
    --series-1-wash: rgba(165, 141, 247, 0.1);
    --series-prev: #6d6884;
    --ramp-1: var(--purple-500);
    --ramp-2: #8f78e0;
    --ramp-3: var(--purple-300);
    --ramp-4: #d6c9ff;
    --good-text: #5bd08a;
    --bad-text: #ff8a80;
    --good: #3cc47a;
    --notice-soft: rgba(250, 200, 255, 0.1);
    --warn-text: #ffb27a;
    --error: #ff8a80;
    --error-soft: rgba(255, 138, 128, 0.12);
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--text);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar ---------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 12px max(16px, calc((100vw - 1240px) / 2));
  background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
  position: sticky; top: 0; z-index: 5;
}
@media (prefers-reduced-transparency: reduce) { .topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wordmark { display: block; flex: none; line-height: 0; }
.wordmark img { display: block; height: 26px; width: auto; }
.brand-divider { width: 1px; height: 26px; background: var(--border-strong); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-client { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; letter-spacing: -0.015em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The name and, for an admin, the chevron button that switches client. The
   select covers the whole row but is invisible, so tapping the name or the
   button opens the phone's own list. */
.brand-name-row { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.client-switch {
  flex: none; width: 24px; height: 24px; display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.client-switch[hidden] { display: none; }
.client-switch select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
  font-size: 16px; /* under 16px iOS zooms the page when it opens */ appearance: none; border: 0;
}
.brand-name-row:has(.client-switch:not([hidden])):hover .client-switch { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.brand-name-row:has(select:focus-visible) .client-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The website address under the name is gone everywhere (Stuart, 27 Oct 2026). */
.brand-site { display: none !important; }
/* Auto margin, not space-between: the refresh button sits hard against the
   controls on the right, and on a phone stays up on the logo row. */
.topbar-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.refresh-btn {
  flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.refresh-btn:hover { background: var(--hover); color: var(--text); }
.refresh-btn:active { transform: scale(0.96); }
.refresh-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.refresh-btn[hidden] { display: none; }
.topbar-icons { display: flex; gap: 8px; flex: none; }
/* On the Clients screen its button reads as the place you are. */
.refresh-btn[aria-current="page"] { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.refresh-btn.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh-btn.spinning svg { animation: none; opacity: 0.5; } }
.who { font-size: 13px; color: var(--muted); }
/* Analytics | Enquiries, in the header beside the client's name: places to
   go, not another filter. The tabs run the header's full height, so the
   current one's underline sits on the header's own bottom line. */
.views { display: flex; align-self: stretch; gap: 16px; margin: -12px 0 -13px 20px; }
.views[hidden] { display: none; }
.view-tab {
  display: flex; align-items: center; padding: 0 12px;
  font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s var(--ease-out, ease), border-color 0.15s var(--ease-out, ease);
}
.view-tab:hover { color: var(--text); }
.view-tab[aria-current="page"] { color: var(--text); }
/* One underline that slides to the chosen tab (placed by placeIndicator() in
   app.js), rather than one per tab switching on and off. */
.views { position: relative; }
.view-indicator {
  position: absolute; left: 0; bottom: 0; height: 2px; width: var(--w, 0); border-radius: 2px 2px 0 0;
  background: var(--accent); transform: translateX(var(--x, 0)); pointer-events: none;
  transition: transform 0.32s var(--ease-out), width 0.32s var(--ease-out);
}
.view-indicator.instant { transition: none; }
@media (prefers-reduced-motion: reduce) { .view-indicator { transition: none; } }
.view-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; border-radius: 8px; }

.select {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px;
}
.select:hover { border-color: var(--border-strong); }
.select select { border: 0; background: transparent; height: 100%; padding-right: 6px; max-width: 240px; text-overflow: ellipsis; }
.select.dev select { max-width: 190px; }
.select select:focus { outline: none; }
.select:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.select-prefix { font-size: 12px; color: var(--muted); }
.select.dev { border-style: dashed; }


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

.page { max-width: 1272px; margin: 0 auto; padding: 28px 16px 56px; transition: opacity 0.2s; }
.page.loading .kpis, .page.loading .panels { opacity: 0.5; pointer-events: none; }
/* Pinned panels sit between the pinned tiles and the rest of the tiles. */
.pinned-panels { margin-bottom: 22px; }
#top-kpis:empty { display: none; }

/* The enquiry view is the list alone: no tiles. */
.page[data-view="list"] #top-kpis, .page[data-view="list"] #kpis { display: none; }

.filters { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 28px; }
/* The periods are a group of chips (Stuart, 27 Oct 2026): each its own
   outlined pill, the period being read filled, in one row that scrolls
   sideways when it is wider than the screen. On a phone the row runs to the
   screen's edges, so a chip cut off at the edge says "there's more". */
.range-chips {
  display: flex; gap: 6px; max-width: 100%; overflow-x: auto; padding: 3px 0;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.range-chips::-webkit-scrollbar { display: none; }
.range-chips button { flex: none; }
@media (max-width: 520px) {
  .range-chips { flex: 0 0 calc(100% + 32px); max-width: none; margin: 0 -16px; padding: 3px 16px; scroll-padding: 0 16px; }
}
.range-chips button {
  padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
  font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.16s var(--ease-out, ease);
}
.range-chips button:active { transform: scale(0.97); }
.range-chips button[aria-pressed="true"] { background: var(--current); border-color: var(--current); color: var(--current-text); }
.range-chips button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .range-chips button:not([aria-pressed="true"]):hover { background: var(--hover); border-color: var(--text-2); color: var(--text); }
}
.pill {
  border: 0; background: transparent; padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text-2); white-space: nowrap;
  text-decoration: none; display: inline-block; transition: background-color 0.15s, color 0.15s;
}
.pill:hover { background: var(--hover); color: var(--text); }
.pill { border: 1px solid var(--border); background: var(--surface); }
.compare { margin: 0; font-size: 13px; color: var(--muted); }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---- badges ------------------------------------------------------------ */

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.01em; padding: 1px 7px; border-radius: 999px; white-space: nowrap; vertical-align: 1px; }
.badge-live { color: var(--good-text); background: var(--accent-soft); }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.badge-sample { color: var(--sg-dark); background: var(--pink-200); }
.badge-error { color: var(--error); background: var(--error-soft); }
.badge-stale { color: var(--text-2); background: var(--hover); }

/* ---- KPI tiles ---------------------------------------------------------- */

.kpis { margin-bottom: 16px; }
/* A group of tiles is one card, the tiles split by hairlines that stop short
   of the edges. Each tile draws its own left and top line at -1px, so on the
   card's outer edge the line lands on the card's border and disappears, and
   inside it reads as a divider. The 18px inset keeps the lines clear of the
   rounded corners. No overflow clipping, so the definition popover can spill
   out of its tile. */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.kpi-group {
  font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); margin: 0 0 10px;
}
.kpi-grid + .kpi-group { margin-top: 32px; }
/* How this group's numbers are dated. The lag between an enquiry and the money
   is the one thing the tiles cannot say for themselves. */
.kpi-group-note { font-size: 13px; color: var(--muted); margin: -6px 0 12px; max-width: 62ch; }
.kpi {
  position: relative; padding: 18px 20px 16px; display: flex; flex-direction: column; min-height: 150px;
}
.kpi::before, .kpi::after { content: ""; position: absolute; background: var(--border); pointer-events: none; }
.kpi::before { left: -1px; top: 18px; bottom: 18px; width: 1px; }
.kpi::after { top: -1px; left: 18px; right: 18px; height: 1px; }
.kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; line-height: 1.35; }
.info {
  flex: none; width: 22px; height: 22px; margin: -3px -6px 0 0; border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.info:hover, .info[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.info span { width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 50%; display: grid; place-items: center; font-size: 10px; line-height: 1; font-style: italic; font-family: Georgia, serif; }
/* The label hangs from the top, the number and its change sit on the floor,
   so numbers in a row line up even when one label runs to two lines. */
.kpi-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin: auto 0 12px; padding-top: 10px; }
.kpi-value {
  font-family: var(--font-display); font-size: 40px; font-weight: 600; letter-spacing: -0.035em; margin: 0; line-height: 1;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.delta { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.delta > * { white-space: nowrap; }
.delta strong { font-weight: 600; }
.delta.good strong { color: var(--good-text); }
.delta.bad strong { color: var(--bad-text); }
.spark { width: 72px; height: 28px; flex: 0 1 auto; min-width: 0; margin-bottom: 4px; }
.kpi-note {
  position: absolute; left: 10px; right: 10px; top: 44px; z-index: 3; margin: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 14px; font-size: 13px; color: var(--text-2);
}
.kpi-note .from { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
/* Under the change, in the flow: in a narrow tile a corner badge sits on the
   text. Live tiles carry no badge, so only demo and failed tiles grow. */
.kpi .badge { align-self: flex-start; margin-top: 10px; }

/* ---- panels ------------------------------------------------------------- */

.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px 24px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.panel-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); max-width: 65ch; }
.panel-unavailable { color: var(--muted); font-size: 14px; padding: 18px 0 6px; margin: 0; }

.legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-2); margin: 0 0 10px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--series-1); }
/* The previous period is drawn dashed, so the key is dashed too. */
.legend i.prev { height: 0; border-radius: 0; background: none; border-top: 2px dashed var(--series-prev); width: 14px; }

.chart { position: relative; }
.chart svg {
  display: block; width: 100%; overflow: visible;
  /* Dragging across a chart is reading it, not selecting text: without this a
     click-drag highlights the axis labels, and a press-and-hold on a phone
     selects the chart and offers the copy menu. */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}
/* Safari paints its own blue ring on :focus, and a tap focuses the chart
   whatever the script does — that ring, not a selection, is the box readers
   saw drawn around the chart on a phone. Off by default; the accent ring below
   puts it back for the keyboard, which is the only place it means anything. */
.chart svg:focus { outline: none; }
.chart svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.chart svg.by-pointer:focus-visible { outline: none; }
.axis-label { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }

details.as-table { margin-top: 8px; font-size: 13px; }
details.as-table summary { color: var(--muted); cursor: pointer; width: max-content; }
details.as-table .table-wrap { max-height: 260px; overflow: auto; margin-top: 6px; }

/* bar lists: label, bar, value */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: baseline; border-radius: 6px; }
.bar-row:hover .bar-fill { filter: brightness(1.08); }
.bar-label { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.bar-value small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.bar-track { grid-column: 1 / -1; height: 6px; position: relative; margin-top: 2px; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); border-radius: 999px; min-width: 3px; }
.bar-prev { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--text-2); opacity: .5; }
.bars-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; display: flex; align-items: center; gap: 6px; }
.bars-note i { display: inline-block; width: 2px; height: 12px; background: var(--text-2); opacity: .55; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 8px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.dim { color: var(--muted); }
.table-scroll { overflow-x: auto; }
/* A totals row: the line above it says "these add up to this". */
tfoot th, tfoot td { padding: 10px 8px 0; border-top: 1px solid var(--border-strong); border-bottom: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }
tfoot th:first-child { padding-left: 0; }
tfoot td:last-child { padding-right: 0; }
/* Long headings over short numbers: let them wrap so the table fits a phone. */
.services-table thead th.num { white-space: normal; vertical-align: bottom; }
/* Where they came from (13 Nov 2026): a row heading per source, and a change column coloured like the tiles. */
.source-tables { display: grid; gap: 22px; }
.source-heading { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.source-table tbody th { padding: 9px 8px 9px 0; font-size: 13.5px; font-weight: 500; color: var(--text); white-space: normal; vertical-align: top; }
.source-table tbody tr:last-child th { border-bottom: 0; }
.source-table .change { white-space: nowrap; color: var(--muted); }
.source-table .change.good { color: var(--good-text); }
.source-table .change.bad { color: var(--bad-text); }
.table-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; max-width: 72ch; }
.show-more { margin-top: 14px; font-size: 13px; padding: 6px 14px; cursor: pointer; }
.show-more[hidden] { display: none; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--axis); }
.status-won::before { background: var(--good); }
.status-quoted::before { background: var(--ramp-3); }
.status-contacted::before { background: var(--ramp-1); }
.status-new::before { background: transparent; border: 1.5px solid var(--muted); width: 5px; height: 5px; }
.status-lost { color: var(--muted); }

/* ---- every enquiry (enquiries() in app.js) ------------------------------
   One list, three shapes, chosen by the panel's own width, not the screen's:
   - under 600px: stacked rows. Name and value, what they asked for, a quiet
     line of when / where from / status, then the two buttons side by side
     and full width, where a thumb reaches;
   - 600-939px: the same, with the buttons beside the quiet line;
   - 940px and up: a table, one line per enquiry, buttons in the last column.
   Nothing scrolls sideways at any width. */
.leads { container-type: inline-size; }
.lead-summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; margin: -6px 0 14px;
  font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.lead-summary strong { color: var(--text); font-weight: 600; }
.lead-summary > span { white-space: nowrap; }
.lead-summary > span:not(:last-child)::after { content: "·"; margin: 0 9px; color: var(--muted); }
/* On the enquiry tab the totals are a purple card of their own above the list
   (Stuart, 27 Oct 2026): each figure big, its label small beneath. The brand
   purple in both light and dark mode. */
.panels > .lead-summary {
  grid-column: 1 / -1; margin: 0; padding: 18px 20px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px;
  background: var(--purple-700); color: var(--purple-100); border-radius: var(--radius);
  font-size: 13px;
}
.panels > .lead-summary > span { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; white-space: normal; min-width: 0; }
.panels > .lead-summary > span:not(:last-child)::after { content: none; }
.panels > .lead-summary strong {
  color: #ffffff; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
}
@media (max-width: 520px) {
  .panels > .lead-summary { padding: 16px; }
  .panels > .lead-summary strong { font-size: 22px; }
}

/* The list has no card of its own; each day's requests are a white rounded
   card under the day's heading, on the page's grey (Stuart, 27 Oct 2026). */
.panel.enquiry-card { background: none; border: 0; border-radius: 0; padding: 0; }
.enquiry-card .lead-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.enquiry-card .lead { margin: 0; padding-left: 16px; padding-right: 16px; }
.enquiry-card .lead-day-head { margin: 0; padding: 0 4px 10px; }
@container (min-width: 940px) {
  .enquiry-card .lead-head { margin: 0; padding: 0 17px 8px; border-bottom: 0; }
  .enquiry-card .lead { padding: 12px 16px; }
}
.lead-head { display: none; }
.lead-list { list-style: none; margin: 0; padding: 0; }
/* One group per day: the date as a quiet band across the card, the day's
   count on the right. */
/* Room above each day, so the days read as separate groups. */
.lead-day { margin-top: 44px; }
.lead-day:first-child { margin-top: 16px; }
.lead-day-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0 -10px; padding: 8px 10px; border-radius: 10px; background: transparent;
  font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: -0.005em; color: var(--text);
}
.panel .lead-day-head { font-size: 13px; font-weight: 500; } /* beats .panel h2's 16px and 600 */
.lead-day-count { font-family: var(--font-body, inherit); font-size: 12.5px; font-weight: 400; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lead {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "who value" "meta meta" "actions actions" "msg msg";
  gap: 0 12px; padding: 14px 10px; margin: 0 -10px; border-bottom: 1px solid var(--grid);
}
.lead:last-child { border-bottom: 0; }
.lead-who { grid-area: who; min-width: 0; }
.lead-name {
  margin: 0; font-family: var(--font-display); font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.3; overflow-wrap: anywhere;
}
.lead-name:focus { outline: none; }
.lead-services { margin: 2px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.lead-when { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lead-value { grid-area: value; margin: 0; text-align: right; white-space: nowrap; line-height: 1.3; font-variant-numeric: tabular-nums; }
.lead-value strong { display: block; font-size: 15px; font-weight: 600; }
.lead-value span { display: block; font-size: 12px; color: var(--muted); }
.lead-value.is-won strong, .lead-value.is-won span { color: var(--good-text); }
.lead-meta {
  grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; row-gap: 2px; margin-top: 6px;
  font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.lead-meta > * { white-space: nowrap; }
.lead-meta > :not(:last-child)::after { content: "·"; margin: 0 8px; }
.lead-status .status { font-size: 12.5px; }
.lead-status .status-lost { color: var(--muted); }
.lead-actions { grid-area: actions; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.lead-actions:empty { display: none; }
.lead-msg { grid-area: msg; margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-2); max-width: 60ch; }
.lead-msg.is-good { color: var(--good-text); }
.lead-msg.is-warn { color: var(--warn-text); }
.lead-msg.is-bad { color: var(--error); }

/* The buttons. Mark as won is quiet (most rows never need it); Send review is
   filled once it is the next step; unavailable reads as unavailable but still
   answers a tap with why. */
.lead-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text);
  font-family: var(--font-display); font-size: 14px; font-weight: 500; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.16s var(--ease-out);
}
.lead-btn:active { transform: scale(0.97); }
.lead-btn.primary { background: var(--button); border-color: var(--button); color: var(--button-text); }
.lead-btn[aria-disabled="true"] { background: transparent; border-style: dashed; border-color: var(--border-strong); color: var(--muted); cursor: default; }
.lead-btn[aria-disabled="true"]:active { transform: none; }
@media (hover: hover) and (pointer: fine) {
  .lead-btn:hover { background: var(--hover); border-color: var(--text-2); }
  .lead-btn.primary:hover { background: var(--button); border-color: var(--button); filter: brightness(1.2); }
  .lead-btn[aria-disabled="true"]:hover { background: transparent; border-color: var(--border-strong); }
}
@media (pointer: coarse) { .lead-btn { min-height: 44px; } }
.lead-done {
  /* Shaped like the buttons, so a row keeps its layout once something is done;
     green and not clickable (Stuart, 27 Oct 2026). */
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--good-text) 35%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--good-text) 9%, transparent);
  font-family: var(--font-display); font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--good-text); white-space: nowrap;
}
.lead-done-main { display: inline-flex; align-items: center; gap: 5px; }
.lead-done small { font-size: 12.5px; font-weight: 400; color: inherit; opacity: 0.8; }
.lead-done small::before { content: "·"; margin-right: 6px; }
@media (pointer: coarse) { .lead-done { min-height: 44px; } }
.lead-done:focus { outline: none; }
.lead-done:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A row that just changed glows once, so the eye finds it after the sheet closes. */
.lead.just-changed { animation: lead-changed 1.4s var(--ease-out); }
@keyframes lead-changed { from { background-color: var(--accent-soft); } to { background-color: transparent; } }

/* Phone: the two buttons share the row equally, full width, thumb height. */
@container (max-width: 599px) {
  .lead-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-actions > :only-child { grid-column: 1 / -1; }
  .lead-btn { width: 100%; padding: 0 10px; }
}
/* Tablet: buttons beside the quiet line, so a row is two lines, not three. */
@container (min-width: 600px) and (max-width: 939px) {
  .lead { grid-template-areas: "who value" "meta actions" "msg msg"; align-items: center; }
  .lead-actions { justify-content: flex-end; flex-wrap: nowrap; }
  .lead-msg { justify-self: end; text-align: right; }
}
/* Wide: a table. Each row is its own grid on the same columns (set in
   --lead-cols by app.js), the quiet line's parts become cells. */
@container (min-width: 940px) {
  .lead-head, .lead {
    grid-template-columns: var(--lead-cols); grid-template-areas: none; column-gap: 16px; align-items: center;
  }
  .lead-head {
    display: grid; padding: 0 10px 8px; margin: 0 -10px; border-bottom: 1px solid var(--grid);
    font-size: 12px; font-weight: 500; color: var(--muted);
  }
  .lead-head .num { text-align: right; }
  .lead { padding: 11px 10px; }
  .lead-meta { display: contents; }
  .lead-meta > :not(:last-child)::after { content: none; }
  .lead-meta > * { white-space: normal; }
  .lead-who { grid-column: 1; grid-row: 1; }
  .lead-name { font-size: 14.5px; }
  .lead-services { font-size: 13px; color: var(--muted); }
  .lead-from { grid-column: 2; grid-row: 1; font-size: 13.5px; color: var(--text-2); }
  .lead-status { grid-column: 3; grid-row: 1; }
  .lead-value { grid-column: 4; grid-row: 1; }
  .lead-actions { grid-column: -2 / -1; grid-row: 1; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lead-actions > :only-child { grid-column: 1 / -1; }
  .lead-btn { width: 100%; min-height: 36px; padding: 0 10px; font-size: 13.5px; }
  .lead-done { min-height: 36px; }
  .lead-msg { grid-column: 1 / -1; grid-row: 2; justify-self: end; text-align: right; margin-top: 6px; }
}
@media (hover: hover) and (pointer: fine) { .lead:hover { background: var(--hover); } }

/* ---- the confirm sheet ---------------------------------------------------- */
.sheet {
  padding: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text);
  width: min(460px, calc(100vw - 32px)); max-width: none; box-shadow: var(--shadow);
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.sheet::backdrop { background: rgba(13, 11, 22, 0.45); transition: opacity 0.2s ease; }
@starting-style {
  .sheet[open] { opacity: 0; transform: translateY(8px) scale(0.98); }
  .sheet[open]::backdrop { opacity: 0; }
}
.sheet-form { padding: 24px; }
.sheet h2 { margin: 0 0 6px; font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; overflow-wrap: anywhere; }
.sheet h2:focus { outline: none; }
.sheet-text { margin: 0 0 16px; font-size: 14.5px; color: var(--text-2); }
#lead-dialog-body > .sheet-text:last-child { margin-bottom: 0; }
.sheet-field { margin-bottom: 0; }
.sheet-field .optional { font-weight: 400; color: var(--muted); }
.sheet-note { margin: 14px 0 0; }
.money-field {
  display: flex; align-items: center; height: 48px; padding-left: 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.money-field:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.money-field span { font-size: 16px; color: var(--muted); }
/* 16px: iPhones don't zoom in on focus. */
.sheet .money-field input { flex: 1; min-width: 0; height: 100%; padding: 0 14px 0 4px; border: 0; background: transparent; font-size: 16px; font-variant-numeric: tabular-nums; outline: none; }
.sheet .money-field input:focus { outline: none; }
.money-field:has(input[aria-invalid="true"]) { border-color: var(--error); }
.sheet-error { margin-top: 14px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.sheet .btn:active:not(:disabled) { transform: scale(0.97); }
.sheet .btn { transition: transform 0.16s var(--ease-out), background-color 0.15s ease, filter 0.15s ease; }
/* Phone: a bottom sheet, buttons full width with the main one nearest the thumb. */
@media (max-width: 560px) {
  .sheet {
    width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0;
    transition-duration: 0.3s; transition-timing-function: var(--ease-drawer);
  }
  @starting-style { .sheet[open] { opacity: 1; transform: translateY(100%); } }
  .sheet-form { padding: 22px 16px max(16px, env(safe-area-inset-bottom)); }
  .sheet-actions { flex-direction: column-reverse; }
  .sheet-actions .btn { width: 100%; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { transition: opacity 0.2s ease; }
  @starting-style { .sheet[open] { transform: none; opacity: 0; } }
  .lead-btn:active, .sheet .btn:active { transform: none; }
}

/* ---- provenance --------------------------------------------------------- */

.provenance { margin-top: 28px; }
.provenance h2 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--text-2); }
.provenance ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.provenance li { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.provenance li strong { color: var(--text-2); font-weight: 600; }

/* ---- tooltip ------------------------------------------------------------ */

.tooltip {
  position: fixed; z-index: 20; pointer-events: none; min-width: 150px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 9px 12px; font-size: 12.5px;
}
.tooltip .t-date { color: var(--muted); margin-bottom: 4px; }
.tooltip .t-row { display: grid; grid-template-columns: 12px auto 1fr; gap: 6px; align-items: center; }
.tooltip .t-row i { width: 12px; height: 2px; border-radius: 2px; background: var(--series-1); }
.tooltip .t-row i.prev { height: 0; background: none; border-top: 2px dashed var(--series-prev); }
.tooltip .t-row strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.tooltip .t-row span { color: var(--muted); }

/* ---- small screens ------------------------------------------------------ */

@media (max-width: 860px) {
  .panels { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 14px 14px 12px; min-height: 132px; }
  .kpi::before { top: 14px; bottom: 14px; }
  .kpi::after { left: 14px; right: 14px; }
  .kpi-value { font-size: 28px; }
  /* An odd tile out takes the whole last row rather than leave a hole. */
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .spark { display: none; }
  .panel { padding: 14px; }
  .topbar-controls { width: 100%; }
  .select { flex: 1; min-width: 0; }
  .select select { width: 100%; max-width: none; }
  .who { display: none; }
  .hide-sm { display: none !important; }
}
.panel.wide > .bars, .panel.wide > div > .bars { max-width: 760px; }
.select-prefix { white-space: nowrap; }
@media (max-width: 520px) {
  .topbar { position: static; padding-top: 20px; }
  /* A little less space between the tabs and the period chips. */
  .page { padding-top: 20px; }
  .brand-divider { display: none; }
  .wordmark img { height: 24px; }
  .brand { flex-wrap: wrap; row-gap: 10px; }
  /* The logo and client name stack here; the brand shrinks so the button can
     share its row, and the button lines up with the logo, not the pair. */
  .brand { flex: 1 1 0; }
  .topbar-icons { order: 1; margin-left: auto; align-self: flex-start; margin-top: 0; }
  .topbar-controls { order: 2; }
  /* A client has no picker here (and .who is hidden): no empty row for it. */
  .topbar-controls:not(:has(> :not([hidden]):not(.who))) { display: none; }
  /* On a phone the tabs are the header's last row, splitting its width. */
  .views { order: 3; width: calc(100% + 32px); margin: 0 -16px -13px; padding: 0 16px; gap: 0; }
  .view-tab { flex: 1; justify-content: center; padding: 12px 8px 11px; }
}

.page-foot { max-width: 1272px; margin: 0 auto; padding: 0 16px 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---- Clients screen ------------------------------------------------------ */

.nav-link { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; padding: 8px 14px; border-radius: 999px; }
.nav-link:hover { background: var(--hover); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* Same width as the dashboard (.page), so the Clients screen lines up with
   the top bar and the numbers pages instead of sitting in a narrower column. */
.admin.loading { opacity: 0.5; }
.admin h1 { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.back-link { display: inline-block; font-size: 13px; color: var(--muted); text-decoration: none; margin-top: 4px; }
.back-link:hover { color: var(--text); }
.small { font-size: 12.5px; }
.warn-text { color: var(--warn-text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--text); background: transparent; color: var(--text);
  font-family: var(--font-display); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--button); border-color: var(--button); color: var(--button-text); }
.btn-primary:hover { background: var(--button); filter: brightness(1.25); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--text); height: 36px; padding: 0 12px; }

.clients-table td { vertical-align: middle; }
/* The table is the card: no inset, so the header band and row lines run to
   the card's edges. The padding moves into the outer cells instead. */
.panel.table-card { padding: 0; overflow: hidden; }
.table-card th { padding-top: 14px; padding-bottom: 10px; background: var(--page); }
.table-card td { padding-top: 14px; padding-bottom: 14px; }
.table-card th:first-child, .table-card td:first-child { padding-left: 24px; }
.table-card th:last-child, .table-card td:last-child { padding-right: 24px; }
.table-card tbody tr:hover td { background: var(--hover); }
.clients-table tr.paused td { color: var(--muted); }
.client-link { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; text-decoration: none; }
.client-link:hover { text-decoration: underline; }
.actions { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 8px; background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.chip-button { font-family: var(--font-display); font-size: 14px; font-weight: 500; padding: 6px 14px; border-radius: 999px; border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.chip-button:hover { background: var(--hover); color: var(--text); }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state .btn { margin-top: 14px; }

.client-form { display: grid; gap: 12px; padding-bottom: 8px; }
.form-card { padding: 22px 24px 24px; }
.form-card .panel-head { margin-bottom: 14px; }
.form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 13.5px; font-weight: 550; }
.field input, .field select, .field textarea {
  height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%;
}
.field textarea { height: auto; min-height: 120px; padding: 10px 14px; font: inherit; line-height: 1.5; resize: vertical; }
.field input:disabled { background: var(--hover); color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.field-error { margin: 0; font-size: 13px; color: var(--error); font-weight: 500; }
.note { font-size: 13px; color: var(--text); background: var(--notice-soft); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 0 14px; }
.word-preview { font-size: 13px; color: var(--text-2); margin: 12px 0 0; }

.toggle { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.toggle > span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.check-item { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; }
.check-item:hover { background: var(--hover); }
.check-item input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.check-item label { display: flex; flex-direction: column; font-size: 14px; cursor: pointer; min-width: 0; }
.check-item:not(.on) label > span:first-child { color: var(--text-2); }
.needs { font-size: 12px; color: var(--muted); }
.order-buttons { display: flex; gap: 2px; }
.icon-btn { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 14px; }
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.pin-btn { height: 32px; padding: 0 11px; margin-right: 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.pin-btn:hover { background: var(--hover); color: var(--text); }
.pin-btn[aria-pressed="true"] { background: var(--button); border-color: var(--button); color: var(--button-text); }

.login-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; }
.login-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 14px; min-height: 44px; overflow-wrap: anywhere; }
.login-list li.dim { border-bottom: 0; }
.login-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; flex: none; }
.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; }

.form-summary { background: var(--error-soft); color: var(--text); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.form-summary p { margin: 4px 0 0; }
.form-summary:focus { outline: 2px solid var(--error); }

.savebar {
  position: sticky; bottom: 0; z-index: 4; display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 0; margin-top: 4px; background: linear-gradient(to bottom, transparent, var(--page) 30%);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--button); color: var(--button-text); padding: 12px 20px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow);
  max-width: calc(100vw - 32px);
}

@media (max-width: 760px) {
  .form-pair, .field-row, .field-row.three { grid-template-columns: minmax(0, 1fr); }
}

/* ---- sign-in page (public/sign-in.html) ------------------------------- */

.sign-in-page { min-height: 100vh; min-height: 100dvh; display: flex; }
.sign-in {
  width: 100%; max-width: 440px; margin: auto; padding: max(40px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.sign-in-logo img { display: block; height: 30px; width: auto; }
.sign-in-card {
  width: 100%; padding: 32px 28px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.sign-in-step { display: flex; flex-direction: column; }
.sign-in-step h1 {
  margin: 0 0 8px; text-align: center; font-family: var(--font-display); font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em;
}
.sign-in-lede { margin: 0 0 22px; color: var(--text-2); font-size: 16px; text-align: center; }
.sign-in-small { margin: 0 0 18px; color: var(--muted); font-size: 14px; text-align: center; }
.sign-in-step strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.sign-in-wide { width: 100%; height: 48px; font-size: 16px; }
.sign-in-step .btn-quiet { align-self: center; margin-top: 4px; }
.sign-in-step .btn-quiet.sign-in-wide { height: 44px; }
.sign-in-step .field input { height: 48px; font-size: 16px; } /* 16px: iPhones don't zoom in on focus */
.sign-in-or {
  display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px;
}
.sign-in-or::before, .sign-in-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sign-in-alert {
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--error-soft); color: var(--error); font-size: 14px; font-weight: 500;
}
.sign-in-icon {
  display: grid; place-items: center; align-self: center; width: 52px; height: 52px; margin-bottom: 18px;
  border-radius: 14px; background: var(--current); color: var(--current-text);
}
.sign-in-spinner {
  width: 28px; height: 28px; margin-bottom: 18px; align-self: center; border-radius: 50%;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: sign-in-spin 0.8s linear infinite;
}
@keyframes sign-in-spin { to { transform: rotate(360deg); } }
.sign-in-foot { margin: 0; color: var(--muted); font-size: 13px; }
.sign-in-foot a { color: inherit; }
@media (max-width: 480px) { .sign-in-card { padding: 26px 20px; } .sign-in-step h1 { font-size: 24px; } }

/* Under a booking list: the website form's messages (PeterJames, 30 Oct 2026). */
.list-subhead { font-size: 15px; font-weight: 600; margin: 28px 4px 4px; color: var(--text); }

/* Confetti falling when a deal is marked won (app.js confettiRain). Above everything, never in the way. */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1000; overflow: hidden; }
.confetti span { position: absolute; width: 10px; height: 14px; border-radius: 2px; will-change: transform, opacity; }
/* The paper plane when a review request is sent (app.js paperPlaneFrom). */
.paper-plane { position: fixed; width: 44px; height: 44px; pointer-events: none; z-index: 1000; will-change: transform, opacity; filter: drop-shadow(0 4px 6px rgba(25, 15, 54, 0.18)); }
/* Send review with no details on the form: email and mobile, typed in. */
.sheet-contact { display: grid; gap: 12px; margin-top: 4px; }
.sheet-contact[hidden] { display: none; }
.sheet-contact .hint { margin: 0; }

/* ---- photos (31 Oct 2026) -------------------------------------------------- */

.photos { position: relative; }
.photos-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.photos-title { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.photos-add svg { margin-left: -4px; }
.photos-month { margin: 26px 0 10px; font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--muted); }
.photos-month:first-child { margin-top: 0; }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.photo-tile {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--grid); cursor: zoom-in;
  transition: transform 0.16s var(--ease-out);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.no-preview img { display: none; }
.photo-tile.no-preview::after { content: "No preview yet"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.photo-tile:active { transform: scale(0.97); }
.photo-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .photo-tile:hover img { filter: brightness(1.06); } }
.photo-badge {
  position: absolute; left: 6px; bottom: 6px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: rgba(13, 11, 22, 0.62); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.photo-badge + .photo-badge, .photo-badge-up { left: auto; right: 6px; }
.photos-more { display: flex; margin: 24px auto 0; }
.photos-empty { padding: 56px 16px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.photos-empty p { margin: 0 auto; }
.photos-empty .panel-sub { margin-top: 6px; }
.photos.dropping::after {
  content: "Drop to add them"; position: absolute; inset: 12px 8px; display: grid; place-items: center; z-index: 5; pointer-events: none;
  border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); color: var(--accent);
  font-family: var(--font-display); font-size: 18px; font-weight: 600;
}

.photos-uploads:not(:empty) { display: grid; gap: 8px; margin-bottom: 20px; }
.up-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13.5px;
}
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-status { color: var(--muted); }
.up-track { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--grid); overflow: hidden; }
.up-bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }
.up-failed { grid-template-columns: minmax(0, 1fr) auto auto; border-color: var(--error); background: var(--error-soft); }
.up-failed .up-status { color: var(--error); }
.up-failed .up-track { display: none; }
.up-dismiss { height: 28px; padding: 0 8px; }

.photo-viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(13, 11, 22, 0.94); color: #f4f2fa;
}
.photo-viewer[open] { display: flex; flex-direction: column; }
.photo-viewer::backdrop { background: transparent; }
.pv-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.pv-stage img, .pv-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; }
.pv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.pv-caption { margin: 0; font-size: 13.5px; color: #c9c5d8; overflow-wrap: anywhere; }
.pv-buttons { display: flex; gap: 6px; margin-left: auto; }
.photo-viewer .btn { color: #f4f2fa; border-color: rgba(244, 242, 250, 0.5); }
.photo-viewer .btn-quiet { border-color: transparent; font-size: 18px; }
.photo-viewer .btn:hover { background: rgba(244, 242, 250, 0.1); }

@media (max-width: 520px) {
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .photo-tile { border-radius: 4px; }
  .photo-badge { font-size: 10.5px; padding: 2px 6px; left: 4px; bottom: 4px; }
  .photo-badge + .photo-badge, .photo-badge-up { left: auto; right: 4px; }
  .photos-add { width: 100%; }
  .pv-stage { padding: 0; }
  .pv-stage img, .pv-stage video { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .photo-tile, .up-bar { transition: none; } }
