/* WhenAreWeFree? app layer (Track E — rule builder + schedule, mobile-first).
   Loaded AFTER blades.min.css (the classless base layer that styles semantic
   HTML: typography, form controls, buttons, details, dialog). This file holds
   only what Blades does not: the design tokens, the schedule grid, the rule
   chips, the session/calendar-link rows, and the pills. Our tokens override
   the --pico-* variables so both palettes stay themeable in one place and the
   contrast tests in src/assets.rs keep verifying them. */

:root {
    color-scheme: dark light;
    /* Mulberry dark palette. The three purple roles are --primary (buttons),
       --accent (links and focus), and --accent-bg (quiet surfaces). Text and
       control pairs pass WCAG AA. The light palette is an explicit
       prefers-color-scheme: light override below. */
    --bg: #0f0b15;
    --fg: #e9e2f2;
    --muted: #a79bb5;
    --border: #7d718c;
    --primary: #6b21a8;
    --on-primary: #f4effa;
    --accent: #c084fc;
    --accent-bg: #2d1d42;
    --accent-border: #c084fc;
    /* Required member state: a filled violet pill. */
    --required-fg: #f3e8ff;
    --required-bg: #3b2453;
    --required-border: #c084fc;
    /* Fully available window: green text on a soft green fill. */
    --ok: #86efac;
    --ok-bg: #14301f;
    /* Ink for filled semantic controls such as danger and lock states. */
    --on-accent: #14101b;
    /* Locked-session pill: amber, visually distinct from purple. */
    --lock: #f5c98a;
    --lock-bg: #332b1a;
    --lock-border: #d6b25e;
    /* Past-overlap cell: historical and non-actionable. */
    --past-bg: #211a2c;
    --past-border: #3a3048;
    /* Destructive actions and their soft fill. */
    --danger: #f08c8c;
    --danger-bg: #331d1d;
    /* Rule-builder chip outline (WCAG 1.4.11 non-text, >=3:1 on --bg). */
    --chip-border: #8a7d98;
    /* Schedule cell fill, distinct from the page background. */
    --cell-bg: #181121;
    --cell-border: #2a2234;
    --radius: 6px;
    /* Apple HIG target: 44x44 pt, not pixels. Map it to rem so it follows
       the user's text size. At the default 16px root, 2.75rem is 44px. */
    --control-height: 2.75rem;
    /* Text fields and choice targets use the taller form height (50px at the
       default root). Buttons keep the 44pt control height. */
    --field-height: 3.125rem;
    --space-s: 0.35rem;
    --space-m: 0.75rem;
    /* Vertical rhythm follows the Apple HIG 8-point grid. Use these named
       steps for unrelated blocks; do not invent one-off gaps. */
    --space-1: 0.25rem; /* 4pt */
    --space-2: 0.5rem; /* 8pt */
    --space-3: 0.75rem; /* 12pt */
    --space-4: 1rem; /* 16pt */
    --space-5: 1.5rem; /* 24pt */
    /* Availability list: derive the pill height and the visible-row cap from
       one set of sizes so the cap cannot drift from the pill spacing. */
    --availability-visible-rows: 3.4; /* three full pills plus a 0.4 peek */
    --availability-gap: 0.4rem;
    --availability-row-margin: 0.25rem;
    --availability-pill-border: 1px;
    --availability-pill-padding-block: 0.45rem;
    --availability-pill-padding-inline: 0.65rem;
    --availability-text-gap: 0.1rem;
    --availability-name-line: 1.3rem;
    --availability-range-line: 1.1rem;
    --availability-icon-gap: 0.5rem;
    --availability-icon-width: 1.1rem;
    --availability-icon-line: 1.2;
    --availability-range-font: 0.85rem;
    --availability-fade: 1rem;
    --availability-pill-block: calc(
        2 * var(--availability-pill-border)
        + 2 * var(--availability-pill-padding-block)
        + var(--availability-name-line)
        + var(--availability-text-gap)
        + var(--availability-range-line)
    );

    /* Map our palette onto the Blades variables so its semantic-HTML styles
       (buttons, inputs, links, details) render in our colors without
       duplicating any rule. */
    --pico-background-color: var(--bg);
    --pico-color: var(--fg);
    --pico-muted-color: var(--muted);
    --pico-primary: var(--accent);
    --pico-primary-background: var(--primary);
    --pico-primary-border: var(--accent);
    --pico-primary-inverse: var(--on-primary);
    --pico-border-width: 1px;
    --pico-border-radius: var(--radius);
    --pico-icon-date: none;
    --pico-icon-chevron: none;
}

/* Mulberry light palette. This is the explicit light override. It uses a
   porcelain page with a faint lilac cast instead of pure white, and the same
   three purple roles. Text and control pairs pass WCAG AA in the same tests
   as the dark mode. */
@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --bg: #f5f3f6;
        --fg: #1a1322;
        --muted: #575061;
        --border: #756b82;
        --primary: #6b21a8;
        --on-primary: #f4effa;
        --accent: #6b21a8;
        --accent-bg: #e9ddf4;
        --accent-border: #6b21a8;
        --required-fg: #3b0764;
        --required-bg: #ddd6fe;
        --required-border: #6d28d9;
        --ok: #166534;
        --ok-bg: #dcfce7;
        --on-accent: #f4effa;
        --lock: #92400e;
        --lock-bg: #fef3c7;
        --lock-border: #8a5a00;
        --past-bg: #e4daee;
        --past-border: #d5c8e2;
        --danger: #991b1b;
        --danger-bg: #fee2e2;
        --chip-border: #756b82;
        --cell-bg: #e9e0f0;
        --cell-border: #d5c8e2;
    }
}
/* Readable line length (Blades' .container philosophy applied to our
   `main`): full width with gutters on phones, capped and centered from
   small tablets up. 72ch ≈ 66-75% of a 1440px window; it also keeps the
   7-column schedule grid's cells above ~7rem, so the grid stays usable. */
html {
    scrollbar-gutter: stable;
}
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
body > leptos-island {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    min-height: 0;
}
main {
    flex: 1 0 auto;
    width: 100%;
    max-width: 72ch;
    margin-inline: auto;
    padding-inline: var(--pico-spacing);
    /* Breathing room above and below the content so the page never starts
       flush with the top of the viewport (or end flush at the bottom of a
       short page). Scales with the user's font size, not the viewport. */
    padding-block: 1.25em;
}
@media (min-width: 48rem) {
    main {
        padding-inline: 0;
    }
}
/* Blades scales the root font with the viewport (up to 131% on ultrawide),
   which compounds with a wide `main` into a page that feels oversized.
   Pin the root font to 100% so `ch` above stays honest and the page
   scales with the user's own browser font setting, not their monitor. */
:root {
    --pico-font-size: 100%;
}
/* Links and inline errors use the palette's semantic tokens (P1). */
a {
    color: var(--accent);
}

/* Shared gray/yellow/red message boxes. */
.note-box {
    display: block;
    margin-block: var(--space-2) var(--space-3);
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}
.note-box.is-warning {
    border-color: var(--lock-border);
    background: var(--lock-bg);
    color: var(--lock);
    font-weight: 600;
}
.note-box.is-error {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

/* Text-entry boundaries need 3:1 non-text contrast against their fills. */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    border-color: var(--border);
}

/* Text-like fields use the taller field height, on pointer and touch
   devices. Hidden, choice, and button inputs keep their own sizing. */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
select,
textarea {
    min-height: var(--field-height);
}

/* Blades embeds the date icon as a data URL, which the CSP blocks. Use the
   browser's native indicator instead of requesting an external image. */
