:root {
    --primary: #020b26;
    --primary-dark: #000617;
    --primary-soft: #081c4e;

    --gold: #f2c45b;
    --gold-dark: #b88418;
    --gold-light: #ffe39a;

    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #667085;
    --border: #d9e1ef;

    --danger: #b00020;
    --success: #176b3a;
}

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.overlay.hidden {
    display: none !important;
    pointer-events: none;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* HERO */
.hero {
    background:
        radial-gradient(ellipse at top right, rgba(242,196,91,.08), transparent 55%),
        linear-gradient(115deg, #09152f, #0b2352);
    border-bottom: 2px solid #f2c45b66;
    color: white;
    padding: 32px 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero-inner {
    max-width: 928px;
    margin: auto;
}

.hero-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--gold-light);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 650;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hero-eyebrow::before {
    content: "";
    flex: 0 0 28px;
    height: 2px;
    background: var(--gold);
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 3.2vw, 44px);
    line-height: 1.1;
    font-weight: 750;
    letter-spacing: -.025em;
}

.hero p {
    max-width: 620px;
    margin: 14px 0 0;
    font-size: 18px;
    line-height: 1.5;
    color: #e0e7f3;
}

/* PAGE */
.page {
    max-width: 960px;
    margin: auto;
    padding: 24px 16px 60px;
}

/* TABS */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.tab {
    flex: 1;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    color: var(--primary);
    font-weight: bold;
}

.tab:hover {
    background: var(--primary-soft);
    color: white;
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* FILTER */
.filters {
    margin-bottom: 12px;
}

/* SEARCH */
.search-box {
    margin-bottom: 14px;
}

.search-box input {
    display: block;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font-size: 16px;
    appearance: none;
}

.search-box input::placeholder {
    color: #8a94a6;
}

.search-box input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(242, 196, 91, .25);
}

/* CARD */
.event-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

/* PROGRESS */
.progress {
    margin-bottom: 12px;
    font-weight: bold;
    color: var(--primary);
}

/* GROUP */
.slot-group {
    border: 1px solid var(--border);
    border-radius: 14px;
    margin: 14px 0;
    overflow: hidden;
    background: #fff;
}

.slot-group > summary {
    cursor: pointer;
    padding: 14px 16px;
    background: #f7f9fd;
    color: var(--primary);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 12px;
    list-style: none;
}

.slot-group > summary:hover { background: #edf3fb; }
.slot-group > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.slot-group[open] > summary { background: #eef3fa; }
.group-heading { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.group-title { overflow-wrap: anywhere; font-weight: bold; }
.group-toggle-hint { font-size: 13px; line-height: 1.4; font-weight: 600; color: #425674; }
.group-metrics { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; color: var(--muted); }
.group-free-count { padding: 4px 7px; border: 1px solid #f2dfb4; border-radius: 6px; background: #fff3d8; color: #775307; font-weight: bold; }
.group-free-count.is-full { background: #edf0f5; color: #536078; border-color: var(--border); font-weight: normal; }
.overlap-list { padding-left: 20px; }
.overlap-list li { margin-bottom: 14px; }
.overlap-list li strong, .overlap-list li span { display: block; overflow-wrap: anywhere; }
.overlap-list li span { margin-top: 5px; color: var(--muted); font-size: 14px; }

.slot-group > summary::-webkit-details-marker {
    display: none;
}

.slot-group > summary small {
    text-align: center;
}

.slot-group > summary::after {
    content: "▾";
    text-align: right;
    color: var(--primary);
    font-size: 22px;
}

.slot-group[open] > summary::after {
    content: "▴";
}

/* SLOT */
.slot {
    border-top: 1px solid var(--border);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    scroll-margin-top: 16px;
}

.public-group { background: #f4f6fb; }
.slot.public-shift { display: block; margin: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: white; box-shadow: 0 2px 8px #020b2605; }
.public-shift .slot-info { display: block; min-width: 0; }
.public-shift-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.public-shift-heading > div:first-child { min-width: 0; }
.public-shift .slot-title { margin: 0; color: var(--primary); font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.shift-time { display: flex; flex-wrap: wrap; gap: 7px; align-items: flex-start; margin-top: 8px; color: #344054; font-size: 15px; line-height: 1.5; }
.shift-time svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shift-availability { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #f2dfb4; border-radius: 8px; background: #fff3d8; color: #775307; font-size: 13px; font-weight: bold; line-height: 1.4; }
.shift-availability.is-full { border-color: var(--border); background: #edf0f5; color: #536078; }
.shift-availability-summary { display: flex; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 6px; }
.public-shift .counter { color: #667085; font-size: 13px; font-weight: normal; line-height: 1.5; text-align: right; }
.public-shift-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #edf0f5; }
.shift-helpers { min-width: 0; }
.shift-helpers-title { margin: 0 0 8px; color: #536078; font-size: 13px; font-weight: 600; }
.helper-name-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; list-style: none; }
.helper-name { max-width: 100%; padding: 5px 10px; border: 1px solid #e1e7f0; border-radius: 999px; background: #f3f6fb; color: #344054; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.public-shift .shift-empty { color: #536078; font-size: 14px; }
.public-shift .slot-actions button { min-height: 44px; }

.selected-shift-summary { padding: 16px; border: 1px solid #eddbb5; border-left: 4px solid var(--gold); border-radius: 10px; background: #fffaf0; line-height: 1.5; overflow-wrap: anywhere; }
.selected-shift-summary h3 { margin: 5px 0 10px; color: var(--primary); font-size: 21px; line-height: 1.35; }
.selected-shift-summary p { margin: 0; }
.selected-shift-event { color: #775307; font-size: 14px; font-weight: 600; }
.selected-shift-date { color: #536078; font-size: 15px; }
.selected-shift-time { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px !important; color: var(--primary); font-size: 19px; }
.shift-duration { display: inline-block; padding: 2px 7px; border-radius: 5px; background: #edf0f5; color: #536078; font-size: 13px; font-weight: normal; white-space: nowrap; }
.search-status { margin: 8px 2px 0; }
.reset-helper-filters { display: block; margin: 12px auto 0; }
.public-shift .cancel-button { background: transparent; color: #536078; border: 1px solid transparent; }
.public-shift .cancel-button:hover { background: #edf0f5; color: var(--primary); border-color: #d9e1ef; }
.public-signup-dialog .signup-fields input { font-size: 16px; }
.remembered-details { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px; border: 1px solid #c7d8ed; border-radius: 8px; background: #edf3fb; color: var(--primary); font-size: 14px; line-height: 1.4; }
.change-person { background: white; color: var(--primary); border: 1px solid #c7d8ed; }
.change-person:hover { background: #e0eafa; color: var(--primary); }

.slot-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slot-title {
    font-weight: bold;
    font-size: 16px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.counter {
    font-size: 14px;
    font-weight: bold;
}

.signup-names {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
    word-break: break-word;
}

/* CHIP */
.chip {
    display: inline-block;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 8px;
    background: #eef2fa;
    color: var(--primary);
    font-size: 13px;
    font-weight: bold;
}

.chip.full {
    background: var(--gold);
    color: var(--primary);
}

.full {
    color: var(--danger);
}

/* BUTTONS */
button {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background: var(--primary-dark);
}

button:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.secondary {
    background: #666;
}

.secondary:hover {
    background: #4d4d4d;
}

.cancel-button {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.cancel-button:hover {
    background: var(--gold-light);
}

.slot-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* MODAL */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 10;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 22px;
    border-radius: 18px;
    display: none;
    width: min(92vw, 430px);
    box-shadow: 0 18px 50px rgba(0,0,0,.25);
    z-index: 20;
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text);
}

.modal label {
    display: block;
    margin-top: 14px;
    font-weight: 700;
    color: var(--text);
}

.modal input {
    display: block;
    width: 100%;
    padding: 13px 14px;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font-size: 16px;
    appearance: none;
}

.modal input::placeholder {
    color: #8a94a6;
}

.modal input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(242, 196, 91, .25);
}

/* CHECKBOX */
.checkbox {
    display: flex !important;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
    font-weight: 400 !important;
    line-height: 1.35;
}

.checkbox input {
    width: 18px !important;
    min-width: 18px;
    height: 18px;
    margin-top: 2px;
    padding: 0;
    appearance: auto;
}

/* ACTIONS */
.actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

/* MESSAGES */
.message {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    background: white;
    border: 1px solid var(--border);
}

.message.success {
    color: var(--success);
    border-color: #b8dfc7;
}

.message.error {
    color: var(--danger);
    border-color: #efb8c0;
}

.empty-state {
    background: white;
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 16px;
    color: var(--muted);
    text-align: center;
}

/* TOAST POPUP */
.message.toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 50;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
    font-weight: bold;
}

.message.toast.success {
    color: var(--success);
    border-color: #b8dfc7;
}

.message.toast.error {
    color: var(--danger);
    border-color: #efb8c0;
}

/* MOBILE */
@media (max-width: 640px) {
    .slot.public-shift { margin: 10px; padding: 14px; }
    .public-shift-heading { flex-direction: column; gap: 12px; }
    .public-shift .slot-title { font-size: 17px; }
    .shift-availability-summary { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
    .public-shift .counter { text-align: left; }
    .public-shift-footer { grid-template-columns: 1fr; gap: 16px; }
    .hero {
        padding: 16px;
    }

    .hero-eyebrow {
        margin-bottom: 6px;
        font-size: 11px;
        letter-spacing: .06em;
        gap: 8px;
    }

    .hero-eyebrow::before { flex-basis: 18px; }

    .hero h1 {
        font-size: 26px;
        line-height: 1.15;
    }

    .hero p {
        margin-top: 10px;
        font-size: 14px;
        line-height: 1.4;
    }

    .page {
        padding: 16px 10px 40px;
    }

    .tabs {
        gap: 6px;
    }

    .tab {
        padding: 12px 8px;
        font-size: 14px;
    }

    .event-card {
        border-radius: 14px;
        padding: 12px;
    }

    .slot-group {
        border-radius: 12px;
        margin: 10px 0;
    }

    .slot-group > summary {
        grid-template-columns: minmax(0, 1fr) auto 18px;
        padding: 13px 12px;
        gap: 8px;
        font-size: 15px;
    }

    .slot-group > summary small {
        font-size: 12px;
        white-space: nowrap;
    }

    .group-toggle-hint { font-size: 12px; }

    .slot {
        grid-template-columns: 1fr;
        padding: 14px 12px;
        gap: 12px;
    }

    .slot-title {
        font-size: 16px;
        line-height: 1.3;
    }

    .muted,
    .counter,
    .signup-names {
        font-size: 14px;
        line-height: 1.35;
    }

    .slot-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .slot-actions button {
        width: 100%;
        padding: 12px 10px;
    }

    .actions {
        flex-direction: column;
    }

    .actions button {
        width: 100%;
        padding: 13px 12px;
        font-size: 16px;
    }

    .modal {
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-height: 88vh;
        overflow-y: auto;
        border-radius: 18px 18px 0 0;
        padding: 24px 18px;
    }

.message.toast {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 16px;
    max-width: none;
    text-align: center;
}

    .modal h3 {
        font-size: 24px;
        line-height: 1.2;
    }

    .modal input,
    .search-box input {
        font-size: 16px;
        padding: 13px 12px;
    }

    .checkbox {
        line-height: 1.35;
    }
}
