/* Brand: the colours, logo and type of pawsomesmile.com (navy #234386, sky #28ace5,
   orange #e6752e, warm off-white #fbf9f6, Poppins + Karla). */
:root {
  color-scheme: light;
  --ground: #fbf9f6;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --ink: #16233f;
  --ink-2: #4a5a78;
  --muted: #626e86;
  --hair: #e2e8f2;
  --ring: rgba(35, 67, 134, 0.10);
  --accent: #234386;
  --accent-ink: #ffffff;
  --accent-wash: #e3ecfb;
  --sky: #28ace5;
  --sky-wash: #e2f4fd;
  --warm: #e6752e;
  --warm-wash: #fdeade;
  --hover: rgba(35, 67, 134, 0.06);
  --good: #16794a;
  --good-wash: #dcf3e7;
  --warn-ink: #8a5209;
  --warn-wash: #fdeed0;
  --crit: #b3312f;
  --crit-wash: #fbe2e1;
  --t-leonardo: #234386;
  --t-nicolas: #e6752e;
  --t-valentina: #28ace5;
  --display: "Poppins", "Raleway", system-ui, sans-serif;
  --sans: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #0b1220;
    --surface: #141d30;
    --surface-2: #1c2740;
    --ink: #e9eefb;
    --ink-2: #aebad3;
    --muted: #8494b0;
    --hair: #27334d;
    --ring: rgba(255, 255, 255, 0.09);
    --accent: #5f9bf2;
    --accent-ink: #081227;
    --accent-wash: #1a2b4c;
    --sky: #43b9e9;
    --sky-wash: #16324a;
    --warm: #f08a45;
    --warm-wash: #3b2414;
    --hover: rgba(255, 255, 255, 0.07);
    --good: #4fc188;
    --good-wash: #13301f;
    --warn-ink: #f2c46a;
    --warn-wash: #3a2c10;
    --crit: #ef7d7b;
    --crit-wash: #3a1b1b;
    --t-leonardo: #5f9bf2;
    --t-nicolas: #f08a45;
    --t-valentina: #43b9e9;
  }
}

* { box-sizing: border-box; }
/* Our own .np-pane / .pop-actions / .np-pets rules set display, which beats the browser's
   [hidden] rule: the Time Block fields stayed on screen while the Appointment tab was open
   (Leonardo, 2026-09-15). Hidden means hidden, whatever else a class says. */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--hair); position: sticky; top: 0; z-index: 10; }