input[type="date"] {
    background-image: none;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    margin: 0;
    opacity: 1;
}

/* --- Touch targets (Apple HIG: ≥44×44pt) ------------------------------- */
/* Radio and checkbox labels use the same taller field height as the text
   inputs. The native control stays its normal size; the label is the click
   and touch target. */
label:has(> input[type="radio"]),
label:has(> input[type="checkbox"]):not(.ew-chip) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--field-height);
}

/* Checkbox icons (Blind-review m9): Blades draws the checked checkmark as a
   `data:` SVG image, which our CSP `default-src 'self'` blocks — checked
   chips showed a blank square. Load the check from the app's own origin
   so `default-src 'self'` permits it without a data URL. */
input[type="checkbox"]:checked,
input[type="checkbox"]:checked:focus,
input[type="checkbox"]:checked:active {
    /* The check color must contrast with the CHECKBOX's background (Blades
       dark theme paints the checked box a dark navy, not the light accent).
       --on-accent is meant for text on the accent background, not the
       checkbox itself — it blended into the navy (1.12:1). Use a fixed
       near-white in dark mode and the accent ink in light. */
    background-image: url("/static/check.svg");
    background-size: 0.85rem 0.85rem;
    background-position: center;
    background-repeat: no-repeat;
}

@media (pointer: coarse) {

    /* Calendar-link rows: full-width tap. */
    .cal-links a {
        display: inline-block;
        min-height: var(--control-height);
        line-height: var(--control-height);
        padding: 0.55rem 0;
    }

    /* Session row controls: the `Edit` link measured 28×24px sitting beside
       destructive `Delete` — too small and too close (UI-audit M-Touch). */
    .session-edit {
        display: inline-block;
        min-height: var(--control-height);
        min-width: var(--control-height);
        line-height: var(--control-height);
        text-align: center;
    }

    /* Viewer-timezone picker, member-row actions, and rule controls: all
       measured under 44pt in the R2 audit — give every interactive control
       the same minimum target. */

}
/* Long, freely-entered user names / labels must never blow the layout. */
/* `.rule` is the rules list item holding a submitter's name; `.group h1` */
/* holds the group name in the member views.                              */
.group h1, .session-when, .cal-label, .cal-url {
    overflow-wrap: anywhere;
}

/* Pin default button hover and focus fills to the audited purple pair. */
button:hover,
button:focus,
button:focus-visible {
    --pico-primary-background: var(--primary);
    --pico-primary-border: var(--accent);
    background-color: var(--primary);
    border-color: var(--accent);
}

/* --- Dropdown affordances --------------------------------------------- */
/* Blades gives `<details>` summaries no box and `<select>` only a faint
   gray caret; both read as disabled input boxes. Give every disclosure
   trigger an explicit caret that rotates when open, and make selects show
   an accent border on hover/focus so they read as interactive controls. */

details > summary {
    position: relative;
    padding-right: 2rem;
}

details > summary::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0.6rem;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-70%) rotate(45deg);
    transition: transform 0.15s ease;
}

details[open] > summary::after {
    transform: translateY(-30%) rotate(225deg);
}

select:not([multiple]):hover,
select:not([multiple]):focus {
    border-color: var(--accent);
}

/* Group header: title and title actions. */
.group-head h1 {
    margin-bottom: 0;
}

/* Narrow headers (Blind-review n3): the title badge and copy button used
   alternating left/right alignment at 320px — an awkward zigzag. Stack the
   header's controls into one full-width row under the title. Mobile-first:
   the grid layout is the default; the min-width block restores the desktop
   flex header (E.4 keeps the stylesheet mobile-first). */
.group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem 0.75rem;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.group-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-2) var(--space-3);
    width: 100%;
    max-width: 72ch;
    margin-inline: auto;
    padding-inline: var(--pico-spacing);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border);
}
.group-page-name {
    grid-row: 1;
    color: var(--fg);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}
.group-page-name:hover,
.group-page-name:focus-visible {
    color: var(--accent);
}
.group-page-actions {
    display: flex;
    flex-wrap: wrap;
    grid-row: 2;
    justify-content: flex-start;
    gap: var(--space-1);
    margin-left: 0;
}
.group-page-actions .calendar-link,
.group-page-actions .group-page-back {
    padding-inline: var(--space-2);
    font-size: 0.9rem;
}

.group-page-back {
    flex: 0 0 auto;
    width: auto;
    min-height: var(--control-height);
    padding: 0 var(--space-2);
    white-space: nowrap;
}
.group-page-head .group-page-back-inline {
    display: none;
}
.group-page-head .group-page-back-stacked {
    display: inline-flex;
}
.group-page-head.is-stacked {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}
.group-page-head.is-stacked .group-page-name {
    grid-row: 1;
}
.group-page-head.is-stacked .group-page-actions {
    grid-row: 2;
    justify-content: flex-start;
    margin-left: 0;
}
.group-page-head.is-stacked .group-page-back-inline {
    display: none;
}
.group-page-head.is-stacked .group-page-back-stacked {
    display: inline-flex;
}
@media (min-width: 36rem) {
    .group-page-head:not(.is-stacked) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
    .group-page-actions {
        gap: var(--space-2);
    }
    .group-page-actions .calendar-link {
        padding-inline: var(--space-3);
        font-size: 1rem;
    }
    .group-page-actions .group-page-back {
        padding-inline: var(--space-2);
        font-size: inherit;
    }
    .group-page-head:not(.is-stacked) .group-page-name {
        grid-row: auto;
    }
    .group-page-head:not(.is-stacked) .group-page-actions {
        grid-row: auto;
        margin-left: auto;
    }
    .group-page-head:not(.is-stacked) .group-page-back-inline {
        display: inline-flex;
    }
    .group-page-head:not(.is-stacked) .group-page-back-stacked {
        display: none;
    }
}.group-page-menus {
    width: 100%;
    max-width: 72ch;
    margin-inline: auto;
    padding-inline: var(--pico-spacing);
}
@media (min-width: 48rem) {
    .group-page-head,
    .group-page-menus {
        padding-inline: 0;
    }
}
.group-head h1 {
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
}

@media (min-width: 36rem) {
    .group-head {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 1rem;
    }

    .group-head h1 {
        grid-column: auto;
        margin-bottom: 0;
    }
}
/* Add to Calendar is a page section between the title row and the tab bar.
   It is a normal block, not a floating panel, so the tabs move down instead
   of being covered. */
.calendar-section {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0.35rem 0 0.5rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
}

/* The group share panel holds the link and its QR code. */
.group-link-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0.25rem 0 0.5rem;
}
.group-link-row .group-link-url {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0;
}
.group-link-row button {
    flex: 0 0 auto;
    width: auto;
    margin: 0;
    white-space: nowrap;
}
.group-link-copy {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.group-qr {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 0.75rem auto;
    padding: 0.75rem;
    background: #f4effa;
    border-radius: var(--radius);
}
.group-qr svg {
    display: block;
    width: 220px;
    height: auto;
    max-width: 100%;
}
/* Without JavaScript the section stays visible and the toggle is hidden. */
.js .calendar-section {
    display: none;
}
.js .calendar-section.is-open {
    display: block;
}
.calendar-option h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}
/* Shared centered rule + italic label. Used for "or", "existing links…",
   and "other availability…". */
