/* MyTechie Techies demo. The prototype's src/styles.css ported whole (same variable names), then the demo's own parts at the
   end with the same tokens: sign-in, View as, the More sheet, help, boards, list tools, dialogs, reports. */

:root {
  --band: #231f20; /* logo near-black */
  --band-ink: #ffffff;
  --band-muted: #d6d2d1; /* 11.6:1 on the band */
  --ground: #f2f1ee; /* the sheet: a concrete/stone step, not cream */
  --surface: #ffffff;
  --raised: #f7f6f4;
  --active: #eceae7;
  --border: #e0ddd9;
  --rule: #eae7e3;
  --control: #8a8481;
  --text: #231f20;
  --muted: #555555; /* 7.5:1 on white, 6.6:1 on the sheet */
  --primary: #d3171c; /* brand red darkened: 5.4:1 with white */
  --primary-press: #b51217;
  --primary-ink: #ffffff;
  --pos-bg: #dcf2e3; --pos-ink: #14532d; --pos-dot: #1e8a4c;
  --warn-bg: #fcefc7; --warn-ink: #7a3b05; --warn-dot: #c46a00;
  --neutral-bg: #eceae7; --neutral-ink: #3a3536;
  --gauge-off: #d5d1cd;
  --bubble: #e4e1dc; /* your own words in Ask AI: a step darker than the sheet, 12:1 with the text */
  --radius-sheet: 16px;
  --radius-card: 8px;
  --radius-control: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 24px; color: var(--text);
  background: var(--ground); -webkit-font-smoothing: antialiased; min-height: 100vh;
  font-feature-settings: "calt" 0; /* keep "4x2" as typed, not 4×2 */
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; text-align: inherit; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; flex: none; }
fieldset { border: 0; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--text); outline-offset: 2px; }
.band :focus-visible, .banner.blocked :focus-visible { outline-color: #ffffff; }
.gap-top { margin-top: 16px; }
.far-note { margin: 0 4px 10px; font-size: 15px; line-height: 22px; color: var(--muted); }
.far-note.gap-top { margin-top: 16px; }
.block { display: block; }
.desk-only, .section-head.desk-only, .desk-inline { display: none; }

/* ---------- the frame: brand band with logo and page title ---------- */
.band { background: var(--band); color: var(--band-ink); padding: 14px 16px 30px; }
.band-in { max-width: 1120px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 16px; min-height: 32px; }
.logo-link { display: block; flex: none; border-radius: 4px; }
.band .logo { height: 32px; width: auto; display: block; }
.topnav { display: none; }
.proto { margin-left: auto; font-size: 14px; line-height: 20px; color: var(--band-muted); white-space: nowrap; }
.band h1 { font-size: 26px; line-height: 32px; font-weight: 700; letter-spacing: -0.01em; margin-top: 14px; overflow-wrap: anywhere; }
.band .sub { font-size: 16px; line-height: 24px; color: var(--band-muted); margin-top: 2px; }

/* ---------- the sheet ---------- */
.sheet {
  position: relative; margin-top: -16px; background: var(--ground);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  padding: 16px 16px 100px;
}
.sheet.has-footer { padding-bottom: 112px; }
.sheet.public:not(.has-footer) { padding-bottom: 40px; }
.sheet-in { max-width: 1120px; margin: 0 auto; }
.sheet-in.narrow { max-width: 640px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 4px 10px; }
.section-head:first-child { margin-top: 4px; }
.section-head h2, .section-head h3 { font-size: 20px; line-height: 26px; font-weight: 700; letter-spacing: -0.005em; }
.section-head .aside, .aside { font-size: 15px; line-height: 22px; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.card.pad { padding: 16px; }
.card p + p { margin-top: 0; }

/* grouped rows: a rule between rows, inset to the text, none above the first */
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px 12px 16px; position: relative; width: 100%; }
.row + .row::before, .row + .skill::before, .skill + .row::before, .skill + .skill::before, .prov-more.shown::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--rule);
}
.skill { position: relative; }
a.row, button.row { cursor: pointer; }
a.row:focus-visible, button.row:focus-visible { outline-offset: -3px; border-radius: var(--radius-card); }
.row .main { flex: 1; min-width: 0; display: block; }
.row .title, .title { font-size: 17px; line-height: 24px; font-weight: 600; display: block; }
.row .meta, .meta { font-size: 15px; line-height: 22px; color: var(--muted); }
.row .figure { font-size: 17px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row .figure small { font-size: 15px; font-weight: 400; color: var(--muted); }
.chev { width: 20px; height: 20px; color: #555; }
.open-mark { width: 20px; height: 20px; color: #555; }
.empty { padding: 16px; }
p.empty { color: var(--muted); font-size: 15px; }

/* key-value rows inside a card */
.kv { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; }
.kv dt { font-size: 15px; line-height: 24px; color: var(--muted); }
.kv dd { font-size: 16px; line-height: 24px; min-width: 0; overflow-wrap: anywhere; }

/* soft status pills with a dot */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 9px;
  border-radius: 999px; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; flex: none;
  background: var(--neutral-bg); color: var(--neutral-ink);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--control); flex: none; }
.pill.pos { background: var(--pos-bg); color: var(--pos-ink); }
.pill.pos::before { background: var(--pos-dot); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.warn::before { background: var(--warn-dot); }
.pill.stop { background: var(--text); color: #ffffff; }
.pill.stop::before { background: #ffffff; }
.pill.count { min-width: 40px; justify-content: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px 0 14px;
  border-radius: var(--radius-control); border: 1.5px solid var(--text); background: var(--surface);
  font-size: 17px; line-height: 24px; font-weight: 600; white-space: nowrap; color: var(--text);
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { background: var(--raised); }
.btn.primary {
  width: 100%; height: 56px; background: var(--primary); border-color: var(--primary); color: var(--primary-ink);
  font-size: 18px; padding: 0 20px;
}
.btn.primary:hover { background: var(--primary-press); border-color: var(--primary-press); }
.btn.primary:active { background: var(--primary-press); }
.btn.small { height: 44px; padding: 0 14px 0 12px; font-size: 16px; }
.btn.small svg { width: 18px; height: 18px; }
.btn.dark { background: var(--text); color: #ffffff; }
.btn.dark:hover { background: #3a3536; }
.btn.quiet { width: 100%; border-color: var(--border); color: var(--text); }
.btn.on-dark { background: transparent; color: #ffffff; border-color: #ffffff; height: 44px; flex: none; }
.btn.on-dark:hover { background: #3a3536; }
.link-row {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 10px 4px 0;
  font-size: 16px; line-height: 24px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.link-row svg { width: 18px; height: 18px; }

/* the experience gauge: MyTechie's 0-4 scale as four marks, filled up to the level */
.gauge { display: inline-flex; gap: 3px; flex: none; }
.gauge span { width: 14px; height: 8px; border-radius: 2px; background: var(--gauge-off); }
.gauge span.on { background: var(--text); }

/* rating stars, filled to the rating */
.rating { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 2px; }
.star { position: relative; width: 18px; height: 18px; }
.star svg { width: 18px; height: 18px; }
.star svg path { fill: var(--text); }
.star svg path.star-off { fill: var(--gauge-off); }
.star-on { position: absolute; inset: 0 auto 0 0; overflow: hidden; }

/* initials for people */
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--active); color: var(--text);
  display: grid; place-items: center; font-size: 16px; font-weight: 600; flex: none; letter-spacing: 0.01em;
}

/* ---------- the white bottom menu ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; height: 76px; background: var(--surface);
  border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 2px 10px;
}
/* anything scrolled into view (a focused row, a tapped list row) stops above the bottom menu, not under it */
html { scroll-padding-bottom: 92px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; line-height: 18px; font-weight: 500; color: #555; border-radius: 8px; }
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a[aria-current="page"] { color: var(--primary); font-weight: 700; }

/* ---------- a step flow's footer: Back and Next in place of the menu ---------- */
.stepbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px 16px; }
.stepbar-in { max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; }
.stepbar .btn { width: 100%; }
.stepbar .btn.primary { height: 48px; }

/* ---------- Home ---------- */
.today-card { padding: 16px; }
.figures { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.figures > div + div { border-left: 1px solid var(--border); padding-left: 16px; }
.fig-label { font-size: 15px; line-height: 22px; color: var(--muted); }
.fig-lead { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.fig-side { font-size: 26px; line-height: 40px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.prov-more { display: none; }
.prov-more.shown { display: flex; }
.prov-toggle.open .chev { transform: rotate(90deg); }

/* ---------- Find a techie ---------- */
.job { padding: 14px 16px 16px; }
.job-skill { font-size: 20px; line-height: 28px; font-weight: 700; }
.job-site { display: flex; align-items: center; gap: 6px; font-size: 16px; line-height: 24px; margin-top: 2px; }
.job-site svg { width: 18px; height: 18px; color: #555; }
.job .kv { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
.job .form { display: grid; gap: 14px; }

.match { align-items: center; padding-top: 14px; padding-bottom: 14px; }
.match .main { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; align-items: center; }
.match .name { font-size: 17px; line-height: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .dist { font-size: 17px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.match .lvl { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 22px; color: var(--muted); white-space: nowrap; min-width: 0; overflow: hidden; }
.match .side { font-size: 15px; line-height: 22px; color: var(--muted); text-align: right; white-space: nowrap; }
.match .avail { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.match .avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--control); }
.match .avail.now { color: var(--text); font-weight: 600; }
.match .avail.now::before { background: var(--pos-dot); }
.match .pill { justify-self: start; margin-top: 4px; max-width: 100%; }
.lvl-t, .pill-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match .veh { margin-top: 4px; }

.seg { display: inline-grid; grid-auto-flow: column; border: 1.5px solid var(--text); border-radius: var(--radius-control); overflow: hidden; flex: none; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; font-size: 16px; font-weight: 600; background: var(--surface); color: var(--text); }
.seg button + button { border-left: 1.5px solid var(--text); }
.seg button svg { width: 18px; height: 18px; }
.seg button[aria-pressed="true"] { background: var(--text); color: #ffffff; }
.seg button:focus-visible { outline-offset: -4px; outline-color: var(--primary); }

.map { position: relative; z-index: 0; isolation: isolate; height: 360px; border-radius: var(--radius-card); border: 1px solid var(--border); overflow: hidden; background: #e9e7e3; }
.leaflet-container { font: 14px/20px var(--font); }
.base-tiles { filter: grayscale(1) brightness(1.06) contrast(0.82); }
.leaflet-container a { color: var(--text); }
.leaflet-control-attribution { font-size: 14px; line-height: 20px; }
.leaflet-tooltip { font: 600 14px/20px var(--font); color: var(--text); }
/* The job's pin (2 Dec 2026: "just a black dot, very hard to see"): a big brand-red pin with a white eye, a "Job" tag,
   and a pulse at its point; the same box on Leaflet and on Google's map, its point at (18, 43). */
.pin-site { overflow: visible; }
.pin-site .pin-body {
  position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--primary); border: 3px solid #ffffff; box-shadow: 0 2px 6px rgb(35 31 32 / 0.45);
}
.pin-site .pin-body::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #ffffff; }
.pin-site .pin-tag {
  position: absolute; left: 38px; top: 4px; padding: 1px 8px; border-radius: 999px; border: 2px solid #ffffff;
  background: var(--primary); color: var(--primary-ink); font: 700 13px/18px var(--font); white-space: nowrap;
  box-shadow: 0 1px 4px rgb(35 31 32 / 0.35);
}
.pin-site .pin-pulse {
  position: absolute; left: 6px; top: 31px; width: 24px; height: 24px; border-radius: 50%;
  background: rgb(211 23 28 / 0.4); animation: pin-pulse 1.8s ease-out infinite;
}
@keyframes pin-pulse { from { transform: scale(0.4); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin-site .pin-pulse { animation: none; opacity: 0.6; } }
/* a Find pin's name, on hover and focus: one label for Leaflet and Google's map alike */
.pin-tip {
  display: none; position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 1;
  padding: 5px 10px; border-radius: var(--radius-control); background: var(--surface); color: var(--text);
  font: 600 14px/20px var(--font); white-space: nowrap; box-shadow: 0 2px 10px rgb(35 31 32 / 0.28); pointer-events: none;
}
:is(.pin-site, .pin-match, .pin-dot):is(:hover, :focus-visible) .pin-tip { display: block; }
.pin-site:hover .pin-tag { visibility: hidden; }
.leaflet-marker-icon:is(.pin-site, .pin-match, .pin-dot):is(:hover, :focus-visible, .is-on),
.gpin:is(:hover, :focus-visible, .is-on) { z-index: 2000 !important; }
.leaflet-marker-icon:focus-visible { outline: none; }
.pin-match:focus-visible span, .pin-match.is-on span { background: var(--text); color: #ffffff; box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--text); }
.pin-dot.is-on span, .pin-dot:focus-visible span { outline: 2px solid var(--text); outline-offset: 1px; }
.pin-match span {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: #ffffff; border: 2.5px solid var(--text); color: var(--text);
  font: 700 14px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.pin-match:hover span { background: var(--text); color: #ffffff; }
.pin-dot { cursor: pointer; }
.pin-dot span { display: block; width: 16px; height: 16px; margin: 4px; border-radius: 50%; border: 2px solid #ffffff; box-shadow: 0 0 0 1px rgb(35 31 32 / 0.35); }
.pin-dot:hover span { outline: 2px solid var(--text); outline-offset: 1px; }
/* the same pins on Google's map (ADR 0011): plain boxes laid over it; a demand circle is sized by its box */
.gpin { cursor: default; }
.gpin[role="button"] { cursor: pointer; }
.gpin:focus-visible { outline: none; }
.pin-heat span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 1.5px solid #ffffff; opacity: 0.72; }
/* Find: a techie's card over the map, opened from their pin; the full profile is one more click */
.map-frame { position: relative; }
.map-card {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; max-width: 380px;
  display: grid; gap: 10px; padding: 12px 12px 14px 14px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgb(35 31 32 / 0.25);
}
.map-card[hidden] { display: none; }
.mc-head { display: flex; align-items: flex-start; gap: 10px; }
.mc-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; border: 2px solid var(--text); background: var(--text); color: #ffffff; font-size: 14px; font-weight: 700; }
.mc-dot { width: 16px; height: 16px; margin: 4px 8px; border-radius: 50%; flex: none; }
.mc-who { flex: 1; min-width: 0; }
.mc-who .title { font-size: 17px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.mc-who .meta { font-size: 14px; line-height: 20px; color: var(--muted); }
.mc-close { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -6px -8px 0; border-radius: var(--radius-control); color: var(--muted); }
.mc-close:hover { background: var(--active); color: var(--text); }
.mc-close svg { width: 20px; height: 20px; }
.mc-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; line-height: 22px; color: var(--muted); }
.mc-facts .mc-dist { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-lvl { display: inline-flex; align-items: center; gap: 8px; }
.mc-avail { display: inline-flex; align-items: center; gap: 6px; }
.mc-avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--control); }
.mc-avail.now { color: var(--text); font-weight: 600; }
.mc-avail.now::before { background: var(--pos-dot); }
.mc-open { justify-content: center; }
.mc-open svg { width: 18px; height: 18px; color: currentColor; }
/* on a phone the card would hide most of the map: it sits under it instead */
@media (max-width: 639px) { .map-card { position: static; max-width: none; margin-top: 10px; box-shadow: none; } }
.map-key .legend-pin { width: 14px; height: 14px; flex: none; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--primary); border: 2px solid #ffffff; box-shadow: 0 0 0 1px rgb(35 31 32 / 0.3); }
.map-key .legend-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; border: 2px solid var(--text); color: var(--text); font-size: 12px; font-weight: 700; }
.map-key .map-tip { flex-basis: 100%; }
/* the line under the Job address box: on the map (or about to be), keep going, or why it can't go on */
.addr-status { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; line-height: 20px; color: var(--muted); }
.addr-status:empty { display: none; }
.addr-status svg { width: 16px; height: 16px; margin-top: 2px; }
.addr-status.ok { color: var(--pos-ink); font-weight: 600; }
.addr-status.bad { color: var(--primary); font-weight: 600; }
.input.is-ok { border-color: var(--pos-dot); }
.input[aria-invalid="true"] { border-color: var(--primary); }
/* the address search under the Job address box (ADR 0011) */
.addr-list { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-card); background: #ffffff; overflow: hidden; }
.addr-list button { display: block; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.addr-list li:last-child button { border-bottom: 0; }
.addr-list button:hover, .addr-list button:focus-visible { background: #f3f1ee; }
.addr-list button:focus-visible { outline: 2.5px solid var(--primary); outline-offset: -3px; } /* the arrow keys move through these */
.addr-by { margin: 6px 2px 0; font-size: 13px; line-height: 18px; color: var(--muted); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 4px 0; font-size: 15px; line-height: 22px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend strong { color: var(--text); font-weight: 600; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.heat-legend { gap: 6px 4px; align-items: center; margin: 0 0 12px; }
.heat-legend .legend-dot { width: 16px; height: 16px; }
.heat-legend li:first-child { margin-right: 4px; }
.heat-legend li:last-child { margin-left: 4px; }
.key .key-dot { width: 16px; height: 16px; margin: 0 8px; border-radius: 50%; flex: none; }
.key .key-n {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  border: 2px solid var(--text); font-size: 14px; font-weight: 700;
}

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.label { font-size: 15px; line-height: 22px; color: var(--muted); font-weight: 500; }
legend.label { margin-bottom: 8px; padding: 0; }
.hint { font-size: 14px; line-height: 20px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid var(--control); border-radius: var(--radius-control);
  background-color: var(--surface); font-size: 17px; line-height: 24px; color: var(--text);
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23231f20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 20px 20px;
}
.select:disabled { color: var(--muted); background-color: var(--raised); cursor: not-allowed; }
.btn:disabled, .btn.primary:disabled { background: var(--active); border-color: var(--active); color: var(--muted); cursor: not-allowed; }
.textarea { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; border-color: var(--text); }
.input[type="date"] { appearance: none; -webkit-appearance: none; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: 6px;
  background: var(--active); font-size: 15px; line-height: 22px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip:has(input:checked) { background: var(--text); color: #ffffff; }
.chip:has(input:focus-visible) { outline: 2.5px solid var(--text); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; cursor: pointer; padding: 2px 0; }
.check input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--text); cursor: pointer; }
.error { font-size: 15px; line-height: 22px; color: var(--warn-ink); font-weight: 600; margin-top: 6px; }

/* ---------- banners ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-card); margin-bottom: 16px; font-size: 16px; line-height: 24px; }
.banner p + p { margin-top: 4px; }
.banner.blocked { background: var(--text); color: #ffffff; }
.banner .banner-text { flex: 1; min-width: 0; }
.banner .banner-meta { font-size: 15px; line-height: 22px; color: var(--band-muted); }
.banner.info { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- Techie profile ---------- */
.back { margin: 0 0 16px; }
.back svg { width: 22px; height: 22px; }
.summary { padding: 16px; }
/* the three grades look different on a profile, as the URS asks: Master dark, Qualified a grey strip, Assistant plain */
.grade-strip {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: -16px -16px 14px; padding: 10px 16px;
  border-radius: var(--radius-card) var(--radius-card) 0 0; background: var(--neutral-bg); color: var(--neutral-ink);
  font-size: 15px; line-height: 22px;
}
.grade-strip strong { font-weight: 700; }
.grade-strip.master { background: var(--text); color: #ffffff; }
.grade-strip.assistant, .grade-strip.none { background: none; color: var(--muted); border-bottom: 1px solid var(--rule); }
.free { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.free::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pos-dot); }
.busy { display: inline-flex; align-items: center; gap: 8px; }
.busy::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--control); }
.book { margin-top: 16px; }
.book > .btn { width: 100%; }
.book > .btn + .wa-group + .btn, .book > .btn + .btn { margin-top: 10px; }
.book-note { font-size: 15px; line-height: 22px; color: var(--muted); margin: 8px 4px 0; }
.block-slot { margin-top: 24px; }
.block-slot:empty { display: none; }

.tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.tool { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 6px; background: var(--active); font-size: 15px; line-height: 22px; font-weight: 500; white-space: nowrap; }

.log { padding: 16px; }
.log-figures { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.log-figures > div + div { border-left: 1px solid var(--border); padding-left: 16px; }
.log-label { font-size: 15px; line-height: 22px; color: var(--muted); }
.log-value { font-size: 26px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.log-value small { font-size: 16px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.log-sub { font-size: 16px; line-height: 24px; font-weight: 600; margin: 16px 0 4px; }
.bars { display: grid; gap: 12px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; }
.bar-row .label { font-size: 16px; line-height: 22px; color: var(--text); font-weight: 400; }
.bar-row .val { font-size: 16px; line-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.bar-row .track { grid-column: 1 / -1; height: 4px; }
.bar-row .track span { display: block; height: 4px; border-radius: 2px; background: #b7b1ac; }
.bar-row:first-child .track span { background: var(--text); }
.log .kv { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--rule); grid-template-columns: 120px minmax(0, 1fr); }
.log .kv:empty { display: none; }

/* ---------- Techies list ---------- */
.list-tools { display: grid; gap: 16px; }
.filters { display: grid; gap: 14px; }
.filter-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.list-main .section-head:first-child { margin-top: 24px; }
.person { align-items: flex-start; }
.person .avatar { margin-top: 2px; }
.person .chev { align-self: center; }
.person .pill { margin-top: 6px; max-width: 100%; }

/* ---------- Join MyTechie (the techie's own step flow) ---------- */
.progress { margin: 4px 4px 0; }
.progress-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; line-height: 24px; }
.progress-label strong { font-weight: 700; }
.progress-label span { color: var(--muted); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.steps span { height: 6px; border-radius: 3px; background: var(--gauge-off); }
.steps span.done { background: var(--text); }
.lead { font-size: 16px; line-height: 24px; color: var(--muted); margin: 14px 4px 12px; }
.skill .row { min-height: 60px; }
.set { display: block; font-size: 15px; line-height: 22px; color: var(--muted); }
.set.has { color: var(--text); font-weight: 600; }
.levels { padding: 0 12px 12px; display: grid; gap: 2px; }
.level { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 4px 12px 4px 5px; border-radius: 8px; border: 1.5px solid transparent; cursor: pointer; }
.level .n { width: 36px; height: 34px; border-radius: 6px; border: 1.5px solid var(--control); display: grid; place-items: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.level .w { flex: 1; font-size: 16px; line-height: 24px; }
.level svg { width: 22px; height: 22px; }
.level:hover { background: var(--raised); }
.level:has(input:checked) { background: var(--ground); border-color: var(--text); }
.level:has(input:checked) .n { background: var(--text); border-color: var(--text); color: #ffffff; }
.level:has(input:checked) .w { font-weight: 700; }
.level:has(input:focus-visible) { outline: 2.5px solid var(--text); outline-offset: 1px; }
.opts { padding: 8px; display: grid; gap: 2px; }
.opt { padding-left: 12px; min-height: 48px; }
.cert-row { flex-wrap: wrap; row-gap: 8px; }
.date-field { flex-basis: 100%; padding-left: 34px; }
.proto-note { margin-top: 16px; background: var(--raised); }
.reg-terms { margin-top: 16px; }
.reg-send { width: 100%; margin-top: 16px; }
/* Register your interest: Needed / Optional beside each label, each problem under its own box, the list at the top */
.need-tag { margin-left: 4px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--muted); }
.field-err { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--primary); }
.has-error .input, .has-error .select { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.banner.error { align-items: flex-start; background: #fdecec; color: #7f1013; } /* 7.9:1 */
.err-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.link-btn { justify-self: start; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); text-decoration: underline; text-align: left; cursor: pointer; }
.err-list .link-btn { display: inline; min-height: 0; font-size: inherit; color: inherit; }
.reg .chip { height: 44px; }
.reg-more > summary { padding: 14px 16px; min-height: 48px; font-weight: 600; cursor: pointer; }
.reg-more > .pad { padding-top: 0; }
.report-note { margin-top: 12px; font-size: 15px; line-height: 22px; color: var(--muted); }
/* each report opens with what it found, in a sentence */
.report-lead { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
.report-top { padding: 16px; border-bottom: 1px solid var(--rule); }
.report-by { margin-top: 14px; max-width: 320px; }
.report-gap { margin-top: 12px; }
.card .report-lead + .log-sub { margin-top: 16px; }
.list-main > .report-note { margin: 10px 4px 0; }
.ask-more { display: grid; gap: 10px; margin-top: 12px; }
.done { text-align: left; }
.done h2 { font-size: 22px; line-height: 30px; font-weight: 700; margin: 12px 0 6px; }
.done-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--pos-bg); color: var(--pos-ink); }
.done-mark svg { width: 26px; height: 26px; }

/* ---------- dialog and toast ---------- */
dialog.dlg {
  margin: auto; border: 0; border-radius: 12px; padding: 20px; width: min(440px, calc(100vw - 32px));
  background: var(--surface); color: var(--text);
}
dialog.dlg::backdrop { background: rgb(35 31 32 / 0.6); }
.dlg h2 { font-size: 20px; line-height: 28px; font-weight: 700; }
.dlg-text { font-size: 16px; line-height: 24px; color: var(--muted); margin: 6px 0 16px; }
.dlg-checks { display: grid; gap: 10px; }
.dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.dlg-actions .btn { width: 100%; }
.toast-slot { position: fixed; left: 16px; right: 16px; bottom: 92px; z-index: 1200; display: flex; justify-content: center; pointer-events: none; }
.toast { max-width: 440px; background: var(--text); color: #ffffff; border-radius: var(--radius-card); padding: 12px 16px; font-size: 16px; line-height: 24px; font-weight: 500; animation: toast-in 180ms ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* on a phone the columns stack, so a column's first heading follows the block above it */
.home-b > .section-head:first-child, .find-results > .section-head:first-child, .pg-b > .section-head:first-child { margin-top: 24px; }

/* ---------- phone niceties ---------- */
@media (max-width: 380px) {
  .seg button { padding: 0 10px; }
  .filter-pair { grid-template-columns: 1fr; }
}
@media (hover: hover) {
  a.row:hover, button.row:hover { background: var(--raised); }
}

/* ---------- desk screens: the menu moves into the band, two columns ---------- */
@media (min-width: 1024px) {
  /* wide list rows: the status sits on the right instead of under the name */
  .person { align-items: center; }
  .person .avatar { margin-top: 0; }
  .person .main { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: center; }
  .person .main > .title, .person .main > .meta { grid-column: 1; }
  .person .main > .pill { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; justify-self: end; }
  .band { padding: 0 32px 44px; }
  .topbar { height: 72px; gap: 40px; }
  .topnav { display: flex; align-self: stretch; gap: 28px; }
  .topnav a { display: flex; align-items: center; padding-top: 3px; border-bottom: 3px solid transparent; font-size: 16px; font-weight: 600; color: var(--band-muted); }
  .topnav a:hover { color: #ffffff; }
  .topnav a[aria-current="page"] { color: #ffffff; border-bottom-color: var(--primary); }
  .band h1 { font-size: 32px; line-height: 40px; margin-top: 18px; }
  .sheet { padding: 28px 32px 72px; }
  .sheet.has-footer { padding-bottom: 120px; }
  .tabbar { display: none; }
  html { scroll-padding-bottom: 0; }
  .toast-slot { bottom: 32px; }
  .desk-only { display: block; }
  .desk-inline { display: inline; }
  .phone-only { display: none; }

  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .home-b .section-head:first-child { margin-top: 4px; }
  .home-a .section-head.desk-only { display: flex; }
  .prov-toggle { display: none; }
  .prov-more { display: flex; }
  .prov-more::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--rule); }

  /* Find's "What you need" and a profile's left column stay beside the page as it scrolls, and scroll inside
     themselves when taller than the window. Sticky with no height of its own, Find's Grading, Vehicle, Clear all and
     quick searches were out of reach (2 Dec 2026; tools/layout-check.mjs now checks it). The padding keeps focus
     rings inside the scrolling box. */
  .find-job, .pg-a {
    position: sticky; top: 16px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
    overflow-y: auto; scrollbar-width: thin; padding: 4px 6px 6px; margin: -4px -6px 0;
  }

  .find-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .find-results .section-head:first-child { margin-top: 4px; }
  .map { height: 520px; }

  .profile-grid { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .pg-a > .section-head:first-child, .pg-b > .section-head:first-child { margin-top: 0; }

  .list-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0 32px; align-items: start; }
  .list-tools { position: sticky; top: 16px; margin-top: 40px; }
  .filter-pair { grid-template-columns: 1fr; }
  .list-main .section-head:first-child { margin-top: 4px; }
}

/* ---------- Ask AI: one conversation ----------
   The conversation is the page: one reading column, your words in a soft bubble on the right, the answer as text on
   the sheet. Only what has rows and buttons (the techies to pick, a WhatsApp check, a booking) keeps a card. The box
   to type in stays above the bottom menu while the conversation scrolls under it. Red is the mark only. */
.ai-wrap { max-width: 760px; margin: 0 auto; }
.ai-wrap.is-new { padding-top: 4vh; }
.ai-top {
  position: sticky; top: 0; z-index: 4; display: flex; justify-content: flex-end; margin: -8px 0 4px; padding: 6px 0 14px;
  background: linear-gradient(to bottom, var(--ground) 72%, transparent); pointer-events: none;
}
.ai-top > * { pointer-events: auto; }
.ai-top:empty { display: none; }
.ai-new {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); font-size: 15px; line-height: 22px; font-weight: 600;
}
.ai-new svg { width: 18px; height: 18px; }
.ai-new:hover { background: var(--raised); }
.ai-new:disabled { color: var(--muted); cursor: default; }
.ai-mark { display: inline-flex; flex: none; color: var(--primary); }
.ai-mark svg { width: 20px; height: 20px; }
.ai-hello { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 8px 4px; text-align: center; }
.ai-hello .ai-mark svg { width: 32px; height: 32px; }
.ai-hello h2 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ai-chat { display: flex; flex-direction: column; gap: 32px; }
.ai-turn { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 68px; }
.ai-msg { display: flex; flex-direction: column; gap: 12px; min-width: 0; scroll-margin-top: 68px; }
.ai-you-row { display: flex; justify-content: flex-end; }
.ai-you {
  max-width: 85%; padding: 10px 16px; border-radius: 20px 20px 6px 20px; background: var(--bubble);
  font-size: 16px; line-height: 24px; overflow-wrap: anywhere; white-space: pre-wrap;
}
.ai-text, .ai-answer { font-size: 16px; line-height: 26px; overflow-wrap: anywhere; }
.ai-text p + p { margin-top: 8px; }
.ai-heard { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-heard-label { width: 100%; font-size: 14px; line-height: 20px; color: var(--muted); }
.ai-tag {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; line-height: 20px; font-weight: 500;
}
.ai-card { border-radius: 14px; }
.ai-card > :first-child { border-top: 0; }
.ai-rows { border-top: 1px solid var(--rule); }
.ai-label { padding: 12px 16px 2px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); }
.ai-label + .ai-rows { border-top: 0; }
.ai-notes { padding: 12px 16px 14px; border-top: 1px solid var(--rule); }
.ai-msg > .ai-notes { padding: 0; border-top: 0; }
.ai-notes p { font-size: 15px; line-height: 22px; color: var(--muted); }
.ai-notes p + p { margin-top: 6px; }
.ai-notes .ai-warn { color: var(--warn-ink); font-weight: 500; }
.ai-act { padding: 14px 16px 16px; border-top: 1px solid var(--rule); }
.ai-act .btn.primary { white-space: normal; height: auto; min-height: 56px; padding: 10px 20px; text-align: center; }
.ai-done { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--rule); font-weight: 600; color: var(--pos-ink); }
.ai-done svg { width: 20px; height: 20px; flex: none; }
/* requests to start from, and what to say next: quiet chips */
.ai-group { margin: 20px 4px 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); }
.ai-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-chip {
  min-height: 44px; padding: 10px 16px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface);
  font-size: 15px; line-height: 22px; font-weight: 500; text-align: left; transition: background-color 0.15s, border-color 0.15s;
}
.ai-chip:hover { background: var(--raised); border-color: var(--control); }
.ai-chip:active { background: var(--active); }
.ai-chip:focus-visible, .ai-new:focus-visible, .ai-tool:focus-visible, .ai-send:focus-visible { outline: 2.5px solid var(--text); outline-offset: 2px; }
/* under a model answer: Copy */
.ai-tools { display: flex; gap: 4px; margin: -6px 0 0 -10px; }
.ai-tool {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 10px;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted);
}
.ai-tool svg { width: 18px; height: 18px; }
.ai-tool:hover { background: var(--active); color: var(--text); }
/* an answer on its way, a new message arriving, a question that did not go through */
.ai-wait { flex-direction: row; align-items: center; gap: 10px; font-size: 16px; line-height: 24px; color: var(--muted); }
.ai-wait .ai-mark { animation: ai-pulse 1.4s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.88); } 50% { opacity: 1; transform: scale(1.08); } }
.ai-in { animation: ai-in 0.22s ease-out both; }
.ai-msg [data-hold] { display: none; } /* the part of an answer that has not been typed onto the page yet */
@keyframes ai-in { from { opacity: 0; transform: translateY(6px); } }
.ai-error {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 12px 12px 16px; border-radius: 14px;
  background: var(--warn-bg); color: var(--warn-ink); font-size: 15px; line-height: 22px;
}
.ai-error p { flex: 1 1 200px; font-weight: 500; }
/* The dock: the box to type in, on a strip of the sheet's own colour, so the conversation leaves the page under it.
   Where the bottom menu shows (under 1024px) the dock is pinned to the bottom of the screen, above the menu or on
   top of the keyboard (--ai-kb, set by ai.mjs), whatever the length of the conversation. On a desk it follows the
   conversation and stops at the bottom of the window. --ai-dock is its height, also set by ai.mjs. */
.ai-dock {
  position: fixed; left: 0; right: 0; bottom: max(76px, var(--ai-kb, 0px)); z-index: 5; padding: 16px 16px 8px;
  background: linear-gradient(to top, var(--ground) 82%, transparent); pointer-events: none;
}
.ai-dock > * { pointer-events: auto; max-width: 760px; margin-left: auto; margin-right: auto; }
.ai-latest {
  position: absolute; left: 50%; top: -36px; margin-left: -22px; display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 4px 14px rgb(35 31 32 / 0.14);
  animation: ai-in 0.2s ease-out both;
}
.ai-latest[hidden] { display: none; }
.ai-latest svg { width: 20px; height: 20px; }
.ai-latest:hover { background: var(--raised); }
.ai-compose {
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 28px;
  box-shadow: 0 1px 2px rgb(35 31 32 / 0.05), 0 8px 24px rgb(35 31 32 / 0.08); transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-compose:focus-within { border-color: var(--control); box-shadow: 0 0 0 3px rgb(35 31 32 / 0.1), 0 8px 24px rgb(35 31 32 / 0.08); }
.ai-compose textarea {
  flex: 1; min-width: 0; height: 44px; max-height: 160px; padding: 10px 0; border: 0; background: none; resize: none;
  font-size: 16px; line-height: 24px; outline: none; overflow-y: auto;
}
.ai-compose textarea::placeholder { color: var(--muted); opacity: 1; }
.ai-send {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--text); color: #ffffff; transition: background-color 0.15s, transform 0.1s;
}
.ai-send svg { width: 22px; height: 22px; }
.ai-send:hover { background: #3a3536; }
.ai-send:active { transform: scale(0.94); }
.ai-send:disabled { background: var(--gauge-off); cursor: default; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .ai-in, .ai-wait .ai-mark, .ai-latest { animation: none; }
  .ai-chip, .ai-compose, .ai-send { transition: none; }
}
/* a tap answers at once: no grey flash, no wait for a second tap */
.ai-chip, .ai-send, .ai-new, .ai-tool, .ai-latest { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ai-start:empty { display: none; }
.ai-start .ai-chip { width: 100%; border-radius: 16px; }
/* a button reached with the keyboard, and a toast, stop above the dock, not under it */
html:has(.ai-dock) { scroll-padding-bottom: calc(92px + var(--ai-dock, 84px)); }
html:has(.ai-dock) .toasts { bottom: calc(max(76px, var(--ai-kb, 0px)) + var(--ai-dock, 84px) + 8px); }
@media (max-width: 1023px) {
  /* A slim header on Ask AI: the conversation gets the screen. The logo and the buttons stay in one row; the title
     is kept for a screen reader (the bottom menu shows where you are) and the line under it goes. Where there is no
     demo row, Report a problem joins the top row. */
  #app-view[data-view="ai"] .band { padding: 8px 16px 24px; }
  #app-view[data-view="ai"] .band h1 { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #app-view[data-view="ai"] .band .sub { display: none; }
  html:not(.demo) #app-view[data-view="ai"] .band-in { display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: 6px; }
  html:not(.demo) #app-view[data-view="ai"] .topbar { display: contents; }
  html:not(.demo) #app-view[data-view="ai"] .logo-link { grid-area: 1 / 1; justify-self: start; }
  html:not(.demo) #app-view[data-view="ai"] .band-tools { grid-area: 1 / 2; margin-top: 0; }
  html:not(.demo) #app-view[data-view="ai"] .band-icons { grid-area: 1 / 3; margin-left: 0; }
  .ai-wrap { padding-bottom: var(--ai-dock, 84px); } /* the last message always clears the pinned dock */
  /* a new chat: the greeting sits in the middle of the room between the header and the dock (--ai-room, from ai.mjs) */
  .ai-wrap.is-new { padding-top: 0; }
  .ai-wrap.is-new .ai-chat { min-height: var(--ai-room, 30vh); justify-content: center; }
  /* the requests to start from: one row of cards to swipe, just above the box; they step aside once you type */
  .ai-start {
    display: flex; gap: 8px; max-width: none; margin: 0 -16px; padding: 2px 16px 10px;
    overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-left: 16px; scrollbar-width: none;
  }
  .ai-start::-webkit-scrollbar { display: none; }
  .ai-start > div, .ai-start .ai-chips { display: contents; }
  .ai-start .ai-group { display: none; }
  .ai-start .ai-chip { flex: none; width: min(78vw, 300px); scroll-snap-align: start; }
  .ai-wrap.has-text .ai-start { display: none; }
}
/* a short phone: the greeting gives up its mark and its space, so it still shows whole above the dock */
@media (max-width: 1023px) and (max-height: 700px) {
  .ai-hello .ai-mark { display: none; }
  .ai-hello h2 { font-size: 24px; line-height: 30px; }
}
@media (min-width: 1024px) {
  .ai-wrap.is-new { padding-top: 8vh; }
  .ai-hello h2 { font-size: 34px; line-height: 40px; }
  .ai-dock { position: sticky; left: auto; right: auto; bottom: 0; display: flex; flex-direction: column; margin-top: 24px; padding: 16px 0 24px; }
  .ai-wrap.is-new .ai-dock { position: static; } /* a new chat: the box under the greeting, the requests under the box */
  .ai-dock > * { max-width: none; margin-left: 0; margin-right: 0; }
  .ai-latest { margin-left: -22px; }
  .ai-start { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  html:has(.ai-dock) { scroll-padding-bottom: calc(12px + var(--ai-dock, 100px)); }
  html:has(.ai-dock) .toasts { top: 16px; bottom: auto; } /* the box moves with the conversation here: toasts go to the top */
}

/* ---------- WhatsApp: the job as the techie gets it ----------
   A light green message bubble (the colour people know from WhatsApp, no logo), a link that opens WhatsApp
   with it, then the techie's answer as the team taps it in. */
.wa { padding: 12px 16px 14px; }
.ai-wa .wa + .wa { border-top: 1px solid var(--rule); }
.ai-wa { border-top: 1px solid var(--rule); }
.book .wa { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.wa-to { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.wa-msg {
  max-width: 34em; padding: 10px 12px; border-radius: 4px 12px 12px 12px; background: #dcf8c6; color: #111b21;
  font-size: 15px; line-height: 22px; overflow-wrap: anywhere;
}
.wa-state { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 15px; line-height: 22px; color: var(--muted); }
.wa-state.yes { color: var(--pos-ink); font-weight: 600; }
.wa-state svg { width: 20px; height: 20px; flex: none; }
.wa-open {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px;
  font-size: 15px; font-weight: 600; color: var(--text); text-decoration: underline; text-underline-offset: 3px;
}
/* red stays for the one main button (Said yes: book) and the selected menu item: this link is neutral */
.wa-ask { margin-top: 2px; font-size: 15px; line-height: 22px; color: var(--muted); }
.wa-act { display: flex; gap: 10px; margin-top: 8px; }
.wa-act .btn { height: 48px; font-size: 17px; }
.wa-act .btn.primary { width: auto; flex: 1 1 auto; }
.ai-done.asked { color: var(--warn-ink); }
.ai-done.gone { color: var(--muted); }

/* ======================================================================================================
   The demo's own parts (same tokens). Red stays on the main button and the selected menu item only.
   ====================================================================================================== */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; line-height: 18px; font-weight: 500; color: #555; border-radius: 8px; text-align: center; }
.tabbar button svg { width: 26px; height: 26px; }
.tabbar button[aria-current="page"] { color: var(--primary); font-weight: 700; }
.tabbar.two { grid-template-columns: repeat(2, 1fr); }

/* the band's tools: View as, help, Report a problem, sign out */
.topnav button { display: flex; align-items: center; padding-top: 3px; border-bottom: 3px solid transparent; font-size: 16px; font-weight: 600; color: var(--band-muted); white-space: nowrap; }
.topnav button:hover { color: #ffffff; }
.topnav button[aria-current="page"] { color: #ffffff; border-bottom-color: var(--primary); }
.band-icons { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 8px; color: #ffffff; border: 1.5px solid #5a5455; font-size: 15px; font-weight: 600; white-space: nowrap; }
.icon-btn:hover { background: #3a3536; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .lbl { display: none; }
.band-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.view-as { display: flex; align-items: center; gap: 8px; min-width: 0; }
.view-as label { font-size: 14px; line-height: 20px; color: var(--band-muted); white-space: nowrap; }
.view-as select {
  height: 40px; max-width: 250px; min-width: 0; padding: 0 34px 0 12px; border-radius: 8px; border: 1.5px solid #5a5455; background-color: #2f2a2b; color: #ffffff;
  font: 600 15px/20px var(--font); appearance: none; -webkit-appearance: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px 18px;
}
.role-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; background: #3a3536; color: #ffffff; font-size: 14px; font-weight: 600; white-space: nowrap; }
.band .proto { margin-left: 0; white-space: normal; }
/* phone and tablet: View as and Report a problem share one row, the demo line under them */
@media (max-width: 1023px) {
  .band-tools .view-as { flex: 1 1 0; }
  .band-tools .view-as select { flex: 1 1 auto; }
  .band-tools .proto { flex-basis: 100%; }
}

/* sign-in */
.login-card { padding: 20px 16px; }
.login-card h2 { font-size: 22px; line-height: 30px; font-weight: 700; }
.login-card .form { margin-top: 14px; }
.demo-list .row { text-align: left; }
.form-error, .modal-error { font-size: 15px; line-height: 22px; color: var(--warn-ink); background: var(--warn-bg); border-radius: 8px; padding: 10px 12px; font-weight: 600; }
.form-error p + p, .modal-error p + p { margin-top: 4px; }

/* dialogs: centred on a desk screen, a bottom sheet on a phone; the error sits between the body and the buttons */
dialog.dlg { padding: 0; max-height: min(88vh, 760px); display: none; }
dialog.dlg[open] { display: flex; flex-direction: column; }
dialog.dlg.wide { width: min(640px, calc(100vw - 32px)); }
.dlg form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; flex: 1 1 auto; }
.dlg-head { padding: 20px 20px 0; display: flex; align-items: flex-start; gap: 12px; }
.dlg-head h2 { flex: 1; min-width: 0; }
.dlg-x { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.dlg-x:hover { background: var(--raised); }
.dlg-x svg { width: 20px; height: 20px; }
.dlg-body { padding: 4px 20px 8px; overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.dlg-body .form { gap: 14px; }
.dlg-foot { padding: 12px 20px 20px; border-top: 1px solid var(--rule); display: grid; gap: 12px; background: var(--surface); }
.dlg-foot .dlg-actions { margin-top: 0; }
.dlg-actions.one { grid-template-columns: 1fr; }
.dlg .btn.primary { height: 48px; font-size: 17px; }
@media (max-width: 640px) {
  dialog.dlg, dialog.dlg.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 90vh; }
}

/* toasts (two at most) */
.toasts { position: fixed; left: 16px; right: 16px; bottom: 92px; z-index: 1200; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 32px; } }

/* the More sheet on a phone */
.more-list .row { font-weight: 600; }
.more-list .row svg:first-child { width: 24px; height: 24px; color: var(--muted); }
.more-list .row[aria-current="page"] { color: var(--primary); }

/* list tools: search, filters, count, clear */
.tools-card { padding: 14px 16px 16px; }
.tool-row { display: grid; gap: 12px; }
.tool-row .field { min-width: 0; }
/* phone: the search full width, the filters two by two */
.tool-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tool-row > .field:first-child { grid-column: 1 / -1; }
/* filter selects: a slimmer arrow gap, so a value fits the narrow phone column */
.tools-card .select { padding: 0 34px 0 12px; background-position: right 8px center; }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.count { font-size: 15px; line-height: 22px; color: var(--muted); }
.count strong { color: var(--text); }
.btn.link { height: 40px; border: 0; padding: 0 4px; text-decoration: underline; text-underline-offset: 3px; font-size: 16px; background: none; }
.btn.link:hover { background: none; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.page-actions .btn.primary { width: auto; height: 48px; font-size: 17px; }
.empty-card { padding: 20px 16px; display: grid; gap: 8px; justify-items: start; }
.seg.neutral { border-color: var(--control); }
.seg.neutral button + button { border-color: var(--control); }
.seg.neutral button[aria-pressed="true"] { background: var(--active); color: var(--text); }

/* boards: one column per stage; a phone shows the stages as tabs */
.board { display: grid; gap: 10px; align-items: start; }
.board.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.board.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { background: var(--raised); border: 1px solid var(--border); border-radius: var(--radius-card); min-width: 0; display: flex; flex-direction: column; min-height: 160px; }
.col.drop { outline: 2.5px dashed var(--text); outline-offset: -4px; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--rule); }
.col-head h3 { font-size: 16px; line-height: 22px; font-weight: 700; }
.col-body { display: grid; gap: 8px; padding: 8px; }
.col-empty { padding: 10px 6px; font-size: 14px; line-height: 20px; color: var(--muted); }
.bcard { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px 12px; cursor: pointer; }
.bcard[draggable="true"] { cursor: grab; }
.bcard:hover { border-color: var(--control); }
.bcard .title { font-size: 16px; line-height: 22px; }
.bcard .meta { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.bcard .pill { margin-top: 6px; height: 26px; font-size: 13px; max-width: 100%; }
.stage-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.stage-tabs button { flex: none; height: 40px; padding: 0 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 15px; font-weight: 600; white-space: nowrap; }
.stage-tabs button[aria-pressed="true"] { background: var(--active); border-color: var(--text); }
@media (max-width: 1023px) {
  .board.cols-5, .board.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .board .col:not(.shown) { display: none; }
}
@media (min-width: 1024px) { .stage-tabs { display: none; } }

/* teams and other cards */
.cards { display: grid; gap: 10px; }
.tcard { display: block; width: 100%; text-align: left; padding: 14px 16px; }
.tcard:hover { background: var(--raised); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 6px; background: var(--active); font-size: 14px; font-weight: 500; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) { .cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the profile and team page actions */
.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions .btn { width: 100%; }
.owner-only { font-size: 15px; line-height: 22px; color: var(--muted); padding: 10px 12px; border: 1px dashed var(--control); border-radius: 8px; }
.mini-map { height: 220px; margin-top: 12px; }
.doc-link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.match .team-line { grid-column: 1 / -1; font-size: 15px; line-height: 22px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-group { font-size: 14px; line-height: 20px; color: var(--muted); margin-bottom: 6px; }
.wa-act { flex-wrap: wrap; }
.wa-links { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.wa-copy { min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.qs-label { padding: 10px 16px 2px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); }

/* reports */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; }
.kpi .fig-lead { font-size: 28px; line-height: 36px; }
@media (min-width: 1024px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.twin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tbl-wrap { margin-top: 10px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; table-layout: fixed; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; width: 84px; }
/* a rand amount never breaks across lines: room for 99,999,999 */
.tbl td.n.rand, .tbl th.n.rand { width: 108px; white-space: nowrap; overflow-wrap: normal; }
.gap-list { margin-top: 8px; display: grid; gap: 4px; font-size: 15px; line-height: 22px; }
.settings-tabs { margin-bottom: 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs button { white-space: nowrap; } /* five tabs are wider than a phone: the row slides, the words stay whole */
.rec { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.help-list { display: grid; gap: 8px; margin-top: 4px; }
.help-list p { font-size: 16px; line-height: 24px; }
.help-btns { margin-top: 8px; padding-left: 20px; display: grid; gap: 4px; font-size: 15px; line-height: 22px; color: var(--muted); }
.map-off { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 15px; padding: 16px; text-align: center; }

/* grouped record forms: two fields side by side from 640 px, one above the other on a phone */
.form .tool-row.two { grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 640px) {
  .form .tool-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-row.two > .field:first-child { grid-column: auto; }
}
@media (min-width: 1024px) {
  .band-tools { margin-top: 0; padding: 4px 0 0; }
  .icon-btn .lbl { display: inline; }
  .tool-row > .field:first-child { grid-column: auto; }
  .tool-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tool-row.five { grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); }
  /* six fields: the search on its own row, the five filters wide enough for their values */
  .tool-row.six { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tool-row.six > .field:first-child { grid-column: 1 / -1; }
  .tool-row.three { grid-template-columns: 2fr repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 28px; }
  .topnav { gap: 22px; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
  .topnav { gap: 14px; }
  .topnav button { font-size: 15px; }
  .icon-btn .lbl { display: none; }
}

/* ---------- Ask AI: the model's answers (ADR 0009) ----------
   Text on the sheet, tables in a white box of their own; the answer's last line says where it came from. */
.ai-answer p + p, .ai-answer p + ul, .ai-answer p + ol, .ai-answer ul + p, .ai-answer ol + p, .ai-answer .ai-table + p, .ai-answer .ai-csv + p, .ai-answer p + .ai-table, .ai-answer h3 + p { margin-top: 10px; }
.ai-answer ul, .ai-answer ol { padding-left: 22px; }
.ai-answer li + li { margin-top: 4px; }
.ai-answer h3 { font-size: 17px; line-height: 26px; font-weight: 700; margin-top: 14px; }
.ai-answer code { font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.ai-table { overflow-x: auto; max-width: 100%; margin-top: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.ai-table table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 22px; }
.ai-table th, .ai-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); overflow-wrap: normal; }
.ai-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .ai-table table { font-size: 14px; line-height: 20px; }
  .ai-table th, .ai-table td { padding: 6px; }
}
.ai-table th { background: var(--raised); font-weight: 600; }
.ai-table tr:last-child td { border-bottom: 0; }
.ai-answer .ai-csv { height: 36px; margin-top: 4px; font-size: 15px; }
.ai-answer p.ai-source { margin-top: 12px; font-size: 14px; line-height: 20px; color: var(--muted); }
/* Settings, Ask AI: the knowledge base's status, one fact a line */
.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; font-size: 15px; line-height: 22px; }
.kv-row .k { color: var(--muted); flex: none; }
.kv-row .v { text-align: right; }

/* Demo mode is a per-environment switch (ADR 0007): ui.mjs adds .demo to <html> when config.js says demo: true.
   Everything marked demo-only exists only then; real-only is its opposite. */
html:not(.demo) .demo-only { display: none !important; }
html.demo .real-only { display: none !important; }
