/* Chill Reporting: one stylesheet for the portal and the exported client reports.

   Brand: Slate & Glacier. Mist #F2F4F6 · Pale Slate #C5C3C6 · Blue Slate #56667A · Night #1C2430 · Glacier #7FB2C9

   The one rule that keeps the pages readable:
   - BLUE = something you can click, or the main data (this period).
   - PALE BLUE = the same data, earlier (last period, older months).
   - NEUTRAL, NO OUTLINE = labels and status tags you can't click.
   All text colours are checked to at least 4.5:1 contrast in light and dark mode. */

:root {
  color-scheme: light;
  --page: #F2F4F6; --surface: #FFFFFF; --ink: #1C2430; --ink-2: #424B58; --muted: #5A626F;
  --grid: #E3E6EA; --track: #EEF0F3; --border: rgba(28, 36, 48, 0.12); --field-border: #C3CAD3;
  --accent: #2C6A8E; --accent-hover: #22566F; --on-accent: #FFFFFF; --accent-soft: #E3EFF6; --accent-line: #7FAFC9;
  --data: #2C6A8E; --data-prev: #9DC0D6;
  --s1: #2C6A8E; --s2: #7FB2C9; --s3: #D3D8DF; --s4: #1C2430;   /* series: dark → mid → light, so they differ in lightness */
  --good: #2B7A4B; --danger: #B42F2F; --brand-night: #1C2430;
  --shadow: 0 1px 2px rgba(28, 36, 48, 0.05), 0 4px 16px rgba(28, 36, 48, 0.05);
  --shadow-hover: 0 2px 4px rgba(28, 36, 48, 0.07), 0 14px 36px rgba(28, 36, 48, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0F141B; --surface: #1A212B; --ink: #EEF1F5; --ink-2: #C9CFD8; --muted: #959DA9;
    --grid: #2A323D; --track: #232B36; --border: rgba(255, 255, 255, 0.12); --field-border: #3A4451;
    --accent: #7FB2C9; --accent-hover: #9CC6DA; --on-accent: #0F141B; --accent-soft: rgba(127, 178, 201, 0.15); --accent-line: #5F93AC;
    --data: #7FB2C9; --data-prev: #3E6075;
    --s1: #7FB2C9; --s2: #D3DAE3; --s3: #4C5666; --s4: #EEF1F5;
    --good: #5DBB7E; --danger: #F08A8A;
    --shadow: none; --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.14);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0F141B; --surface: #1A212B; --ink: #EEF1F5; --ink-2: #C9CFD8; --muted: #959DA9;
  --grid: #2A323D; --track: #232B36; --border: rgba(255, 255, 255, 0.12); --field-border: #3A4451;
  --accent: #7FB2C9; --accent-hover: #9CC6DA; --on-accent: #0F141B; --accent-soft: rgba(127, 178, 201, 0.15); --accent-line: #5F93AC;
  --data: #7FB2C9; --data-prev: #3E6075;
  --s1: #7FB2C9; --s2: #D3DAE3; --s3: #4C5666; --s4: #EEF1F5;
  --good: #5DBB7E; --danger: #F08A8A;
  --shadow: none; --shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
:root { --f-head: "Inter Tight", "Segoe UI", system-ui, sans-serif; --f-body: "Inter", "Segoe UI", system-ui, sans-serif; --r-md: clamp(14px, 1.1vw, 18px); }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-head); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
html, body { overflow-x: clip; } /* the header and footer bands run past the page width */
.wrap { max-width: 1120px; min-height: 100vh; display: flex; flex-direction: column; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
/* Solid Night bands in both themes. Colours are re-set inside them, so the logo, buttons and links stay readable. */
header.top, footer.site-foot {
  color-scheme: dark; position: relative; isolation: isolate; color: var(--muted);
  --ink: #F2F4F6; --ink-2: #C9CFD8; --muted: #AEB6C2; --surface: transparent; --accent: #7FB2C9; --accent-hover: #9CC6DA;
  --on-accent: #0F141B; --accent-soft: rgba(127, 178, 201, 0.15); --accent-line: #5F93AC;
}
header.top::before, footer.site-foot::before { content: ""; position: absolute; inset: 0 -100vmax; z-index: -1; background: var(--brand-night); }
header.top::before { border-bottom: 4px solid #7FB2C9; }
footer.site-foot::before { border-top: 4px solid #7FB2C9; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; padding: 18px 0 22px; }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 7px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
/* Temporary wordmark. System fonts only, so it looks the same in exports and PDFs with nothing to load. */
.logo { font-family: "Segoe UI Black", "Arial Black", system-ui, sans-serif; font-weight: 900; font-size: 28px; line-height: 1; letter-spacing: -.035em; word-spacing: .02em; white-space: nowrap; }
.logo b { font-weight: inherit; color: var(--accent); }
.logo-module { padding-left: 1px; font-size: 12.5px; font-weight: 700; line-height: 1; letter-spacing: .2em; color: var(--ink-2); }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Every page shares one width, so the header doesn't shift between pages. Form pages keep their content narrower. */
.wrap.narrow > :not(header):not(footer):not(.title) { width: 100%; max-width: 760px; }
.wrap.medium > :not(header):not(footer):not(.title) { width: 100%; max-width: 960px; }

/* Page title: one compact line, so the page's content starts straight away */
.title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; margin-bottom: 20px; }
.title h1 { font-size: 28px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.period { font-size: 14px; color: var(--ink-2); }
.period .period-label { margin-right: 6px; font-family: var(--f-head); font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--accent); }

/* ---------- Clickable things: outlined (secondary) or solid (primary). On hover, the fill sweeps in from the left. ---------- */
.btn { --fill: var(--accent); --fg-hover: var(--on-accent); position: relative; overflow: hidden; isolation: isolate; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent);
  background: var(--surface); border: 2px solid var(--accent); border-radius: 10px; min-height: 40px; padding: 7px 15px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: color .4s ease, border-color .4s ease; }
.btn::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; z-index: -1; background: var(--fill); transition: width .4s ease; }
.btn:hover::before, .btn:focus-visible::before { width: 100%; }
.btn:hover, .btn:focus-visible { color: var(--fg-hover); }
.btn.primary { --fill: var(--accent-hover); background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { border-color: var(--accent-hover); color: var(--on-accent); }
.btn.danger { --fill: var(--danger); --fg-hover: var(--surface); color: var(--danger); border-color: var(--danger); }

/* Segmented control: the selected option is solid blue */
.seg { display: inline-flex; background: var(--track); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 13px; font-weight: 500; border: 0; background: transparent; color: var(--ink-2); padding: 5px 12px;
  border-radius: 7px; cursor: pointer; transition: background .2s, color .2s; }
.seg button:hover { color: var(--accent); background: var(--accent-soft); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 1px 3px rgba(28, 36, 48, .2); }
.seg button .av { margin-right: 7px; }
.seg button { display: inline-flex; align-items: center; }

/* Fields: visible border, blue on hover/focus */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--field-border); border-radius: 10px;
  padding: 9px 12px; transition: border-color .2s, box-shadow .2s; }