.divider-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0;
}
.divider-rule {
    flex: 1;
    border-top: 1px solid var(--border);
}
.divider-text {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-style: italic;
    white-space: nowrap;
}
.divider-text-wrap {
    display: block;
    white-space: normal;
    text-align: center;
}
summary.divider-label {
    position: relative;
    margin: 0;
    padding: 0;
    min-height: 0;
    list-style: none;
    cursor: pointer;
}
summary.divider-label::before {
    content: "";
    position: absolute;
    inset: -13px 0;
}
summary.divider-label::after {
    content: none;
}
summary.divider-label::-webkit-details-marker {
    display: none;
}
.divider-caret {
    display: inline-block;
    font-size: 0.75em;
    line-height: 1;
    transition: transform 120ms ease;
}
details[open] > summary.divider-label .divider-caret {
    transform: rotate(180deg);
}
.calendar-download {
    display: flex;
    width: 100%;
    margin: 0;
}
.calendar-section .cal-mint input:not([type="hidden"]) {
    width: 100%;
    max-width: none;
}
.calendar-section .cal-mint button[type="submit"] {
    width: 100%;
}

.muted {
    color: var(--muted);
}

/* Archived (fully-elapsed) locked sessions (J.2): collapsed behind a
   disclosure so the primary "Upcoming" list stays the focus, and visually
   de-emphasized. Lists stay individually deletable. */
details.archived {
    margin: 0.65rem 0;
}
/* Archived rows dim toward muted; 0.85 keeps even the muted duration text
   above 4.5:1 in both palettes (0.75 dropped it to 3.84:1 in light). */
details.archived .session {
    opacity: 0.85;
}
.archived .archived-list {
    margin-top: 0.35rem;
}

/* Skip link (a11y): visually hidden until a keyboard user focuses it, so they
   can jump straight to the page's main landmark. */
.skip-link {
    position: fixed;
    top: -100%;
    left: 0.5rem;
    z-index: 2;
    background: var(--bg);
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
}
.skip-link:focus-visible {
    top: 0.5rem;
}

/* Visible keyboard focus for every interactive control (a11y). */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Rule builder (E.1): day chips + hidden plain-field fallback. */

.ew-chip {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    min-width: 0;
    min-height: var(--field-height);
    border: 1px solid var(--chip-border);
    border-radius: var(--radius);
    padding: 0;
    margin: 0;
    cursor: pointer;
}
/* Blades gives a checkbox label `width: fit-content`, which collapses these
   chips to their text width inside the 7-column grid. Fill the track instead. */

.ew-chip > span {
    min-width: 0;
    overflow: hidden;
    font-size: 0.75rem;
}

.ew-chip input[type="checkbox"] {
    flex: 0 0 14px;
    width: 14px;
    min-width: 14px;
    height: 20px;
    margin: 0;
}

.ew-chip:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-bg);
}

/* Enhancement-only controls stay out of the no-JavaScript baseline. */
.js-only,
.group-link-row .js-only {
    display: none;
}
.js .no-js-only {
    display: none;
}
html:not(.js) .time-clear {
    display: none;
}
.js .js-only {
    display: block;
}
.js .group-link-row .js-only {
    display: inline-block;
}

.field {
    display: grid;
    gap: var(--space-2);
}

.field-label-field {
    margin-bottom: calc(var(--pico-spacing) * 0.375);
}

.field > .field-label {
    display: block;
    color: var(--pico-color);
    font-weight: var(--pico-form-label-font-weight, var(--pico-font-weight));
}

.field input,
.field select {
    width: 100%;
}

/* Schedule grid (E.2, D12): weekday columns × weeks in scope on desktop, stacked
   per-date cards on mobile. Mobile-first — the stacked layout is the default,
   and the 7-column grid only activates at ≥48rem, so there is never horizontal
   overflow on a phone. */
.schedule {
    overflow-x: hidden;
}

.schedule-grid {
    display: block;
}

/* Mobile (M-C): stacked date cards had zero separation while week labels
   carried all the spacing — adjacent cards visually fused. 4px mirrors the
   desktop grid gap. Mobile-first: this is the default; the min-width 48rem
   block resets it for the desktop grid (which already has a 4px column gap). */
.schedule-grid .grid-cell {
    margin-bottom: 4px;
}

/* No column headers on mobile — each date is its own stacked card. */

.schedule-week {
    margin: 0 0 0.9rem;
}

.week-label {
    font-weight: 600;
}

.grid-cell {
    display: block;
    padding: 0.4rem 0.35rem;
    border: 1px solid var(--cell-border);
    border-radius: var(--radius);
    background: var(--cell-bg);
}

/* Touch devices (Apple HIG / coarse pointer): a touch more cell breathing
   room so the date row and window chips never feel cramped on phones.
   Sits AFTER the base rule — same specificity, later wins (E.4 keeps the
   stylesheet mobile-first; this is a pointer query, not a width one). */
@media (pointer: coarse) {
    .grid-cell {
        padding: 0.6rem 0.7rem;
    }
}
/* Empty placeholder cells carry no date; collapse them on mobile. */

/* The cell header (L.4 revised): one line, weekday left ("Sat", muted) and
   day-of-month right ("7", bold and larger) — `space-between` pins the two
   to the cell edges. Same font sizes/weights as the old stacked layout; the
   line-height matches so the row height does not jump. */
.cell-date {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.cell-day {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.2;
}

.cell-windows {
    font-size: 0.85rem;
}

.cell-windows .window {
    margin-left: 0.5rem;
}

/* Window rows (PLAN-6 UI revision): a mini table inside the card — range on
   the left, `n/m · duration` meta on the right, hairline between rows. */
.window-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.1rem 0.4rem;
    padding-block: 0.15rem;
}

.window-row + .window-row {
    border-top: 1px solid var(--cell-border);
}

/* The time link is a 44pt touch target. Without its own flex box the text sat
   at the top of that target, so the row separator looked far below the first
   line and close to the second. Center the label inside the target. */
.cell-windows .window-row a.window {
    display: inline-flex;
    align-items: center;
}

/* Do not add row padding outside the first and last rows: the cell padding
   already supplies the outer gap, and the row padding only belongs between
   the separator lines. */
.cell-windows > .window-row:first-child {
    padding-block-start: 0;
}
.cell-windows > .window-row:last-child {
    padding-block-end: 0;
}

/* The range string must never break mid-time ("10:00–" / "12:00"): the en
   dash is a break opportunity, so pin the whole range to one line. When the
   column is too narrow for range + meta, the meta wraps BELOW the range
   (flex-wrap on .window-row) instead of splitting the times. */
.window {
    white-space: nowrap;
}
a.window {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
}
a.window:hover {
    text-decoration: underline;
}

/* The meta chunk on each row: count + duration, muted and small. */
.headcount {
    color: var(--muted);
    white-space: nowrap;
}

/* The row meta (count · duration) is the only right-aligned piece. The time
   link stays at the left edge. */
.window-row > .headcount {
    margin-inline-start: auto;
}

.lock-icon {
    margin-inline-end: 0.3rem;
    font-size: 0.95em;
}
.pending-icon {
    margin-inline-end: 0.3rem;
    font-size: 0.95em;
}

/* Emphasis for a day the whole group can meet (D12): available windows get a
   highlighted accent; blank days stay muted. */
.cell-windows.available .window {
    font-weight: 600;
    color: var(--accent);
}

/* Empty day: a bare muted dash — the old italic "no overlap" made every
   blank cell look like an error. */

/* Past cells (L.5, UI-audit A2): dimmed via explicit colors, NOT parent
   opacity — opacity 0.45 dropped every child's contrast below AA (1.98:1 for
   muted text). --past on --past-bg passes 4.5:1 in both palettes
   (light 4.7:1, dark ~4.9:1). A past day renders as evidence folks voted (not
   an actionable slot): softer background, all text in --past. The lock pill
   keeps its own emphasis colors (contrast 9.1:1 on --lock-bg light). */

