/* Garage door service requests. Mobile first: the base rules are for phones, media queries add room. */

:root {
  --blue: #1d4e89;
  --blue-dark: #163d6c;
  --blue-soft: #e4ecf7;
  --on-blue: #fff; /* text on a blue background */
  --scrim: rgba(20, 28, 40, .6); /* over photos, in both themes */
  --on-scrim: #fff;
  /* Charts (validated for color vision deficiency on these surfaces): one series, a second
     one, the dial's track, and the heat map's steps from none to most */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-track: #cde2fb;
  --heat-0: #eef0f3;
  --heat-1: #cde2fb;
  --heat-2: #9ec5f4;
  --heat-3: #6da7ec;
  --heat-4: #2a78d6;
  --heat-5: #1c5cab;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #1c2330;
  --muted: #5b6474;
  --line: #dde1e7;
  --danger: #c0352b;
  --danger-soft: #fdecea;
  --ok: #1f7a4d;
  --ok-soft: #e1f3e9;
  --on-ok: #fff; /* text on a green background */
  --warn: #9a6200;
  --warn-soft: #fdf2dc;
  --violet: #6741b8;
  --violet-soft: #efe9fb;
  --shadow: 0 1px 2px rgba(20, 28, 40, .06), 0 4px 14px rgba(20, 28, 40, .06);
  --radius: 14px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Dark: chosen (data-theme, from Account for staff pages or Settings for customers' ones), or
   the device's setting unless light was chosen. The two lists must match. */
:root[data-theme=dark] {
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-track: #1d3150;
  --heat-0: #20262f;
  --heat-1: #1c3a63;
  --heat-2: #1c5cab;
  --heat-3: #2a78d6;
  --heat-4: #5598e7;
  --heat-5: #9ec5f4;
  --blue: #6fa5e8;
  --blue-dark: #8db8ee;
  --blue-soft: #1a2a40;
  --on-blue: #0f131a;
  --bg: #0f131a;
  --surface: #171c25;
  --surface-2: #20262f;
  --text: #e7ebf1;
  --muted: #9aa4b3;
  --line: #2b323d;
  --danger: #f07a6c;
  --danger-soft: #3a1f1d;
  --ok: #5ccf94;
  --ok-soft: #173326;
  --on-ok: #0f131a;
  --warn: #f0b94f;
  --warn-soft: #3a3020;
  --violet: #b59cf0;
  --violet-soft: #2a2240;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-track: #1d3150;
    --heat-0: #20262f;
    --heat-1: #1c3a63;
    --heat-2: #1c5cab;
    --heat-3: #2a78d6;
    --heat-4: #5598e7;
    --heat-5: #9ec5f4;
    --blue: #6fa5e8;
    --blue-dark: #8db8ee;
    --blue-soft: #1a2a40;
    --on-blue: #0f131a;
    --bg: #0f131a;
    --surface: #171c25;
    --surface-2: #20262f;
    --text: #e7ebf1;
    --muted: #9aa4b3;
    --line: #2b323d;
    --danger: #f07a6c;
    --danger-soft: #3a1f1d;
    --ok: #5ccf94;
    --ok-soft: #173326;
    --on-ok: #0f131a;
    --warn: #f0b94f;
    --warn-soft: #3a3020;
    --violet: #b59cf0;
    --violet-soft: #2a2240;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
h3 small { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: .35rem; }
p { margin: 0 0 .75rem; }
small { font-size: .82rem; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 5px; font-size: .9em; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow, .narrow { max-width: 760px; }
.main { padding-top: 20px; padding-bottom: 48px; min-height: 60vh; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; gap: 12px; min-height: 58px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 1.05rem; min-width: 0; margin-right: auto; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand .i { color: var(--blue); width: 1.5em; height: 1.5em; }
.brand:hover { text-decoration: none; }
.top-phone { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.topnav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; margin: 0 -8px; padding-bottom: 4px; }
.topnav a, .topnav .linkish { padding: 6px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; font-size: .95rem; }
.topnav a[aria-current] { color: var(--blue); background: var(--blue-soft); }
.topnav a:hover, .topnav .linkish:hover { text-decoration: none; color: var(--text); }
.topnav form { display: flex; }
@media (max-width: 420px) { .topnav a, .topnav .linkish { padding: 6px 7px; font-size: .88rem; } }
.linkish { background: none; border: 0; font: inherit; cursor: pointer; }
@media (min-width: 720px) {
  .topnav { margin: 0; padding: 0; }
}

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-in { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 28px; }

/* Cards, buttons, forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 16px; box-shadow: var(--shadow); min-width: 0; }
@media (min-width: 600px) { .card { padding: 24px; } }
.narrow-card { max-width: 420px; margin: 24px auto; }
.stack { display: grid; gap: 16px; }
.stack-form { margin-bottom: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--blue); color: var(--on-blue); border: 1px solid var(--blue);
  border-radius: var(--radius-sm); padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; text-decoration: none; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--blue); border-color: var(--line); }
.btn-ghost:hover { background: var(--blue-soft); border-color: var(--blue-soft); }
.btn-sm { padding: 6px 12px; min-height: 36px; font-size: .92rem; }
.btn-lg { padding: 12px 26px; font-size: 1.08rem; min-height: 52px; }
.btn-block { width: 100%; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: .75rem; }

.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: .95rem; min-width: 0; }
.field small, .field-label small { font-weight: 400; color: var(--muted); margin-left: .3rem; }
.field-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: .9rem; margin: -6px 0 14px; font-weight: 500; }
.field-error .i { margin-top: .2em; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }
.check small { display: block; color: var(--muted); }
.grid-2 { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: 1fr 1fr; } .city-zip { grid-template-columns: 2fr 1fr; } }
.fine { color: var(--muted); font-size: .88rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flash { display: flex; gap: 10px; align-items: flex-start; background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-sm); padding: 12px 14px; margin: 16px 0 0; font-weight: 500; }
.flash .i { margin-top: .15em; }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.callout { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.callout .i { margin-top: .2em; color: var(--blue); }
.urgent-callout { background: var(--danger-soft); }
.urgent-callout .i { color: var(--danger); }
.callout-card { border-color: var(--ok); margin-bottom: 16px; }
.callout-card h2 .i { color: var(--ok); }
.password { font: 600 1.25rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; overflow-wrap: anywhere; user-select: all; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge .i { width: 1em; height: 1em; }
.badge.urgent, .badge.overdue { background: var(--danger-soft); color: var(--danger); }
.st-new { background: var(--blue); color: var(--on-blue); }
.st-contacted { background: var(--blue-soft); color: var(--blue); }
.st-quoted { background: var(--violet-soft); color: var(--violet); }
.st-scheduled { background: var(--warn-soft); color: var(--warn); }
.st-completed { background: var(--ok-soft); color: var(--ok); }
.st-cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }

/* Customer form */
.intro { margin: 8px 0 20px; }
.lead { font-size: 1.08rem; color: var(--muted); }
.call-us { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 16px; }
.call-us p { margin: 0; flex: 1 1 260px; font-size: 1.05rem; }
.call-us p span { color: var(--muted); }
.btn-call { background: var(--ok); border-color: var(--ok); color: var(--on-ok); min-height: 52px; padding: 12px 22px; font-size: 1.08rem; white-space: nowrap; }
.btn-call:hover { background: var(--ok); border-color: var(--ok); filter: brightness(.92); }
.btn-call .i { width: 1.3em; height: 1.3em; }
@media (max-width: 520px) { .btn-call { width: 100%; } }
.wizard { padding-top: 4px; }
.wizard, .kind-picked, .doors-field, .sales-only { scroll-margin-top: 76px; } /* clear of the sticky top bar */
.wizard fieldset { border: 0; margin: 0; padding: 12px 0 8px; min-width: 0; }
.wizard fieldset + fieldset { border-top: 1px solid var(--line); margin-top: 8px; }
.wizard legend { padding: 0; float: left; width: 100%; }
.wizard legend + * { clear: both; }
.wizard legend h2 { font-size: 1.3rem; margin: 8px 0 14px; }
.wizard legend h2:focus { outline: none; } /* focused by the script when a step opens, for screen readers */

.cards { display: grid; gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 760px) { .cards.themes { grid-template-columns: repeat(3, 1fr); } }
.choice { position: relative; display: block; cursor: pointer; min-width: 0; }
.choice input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.choice-body { display: grid; gap: 2px; height: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 12px 44px; background: var(--surface); position: relative; transition: border-color .12s, background .12s; }
.choice-body::before { content: ""; position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 6px; background: var(--surface); }
.choice input[type=radio] + .choice-body::before { border-radius: 50%; }
.choice input:checked + .choice-body { border-color: var(--blue); background: var(--blue-soft); }
.choice input:checked + .choice-body::before { border-color: var(--blue); background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/14px no-repeat; }
.choice input:focus-visible + .choice-body { outline: 2px solid var(--blue); outline-offset: 2px; }
.choice-body strong { font-weight: 600; }
.choice-body small { color: var(--muted); font-size: .95rem; line-height: 1.4; }
.choice:hover .choice-body { border-color: var(--blue); }
.choice.big .choice-body { padding: 16px 16px 16px 48px; }
.choice.big .choice-body .i { width: 1.6em; height: 1.6em; color: var(--blue); margin-bottom: 4px; }
.choice.big strong { font-size: 1.08rem; }
.choice-urgent input:checked + .choice-body { border-color: var(--danger); background: var(--danger-soft); }
.choice-urgent input:checked + .choice-body::before { border-color: var(--danger); background-color: var(--danger); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; border: 1.5px solid var(--line); border-radius: 99px; padding: 8px 16px; font-weight: 500; background: var(--surface); min-height: 42px; }
.chip input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.step-nav [data-next] .i, .float-next .i { transform: rotate(180deg); }
.float-next { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom));
  border-radius: 99px; padding: 12px 28px; min-height: 52px; font-size: 1.05rem; box-shadow: 0 6px 20px rgba(20, 28, 40, .3); }
.float-next[hidden] { display: none; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 4px 0 8px; counter-reset: s; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 500; text-align: center; position: relative; }
.steps li span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); font-weight: 700; color: var(--muted); }
.steps li.done span, .steps li.current span { border-color: transparent; }
.steps li.done span { background: var(--ok-soft); color: var(--ok); }
.steps li.current { color: var(--text); }
.steps li.current span { background: var(--blue); color: var(--on-blue); }
.steps li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: -1; }
.steps li:first-child::before { display: none; }
.steps { position: relative; z-index: 0; }

