/* CRM styles
   The main colour (--navy) frames the work; the highlight (--yellow) only means "act on this now".
   Both are set in Settings → Branding (see app/brand.php). */

:root {
  --navy: #001935;
  --navy-2: #0a2747;
  --navy-3: #18395c;
  --yellow: #ffcc00;
  --yellow-soft: #fff4c2;
  --glass: #b7dbde;
  --glass-2: #dcedef;
  --glass-3: #eef6f7;
  --paper: #f5f8f9;
  --white: #ffffff;
  --ink: #10202f;
  --ink-2: #44566a;
  --ink-3: #6d7e8e;
  --line: #d9e3e7;
  --line-2: #e8eef1;
  --red: #b42318;
  --red-soft: #fdecea;
  --green: #1e7a46;
  --green-soft: #e3f4ea;
  --orange: #b4532a;

  --s-new: #8a6a00;      --s-new-bg: #fff4c2;
  --s-contacted: #1f5f99; --s-contacted-bg: #e2eefa;
  --s-survey: #5b3fa8;   --s-survey-bg: #eeeafa;
  --s-quoted: #a8481c;   --s-quoted-bg: #fcebe2;
  --s-won: #1e7a46;      --s-won-bg: #e3f4ea;
  --s-lost: #5f6b76;     --s-lost-bg: #eceff1;

  --src-website: #2a78d6;
  --src-facebook: #eb6834;
  --src-canvasser: #1baf7a;
  --src-phone: #7a5cc4;
  --src-other: #c98500;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --r: 9px;
  --r-lg: 14px;
  --r-xl: 18px;
  --side: 248px;
  --tab: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variation-settings: "wdth" 100;
}
img { max-width: 100%; }
a { color: var(--s-contacted); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.i { flex: none; display: block; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--yellow); color: var(--on-accent, var(--navy)); padding: 8px 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Frame ---------- */

.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side);
  background: var(--navy); color: var(--on-navy, #cfe0ea);
  display: flex; flex-direction: column; z-index: 20;
}
.brand { display: block; }
.brand img { width: 150px; height: auto; display: block; }
.side-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .me {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r);
  color: var(--on-navy, #cfe0ea); text-decoration: none; font-weight: 500;
}
.side-nav a:hover { background: var(--navy-2); color: var(--white); }
.side-nav a.on { background: var(--navy-3); color: var(--white); box-shadow: inset 3px 0 0 var(--yellow); }
.pill-count {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--yellow); color: var(--on-accent, var(--navy));
  font-size: 12px; font-weight: 700; display: inline-grid; place-items: center;
}
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--navy-3); display: flex; align-items: center; gap: 4px; }
.me { flex: 1; min-width: 0; padding: 8px; }
.me:hover { background: var(--navy-2); }
.me span:last-child { min-width: 0; color: var(--white); font-size: 14px; line-height: 1.25; }
.me small { display: block; color: var(--on-navy-2, #8fa8ba); font-size: 12px; }
.avatar {
  --c: #2f6f8f;
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--c); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; letter-spacing: .02em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.icon-btn {
  border: 0; background: transparent; color: inherit; cursor: pointer;
  width: 38px; height: 38px; border-radius: var(--r); display: grid; place-items: center;
}
.side .icon-btn:hover { background: var(--navy-2); color: #fff; }

.main-wrap { margin-left: var(--side); min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(245, 248, 249, .92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2);
}
.top-brand { display: none; }
.search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 0 12px; color: var(--ink-3);
}
.search:focus-within { border-color: var(--navy-3); }
.search input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 100%; color: var(--ink); }
.add-lead { margin-left: auto; }
.main { padding: 24px 28px 64px; max-width: 1400px; }

.tabbar { display: none; }

/* ---------- Type & headings ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 700; font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
h2.h { font-size: 17px; font-weight: 650; font-variation-settings: "wdth" 106; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-size: 14px; }

/* ---------- Buttons & form controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 9px 14px; border-radius: var(--r); cursor: pointer;
  font-weight: 600; font-size: 14px; text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-3); border-color: var(--navy-3); }
.btn-yellow { background: var(--yellow); border-color: var(--yellow); color: var(--on-accent, var(--navy)); }
.btn-yellow:hover { background: var(--accent-hover, #ffd633); border-color: var(--accent-hover, #e6b800); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--glass-3); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-lg { padding: 13px 18px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { border: 0; background: none; padding: 0; color: var(--s-contacted); cursor: pointer; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger { color: var(--red); }

.field { display: block; margin-bottom: 14px; }
.field > span, .label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, select.input, textarea.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--white); color: var(--ink);
}
.field textarea, textarea.input { resize: vertical; min-height: 80px; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--glass-2); }
.hint { display: block; font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--navy); flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
code, .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  background: var(--glass-3); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px; word-break: break-all;
}
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row code { flex: 1; padding: 8px 10px; }

/* ---------- Surfaces ---------- */

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.panel + .panel { margin-top: 16px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }

.flashes { padding: 16px 28px 0; display: grid; gap: 8px; max-width: 1400px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r); background: var(--green-soft); color: var(--green); font-weight: 500; }
.flash span { flex: 1; color: var(--ink); }
.flash-error { background: var(--red-soft); color: var(--red); }
.flash-warn { background: var(--yellow-soft); color: #8a6a00; }
.flash-x { border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; }

/* ---------- Badges ---------- */

.stage {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--c); background: var(--bg);
}
.stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, currentColor); }
.stage-new { --c: var(--s-new); --bg: var(--s-new-bg); }
.stage-contacted { --c: var(--s-contacted); --bg: var(--s-contacted-bg); }
.stage-survey_booked { --c: var(--s-survey); --bg: var(--s-survey-bg); }
.stage-quoted { --c: var(--s-quoted); --bg: var(--s-quoted-bg); }
.stage-won { --c: var(--s-won); --bg: var(--s-won-bg); }
.stage-lost { --c: var(--s-lost); --bg: var(--s-lost-bg); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--glass-3); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tag-warn { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* ---------- Dashboard ---------- */

.dash { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.dash-col { display: grid; gap: 20px; min-width: 0; }

/* The waiting list: the one loud thing in the app. */
.waiting { background: var(--navy); color: var(--white); border-radius: var(--r-lg); padding: 20px 20px 10px; }
.waiting-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.waiting-head h2 { font-size: 22px; font-weight: 700; font-variation-settings: "wdth" 115; }
.waiting-head h2 b { color: var(--accent-on-dark, var(--yellow)); }
.waiting-head a { color: var(--glass); font-size: 14px; }
.waiting-list { list-style: none; margin: 0; padding: 0; }
.wait {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--navy-3);
}
.wait-bar { align-self: stretch; border-radius: 4px; background: var(--yellow); }
.wait.late .wait-bar { background: #ff8a4c; }
.wait-name { font-weight: 650; font-size: 16px; color: var(--white); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-name:hover { text-decoration: underline; }
.wait-meta { color: var(--on-navy-2, #9fb7c8); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wait-time { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.2; }
.wait-time b { display: block; font-size: 20px; font-weight: 700; font-variation-settings: "wdth" 85; color: var(--accent-on-dark, var(--yellow)); }
.wait.late .wait-time b { color: #ff9d66; }
.wait-time small { color: var(--on-navy-2, #9fb7c8); font-size: 12px; }
.waiting .btn-call { background: var(--yellow); color: var(--on-accent, var(--navy)); border: 0; padding: 10px 14px; }
.waiting-empty { padding: 4px 0 14px; color: var(--on-navy, #cfe0ea); }
.waiting-empty b { color: var(--white); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line-2); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; font-variation-settings: "wdth" 88; letter-spacing: -.01em; line-height: 1.15; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--ink-3); }
.kpi-sub .up { color: var(--green); font-weight: 600; }
.kpi-sub .down { color: var(--red); font-weight: 600; }

.range { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--white); }
.range a { padding: 6px 12px; font-size: 13px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.range a + a { border-left: 1px solid var(--line); }
.range a.on { background: var(--navy); color: var(--white); }

.today-list { list-style: none; margin: 0; padding: 0; }
.today-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.today-item:first-child { border-top: 0; }
.today-time { font-weight: 700; font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 90; font-size: 17px; }
.today-time small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.today-item a { font-weight: 600; text-decoration: none; color: var(--ink); }
.today-item a:hover { text-decoration: underline; }

.funnel { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.funnel li { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.funnel-bar { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 5px; background: var(--c); min-width: 4px; }
.funnel li a { color: var(--ink); text-decoration: none; }
.funnel li a:hover { text-decoration: underline; }

.setup { background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: var(--r-lg); padding: 14px 18px; }
.setup h2 { font-size: 15px; margin-bottom: 6px; }
.setup ul { margin: 0; padding-left: 18px; }
.setup li { margin: 3px 0; }
.setup a { color: var(--navy); font-weight: 500; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--line-2); stroke-width: 1; }
.chart .axis-label { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hit:hover + g rect, .chart g.col:hover rect { opacity: .85; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--navy); color: var(--white);
  font-size: 13px; padding: 8px 10px; border-radius: var(--r); min-width: 140px; transform: translate(-50%, -100%); margin-top: -8px;
  box-shadow: 0 6px 18px rgba(0, 25, 53, .25);
}
.tip[hidden] { display: none; }
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tip div span { display: flex; align-items: center; gap: 6px; color: var(--on-navy, #cfe0ea); }
.tip i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--glass-3); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--glass-3); }
.cell-name { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-name a { font-weight: 600; color: var(--ink); text-decoration: none; }
.cell-name small { display: block; color: var(--ink-3); font-size: 12.5px; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); flex: none; }
.dot-src { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.dot-src::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--ink-3)); }

/* ---------- Leads list ---------- */

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.chip b { font-weight: 500; color: var(--ink-3); }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.chip.on b { color: var(--glass); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--ink-2); }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }
.empty h2 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.lead-cards { display: none; }

/* ---------- Pipeline ---------- */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; scroll-snap-type: x mandatory; }
.col { background: var(--glass-3); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 10px; scroll-snap-align: start; min-height: 220px; }
.col.over { background: var(--glass-2); border-color: var(--glass); }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 10px; }
.col-head h2 { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.col-head h2 .n { color: var(--ink-3); font-weight: 500; }
.col-value { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 8px; min-height: 160px; align-content: start; }
.card {
  display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; text-decoration: none; color: var(--ink); cursor: grab; position: relative;
}
.card:hover { border-color: var(--ink-3); }
.card.dragging { opacity: .45; }
.card.uncalled { border-left: 4px solid var(--yellow); padding-left: 9px; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-name { font-weight: 650; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.card-name:hover { text-decoration: underline; }
.card-value { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.card-meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.card-move { display: none; }

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

.contact-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; margin-bottom: 18px; }
.contact-title { display: flex; align-items: center; gap: 14px; }
.contact-title .avatar { width: 52px; height: 52px; font-size: 18px; }
.contact-title h1 { font-size: 26px; font-weight: 700; font-variation-settings: "wdth" 110; }
.contact-sub { color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.stage-track { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 4px; margin-bottom: 20px; }
.stage-track form { display: contents; }
.stage-step {
  border: 0; padding: 10px 6px 8px; background: var(--white); color: var(--ink-3); font-weight: 600; font-size: 13px;
  border-top: 4px solid var(--line); cursor: pointer; text-align: center; border-radius: 0;
}
.stage-step:hover { color: var(--ink); background: var(--glass-3); }
.stage-step.done { border-top-color: var(--navy-3); color: var(--ink-2); }
.stage-step.current { border-top-color: var(--sc, var(--yellow)); color: var(--ink); background: var(--white); box-shadow: inset 0 -2px 0 var(--sc, var(--yellow)); }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--navy); }
.tab-panel[hidden] { display: none; }
.composer textarea { min-height: 96px; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.templates { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.templates button { font-size: 12.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass-3); cursor: pointer; color: var(--ink-2); }
.templates button:hover { border-color: var(--ink-3); color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line-2); }
.ev { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.ev-ic { width: 32px; height: 32px; border-radius: 50%; background: var(--white); border: 2px solid var(--line); display: grid; place-items: center; color: var(--ink-3); position: relative; }
.ev-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13.5px; }
.ev-head strong { font-weight: 650; }
.ev-time { color: var(--ink-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; }
.ev-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-size: 14px; color: var(--ink); }
.ev-bubble { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; }
.ev.out .ev-bubble { background: var(--glass-3); border-color: var(--glass-2); }
.ev.in .ev-bubble { background: var(--yellow-soft); border-color: var(--yellow-soft); }
.ev.in .ev-ic { border-color: var(--yellow); color: var(--on-accent, var(--navy)); background: var(--yellow); }
.ev.t-note .ev-bubble { background: #fffdf4; }
.ev.quiet .ev-body { color: var(--ink-2); font-size: 13.5px; margin-top: 0; }
.ev.quiet .ev-ic { width: 32px; height: 20px; border: 0; background: transparent; }
.ev.quiet .ev-ic::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ev.quiet .ev-ic svg { display: none; }
.ev-status { font-size: 12px; color: var(--ink-3); }
.ev-status.bad { color: var(--red); }

.side-panel h2 { font-size: 15px; margin-bottom: 10px; }
.dl { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; word-break: break-word; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.mini-row b { font-variant-numeric: tabular-nums; }
.mini-actions { display: flex; gap: 10px; margin-top: 4px; font-size: 13px; }
.mini-actions form { display: inline; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 12px; }

dialog.sheet {
  border: 0; border-radius: var(--r-lg); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  box-shadow: 0 20px 60px rgba(0, 25, 53, .3); color: var(--ink);
}
dialog.sheet::backdrop { background: rgba(0, 25, 53, .45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { font-size: 17px; }
.sheet-body { padding: 18px 20px 8px; }
.sheet-foot { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Calendar ---------- */

.cal-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar h1 { font-size: 24px; font-weight: 700; font-variation-settings: "wdth" 110; margin-right: auto; }
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(110px, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: auto; }
.week-head { position: sticky; top: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: 8px; text-align: center; font-size: 13px; color: var(--ink-2); z-index: 2; }
.week-head b { display: block; font-size: 20px; color: var(--ink); font-variation-settings: "wdth" 90; }
.week-head.today b { background: var(--yellow); color: var(--on-accent, var(--navy)); border-radius: 50%; width: 34px; height: 34px; line-height: 34px; margin: 0 auto; }
.hours { position: relative; }
.hour { height: 56px; border-top: 1px solid var(--line-2); font-size: 11px; color: var(--ink-3); text-align: right; padding: 2px 6px 0 0; }
.day-col { position: relative; border-left: 1px solid var(--line-2); }
.day-col .slot { height: 56px; border-top: 1px solid var(--line-2); }
.day-col.today { background: #fffdf2; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.appt {
  position: absolute; left: 3px; right: 3px; border-radius: 5px; padding: 4px 6px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 14%, white); border-left: 4px solid var(--c);
  font-size: 12px; line-height: 1.3; color: var(--ink); text-decoration: none; z-index: 1;
}
.appt:hover { z-index: 4; box-shadow: 0 4px 12px rgba(0, 25, 53, .18); }
.appt b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.done { opacity: .6; }
.appt.cancelled { opacity: .45; text-decoration: line-through; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.month-dow { padding: 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); background: var(--glass-3); }
.month-day { min-height: 112px; padding: 6px; border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2); font-size: 12.5px; }
.month-day:nth-child(7n + 1) { border-left: 0; }
.month-day.other { background: var(--paper); color: var(--ink-3); }
.month-day.today .mday { background: var(--yellow); color: var(--on-accent, var(--navy)); }
.mday { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 600; }
.m-appt { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, white); border-left: 3px solid var(--c); color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda { display: none; }
.cal-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.cal-key span { display: inline-flex; gap: 6px; align-items: center; }
.cal-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* ---------- Settings ---------- */

.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 80px; }
.settings-nav a { padding: 9px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-weight: 600; }
.settings-nav a:hover { background: var(--white); color: var(--ink); }
.settings-nav a.on { background: var(--white); color: var(--ink); box-shadow: inset 3px 0 0 var(--navy); }
.settings-body { max-width: 860px; display: grid; gap: 16px; min-width: 0; }
.settings-body > * { min-width: 0; }
.settings-body .panel h2 { font-size: 17px; margin-bottom: 4px; }
.settings-body .panel > p { margin: 0 0 16px; color: var(--ink-2); }
.step-list { display: grid; gap: 10px; }
.step { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--white); display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.step.off { background: var(--paper); }
.step.off textarea, .step.off input:not([type=checkbox]), .step.off select { opacity: .6; }
.step-when { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.step-when input[type=number] { width: 70px; }
.step-when select, .step-when input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; margin-top: 4px; }
.vars { font-size: 13px; color: var(--ink-2); }
.vars code { font-size: 12px; margin: 2px 2px 0 0; display: inline-block; cursor: copy; }
.ol { margin: 0; padding-left: 20px; }
.ol li { margin-bottom: 8px; }


/* ---------- Settings: stages, fields, templates, spend, backup, updates ---------- */

.stage-list { display: grid; gap: 8px; }
.stage-row { display: grid; grid-template-columns: auto 40px minmax(0, 1fr) 190px 110px 38px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); }
.stage-row.moved { background: var(--glass-3); }
.stage-move { display: flex; flex-direction: column; }
.stage-move .icon-btn { width: 28px; height: 20px; }
.stage-move .icon-btn:hover { background: var(--glass-3); }
.stage-row .icon-btn { color: var(--ink-3); }
.stage-row .icon-btn:hover { color: var(--red); }
.stage-move .icon-btn:hover { color: var(--ink); }
input.swatch { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); cursor: pointer; }
.stage-kind-fixed { font-size: 13.5px; color: var(--ink-2); padding-left: 4px; }
.stage-count { font-size: 13px; text-align: right; }
.note { background: var(--glass-3); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 16px; margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.note ul { margin: 6px 0 8px; padding-left: 18px; }
.note li { margin: 3px 0; }
.note p { margin: 0; }
.tfoot-row td, .table tfoot td { border-top: 1px solid var(--line); background: var(--glass-3); }
.table-note { margin: 0; padding: 10px 16px 14px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line-2); }
.money-in { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 8px; background: var(--white); }
.money-in:focus-within { border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--glass-2); }
.money-in span { color: var(--ink-3); font-size: 14px; }
.money-in input { border: 0; outline: 0; width: 76px; padding: 7px 0; text-align: right; font-variant-numeric: tabular-nums; background: transparent; }
.spend-grid td { padding: 6px 10px; }
.spend-grid th { white-space: nowrap; }
.version-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; color: var(--green); }
.version-head h2 { color: var(--ink); }
.version-head p { color: var(--ink-2); margin: 4px 0 14px; }
.err div + div { margin-top: 4px; }
.tpl-edit { font-size: 12.5px; align-self: center; margin-left: 4px; }

@media (max-width: 860px) {
  .stage-row { grid-template-columns: auto 40px minmax(0, 1fr) 34px; grid-template-areas: "mv sw lb del" "mv . kd kd" "mv . ct ct"; row-gap: 6px; }
  .stage-row .stage-move { grid-area: mv; }
  .stage-row .swatch { grid-area: sw; }
  .stage-row .stage-label { grid-area: lb; }
  .stage-row .stage-kind { grid-area: kd; }
  .stage-row .stage-count { grid-area: ct; text-align: left; font-size: 12.5px; }
  .stage-row .stage-del { grid-area: del; }
  .stage-row .stage-kind-fixed { padding-left: 2px; }
  .range { display: flex; width: 100%; }
  .range a { flex: 1; text-align: center; white-space: nowrap; padding: 7px 4px; font-size: 12.5px; }
}

/* ---------- Login ---------- */

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); background: var(--white); }
.login-art { background: var(--navy); color: var(--white); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art img { width: 200px; height: auto; position: relative; }
.login-art p { z-index: 1; text-shadow: 0 2px 12px rgba(0,25,53,.6); font-size: 34px; line-height: 1.15; font-weight: 700; font-variation-settings: "wdth" 115; max-width: 14ch; margin: 0; position: relative; }
.login-art .panes { position: absolute; right: -80px; bottom: -60px; width: 420px; height: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px; border: 14px solid var(--yellow); transform: rotate(-6deg); opacity: .9; }
.login-art .panes i { background: linear-gradient(135deg, rgba(var(--glass-rgb, 183, 219, 222), .55), rgba(var(--glass-rgb, 183, 219, 222), .18) 55%, rgba(var(--glass-rgb, 183, 219, 222), .4)); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.login-form h1 { font-size: 26px; margin-bottom: 6px; font-variation-settings: "wdth" 110; }
.login-form > p { color: var(--ink-2); margin: 0 0 24px; }
.login-form .btn { width: 100%; }
.err { background: var(--red-soft); color: var(--red); padding: 10px 12px; border-radius: var(--r); margin-bottom: 14px; font-size: 14px; }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .dash { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line-2); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { font-size: 15.5px; }
  .side { display: none; }
  .main-wrap { margin-left: 0; padding-bottom: calc(var(--tab) + env(safe-area-inset-bottom)); }
  .top { padding: 10px 14px; gap: 10px; }
  .top-brand { display: block; }
  .top-brand img { display: block; border-radius: 6px; }
  .add-lead span { display: none; }
  .add-lead { padding: 9px 10px; }
  .main { padding: 16px 14px 40px; }
  .flashes { padding: 12px 14px 0; }
  .page-head h1 { font-size: 24px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--navy); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--on-navy-2, #9fb7c8); text-decoration: none; font-size: 11px; font-weight: 600; position: relative; }
  .tabbar a.on { color: var(--white); box-shadow: inset 0 3px 0 var(--yellow); }
  .tabbar .pill-count { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }

  .wait { grid-template-columns: 6px minmax(0, 1fr) auto; gap: 10px; }
  .wait .btn-call span { display: none; }
  .wait-time { display: none; }
  .wait-meta .t-mobile { display: inline; color: var(--accent-on-dark, var(--yellow)); font-weight: 600; }
  .waiting-head h2 { font-size: 19px; }

  .table-leads { display: none; }
  .lead-cards { display: grid; gap: 0; }
  .lead-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
  .lead-card:first-child { border-top: 0; }
  .lead-card strong { display: flex; gap: 8px; align-items: center; }
  .lead-card .meta { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); }

  .board { grid-auto-columns: 82vw; }
  .card-move { display: block; margin-top: 8px; width: 100%; padding: 6px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }

  .contact-head { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
  .actions .btn { flex: 1; }
  .stage-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .week { display: none; }
  .month { display: none; }
  .agenda { display: block; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .step { grid-template-columns: 1fr auto; }
  .step-n { display: none; }

  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 28px; min-height: 220px; }
  .login-art p { font-size: 26px; }
  .login-art .panes { width: 170px; height: 220px; right: -50px; bottom: -90px; border-width: 9px; opacity: .55; }
  .login-form { padding: 28px; }
}

@media (min-width: 861px) {
  .wait-meta .t-mobile { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .wait-new { animation: arrive .6s ease-out; }
  @keyframes arrive { from { background: var(--navy-3); } to { background: transparent; } }
}

@media print {
  .side, .top, .tabbar, .actions, .composer { display: none !important; }
  .main-wrap { margin: 0; }
}

/* 2.2: odd-hour warning in the appointment dialogs */
.time-warn { margin: -4px 0 12px; padding: 8px 12px; border-radius: var(--r); background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 600; }

/* 2.3: booking pages */
.stack { display: grid; gap: 0; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--glass-1, #fff); }
.input-prefix span { padding: 0 10px; display: flex; align-items: center; color: var(--ink-3); font-size: 13.5px; background: var(--glass-3); border-right: 1px solid var(--line-2); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.input-prefix input { border: 0 !important; border-radius: 0 !important; flex: 1; min-width: 0; box-shadow: none !important; }
.open-hours { display: grid; gap: 6px; margin-bottom: 8px; }
.hours-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 10px; min-height: 44px; }
.hours-row .input { width: auto; }
.hours-row .off { opacity: .35; pointer-events: none; }
.bq-list { display: grid; gap: 10px; margin: 6px 0 12px; }
.bq { display: flex; gap: 10px; border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 12px 4px 14px; background: var(--glass-1, #fff); }
.bq-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 2fr 1.2fr 1.4fr; gap: 0 12px; }
.bq-main > .field:nth-child(4), .bq-main > .bq-choices { grid-column: 1 / -1; }
.bq-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.bq-tools { display: flex; flex-direction: column; gap: 2px; }
.icon-btn.danger { color: var(--red); }
.tag-ok { background: #e7f6ec; color: #1e7a46; border-color: #bfe3cb; }
.bp-list { list-style: none; margin: 0; padding: 0; }
.bp { padding: 16px 18px; border-top: 1px solid var(--line); }
.bp-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.bp-head b { font-size: 16px; margin-right: 6px; }
.bp-share .field { margin-bottom: 10px; }
.bp-share .copy-row { align-items: flex-start; }
.bp-share .copy-row .input { flex: 1; min-width: 0; }
.input.code, textarea.code { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.color-input, .field input.color-input:not([type=checkbox]) { width: 64px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; cursor: pointer; }
@media (max-width: 720px) {
  .bq-main { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 1fr; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .hours-row .row-gap { flex-wrap: nowrap; }
  .hours-row .input { flex: 1; min-width: 0; }
}
.bq [hidden], .open-hours [hidden] { display: none !important; }

/* 2.4: branding */
.brand img { max-width: 182px; max-height: 84px; width: auto; }
.on-white img { background: #fff; padding: 8px 10px; border-radius: 8px; }
.login-logo { display: block; position: relative; }
.brand-text { display: block; color: #fff; font-weight: 800; font-size: 20px; line-height: 1.15; letter-spacing: -.01em; font-variation-settings: "wdth" 110; text-decoration: none; }
.brand-text small { display: block; color: var(--accent-on-dark, var(--yellow)); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-top: 3px; }
.login-art img { max-width: 220px; max-height: 110px; width: auto; }
.login-art .brand-text { font-size: 28px; position: relative; }
.top-brand img { width: 32px; height: 32px; object-fit: contain; }
.brand-form .logo-box { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.brand-form .logo-box:first-of-type { border-top: 0; }
.logo-prev { height: 96px; border-radius: var(--r-lg); border: 1px dashed var(--line); display: grid; place-items: center; padding: 10px; background: #fff; overflow: hidden; }
.logo-prev.dark { background: var(--navy); border-color: var(--navy); }
.logo-prev img { max-width: 100%; max-height: 76px; }
.logo-prev .muted { font-size: 13px; text-align: center; }
.logo-prev.dark .muted { color: var(--on-navy-2, #9fb7c8); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.preset { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13.5px; }
.preset:hover { border-color: var(--ink-3); }
.preset i { width: 24px; height: 24px; border-radius: 50%; display: block; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.colour-pair { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.colour-pair .field { margin: 0; }
.colour-pair .row-gap input[type=text] { width: 110px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.brand-preview { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: grid; grid-template-columns: 170px 1fr; min-height: 170px; }
.bp-side { background: var(--pv-p); padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.bp-side .bp-logo { color: #fff; font-weight: 800; margin-bottom: 8px; font-size: 15px; }
.bp-side span { display: block; padding: 7px 10px; border-radius: 6px; color: var(--pv-on); font-size: 13.5px; }
.bp-side span.on { background: var(--pv-p3); color: #fff; box-shadow: inset 3px 0 0 var(--pv-a); }
.bp-main { background: var(--pv-paper); padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.bp-main .bp-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bp-btn { display: inline-block; padding: 8px 14px; border-radius: 6px; font-weight: 700; font-size: 13.5px; }
.bp-btn.a { background: var(--pv-a); color: var(--pv-ona); }
.bp-btn.p { background: var(--pv-p); color: #fff; }
.adjust-note { margin: 8px 0 0; }
@media (max-width: 720px) {
  .brand-form .logo-box { grid-template-columns: 1fr; }
  .brand-preview { grid-template-columns: 120px 1fr; }
}

/* =====================================================================
   2.5 design
   One idea: the sidebar is a solid slab of the brand colour and the active
   page is "lit" with the highlight colour. Everything else stays quiet:
   white surfaces, hairlines tinted from the brand, generous spacing.
   ===================================================================== */

:root {
  --tint: color-mix(in srgb, var(--navy) 9%, transparent);
  --shadow-1: 0 1px 2px color-mix(in srgb, var(--navy) 6%, transparent);
  --shadow-2: 0 12px 32px -10px color-mix(in srgb, var(--navy) 28%, transparent), 0 2px 6px color-mix(in srgb, var(--navy) 8%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--navy) 16%, transparent);
}

body { background: var(--paper); }
a { color: color-mix(in srgb, var(--navy) 70%, #2f6fd6); }
:focus-visible { outline: 0; box-shadow: var(--ring), 0 0 0 1px var(--navy); border-radius: var(--r); }

/* ---------- Sidebar ---------- */
.side { width: var(--side); }
.brand-link { display: block; padding: 22px 22px 14px; text-decoration: none; }
.side-nav { flex: 1; padding: 6px 12px 10px; gap: 1px; overflow-y: auto; }
.side-nav a { position: relative; padding: 9px 12px; border-radius: 10px; font-weight: 550; font-size: 14.5px; transition: background .12s; }
.side-nav a .i { opacity: .82; }
.side-nav a:hover { background: color-mix(in srgb, #fff 7%, transparent); }
.side-nav a.on { background: color-mix(in srgb, #fff 11%, transparent); color: #fff; box-shadow: none; }
.side-nav a.on .i { opacity: 1; color: var(--accent-on-dark, var(--yellow)); }
.side-nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.side-sep { height: 1px; margin: 10px 12px; background: color-mix(in srgb, #fff 12%, transparent); }
.side-push { flex: 1; min-height: 12px; }
.side-foot { border-top: 1px solid color-mix(in srgb, #fff 10%, transparent); padding: 12px; }
.me { border-radius: 10px; }

/* ---------- Top bar ---------- */
.top { background: color-mix(in srgb, var(--paper) 86%, transparent); border-bottom-color: transparent; padding: 14px 32px; }
.search { max-width: 560px; border-radius: 12px; border-color: var(--line); background: #fff; min-height: 44px; box-shadow: var(--shadow-1); transition: box-shadow .15s, border-color .15s; }
.search:focus-within { border-color: var(--navy-3); box-shadow: var(--ring); }
.main { padding: 18px 32px 72px; }
.flashes { padding: 12px 32px 0; }

/* ---------- Type ---------- */
.page-head { margin-bottom: 22px; align-items: center; }
.page-head h1 { font-size: 30px; font-weight: 750; font-variation-settings: "wdth" 118; letter-spacing: -.02em; }
.page-head-lg { margin: 8px 0 26px; }
.page-head-lg h1 { font-size: 34px; }
.page-head-lg p { font-size: 15.5px; max-width: 62ch; margin-top: 6px; color: var(--ink-2); }
.panel h2, .settings-body .panel h2 { font-size: 17.5px; font-weight: 700; font-variation-settings: "wdth" 108; letter-spacing: -.005em; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; padding: 10px 16px; font-weight: 650; min-height: 40px; box-shadow: var(--shadow-1); transition: background .12s, border-color .12s, box-shadow .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn-ghost { box-shadow: none; }
.btn-sm { min-height: 34px; padding: 6px 12px; border-radius: 9px; }
.btn-lg { min-height: 48px; padding: 12px 22px; border-radius: 12px; }
.btn-navy:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-yellow { box-shadow: 0 1px 0 color-mix(in srgb, var(--navy) 12%, transparent); }
.icon-btn { border-radius: 9px; }
.icon-btn:hover { background: var(--glass-3); }

/* ---------- Fields ---------- */
.field { margin-bottom: 16px; }
.field > span, .label { font-size: 13.5px; font-weight: 650; color: var(--ink); margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=color]), .field select, .field textarea, select.input, textarea.input {
  border-radius: 10px; padding: 10px 12px; min-height: 44px; border-color: var(--line); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.field input:not([type=checkbox]):not([type=radio]):hover, .field select:hover, .field textarea:hover, .input:hover { border-color: color-mix(in srgb, var(--navy) 28%, #cfd8de); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-3); box-shadow: var(--ring); }
select.input, .field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236d7e8e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; }
.hint { font-size: 13px; line-height: 1.45; margin-top: 6px; }

/* Checkboxes and radios in the brand colour */
.check { align-items: center; gap: 10px; font-size: 14.5px; }
.check input[type=checkbox], .check input[type=radio] {
  appearance: none; -webkit-appearance: none; margin: 0; width: 20px; height: 20px; flex: none; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--navy) 30%, #c3cdd4); background: #fff; display: inline-grid; place-items: center;
  transition: background .12s, border-color .12s;
}
.check input[type=checkbox] { border-radius: 6px; }
.check input[type=radio] { border-radius: 50%; }
.check input:hover { border-color: var(--navy-3); }
.check input:checked { background: var(--navy); border-color: var(--navy); }
.check input[type=checkbox]:checked::after { content: ""; width: 11px; height: 11px; background: #fff; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.check input[type=radio]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.check input:focus-visible { box-shadow: var(--ring); }

/* On/off switch: <label class="switch"><input type="checkbox"><i></i><span>…</span></label> */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; font-weight: 550; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 40px; height: 24px; border-radius: 999px; background: color-mix(in srgb, var(--navy) 18%, #d5dde2); position: relative; flex: none; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + i { background: var(--navy); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: var(--ring); }

/* ---------- Surfaces ---------- */
.panel { border-radius: var(--r-lg); padding: 22px 24px; border-color: var(--line); box-shadow: var(--shadow-1); }
.panel + .panel { margin-top: 18px; }
.panel-flush { padding: 0; }
.panel-head { padding: 16px 22px; border-bottom-color: var(--line-2); }
.tag { border-radius: 999px; padding: 2px 9px; font-weight: 600; font-size: 12px; border: 0; background: var(--glass-3); }
.tag-ok { background: var(--green-soft); color: var(--green); }
.flash { border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-1); }
.note { border-radius: 12px; }
code, .code { border-radius: 6px; }

/* ---------- Tables ---------- */
.table th { background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 16px; }
.table tbody tr.clickable:hover td, tr[data-href]:hover td { background: color-mix(in srgb, var(--navy) 3%, #fff); }

/* ---------- Dialogs ---------- */
dialog.sheet { border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
dialog.sheet::backdrop { background: color-mix(in srgb, var(--navy) 45%, transparent); backdrop-filter: blur(2px); }
.sheet-head { padding: 18px 22px; }
.sheet-body { padding: 20px 22px 8px; }
.sheet-foot { padding: 14px 22px 20px; }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-in .18s ease-out; }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
}

/* ---------- Dashboard & pages ---------- */
.waiting { border-radius: var(--r-xl); padding: 22px 22px 12px; box-shadow: var(--shadow-2); }
.kpis { border-radius: var(--r-lg); box-shadow: var(--shadow-1); border-color: var(--line); }
.kpi { padding: 18px 20px; }
.range { border-radius: 10px; box-shadow: var(--shadow-1); border-color: var(--line); }
.range a { padding: 7px 13px; }
.chip { border-color: var(--line); padding: 7px 13px; }
.col { border-radius: var(--r-lg); background: color-mix(in srgb, var(--navy) 4%, var(--paper)); border-color: var(--line-2); }
.card { border-radius: 11px; border-color: var(--line); box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: color-mix(in srgb, var(--navy) 30%, #cfd8de); box-shadow: var(--shadow-2); }
.stage-step { border-radius: 8px 8px 0 0; }
.week, .month { border-radius: var(--r-lg); box-shadow: var(--shadow-1); border-color: var(--line); }

/* ---------- Settings ---------- */
.settings { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.settings-nav { gap: 2px; top: 86px; }
.settings-nav a { padding: 10px 14px; border-radius: 10px; font-weight: 600; color: var(--ink-2); }
.settings-nav a:hover { background: color-mix(in srgb, var(--navy) 5%, #fff); }
.settings-nav a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-1), inset 3px 0 0 var(--yellow); }
.settings-body { max-width: 900px; gap: 18px; }
.settings-solo { display: block; }
.settings-solo .settings-body { max-width: 1040px; }
.settings-body .panel > p { color: var(--ink-2); }
.step { border-radius: 12px; border-color: var(--line); padding: 14px; }

/* ---------- Mobile "More" menu ---------- */
.tabbar button { border: 0; background: none; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--on-navy-2, #9fb7c8); font-size: 11px; font-weight: 600; }
.tabbar button.on { color: #fff; box-shadow: inset 0 3px 0 var(--yellow); }
dialog.more-sheet { width: min(460px, calc(100vw - 16px)); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 16px; }
.more-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: color-mix(in srgb, var(--navy) 5%, #fff); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 650; text-align: center; }
.more-grid a .i { color: var(--navy); }
.more-grid a.on { background: var(--navy); color: #fff; }
.more-grid a.on .i { color: var(--accent-on-dark, var(--yellow)); }
.more-out { padding: 0 16px 18px; }
.more-out .btn { width: 100%; }
@media (max-width: 860px) {
  .more-sheet { margin: auto auto 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .top { padding: 10px 14px; }
  .main { padding: 14px 14px 40px; }
  .flashes { padding: 12px 14px 0; }
  .page-head h1, .page-head-lg h1 { font-size: 26px; }
  .page-head-lg { margin: 4px 0 18px; }
  .panel { padding: 18px 16px; }
  .settings { gap: 16px; }
  .settings-nav { background: #fff; border-radius: 12px; padding: 4px; box-shadow: var(--shadow-1); }
  .settings-nav a.on { box-shadow: inset 0 -3px 0 var(--yellow); }
}

/* ---------- Booking forms: list ---------- */
.settings-booking .settings-body { max-width: 1180px; }
.bf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.bf-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-1); }
.bf-card.is-off .bf-preview { filter: grayscale(.85); opacity: .7; }
.bf-preview { display: block; padding: 18px 18px 0; background: color-mix(in srgb, var(--bc) 9%, #fff); text-decoration: none; color: var(--ink); }
.bf-mini { background: #fff; border-radius: 12px 12px 0 0; box-shadow: 0 -1px 0 color-mix(in srgb, var(--bc) 14%, transparent), 0 10px 24px -12px color-mix(in srgb, var(--bc) 45%, transparent); padding: 14px 14px 12px; display: grid; grid-template-columns: 1fr 112px 54px; gap: 12px; align-items: start; min-height: 128px; }
.bf-mini-info { min-width: 0; display: grid; gap: 4px; }
.bf-mini-info img { max-height: 22px; max-width: 90px; width: auto; }
.bf-mini-co { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.bf-mini-info strong { font-size: 13px; line-height: 1.25; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bf-mini-info span { font-size: 11px; color: var(--ink-3); }
.bf-mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-top: 6px; }
.bf-mini-cal i { aspect-ratio: 1; border-radius: 50%; background: var(--line-2); }
.bf-mini-cal i.f { background: color-mix(in srgb, var(--bc) 18%, #fff); }
.bf-mini-cal i.s { background: var(--bc); }
.bf-mini-times { display: grid; gap: 5px; padding-top: 6px; }
.bf-mini-times i { height: 14px; border-radius: 4px; border: 1.5px solid var(--bc); }
.bf-mini-times i.s { background: var(--bc); }
.bf-body { padding: 18px 20px 20px; display: grid; gap: 14px; flex: 1; }
.bf-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bf-title h2 { font-size: 19px; font-weight: 750; font-variation-settings: "wdth" 110; }
.bf-title h2 a { color: var(--ink); text-decoration: none; }
.bf-title h2 a:hover { text-decoration: underline; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-3); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.status.on { color: var(--green); }
.status.on::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.bf-facts { margin: -4px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.bf-stats { display: grid; grid-template-columns: auto auto 1fr; gap: 0; border: 1px solid var(--line-2); border-radius: 12px; }
.bf-stats > div { padding: 10px 14px; display: grid; gap: 1px; border-left: 1px solid var(--line-2); min-width: 0; }
.bf-stats > div:first-child { border-left: 0; }
.bf-stats b { font-size: 20px; font-weight: 750; font-variation-settings: "wdth" 90; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bf-stats span { font-size: 12.5px; color: var(--ink-3); }
.bf-people { align-content: center; }
.bf-people > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-av { display: flex; margin-bottom: 3px; }
.stack-av .avatar { box-shadow: 0 0 0 2px #fff; }
.stack-av .avatar + .avatar { margin-left: -6px; }
.bf-link { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 10px; padding: 4px 4px 4px 12px; font-size: 13.5px; color: var(--ink-2); }
.bf-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf-link .btn { min-height: 32px; }
.bf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.bf-actions .btn { flex: 1; }
.bf-new { border: 2px dashed var(--line); border-radius: var(--r-xl); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 32px; min-height: 280px; text-decoration: none; color: var(--ink-2); text-align: center; transition: border-color .12s, background .12s; }
.bf-new:hover { border-color: var(--navy-3); background: #fff; color: var(--ink); }
.bf-new-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; margin-bottom: 6px; }
.bf-new b { font-size: 16px; color: var(--ink); }
.bf-new small { font-size: 13.5px; }
.empty-big { text-align: center; padding: 48px 24px; }
.empty-big h2 { font-size: 22px !important; margin-bottom: 6px; }
.empty-big p { color: var(--ink-2); margin: 0 0 20px; }

/* ---------- Booking forms: editor ---------- */
.crumb { margin: 0 0 4px !important; font-size: 14px !important; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.crumb a:hover { color: var(--ink); }
.bf-editor { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.bf-toc { position: sticky; top: 92px; display: grid; gap: 2px; }
.bf-toc a { padding: 8px 12px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; border-left: 3px solid transparent; }
.bf-toc a:hover { background: #fff; color: var(--ink); }
.bf-toc a.on { color: var(--ink); background: #fff; border-left-color: var(--yellow); box-shadow: var(--shadow-1); }
.bf-form { display: grid; gap: 18px; min-width: 0; }
.bf-form .panel + .panel { margin-top: 0; }
.fs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; scroll-margin-top: 90px; }
.fs-head h2 { margin-bottom: 6px; }
.fs-head p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.fs-body { min-width: 0; }
.fs-stack { grid-template-columns: 1fr; gap: 16px; }
.fs-stack .fs-head p { max-width: 70ch; }
.switch.big { font-size: 16px; font-weight: 700; }
.switch-list { display: grid; gap: 12px; margin: 4px 0 6px; }

.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.person { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; }
.person input { position: absolute; opacity: 0; }
.person-name { display: grid; line-height: 1.25; font-weight: 650; font-size: 14px; min-width: 0; }
.person-name small { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.person-tick { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; }
.person:has(input:checked) { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 4%, #fff); }
.person:has(input:checked) .person-tick { background: var(--navy); border-color: var(--navy); color: #fff; }
.person:has(input:focus-visible) { box-shadow: var(--ring); }

.open-hours { display: grid; gap: 0; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; margin: 0; }
.hours-row { grid-template-columns: 170px 1fr; padding: 8px 14px; min-height: 58px; border-top: 1px solid var(--line-2); background: #fff; }
.hours-row:first-child { border-top: 0; }
.hours-times { display: flex; align-items: center; gap: 10px; }
.hours-times .input { width: 132px; min-height: 40px; }
.hours-closed { display: none; color: var(--ink-3); font-size: 14px; }
.hours-row.closed { background: var(--paper); }
.hours-row.closed .hours-times { display: none; }
.hours-row.closed .hours-closed { display: block; }

.bq-list { gap: 8px; margin: 0 0 12px; }
.bq { display: block; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: box-shadow .12s, border-color .12s; }
.bq.open { border-color: var(--navy-3); box-shadow: var(--shadow-2); }
.bq-sum { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 4px; }
.bq-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; cursor: pointer; padding: 8px 10px; border-radius: 9px; display: grid; gap: 3px; }
.bq-title:hover { background: var(--paper); }
.bq-title b { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); }
.bq-req { color: var(--navy); font-weight: 650; }
.bq-tools { flex-direction: row; }
.bq-main { display: none; padding: 6px 16px 14px; border-top: 1px solid var(--line-2); grid-template-columns: 2fr 1.2fr 1.5fr; gap: 0 14px; padding-top: 16px; }
.bq.open .bq-main { display: grid; }
.bq-checks { gap: 10px 26px; margin: 2px 0 4px; }
.bq-add { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 12px; background: transparent; color: var(--ink-2); font-weight: 650; cursor: pointer; }
.bq-add:hover { border-color: var(--navy-3); color: var(--ink); background: #fff; }

.colour-field { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.bf-swatch { margin-top: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 16px; border-radius: 12px; background: var(--paper); }
.bf-swatch .d { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: color-mix(in srgb, var(--bc) 12%, #fff); color: var(--bc); }
.bf-swatch .d.sel { background: var(--bc); color: var(--bc-on); }
.bf-swatch .t { padding: 8px 16px; border: 1.5px solid var(--bc); border-radius: 8px; color: var(--bc); font-weight: 700; font-size: 14px; margin-left: 8px; background: #fff; }
.bf-swatch .b { padding: 9px 18px; border-radius: 8px; background: var(--bc); color: var(--bc-on); font-weight: 700; font-size: 14px; }

.savebar { position: sticky; bottom: 14px; z-index: 6; display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 12px 14px 12px 20px; background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2); }
.savebar-note { margin-right: auto; color: var(--ink-3); font-size: 14px; }
.bf-delete { margin: 18px 0 0 218px; }
.sheet-wide { width: min(680px, calc(100vw - 24px)); }
.steps-ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; }
.code-box { position: relative; }
.code-box textarea { padding-bottom: 52px; background: var(--paper); }
.code-box .btn { position: absolute; right: 10px; bottom: 10px; }

@media (max-width: 1180px) {
  .bf-editor { grid-template-columns: 1fr; }
  .bf-toc { position: sticky; top: 64px; z-index: 5; display: flex; overflow-x: auto; gap: 4px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); padding: 6px 0; margin: -6px 0 0; }
  .bf-toc a { white-space: nowrap; border-left: 0; }
  .bf-toc a.on { box-shadow: var(--shadow-1), inset 0 -3px 0 var(--yellow); }
  .fs { grid-template-columns: 1fr; gap: 14px; scroll-margin-top: 130px; }
  .bf-delete { margin-left: 0; }
}
@media (max-width: 720px) {
  .bf-grid { grid-template-columns: 1fr; }
  .bf-stats { grid-template-columns: 1fr 1fr; }
  .bf-people { grid-column: 1 / -1; border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .bq-main { grid-template-columns: 1fr; }
  .bq-tools .icon-btn { width: 32px; }
  .hours-row { grid-template-columns: 1fr; gap: 8px; padding: 12px 14px; border-bottom: 0; }
  .hours-times .input { flex: 1; width: auto; }
  .savebar { bottom: calc(var(--tab) + 10px); flex-wrap: wrap; }
  .savebar-note { display: none; }
  .savebar .btn-lg { flex: 1; }
  .bf-mini { grid-template-columns: 1fr 96px; }
  .bf-mini-times { display: none; }
}
.field > .hint, .field > span.hint { font-size: 13px; font-weight: 400; color: var(--ink-3); margin: 6px 0 0; }
.conn { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.conn .status { font-size: 13px; }
@media (max-width: 860px) {
  dialog.more-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
  .settings-team .table th:nth-child(n+3), .settings-team .table td:nth-child(n+3) { display: none; }
}
