/*
 * ReserveWorx UI. Plain CSS, no build step: SiteGround serves this through a route.
 *
 * Look: the BrandWorx mobile app. White app bar, light grey page, rounded white
 * cards with a grey time strip, tinted icon circles, a bottom tab bar with a
 * pill on the active tab, and a floating action button.
 *
 * Workspace colors arrive as --brand / --accent (and readable derivatives) from
 * layouts/partials/brand-style.blade.php. Everything else is fixed.
 */
:root {
    --brand: #0F5C4D;
    --brand-strong: #0C4B3F;
    --brand-ink: #FFFFFF;
    --brand-text: #0F5C4D;
    --brand-soft: #DAE8E5;
    --brand-soft-ink: #0F5C4D;
    --accent: #F59E0B;
    --accent-ink: #111827;
    --accent-soft: #FDEFD2;
    --accent-soft-ink: #8A5A06;

    --ink: #1F2937;
    --ink-soft: #374151;
    --muted: #6B7280;
    --page: #F3F4F6;
    --surface: #FFFFFF;
    --strip: #E8EAED;
    --line: #E5E7EB;
    --line-strong: #D1D5DB;
    --ok: #15803D;
    --ok-soft: #DCFCE7;
    --link: #2563EB;
    --danger: #B91C1C;
    --danger-soft: #FEE2E2;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-lift: 0 8px 24px rgba(16, 24, 40, 0.16);
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --tabbar: 4.5rem;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.25rem; color: var(--ink-soft); }
p { margin: 0 0 0.75rem; }
a { color: var(--brand-text); }
code { font-size: 0.92em; background: var(--page); padding: 0.05em 0.35em; border-radius: 4px; }
img { max-width: 100%; }

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.icon { flex: none; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0.5rem; background: var(--surface); padding: 0.5rem 1rem; z-index: 50; }
.skip-link:focus { left: 0.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.num { text-align: right; white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.top-gap { margin-top: 1rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- Avatar ---------- */

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 700;
    font-size: 0.95rem;
    overflow: hidden;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; background: #fff; }
.avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }

/* ---------- Platform brand lockup ---------- */

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    color: #111827;
    text-decoration: none;
}
.brand-mark {
    display: block;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    max-width: none;
}
.brand-lockup--sm .brand-mark { width: 1.75rem; height: 1.75rem; }
.brand-lockup--lg .brand-mark { width: 3rem; height: 3rem; }
.brand-lockup-text {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}
.brand-wordmark {
    font-family: var(--font);
    font-weight: 700;
    font-style: italic;
    font-size: 1.35rem;
    letter-spacing: -0.045em;
    line-height: 1;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-lockup--sm .brand-wordmark { font-size: 1.1rem; }
.brand-lockup--lg .brand-wordmark { font-size: 1.55rem; }
.brand-lockup--on-dark { color: #FFFFFF; }
.brand-lockup--pill {
    color: #FFFFFF;
    background: #111827;
    border-radius: 999px;
    padding: 0.3rem 0.95rem 0.3rem 0.3rem;
    gap: 0.5rem;
}
.brand-lockup--pill.brand-lockup--lg { padding: 0.35rem 1.1rem 0.35rem 0.35rem; }
.brand-lockup--pill .identity-sub { color: rgba(255, 255, 255, 0.7); }
.side-identity .brand-lockup,
.app-identity .brand-lockup { min-width: 0; }
.side-identity .brand-wordmark { font-size: 1.2rem; }
.app-identity .brand-wordmark { font-size: 1.1rem; }

/* ---------- App shell (mobile first) ---------- */

.app-shell { min-height: 100vh; }
.app-side { display: none; }

.app-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
    background: var(--surface);
    box-shadow: 0 1px 0 var(--line), 0 6px 16px rgba(16, 24, 40, 0.04);
}
.app-identity, .side-identity { display: flex; align-items: center; gap: 0.75rem; min-width: 0; text-decoration: none; color: inherit; }
.identity-text { display: grid; min-width: 0; line-height: 1.2; }
.identity-name { font-size: 1.2rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.identity-sub { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.15rem; }
.app-bar-actions { display: flex; align-items: center; gap: 0.25rem; }
.location-switcher {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 1rem 0.65rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    min-width: 0;
}
.location-switcher a {
    flex: none;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    white-space: nowrap;
}
.location-switcher a.is-current { background: var(--brand-soft, #e7f3ef); border-color: var(--brand); font-weight: 600; }

.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    color: var(--ink);
    text-decoration: none;
    background: none;
    border: 0;
    cursor: pointer;
}
.icon-button:hover { background: var(--page); color: var(--ink); }
.dot-count {
    position: absolute;
    top: 0.1rem;
    right: -0.05rem;
    min-width: 1rem;
    height: 1.05rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
    border: 2px solid var(--surface);
    box-sizing: content-box;
}

.app-content {
    padding: 1.25rem 1rem calc(var(--tabbar) + var(--safe-bottom) + 1.25rem);
    max-width: 72rem;
}
.app-content:focus { outline: none; }

.tab-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.4rem 0.25rem calc(0.4rem + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
}
.tab-bar a {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    min-width: 0;
}
.tab-icon { display: grid; place-items: center; width: 4rem; height: 2.1rem; border-radius: 999px; }
.tab-bar a.is-active { color: var(--brand-soft-ink); font-weight: 600; }
.tab-bar a.is-active .tab-icon { background: var(--brand-soft); }
.tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab-bar:has(.tab-new) { grid-template-columns: repeat(6, minmax(0, 1fr)); }


.fab {
    position: fixed;
    right: 1rem;
    bottom: calc(var(--tabbar) + var(--safe-bottom) + 1rem);
    z-index: 25;
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 14px;
    background: var(--brand);
    color: var(--brand-ink);
    box-shadow: var(--shadow-lift);
    text-decoration: none;
}
.fab:hover { background: var(--brand-strong); color: var(--brand-ink); }

/* Below 1024px the shell used to pin the document and end the scrolling
   column above the tab bar. On a short screen — a phone, or Chrome
   zoomed until the CSS width is about 430px — that column only fit the app
   bar, the location tabs, and a title. Let every staff page grow with the
   document. The header scrolls away. The tab bar stays fixed, and the
   content padding keeps the last controls above that bar.
   From 1024px the tab bar is hidden and this does not apply. */
@media (max-width: 1023px) {
    body.app:has(.tab-bar) .app-bar {
        position: static;
    }
    body.app:has(.tab-bar) {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }
    body.app:has(.tab-bar) .app-shell,
    body.app:has(.tab-bar) .app-main {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }
    body.app:has(.tab-bar) .app-content {
        padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 1.25rem);
    }
}

/* Boats & gear keeps that same document scroll at 360–430px, where its own
   layout also stacks the minute fields. The shell rule above already covers
   every staff page below 1024px. */
@media (max-width: 430px) {
    body.app:has(.fab):has(.resources-page) {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }
    body.app:has(.fab):has(.resources-page) .app-shell,
    body.app:has(.fab):has(.resources-page) .app-main {
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }
    body.app:has(.fab):has(.resources-page) .app-content {
        padding-bottom: calc(var(--tabbar) + var(--safe-bottom) + 1.25rem);
    }
}

@media print {
    body.app:has(.fab),
    body.app:has(.fab) .app-shell,
    body.app:has(.fab) .app-main {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

.platform-content { padding-bottom: 3rem; }
.page > .panel + .panel, .page > .stat-grid + .panel { margin-top: 1.25rem; }
.spin { animation: spin 0.8s linear infinite; }
.spinner { display: inline-block; width: 0.9em; height: 0.9em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -0.1em; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: 16.5rem minmax(0, 1fr);
        background: linear-gradient(90deg, var(--surface) calc(16.5rem - 1px), var(--line) calc(16.5rem - 1px), var(--line) 16.5rem, transparent 16.5rem);
    }
    .app-side {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 1.25rem 0.9rem;
        overflow-y: auto;
    }
    .side-identity { padding: 0 0.35rem 0.25rem; }
    .side-identity .identity-name { font-size: 1.05rem; }
    .side-identity .brand-wordmark { font-size: 1.05rem; }
    .side-nav { display: grid; gap: 0.15rem; }
    .side-nav a {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.6rem 0.8rem;
        border-radius: 999px;
        color: var(--ink-soft);
        text-decoration: none;
        font-weight: 500;
    }
    .side-nav a:hover { background: var(--page); color: var(--ink); }
    .side-nav a.is-active { background: var(--brand-soft); color: var(--brand-soft-ink); font-weight: 600; }
    .side-nav form { margin: 0; }
    .side-nav button.nav-link, .side-nav span.nav-link {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        padding: 0.6rem 0.8rem;
        border: 0;
        border-radius: 999px;
        background: none;
        color: var(--ink-soft);
        font: inherit;
        font-weight: 500;
        text-align: left;
        cursor: pointer;
    }
    .side-nav button.nav-link:hover { background: var(--page); color: var(--ink); }
    .side-nav span.nav-link.is-quiet { cursor: default; }
    .side-group { margin: 1rem 0.8rem 0.3rem; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
    .side-user { margin-top: auto; padding: 0.75rem 0.8rem 0; border-top: 1px solid var(--line); display: grid; gap: 0.25rem; font-size: 0.875rem; color: var(--ink-soft); }
    .app-bar { padding: 0.75rem 2rem; }
    .app-bar .app-identity { visibility: hidden; }
    .app-content { padding: 1.75rem 2rem 4rem; }
    .tab-bar, .fab { display: none; }
}

/* ---------- Page structure ---------- */

.page { max-width: 72rem; }
.page.narrow { max-width: 46rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head .lede { margin: 0.25rem 0 0; color: var(--muted); font-size: 1rem; }
.crumb { margin: 0 0 0.35rem; font-size: 0.9rem; }
.crumb a { display: inline-flex; align-items: center; gap: 0.15rem; text-decoration: none; font-weight: 500; }

.split { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 900px) {
    .split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; }
    .split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stack { display: grid; gap: 1rem; align-content: start; }
.stack > .button { justify-self: start; }
.auth-panel .stack > .button { justify-self: stretch; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
fieldset.panel { margin: 0; }
fieldset.panel > legend { float: left; width: 100%; margin: 0 0 0.75rem; padding: 0; font-weight: 600; font-size: 1.125rem; }
fieldset.panel > legend + * { clear: both; }
.panel.attention { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.panel.new-link { box-shadow: inset 4px 0 0 var(--brand), var(--shadow); margin-bottom: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.panel-head h2 { margin: 0; }

.notice { background: var(--brand-soft); color: var(--brand-soft-ink); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.notice.attention { background: var(--accent-soft); color: var(--accent-soft-ink); }
.notice h2 { color: inherit; }
.notice .button { margin-top: 0.25rem; }
.recover-time { min-width: 0; }
.recover-time .field input { width: 100%; min-width: 0; max-width: 100%; }
@media (max-width: 390px) {
    .notice,
    .recover-time { min-width: 0; overflow-wrap: anywhere; }
    .recover-time .field input { width: 100%; min-width: 0; max-width: 100%; }
}

.undo-toast {
    position: fixed;
    z-index: 40;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(var(--tabbar) + var(--safe-bottom) + 0.75rem);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 28rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.18);
}
.undo-toast p { margin: 0; min-width: 0; }
.undo-toast .button { flex: 0 0 auto; background: #fff; color: var(--ink); }
@media (min-width: 1024px) {
    .undo-toast { bottom: 1.25rem; }
}
@media (max-width: 390px) {
    .undo-toast { display: grid; width: auto; min-width: 0; }
    .undo-toast p { min-width: 0; overflow-wrap: anywhere; }
    .undo-toast .button { width: 100%; min-width: 0; }
}

.flash { padding: 0.8rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: #14532D; }
.flash.bad { background: var(--danger-soft); color: var(--danger); }

.empty { color: var(--muted); margin: 0.25rem 0; }
.empty.small { font-size: 0.875rem; }
.error { color: var(--danger); font-size: 0.875rem; margin: 0.25rem 0 0; }
.figure { font-size: 2.25rem; font-weight: 700; margin: 0.25rem 0; letter-spacing: -0.02em; }

/* ---------- Home: welcome, stat cards, shortcuts ---------- */

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0.25rem 0 1.25rem; }
.welcome h1 { font-size: 1.4rem; font-weight: 500; margin: 0; }
.welcome .icon-button { color: var(--brand); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.25rem; }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; } }
.kicker { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.stat-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    min-height: 11.5rem;
}
button.stat-card { width: 100%; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.stat-card.compact { min-height: 0; }
.stat-card.compact .stat-body { padding: 0.75rem 0.9rem 0.9rem; }
.stat-card.is-selected { border-color: var(--brand); }
a.stat-card:hover { border-color: var(--line-strong); }
.stat-strip { display: flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.9rem; background: var(--strip); color: var(--ink-soft); font-size: 0.9rem; }
.stat-body { position: relative; display: flex; flex-direction: column; flex: 1; padding: 0.9rem 0.9rem 1rem; }
.stat-title { font-size: 1.05rem; font-weight: 500; padding-right: 3rem; line-height: 1.3; }
.stat-value { margin-top: auto; font-size: 2.4rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.stat-good { margin-top: auto; color: var(--ok); font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.stat-action { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.4rem; color: var(--link); font-weight: 500; text-decoration: none; }

.icon-circle { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; flex: none; }
.stat-body .icon-circle { position: absolute; top: 0.8rem; right: 0.8rem; }
.tone-ok { background: var(--ok-soft); color: var(--ok); }
.tone-brand { background: var(--brand-soft); color: var(--brand-soft-ink); }
.tone-accent { background: var(--accent-soft); color: var(--accent-soft-ink); }
.tone-late { background: var(--danger-soft); color: var(--danger); }
.tone-neutral { background: var(--page); color: var(--ink-soft); }

.app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem 0.5rem; }
@media (min-width: 900px) { .app-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.app-grid a, .app-grid button {
    display: grid;
    justify-items: center;
    gap: 0.55rem;
    color: var(--ink);
    text-decoration: none;
    text-align: center;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.25;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.app-circle {
    display: grid;
    place-items: center;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink-soft);
}
.app-grid a:hover .app-circle, .app-grid button:hover .app-circle { border-color: var(--brand); color: var(--brand-text); }
.app-grid .is-primary .app-circle { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- Forms ---------- */

.field { display: grid; gap: 0.35rem; }
.field > span { font-weight: 500; font-size: 0.875rem; color: var(--ink-soft); }
.field.compact { min-width: 8.5rem; }
.field.inline { display: inline-block; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="search"], select, textarea {
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    min-height: 2.875rem;
    width: 100%;
}
textarea { min-height: 0; resize: vertical; font-size: 0.875rem; line-height: 1.45; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--page); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); outline-offset: 0; }
input:disabled, select:disabled { background: var(--page); color: var(--muted); }
input.count { width: 6rem; }
.form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.form-row > .button { min-height: 2.875rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 0.2rem; accent-color: var(--brand); width: 1.15rem; height: 1.15rem; flex: none; }
fieldset.choice, fieldset.days { border: 0; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
fieldset.choice > legend, fieldset.days > legend { font-weight: 500; font-size: 0.875rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
fieldset.days { grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr)); }
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1.25rem; }
@media (max-width: 640px) { .filters .field.compact { flex: 1 1 9rem; min-width: 0; } }
@media (max-width: 640px) {
    .price-form .field.compact { flex: 1 1 calc(50% - 0.75rem); min-width: 0; }
    .price-form .button { width: 100%; }
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 0.55rem 1.05rem;
    min-height: 2.875rem;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.button:hover { background: var(--page); color: var(--ink); }
.button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.button.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); }
.button.danger { color: var(--danger); border-color: #FCA5A5; }
.button.danger:hover { background: var(--danger-soft); }
.button.small { min-height: 2.25rem; padding: 0.3rem 0.8rem; font-size: 0.875rem; }
.button.block { width: 100%; }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Segmented control ---------- */

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem; padding: 0.25rem; background: var(--strip); border-radius: 12px; }
@media (min-width: 560px) { .segmented { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.segmented button {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: none;
    border: 0;
    border-radius: 9px;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.page-tabs { grid-template-columns: repeat(min(var(--tabs, 2), 2), minmax(0, 1fr)); max-width: calc(var(--tabs, 2) * 210px); margin-bottom: 1rem; }
@media (min-width: 560px) { .page-tabs { grid-template-columns: repeat(var(--tabs, 2), minmax(0, 1fr)); } }
.page-tabs a { display: inline-flex; align-items: center; justify-content: center; font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); text-decoration: none; border-radius: 9px; padding: 0.55rem 0.8rem; white-space: nowrap; }
.page-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }

/* ---------- Status badges ---------- */

.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--page); color: var(--ink-soft); white-space: nowrap; }
.badge.large { font-size: 0.95rem; padding: 0.3rem 0.85rem; }
.badge-confirmed { background: var(--ok-soft); color: #14532D; }
.badge-held, .badge-pending_payment { background: var(--accent-soft); color: var(--accent-soft-ink); }
.badge-cancelled, .badge-no_show { background: var(--page); color: var(--muted); }
.badge-payment_exception { background: var(--danger-soft); color: var(--danger); }
.badge-below-minimum { background: var(--danger-soft); color: var(--danger); }
.badge-channel { background: var(--accent-soft); color: var(--accent-soft-ink); white-space: normal; overflow-wrap: anywhere; }
.badge-attention { background: var(--danger-soft); color: var(--danger); }

/* ---------- Schedule rail ---------- */

.time-rail { list-style: none; margin: 0; padding: 0; position: relative; }
.rail-item { display: grid; grid-template-columns: 4.75rem 1fr auto; gap: 0.25rem 0.9rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.time-rail .rail-item:first-child { border-top: 0; }
.rail-time { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.rail-date { display: block; font-weight: 400; color: var(--muted); }
.rail-body { display: grid; text-decoration: none; color: inherit; min-width: 0; padding-left: 0.75rem; border-left: 3px solid var(--brand); }
.rail-item.status-held .rail-body, .rail-item.status-pending_payment .rail-body { border-left-color: var(--accent); }
.rail-item.status-confirmed .rail-body { border-left-color: var(--ok); }
.rail-item.status-cancelled .rail-body, .rail-item.status-no_show .rail-body { border-left-color: var(--line-strong); }
.rail-body:hover .rail-title { color: var(--brand-text); text-decoration: underline; }
.rail-title { font-weight: 600; }
.rail-meta { color: var(--muted); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; }
.rail-item.status-cancelled .rail-title { text-decoration: line-through; color: var(--muted); }
.time-rail.compact .rail-item { grid-template-columns: 1fr; gap: 0.15rem; padding: 0.5rem 0; }
.time-rail.compact .badge { display: none; }
@media (max-width: 560px) {
    .rail-item { grid-template-columns: 1fr auto; }
    .rail-time { grid-column: 1 / -1; }
}

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

.calendar { display: grid; gap: 0.75rem; min-width: 0; }
.calendar-page { min-width: 0; max-width: 100%; }
@media (min-width: 1100px) { .calendar.is-week { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.calendar-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.85rem; box-shadow: var(--shadow); min-width: 0; }
@media (min-width: 1100px) { .calendar-day { min-height: 10rem; } }
.calendar-day.is-today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand), var(--shadow); }
.calendar-day h2 { display: flex; align-items: baseline; gap: 0.4rem; font-size: 1rem; }
.calendar-day .weekday { color: var(--muted); font-weight: 500; }
.calendar-day .daynum { font-size: 1.5rem; font-weight: 700; color: inherit; text-decoration: none; }
.calendar-day a.daynum:hover { color: var(--brand-text); }
.departure-chip { display: block; margin: 0.4rem 0 0; padding: 0.35rem 0.6rem; background: var(--brand-soft); color: var(--brand-soft-ink); border-radius: var(--radius-sm); font-size: 0.875rem; text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.departure-chip.is-below-minimum { background: var(--danger-soft); color: var(--danger); }
.calendar.is-month { gap: 0.35rem; width: 100%; }
.calendar-weekdays, .calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; min-width: 0; width: 100%; }
.calendar-weekdays { color: var(--muted); font-size: 0.75rem; font-weight: 600; text-align: center; }
.calendar.is-month .calendar-day { padding: 0.4rem; min-height: 5.5rem; }
.calendar.is-month .calendar-day.is-outside { opacity: 0.55; }
.calendar.is-month .calendar-day h2 { font-size: 0.85rem; }
.calendar.is-month .daynum { font-size: 1rem; }
.month-event, .month-more { display: block; margin-top: 0.2rem; padding: 0.1rem 0.25rem; border-radius: 4px; background: var(--page); font-size: 0.75rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: inherit; min-width: 0; max-width: 100%; }
.month-event.is-below { background: var(--danger-soft); color: var(--danger); }
.month-more { background: transparent; color: var(--brand-text); padding-left: 0; }
.calendar.is-agenda { gap: 0.75rem; }

/* Month tiles and the selected day's slots. */
.board { display: grid; gap: 1rem; min-width: 0; }
.board-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.35rem; }
.board-picker select {
    appearance: none;
    background-color: var(--brand);
    color: var(--brand-ink);
    font: inherit;
    font-weight: 700;
    font-size: 1.05rem;
    border: 0;
    border-radius: 999px;
    min-height: 2.5rem;
    padding: 0.35rem 1.7rem 0.35rem 0.9rem;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 0.95rem) 55%, calc(100% - 0.65rem) 55%;
    background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
    background-repeat: no-repeat;
}
.board-today { border-radius: 999px; margin-left: auto; }
.board-arrow { width: 2.5rem; height: 2.5rem; min-height: 2.5rem; padding: 0; border-radius: 999px; }
.board-weekdays, .board-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.board-weekdays { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-align: center; margin-bottom: 0.35rem; }
.board-day {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    min-height: 2.35rem;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: var(--brand-ink);
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
}
.board-day.is-outside:not(.is-selected) { background: color-mix(in srgb, var(--brand) 72%, white); }
.board-day.is-past:not(.is-selected) { background: color-mix(in srgb, var(--brand) 42%, #9CA3AF); }
.board-day.is-selected { background: var(--brand-strong); }
.board-day:hover { filter: brightness(1.08); }
.board-num {
    display: inline-grid;
    place-items: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.15rem;
}
.board-day.has-bookings .board-num { border: 2px solid currentColor; border-radius: 999px; }
.board-day-heading { margin: 0 0 0.7rem; font-size: 1.2rem; }
.slot-list { display: grid; gap: 0.65rem; }
.slot-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem 0.6rem;
    overflow: hidden;
    min-width: 0;
    padding: 0.7rem 0.75rem 0.95rem;
    border: 1.5px solid var(--slot, var(--brand));
    border-radius: 14px;
    background: color-mix(in srgb, var(--slot, var(--brand)) 16%, white);
    color: inherit;
    text-decoration: none;
}
.slot-main { display: grid; gap: 0.25rem; min-width: 0; }
.slot-line { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.slot-lock { display: inline-flex; color: color-mix(in srgb, var(--slot, var(--brand)) 70%, black); }
.slot-title { font-weight: 700; color: color-mix(in srgb, var(--slot, var(--brand)) 72%, black); min-width: 0; }
.slot-counts { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; color: color-mix(in srgb, var(--slot, var(--brand)) 45%, #374151); }
.slot-count { display: inline-flex; align-items: center; gap: 0.3rem; }
.slot-sq { width: 0.7rem; height: 0.7rem; border-radius: 2px; flex: none; }
.slot-sq.is-filled { background: var(--slot, var(--brand)); }
.slot-sq.is-open { border: 1.5px solid var(--slot, var(--brand)); }
.slot-card > .icon { color: color-mix(in srgb, var(--slot, var(--brand)) 65%, black); }
.slot-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: color-mix(in srgb, var(--slot, var(--brand)) 22%, white); }
.slot-bar > span { display: block; height: 100%; width: calc(var(--fill, 0) * 1%); background: var(--slot, var(--brand)); }
.slot-card.is-below { box-shadow: inset 0 0 0 1px var(--danger); }
@media (max-width: 800px) {
    .calendar-page:has(.board) { display: flex; flex-direction: column; }
    .calendar-page:has(.board) .page-head { order: 1; }
    .calendar-page:has(.board) .board { order: 2; }
    .calendar-page:has(.board) .filters { order: 3; }
}
@media (min-width: 960px) {
    .board { grid-template-columns: minmax(20rem, 28rem) minmax(0, 1fr); align-items: start; gap: 1.5rem; }
    .board-day { min-height: 3.1rem; }
    .board-daylist { position: sticky; top: 1rem; }
}
@media (max-width: 390px) {
    .calendar-page .page-head,
    .calendar-page .toolbar,
    .calendar-page .filters { display: grid; min-width: 0; }
    .calendar-page .toolbar .button,
    .calendar-page .filters .field { width: 100%; min-width: 0; }
    .calendar.is-month .calendar-day { padding: 0.15rem; min-height: 0; overflow: hidden; }
    .calendar.is-month .calendar-day h2,
    .calendar.is-month .calendar-week { min-width: 0; overflow: hidden; }
    .calendar.is-month .weekday { display: none; }
    .calendar-weekdays { font-size: 0.65rem; }
    .month-event, .month-more { font-size: 0.65rem; }
    .departure-chip .badge, .below-minimum-list .badge { white-space: normal; }
    .board, .board-grid, .board-day, .slot-card { min-width: 0; max-width: 100%; }
    .slot-card, .slot-title, .board-day-heading { overflow-wrap: anywhere; }
}

/* ---------- Lists, tables, facts ---------- */

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rows .row:first-child { border-top: 0; }
.rows.compact .row { padding: 0.5rem 0; }
.row a.grow { text-decoration: none; color: inherit; display: grid; }
.row a.grow:hover strong { color: var(--brand-text); text-decoration: underline; }
.row select { width: auto; }

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-list a, .menu-list button {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.85rem 0.25rem;
    border: 0;
    border-top: 1px solid var(--line);
    background: none;
    font: inherit;
    color: var(--ink);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}
.menu-list li:first-child a, .menu-list li:first-child button { border-top: 0; }
.menu-list .icon:last-child { margin-left: auto; color: var(--muted); }
.menu-text { display: grid; }
.menu-text small { color: var(--muted); font-size: 0.85rem; }

.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.plain-list li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 0.85rem; color: var(--muted); font-weight: 500; background: #FAFAFB; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFAFB; }
.table-scroll { overflow-x: auto; }
.trend-chart { display: block; width: 100%; height: 9rem; margin-bottom: 1rem; color: var(--brand); }
.trend-chart rect { fill: currentColor; }
.menu-list form { margin: 0; }

.booking-cards { display: none; list-style: none; margin: 0; padding: 0; }
@media (max-width: 720px) {
    .table-wrap.responsive { display: none; }
    .booking-cards { display: grid; gap: 0.75rem; }
}
.booking-card { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.75rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.9rem 1rem; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.booking-card .when { grid-column: 1 / -1; font-size: 0.875rem; color: var(--muted); }
.booking-card strong { font-weight: 600; }

.facts { display: grid; gap: 0.9rem; margin: 0; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.facts dt { font-size: 0.85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.facts > div { min-width: 0; }
.tag { display: inline-block; background: var(--brand-soft); color: var(--brand-soft-ink); border-radius: 999px; padding: 0.1rem 0.6rem; margin: 0 0.25rem 0.25rem 0; font-weight: 600; font-size: 0.85rem; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.9rem; }
.history li { display: flex; justify-content: space-between; gap: 1rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }
.payment-link { display: grid; gap: 0.5rem; margin-top: 1rem; min-width: 0; }
.payment-link input { width: 100%; min-width: 0; max-width: 100%; }

/* ---------- Time slots ---------- */

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.5rem; }
.slot { position: relative; display: grid; gap: 0.05rem; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0.6rem 0.75rem; cursor: pointer; background: var(--surface); }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot:hover { border-color: var(--brand); }
.slot:focus-within { outline: 3px solid var(--brand-soft); outline-offset: 1px; border-color: var(--brand); }
.slot-time { font-weight: 600; }
.slot-note { font-size: 0.8rem; color: var(--muted); }
.slot.is-picked { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.slot.is-picked .slot-note { color: inherit; opacity: 0.85; }
.slot.is-full { background: var(--page); color: var(--muted); cursor: not-allowed; }
.slot.is-full .slot-time { text-decoration: line-through; }

/* ---------- Fee disclosure partials ---------- */

.promo-page { min-width: 0; }
.promo-page .row { align-items: flex-start; }
.promo-page .field, .promo-page .stack, .promo-page .split { min-width: 0; }
.promo-page code, .promo-page h2 { overflow-wrap: anywhere; }
.promo-page .field input, .promo-page .field select { width: 100%; min-width: 0; max-width: 100%; }
.checkout-summary dl, .receipt-summary dl { margin: 0; display: grid; }
.checkout-summary .line, .receipt-summary .line { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.checkout-summary .line:first-child, .receipt-summary .line:first-child { border-top: 0; }
.checkout-summary dt, .receipt-summary dt { color: var(--ink-soft); min-width: 0; overflow-wrap: anywhere; }
.checkout-summary dd, .receipt-summary dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; text-align: right; }
.checkout-summary .total, .receipt-summary .total { border-top: 2px solid var(--ink); font-size: 1.15rem; }
.booking-fee-refund-terms { margin-top: 1rem; padding: 0.9rem 1rem; background: var(--page); border-radius: var(--radius); font-size: 0.875rem; }
.booking-fee-refund-terms h3 { margin: 0 0 0.4rem; font-size: 0.95rem; color: var(--ink); }
.booking-fee-refund-terms ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.booking-fee-refund-terms .disclosure-version { margin: 0.5rem 0 0; color: var(--muted); }

/* ---------- Share & embed ---------- */

.share-url { display: grid; gap: 0.6rem; }
.share-url input { font-size: 0.95rem; background: var(--page); }
.link-text { display: block; font-family: var(--font); padding: 0.75rem 0.9rem; background: var(--page); border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem; font-weight: 500; overflow-wrap: anywhere; user-select: all; }
@media (min-width: 560px) { .share-url { grid-template-columns: 1fr auto; align-items: stretch; } }
.share-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.share-actions .button { padding-left: 0.5rem; padding-right: 0.5rem; }
.copy-box { display: grid; gap: 0.6rem; }
.copy-box textarea { min-height: 7rem; }
.step-title { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.75rem; font-size: 1.05rem; font-weight: 600; }
.step-num { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 0.9rem; font-weight: 700; flex: none; }
.preview-stage { display: grid; place-items: center; gap: 0.75rem; padding: 1.5rem 1rem; background: repeating-linear-gradient(45deg, #FAFAFB, #FAFAFB 10px, #F5F6F8 10px, #F5F6F8 20px); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.preview-note { font-size: 0.85rem; color: var(--muted); text-align: center; margin: 0; }
.how-to { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; font-size: 0.925rem; color: var(--ink-soft); }
.copied { color: var(--ok); font-weight: 600; }
details.more { border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 1rem; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }

/* ---------- Branding ---------- */

.swatches { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.swatch { display: grid; justify-items: center; gap: 0.3rem; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 0.78rem; color: var(--ink-soft); width: 4.25rem; }
.swatch-chip { position: relative; width: 3rem; height: 3rem; border-radius: 50%; overflow: hidden; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch-chip i { position: absolute; inset: 0; }
.swatch-chip i + i { inset: auto 0 0 auto; width: 50%; height: 50%; border-top-left-radius: 100%; }
.swatch[aria-pressed="true"] .swatch-chip { box-shadow: 0 0 0 3px var(--ink); }
.color-field { display: flex; gap: 0.5rem; align-items: center; }
.color-field input[type="color"] { width: 3rem; height: 2.875rem; padding: 0.2rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; flex: none; }
.color-field input[type="text"] { max-width: 8.5rem; text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.logo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.phone-preview { width: min(20rem, 100%); margin: 0 auto; border: 8px solid #111827; border-radius: 2rem; overflow: hidden; background: var(--page); box-shadow: var(--shadow-lift); }
.phone-preview .pp-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.phone-preview .pp-name { font-weight: 600; font-size: 0.95rem; }
.phone-preview .pp-body { padding: 0.8rem; display: grid; gap: 0.6rem; }
.phone-preview .pp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.8rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.phone-preview .pp-card small { display: block; color: var(--muted); }
.phone-preview .pp-button { border-radius: 8px; padding: 0.4rem 0.7rem; font-weight: 600; font-size: 0.85rem; }
.phone-preview .pp-badge { display: inline-block; border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.75rem; font-weight: 600; }

/* ---------- Sign in ---------- */

body.auth { display: grid; place-items: center; min-height: 100vh; max-width: 100%; overflow-x: hidden; padding: 1rem; background: var(--page); }
.auth-panel { width: min(26rem, 100%); max-width: 100%; min-width: 0; box-sizing: border-box; background: var(--surface); border-radius: var(--radius-lg); padding: 2rem 1.5rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; margin-bottom: 1.5rem; max-width: 100%; min-width: 0; }
.auth-brand .brand-lockup { max-width: 100%; }
.auth-tenant { color: var(--ink); font-weight: 600; margin: 0; font-size: 1.1rem; }
.auth-panel h1 { margin-bottom: 1.25rem; overflow-wrap: anywhere; }
.auth-foot { margin: 1rem 0 0; font-size: 0.9rem; }
.auth-panel.wide { width: min(36rem, 100%); }
.auth-panel .stack, .auth-panel .field, .auth-panel input, .auth-panel select, .auth-panel .button { max-width: 100%; min-width: 0; }
.auth-panel .muted, .auth-panel #signup-host { overflow-wrap: anywhere; }
@media (max-width: 390px) {
    body.auth { padding: 0.75rem; }
    .auth-panel { padding: 1.25rem 0.9rem; }
    .auth-panel .button { white-space: normal; text-align: center; }
}
.welcome-shell { width: min(64rem, 100%); min-width: 0; display: grid; gap: 1.25rem; }
.welcome-intro { justify-self: center; }
.industry-board { min-width: 0; }
.industry-board h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.industry-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; list-style: none; margin: 0; padding: 0; min-width: 0; }
@media (min-width: 640px) { .industry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .industry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.industry-card { display: flex; align-items: center; gap: 0.65rem; min-width: 0; padding: 0.7rem 0.85rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; text-decoration: none; }
.industry-card span { min-width: 0; overflow-wrap: anywhere; }
.industry-counts { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; min-width: 0; }
.industry-counts li { max-width: 100%; min-width: 0; }
.industry-counts button { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0.35rem 0.7rem; font: inherit; color: inherit; cursor: pointer; }
.industry-counts button.is-selected { border-color: var(--brand); }
.industry-counts button span { color: var(--muted); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Resource schedule. The grid is wider than a 390px screen and scrolls sideways.
   The Move panel sits outside that grid so it stays full width on a phone. */

.schedule-page { min-width: 0; }
.schedule-scroll {
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.schedule-location { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; padding: 0.75rem 0.9rem 0.35rem; }
.schedule-location h2 { margin: 0; font-size: 1rem; }
.schedule-grid {
    display: grid;
    grid-template-columns: 8.75rem minmax(48rem, 1fr);
    min-width: 56.75rem;
}
.schedule-grid.is-week {
    grid-template-columns: 8.75rem minmax(56rem, 1fr);
    min-width: 64.75rem;
}
.schedule-corner, .schedule-label {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
}
.schedule-corner { border-bottom: 1px solid var(--line); }
.schedule-label {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    padding: 0.35rem 0.65rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    min-height: calc(var(--lanes, 1) * 2.75rem);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
}
.schedule-label small { font-weight: 500; color: var(--muted); }
.schedule-head, .schedule-lane { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); min-width: 0; }
.schedule-lane { border-bottom: 1px solid var(--line); }
.schedule-dayhead {
    position: relative;
    min-height: 2.6rem;
    padding: 0.35rem 0.4rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.schedule-dayhead + .schedule-dayhead, .schedule-daylane + .schedule-daylane { border-left: 1px solid var(--line); }
.schedule-dayhead.is-today, .schedule-daylane.is-today { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.schedule-daytitle, .schedule-dayhead .weekday { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.schedule-dayhead .daynum { display: block; font-size: 1.1rem; font-weight: 700; }
.schedule-hours { position: absolute; left: 0; right: 0; bottom: 0; height: 1rem; }
.schedule-hour { position: absolute; top: 0; font-size: 0.65rem; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.schedule-category {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0.35rem 0.75rem;
    background: var(--strip);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.schedule-daylane { position: relative; min-height: calc(var(--lanes, 1) * 2.75rem); }
.schedule-block {
    position: absolute;
    top: calc(var(--lane) * 2.75rem + 0.2rem);
    height: 2.35rem;
    display: flex;
    overflow: hidden;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    z-index: 1;
}
button.schedule-block {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
    box-sizing: border-box;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    background: transparent;
}
button.schedule-block:focus-visible,
.move-panel:focus,
.schedule-slot:focus-visible,
.schedule-booking:focus { outline: 3px solid var(--brand); outline-offset: 2px; }
.move-panel { max-width: 100%; min-width: 0; margin: 0 0 1rem; }
.move-panel .field { min-width: 0; }
.move-panel .field input { max-width: 100%; min-width: 0; }
.schedule-booking { max-width: 100%; min-width: 0; margin: 0 0 1rem; }
.move-panel p,
.schedule-booking p,
.schedule-location span { overflow-wrap: anywhere; }
.move-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.schedule-slot {
    position: absolute;
    top: 0;
    height: 100%;
    z-index: 0;
    margin: 0;
    padding: 0;
    border: 0;
    min-height: 2.75rem;
    background: transparent;
    cursor: pointer;
}
.schedule-slot:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.choice-picks { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hour-picks { display: flex; flex-wrap: nowrap; gap: 0.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.25rem; }
.choice-pick, .hour-pick { min-height: 2.75rem; }
.closure-page { min-width: 0; }
.closure-page .field { min-width: 0; }
.closure-page .overlap-list { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.closure-page .overlap-list a { overflow-wrap: anywhere; }
@media (max-width: 420px) {
    .closure-page .form-row { display: grid; grid-template-columns: minmax(0, 1fr); }
    .closure-page .form-row > .button,
    .closure-page .actions .button,
    .closure-page .row .button { width: 100%; justify-self: stretch; }
}
@media (max-width: 420px) {
    .move-panel .stack > .button,
    .move-suggestions .button { width: 100%; justify-self: stretch; white-space: normal; text-align: center; }
    .move-suggestions { display: grid; }
    .schedule-grid:not(.is-week) { min-width: 74.75rem; }
    .schedule-booking .stack > .button,
    .schedule-booking .choice-pick,
    .schedule-booking .actions .button { width: 100%; justify-self: stretch; white-space: normal; text-align: center; }
}
.schedule-closure {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(-45deg, rgba(15, 23, 42, 0.07), rgba(15, 23, 42, 0.07) 4px, rgba(15, 23, 42, 0.18) 4px, rgba(15, 23, 42, 0.18) 8px);
}
.schedule-block.is-booking { background: var(--brand-soft); color: var(--brand-soft-ink); }
.schedule-block.is-hold { background: var(--accent-soft); color: var(--accent-soft-ink); }
.schedule-block.is-quiet { opacity: 0.55; }
.schedule-block.is-selected { box-shadow: inset 0 0 0 2px var(--brand); }
.schedule-buffer {
    flex: none;
    height: 100%;
    background: repeating-linear-gradient(-45deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.05) 3px, rgba(15, 23, 42, 0.18) 3px, rgba(15, 23, 42, 0.18) 6px);
}
.schedule-core {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.1rem 0.35rem;
    line-height: 1.15;
}
.schedule-who, .schedule-when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; }
.schedule-who { font-weight: 600; }

.team-list { list-style: none; margin: 0; padding: 0; }
.team-card {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--line);
    min-width: 0;
}
.team-list .team-card:first-child { border-top: 0; }
.team-who { min-width: 0; }
.team-who strong, .team-who span { display: block; overflow-wrap: anywhere; }
.team-who span { color: var(--muted); font-size: 0.875rem; }
.team-card .form-row { align-items: stretch; }
.team-card select { width: 100%; min-width: 0; }
.team-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.location-picks { border: 0; margin: 0; padding: 0; display: grid; gap: 0.35rem; min-width: 0; }
.location-picks legend { font-weight: 600; padding: 0; }
.location-picks .check { min-height: 2.75rem; align-items: center; }
.location-picks .muted { margin: 0; }
@media (max-width: 420px) {
    .team-card .form-row,
    .team-actions { display: grid; }
    .team-card .button { width: 100%; white-space: normal; }
}

.tax-page { min-width: 0; }
.tax-page .page-head,
.tax-page .panel,
.tax-page .field,
.tax-page .stack,
.tax-page .row,
.tax-page .split,
.tax-page .actions { min-width: 0; max-width: 100%; }
.tax-page h1,
.tax-page .lede,
.tax-page .row strong,
.tax-page .row .muted { overflow-wrap: anywhere; }
.tax-page .field input { width: 100%; min-width: 0; max-width: 100%; }
.tax-applies { display: grid; gap: 0.65rem; margin: 0; padding: 0; border: 0; }
.tax-applies legend { font-weight: 500; font-size: 0.875rem; color: var(--ink-soft); }
.tax-applies .check {
    min-height: 2.75rem;
    align-items: center;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}
.tax-page .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
@media (max-width: 420px) {
    .tax-page .actions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .tax-page .button,
    .tax-page .actions .button,
    .tax-page .row .button { width: 100%; white-space: normal; text-align: center; }
    .tax-page .stack > .button { justify-self: stretch; }
}

.import-page { min-width: 0; }
.import-page .field,
.import-page .stack,
.import-page .panel { min-width: 0; }
.import-page .field input,
.import-page .field select { width: 100%; min-width: 0; max-width: 100%; }
.import-page input[type="file"] { max-width: 100%; }
.import-page .lede,
.import-page .muted,
.import-page .error { overflow-wrap: anywhere; }
.import-steps { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.import-steps li { padding: 0.35rem 0.7rem; border-radius: 999px; background: var(--page); color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.import-steps li.is-current { background: var(--brand-soft); color: var(--brand-soft-ink); }
.import-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.preview-list { display: grid; gap: 0.75rem; }
.preview-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem; display: grid; gap: 0.45rem; min-width: 0; }
.preview-card header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.preview-card dl { display: grid; gap: 0.35rem; margin: 0; }
.preview-card dl div { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.5rem; }
.preview-card dt { margin: 0; color: var(--muted); }
.preview-card dd { margin: 0; overflow-wrap: anywhere; }
.skip-list { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.skip-list li { overflow-wrap: anywhere; }
@media (max-width: 420px) {
    .import-page .stack > .button,
    .import-page .import-actions .button,
    .import-page .choice-picks .button { width: 100%; justify-self: stretch; white-space: normal; text-align: center; }
    .import-page .import-actions,
    .import-page .choice-picks { display: grid; grid-template-columns: minmax(0, 1fr); }
    .import-page .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .preview-card dl div { grid-template-columns: minmax(0, 1fr); }
}

#main .row[id^="asset-"],
#main .row[id^="pool-"] { scroll-margin-top: 5.5rem; }

.staff-search-layer {
    position: fixed;
    inset: 0;
    z-index: 70;
    min-width: 0;
}
.staff-search-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: var(--surface);
    cursor: pointer;
}
.staff-search {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    background: var(--surface);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.staff-search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}
.staff-search-bar h2 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; }
.staff-search-bar input {
    flex: 1;
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    color: inherit;
    padding: 0.35rem 0;
}
.staff-search-bar input:focus { outline: none; }
.staff-search-results { overflow: auto; flex: 1; min-height: 0; min-width: 0; }
.staff-search-group {
    margin: 0;
    padding: 0.85rem 1rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.staff-search-results ul { list-style: none; margin: 0; padding: 0; }
.staff-search-hit {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
    padding: 0.75rem 1rem;
    color: inherit;
    text-decoration: none;
}
.staff-search-hit.is-active { background: var(--brand-soft); }
.staff-search-title, .staff-search-meta { min-width: 0; overflow-wrap: anywhere; }
.staff-search-title { font-weight: 600; }
.staff-search-meta { color: var(--muted); font-size: 0.875rem; }
.staff-search-hint { margin: 0; padding: 0.85rem 1rem 1.1rem; color: var(--muted); overflow-wrap: anywhere; }
.staff-search-pages {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 1rem 0.85rem;
}
.staff-search-pages .button { min-height: 2.75rem; }
.staff-help-list { list-style: none; margin: 0; padding: 0.5rem 0; }
.staff-help-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.75rem;
    padding: 0.5rem 1rem;
}
.staff-help-list span { margin-left: auto; }
.staff-help-list kbd {
    display: inline-flex;
    align-items: center;
    min-height: 1.6rem;
    padding: 0 0.4rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--page);
    font: inherit;
    font-size: 0.85rem;
}
/* Equally specific to the narrow-screen document scroll, and later in the
   file, so an open search still locks the page on a short screen. */
body.app:has(.staff-search-layer) { overflow: hidden; }
@media (min-width: 720px) {
    .staff-search-backdrop { background: rgba(16, 24, 40, 0.45); }
    .staff-search {
        position: absolute;
        top: 8vh;
        left: 50%;
        transform: translateX(-50%);
        width: min(40rem, calc(100% - 2rem));
        height: auto;
        max-height: min(36rem, 80vh);
        border-radius: 16px;
        box-shadow: var(--shadow-lift);
        overflow: hidden;
        padding-top: 0;
        padding-bottom: 0;
    }
}

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

/* ---------- Setup step bar ---------- */

.setup-step-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: 12px; background: var(--accent-soft); color: var(--accent-soft-ink); }
.setup-step-bar .setup-step-links { display: inline-flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