input:not([type=checkbox]):not([type=radio]):hover, select:hover, textarea:hover { border-color: var(--accent-line); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { cursor: pointer; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

/* Suggestion chips you can click to add (blue = clickable) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chips button, a.client-chip { font: inherit; font-size: 13px; color: var(--accent); background: var(--surface); border: 1px solid var(--accent-line);
  border-radius: 8px; padding: 4px 11px; cursor: pointer; text-decoration: none; transition: background .2s, border-color .2s, color .2s; }
.chips button:hover, a.client-chip:hover { color: var(--accent-hover); border-color: var(--accent); background: var(--accent-soft); }
.chips button.opp { background: var(--accent-soft); }
.chips-label { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Labels you can't click: neutral fill, no outline ---------- */
.src, .pill, .badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; font-size: 12px; font-weight: 600;
  padding: 2px 9px; background: var(--track); color: var(--ink-2); white-space: nowrap; }
.src { padding: 0; background: none; font-family: var(--f-body); font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.pill.good { color: var(--good); }

/* Source tags: squared-off, coloured when connected, greyed with an outline when not (List view only). */
.badge { border-radius: 6px; }
.badge.off { background: transparent; color: var(--muted); font-weight: 500; box-shadow: inset 0 0 0 1px var(--field-border); }
.client-grid:not(.list) .badge.off { display: none; }
.badge.ga4 { background: #FCEBD3; color: #7A4A00; }
.badge.gsc { background: #DDEBFA; color: #1D5690; }
.badge.ads { background: #DDF1E3; color: #1F6634; }

/* People: a coloured dot plus their name. Each owner has their own colour (by position in the owner list). */
.person { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.av { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.av.none { background: transparent; box-shadow: inset 0 0 0 1px var(--muted); }

/* Team page: click an owner to change their dot colour */
.dot-pop summary { cursor: pointer; border-radius: 6px; padding: 3px 6px; margin: -3px -6px; transition: background .2s; }
.dot-pop summary:hover, .dot-pop[open] summary { background: var(--accent-soft); }
.dot-pop .av { transition: transform .2s ease; }
.dot-pop summary:hover .av { transform: scale(1.3); }
.dot-pop .pop-body { right: auto; left: 0; width: 196px; }
.dot-label { font-size: 13px; font-weight: 600; color: var(--ink); white-space: normal; }
@media (min-width: 800px) { .table-scroll:has(.team-table) { overflow: visible; } }
.team-table th:not(:last-child), .team-table td:not(:last-child) { text-align: left; }
.team-table th:not(:first-child), .team-table td:not(:first-child) { padding-left: 18px; }
.swatches { display: grid; grid-template-columns: repeat(5, 28px); gap: 7px; }
.swatch { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.swatch:hover { transform: scale(1.12); }
.swatch:active { transform: scale(.94); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .badge.ga4 { background: rgba(249,171,0,.16); color: #F5C46B; }
  :root:where(:not([data-theme="light"])) .badge.gsc { background: rgba(66,133,244,.18); color: #9CC2F5; }
  :root:where(:not([data-theme="light"])) .badge.ads { background: rgba(52,168,83,.18); color: #8BD3A0; }
}
:root[data-theme="dark"] .badge.ga4 { background: rgba(249,171,0,.16); color: #F5C46B; }
:root[data-theme="dark"] .badge.gsc { background: rgba(66,133,244,.18); color: #9CC2F5; }
:root[data-theme="dark"] .badge.ads { background: rgba(52,168,83,.18); color: #8BD3A0; }

/* ---------- Layout: sections, grids, cards ---------- */
section { margin-top: 56px; }
#report > section:first-child { margin-top: 28px; }
section > h2 { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; color: var(--ink); margin: 0 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
section > h2::before { content: ""; width: 24px; height: 4px; background: var(--accent); }
.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 900px) { .g4, .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2, .g32 { grid-template-columns: 1fr; } }
@media (max-width: 440px) { .wrap { padding: 0 16px; } .g4, .g3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 24px 26px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.card .sub { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head .sub { margin-bottom: 0; }
.mt { margin-top: 20px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* ---------- Report: date range bar ---------- */
.rangebar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.rangebar select, .rangebar input[type=date] { font-size: 13.5px; padding: 7px 10px; }
.rangebar .sep { flex: 1; }
.rangebar .custom { display: none; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); }
.rangebar.is-custom .custom { display: inline-flex; }

/* ---------- KPIs and changes ---------- */
.kpi .label { font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
button.kpi { display: block; width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.kpi:hover { border-color: var(--accent); box-shadow: var(--shadow-hover); }
button.kpi:active { scale: .985; }
button.kpi[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 -4px 0 var(--accent); }
button.kpi:focus { outline: none; }
button.kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.kpi[aria-pressed="true"]:focus-visible { outline-offset: 3px; }
.stat-note { margin: 14px 0 0 !important; }
.climb-row .mv b.rate { color: var(--accent); }
.kpi .value { font-family: var(--f-head); font-size: 36px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
.delta { margin-top: 4px; font-size: 13px; color: var(--muted); }
.kpi .delta { margin-top: 8px; }
.delta.up { color: var(--good); }
.delta .arrow { font-size: 10px; margin-right: 3px; }
.delta b { font-weight: 600; }
.delta .was { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-family: var(--f-head); font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }

/* ---------- Line chart: this period solid blue, comparison dashed grey ---------- */
.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .ln-cur { fill: none; stroke: var(--data); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-prev { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .area { fill: var(--data); opacity: .1; transition: opacity .8s ease .6s; }
.chart:not(.on) .area { opacity: 0; }
.chart .xh { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.chart .dot { fill: var(--data); stroke: var(--surface); stroke-width: 2; opacity: 0; }
.chart.hovering .xh, .chart.hovering .dot { opacity: 1; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1.4s cubic-bezier(.4, .1, .2, 1); }
.chart.on .draw { stroke-dashoffset: 0; }

/* Keys under charts */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.legend i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.legend .sw-line { width: 16px; height: 3px; border-radius: 2px; background: var(--data); }
.legend .sw-dash { width: 16px; height: 0; border-top: 2px dashed var(--muted); }
.legend .sw-bar { width: 14px; height: 10px; border-radius: 0 3px 3px 0; background: var(--data); }
.legend .sw-prev { width: 14px; height: 5px; border-radius: 0 2px 2px 0; background: var(--data-prev); }

/* ---------- 12-month columns: older months pale blue, the latest month solid blue ---------- */
.cols { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 18px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.col .bar { width: 100%; max-width: 38px; background: var(--data-prev); border-radius: 4px 4px 0 0; height: 0;
  transition: height .9s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms), background .2s; }
.col.last .bar, .col:hover .bar { background: var(--data); }
.col .lab { font-size: 12px; color: var(--muted); white-space: nowrap; }
.col.last .lab { color: var(--ink); font-weight: 600; }

/* ---------- Horizontal bars: this period solid blue, last period a thin pale bar underneath ---------- */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 36%) minmax(0, 1fr) 116px; align-items: center; gap: 12px; }
.bar-row .name { font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row:hover .name { color: var(--ink); }
.track { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fill { height: 10px; width: 0; background: var(--data); border-radius: 0 4px 4px 0; transition: width .9s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
.fill-prev { height: 5px; width: 0; background: var(--data-prev); border-radius: 0 3px 3px 0; transition: width .9s cubic-bezier(.2, .8, .2, 1) calc(var(--d, 0ms) + 150ms); }
.hit { position: absolute; inset: -8px 0; }
.bar-row .num { display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.bar-row .num .chg-up { color: var(--good); } .bar-row .num .chg-down { color: var(--muted); }
.chg { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 46px; text-align: right; white-space: nowrap; }
.chg.up { color: var(--good); }

/* ---------- Device split ---------- */
.stack { display: flex; gap: 2px; height: 14px; margin: 6px 0 18px; transform: scaleX(0); transform-origin: left; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1) .15s; }
.on .stack { transform: none; }
.stack span { display: block; height: 100%; }
.stack span:first-child { border-radius: 4px 0 0 4px; } .stack span:last-child { border-radius: 0 4px 4px 0; }
.dev-list { display: grid; gap: 10px; }
.dev { display: grid; grid-template-columns: 12px 1fr auto auto; align-items: center; gap: 10px; font-size: 14px; }
.dev .dot { width: 10px; height: 10px; border-radius: 3px; }
.dev .n { font-variant-numeric: tabular-nums; font-weight: 600; }
.dev .p { font-variant-numeric: tabular-nums; color: var(--muted); width: 44px; text-align: right; }

/* ---------- Tables (sortable headers are blue = clickable) ---------- */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: right; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { padding: 10px 0; border-bottom: 1px solid var(--grid); text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
td:first-child { color: var(--ink); padding-right: 12px; word-break: break-word; }
th:not(:first-child), td:not(:first-child) { padding-left: 14px; white-space: nowrap; }
tbody tr:hover td { background: var(--track); }
th button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
th button:hover { color: var(--accent-hover); text-decoration: underline; }
th .ind { font-size: 9px; opacity: 0; transition: opacity .2s, transform .25s; }
th[aria-sort] button { color: var(--ink); } th[aria-sort] .ind { opacity: 1; } th[aria-sort="ascending"] .ind { transform: rotate(180deg); }
.pos-up { color: var(--good); font-size: 12.5px; margin-left: 4px; }
.lbl-s { display: none; }

/* ---------- Search lists (climbers, new searches, opportunities) ---------- */
.climb { display: grid; gap: 12px; }
.climb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.climb-row .q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.climb-row .mv { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; font-size: 13.5px; }
.climb-row .mv b { color: var(--good); font-weight: 650; }

/* ---------- This month's work ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .work-grid { grid-template-columns: 1fr; } }
.work-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.work-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 15px; line-height: 1.45; }
.work-list li::before { content: ""; width: 8px; height: 8px; border-radius: 99px; margin-top: 7px; background: var(--good); }
.work-list.next li::before { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.work-month { font-size: 12.5px; color: var(--muted); margin: -10px 0 14px; }
.work-edit textarea { width: 100%; min-height: 130px; line-height: 1.5; resize: vertical; }
.saved-note { font-size: 13px; color: var(--good); }

/* Team-only panel: amber and dashed, so it can't be mistaken for part of the client's report */
.team-panel { padding: 16px 20px; border: 2px dashed #C98F16; border-radius: var(--r-md); background: color-mix(in srgb, #D49A1F 9%, var(--surface)); }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tp-title { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; }
.tp-title h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.tp-tag { padding: 3px 9px; border-radius: 6px; background: #E8B64C; color: #3A2A00; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tp-note { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }
.tp-body { margin-top: 16px; }

/* ---------- Client list ---------- */
.index-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tool-group { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.sort-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.sort-label select { font-size: 13.5px; padding: 7px 12px; }
.filter { width: min(320px, 100%); }
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
a.client-card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: box-shadow .25s, border-color .25s, translate .25s, background .2s; }
a.client-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-hover); translate: 0 -2px; color: var(--ink); }
.cc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.client-card h3 { font-size: 16px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.client-card .k { font-size: 12.5px; color: var(--muted); }
.client-card .v { font-family: var(--f-head); font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
.client-card .mini-row { display: flex; gap: 24px; }
.client-grid:not(.list) .mini-row .is-off { display: none; }
.client-card .nodata { font-size: 13.5px; color: var(--muted); }
.cc-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px; }
.open { font-size: 13.5px; font-weight: 600; color: var(--accent); white-space: nowrap; transition: color .2s; }
.open .arr { display: inline-block; font-style: normal; transition: transform .25s ease; }
a.client-card:hover .open { color: var(--accent-hover); }
a.client-card:hover .arr { transform: translateX(4px); }
.list-head { display: none; }

/* List view */
.client-grid.list { grid-template-columns: 1fr; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; }
.client-grid.list .list-head, .client-grid.list .client-card { display: grid; grid-template-columns: minmax(0, 1.5fr) 74px minmax(0, 2fr) minmax(0, 2.6fr) 16px; gap: 16px; align-items: center; }
.client-grid.list .list-head { padding: 12px 22px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--grid); }
.lh-stats, .client-grid.list .mini-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.client-grid.list .client-card { border: 0; border-bottom: 1px solid var(--grid); border-radius: 0; box-shadow: none; padding: 14px 22px; translate: none; }
.client-grid.list .client-card:last-child { border-bottom: 0; }
.client-grid.list .client-card:hover { background: var(--accent-soft); box-shadow: none; }
.client-grid.list .client-card h3 { margin: 0; font-size: 15px; }
.client-grid.list .cc-head { display: contents; }
.client-grid.list .person { justify-self: start; }
.client-grid.list .badges { margin: 0; gap: 5px; }
.client-grid.list .badge { padding-left: 7px; padding-right: 7px; }
.client-grid.list .mini-row .k { display: none; }
.client-grid.list .mini-row .v { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.client-grid.list .mini-row .delta { margin-top: 0; font-size: 12.5px; }
.client-grid.list .mini-row > div { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.client-grid.list .cc-foot { display: contents; }
.client-grid.list .open { font-size: 0; justify-self: end; }
.client-grid.list .open::after { content: "›"; font-size: 22px; line-height: 1; }
.client-grid.list .nodata { grid-column: span 1; }
@media (max-width: 700px) {
  .client-grid.list .list-head { display: none; }
  .client-grid.list .client-card { grid-template-columns: 1fr; gap: 8px; }
  .client-grid.list .cc-head { display: flex; }
  .client-grid.list .mini-row .k { display: block; width: 100%; }
  .client-grid.list .open { display: none; }
}

/* ---------- Forms (add / edit client, team) ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.form-grid input:not([type=checkbox]), .form-grid select { width: 100%; align-self: end; font-weight: 400; }
.form-grid label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hint, .req { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 4px; }
.form-alert { border-color: var(--danger); color: var(--danger); margin-bottom: 16px; font-size: 14px; display: grid; gap: 4px; }

/* Enquiry event picker */
.event-list { display: grid; gap: 6px; margin-top: 10px; }
label.event { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 12px;
  border: 1px solid var(--field-border); border-radius: 10px; background: var(--surface); font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
label.event:hover { border-color: var(--accent-line); }
label.event:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.event.muted { opacity: .6; }
label.event code { font-size: 12px; color: var(--muted); }
.ev-n { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; min-width: 48px; text-align: right; }

/* ---------- Team page ---------- */
.flash { margin-bottom: 12px; font-size: 14px; padding: 12px 18px; }
.flash.ok { border-color: var(--good); color: var(--good); }
.flash.error { border-color: var(--danger); color: var(--danger); }
.team-table td { vertical-align: middle; height: 62px; }
/* A real table cell, so an empty one still fills its row. */
td.actions { display: table-cell; text-align: right; }
td.actions > * { margin-left: 6px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }
details.pop { position: relative; display: inline-block; }
details.pop summary { list-style: none; }
details.pop summary::-webkit-details-marker { display: none; }
.pop-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-hover); padding: 14px; display: grid; gap: 10px; width: 260px; text-align: left; }
.pop-body label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.owner-list { display: grid; }
.owner-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--grid); flex-wrap: wrap; }
.owner-row:first-child { padding-top: 0; }
.owner-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; min-width: 0; flex: 1 1 420px; }
.owner-clients { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 8px; }
.sub-inline { font-size: 13.5px; color: var(--muted); margin-left: 6px; }
.add-owner { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.add-owner select, .add-owner input { flex: 1 1 220px; min-width: 0; }

/* ---------- Login ---------- */
.login { background: var(--brand-night); border-top: 4px solid #7FB2C9; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: min(360px, 100%); display: grid; gap: 14px; }
.login label { font-size: 13.5px; color: var(--ink-2); display: grid; gap: 6px; }
.login .err { color: var(--danger); font-size: 13.5px; }

/* ---------- Loading, footer, tooltip ---------- */
.loading { color: var(--muted); padding: 60px 0; text-align: center; font-size: 14px; }
.loading::after { content: ""; display: block; width: 28px; height: 28px; margin: 16px auto 0; border-radius: 50%; border: 2px solid var(--grid); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#tip { position: fixed; pointer-events: none; z-index: 10; background: var(--ink); color: var(--surface); font-size: 13px; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; opacity: 0; transition: opacity .1s; max-width: 260px; }
#tip b { font-weight: 600; }
#tip .row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  th:has(.lbl-s) .lbl { display: none; } .lbl-s { display: inline; }
  th:not(:first-child), td:not(:first-child) { padding-left: 10px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 108px; row-gap: 6px; } .bar-row .name { grid-column: 1 / -1; }
  label.event { grid-template-columns: 20px minmax(0, 1fr) auto; } label.event code { display: none; }
}

/* One height for every button, field and toggle, wherever they sit side by side. */
.btn { min-height: 0; height: 40px; padding-top: 0; padding-bottom: 0; }
input:not([type=checkbox]):not([type=radio]), select, .rangebar select, .rangebar input[type=date] { height: 40px; padding-top: 0; padding-bottom: 0; }
.seg { height: 40px; align-items: stretch; }
.seg button { padding-top: 0; padding-bottom: 0; }

/* ---------- Motion (off for anyone who has reduced motion turned on) ---------- */
/* Everything you can click responds: hover, keyboard focus and a small press. */
button.kpi { transition: border-color .2s, box-shadow .25s, scale .15s ease; }
a { transition: color .2s; }
a.brand { transition: opacity .2s; }
a.brand:hover { opacity: .82; }
.btn { transition: color .4s ease, border-color .4s ease, transform .15s ease; }
.btn:active, .seg button:active, .chips button:active, a.client-chip:active { transform: scale(.97); }
.btn.icon svg { transition: transform .4s ease; }
.btn.icon:hover svg { transform: rotate(20deg); }
.seg button { transition: background .2s, color .2s, transform .15s ease; }
.chips button, a.client-chip { transition: background .2s, border-color .2s, color .2s, transform .15s ease; }
input[type=checkbox] { cursor: pointer; transition: transform .15s ease; }
input[type=checkbox]:hover { transform: scale(1.1); }
input[type=checkbox]:active { transform: scale(.92); }
th button { transition: color .2s; }
td { transition: background .15s; }
.bar-row .name { transition: color .2s; }
a.client-card:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.reveal { opacity: 0; translate: 0 12px; }
.reveal.in { opacity: 1; translate: 0 0; transition: opacity .6s ease var(--d, 0ms), translate .7s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; translate: none; }
  .chart .draw { stroke-dashoffset: 0; }
}
@media print {
  @page { size: A4; margin: 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rangebar, .top-actions, .seg, .share, #tip { display: none !important; }
  html, body { height: auto; background: #fff; }
  .wrap { max-width: none; min-height: 0; display: block; padding: 0; }
  header.top { padding: 14px 16px 18px; margin-bottom: 18px; }
  header.top::before { inset: 0; }
  .site-foot { display: none !important; } /* it can land alone on a final, almost empty page; the header already names Chill */
  .reveal { opacity: 1; translate: none; }
  .chart .draw { stroke-dashoffset: 0; }
  .card { break-inside: avoid; box-shadow: none; }
  section > h2 { break-after: avoid; }
}

/* ---------- Share with the client ---------- */
[hidden] { display: none !important; }
.share { margin: 0 0 22px; }
.share h3 { margin: 0 0 4px; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 14px; }
.share-step h4 { margin: 0 0 4px; font-size: 14px; }
.share-step p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.share-url { display: block; margin: 0 0 10px; font-size: 13px; word-break: break-all; }
.share-msg { margin-top: 12px; font-size: 13.5px; font-weight: 600; }
.share-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; line-height: 1.45; background: #FBEFD3; color: #6B4100; }

/* ---------- Icon button (light/dark) ---------- */
.btn.icon { width: 40px; height: 40px; padding: 0; justify-content: center; }
.client-grid.list .open { border-bottom: 0; }
.btn.icon .i-sun { display: none; }
.btn.icon.is-dark .i-sun { display: block; }
.btn.icon.is-dark .i-moon { display: none; }

/* ---------- Footer: the same on every page ---------- */
footer.site-foot { margin-top: auto; padding: 30px 0 26px; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 16px 32px; flex-wrap: wrap; font-size: 13px; }
.wrap > :has(+ footer.site-foot) { margin-bottom: 64px; }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-name { font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.foot-sub { font-size: 12.5px; }
.foot-meta { display: grid; gap: 4px; text-align: right; }
.foot-links { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; align-items: baseline; }
.foot-links a { font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; padding-bottom: 2px; transition: background-size .3s ease, color .2s; }
.foot-links a:hover { background-size: 100% 2px; }
@media (max-width: 600px) { .foot-meta, .foot-links { text-align: left; justify-content: flex-start; } }
.login footer.site-foot { margin-top: 24px; }

/* ---------- When ads were running ---------- */
:root { --ad-google: #2E8A5F; --ad-meta: #7A5FD0; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --ad-google: #4FBF88; --ad-meta: #A893F0; } }
:root[data-theme="dark"] { --ad-google: #4FBF88; --ad-meta: #A893F0; }
.chart .strip-bg { fill: var(--track); }
.chart .strip-on.g { fill: var(--ad-google); }
.chart .strip-on.m { fill: var(--ad-meta); }
.legend .sw-ad { width: 16px; height: 8px; border-radius: 4px; }
.legend .sw-ad.g { background: var(--ad-google); }
.legend .sw-ad.m { background: var(--ad-meta); }
.admarks { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 38px; }
.admarks i { display: block; height: 4px; border-radius: 2px; background: var(--track); }
.admarks i.g.on { background: var(--ad-google); }
.admarks i.m.on { background: var(--ad-meta); }
.ads-note { margin-top: 16px; display: flex; gap: 14px; align-items: flex-start; border-color: var(--accent-line); background: var(--accent-soft); font-size: 14.5px; line-height: 1.5; }
.ads-note-i { flex: none; width: 22px; height: 22px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; font-family: Georgia, serif; font-style: italic; margin-top: 1px; }
.ads-note-t { font-weight: 650; margin-bottom: 2px; }
.ads-note-s { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* ---------- Google Ads review (team only) ---------- */
dl.snap { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin: 0; }
dl.snap dt { font-size: 12.5px; color: var(--muted); }
dl.snap dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; }
.review-list { display: grid; gap: 12px; margin-top: 16px; }
.review-item { border-left: 4px solid var(--grid); }
.review-item.p-high { border-left-color: #C2410C; } .review-item.p-medium { border-left-color: #D49A1F; }
.review-item.p-low { border-left-color: var(--accent); } .review-item.p-hold { border-left-color: var(--field-border); }
.ri-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ri-head h3 { margin: 0; }
.prio { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.prio.p-high { background: #FDE7DC; color: #9A3412; } .prio.p-medium { background: #FBEFD3; color: #7A4A00; }
.prio.p-low { background: var(--accent-soft); color: var(--accent); } .prio.p-hold { background: var(--track); color: var(--muted); }
.ri-why { margin: 0 0 6px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.ri-action { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
.review-item .btn:disabled { cursor: default; color: var(--good); border-color: var(--good); background: transparent; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .prio.p-high { background: rgba(194,65,12,.22); color: #F8A97E; }
  :root:where(:not([data-theme="light"])) .prio.p-medium { background: rgba(212,154,31,.2); color: #F2C46B; } }
:root[data-theme="dark"] .prio.p-high { background: rgba(194,65,12,.22); color: #F8A97E; }
:root[data-theme="dark"] .prio.p-medium { background: rgba(212,154,31,.2); color: #F2C46B; }
.ri-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ri-btns a.btn { text-decoration: none; }
.review-manual > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.review-manual[open] > summary { margin-bottom: 14px; }
.review-manual .card { box-shadow: none; }
.stats.mt-s { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--grid); }