/* Empty cells (Blind-review M4): a day with no availability, no locks, and
   no remaining overlap is a bare "—". On mobile these collapse from a full
   card into a compact one-line chip, so the schedule stops burying the
   availability form under 3,000+px of empty days. Desktop keeps the
   full-height cells to hold the calendar columns open. */
/* Mobile-first (E.4): collapsed by default; the desktop min-width block
   below restores full-height cells to hold the calendar columns open. */

/* Today (Blind-review n2): the current date gets an accent outline and a
   small "today" tag on the date row so the present is findable at a glance
   across the scope range. */
.grid-cell.today {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
}

.week-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    margin-bottom: 0.4rem;
}
.week-head .week-label {
    margin: 0;
}
.custom-time-button {
    width: 100%;
}
.more-weeks-form {
    margin-top: 0.5rem;
}
.more-weeks-form button,
.load-more-button {
    width: 100%;
    margin: 0;
}
.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem 0.75rem;
    margin: 0;
    margin-inline-start: auto;
    font-size: 0.8rem;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.legend-item .pending-icon,
.legend-item .lock-icon {
    margin-inline-end: 0;
}
.legend-check {
    color: var(--accent);
}
.legend-link {
    color: inherit;
    text-decoration: none;
}
.legend-link:hover {
    text-decoration: underline;
}

.grid-cell.today .cell-date::after {
    content: "today";
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--accent);
    text-transform: lowercase;
    letter-spacing: 0.02em;
    margin-inline-start: 0;
}

/* A scheduled session shares the availability table. Its time is orange, and
   the "also free…" label replaces the separator under it. */

/* Calendar links (P1): one flex row per token, with the action at the end. */
.cal-minted {
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    padding: var(--space-m);
    margin: 0 0 var(--space-m);
}
.cal-minted p {
    margin: 0 0 var(--space-s);
}
.cal-minted p:last-child {
    margin-bottom: 0;
}
.cal-url {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-s) var(--space-m);
    background: var(--bg);
    overflow-wrap: anywhere;
    user-select: all;
}

.cal-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-s);
}
.cal-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-s);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-s) var(--space-m);
}
.cal-copy {
    display: flex;
    flex: 1 1 10rem;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.cal-label {
    min-width: 0;
    overflow-wrap: anywhere;
}
.cal-meta {
    color: var(--muted);
    font-size: 0.9rem;
}
.revoked-badge {
    display: inline-block;
    border: 1px solid var(--past-border);
    border-radius: var(--radius);
    background: var(--past-bg);
    color: var(--muted);
    font-size: 0.8rem;
    padding: 0.05rem 0.45rem;
}

/* Locked sessions (P1): one flex row per session, so Delete stays inline. */
.sessions {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--space-s);
}
.session {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-s) var(--space-m);
}
.session-copy {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.75rem;
    min-width: 0;
}
.session-when {
    flex: 0 1 auto;
}
.session .session-edit {
    flex: 0 0 auto;
    align-self: center;
    margin-inline-start: auto;
}
/* Forms (P1): shared field shape for controls outside the rule builder.
   Blades already styles bare inputs/selects; these only set the width and
   stacking for the app's form sections. */
/* Session-form controls fill the container. The start/end pair shares the
   row: 50% each without JavaScript, 33% each beside the duration label with
   JavaScript. */
.session-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
.session-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.session-actions {
    display: flex;
    align-items: stretch;
    gap: var(--space-3);
    margin-top: var(--space-2);
}
.session-actions .session-submit,
.session-actions .session-cancel-button {
    flex: 1 1 0;
    width: auto;
    min-height: var(--control-height);
}
.session-cancel-button {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.session-cancel-button:hover,
.session-cancel-button:focus {
    background: var(--danger-bg);
}

.session-form input:not([type="checkbox"]):not([type="hidden"]),
.cal-mint input:not([type="hidden"]) {
    width: 100%;
    display: block;
}

.weekday-badge {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-weight: 600;
}
.weekday-badge {
    flex: 0 0 auto;
}
.duration-box strong {
    font-size: 1rem;
}
.js .weekday-badge {
    display: inline-flex;
}

.override-field {
    margin: 0 0 1rem;
}
.override-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--field-height);
    font-weight: 600;
}
.override-field input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
}

.submission-section {
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.session-form .submission-section {
    margin-block: 0;
}
.submission-section .override-field,
.session-form .override-field {
    margin-bottom: 0;
}

.date-row {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
}
.date-row input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0;
}

/* Standalone session scheduler: the selected window, the attendance lists,
   and the prefilled form all share one page. */

