*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.7;
    -webkit-tap-highlight-color: transparent;
    padding-block-end: env(safe-area-inset-bottom);
}

img { max-width: 100%; height: auto; }
a { color: var(--gold-text); }
h1, h2 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--text-2); }
.footnote { text-align: center; color: var(--text-2); font-size: .85rem; margin-block-start: 1.5rem; }

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: max(var(--space), env(safe-area-inset-left)) max(var(--space), env(safe-area-inset-right));
}
.main { padding-block: 20px 40px; }

/* Focus: thick and visible on every control */
:focus-visible { outline: 3px solid var(--gold-text); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; inset-inline-start: -999px; }
.skip-link:focus { inset-inline-start: 8px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--bg);
    border-block-end: 1px solid var(--line);
    padding-block-start: env(safe-area-inset-top);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { border-radius: 50%; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-name { font-weight: 700; font-size: 1.05rem; }
.brand-tag { font-size: .8rem; color: var(--text-2); }
.header-actions { display: flex; gap: 8px; flex: none; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: var(--tap); height: var(--tap); padding-inline: 12px;
    background: var(--surface); color: var(--text);
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; font-size: .95rem; font-weight: 500; text-decoration: none; cursor: pointer;
}
.icon-sun, .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* Cards and buttons */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.hero { text-align: center; padding-block: 28px; }
.hero-logo { border-radius: 50%; margin-block-end: 12px; box-shadow: var(--shadow); }
.error-code { font-size: 3rem; font-weight: 700; color: var(--gold-text); margin: 0; line-height: 1.1; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 22px;
    border-radius: var(--radius); border: 1.5px solid transparent;
    font: inherit; font-size: 1.1rem; font-weight: 700; text-decoration: none; cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--gold-text); }
.btn-block { display: flex; width: 100%; }
html[data-motion="playful"] .btn:active { transform: scale(.97); }