.review { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 8px; }
.review dt { color: var(--muted); font-size: .92rem; }
.review dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.review dd a { font-size: .9rem; margin-left: 6px; }
.js .wizard [data-step="4"] .step-nav { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 20px; }
.wizard .fine { margin: 16px 0 0; }

/* Without JavaScript every step shows; with it, one at a time */
html:not(.js) .js-only { display: none !important; }
.js .no-js { display: none; }
.js .wizard .step { display: none; border-top: 0; margin-top: 0; }
.js .wizard .step.active { display: block; }
.js .wizard .topic-group:not(.shown), .js .wizard .sales-only:not(.shown) { display: none; }

/* Repair or new door, once picked: one line with a Change button */
.kind-picked { display: none; align-items: center; gap: 10px; border: 1.5px solid var(--blue); background: var(--blue-soft); border-radius: var(--radius-sm); padding: 8px 8px 8px 14px; margin-bottom: 18px; }
.kind-picked span { display: flex; align-items: center; gap: 8px; margin-right: auto; min-width: 0; }
.kind-picked span:not(.shown) { display: none; }
.kind-picked .i { width: 1.3em; height: 1.3em; color: var(--blue); flex: none; }
.kind-picked .btn { background: var(--surface); }
.kind-picked .btn:hover { border-color: var(--blue); }
.js .kind-collapsed .kind-picked { display: flex; }
.js .kind-collapsed .kind-cards { display: none; }
.js [data-show-for]:not(.shown) { display: none; }