.scheduler-status {
    margin: 0.75rem 0 0.35rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
}
.scheduler-status.partial {
    border-color: var(--lock-border);
    background: var(--lock-bg);
    color: var(--lock);
}
.scheduler-status.full {
    border-color: var(--ok);
    background: var(--ok-bg);
    color: var(--ok);
}
.scheduler-status.none {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}
.people-columns {
    display: grid;
    gap: 0.75rem;
    margin: 0.75rem 0 1rem;
}
.people-group h2 {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
}
.people-group ul {
    margin: 0;
    padding: 0;
}
.people-group .availability-list {
    padding: 0;
}
.people-group li {
    overflow-wrap: anywhere;
}
.people-group p {
    margin: 0;
}
.availability-scroll {
    max-height: calc(
        var(--availability-visible-rows) * var(--availability-pill-block)
        + (var(--availability-visible-rows) - 1) * var(--availability-row-margin)
        + (var(--availability-visible-rows) - 1) * var(--availability-gap)
    );
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    container-type: scroll-state;
}
.availability-scroll:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius);
}
.availability-scroll::before,
.availability-scroll::after {
    content: "";
    display: block;
    position: sticky;
    block-size: var(--availability-fade);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.availability-scroll::before {
    top: 0;
    margin-block-end: calc(-1 * var(--availability-fade));
    background: linear-gradient(to bottom, var(--bg), transparent);
}
.availability-scroll::after {
    bottom: 0;
    margin-block-start: calc(-1 * var(--availability-fade));
    background: linear-gradient(to bottom, transparent, var(--bg));
}
/* Fallback for browsers without scroll-state queries. */
@supports not (container-type: scroll-state) {
    .availability-scroll.has-overflow::after {
        opacity: 1;
    }
}@supports (container-type: scroll-state) {
    @container scroll-state(scrollable: block-start) {
        .availability-scroll::before {
            opacity: 1;
        }
    }
    @container scroll-state(scrollable: block-end) {
        .availability-scroll::after {
            opacity: 1;
        }
    }
}@media (prefers-reduced-motion: reduce) {
    .availability-scroll::before,
    .availability-scroll::after {
        transition: none;
    }
}.availability-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--availability-gap);
}
.availability-member {
    display: flex;
    align-items: center;
    gap: var(--availability-icon-gap);
    min-block-size: var(--availability-pill-block);
    margin: 0 0 var(--availability-row-margin);
    padding: var(--availability-pill-padding-block) var(--availability-pill-padding-inline);
    border: var(--availability-pill-border) solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
}
.availability-text {
    display: flex;
    flex-direction: column;
    gap: var(--availability-text-gap);
    min-width: 0;
}
.availability-icon {
    flex: 0 0 auto;
    width: var(--availability-icon-width);
    line-height: var(--availability-icon-line);
    text-align: center;
}
.availability-member.is-full .availability-icon {
    color: var(--ok);
}
.availability-member.is-partial .availability-icon {
    color: var(--lock);
    font-weight: 700;
}
.availability-member.is-unavailable .availability-icon {
    color: var(--danger);
}
.availability-name {
    font-weight: 600;
    line-height: var(--availability-name-line);
    overflow-wrap: anywhere;
}
.availability-ranges {
    color: var(--muted);
    font-size: var(--availability-range-font);
    line-height: var(--availability-range-line);
    overflow-wrap: anywhere;
}
@media (min-width: 44rem) {
    .people-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
/* Destructive controls (P1): danger treatment for delete/stop-sharing.
   Background must be transparent: Blades gives buttons a solid primary
   (accent) background, and --danger text on that accent failed contrast
   (1.24:1 light / 1.06:1 dark — UI audit C1). On the card background the
   danger text passes AA; hover tints with --danger-bg. */

/* Task-first UI: expose three primary tasks and keep advanced controls in
   native disclosures. The compact schedule contains only useful dates. */
.task-links {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    margin-block: var(--space-3) var(--space-2);
}
.task-links a {
    display: inline-block;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    text-decoration: none;
}
.task-links a.active {
    background: var(--primary);
    color: var(--on-primary);
}
.task-section {
    margin-block: 1rem;
}
.task-section > h2 {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.plan-filter-wrap {
    width: 100%;
}
.plan-required {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    margin: -0.35rem 0 0.75rem;
}
.plan-required .note-box {
    display: flex;
    flex: 1 1 16rem;
    align-items: center;
    min-height: var(--control-height);
    margin: 0;
    line-height: 1.3;
}
.plan-required-edit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
}
.plan-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem 1.25rem;
    width: 100%;
    margin: 0.75rem 0;
}
.plan-filter-field {
    display: flex;
    flex: 1 1 18rem;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
}
.plan-filter label {
    margin: 0;
    font-weight: 600;
}
.plan-min-field {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-inline-start: auto;
}
.plan-min-field input {
    width: 5.5rem;
    min-height: var(--control-height);
    margin: 0;
    text-align: center;
}
.plan-filter select,
.plan-filter button {
    min-height: var(--control-height);
    margin: 0;
}
.plan-filter button {
    flex: 0 0 auto;
    width: auto;
}
.scheduled-sessions {
    margin: 0.5rem 0 1rem;
}
.sessions-empty {
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.next-session {
    padding: 0.75rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    background: var(--accent-bg);
}
.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.next-session-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.next-session-copy {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.75rem;
    min-width: 0;
}
.next-when {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}
.next-session .session-edit {
    flex: 0 0 auto;
    align-self: center;
    margin-inline-start: auto;
}
.scheduled-sessions h3 {
    margin: 1rem 0 0.35rem;
    font-size: 1rem;
}
.task-panel, .secondary-panel {
    margin-block: 0.65rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.task-panel > summary {
    color: var(--accent);
    font-weight: 600;
}
.secondary-panel {
    background: var(--cell-bg);
}
.task-panel summary, .secondary-panel summary {
    cursor: pointer;
}

.schedule-grid {
    display: block;
}
.schedule-week {
    display: block;
    margin-block: 0.8rem;
}
.week-label {
    margin: 0 0 0.4rem;
    font-size: 1rem;
}
.week-cells {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
}
.grid-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: 0.75rem;
    min-height: 0;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--cell-border);
    background: var(--cell-bg);
    text-align: left;
}
.cell-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.1rem;
    min-width: 2.5rem;
}
.cell-day {
    font-size: 1.25rem;
}
.cell-windows {
    justify-content: flex-start;
    text-align: left;
}
.window-row {
    justify-content: flex-start;
    gap: 0.35rem 0.6rem;
}
.cell-windows a.window {
    display: inline-block;
    margin: 0;
    color: var(--fg);
    font-weight: 400;
    cursor: default;
}
.js .cell-windows a.window {
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}
.schedule-empty {
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
@media (pointer: coarse) {
    .task-panel summary, .secondary-panel summary, .task-links a {
        min-height: var(--control-height);
        align-items: center;
    }
}
@media (min-width: 48rem) {
    .week-cells {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .task-links {
        flex-wrap: nowrap;
    }
}
.schedule-grid.plan-grid .week-cells {
    grid-template-columns: minmax(0, 1fr);
}
.schedule-grid.plan-grid .grid-cell {
    align-content: start;
    align-items: start;
}

/* Hit areas and compact advanced forms. */
.task-panel summary, .secondary-panel summary {
    display: flex;
    align-items: center;
    min-height: var(--control-height);
}
.cell-windows a.window, .session-edit {
    min-width: var(--control-height);
    min-height: var(--control-height);
}
.session-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.new-group {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height);
}
.ew-chip input[type="checkbox"] {
    border-color: var(--border);
}

.headcount {
    font-size: 0.875rem;
}

.task-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}
.task-links a {
    padding: 0.55rem 0.25rem;
    font-size: 0.85rem;
    text-align: center;
}

.cal-url {
    width: 100%;
}
#cal-copy-status {
    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;
}
.site-header {
    padding: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.site-footer {
    flex-shrink: 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.site-footer-inner {
    max-width: 72ch;
    margin: 0 auto;
    padding: 0.6rem var(--pico-spacing);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}
@media (min-width: 48rem) {
    .site-footer-inner {
        padding-inline: 0;
    }
}.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    max-width: 72ch;
    margin-inline: auto;
    padding: 0.6rem var(--pico-spacing);
}
@media (min-width: 48rem) {
    .site-header-inner {
        padding-inline: 0;
    }
}.site-header:has(.settings-panel.is-open) .site-header-inner {
    padding-bottom: 0;
}
.site-header .settings-panel {
    width: 100%;
    max-width: 72ch;
    margin: var(--space-2) auto;
}
.site-brand {
    flex-shrink: 0;
    color: var(--fg);
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
}
.site-header-actions {
    display: flex;
    align-items: center;
    justify-content: start;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-width: 0;
}

/* The timezone field is a datalist input. Keep its label available to screen
   readers without taking header space. */

/* Time display preference. The select is JS-only: without it the page stays
   on the server's 24-hour format. */

/* Hydration state: the server renders the no-JS layout, then the same-origin
   boot script adds `.js` before first paint. Hide the controls that only the
   hydrated UI owns, so the no-JS markup never flashes. If hydration fails,
   `ui-loader.js` removes `.js` and the no-JS layout returns. */
.js:not(.hydrated) .task-section,
.js .group.tz-pending .task-section {
    visibility: hidden;
}
.tz-loading {
    display: none;
}
.js .tz-loading {
    display: block;
}

.site-header .new-group {
    flex-shrink: 0;
}
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}
.settings-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}
.settings-tz-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.settings-tz-form label {
    font-weight: 700;
}
.settings-tz-form select {
    width: 100%;
    max-width: none;
}
/* Long timezone lists use a searchable listbox. The native select remains
   visible without JavaScript and submits the form. */