.top-in { max-width: 1400px; margin: 0 auto; padding: 10px clamp(16px, 3vw, 32px); display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: 8px; }
.brand img { display: block; }
.brand b { font: 600 18px/1.1 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.brand .sys { font: 500 12px/1 var(--sans); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; align-self: center; }
.nav { display: flex; gap: 4px; margin-right: auto; flex-wrap: wrap; }   /* wraps on a phone instead of running off the screen */
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--accent-wash); color: var(--ink); }
.me { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.me form { margin: 0; }
.btn { border: 1px solid var(--hair); background: var(--surface); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.wrap { max-width: 1400px; margin: 0 auto; padding: 22px clamp(16px, 3vw, 32px) 48px; }
h1 { font: 700 26px/1.15 var(--display); letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h2 { font: 600 16px/1.3 var(--sans); margin: 0; }
.muted { color: var(--muted); }
.card { background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--ring); }
.chip { display: inline-flex; align-items: center; gap: 5px; font: 500 12px/1 var(--sans); padding: 4px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.good { background: var(--good-wash); color: var(--good); }
.chip.warn { background: var(--warn-wash); color: var(--warn-ink); }
.chip.crit { background: var(--crit-wash); color: var(--crit); }
.chip.accent { background: var(--accent-wash); color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.leonardo { background: var(--t-leonardo); } .dot.nicolas { background: var(--t-nicolas); } .dot.valentina { background: var(--t-valentina); }

/* page header */
.page-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.page-h .sub { color: var(--muted); margin-top: 4px; }
.daynav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.daynav input[type="date"] { border: 1px solid var(--hair); background: var(--surface); border-radius: 8px; padding: 6px 8px; }

/* week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.wd { text-decoration: none; padding: 10px 10px 9px; display: grid; gap: 4px; }
.wd:hover { background: var(--hover); }
.wd[aria-current="date"] { box-shadow: 0 0 0 2px var(--accent); }
.wd .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wd .n { font: 600 18px/1 var(--sans); }
.wd .dots { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-2); min-height: 16px; }
.wd .dots span { display: inline-flex; align-items: center; gap: 4px; }
.wd.sun { opacity: 0.55; }
@media (max-width: 720px) { .week { grid-template-columns: repeat(7, minmax(44px, 1fr)); overflow-x: auto; } .wd .dots { display: none; } }

/* day columns */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.col-h { padding: 14px 16px 12px; border-bottom: 1px solid var(--hair); display: grid; gap: 6px; }
.col-h .who { display: flex; align-items: center; gap: 8px; }
.col-h .nums { display: flex; flex-wrap: wrap; gap: 6px; }
.entries { list-style: none; margin: 0; padding: 6px; display: grid; gap: 4px; }
.entry { display: grid; grid-template-columns: 70px 1fr; gap: 10px; padding: 10px; border-radius: 9px; }
.entry.visit:hover { background: var(--hover); }
.entry .time { font: 500 13px/1.35 var(--mono); color: var(--ink-2); }
.entry .time span { display: block; color: var(--muted); font-size: 12px; }
.entry .main { display: grid; gap: 3px; min-width: 0; }
.entry .name { font-weight: 600; text-decoration: none; }
.entry .name:hover { text-decoration: underline; }
.entry .line { color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.entry .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.entry.block { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, transparent 6px 12px); }
.entry.block .main { color: var(--ink-2); }
.empty { padding: 18px 16px; color: var(--muted); }

/* tables */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 11.5px/1.2 var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

.search { display: flex; gap: 8px; flex-wrap: wrap; }
.search input { flex: 1 1 280px; border: 1px solid var(--hair); background: var(--surface); border-radius: 9px; padding: 10px 12px; font-size: 15px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; color: var(--muted); }

/* client page */
.client-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .client-grid { grid-template-columns: 1fr; } }
.panel { padding: 16px 18px; display: grid; gap: 12px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; }

/* Named squares: the label sits ABOVE the number, so you know what you are looking at before
   you read it. Only the Revenue page opts in, via .stats-named (Leonardo, 2026-09-21). */
.stats-named { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stats-named .stat { display: flex; flex-direction: column; gap: 2px; min-width: 0;
                     padding: 14px 16px 15px; }
.stats-named .k { font: 600 11.5px/1.2 var(--sans); letter-spacing: .06em;
                  text-transform: uppercase; color: var(--muted); }
.stats-named .v { font: 600 26px/1.15 var(--sans); font-variant-numeric: tabular-nums;
                  margin-top: 2px; }
.stats-named .l { color: var(--muted); font-size: 12.5px; line-height: 1.35;
                  overflow-wrap: break-word; }
.stats-named .t { margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--muted); }
/* The headline is the one figure the page exists for, so it is marked as such. */
.stats-named .lead { box-shadow: 0 0 0 1px var(--accent); }
.stats-named .lead .k, .stats-named .lead .v { color: var(--accent); }
.stat .v { font: 600 22px/1.15 var(--sans); }
.stat .l { color: var(--muted); font-size: 12.5px; }
.pet { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hair); }
.pet:first-of-type { border-top: 0; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(380px, 100%); padding: 28px 26px; display: grid; gap: 16px; }
.login label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.login input { border: 1px solid var(--hair); background: var(--surface); border-radius: 9px; padding: 11px 12px; font-size: 15px; }
.login .err { background: var(--crit-wash); color: var(--crit); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.login .btn.primary { justify-content: center; padding: 11px; font-size: 15px; }

.foot { max-width: 1400px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px) 28px; color: var(--muted); font-size: 12.5px; }

/* ============================================================ calendar */
:root {
  --hair-soft: #eef3f2;
  --offhours: rgba(15, 30, 38, 0.045);
  --sunday: rgba(15, 30, 38, 0.07);
  --blk-a: #eef2f1;
  --blk-b: #fbfcfc;
  --card-ink: #0f1e26;
  --svc-small-bg: #cfe2f6;  --svc-small-bar: #2a78d6;
  --svc-medium-bg: #f2c38e; --svc-medium-bar: #c46b12;
  --svc-large-bg: #ddd1f5;  --svc-large-bar: #6f4bc0;
  --svc-xl-bg: #f4c4c4;     --svc-xl-bar: #c23c3c;
  --svc-cat-bg: #c9eedb;    --svc-cat-bar: #1f9a5e;
  --now: #e0463e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hair-soft: #172228;
    --offhours: rgba(0, 0, 0, 0.22);
    --sunday: rgba(0, 0, 0, 0.3);
    --blk-a: #18242a;
    --blk-b: #121b1f;
    --card-ink: #edf3f2;
    --svc-small-bg: #1e3a5a;  --svc-small-bar: #5a9ae8;
    --svc-medium-bg: #56391a; --svc-medium-bar: #e08a3a;
    --svc-large-bg: #382c5a;  --svc-large-bar: #9d7fe6;
    --svc-xl-bg: #552626;     --svc-xl-bar: #e07070;
    --svc-cat-bg: #173d2c;    --svc-cat-bar: #3fc187;
    --now: #ff6b61;
  }
}
.wrap.wide { max-width: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--hair); border-radius: 8px; text-decoration: none; background: var(--surface); font-size: 18px; line-height: 1; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.icon-btn.sm { width: 28px; height: 28px; font-size: 16px; }
select { border: 1px solid var(--hair); background: var(--surface); border-radius: 8px; padding: 7px 10px; }

.cal-page { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
@media (max-width: 1060px) { .cal-page { grid-template-columns: 1fr; } }
.cal-main { min-width: 0; overflow: hidden; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 10px 14px; border-bottom: 1px solid var(--hair); }
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-right form { margin: 0; }
.range { font: 600 19px/1.2 var(--display); margin: 0 0 0 6px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring); }

.cal-scroll { overflow: auto; max-height: calc(100vh - 150px); }
.cal-grid { min-width: calc(58px + var(--cols) * var(--colmin, 150px)); }
.cal-head, .cal-body { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(var(--colmin, 150px), 1fr)); }
.cal-head { position: sticky; top: 0; z-index: 8; background: var(--surface); border-bottom: 1px solid var(--hair); }
.ch { padding: 7px 10px 8px; border-left: 1px solid var(--hair); display: grid; gap: 3px; align-content: start; min-width: 0; }
.ch-date { display: flex; align-items: center; gap: 7px; text-decoration: none; min-width: 0; }
.ch-date span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ch-date b { font: 600 18px/1 var(--sans); }
.ch-name { font-size: 15px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch.is-today .ch-date b:not(.ch-name) { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 3px 7px; font-size: 16px; }
.ch.is-today .ch-date span { color: var(--accent); font-weight: 600; }
.ch-meta { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.ch-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ch-tags .chip { font-size: 11px; padding: 3px 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.gutter .hr { height: var(--hour); position: relative; }
.gutter .hr span { position: absolute; top: -7px; right: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gutter .hr:first-child span { top: 3px; }
.col {
  position: relative; height: calc(var(--hour) * var(--hours)); border-left: 1px solid var(--hair);
  background-image: linear-gradient(to bottom, var(--hair) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--hair-soft) 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2);
}
.col.is-sun { background-color: var(--sunday); }
.off-hours { position: absolute; left: 0; right: 0; background: var(--offhours); pointer-events: none; }
.closed-label { position: absolute; top: calc(var(--hour) * 3); left: 0; right: 0; text-align: center; color: var(--muted); font-weight: 500; }

.blk {
  position: absolute; left: 3px; right: 3px; z-index: 1; border-radius: 6px; padding: 3px 7px;
  font-size: 11px; line-height: 1.3; color: var(--ink-2); overflow: hidden; display: flex; flex-direction: column;
  background: repeating-linear-gradient(135deg, var(--blk-a) 0 7px, var(--blk-b) 7px 14px);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.blk b { font-weight: 600; color: var(--ink); }
.blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.appt {
  position: absolute; z-index: 2; text-align: left; border: 0; border-radius: 6px; margin: 0;
  padding: 4px 7px 4px 10px; overflow: hidden; cursor: pointer; color: var(--card-ink);
  display: flex; flex-direction: column; gap: 1px; font: 400 11.5px/1.3 var(--sans);
  box-shadow: inset 4px 0 0 var(--bar), 0 0 0 1px var(--surface);
}
.appt:hover { z-index: 5; box-shadow: inset 4px 0 0 var(--bar), 0 0 0 1px var(--surface), 0 4px 14px rgba(0, 0, 0, 0.18); }
.appt:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 6; }
.s-small { background: var(--svc-small-bg); --bar: var(--svc-small-bar); }
.s-medium { background: var(--svc-medium-bg); --bar: var(--svc-medium-bar); }
.s-large { background: var(--svc-large-bg); --bar: var(--svc-large-bar); }
.s-xl { background: var(--svc-xl-bg); --bar: var(--svc-xl-bar); }
.s-cat { background: var(--svc-cat-bg); --bar: var(--svc-cat-bar); }
.a-t { font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-i { font-style: italic; }
.a-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; font: 700 9.5px/1 var(--sans); font-style: normal; margin-right: 4px; vertical-align: 1px; }
.a-mark.ok { background: var(--good); color: #fff; }
.a-mark.warn { background: #e5a50a; color: #1a1300; }
.drive {
  position: absolute; left: 50%; z-index: 7; transform: translate(-50%, -50%); pointer-events: none;
  background: var(--surface); color: var(--ink-2); font-size: 10.5px; font-weight: 500; line-height: 1;
  padding: 3px 7px; border-radius: 999px; box-shadow: 0 0 0 1px var(--hair); white-space: nowrap;
}
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--now); z-index: 9; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }

.cal-side { display: grid; gap: 12px; position: sticky; top: 72px; }
@media (max-width: 1060px) { .cal-side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.mini { padding: 12px; }
.mini-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.mini-grid { width: 100%; border-collapse: collapse; }
.mini-grid th { font-size: 11px; padding: 4px 0; text-align: center; border: 0; letter-spacing: 0; text-transform: none; }
.mini-grid td { padding: 1px; text-align: center; border: 0; }
.mini-grid tbody tr:hover { background: none; }
.mini-grid a { display: grid; place-items: center; width: 30px; height: 30px; margin: auto; border-radius: 50%; text-decoration: none; font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; }
.mini-grid a:hover { background: var(--hover); text-decoration: none; }
.mini-grid a.out { color: var(--muted); }
.mini-grid a.sel { background: var(--accent-wash); }
.mini-grid a.now { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
.side-box { padding: 12px 14px; display: grid; gap: 10px; }
.sum-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; font-size: 13.5px; }
.sum-row span, .sum-row em { grid-column: 2; color: var(--ink-2); }
.sum-row em { font-style: normal; font-size: 12px; color: var(--warn-ink); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.legend i { display: inline-block; width: 16px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 8px; box-shadow: inset 4px 0 0 var(--bar); }

.detail { border: 0; padding: 22px 22px 18px; width: min(470px, calc(100vw - 32px)); color: var(--ink); background: var(--surface); border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3); }
.detail::backdrop { background: rgba(10, 17, 20, 0.45); }
.d-close { position: absolute; top: 12px; right: 12px; margin: 0; }
.d-when { color: var(--muted); font-size: 13px; padding-right: 40px; }
.detail h2 { font: 700 21px/1.2 var(--display); margin: 4px 0 8px; padding-right: 40px; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.d-pets { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.d-pets li { background: var(--surface-2); border-radius: 9px; padding: 9px 11px; }
.d-pet-top { display: flex; justify-content: space-between; gap: 10px; }
.d-pet-sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.detail .kv { margin: 0 0 14px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.d-actions [hidden] { display: none; }

/* waiver marks, week money, employees */
.a-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.a-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-row .wv { flex: none; }
.appt.join-down { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.appt.join-up { border-top-left-radius: 0; border-top-right-radius: 0; }
.wv { flex: none; font: 600 9.5px/1 var(--sans); font-style: normal; padding: 2px 5px; border-radius: 4px; }
.wv.ok { background: var(--good); color: #fff; }
.wv.no { background: var(--crit); color: #fff; }
.sum-money { grid-column: 2; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 0; font-size: 12.5px; }
.sum-money dt { color: var(--muted); }
.sum-money dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
/* EVERY card the same height, across the whole page, not just within a row. The cards hold
   different things (a technician has an address and a schedule button, the office does not)
   and any raggedness reads as broken (Leonardo, 2026-09-21). grid-auto-rows: 1fr makes every
   row the height of the tallest, and stretch makes each card fill its row. */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
          gap: 14px; align-items: stretch; grid-auto-rows: 1fr; }
.person { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.person > .btn { margin-top: auto; align-self: start; }   /* Open schedule sits on the bottom edge */
.comm-row { grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 12px; }
.comm-said { font-size: 12.5px; color: var(--good); }
.comm-said.bad { color: var(--crit); }
.comm-in { display: inline-flex; align-items: center; gap: 6px; }
.comm-in input { width: 84px; text-align: right; }
.comm-in span { color: var(--muted); }
.person-h { display: flex; gap: 10px; align-items: flex-start; }
.person-h .dot { margin-top: 8px; width: 11px; height: 11px; }
.person-name { display: grid; gap: 6px; }
.person-name h2 { font: 600 18px/1.2 var(--display); }
.person-tags { display: flex; flex-wrap: wrap; gap: 6px; }
/* Short labels, so give the value the room. And prefer the <wbr> break points over
   snapping a domain in half (Leonardo, 2026-09-21). */
.person .kv { grid-template-columns: 78px 1fr; }
.person .kv dd { overflow-wrap: break-word; }
.person .kv a { text-decoration: none; }
.person .kv a:hover { text-decoration: underline; }
.person-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.person-stats div { background: var(--surface-2); border-radius: 9px; padding: 9px 10px; display: grid; gap: 2px; }
.person-stats b { font: 600 17px/1.1 var(--sans); }
.person-stats span { color: var(--muted); font-size: 12px; }

/* popovers: visit details and new appointment */
.col { cursor: cell; }
.col.is-sun { cursor: default; }
.pop {
  position: fixed; z-index: 1300; width: min(440px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto;
  background: var(--surface); color: var(--ink); border-radius: 12px; padding: 14px 18px 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), 0 0 0 1px var(--ring);
}
.pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pop-x { flex: none; }
.pop-x .ico { display: grid; place-items: center; }
.pop-title { font: 500 22px/1.25 var(--sans); margin: 8px 0 4px; overflow-wrap: anywhere; }
.pop-title em { color: var(--muted); font-style: italic; font-weight: 400; }
.pop-more { font-size: 14px; color: var(--muted); }
.pop-sec { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--hair); }
.pop-sec:first-of-type { border-top: 0; }
.pop-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.pop-row .ico { color: var(--muted); margin-top: 2px; }
.pop-row-b { min-width: 0; }
.pop-main { font-size: 15px; overflow-wrap: anywhere; }
.pop-sub { font-size: 13px; color: var(--ink-2); margin-top: 1px; overflow-wrap: anywhere; }
.pop-link { color: var(--ink); text-decoration: none; font-size: 15px; overflow-wrap: anywhere; }
.pop-link:hover { text-decoration: underline; }
.pop-inline { display: flex; align-items: center; gap: 8px; }
.pop-sms { display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: 5px; background: var(--svc-small-bar); color: #fff; }
.pop-sms .ico svg { width: 15px; height: 15px; }
.pop-banner { display: flex; align-items: center; gap: 8px; margin-left: 32px; padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.pop-banner.bad { background: var(--crit-wash); color: var(--crit); }
.pop-banner.ok { background: var(--good-wash); color: var(--good); }
.pop-banner a { margin-left: auto; font-weight: 600; color: inherit; }
.pop-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hair); }

.ghost {
  position: absolute; left: 3px; right: 3px; z-index: 8; border-radius: 6px; padding: 3px 8px; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 80%, transparent); color: var(--accent-ink);
  display: flex; flex-direction: column; font-size: 11.5px; line-height: 1.3; overflow: hidden;
  box-shadow: 0 0 0 2px var(--surface), 0 6px 18px rgba(0, 0, 0, 0.2);
}
.ghost.is-block { background: repeating-linear-gradient(135deg, var(--blk-a) 0 7px, var(--blk-b) 7px 14px); color: var(--ink); box-shadow: 0 0 0 2px var(--accent); }
.ghost b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.np-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--hair); margin: -4px 0 10px; }
.np-tabs .pop-x { margin-left: auto; }
.np-tab { background: none; border: 0; padding: 10px 12px; font-weight: 500; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.np-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.np-pane { display: grid; gap: 10px; }
.np-field { display: grid; gap: 6px; margin-bottom: 10px; }
.np-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.np-label .ico { color: var(--muted); }
.np-label .np-mini { margin-left: auto; }
.np-when { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.pop input[type="date"], .pop input[type="time"], .pop input[type="text"], .pop input[type="search"], .pop select {
  width: 100%; border: 1px solid var(--hair); background: var(--surface); border-radius: 7px; padding: 8px 10px; font-size: 14.5px;
}
.np-mini { background: none; border: 0; color: var(--accent); font-weight: 500; font-size: 13px; cursor: pointer; padding: 0; }
.np-pick { position: relative; }
.np-results { list-style: none; margin: 4px 0 0; padding: 4px 0; border: 1px solid var(--hair); border-radius: 8px; max-height: 240px; overflow: auto; background: var(--surface); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14); }
.np-result { width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; cursor: pointer; display: grid; gap: 2px; }
.np-result:hover, .np-result:focus-visible { background: var(--hover); }
.np-r1 em { color: var(--muted); }
.np-r2 { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); font-size: 13px; }
.np-empty { padding: 8px 12px; color: var(--muted); font-size: 13px; }
.np-picked { border: 1px solid var(--hair); border-radius: 8px; padding: 9px 11px; display: grid; gap: 2px; font-size: 13px; color: var(--ink-2); }
.np-picked-top { display: flex; justify-content: space-between; gap: 8px; color: var(--ink); font-size: 14.5px; }
.np-service { display: flex; justify-content: space-between; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; margin-top: -4px; }
.np-note { margin: 0; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.np-checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.np-check { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.np-check .ico svg { width: 16px; height: 16px; }
.np-check.ok .ico { color: var(--good); }
.np-check.bad .ico { color: var(--crit); }
.np-check.warn .ico { color: #d18b00; }
.np-check.info .ico { color: var(--muted); }
.np-notice { margin: 10px 0 0; font-size: 13px; background: var(--warn-wash); color: var(--warn-ink); border-radius: 8px; padding: 9px 11px; }

/* card icons (note, reminder bell, confirmed bell) and their tooltip */
.a-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; min-width: 0; }
.a-top .a-t { min-width: 0; }
.a-icons { flex: none; display: inline-flex; align-items: center; gap: 3px; margin-top: 1px; color: var(--card-ink); opacity: 0.85; }
.a-ic { display: inline-grid; place-items: center; font-style: normal; }
.a-ic svg { display: block; }
.cal-tip {
  position: fixed; z-index: 1400; pointer-events: none; max-width: 260px;
  background: #1f2328; color: #fff; font: 400 12.5px/1.4 var(--sans);
  padding: 7px 10px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* closed visits turn gray like DaySmart; records made while practicing get a dashed outline */
:root { --closed-bg: #9ca5aa; --closed-bar: #5d676c; --closed-ink: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --closed-bg: #3a4348; --closed-bar: #7d888e; --closed-ink: #e9eff1; } }
.appt.st-completed { background: var(--closed-bg); --bar: var(--closed-bar); color: var(--closed-ink); }
.appt.st-completed .a-icons { color: var(--closed-ink); }
.appt.st-completed .bell-check { stroke: var(--closed-bg); }
.appt.is-practice { outline: 2px dashed var(--accent); outline-offset: -2px; }
.a-prac { font: 700 9px/1 var(--sans); background: var(--accent); color: var(--accent-ink); border-radius: 3px; padding: 2px 3px; }
.blk { cursor: pointer; }
.blk:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }
.blk:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.blk.is-practice { box-shadow: inset 0 0 0 2px var(--accent); }
.legend i.s-closed { background: var(--closed-bg); --bar: var(--closed-bar); }
.legend i.s-practice { background: var(--surface); box-shadow: none; outline: 2px dashed var(--accent); outline-offset: -2px; }
.side-note { margin: 0; font-size: 12px; color: var(--muted); }
.mode-chip { text-decoration: none; }

/* popover actions and forms */
.pop-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pop-form { display: grid; gap: 10px; padding: 12px 0 0; border-top: 1px solid var(--hair); }
.pop-form-h { font: 600 15px/1.3 var(--sans); margin: 0; }
.pf-field { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); }
.pf-sum, .pf-help { margin: 0; font-size: 13px; color: var(--ink-2); }
.pop-foot { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.pop-actions [hidden] { display: none; }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.danger-ghost { color: var(--crit); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.pop input[type="number"], .pop textarea { width: 100%; border: 1px solid var(--hair); background: var(--surface); border-radius: 7px; padding: 8px 10px; font-size: 14.5px; }
.pop textarea { resize: vertical; }
.np-pets { display: grid; gap: 6px; margin-top: -2px; }
.np-pet { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.np-service { display: grid; gap: 6px; justify-content: stretch; }
.np-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.np-lines li, .np-total { display: flex; justify-content: space-between; gap: 10px; }
.np-total { border-top: 1px solid var(--hair); padding-top: 5px; color: var(--ink-2); }
.np-total b { color: var(--ink); }
.np-warn { margin: 0; color: var(--warn-ink); font-size: 12.5px; }
.np-extras { display: grid; gap: 8px; }
.np-practice { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.np-notice ul { margin: 6px 0 0; padding-left: 18px; }
.np-notice .btn { margin-top: 8px; }
a.np-mini { text-decoration: none; }

/* client form and settings */
.form-card { padding: 18px 20px; display: grid; gap: 14px; margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.fld { display: grid; gap: 5px; font-size: 13.5px; font-weight: 500; }
.fld input, .fld select, .fld textarea { border: 1px solid var(--hair); background: var(--surface); border-radius: 8px; padding: 9px 11px; font-weight: 400; color: var(--ink); width: 100%; }
.fld textarea { resize: vertical; }
.fld small { font-weight: 400; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.checks label { display: flex; gap: 8px; align-items: center; }
.pet-card { border: 1px solid var(--hair); border-radius: 10px; padding: 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
.row-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
#pets { display: grid; gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.form-err { background: var(--crit-wash); color: var(--crit); border-radius: 8px; padding: 10px 12px; margin: 0; }
.form-err a { color: inherit; font-weight: 600; margin-left: 6px; }
.banner { border-radius: 10px; padding: 12px 14px; background: var(--warn-wash); color: var(--warn-ink); margin: 0 0 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.settings-grid p { margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.side-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sum-money .sum-pay { border-top: 1px solid var(--hair); padding-top: 4px; margin-top: 2px; }
.sum-money dt.sum-pay { color: var(--ink-2); }

/* login: the brand, with the photo from the website */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-art { position: relative; background: #234386 url("/static/brand/happy-pets-together.jpg") center/cover no-repeat; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(200deg, rgba(35, 67, 134, 0.18) 0%, rgba(35, 67, 134, 0.72) 68%, rgba(13, 28, 60, 0.88) 100%); }
.login-art-in { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: clamp(24px, 4vw, 48px); color: #fff; }
.login-art-in h2 { font: 600 clamp(24px, 3.2vw, 34px)/1.2 var(--display); text-wrap: balance; color: #fff; }
.login-art-in p { margin: 0; max-width: 42ch; color: rgba(255, 255, 255, 0.86); font-size: 15px; }
.login-side { display: grid; place-items: center; padding: 32px clamp(16px, 4vw, 40px); background: var(--ground); }
.login-box { width: min(400px, 100%); display: grid; gap: 18px; }
.login-box .logo { height: 54px; width: auto; justify-self: start; }
.login-box h1 { font: 600 22px/1.25 var(--display); }
.login-box .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.login-box form { display: grid; gap: 14px; }
.login-box label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
.login-box input { border: 1px solid var(--hair); background: var(--surface); border-radius: 10px; padding: 11px 13px; font-size: 16px; }   /* 16px: an iPhone zooms the page into any smaller field */
.login-box .btn.primary { justify-content: center; padding: 12px; font-size: 15px; border-radius: 10px; }
.login-box .err { background: var(--crit-wash); color: var(--crit); border-radius: 9px; padding: 10px 12px; font-size: 14px; }
.login-box .ok { background: var(--good-wash); color: var(--good); border-radius: 9px; padding: 10px 12px; font-size: 14px; }
.me-name { color: inherit; text-decoration: none; }
.pw-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pw-reset { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.me-name:hover { text-decoration: underline; }
.login-box .foot-note { color: var(--muted); font-size: 12.5px; }
@media (max-width: 860px) { .login-split { grid-template-columns: 1fr; } .login-art { display: none; } }
@media (prefers-color-scheme: dark) {
  .login-box .logo { background: #fff; border-radius: 12px; padding: 8px 12px; box-sizing: content-box; }
  .brand img { background: #fff; border-radius: 8px; }
}

/* week with the whole team: day row on top, one technician column under each day */
.ch-day { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px 6px; min-width: 0; background: var(--surface-2); border-left: 2px solid var(--hair); }
.ch-day a { display: flex; align-items: baseline; gap: 6px; text-decoration: none; color: inherit; }
.ch-day span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ch-day b { font: 600 16px/1 var(--sans); }
.ch-day em { font-style: normal; font-size: 11.5px; color: var(--ink-2); margin-left: auto; white-space: nowrap; }
.ch-day.is-today { background: var(--accent-wash); }
.ch-day.is-today b, .ch-day.is-today span { color: var(--accent); font-weight: 600; }
.ch-day.is-sun { background: var(--sunday); }
.ch.ch-sub { padding: 5px 7px 7px; gap: 2px; }
.ch-sub .ch-name { font-size: 13px !important; }
.ch-sub .ch-meta { font-size: 11px; }
.ch-sub .ch-tags .chip { font-size: 10px; padding: 2px 5px; }
.col.day-start, .ch.day-start { border-left: 2px solid var(--hair); }

/* map of the day: the route the way the technicians see it in DaySmart's app */
.map-page { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; padding: 14px; }
@media (max-width: 1060px) { .map-page { grid-template-columns: 1fr; } .map-canvas { height: 60vh !important; } }
.map-canvas { height: calc(100vh - 215px); min-height: 400px; border-radius: 12px; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--ring); }
.map-off { display: grid; place-items: center; height: 100%; padding: 24px; text-align: center; color: var(--muted); }
.stop-list { max-height: calc(100vh - 215px); overflow: auto; display: grid; gap: 10px; align-content: start; }
/* the map's side column: the little month stays put, the stops scroll under it */
.map-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.map-side .stop-list { max-height: max(220px, calc(100vh - 530px)); }
.stop-head { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stop { border: 1px solid var(--hair); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); cursor: pointer; }
.stop:hover { background: var(--hover); }
.stop.is-active { box-shadow: inset 0 0 0 2px var(--accent); }
.stop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stop.no-pos { opacity: 0.75; }
.stop-h { display: flex; gap: 9px; align-items: flex-start; }
.stop-h > div { flex: 1; min-width: 0; }
.stop-h b { font-size: 14.5px; }
.stop-h .muted { font-size: 12.5px; }
.stop-time { font-weight: 600; white-space: nowrap; font-size: 13.5px; }
.stop-addr { font-size: 13px; color: var(--ink-2); }
.stop-note { font-size: 12.5px; background: var(--surface-2); border-radius: 7px; padding: 6px 8px; }
.stop-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stop-actions .btn { padding: 5px 9px; font-size: 12.5px; border-radius: 7px; }
.stop-tech { margin-left: auto; font-size: 12px; }
.stop-drive { font-size: 12px; color: var(--muted); }
.pin-num, .map-pin { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font: 600 12.5px/1 var(--sans); flex: none; }
.map-pin { border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.map-pin.is-done { opacity: 0.75; }
.t-leonardo { background: var(--t-leonardo); }
.t-nicolas { background: var(--t-nicolas); }
.t-valentina { background: var(--t-valentina); }
.leaflet-container { font: inherit; background: var(--surface-2); }
.map-pop b { font-size: 14px; }
.map-pop-sub { color: #5a6b86; }
.map-pop-links { display: flex; gap: 10px; margin-top: 6px; font-weight: 600; }

/* the employee list: tick who you want to see, however many technicians there are */
.pick { position: relative; }
.pick > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--hair); background: var(--surface); border-radius: 9px; padding: 7px 12px; font-weight: 500; white-space: nowrap; }
.pick > summary::-webkit-details-marker { display: none; }
.pick > summary::after { content: "▾"; color: var(--muted); font-size: 12px; margin-left: 2px; }
.pick[open] > summary { box-shadow: 0 0 0 2px var(--accent-wash); }
.pick-dots { display: inline-flex; gap: 3px; }
.pick-dots .dot { width: 8px; height: 8px; }
.pick-label { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.pick-menu { position: absolute; z-index: 1200; top: calc(100% + 8px); right: 0; width: 290px; background: var(--surface); border-radius: 12px; padding: 10px; display: grid; gap: 8px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--ring); }
.pick-search { width: 100%; border: 1px solid var(--hair); background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.pick-list { display: grid; gap: 2px; max-height: 40vh; overflow: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.pick-row:hover { background: var(--hover); }
.pick-row > label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.pick-only { font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none;
             white-space: nowrap; padding: 3px 9px; border-radius: 999px; }
.pick-only:hover, .pick-only:focus { background: var(--accent-wash); color: var(--accent); }
.pick-row input { margin: 0; flex: none; }
.pick-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row .dot { flex: none; }
.pick-all { border-bottom: 1px solid var(--hair); border-radius: 8px 8px 0 0; font-weight: 600; margin-bottom: 2px; }
.pick-busy { border-top: 1px solid var(--hair); border-radius: 0; padding-top: 10px; color: var(--ink-2); }
.pick-count { font-style: normal; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pick-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--ring); }
@media (max-width: 760px) { .pick-menu { right: auto; left: 0; width: min(290px, calc(100vw - 32px)); } }

/* map: the H pin and the drive home, and the office log table */
.map-pin.is-home, .pin-num.is-home { font-weight: 700; letter-spacing: 0.02em; }
.stop.is-home { background: var(--surface-2); }
.stop.is-home .stop-h b { font-weight: 600; }
.drive.is-home { background: var(--accent-wash); color: var(--ink); box-shadow: 0 0 0 1px var(--accent); }
.drive.is-home b { font-weight: 700; margin-right: 2px; }

/* the office log: dense like the sheet, with the status readable at a glance */
.log { font-size: 13.5px; }
.log th { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.log td { padding: 8px 10px; white-space: nowrap; }
.log td:nth-child(3), .log td:nth-child(12) { white-space: normal; min-width: 130px; }
.log tr.st-cancelled td { background: color-mix(in srgb, var(--crit-wash) 55%, transparent); }
.log tr.st-reschedule td { background: color-mix(in srgb, var(--warn-wash) 55%, transparent); }
.log .chip { font-size: 11px; padding: 3px 7px; }
.log .dot { margin-right: 5px; }

/* The client's conversation: what they wrote on the left, what we wrote on the right, so a thread
   reads the way it happened without anybody having to label every line. */
.thread { display: grid; gap: 10px; padding: 6px 18px 18px; }
.msg { max-width: 78%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--surface); }
.msg.them { justify-self: start; }
.msg.us { justify-self: end; background: var(--accent-wash); border-color: transparent; }
.msg-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-h b { font-weight: 600; color: var(--ink-2); }
.msg-s { font-weight: 600; margin-bottom: 3px; }
.msg-b { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.msg-b summary { cursor: pointer; }
.msg-b summary::marker { color: var(--muted); }
.msg-files { margin-top: 6px; font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) { .msg { max-width: 100%; } }

/* A bar on a report is a length that means a number, never decoration: every one is drawn as a
   share of the biggest row, so the eye can compare without reading a single figure. */
.bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .7; min-width: 2px; }
tr.picked td { background: var(--accent-wash); font-weight: 600; }
.bar.warm { background: var(--warn); opacity: .8; }
.up { color: var(--good); font-variant-numeric: tabular-nums; }
.down { color: var(--crit); font-variant-numeric: tabular-nums; }
/* These cards hold whole tables, so 340px was far too narrow: five of them across the screen
   left every table too cramped to fit and you had to scroll each one sideways to read it
   (Leonardo, 2026-09-21). At 460px the row caps at four on a wide screen, three on a laptop,
   and each table has the width it actually needs. auto-fit still collapses spare tracks, so a
   pair of cards sits as two even halves rather than two thirds and a gap.
   Cards also share a height, so a short table next to a long one leaves no step. */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
               gap: 14px; align-items: stretch; }
.report-grid > .card { display: flex; flex-direction: column; }
.report-grid > .card > .tw { flex: 1; }
/* Report tables must fit the card they are in. Sideways scrolling to read your own numbers is
   not reading them (Leonardo, 2026-09-21). Tighter cells, and the share bar sits under the
   name rather than owning a column. */
.report-grid td, .report-grid th,
.form-card .tw td, .form-card .tw th { padding: 8px 9px; }
.form-card .tw td, .form-card .tw th { font-size: 13.5px; }
.row-bar { display: block; height: 3px; margin-top: 5px; border-radius: 2px; min-width: 2px; }
.form-card .tw table { table-layout: auto; width: 100%; }

/* Any screen, any machine. The office gets read on a phone in somebody's driveway, on Kevin's
   monitor and on a laptop, so nothing below assumes a width: text scales with the reader's own
   setting, long words never push the page sideways, a wide table scrolls inside its own box
   instead of dragging the whole page, and a machine set to reduce motion gets none. */
html { -webkit-text-size-adjust: 100%; }
body { overflow-wrap: break-word; }
img, svg, canvas { max-width: 100%; }
img { height: auto; }
.leaflet-container img, .leaflet-container svg, .leaflet-container canvas { max-width: none; }
.seg { max-width: 100%; overflow-x: auto; }          /* DAY / 2 DAYS / WEEK stays reachable */

@media (max-width: 560px) {
  .page-h h1 { font-size: 22px; }
  .stat .v { font-size: 19px; }
  .daynav { width: 100%; }
  .daynav select, .daynav input { flex: 1 1 auto; min-width: 0; }
  .log td, .log th { padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* The "XXX" sheet on the schedule, made for a technician's iPhone first (Leonardo, 2026-09-21):
   it rises from the bottom where a thumb reaches, the fields open the number keypad, and every
   input is 16px or larger so iOS does not zoom the page when one is tapped. */
dialog.sheet { border: 0; padding: 0; background: var(--surface); color: var(--ink);
               width: min(440px, calc(100vw - 24px)); border-radius: 14px;
               box-shadow: 0 18px 50px rgba(0, 0, 0, .28), 0 0 0 1px var(--ring); }
dialog.sheet::backdrop { background: rgba(10, 17, 20, .45); }
.sheet form { display: grid; gap: 12px; padding: 16px 18px 18px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font: 600 20px/1.2 var(--sans); }
.sheet-x { padding: 6px 11px; }
.sf { display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.sf input, .sf select { font-size: 16px; padding: 11px 12px; border: 1px solid var(--hair);
                        border-radius: 10px; background: var(--surface); color: var(--ink);
                        width: 100%; min-width: 0; box-sizing: border-box; }
.sf input:focus, .sf select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sf input[type="file"] { padding: 9px 10px; font-size: 14px; }
.sf-money { display: flex; align-items: center; gap: 8px; }
.sf-money > span { color: var(--muted); font-size: 16px; }
.sf-opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.sf-err { margin: 0; color: var(--crit); font-size: 13.5px; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.sheet-foot .btn { padding: 11px 18px; font-size: 15px; }
@media (max-width: 600px) {
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0;
                 max-height: 92vh; overflow: auto; }
  .sheet form { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
}