/* Bottom sheet (theme menu) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 40; }
.sheet {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    max-width: 520px; margin-inline: auto;
    background: var(--bg); border-radius: 24px 24px 0 0;
    padding: 22px max(20px, env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
}
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }
.sheet h2 { margin-block-end: 8px; }
.option {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; min-height: 60px; margin-block-start: 10px; padding: 8px 16px;
    background: var(--surface); color: var(--text);
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; font-size: 1.1rem; text-align: start; cursor: pointer;
}
.option small { display: block; font-weight: 400; font-size: .85rem; color: var(--text-2); }
.option .icon-check { display: none; color: var(--gold-text); flex: none; }
.option[aria-pressed="true"] { border: 3px solid var(--gold-text); background: var(--selected); }
.option[aria-pressed="true"] .icon-check { display: block; }
.sheet-close { width: 100%; margin-block-start: 14px; }

html[data-motion="playful"] .sheet:not([hidden]) { animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Smooth colour change when the theme switches (added by JS only on user action) */
html.theme-anim, html.theme-anim body, html.theme-anim .card, html.theme-anim .site-header, html.theme-anim .icon-btn {
    transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* System check */
.checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.check-badge { display: inline-flex; align-items: center; gap: 4px; flex: none; min-width: 84px; font-weight: 700; font-size: .9rem; }
.check-ok .check-badge { color: var(--st-ok); }
.check-warn .check-badge { color: var(--gold-text); }
.check-fail .check-badge { color: var(--st-danger); }
.check-body { display: flex; flex-direction: column; min-width: 0; font-size: .95rem; line-height: 1.5; overflow-wrap: anywhere; }
.check-body span { color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* ---------- Forms (Step 2) ---------- */
.main { display: grid; gap: 16px; align-content: start; }
.auth-card { width: 100%; max-width: 440px; margin-inline: auto; }
.card-soft { background: var(--selected); }
.form { display: grid; gap: 16px; }
.form-secondary { margin-block-start: 12px; }
.field label, .field > .label { display: block; font-weight: 700; margin-block-end: 6px; }
.hint { margin: 6px 0 0; font-size: .9rem; color: var(--text-2); line-height: 1.5; }

input[type="text"], input[type="password"], input[type="search"], input[type="time"], input[type="date"], input[type="tel"], select, textarea {
    display: block; width: 100%; min-height: 52px; padding: 0 14px;
    background: var(--surface); color: var(--text);
    border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    font: inherit; font-size: 1.0625rem;
}
input:disabled, select:disabled { opacity: .7; }
textarea { min-height: 84px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.pin-input { text-align: center; letter-spacing: .4em; font-size: 1.6rem; font-variant-numeric: tabular-nums; }

/* The password box is always left-to-right, so its Show button sits on the physical right. */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 84px; }
.reveal {
    position: absolute; right: 6px; top: 6px; bottom: 6px; min-width: 66px; padding: 0 10px;
    background: transparent; color: var(--gold-text); border: 0; border-radius: 10px;
    font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
}

.check-row {
    display: flex; align-items: flex-start; gap: 12px; min-height: 52px; padding: 12px 14px;
    background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.check-row input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--gold-text); }
.check-row span { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.check-row small, .tile small, .row small { font-size: .88rem; font-weight: 400; color: var(--text-2); }

.alert {
    padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line);
    border-inline-start-width: 5px; background: var(--surface); line-height: 1.6;
}
.alert-error { background: var(--danger-bg); border-color: var(--st-danger); }
.alert-ok { background: var(--ok-bg); border-color: var(--st-ok); }
.alert-info { background: var(--info-bg); border-color: var(--st-pending); }
.card > .alert { margin-block: 12px; }

.btn-small { min-height: 44px; padding: 0 14px; font-size: 1rem; }
.btn-danger { background: var(--st-danger); color: var(--on-danger); }

/* Lists and tiles */
.tiles, .rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tile {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px;
    background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); text-decoration: none;
}
.tile > span { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tile-arrow { flex: none; color: var(--gold-text); }
:root[dir="rtl"] .tile-arrow { transform: scaleX(-1); }
html[data-motion="playful"] a.tile:active { transform: scale(.985); }
.tile-static { box-shadow: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; border-block-end: 1px solid var(--line); }
.row:last-child { border-block-end: 0; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-main .badge { align-self: flex-start; }
.rows-cards .row-main { gap: 4px; }
.row-main > b { overflow-wrap: anywhere; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
    display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; line-height: 1.6;
    background: var(--selected); color: var(--text); border: 1px solid var(--line);
}
.badge-ok { background: var(--ok-bg); color: var(--st-ok); border-color: var(--st-ok); }
.badge-off { background: var(--surface); color: var(--text-2); }
.badge-warn { color: var(--gold-text); border-color: var(--gold-text); }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { margin: 0; }

.facts { display: grid; gap: 10px; margin: 0 0 16px; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: .88rem; color: var(--text-2); }
.facts dd { margin: 0; font-weight: 700; }

.disclosure { border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-block-start: 12px; }
.disclosure > summary { min-height: 52px; display: flex; align-items: center; padding: 0 14px; font-weight: 700; cursor: pointer; }
.disclosure[open] > summary { border-block-end: 1px solid var(--line); }
.disclosure > :not(summary) { margin-inline: 14px; }
.disclosure > :last-child { margin-block-end: 14px; }
.disclosure > summary + * { margin-block-start: 14px; }
.perm-group { border: 0; padding: 0; margin: 16px 14px 0; display: grid; gap: 8px; }
.perm-group legend { font-weight: 700; color: var(--gold-text); padding: 0; margin-block-end: 6px; }

.action-row { display: grid; gap: 8px; margin-block-end: 16px; }
.action-row p { margin: 0; }

.credentials { display: grid; gap: 12px; margin: 16px 0; }
.credentials dt { font-size: .88rem; color: var(--text-2); }
.credentials dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 700; padding: 12px 14px; background: var(--selected); border: 1.5px dashed var(--gold-text); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; user-select: all; }

.footnote a { color: var(--gold-text); }

/* Keep the header tidy when the account button is added */
.brand-name, .brand-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-small { white-space: nowrap; }
.row { flex-wrap: wrap; }
.row-main { flex: 1 1 200px; }


/* ---------- Responsive layout: phone first, then tablet and desktop ---------- */
.main-narrow { max-width: var(--narrow); }
.main-wide { max-width: var(--max-width); }

.grid-2, .cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.cols > section, .cols > .stack { min-width: 0; }
.card-narrow { max-width: var(--narrow); }
.form-actions { display: flex; }
.form-actions .btn { flex: 1; }

.tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rows-cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.rows-cards .tile { height: 100%; align-items: center; }
.row-main small[dir="ltr"], .tile small[dir="ltr"] { align-self: flex-start; }
.checks { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }

/* Top navigation: shown on larger screens only (on a phone the home page tiles do this job) */
.main-nav { display: none; align-items: center; gap: 4px; flex: 1; margin-inline-start: 20px; }
.main-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
    color: var(--text); font-weight: 700; text-decoration: none;
}
.main-nav a:hover { background: var(--selected); }
.main-nav a[aria-current="page"] { background: var(--selected); color: var(--gold-text); }