.tz-combo {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}
.tz-combo > label {
    margin: 0;
}
.tz-combo-native {
    width: 100%;
    max-width: none;
    appearance: auto;
    background-image: none;
    padding-right: 2rem;
}
.tz-combo-ui {
    display: none;
    position: relative;
    min-width: 0;
}
.js .tz-combo-ui {
    display: block;
}
.js .tz-combo-native {
    display: none;
}
.tz-combo-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--field-height);
    margin: 0;
    padding: 0 2.5rem 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    font: inherit;
    line-height: 1.2;
    text-align: left;
}
.tz-combo-trigger:hover,
.tz-combo-trigger:focus-visible,
.tz-combo.is-open .tz-combo-trigger {
    border-color: var(--accent);
}
.tz-combo-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tz-combo-caret {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    color: var(--muted);
    line-height: 1;
    transform: translateY(-116%);
    pointer-events: none;
}
.tz-combo-popover {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: min(55vh, 20rem);
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.18);
}
.tz-combo-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: transparent;
}
.tz-combo-search {
    width: 100%;
    margin: 0;
    padding: 0 0.75rem;
    min-height: var(--field-height);
    border-radius: var(--radius);
}
.tz-combo-list {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}
.tz-combo-list button {
    display: block;
    width: 100%;
    min-height: var(--control-height);
    margin: 0;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: calc(var(--radius) - 2px);
    background: transparent;
    color: var(--fg);
    font: inherit;
    line-height: 1.25;
    text-align: left;
    box-shadow: none;
}
.tz-combo-list button:hover,
.tz-combo-list button:focus-visible {
    background: var(--accent-bg);
    color: var(--fg);
}
.tz-combo-list button.is-selected {
    background: var(--primary);
    color: var(--on-primary);
}
.tz-combo-empty {
    margin: 0;
    padding: 0.75rem;
    color: var(--muted);
}
@media (min-width: 760px) {
    .tz-combo-popover {
        max-height: min(60vh, 24rem);
    }
}.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.25rem;
}
.settings-actions button {
    width: auto;
    min-height: var(--control-height);
    margin: 0;
}
.settings-actions .settings-action {
    flex: 1 1 0;
}
.settings-apply {
    flex: 0 0 auto;
    border-color: var(--accent);
    background: var(--primary);
    color: var(--on-primary);
}
.settings-apply:hover,
.settings-apply:focus-visible {
    border-color: var(--accent);
    background: var(--primary);
    color: var(--on-primary);
    filter: brightness(1.08);
}
button.settings-action {
    display: none;
}
.js button.settings-action {
    display: inline-flex;
}
.settings-clock {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}
.js .settings-clock {
    display: flex;
}
.settings-label {
    font-weight: 700;
}
.settings-clock .segmented-radio {
    width: 100%;
    margin: 0;
}
.settings-status {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}
@media (min-width: 760px) {
    .js .settings-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
    color: var(--fg);
    text-decoration: none;
}
.button-secondary:hover,
.button-secondary:focus-visible {
    border-color: var(--accent);
    background: var(--cell-bg);
    color: var(--accent);
}
.group-title-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}
.group-title-row h1 {
    margin-bottom: 0;
}
.group-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: start;
    gap: 0.35rem;
    width: 100%;
}
.group-actions .calendar-link {
    flex: 1 1 auto;
    padding-inline: var(--space-2);
    font-size: 0.9rem;
}
.group-secondary-actions {
    grid-column: 1 / -1;
    width: 100%;
}
@media (min-width: 36rem) {
    .group-head .group-secondary-actions {
        justify-content: flex-end;
        width: 100%;
    }
    .group-head .group-secondary-actions .calendar-link {
        flex: 0 0 auto;
    }
}/* The calendar toggle is a normal button in the title actions. The section it
   controls lives in the page flow under the title row. */
.calendar-link {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: var(--control-height);
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
    color: var(--fg);
    font-weight: 400;
    font-size: 0.95rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.js .calendar-link {
    display: inline-flex;
}
/* The rule wizard also works without JavaScript, so its toggle stays visible. */
.calendar-link.rule-toggle {
    display: inline-flex;
}
.calendar-link:not([aria-expanded="true"]):hover {
    border-color: var(--accent);
    background: var(--cell-bg);
    color: var(--accent);
}
.calendar-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.calendar-link[aria-expanded="true"] {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--accent);
}
.calendar-link[aria-expanded="true"]:hover {
    filter: brightness(1.08);
}
.calendar-caret {
    display: inline-block;
    font-size: 0.75em;
    line-height: 1;
    transition: transform 120ms ease;
}
.calendar-link[aria-expanded="true"] .calendar-caret {
    transform: rotate(180deg);
}
/* Existing calendar links stay collapsed under the create form. */
.existing-links {
    margin: 0.75rem 0 0;
}
.existing-links[open] > summary {
    margin-bottom: 0.5rem;
}
.group-title-row.is-stacked {
    flex-direction: column;
    align-items: flex-start;
}
.group-title-row.is-stacked .group-actions {
    justify-content: flex-start;
}
@media (min-width: 36rem) {
    .group-title-row {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
    .group-title-row.is-stacked {
        flex-direction: column;
        align-items: flex-start;
    }
    .group-actions {
        justify-content: end;
        gap: 0.5rem;
        width: auto;
    }
    .group-actions .calendar-link {
        padding-inline: 0.65rem;
        font-size: 0.95rem;
    }
    .group-title-row.is-stacked .group-actions {
        justify-content: flex-start;
    }
}@media (min-width: 48rem) {
    .group-actions .calendar-link {
        padding-inline: 0.75rem;
        font-size: 1rem;
    }
}@media (min-width: 48rem) {
    .site-header-actions {
        justify-content: end;
    }
    .calendar-link {
        padding-inline: 0.75rem;
        font-size: 1rem;
    }
}/* The tab anchors are grid items and can stretch when one label wraps. The
   base `.task-tab` flex centering loses to `.task-links a { display:inline-block }`
   on specificity, which leaves labels top-aligned. Restore the flex box and
   tighten the control line box. */
.task-links a.task-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    padding-block: calc(0.55rem + 1px) calc(0.55rem - 1px);
}
.task-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    border-bottom: 3px solid transparent;
}
.task-links .task-tab.active {
    border-bottom-color: var(--accent);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}

.danger-action {
    border-color: var(--danger);
    background: var(--danger);
    color: var(--on-accent);
}
/* The archived-session confirmation puts the PIN and action in one row on
   wide screens and in two rows on phones. */
.confirm-delete form[action$="/sessions/clear-archived"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: var(--space-2);
}
.confirm-delete form[action$="/sessions/clear-archived"] .pin-field,
.confirm-delete form[action$="/sessions/clear-archived"] > p:not(.pin-field) {
    margin: 0;
}
.confirm-delete form[action$="/sessions/clear-archived"] > p:not(.pin-field) {
    display: flex;
    align-items: flex-start;
}
.confirm-delete form[action$="/sessions/clear-archived"] button {
    width: 100%;
    min-height: var(--field-height);
}
@media (min-width: 36rem) {
    .confirm-delete form[action$="/sessions/clear-archived"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
/* One full-width escape route at the top of every group page. */
.back-to-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: var(--control-height);
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-weight: 600;
    text-decoration: none;
}
.back-to-group:hover,
.back-to-group:focus-visible {
    border-color: var(--accent);
    background: var(--cell-bg);
}

@media (min-width: 48rem) {

    .task-links a {
        padding: 0.55rem 0.75rem;
        font-size: 1rem;
    }
}
/* --- Availability redesign: members, rules, and the rule wizard ---------- */
.is-hidden {
    display: none !important;
}

.member-title {
    margin-bottom: 0.2rem;
}
.member-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
}
.member-title-row .heading-with-hint {
    flex: 1 1 18rem;
    min-width: 0;
}
.member-rename-button {
    flex: 0 0 auto;
}
.rename-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
}
.rename-input {
    flex: 1 1 16rem;
    min-width: 0;
    height: auto;
    margin: 0;
    padding: 0.35rem 0.6rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}
