:root {
    color-scheme: light;
    --ink: #192c39;
    --muted: #536571;
    --navy: #112733;
    --teal: #10665c;
    --line: #dce5e8;
    --page: #f4f7f7;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); font: 15px/1.6 Tahoma, Arial, sans-serif; }
.shell { width: min(1400px, 94%); margin-inline: auto; }
.top { background: var(--navy); color: white; border-bottom: 3px solid #a68b52; }
.top-inner, .identity, .profile, .toolbar, .inline { display: flex; align-items: center; gap: 12px; }
.top-inner { justify-content: space-between; min-height: 80px; padding: 10px 0; }
.identity strong { font-size: 17px; }
.identity small { display: block; color: #ccdbdf; }
.symbol { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 11px; background: #234650; color: #e7d198; font-size: 23px; }
.nav { display: flex; gap: 8px; overflow-x: auto; padding-block: 15px; border-bottom: 1px solid var(--line); }
.nav a { color: var(--muted); font-weight: bold; border-radius: 8px; padding: 8px 12px; white-space: nowrap; text-decoration: none; }
.nav a[aria-current] { background: #dceee9; color: #10594f; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 0 17px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 2px; font-size: 13px; color: var(--teal); font-weight: bold; }
h1 { font-size: clamp(25px, 4vw, 35px); line-height: 1.3; margin: 0; }
h2 { margin: 0 0 12px; font-size: 19px; }
.panel, .stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.pad { padding: 18px; margin-bottom: 15px; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 15px; margin-bottom: 16px; }
.filters.bare { padding: 0; margin: 0; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: bold; }
.search { flex: 1 1 220px; }
input, select, button, .button { font: inherit; border-radius: 7px; padding: 8px 10px; min-height: 40px; }
input, select { color: var(--ink); border: 1px solid #bccbd0; background: #fff; max-width: 100%; }
button, .button { display: inline-block; text-decoration: none; color: white; background: var(--teal); border: 1px solid transparent; cursor: pointer; font-weight: bold; white-space: nowrap; }
button:hover, .button:hover { filter: brightness(.92); }
:focus-visible { outline: 2px solid #157567; outline-offset: 2px; }
.secondary { color: var(--teal); background: #fff; border-color: #c4d1d4; }
.quiet { background: #234650; border-color: #47616a; }
.small { min-height: 34px; padding: 4px 10px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 14px; }
.stat strong { font-size: 24px; }
.present { background: #e7f5ed; color: #165d45; }
.absent { background: #fceceb; color: #8d322e; }
.excused { background: #fbf3e2; color: #76541a; }
.pending { background: #edf1f4; color: #465867; }
.hint { color: var(--muted); margin: 12px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: right; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: #36515b; background: #eef3f4; font-size: 13px; white-space: nowrap; }
.daily td:first-child { min-width: 150px; }
.daily select { min-width: 105px; }
.daily input[name="note"] { min-width: 125px; width: 100%; }
.number { display: block; color: var(--muted); overflow-wrap: anywhere; }
.pill { display: inline-block; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.month th, .month td { text-align: center; padding: 5px 7px; border-inline-end: 1px solid var(--line); min-width: 28px; }
.month th:first-child, .month td:first-child { min-width: 145px; text-align: right; }
.empty { text-align: center !important; padding: 26px; color: var(--muted); }
.notice { background: #e5f3ed; border: 1px solid #afd3c4; border-radius: 8px; padding: 8px 12px; }
.error { background: #fceceb; border-color: #e6b5b1; color: #8d322e; }
.signin { max-width: 460px; margin-block: clamp(32px, 10vh, 94px); }
.auth { padding: 25px; }
.auth p { color: var(--muted); }
.stack { display: grid; gap: 13px; }
.account { max-width: 380px; }
.pager { margin-top: 12px; }
.footer { color: var(--muted); margin-block: 22px; font-size: 13px; }
.print-only { display: none; }
@media (max-width: 600px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .identity strong { font-size: 14px; }
    .identity small, .profile { font-size: 11px; }
    .profile { flex-direction: column; gap: 3px; }
    .quiet { min-height: 31px; padding: 3px 9px; }
}
@page { size: A4 portrait; margin: 10mm; }
@media print {
    body { background: white; color: black; font-size: 10pt; }
    .shell { width: 100%; }
    .top { color: black; background: white; border-bottom: 1px solid #888; }
    .top-inner { min-height: 42px; }
    .identity small { color: #222; }
    .symbol, .profile, .nav, .toolbar, .filters, .screen-only, .notice, .footer { display: none !important; }
    .print-only { display: inline; }
    .heading { margin: 8px 0; }
    .table-wrap { overflow: visible; }
    .month { table-layout: fixed; font-size: 7pt; }
    .month th, .month td { min-width: 0; padding: 2px 0; overflow-wrap: anywhere; }
    .month th:first-child, .month td:first-child { min-width: 0; }
    thead { display: table-header-group; }
    tr { break-inside: avoid; }
}

.monthly-print { display: none; }
.monthly-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.monthly-meta h2 { margin: 0; }
.monthly-legend { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.monthly-grid th, .monthly-grid td { padding: 7px 8px; }
.monthly-grid thead tr:first-child th { background: #214452; color: #fff; }
.monthly-grid th.monthly-name { text-align: start; font-weight: normal; background: #fff; white-space: normal; }
.monthly-grid th.monthly-name strong { display: block; }
.monthly-grid .monthly-date { min-width: 87px; }
.monthly-date span, .monthly-date time { display: block; }
.monthly-date time { font-size: .86em; font-weight: normal; }
.monthly-grid tbody tr:nth-child(even) .monthly-cell,
.monthly-grid tbody tr:nth-child(even) .monthly-name { background: #f5f8f8; }
.monthly-total { font-weight: bold; }
.monthly-mark { display: inline-grid; place-items: center; min-width: 23px; min-height: 23px; border-radius: 5px; font-weight: bold; }
.monthly-mark.off { color: #56656c; }
@media screen {
    .monthly-grid thead th[rowspan], .monthly-grid th.monthly-name {
        position: sticky;
        inset-inline-start: 0;
        z-index: 1;
        min-width: 185px;
        box-shadow: -2px 0 var(--line);
    }
}
@media print {
    .monthly-print { display: block; }
    .daily { table-layout: fixed; }
    .daily th, .daily td { padding: 2mm 1.4mm; white-space: normal; overflow-wrap: anywhere; }
    .daily th:nth-child(1) { width: 27%; }
    .daily th:nth-child(2) { width: 18%; }
    .daily th:nth-child(3) { width: 15%; }
    .daily th:nth-child(4) { width: 15%; }
    .daily td:first-child { min-width: 0; }
    .member-sheet + .member-sheet { break-before: page; }
    .member-heading { break-after: avoid; padding: 2mm 0; }
    .member-heading h2 { margin: 0; font-size: 14pt; }
    .member-heading p { margin: 1mm 0 2mm; }
    .member-register { table-layout: fixed; font-size: 9pt; line-height: 1.35; }
    .member-register th, .member-register td { padding: 1mm 1.5mm; border: .25mm solid #b7c3c8; overflow-wrap: anywhere; }
    .member-register tr:last-child td { border-bottom: .25mm solid #b7c3c8; }
    .member-register th { font-size: 9pt; }
    .member-register td:nth-child(2), .member-register td:nth-child(4) { white-space: nowrap; }
    .print-day { width: 16%; }
    .print-date { width: 19%; }
    .print-status { width: 16%; }
    .print-time { width: 16%; }
    .member-totals { display: flex; flex-wrap: wrap; gap: 2mm 5mm; margin-top: 3mm; padding: 2mm; border: .25mm solid #b7c3c8; break-inside: avoid; }
}

.mobile-scroll-hint { display: none; }
@media screen and (max-width: 700px) {
    .shell { width: calc(100% - 24px); }
    .top-inner { align-items: center; }
    .identity, .profile { min-width: 0; }
    .identity small, .profile span { overflow-wrap: anywhere; }
    .profile { flex-direction: column; gap: 3px; text-align: center; }
    .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding-block: 8px; }
    .nav a { display: grid; place-items: center; min-height: 44px; padding: 4px 6px; text-align: center; white-space: normal; }
    .heading { display: grid; margin-block: 17px 12px; }
    .toolbar { flex-wrap: wrap; gap: 8px; }
    .heading .toolbar > * { flex: 1; text-align: center; }
    .filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .filters > label, .stack > label { min-width: 0; }
    .filters > button, .filters > .button { width: 100%; text-align: center; }
    .filters input:not([type="checkbox"]), .filters select, .stack input { width: 100%; min-width: 0; }
    input, select, button, .button, .small, .quiet { min-height: 44px; }
    input:not([type="checkbox"]), select { font-size: 16px; }
    .filters fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; padding: 6px; }
    .filters fieldset label span, .filters label span:has(input[type="checkbox"]) { display: flex; gap: 7px; align-items: center; min-height: 44px; }
    input[type="checkbox"] { min-height: 0; inline-size: 19px; block-size: 19px; flex: none; }
    .mobile-cards { overflow: visible; border: 0; background: transparent; border-radius: 0; }
    .mobile-cards table, .mobile-cards tbody { display: block; width: 100%; }
    .mobile-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .mobile-cards tbody { display: grid; gap: 10px; }
    .mobile-cards tbody tr {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
        background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px;
    }
    .mobile-cards tbody td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
    .mobile-cards .daily tbody td:first-child { min-width: 0; }
    .mobile-cards td[data-label]::before {
        content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: bold; margin-bottom: 3px;
    }
    .mobile-cards :is(.card-title, .card-subtitle, .card-wide, .empty) { grid-column: 1 / -1; }
    .mobile-cards .card-title { grid-row: 1; font-size: 16px; }
    .mobile-cards .card-subtitle { grid-row: 2; color: var(--muted); }
    .mobile-cards .card-no-action { display: none; }
    .mobile-cards :is(select, input:not([type="hidden"]), button) { width: 100%; min-width: 0; }
    .mobile-cards .inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
    .mobile-edit { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: 7px; }
    .mobile-scroll-hint { display: block; color: var(--muted); margin: 5px 0; }
    .monthly-scroll { max-width: 100%; overscroll-behavior-inline: contain; }
    .monthly-grid thead th[rowspan], .monthly-grid th.monthly-name { min-width: 132px; max-width: 150px; }
    .monthly-grid .monthly-date { min-width: 83px; }
    .signin { margin-block: 26px; }
    .auth { padding: 18px; }
}