/* Date fields (app.js datePicker): pick from a calendar, no typing */
.date-wrap { position: relative; display: block; }
.field .date-shown { cursor: pointer; caret-color: transparent; padding-right: 40px; background: var(--surface) no-repeat right 12px center / 20px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d8696' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.datepicker { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 296px; padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(20, 28, 40, .2); font-weight: 400; color: var(--text); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.dp-nav { width: 40px; height: 40px; border: 0; border-radius: 8px; background: none; color: var(--blue); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.dp-nav:hover { background: var(--blue-soft); }
.dp-nav:disabled { opacity: .25; cursor: default; background: none; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.day { height: 38px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; }
.day:hover { background: var(--blue-soft); }
.day[aria-current=date] { color: var(--blue); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--blue); }
.day[aria-pressed=true] { background: var(--blue); color: var(--on-blue); font-weight: 700; }
.day:disabled { opacity: .3; cursor: default; background: none; }
.datepicker button:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; }
.dp-foot button { border: 0; border-radius: 8px; background: none; color: var(--blue); font: inherit; font-weight: 600; padding: 8px 10px; cursor: pointer; }
.dp-foot button:hover { background: var(--blue-soft); }
.appt { display: flex; flex-wrap: wrap; gap: 0 8px; } /* day and time side by side when there's room */
.appt .date-wrap { flex: 1 1 150px; }
.appt input[type=time] { flex: 1 1 130px; width: auto; }