.rename-pin {
    flex: 0 1 10rem;
    min-width: 8rem;
    margin: 0;
}
.rename-actions {
    display: flex;
    gap: var(--space-2);
}
.group-rename-form {
    --field-height: var(--control-height);
    flex: 0 0 auto;
    width: 100%;
}
.group-rename-form .rename-input,
.group-rename-form .rename-pin {
    height: var(--control-height);
    min-height: var(--control-height);
    margin: 0;
    padding-block: 0;
}
.group-rename-form .rename-input {
    padding-inline: 0.6rem;
    font-size: 1.75rem;
}
.group-rename-form .rename-actions button {
    height: var(--control-height);
    min-height: var(--control-height);
    margin: 0;
    padding-block: 0;
}
@media (min-width: 48rem) {
    .group-rename-form {
        flex: 1 1 auto;
        width: auto;
    }
}.members-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.4rem 0 0.7rem;
}
.members-toolbar h2 {
    margin: 0;
}
.member-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid;
    gap: 0.55rem;
}
.member-list li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}
.member-row-shell {
    display: block;
}
.member-row-main {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}
.member-row-shell .member-row {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}
.member-row-main .member-actions {
    align-items: stretch;
    align-self: stretch;
}
.member-actions {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    width: auto;
    justify-content: flex-end;
    gap: 0.25rem;
}
.member-actions .row-actions,
.member-actions .required-toggle-form,
.member-actions .member-delete-form,
.member-actions .rule-delete-form {
    display: flex;
    align-items: stretch;
    align-self: stretch;
    flex-wrap: nowrap;
}
.member-actions .required-toggle,
.member-actions .member-delete-toggle,
.member-actions .rule-delete-button {
    align-self: stretch;
    height: auto;
}
.member-actions .member-delete-toggle {
    width: auto;
    min-width: var(--control-height);
    height: 100%;
    justify-content: center;
}
.member-delete-toggle .label-long {
    display: none;
}
.member-delete-toggle .label-short {
    display: inline;
}
.member-delete-toggle .label-long > span {
    margin-inline-start: 0.25rem;
}
.member-delete-drawer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
}
.member-delete-prompt {
    color: var(--fg);
    font-weight: 600;
}
.member-delete-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.member-delete-actions button {
    margin: 0;
}
.member-delete-confirm-form {
    display: flex;
    margin: 0;
}
.member-delete-confirm {
    margin: 0;
}
.member-delete-toggle[aria-expanded="false"]:focus:not(:focus-visible):not(:hover) {
    background-color: var(--cell-bg);
    border-color: var(--border);
    box-shadow: none;
    color: var(--fg);
    outline: none;
}
.member-actions .required-toggle {
    min-width: 3.25rem;
    padding-inline: 0.4rem;
    font-size: 0.85rem;
}
.member-actions .member-delete-toggle,
.member-actions .rule-delete-button {
    padding-inline: 0.45rem;
    font-size: 0.85rem;
}
.required-toggle .label-long {
    display: none;
}
.required-toggle .label-short {
    display: inline;
}
.required-toggle-form {
    margin: 0;
}
.required-toggle {
    min-width: 7rem;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}
.required-toggle.is-required {
    border-color: var(--required-border);
    background: var(--required-bg);
    color: var(--required-fg);
    font-weight: 700;
}
.pin-field input {
    width: 100%;
}
.pin-note {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.85rem;
}
@media (min-width: 40.0625rem) {
    .member-row-shell {
        flex-wrap: nowrap;
    }
    .member-row-shell .member-row {
        flex: 1 1 auto;
        width: auto;
    }
    .member-actions {
        width: auto;
        justify-content: flex-end;
    }
    .member-actions .required-toggle {
        min-width: 7rem;
        padding-inline: 0;
        font-size: 1rem;
    }
    .member-actions .member-delete-toggle,
    .member-actions .rule-delete-button {
        padding-inline: 0.75rem;
        font-size: 0.95rem;
    }
    .required-toggle .label-long,
    .member-delete-toggle .label-long {
        display: inline;
    }
    .required-toggle .label-short,
    .member-delete-toggle .label-short {
        display: none;
    }
}.member-row {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
    padding: 0.75rem 0.85rem;
    font: inherit;
    color: var(--fg);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.member-row:hover,
.member-row:focus-visible {
    border-color: var(--accent);
}
.member-name {
    display: block;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.member-count {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}
.plain-fieldset {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}
.plain-fieldset[disabled] button {
    cursor: not-allowed;
    opacity: 0.55;
}
.member-unlock {
    margin: 0 0 1rem;
}
.member-unlock-form {
    margin-top: 0.5rem;
}
.input-action-row {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0.5rem;
}
.input-action-row .field {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}
.input-action-row .field input {
    height: var(--field-height);
}
.input-action-row button {
    flex: 0 0 auto;
    width: auto;
    height: var(--field-height);
    min-height: var(--field-height);
    margin: 0;
    padding-block: 0;
}
.wide-button {
    width: 100%;
    text-align: center;
}
.empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 0;
}
.empty-actions .button-secondary {
    flex: 1 1 16rem;
    text-align: center;
}
.member-fields {
    width: 100%;
    max-width: none;
}
.member-fields .field,
.member-fields input {
    width: 100%;
}
.rule-stack-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin: var(--space-4) 0 var(--space-2);
}
.rule-stack-toolbar h3 {
    margin: 0;
    font-size: 1rem;
}
.rule-stack-toolbar form {
    margin: 0;
}

.saved-status.is-empty {
    display: none;
}
.saved-status {
    min-height: 1.2rem;
    margin: 0.1rem 0 0.4rem;
    color: var(--muted);
    font-size: 0.86rem;
}
.rule-stack {
    display: grid;
    gap: 0.55rem;
}
.rule-item-shell {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
}
.rule-item {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.rule-item-shell > .row-actions {
    position: absolute;
    top: var(--space-2);
    right: var(--space-3);
    z-index: 1;
    padding: 0;
}
.rule-item > summary,
.rule-item[open] > summary {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.5rem 5.9rem 0.5rem 0.75rem;
    cursor: pointer;
    list-style: none;
    -webkit-tap-highlight-color: transparent;
}

/* The confirmation is wider than the delete button. Reserve its lane on
   narrow screens so it never covers the rule title or summary text. */
.rule-item-shell:has(.delete-confirm) > .rule-item > summary {
    padding-right: 17.5rem;
}
@media (min-width: 36rem) {
    .rule-item-shell:has(.delete-confirm) > .rule-item > summary {
        padding-right: 5.9rem;
    }
}.rule-item[open] > summary {
    box-shadow: inset 0 -1px 0 var(--border);
}
/* iOS keeps focus on the tapped summary after it closes. Pico's focus color
   would then leave the closed rule header looking active. Keep the active
   color only while the disclosure is open; keyboard focus still gets its
   focus-visible outline from the global rule. */
.rule-item:not([open]) > summary:focus:not(:focus-visible) {
    color: var(--fg);
}
/* Safari on iOS can also leave :focus-visible on a tapped summary. On coarse
   pointers, a closed row always returns to the standard text color; the
   keyboard focus ring remains. */
@media (pointer: coarse) {
    .rule-item:not([open]) > summary:focus {
        color: var(--fg);
    }
}.rule-item > summary::-webkit-details-marker {
    display: none;
}
.rule-item > summary::after {
    content: none;
}
.rule-item > summary::marker {
    content: "";
}
.rule-caret {
    display: inline-block;
    align-self: center;
    width: 1.1rem;
    color: var(--muted);
    text-align: center;
    transition: transform 0.15s ease;
}
.rule-item[open] .rule-caret {
    transform: rotate(90deg);
}
.rule-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    min-width: 0;
    min-height: var(--control-height);
}
.rule-title {
    display: block;
    font-weight: 700;
}
.rule-meta {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.35;
    margin-top: 0.1rem;
    overflow-wrap: anywhere;
}
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    align-self: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.rule-delete-form,
.delete-confirm-form {
    display: flex;
    align-items: center;
    margin: 0;
}
.rule-delete-button {
    border: 1px solid var(--danger);
    background: transparent;
    color: var(--danger);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.95rem;
    min-height: var(--control-height);
    margin: 0;
    padding: 0 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}
