/* Lodge DC Tool - styles */
:root {
    --bg: #f5f5f3;
    --surface: #ffffff;
    --ink: #1a1a1a;
    --ink-muted: #6b6b6b;
    --border: #e1e1de;
    --accent: #2b4d7a;
    --accent-dark: #1f3a5c;
    --danger: #b03434;
    --success: #2d7d46;
    --warn: #b87a1f;
    --schedule-blue: #a8c8e8;   /* meeting-night highlight, schedule views + PDFs */
    --schedule-red: #f0baba;    /* closed Tuesdays */
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 2px 6px rgba(0,0,0,0.04);
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.muted { color: var(--ink-muted); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}
.site-header .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--ink);
    white-space: nowrap;
}
.site-header nav { display: flex; gap: 1.25rem; align-items: center; }
.site-header nav a { color: var(--ink); font-size: 0.95rem; }
.site-header nav a:hover { color: var(--accent); }

main.container { padding-top: 1.5rem; padding-bottom: 3rem; }

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    padding: 1rem 0;
    font-size: 0.85rem;
    text-align: center;
}

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; color: var(--ink-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }

.big-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.25rem 0 0.5rem;
    color: var(--ink);
    line-height: 1;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table th, .data-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.data-table th {
    background: #fafaf8;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--ink-muted);
    letter-spacing: 0.03em;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fbfbf9; }