.thanks { text-align: center; padding: 36px 20px; margin-top: 12px; }
.thanks-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); margin-bottom: 12px; }
.thanks-icon .i { width: 32px; height: 32px; }
.thanks .callout { text-align: left; max-width: 480px; margin: 0 auto 16px; }
.btn-big { min-height: 52px; padding: 12px 26px; font-size: 1.05rem; }
.review-page form { margin: 0 0 12px; }
.review-page .fine .linkish { color: var(--blue); padding: 0; text-decoration: underline; }
.feedback-form { text-align: left; max-width: 520px; margin: 0 auto 12px; }
.feedback-form .btn { width: 100%; }
.photo-page #photos { display: grid; gap: 8px; }
.photo-page #photos .file-list { margin: 0; }
.ask-photos { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.ask-photos summary { cursor: pointer; font-weight: 600; color: var(--blue); display: inline-flex; align-items: center; gap: 8px; }
.ask-photos summary .i { width: 1.1em; height: 1.1em; }
.ask-photos[open] summary { margin-bottom: 10px; }
.ask-photos form { margin: 0 0 12px; }
.ask-photos textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical; }
.ask-photos .row-actions { margin: 8px 0 0; }
.review-page .callout { margin-top: 20px; }
.review-choices { display: grid; gap: 10px; max-width: 360px; margin: 8px auto 16px; }
.ask-text { margin-top: 10px; }
.ask-text summary { cursor: pointer; color: var(--blue); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.review-box .linkish { color: var(--blue); padding: 0; text-decoration: underline; }

/* Staff: list */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.new-banner { display: flex; gap: 8px; align-items: center; background: var(--blue); color: var(--on-blue); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; }
.new-banner a { color: var(--on-blue); text-decoration: underline; margin-left: auto; }

.filters { display: grid; gap: 0 12px; padding: 16px; margin-bottom: 14px; grid-template-columns: 1fr 1fr; align-items: end; }
.filters .search { grid-column: 1 / -1; }
.filters .field { margin-bottom: 10px; font-size: .85rem; }
.filters .field select, .filters .field input { margin-top: 4px; min-height: 40px; padding: 7px 10px; }
.filters .btn { margin-bottom: 10px; }
.custom-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; grid-column: 1 / -1; }
.search { position: relative; display: block; margin-bottom: 12px; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 10px 40px; min-height: 46px; }
.search input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
@media (min-width: 900px) {
  .filters { grid-template-columns: 2fr repeat(4, 1fr) auto; }
  .filters .search { grid-column: auto; margin-bottom: 10px; }
  .custom-dates { grid-column: 2 / 4; grid-row: 2; }
}
.js .filters > .btn { display: none; }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 10px; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a[aria-current] { color: var(--blue); border-color: var(--blue); }
.tabs .count { font-size: .78rem; background: var(--surface-2); border-radius: 99px; padding: 0 7px; color: var(--muted); }
.seg { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 8px; background: var(--surface-2); border-radius: 99px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; color: var(--muted); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg .count { font-size: .78rem; color: var(--muted); }
.seg .has-overdue .count { color: var(--danger); }
.req-list .req-group { padding: 14px 18px 6px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.h-sub { display: block; font-size: 1rem; font-weight: 600; color: var(--muted); margin-top: 2px; }
.day-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.day-nav form { flex: 0 1 200px; }
.day-nav .field { margin: 0; }
.day-nav .field input { margin-top: 0; min-height: 36px; padding: 6px 10px; }
.day-nav .next .i { transform: scaleX(-1); }
.job-day { padding: 0; overflow: hidden; margin-bottom: 14px; }
.job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; padding: 16px 18px 12px; }
.job-head h2 { margin: 0; }
.job-head .fine { margin: 2px 0 0; }
.routes { display: flex; gap: 8px; flex-wrap: wrap; }
.stops { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.stops li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 18px; }
.stops li + li { border-top: 1px solid var(--line); }
.stops li.done { color: var(--muted); }
.stop-no { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 99px; background: var(--blue); color: var(--on-blue); font-weight: 700; font-size: .9rem; }
.done .stop-no { background: var(--ok-soft); color: var(--ok); }
.stop-no .i { width: 16px; height: 16px; }
.stop-main { flex: 1; min-width: 0; }
.stop-main p { margin: 0 0 2px; overflow-wrap: anywhere; }
.stop-main a[href^="tel:"] { white-space: nowrap; }
.stop-time { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 700; }
.stop-status { margin-left: auto; }
@media (max-width: 560px) {
  .stops li { padding: 12px 14px; gap: 10px; }
  .routes { width: 100%; }
  .routes .btn { flex: 1 1 auto; }
}
/* Quotes */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.quote-list { list-style: none; margin: 0; padding: 0; }
.quote-list li + li { border-top: 1px solid var(--line); }
.quote-list a { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 10px 0; color: var(--text); }
.quote-list a:hover { text-decoration: none; }
.quote-list a:hover strong { color: var(--blue); }
.quote-list-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.quote-list .badge { margin-left: auto; }
.badge.q-accepted { background: var(--ok-soft); color: var(--ok); }
.badge.q-declined { background: var(--danger-soft); color: var(--danger); }
.badge.q-sent { background: var(--blue-soft); color: var(--blue); }
a.badge:hover { text-decoration: none; }
.quote-doc .quote-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.quote-doc .quote-top p { margin: 0; }
.quote-from { font-size: 1.2rem; font-weight: 700; }
.quote-meta { text-align: right; }
.quote-meta h1 { font-size: 1.3rem; margin: 0 0 2px; }
.quote-for { margin: 0 0 18px; }
.quote-items { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.quote-items th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.quote-items td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.quote-items .num { text-align: right; white-space: nowrap; }
.quote-items th:first-child, .quote-items td:first-child { padding-left: 0; }
.quote-items th:last-child, .quote-items td:last-child { padding-right: 0; }
.quote-items tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; }
.quote-items tfoot .sum-label { text-align: right; color: var(--muted); }
.quote-items .qp-only { display: none; }
.quote-items .quote-total td { font-size: 1.15rem; font-weight: 700; color: var(--text); border-top: 2px solid var(--text); padding-top: 10px; }
.qp-inline { display: none; color: var(--muted); }
.quote-notes { margin: 18px 0 0; white-space: pre-line; color: var(--muted); }
.quote-page { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.quote-page > .callout { margin: 0; }
.callout-ok { background: var(--ok-soft); }
.callout-ok .i { color: var(--ok); }
.quote-answer h2 { margin-top: 0; }
.quote-answer form { margin: 0; }
.decline { margin-top: 14px; }
.decline summary { cursor: pointer; color: var(--muted); text-align: center; padding: 6px; }
.decline[open] summary { margin-bottom: 10px; }
.quote-print { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin: 0; }
@media (max-width: 560px) {
  .quote-items .qp { display: none; }
  .quote-items .qp-only { display: table-cell; }
  .qp-inline { display: block; }
  .quote-meta { text-align: left; }
}
.quote-form h2 { margin-top: 0; }
.quote-lines { display: grid; gap: 8px; margin-bottom: 8px; position: relative; }
.suggest { position: absolute; z-index: 5; list-style: none; margin: 0; padding: 4px; max-height: 300px; overflow-y: auto; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.suggest li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggest li:hover, .suggest li[aria-selected=true] { background: var(--blue-soft); }
.suggest mark { background: none; color: var(--blue); font-weight: 700; }
.suggest-price { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.quote-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 100px 36px; gap: 8px; align-items: center; }
.quote-line .field { margin: 0; }
.quote-line .field input { margin-top: 0; }
.quote-line-head { font-size: .82rem; color: var(--muted); font-weight: 600; }
.quote-line-head span:nth-child(n+2) { text-align: right; }
.quote-amount { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.quote-line [inputmode=decimal] { text-align: right; }
.icon-btn { border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--danger); }
.quote-sums { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; max-width: 280px; margin: 0 0 16px auto; font-variant-numeric: tabular-nums; }
.quote-sums dt { color: var(--muted); text-align: right; }
.quote-sums dd { margin: 0; text-align: right; }
.quote-sums dt:nth-last-child(2), .quote-sums dd:last-child { font-weight: 700; color: var(--text); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.quote-items .paid-row td { color: var(--muted); }
.quote-items .balance-row td { border-top-width: 1px; }
.from-quote { margin-bottom: 16px; }
.from-quote h2 { margin-top: 0; }
.use-quote { color: var(--blue); font-weight: 600; white-space: nowrap; }
.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; }
.pay-list li + li { border-top: 1px solid var(--line); }
.pay-list form { margin: 0; }
.pay-form .grid-2 { gap: 0 12px; }
.pay-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.pay-card .fine { margin: 0; flex: 1 1 260px; }
#card-payments .facts { margin: 14px 0; }
.copy-box { width: 100%; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; resize: vertical; margin-top: 12px; }
#send hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
#send form { margin: 0 0 6px; }
@media (max-width: 640px) {
  .quote-line-head { display: none; }
  .quote-line { grid-template-columns: 1fr 1fr 36px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .quote-line .field:first-child { grid-column: 1 / -1; }
  .quote-amount { grid-column: 1 / 3; grid-row: 3; text-align: left; }
  .quote-line .icon-btn { grid-column: 3; grid-row: 2; }
}
@media print {
  /* Paper is always light: the light tokens again, over the dark ones (hence html: to outrank them) */
  html:root, html:root:not([data-theme=light]) { --bg: #ffffff; --surface: #ffffff; --surface-2: #eef0f3; --text: #1c2330; --muted: #5b6474; --line: #dde1e7; }
  .topbar, .footer, .no-print, .crumbs { display: none !important; }
  body { background: var(--bg); color: var(--text); }
  .quote-page .card { box-shadow: none; border: 0; padding: 0; background: none; }
}
.cal-feed { margin-top: 14px; }
.cal-feed h3 { font-size: 1rem; margin: 0 0 8px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.copy-row label { flex: 1; min-width: 0; }
.copy-row input { width: 100%; font: inherit; font-size: .85rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
.cal-help { margin-top: 16px; }
.cal-help summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.cal-help ul { margin: 8px 0 0; padding-left: 1.2rem; display: grid; gap: 6px; }
.cal-reset { margin-top: 14px; }
.cal-reset .fine { margin: 0 0 8px; }
.result-line { color: var(--muted); font-size: .9rem; }

.req-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.req-list li + li { border-top: 1px solid var(--line); }
.req { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; color: var(--text); }
.req:hover { background: var(--surface-2); text-decoration: none; }
.req > span { min-width: 0; display: flex; flex-direction: column; }
.req small { color: var(--muted); }
.req-id { order: 1; grid-column: 2; text-align: right; font-weight: 600; color: var(--muted); font-size: .9rem; }
.req-who { order: 0; grid-column: 1; grid-row: 1; }
.req-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-what { order: 2; grid-column: 1 / -1; flex-direction: row !important; gap: 6px; align-items: baseline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.req-when { order: 3; flex-direction: row !important; gap: 8px; align-items: center; flex-wrap: wrap; }
.req-when small .i { width: 1em; height: 1em; }
.req-status { order: 4; align-items: flex-end; flex-direction: row !important; gap: 8px; justify-content: flex-end; }
.kind { color: var(--muted); margin-right: 6px; }
.kind .i { width: 1em; height: 1em; }
.is-new .req-who strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 7px; vertical-align: .12em; }
@media (min-width: 900px) {
  .req { grid-template-columns: 110px minmax(150px, 1.2fr) 2fr minmax(150px, 1fr) 170px; align-items: center; gap: 16px; padding: 12px 18px; }
  .req > span { order: 0 !important; grid-column: auto !important; grid-row: auto !important; }
  .req-id { text-align: left; }
  .req-when { flex-direction: column !important; align-items: flex-start; gap: 2px; }
  .req-status { flex-direction: column !important; align-items: flex-end; gap: 2px; }
  .req.inv { grid-template-columns: 110px minmax(150px, 1.4fr) 1fr 1fr 150px; }
}
.inv-money { order: 2; font-variant-numeric: tabular-nums; }
.req.inv .req-status { order: 3; } /* on a phone: the amount, then its badge beside it */
.req.inv .req-when { order: 4; }
.danger-text { color: var(--danger); }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); font-size: .9rem; }
.empty { text-align: center; color: var(--muted); padding: 36px 20px; }

/* Staff: one request */
.crumbs { margin: 0 0 8px; font-size: .92rem; }
.request-head { align-items: flex-start; }
.request-head .sub { color: var(--muted); margin: 4px 0 0; }
.head-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.head-badges .badge { font-size: .88rem; padding: 4px 12px; }
.detail-grid { display: grid; gap: 16px; }
.detail-main { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .detail-side { position: sticky; top: 76px; }
}
.contact-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ok { color: var(--ok); font-weight: 600; }
.details { margin: 16px 0 0; padding: 12px 16px; background: var(--surface-2); border-radius: var(--radius-sm); white-space: pre-line; overflow-wrap: anywhere; }
.note-form { margin-bottom: 18px; }
.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.note-actions .fine { flex-basis: 100%; margin: 0; }
.attach { position: relative; }
.attach input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; } /* still reachable by keyboard */
.attach:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.file-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 6px 6px 8px; min-width: 0; }
.file-list img, .file-list .file-icon { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; }
.file-list .file-icon { display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.file-list span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list small { color: var(--muted); white-space: nowrap; }
.file-list button { border: 0; background: none; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; flex: none; }
.file-list button:hover { background: var(--surface); color: var(--danger); }
.photos-field .attach { margin-top: 2px; }
.photos-head { font-size: .95rem; margin: 18px 0 8px; }
.req-photos .photo { position: relative; aspect-ratio: 1; }
.req-photos .photo > a { height: 100%; }
.photo-file { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; color: var(--muted); font-size: .75rem; text-align: center; overflow-wrap: anywhere; }
.photo-remove { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 99px; background: var(--scrim); color: var(--on-scrim); cursor: pointer; }
.photo-remove:hover { background: var(--danger); }
.photo-remove .i { width: 16px; height: 16px; }
.ev-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 8px; max-width: 520px; }
.ev-photos:empty, .ev-docs:empty { display: none; }
.ev-photos a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.ev-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-docs { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.ev-docs a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; overflow-wrap: anywhere; }
.ev-docs small { color: var(--muted); }
.note-form .field { margin-bottom: 8px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.ev { position: relative; padding: 0 0 16px 14px; }
.ev::before { content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.ev-note::before { background: var(--blue); border-color: var(--blue); }
.ev-created::before { background: var(--ok); border-color: var(--ok); }
.ev-review::before { background: var(--warn); border-color: var(--warn); }
.ev-feedback::before { background: var(--violet); border-color: var(--violet); }
.ev-upload::before { background: var(--ok); border-color: var(--ok); }
.ev-quote::before { background: var(--blue); border-color: var(--blue); }
.ev-alert::before { background: var(--danger); border-color: var(--danger); }
.ev-head { font-size: .88rem; color: var(--muted); }
.ev-head strong { color: var(--text); }
.ev-body { white-space: pre-line; overflow-wrap: anywhere; }
.ev:not(.ev-note):not(.ev-created):not(.ev-feedback):not(.ev-upload) .ev-body { color: var(--muted); font-size: .95rem; }
.manage .field { margin-bottom: 12px; }
.open-hours { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.open-hours legend { padding: 0; margin-bottom: 6px; }
.day-checks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.day-check { position: relative; cursor: pointer; }
.day-check input { position: absolute; opacity: 0; inset: 0; }
.day-check span { display: block; min-width: 52px; text-align: center; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500; }
.day-check input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.day-check input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.hours { display: flex; align-items: center; gap: 10px; max-width: 360px; }
.hours input { flex: 1; min-width: 0; }
.review-box { margin-top: 16px; }
.review-box h2 { display: flex; align-items: center; gap: 8px; }
.review-box h2 .i { color: var(--warn); }
.review-box p { margin: 0 0 12px; }
.review-box p:last-child, .review-box .row-actions { margin-bottom: 0; }
.review-good, .review-bad { display: flex; gap: 8px; align-items: flex-start; }
.review-good .i { color: var(--ok); margin-top: .2em; }
.review-bad .i { color: var(--danger); margin-top: .2em; }

/* Staff: users */
.user-list { list-style: none; margin: 0; padding: 0; }
.user-list li + li { border-top: 1px solid var(--line); }
.user-row { display: grid; gap: 8px; padding: 12px 0; align-items: center; }
.user-row .field { margin: 0; }
.user-row .field input, .user-row .field select { margin-top: 0; }
.user-row .check { margin: 0; }
.inactive { opacity: .65; }
@media (min-width: 900px) {
  .user-row { grid-template-columns: 140px 1fr 1.2fr 110px 90px auto auto; }
}
.stack-form h2:not(:first-child) { margin-top: 1.5rem; }
.settings-link { margin-top: 16px; }

/* Dashboard */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.kpi-link { color: var(--text); }
.kpi-link:hover { text-decoration: none; border-color: var(--blue); }
.kpi-alert { border-color: var(--warn); }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); font-weight: 500; }
.kpi-alert .kpi-label .i { color: var(--warn); }
.kpi-value { font-size: 1.5rem; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
@media (min-width: 600px) { .kpi-value { font-size: 1.9rem; } }
.kpi-delta { font-size: .88rem; font-weight: 600; color: var(--muted); }
.kpi-delta.good { color: var(--ok); }
.kpi-delta.bad { color: var(--danger); }
.kpi-note { font-size: .85rem; color: var(--muted); }
.dash-now .chart-card { margin-bottom: 16px; }
.dash-filters { grid-template-columns: minmax(0, 1fr) auto; }
@media (min-width: 900px) { .dash-filters { grid-template-columns: minmax(180px, 280px) auto 1fr; } }
.dash-filters .custom-dates, .dash-range { grid-column: 1 / -1; }
.dash-range { margin: 0; font-size: .9rem; color: var(--muted); }
.dash-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } .dash-grid .wide { grid-column: 1 / -1; } }
.dash-grid .card { min-width: 0; }
.dash-grid h3 { font-size: .95rem; margin: 14px 0 6px; }
/* Columns: bars grow from the baseline, ticks under some */
.cols { display: flex; align-items: stretch; gap: 2px; height: 150px; margin: 8px 0 30px; border-bottom: 1px solid var(--line); }
.cols-week { height: 110px; }
.col { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; color: var(--text); }
.col:hover { text-decoration: none; }
.col-bar { width: min(100%, 24px); background: var(--series-1); border-radius: 4px 4px 0 0; }
.col:hover .col-bar { filter: brightness(1.15); }
.col-n { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.col-tick { position: absolute; top: 100%; margin-top: 6px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
/* Horizontal bars: label, bar, value */
.bars { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 40%) 1fr auto; gap: 10px; align-items: center; font-size: .92rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 12px; }
.bar { display: block; height: 100%; min-width: 2px; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bars li:hover .bar { filter: brightness(1.15); }
.bar-value { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
/* Part to whole */
.split { display: flex; gap: 2px; height: 14px; margin: 8px 0 10px; }
.split-seg { flex-basis: 0; min-width: 4px; }
.split-seg:first-child { border-radius: 4px 0 0 4px; }
.split-seg:last-child { border-radius: 0 4px 4px 0; }
.split-seg:only-child { border-radius: 4px; }
.s0 { background: var(--series-1); }
.s1 { background: var(--series-2); }
.legend { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .i { color: var(--danger); }
.key { width: 10px; height: 10px; border-radius: 2px; flex: none; }
/* Dials */
.dials { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.dial { margin: 0; text-align: center; }
.dial svg { display: block; width: 100%; max-width: 160px; margin: 0 auto; overflow: visible; }
.dial path { fill: none; stroke-width: 9; stroke-linecap: round; }
.dial-track { stroke: var(--series-track); }
.dial-fill { stroke: var(--series-1); }
.dial-value { display: block; font-size: 1.5rem; font-weight: 650; margin-top: -30px; }
.dial figcaption { display: grid; gap: 2px; margin-top: 8px; font-size: .9rem; }
.dial figcaption span { color: var(--muted); font-size: .85rem; }
/* Heat map */
.heat { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; margin-top: 8px; }
.heat-day { font-size: .75rem; color: var(--muted); }
.heat-hour { grid-column: span 3; font-size: .7rem; color: var(--muted); }
.heat-cell { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--heat-0); }
.heat-cell:hover { outline: 1px solid var(--text); }
@media (min-width: 600px) { .heat .heat-cell { aspect-ratio: auto; height: 20px; } }
.h1 { background: var(--heat-1); } .h2 { background: var(--heat-2); } .h3 { background: var(--heat-3); }
.h4 { background: var(--heat-4); } .h5 { background: var(--heat-5); }
.heat-scale { display: flex; align-items: center; gap: 3px; }
.heat-scale .heat-cell { width: 12px; }
/* Figures and tables */
.stats { margin: 0; display: grid; gap: 12px; }
.stats div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stats dt { font-weight: 500; }
.stats dt small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font-weight: 650; font-size: 1.15rem; white-space: nowrap; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mini-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 6px 6px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 6px; border-bottom: 1px solid var(--line); }
.mini-table th:not(:first-child), .mini-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.table-view { margin-top: 8px; font-size: .9rem; }
.table-view summary { cursor: pointer; color: var(--blue); }
.table-view .mini-table { margin-top: 8px; }
/* The tip over a chart's mark */
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--text); color: var(--bg); padding: 5px 9px; border-radius: 6px; font-size: .85rem; font-weight: 500; max-width: 260px; }

/* The admin console (platform.go) */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child, .data-table th:first-child { padding-left: 0; }
.choice-set { border: 0; padding: 0; margin: 0 0 8px; }
.choice-set legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 8px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.host-row { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 0; }
.host-row .row-actions { margin: 0; }
@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
  .data-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td { padding: 2px 0; border: 0; }
  .data-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* Unsaved changes on a long form (app.js unsavedBar) */
.unsaved-bar { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px); background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 99px; padding: 8px 8px 8px 22px; box-shadow: 0 8px 28px rgba(20, 28, 40, .28); }
.unsaved-bar[hidden] { display: none; }
.unsaved-bar span { font-weight: 600; white-space: nowrap; }
.unsaved-bar .btn { border-radius: 99px; white-space: nowrap; }
@media (max-width: 560px) {
  .unsaved-bar { left: 16px; right: 16px; transform: none; max-width: none; justify-content: space-between; gap: 10px; }
}

/* Signing up (billing.go) */
.signup { max-width: 640px; margin: 0 auto; }
.slug-field { display: flex; align-items: center; gap: 6px; }
.slug-field input { flex: 1; min-width: 0; }
.slug-field span { color: var(--muted); white-space: nowrap; }