.rule-delete-button:hover,
.rule-delete-button:focus-visible {
    background: var(--danger);
    color: var(--on-accent);
}
.delete-confirm {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--danger);
    font-size: 0.9rem;
    white-space: nowrap;
}
.delete-confirm .button-secondary {
    min-height: var(--control-height);
    margin: 0;
    padding: 0 0.75rem;
    font-size: 0.95rem;
}
button.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--danger);
    background: var(--danger);
    color: var(--on-accent);
    border-radius: var(--radius);
    font: inherit;
    min-height: var(--control-height);
    margin: 0;
    padding: 0 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
}
button.button-danger:hover,
button.button-danger:focus-visible {
    border-color: var(--danger);
    background: var(--danger);
    color: var(--on-accent);
    filter: brightness(1.08);
}
button.button-danger[disabled] {
    opacity: 0.55;
    cursor: progress;
}
.rule-editor {
    padding: 0.85rem;
}
.rule-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.8rem;
}
.rule-edit-actions button,
.rule-edit-actions .button-secondary {
    width: auto;
}
.rule-stack-toolbar button,
.rule-edit-actions button,
.rule-edit-actions .button-secondary,
.wizard-confirm button,
.wizard-confirm .button-secondary {
    min-height: var(--control-height);
    margin: 0;
}
.wizard-confirm button,
.wizard-confirm .button-secondary,
.rule-edit-actions button,
.rule-edit-actions .button-secondary {
    height: var(--control-height);
    padding-block: 0;
    line-height: 1.2;
}
.type-pane {
    margin-top: 0.5rem;
    padding: 0.9rem;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.08);
}
.wizard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    color: var(--muted);
    font-size: 0.84rem;
}
button.wizard-back {
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    padding: 0;
    min-height: 0;
    width: auto;
    margin: 0 0 0 auto;
    cursor: pointer;
}
.wizard-back:hover,
.wizard-back:focus-visible {
    background: transparent;
    color: var(--accent);
    text-decoration: underline;
}
.type-pane h3 {
    margin: 0 0 0.15rem;
}
.type-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin: 0.8rem 0;
}
.type-card {
    text-align: left;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    font: inherit;
}
.type-card:hover,
.type-card:focus,
.type-card:focus-visible {
    border-color: var(--accent);
    background: var(--bg);
    color: var(--fg);
}
.type-card strong {
    display: block;
    margin-bottom: 0.15rem;
}
.type-card span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}
.wizard-form {
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}
.wizard-confirm {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.9rem;
}
.wizard-confirm button,
.wizard-confirm .button-secondary {
    width: 100%;
}
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.chip-row .ew-chip {
    margin: 0;
}
.date-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
}
.time-range {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    gap: var(--space-3);
    margin: var(--space-2) 0 var(--space-3);
}
.times-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.times-field > .heading-with-hint {
    margin-block: 0;
}
.times-field .time-range {
    margin: 0;
}
.time-range .time-field {
    margin-bottom: 0;
}
.time-range .time-field input,
.time-range .duration-box {
    height: var(--field-height);
    box-sizing: border-box;
}
.time-range .duration-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-weight: 600;
}
.time-input-row,
.date-input-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}
.time-input-row input,
.date-input-row input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin: 0;
}
.time-clear {
    display: none;
    align-items: center;
    justify-content: center;
    height: var(--field-height);
    min-height: var(--field-height);
    margin: 0;
    padding: 0 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cell-bg);
    color: var(--fg);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}
.js .time-clear {
    display: inline-flex;
}
.time-clear:hover,
.time-clear:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}
.segmented-radio {
    display: inline-flex;
    height: var(--field-height);
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 0 0 0.7rem;
}
.segmented-radio label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 100%;
    min-height: 0;
    padding: 0 0.65rem;
    font-size: 0.88rem;
    cursor: pointer;
    background: var(--bg);
    margin: 0;
}
.segmented-radio label + label {
    border-left: 1px solid var(--border);
}
.segmented-radio input {
    margin: 0;
}
.empty-rules {
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--muted);
    text-align: center;
    margin: 0.5rem 0 0;
}
.rules-summary {
    margin: 1rem 0 0.6rem;
}
.rules-summary h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}
.summary-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin: 0 0 0.5rem;
}
.summary-heading h3 {
    margin: 0;
}
.summary-heading .status-legend {
    justify-content: flex-end;
    margin: 0 0 0 auto;
}
.summary-grid {
    display: grid;
    gap: 1rem;
}
.summary-column h4 {
    margin: 0 0 var(--space-2);
    font-size: 0.95rem;
}
.heading-with-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.6rem;
    row-gap: var(--space-1);
    margin-block: var(--space-4) var(--space-2);
}
.heading-with-hint:first-child {
    margin-block-start: 0;
}
.heading-with-hint.heading-hint-newline {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}
.heading-with-hint.heading-hint-newline .heading-hint {
    flex: 0 0 auto;
}
.field > .heading-with-hint {
    margin-block-end: 0;
}
.heading-with-hint h1,
.heading-with-hint h2,
.heading-with-hint h3,
.heading-with-hint h4 {
    margin: 0;
}
.heading-with-hint h4 {
    font-size: 0.95rem;
}
.heading-with-hint .heading-hint {
    color: var(--muted);
    flex: 1 1 18rem;
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
}
.members-toolbar .heading-with-hint {
    flex: 1 1 auto;
}
.members-toolbar .heading-hint {
    flex: 0 1 auto;
}
.members-toolbar > .button-secondary {
    flex: 0 0 auto;
    white-space: nowrap;
}
.wizard-explanation {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0.5rem 0;
}
.summary-list {
    display: grid;
    gap: 0.3rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.summary-item {
    font-size: 0.88rem;
    line-height: 1.35;
    list-style: none;
    padding: 0.2rem 0;
}
.summary-row {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}
.rule-meta .summary-row {
    align-items: center;
    gap: 0.35rem;
}
.summary-state {
    flex: 0 0 auto;
    line-height: 1.35;
    text-align: center;
    width: 1.1em;
}
.summary-state.is-full {
    color: var(--ok);
}
.summary-state.is-partial {
    color: var(--lock);
    font-weight: 700;
}
.summary-state.is-unavailable {
    color: var(--danger);
}
.status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    font-size: 0.8rem;
    margin: 0.35rem 0 0.5rem;
}
.summary-empty {
    color: var(--muted);
    font-size: 0.88rem;
}
.summary-effective {
    margin-top: 1rem;
}
.summary-effective .summary-list {
    color: var(--fg);
}
@media (min-width: 620px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    .summary-grid.is-single {
        grid-template-columns: 1fr;
    }
}.date-grid.date-grid-single {
    grid-template-columns: 1fr;
}
@media (min-width: 620px) {
    .date-grid {
        grid-template-columns: 1fr 1fr;
    }
    .time-range {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    }
    .type-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .wizard-confirm {
        flex-direction: row;
    }
    .wizard-confirm button,
    .wizard-confirm .button-secondary {
        width: auto;
    }
    .member-row {
        align-items: center;
    }
}