@media (min-width: 820px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media (min-width: 900px) {
    .container { padding-inline: 32px; }
    .main { padding-block: 32px 64px; gap: 20px; }
    .header-row { min-height: 76px; }
    .main-nav { display: flex; }
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.35rem; }
    .card { padding: 24px; }
    .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
    .cols-form { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
    .stack { gap: 20px; }
    .tiles { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
    .rows-cards { gap: 16px; }
    .form-actions { justify-content: flex-start; }
    .form-actions .btn { flex: 0 0 auto; min-width: 220px; }
    .btn:hover { box-shadow: var(--shadow); }
    a.tile:hover { border-color: var(--gold-text); }
}

@media (min-width: 1200px) {
    .main-narrow { max-width: 680px; }
}

.facts dd[dir="ltr"] { align-self: flex-start; }
@media (min-width: 768px) {
    .main-nav { display: flex; }
}

/* Services and schedule screens */
.cat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 8px; }
.cat-head h2 { margin: 0; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rows-flat { gap: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-off .row-main > b { color: var(--text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.badge-price s { opacity: .65; margin-inline-start: 4px; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-block-start: 14px; }
.form-inline .field { flex: 1 1 160px; }
.section + .section, .card + .card { margin-block-start: 16px; }

/* Customer booking */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 6px; }
.steps li { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .78rem; color: var(--text-2); text-align: center; min-width: 0; }
.steps li span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; }
.steps li.on span { background: var(--gold); border-color: var(--gold); color: #121110; }
.steps li.on { color: var(--text); font-weight: 700; }
.steps li.done span { border-color: var(--gold-text); color: var(--gold-text); }
.steps b { font-weight: inherit; overflow-wrap: anywhere; }
.svc-group { margin: 14px 0 2px; font-weight: 700; color: var(--gold-text); }
.price-line { font-weight: 700; color: var(--text); }
.price-line s { font-weight: 400; color: var(--text-2); margin-inline-start: 6px; }
.sticky-bar { position: sticky; inset-block-end: 0; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); margin-block-start: 8px; }
.sticky-bar .btn { flex: 1 1 0; }
.sticky-total { flex: 1.2 1 0; font-size: 1.05rem; }
.total-row { font-size: 1.1rem; }
.day-card { border: 1px solid var(--line); margin: 0 0 12px; padding: 14px 16px; min-width: 0; }
.day-card legend { font-weight: 700; padding-inline: 6px; }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.time-pill input { position: absolute; opacity: 0; pointer-events: none; }
.time-pill { position: relative; display: block; }
.time-pill span { display: block; text-align: center; padding: 12px 8px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 700; cursor: pointer; }
.time-pill input:checked + span { background: var(--selected); border-color: var(--gold-text); color: var(--gold-text); box-shadow: 0 0 0 2px var(--gold-text) inset; }
.time-pill input:focus-visible + span { outline: 3px solid var(--gold-text); outline-offset: 2px; }
.time-pill.full span { opacity: .5; text-decoration: line-through; cursor: not-allowed; }
.map-box { position: relative; height: min(60vh, 420px); min-height: 280px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); overflow: hidden; background: #e8e2d6; touch-action: none; cursor: grab; user-select: none; }
.map-box.grabbing { cursor: grabbing; }
.map-layer { position: absolute; inset: 0; }
.map-tile { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; -webkit-user-drag: none; }
.map-pin { position: absolute; left: 50%; top: 50%; width: 40px; height: 52px; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.map-zoom { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; display: grid; gap: 6px; direction: ltr; }
.map-zoom button { width: 44px; height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.map-credit { position: absolute; inset-block-end: 0; inset-inline-start: 0; padding: 2px 6px; font-size: .7rem; background: rgba(255,255,255,.75); color: #333; direction: ltr; }
input[type="file"] { display: block; width: 100%; padding: 12px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.ref-box { font-size: 1.4rem; }
.ref-box b { letter-spacing: .12em; padding: 4px 12px; border: 1.5px dashed var(--gold-text); border-radius: var(--radius-sm); background: var(--selected); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 14px; }
.tabs a { padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text); font-weight: 700; }
.tabs a[aria-current="page"] { background: var(--selected); border-color: var(--gold-text); color: var(--gold-text); }
.status-pending { color: var(--gold-text); border-color: var(--gold-text); }
.status-confirmed { background: var(--ok-bg); color: var(--st-ok); border-color: var(--st-ok); }
.status-declined, .status-cancelled { background: var(--danger-bg); color: var(--st-danger); border-color: var(--st-danger); }
.building-photo { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.hero .btn-block + .btn-block { margin-block-start: 10px; }

.map-form { display: grid; gap: 12px; }
.map-form .map-box { height: calc(100svh - 380px); min-height: 340px; max-height: 680px; }
@media (min-width: 900px) { .map-form .map-box { height: 520px; } }
.map-box { overscroll-behavior: contain; }
.steps-6 { gap: 2px; }
.steps-6 li { font-size: .7rem; }
.steps-6 li span { width: 26px; height: 26px; font-size: .85rem; }
.price-card h2 { margin-block-start: 0; }
.choice-list { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; min-width: 0; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 14px 16px 14px 52px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-size: 1.05rem; }
[dir="rtl"] .choice span { padding: 14px 52px 14px 16px; }
.choice span::before { content: ""; position: absolute; inset-inline-start: 16px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); }
.choice input:checked + span { border-color: var(--gold-text); background: var(--selected); box-shadow: 0 0 0 2px var(--gold-text) inset; }
.choice input:checked + span::before { border-color: var(--gold-text); background: radial-gradient(circle, var(--gold-text) 0 45%, var(--bg) 50%); }
.choice input:focus-visible + span { outline: 3px solid var(--gold-text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* No pinch or double-tap zoom on phones (the map box sets its own touch-action) */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Dashboard blocks, message previews, close-visit form (0.6.0) */
.dash-block h2 { display: flex; align-items: center; gap: 8px; }
.dash-pending { border-inline-start: 4px solid var(--gold); }
.row-stack { flex-wrap: wrap; }
.row-stack > .close-form, .row-stack > .disclosure { flex: 1 1 100%; }
.close-form { display: flex; gap: 8px; align-items: center; }
.close-form input { flex: 1 1 auto; min-width: 0; }
.wa-preview { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--selected); font: inherit; line-height: 1.7; }
.sent-note { color: var(--text-2); }
.tag-help { margin: 8px 0 0; padding-inline-start: 1.2em; font-size: .9rem; }
.tag-list code { margin-inline-end: 6px; }
.btn-row { display: grid; gap: 10px; }
@media (min-width: 560px) { .btn-row { grid-template-columns: 1fr 1fr; } }

/* My day (0.7.0) */
.visit-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-end: 4px; }
.visit-time { font-size: 1.5rem; font-weight: 800; color: var(--gold-text); }
.visit { display: grid; gap: 12px; }
.visit h2 { margin: 0; }
.visit-done { opacity: .85; }
.section-title { margin-block: 8px 0; }
.btn-row-3 { grid-template-columns: repeat(3, 1fr) !important; }
.btn-quiet { border-style: dashed; }
.header-links { display: flex; gap: 8px; flex-wrap: wrap; }
.close-form .btn { white-space: nowrap; flex: 0 0 auto; }
.close-form input { flex: 1 1 80px; }

/* Week overview + closing spots (colours come from the theme tokens, so dark mode follows) */
.week-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;flex-wrap:wrap}
.week-nav{display:flex;gap:.4rem}
.week-legend{display:flex;flex-wrap:wrap;gap:.35rem;margin:.4rem 0 .6rem}
.lg{display:inline-block;font-size:.72rem;line-height:1;padding:.25rem .5rem;border-radius:999px;border:1px solid var(--c);color:var(--c);background:color-mix(in srgb,var(--c) 14%,transparent)}
.st-free{--c:var(--st-neutral)} .st-pending{--c:var(--st-pending)} .st-booked{--c:var(--st-ok)} .st-cancelled{--c:var(--st-danger)} .st-closed{--c:var(--gold-text)} .st-off{--c:var(--st-neutral)}
.week-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(14.5rem,1fr));gap:.5rem}
.week-day{border:1px solid var(--line);border-radius:.6rem;padding:.45rem .55rem;background:var(--surface);color:var(--text);font-size:.85rem}
.week-day.is-today{border-color:var(--gold)}
.week-day.is-off{opacity:.6}
.week-day header{display:flex;justify-content:space-between;align-items:center;gap:.4rem;margin-bottom:.3rem;flex-wrap:wrap}
.week-slots{list-style:none;margin:0;padding:0;display:grid;gap:.25rem}
.slot{display:grid;grid-template-columns:3.4rem 1fr auto;gap:.1rem .4rem;align-items:start;padding:.25rem .4rem;border-radius:.45rem;border-inline-start:4px solid var(--c);background:color-mix(in srgb,var(--c) 10%,transparent)}
.slot.is-passed{opacity:.5}
.slot-time{font-weight:700;font-size:.8rem;color:var(--text)}
.slot-body{display:flex;flex-direction:column;gap:.1rem;min-width:0;overflow-wrap:anywhere;color:var(--text)}
.slot-body small,.slot-dead{color:var(--text-2);font-size:.75rem}
.slot-dead{text-decoration:line-through}
.slot-act{justify-self:end}
.spot-menu summary{cursor:pointer;list-style:none;display:flex;flex-direction:column;gap:.1rem}
.spot-menu summary::-webkit-details-marker{display:none}
.spot-menu summary b{color:var(--text)}
.menu-panel{display:grid;gap:.25rem;margin-top:.3rem}
.menu-panel a{display:block;padding:.4rem .55rem;border:1px solid var(--line);border-radius:.4rem;background:var(--surface);color:var(--text);text-decoration:none;font-size:.82rem}
.menu-panel a:hover,.menu-panel a:focus{border-color:var(--gold)}
.spot-close{display:inline-block}
.spot-close summary{cursor:pointer;list-style:none;font-size:.72rem;padding:.2rem .5rem;border:1px solid var(--gold-text);border-radius:999px;color:var(--gold-text);background:transparent}
.spot-close summary::-webkit-details-marker{display:none}
.spot-close[open]{display:block;grid-column:1 / -1}
.spot-close form{display:grid;gap:.35rem;margin-top:.35rem;min-width:11rem}
.spot-close input[type=text]{width:100%}
.spot-reopen button{font-size:.72rem;padding:.2rem .5rem;border:1px solid var(--gold-text);border-radius:999px;color:var(--gold-text);background:transparent;cursor:pointer}
.slot:has(.spot-close[open]) .slot-act{grid-column:1 / -1;justify-self:stretch}

/* Day tabs: one agenda at a time, panels stacked in one grid cell so the height never changes */
.wk{display:block}
.wk-tabs{display:grid;grid-template-columns:repeat(7,1fr);gap:.3rem;margin-bottom:.5rem}
.wk-tab{display:flex;flex-direction:column;align-items:center;gap:.1rem;padding:.35rem .1rem;border:1px solid var(--line);border-radius:.6rem;background:var(--surface);color:var(--text);cursor:pointer;font-size:.72rem;user-select:none}
.wk-tab b{font-size:1rem;line-height:1.1}
.wk-tab.is-today{border-color:var(--gold)}
.wk-tab.is-off{opacity:.6}
.wk-dot{display:block;min-width:1.1rem;height:1.1rem;line-height:1.1rem;border-radius:999px;font-size:.68rem;font-style:normal;text-align:center}
.wk-dot.on{background:var(--st-ok);color:var(--bg);font-weight:700}
.wk-panels{display:grid}
.wk-panel{grid-area:1 / 1;visibility:hidden;border:1px solid var(--line);border-radius:.6rem;padding:.5rem .6rem;background:var(--surface);color:var(--text);font-size:.85rem;min-width:0}
.wk-panel.is-off{opacity:.75}
.wk-panel header{display:flex;justify-content:space-between;align-items:center;gap:.4rem;margin-bottom:.4rem;flex-wrap:wrap}
.wk>input:nth-of-type(1):checked~.wk-tabs .wk-tab:nth-child(1){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(1):checked~.wk-tabs .wk-tab:nth-child(1) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(1):checked~.wk-panels .wk-panel:nth-child(1){visibility:visible}
.wk>input:nth-of-type(1):focus-visible~.wk-tabs .wk-tab:nth-child(1){outline:2px solid var(--text);outline-offset:2px}
.wk>input:nth-of-type(2):checked~.wk-tabs .wk-tab:nth-child(2){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(2):checked~.wk-tabs .wk-tab:nth-child(2) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(2):checked~.wk-panels .wk-panel:nth-child(2){visibility:visible}
.wk>input:nth-of-type(2):focus-visible~.wk-tabs .wk-tab:nth-child(2){outline:2px solid var(--text);outline-offset:2px}
.wk>input:nth-of-type(3):checked~.wk-tabs .wk-tab:nth-child(3){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(3):checked~.wk-tabs .wk-tab:nth-child(3) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(3):checked~.wk-panels .wk-panel:nth-child(3){visibility:visible}
.wk>input:nth-of-type(3):focus-visible~.wk-tabs .wk-tab:nth-child(3){outline:2px solid var(--text);outline-offset:2px}
.wk>input:nth-of-type(4):checked~.wk-tabs .wk-tab:nth-child(4){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(4):checked~.wk-tabs .wk-tab:nth-child(4) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(4):checked~.wk-panels .wk-panel:nth-child(4){visibility:visible}
.wk>input:nth-of-type(4):focus-visible~.wk-tabs .wk-tab:nth-child(4){outline:2px solid var(--text);outline-offset:2px}
.wk>input:nth-of-type(5):checked~.wk-tabs .wk-tab:nth-child(5){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(5):checked~.wk-tabs .wk-tab:nth-child(5) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(5):checked~.wk-panels .wk-panel:nth-child(5){visibility:visible}
.wk>input:nth-of-type(5):focus-visible~.wk-tabs .wk-tab:nth-child(5){outline:2px solid var(--text);outline-offset:2px}
.wk>input:nth-of-type(6):checked~.wk-tabs .wk-tab:nth-child(6){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(6):checked~.wk-tabs .wk-tab:nth-child(6) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(6):checked~.wk-panels .wk-panel:nth-child(6){visibility:visible}
.wk>input:nth-of-type(6):focus-visible~.wk-tabs .wk-tab:nth-child(6){outline:2px solid var(--text);outline-offset:2px}
.wk>input:nth-of-type(7):checked~.wk-tabs .wk-tab:nth-child(7){background:var(--gold);border-color:var(--gold);color:var(--on-gold)}
.wk>input:nth-of-type(7):checked~.wk-tabs .wk-tab:nth-child(7) .wk-dot.on{background:var(--on-gold);color:var(--gold)}
.wk>input:nth-of-type(7):checked~.wk-panels .wk-panel:nth-child(7){visibility:visible}
.wk>input:nth-of-type(7):focus-visible~.wk-tabs .wk-tab:nth-child(7){outline:2px solid var(--text);outline-offset:2px}

/* Day agenda page */
.day-nav{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:.5rem;margin:.25rem 0 .6rem}
.day-nav-mid{text-align:center;display:flex;flex-direction:column;gap:.1rem}
.day-today{font-size:.8rem;color:var(--gold-text)}
.day-nav-bottom{margin-top:.8rem}
.day-closeall{margin-bottom:.5rem}
.slot-card{border-inline-start:5px solid var(--c);background:color-mix(in srgb,var(--c) 9%,var(--surface));margin-bottom:.6rem}
.slot-card.is-passed{opacity:.6}
.slot-card-head{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.slot-card-head .slot-act{margin-inline-start:auto}
.slot-reason{margin:.4rem 0 0}
.visit-box{margin-top:.6rem;padding-top:.6rem;border-top:1px dashed var(--line);display:grid;gap:.5rem}
.visit-box h2{margin:0;display:flex;gap:.4rem;align-items:center;flex-wrap:wrap}
.visit-box .facts a{color:var(--gold-text);text-decoration:underline}
.spot-close-link{font-size:.72rem;color:var(--gold-text)}

/* Reports */
.rep-kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem}
.rep-kpis div{display:flex;flex-direction:column;gap:.15rem}
.rep-kpis small{color:var(--text-2)}
.rep-kpis b{font-size:1.25rem}
.rep-bar{display:block;height:6px;border-radius:999px;background:var(--line);margin-top:.35rem;overflow:hidden}
.rep-bar i{display:block;height:100%;width:calc(var(--w) * 1%);background:var(--gold)}