.row-actions { text-align: right; white-space: nowrap; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eee;
    color: #555;
}
.badge-ea { background: #fff4d6; color: #7a5a00; }
.badge-fc { background: #e0eaff; color: #2b4d7a; }
.badge-mm { background: #dcecdc; color: #2d7d46; }
.badge-pm { background: #f5e0e0; color: #8a2a2a; }

.badge-status-active   { background: #dcecdc; color: #2d7d46; }
.badge-status-honorary { background: #ede0f5; color: #5a2d7d; }
.badge-status-joining  { background: #fff4d6; color: #7a5a00; }
.badge-status-resigned { background: #eee; color: #555; }
.badge-status-deceased { background: #444; color: #fff; }
.badge-status-inactive   { background: #f6e0e0; color: #7d1f1f; }
.badge-status-associate  { background: #e0f0f5; color: #1a5a6b; }
.badge-not-progressing   { background: #fff4d6; color: #7a5a00; }
.badge-loi               { background: #e0eaff; color: #2b4d7a; }
.badge-status-non_dining { background: #f0ece4; color: #5a4a2a; }

/* Forms */
form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
@media (max-width: 600px) { form .form-row { grid-template-columns: 1fr; } }

fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}
fieldset legend {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--ink-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0;
}

.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-group-small { max-width: 130px; }
.form-group label { font-size: 0.9rem; font-weight: 500; }
.form-group small { font-size: 0.8rem; }
.checkbox-row,
.radio-row    { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; }

input[type=text],
input[type=email],
input[type=password],
input[type=date],
input[type=number],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font: inherit;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    outline-offset: -1px;
    border-color: var(--accent);
}
textarea { resize: vertical; min-height: 4rem; }

.form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.btn-right { margin-left: auto; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { background: #f0f0ec; text-decoration: none; }
.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger {
    background: var(--surface);
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--accent);
    padding: 0.5rem 0.75rem;
}
.btn-link:hover { background: transparent; text-decoration: underline; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.85rem; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-bar input[type=text] { max-width: 280px; }
.filter-bar select { max-width: 180px; }

/* Flash messages */
.flash {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid;
}
.flash-info    { background: #e7eef7; color: #234; border-color: #c8d4e4; }
.flash-success { background: #e6f3e9; color: #1f5a31; border-color: #b5d8be; }
.flash-error   { background: #f6e0e0; color: #7d1f1f; border-color: #d8b5b5; }
.flash ul { margin: 0; padding-left: 1.2rem; }

/* Login */
.login-card {
    max-width: 360px;
    margin: 3rem auto;
}
.login-card h1 { text-align: center; margin-bottom: 1.5rem; }
.login-card label { display: block; margin-top: 0.75rem; font-size: 0.9rem; font-weight: 500; }
.login-card button { width: 100%; margin-top: 1.25rem; }

/* ===== Offices ===== */
.offices-table th:first-child,
.offices-table td:first-child { width: 28%; }
.offices-table th:last-child,
.offices-table td:last-child { width: 90px; text-align: center; }
.offices-table select { min-width: 180px; }

.member-select { font-size: 0.95rem; }

.badge-override {
    background: #fff4d6;
    color: #7a5a00;
}
.badge-saved {
    background: #dcecdc;
    color: #2d7d46;
    font-weight: 500;
    margin-left: 0.4rem;
}
.badge-projected {
    background: #ede0f5;
    color: #5a2d7d;
    font-weight: 500;
    margin-left: 0.4rem;
}

/* Card with side action button */
.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fdf9ee;
    border-color: #e7d8b3;
}
.card-action form { margin: 0; }

/* Projection table */
.projection-table .section-row td,
.attendance-table .section-row td {
    background: #f5f5f3;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--ink-muted);
    letter-spacing: 0.05em;
    padding: 0.4rem 0.9rem;
}
.projection-table .cell-projected {
    font-style: italic;
    color: var(--ink-muted);
}
.proj-flag-saved { color: #2d7d46; font-weight: 600; }
.proj-flag-projected { color: #5a2d7d; font-weight: 600; font-style: italic; }

/* Mini table for compact dashboards */
.mini-table th, .mini-table td {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

/* Page head actions group */
.page-head-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Details/summary card */
details.card summary {
    cursor: pointer;
    font-weight: 600;
    list-style: revert;
}
details.card summary:hover {
    color: var(--accent);
}
details.card[open] summary {
    margin-bottom: 0.5rem;
}
details.card ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* ===== Meetings ===== */
.badge-ceremony {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-ceremony-installation { background: #ede0f5; color: #5a2d7d; }
.badge-ceremony-initiation   { background: #fff4d6; color: #7a5a00; }
.badge-ceremony-passing      { background: #e0eaff; color: #2b4d7a; }
.badge-ceremony-raising      { background: #dcecdc; color: #2d7d46; }
.badge-ceremony-other        { background: #eee; color: #555; }

.text-success { color: var(--success); font-weight: 600; }
.text-warn { color: var(--warn); font-weight: 600; }

.meeting-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #fbfaf6;
}
.meeting-summary code {
    background: #eee;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.assignments-table th:nth-child(2),
.assignments-table td:nth-child(2) {
    width: 130px;
}
.assignments-table th:last-child,
.assignments-table td:last-child {
    width: 100px;
    text-align: center;
}
.assignments-table select { min-width: 220px; }

/* ===== LoI ===== */
.loi-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.loi-toolbar .inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
}
.loi-toolbar input[type=date] { max-width: 160px; }

.loi-table th:first-child,
.loi-table td:first-child { width: 140px; }
.loi-table th:nth-child(2),
.loi-table td:nth-child(2) { width: 220px; }
.loi-table th:last-child,
.loi-table td:last-child { width: 180px; text-align: right; }

.loi-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #eee;
    color: #444;
}

/* LoI content type colors */
.loi-install-pill          { background: #ede0f5; color: #5a2d7d; }
.loi-1st-pill              { background: #fff4d6; color: #7a5a00; }
.loi-2nd-pill              { background: #e0eaff; color: #2b4d7a; }
.loi-3rd-pill              { background: #dcecdc; color: #2d7d46; }
.loi-general-pill          { background: #f0f0ec; color: #555; }
.loi-officers-night-pill   { background: #ffe4d6; color: #8a4a1a; font-weight: 600; }
.loi-ceremony-pill         { background: #2b4d7a; color: #fff; font-weight: 600; }
.loi-gpc-pill              { background: #d6f0f0; color: #1a5a5a; }
.loi-xmas-pill             { background: #f6e0e0; color: #7d1f1f; }
.loi-closed-pill           { background: #e0e0e0; color: #888; }
.loi-custom-pill           { background: #f5e0f5; color: #5a2d5a; }

/* Subtle row tint for ceremonies and officers nights */
.loi-row.loi-ceremony td { background: #f7faff; font-weight: 600; }
.loi-row.loi-officers-night td { background: #fffaf3; }
.loi-row.loi-closed td { color: var(--ink-muted); }

/* ===== Dashboard ===== */
.dashboard-next .big-date {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0.25rem 0 0.5rem;
    color: var(--ink);
}

.card-warn {
    background: #fff7ec;
    border-color: #f0c977;
}
.card-warn h3 { color: #7a5a00; }

/* ===== Constraint badges ===== */
.badge-constraint-declines    { background: #f6e0e0; color: #7d1f1f; }
.badge-constraint-prefers     { background: #d6ecdc; color: #1f5a2e; }
.badge-constraint-unavailable { background: #eee; color: #555; }
.badge-constraint-note        { background: #fff4d6; color: #7a5a00; }
.constraint-list { margin: 0; padding-left: 1.25rem; }
.constraint-list li { margin-bottom: 0.4rem; }

/* ===== Meeting brief (printable) ===== */
.brief-sheet {
    background: #fff;
    padding: 2rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 900px;
}
.brief-header {
    text-align: center;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
.brief-lodge {
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 0.02em;
}
.brief-year {
    margin: 0.25rem 0 0;
    color: var(--ink-muted);
    font-size: 0.95rem;
}
.brief-meeting-title {
    font-size: 1.2rem;
    margin: 1rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.brief-notes {
    background: #fafaf6;
    border-left: 3px solid var(--border);
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0 1rem;
    font-style: italic;
}
.brief-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1.25rem;
}
.brief-table th,
.brief-table td {
    border: 1px solid var(--border);
    padding: 0.45rem 0.6rem;
    text-align: left;
    vertical-align: top;
}
.brief-table th {
    background: #f4f2ec;
    font-size: 0.9rem;
    font-weight: 600;
}
.brief-table-small th,
.brief-table-small td { padding: 0.3rem 0.5rem; font-size: 0.9rem; }
.brief-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.brief-footer {
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ===== Crib sheet ===== */
.crib-sheet-page {
    margin-top: 2rem;
}
.crib-steps {
    margin: 0.5rem 0 1rem;
    padding-left: 1.5rem;
    list-style: decimal;
}
.crib-step {
    padding: 0.3rem 0 0.3rem 0.4rem;
    line-height: 1.5;
    border-bottom: 1px solid #f0ede4;
}
.crib-step:last-child { border-bottom: none; }
.crib-step-spoken {
    font-weight: 600;
    color: #1a1a1a;
}
.crib-step-action {
    color: #444;
    font-style: italic;
}
.crib-step-note {
    color: #666;
    font-style: italic;
    background: #fafaf6;
    border-left: 3px solid var(--border);
    padding-left: 0.6rem;
    list-style: none;
    margin-left: -1.5rem;
}

/* ===== Print ===== */
@media print {
    nav, .page-head, header, footer.app-footer, .flash, .no-print {
        display: none !important;
    }
    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }
    .brief-sheet {
        border: none;
        padding: 0;
        max-width: 100%;
    }
    .brief-header {
        border-bottom: 2px solid #000;
    }
    .brief-table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .schedule-ceremony-row td { background: var(--schedule-blue) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .schedule-closed-row td { background: var(--schedule-red) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .schedule-meeting-title { background: var(--schedule-blue) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    h1, h2, h3 { page-break-after: avoid; }
    table { page-break-inside: avoid; }
    a { color: #000; text-decoration: none; }
    .crib-sheet-page { page-break-before: always; }
    .crib-step-action { color: #333; }
    .crib-step-note { color: #555; }
}

/* ===== Year schedule + LoI schedule print pages ===== */
.schedule-meeting {
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
}
.schedule-meeting-title {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
    padding: 0.3rem 0.5rem;
    background: var(--schedule-blue);
    border-bottom: 1px solid var(--border);
}
.loi-print-table th:first-child,
.loi-print-table td:first-child {
    width: 130px;
    white-space: nowrap;
}
.schedule-recess-row td {
    background: #f4f2ec;
    text-align: center;
    color: var(--ink-muted);
}
/* Lodge meeting nights: deeper blue, dark text still legible. */
.schedule-ceremony-row td {
    font-weight: 700;
    background: var(--schedule-blue);
}
/* Closed Tuesdays (no LoI). */
.schedule-closed-row td {
    background: var(--schedule-red);
}

/* ===== LoI attendance ===== */
.attendance-table td { vertical-align: top; }
.attendance-table select { width: 100%; max-width: 320px; }
.register-table .register-cell { width: 90px; text-align: center; }
.register-table .register-cell label { display: block; cursor: pointer; padding: 0.2rem 0; }

/* The reply page is the one screen a brother opens himself, usually on a phone.
   It carried no styling of its own, so the radios inherited nothing: no width,
   no centring, and a tap target the size of the radio itself. */
.rsvp-table .register-cell { width: 90px; text-align: center; }
.rsvp-table .register-cell label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0.35rem 0;
    min-height: 44px;
}
.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;
}
.attendance-table .inline-form { display: inline-flex; align-items: center; gap: 0.35rem; }
.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.15rem 0.3rem 0.15rem 0.6rem;
    margin: 0 0.25rem 0.25rem 0;
    border-radius: 999px;
    font-size: 0.85rem;
    background: #e0eaff;
    color: #2b4d7a;
}
/* Offices in blue, ritual parts in green, so the split reads at a glance. */
.role-pill-office { background: #e0eaff; color: #2b4d7a; }
.role-pill-part   { background: #dcecdc; color: #24663a; }
.role-pill-remove {
    border: 0;
    background: none;
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 1rem;
    line-height: 1;
    color: inherit;
    opacity: 0.55;
}
.role-pill-remove:hover { opacity: 1; color: var(--danger); }

.mail-preview {
    background: #faf9f5;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    overflow-x: auto;
}
.plain-list { list-style: none; padding-left: 0; margin: 0.25rem 0; }
.plain-list li { padding: 0.15rem 0; }

/* Replies members sent in advance from their personal link. */
.rsvp-pill {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
}
.rsvp-attending { background: #dcecdc; color: #24663a; }
.rsvp-apologies { background: #f6e0e0; color: #7d1f1f; }

/* ===== Rank labels ===== */
.rank-lodge { color: #1a4a9a; font-size: 0.88em; }

/* Nav separator */
.nav-sep { color: var(--ink-muted); opacity: 0.5; margin: 0 0.2rem; }

/* Pagination */
.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
}

/* ===== Responsive / Mobile ===== */

/* Hamburger button — hidden on desktop */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 7px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.15s ease;
}
/* Hamburger → X animation */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    /* ── Header & nav ───────────────────────────────── */
    .site-header { position: relative; }
    .nav-toggle  { display: flex; }

    /* The brand is a full lodge name, not a two-word label. Shrink it rather
       than let it wrap under the hamburger on a phone. */
    .site-header .brand { font-size: 0.95rem; }

    .site-header nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--surface);
        border-bottom: 2px solid var(--border);
        box-shadow: 0 4px 16px rgba(0,0,0,0.10);
        padding: 0.25rem 0;
        z-index: 200;
    }
    .site-header nav.open { display: flex; }

    .site-header nav a {
        display: block;
        padding: 0.85rem 1.25rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
        color: var(--ink);
    }
    .site-header nav a:last-child { border-bottom: none; }
    .site-header nav a.muted { color: var(--ink-muted); }
    .nav-sep { display: none; }

    /* ── General layout ─────────────────────────────── */
    .container { padding: 0 1rem; }
    main.container { padding-top: 1rem; padding-bottom: 2rem; }
    h1 { font-size: 1.35rem; }

    .page-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .page-head > div,
    .page-head-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

    .card { padding: 1rem; }

    /* ── Tables — horizontal scroll ─────────────────── */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Tighten cell padding on small screens */
    .data-table th,
    .data-table td { padding: 0.5rem 0.65rem; font-size: 0.9rem; }

    /* Allow selects in tables to shrink */
    .assignments-table select { min-width: 0; width: 100%; }
    .offices-table select     { min-width: 140px; }

    /* ── Forms ──────────────────────────────────────── */
    .form-actions { flex-wrap: wrap; }
    .btn-right { margin-left: 0; }
    .form-group-small { max-width: 100%; }

    /* Filter bar — stack vertically */
    .filter-bar { flex-direction: column; align-items: flex-start; }
    .filter-bar input[type=text],
    .filter-bar select { max-width: 100%; width: 100%; }

    /* ── Meeting brief ──────────────────────────────── */
    .brief-sheet { padding: 1rem 1rem; }
    .brief-two-col { grid-template-columns: 1fr; gap: 1rem; }
    .brief-lodge { font-size: 1.2rem; }

    /* ── Reply page ─────────────────────────────────
       The generic .data-table rule above turns tables into a sideways scroller.
       That is wrong here: the two radio columns are the rightmost, so a brother
       would have to scroll right to reach the only controls on the page. Stack
       each night into a card instead, with both answers as full-width rows. */
    .rsvp-table,
    .rsvp-table tbody,
    .rsvp-table tr,
    .rsvp-table td { display: block; width: auto; overflow-x: visible; }

    .rsvp-table thead { display: none; }

    .rsvp-table tr {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 0.75rem;
        padding: 0.25rem 0;
        background: var(--surface);
    }
    .rsvp-table tr:hover td { background: none; }

    .rsvp-table td { border-bottom: none; padding: 0.4rem 0.9rem; }
    .rsvp-table td:first-child { font-size: 1.05rem; padding-top: 0.7rem; }

    /* Each answer becomes its own tappable row, comfortably over the 44px that
       a finger needs, with the label visible rather than screen-reader only. */
    .rsvp-table .register-cell { width: auto; text-align: left; padding: 0; }
    .rsvp-table .register-cell label {
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.6rem 0.9rem;
        min-height: 48px;
        border-top: 1px solid var(--border);
    }
    .rsvp-table .register-cell input[type=radio] {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
    }
    .rsvp-table .register-cell .sr-only {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        clip: auto;
        clip-path: none;
        overflow: visible;
        white-space: normal;
        font-size: 1rem;
    }

    /* Nothing to answer on a night he is already down to take something. */
    .rsvp-table .register-cell-locked { display: none; }

    .rsvp-table + .form-actions .btn { width: 100%; }

    /* ── LoI toolbar ────────────────────────────────── */
    .loi-toolbar { flex-direction: column; align-items: flex-start; }
    .loi-toolbar .inline-form { flex-wrap: wrap; }
    .loi-toolbar input[type=date] { max-width: 100%; width: 100%; }

    /* ── Dashboard grid already responsive via .grid-3 ── */
}
