/* Hallmark · custom editorial · shape: app screen · warm course ledger */
/* Critique: make the remaining count and pickup time readable at a glance. */
:root {
  --paper: #F8F1E7;
  --surface: #FFFBF5;
  --sand: #F1E4D2;
  --line: #E4D6C3;
  --ink: #2A1F18;
  --muted: #624F43;
  --accent: #C0562A;
  --action: #A34320;
  --peach: #F3DCCB;
  --peach-ink: #8E3A17;
  --cream: #FFF7EC;
  --soft-cream: #EAD5C4;
  --dark-line: #695143;
  --white: #FFFAF2;
  --danger: #922F28;
  --danger-bg: #F8E0DC;
  --good: #265C43;
  --good-bg: #E2EEE3;
  --go: #2C3A4A;
  --calligraphy: #A33B32;
  --swim: #1D6A75;
  --badminton: #2C7A4A;
  --art: #C46A16;
  --english: #3A4E9A;
  --pickleball: #6E3B86;
  --scrim: #2A1F1870;
  --shadow: #502F1910;
  --sans: system-ui, "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", sans-serif;
  --serif: "Songti TC", "Noto Serif CJK TC", "PMingLiU", serif;
  --numbers: Georgia, var(--serif);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button, a, input, select, summary, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, .brand { font-family: var(--serif); line-height: 1.25; overflow-wrap: break-word; }
h1 { font-size: 2rem; text-wrap: balance; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
small, .muted { color: var(--muted); font-size: .9rem; }
.shell { width: min(100% - 32px, 1144px); margin-inline: auto; }
.mast { background: var(--surface); border-bottom: 1px solid var(--line); }
.mast-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 60px; font-size: 1.48rem; font-weight: 800; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 6px); gap: 4px; padding: 8px; border-radius: 8px; background: var(--accent); }
.brand-mark i { width: 6px; height: 6px; border: 1px solid var(--white); border-radius: 1px; }
.brand-mark i:last-child { background: var(--white); }
nav { display: flex; align-self: stretch; gap: 4px; }
nav a { display: grid; place-items: center; min-height: 44px; padding: 4px 12px 0; border-bottom: 3px solid transparent; text-decoration: none; font-weight: 650; font-size: .91rem; color: var(--muted); white-space: nowrap; }
nav a[aria-current="page"] { border-color: var(--accent); color: var(--peach-ink); }
.skip { position: absolute; inset: 8px auto auto 12px; z-index: 3; padding: 8px; background: var(--surface); transform: translateY(-200%); }
.skip:focus { transform: none; }
#main:focus { outline: none; }
.banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--peach); color: var(--peach-ink); }
.banner strong { font-size: .91rem; }
.banner .btn { padding-inline: 8px; background: var(--surface); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 8px; margin: 24px 0 16px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.layout { display: grid; gap: 24px; align-items: start; }
.course-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.course, .panel, .entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 0 var(--shadow); }
.course { min-width: 0; border-top: 4px solid var(--course); }
.course-link { display: block; padding: 12px; border-radius: 12px; color: inherit; text-decoration: none; }
.course-link:hover { background: var(--sand); }
.course-title { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border-radius: 20px; font-size: .78rem; font-weight: 750; background: var(--sand); color: var(--muted); white-space: nowrap; }
.badge.warm { background: var(--peach); color: var(--peach-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.good { background: var(--good-bg); color: var(--good); }
.count { margin: 8px 0 8px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; color: var(--muted); font-size: .84rem; font-variant-numeric: tabular-nums; }
.count strong { color: var(--ink); font: bold 2.6rem/.95 var(--numbers); font-variant-numeric: tabular-nums; }
meter { display: block; width: 100%; height: 6px; margin: 12px 0; appearance: none; }
meter::-webkit-meter-bar { background: var(--sand); border: none; border-radius: 8px; }
meter::-webkit-meter-optimum-value { background: var(--course); border-radius: 8px; }
meter::-moz-meter-bar { background: var(--course); border-radius: 8px; }
.course-link small { display: block; font-size: .82rem; }
.schedule { font-variant-numeric: tabular-nums; }
.reminders { grid-row: 1; background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 16px; }
.reminders .muted { color: var(--soft-cream); }
.reminder-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.reminder-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--dark-line); }
.reminder-time { font: bold 1.9rem/1 var(--numbers); color: var(--cream); white-space: nowrap; }
.reminder-row .badge { margin-left: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.checks label, .check { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.section-head, .actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.section-head { margin-bottom: 8px; }
.actions { justify-content: flex-start; }
.btn { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-size: .91rem; cursor: pointer; text-align: center; }
.btn:hover { background: var(--sand); }
.btn.primary { color: var(--white); background: var(--action); border-color: var(--action); }
.btn.primary:hover { background: var(--peach-ink); }
.btn.remove { color: var(--danger); }
.btn:disabled { background: var(--sand); color: var(--muted); border-color: var(--line); cursor: wait; }
.panel, .entry { padding: 16px; }
.narrow { max-width: 720px; }
.stack { display: grid; gap: 12px; }
.panel > p + *, .panel > h2 + * { margin-top: 8px; }
.entry-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.entry .actions, .entry .detail, details { margin-top: 8px; }
.detail { color: var(--muted); font-size: .91rem; }
summary { cursor: pointer; width: fit-content; min-height: 44px; display: list-item; padding-block: 8px; }
.history { padding-inline-start: 20px; margin: 4px 0 0; }
.photo { display: block; width: min(100%, 240px); max-height: 180px; object-fit: contain; object-position: left; border-radius: 8px; margin-top: 8px; }
.sticky-action { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: 8px 0 max(8px, env(safe-area-inset-bottom)); margin-top: 12px; }
.sticky-action .btn { width: 100%; min-height: 50px; }
footer { margin: 24px 0 16px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 750; font-size: .86rem; }
footer span { margin-left: 8px; color: var(--muted); font-weight: 400; }
dialog { width: min(100% - 24px, 545px); max-height: calc(100dvh - 24px); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
dialog::backdrop { background: var(--scrim); }
.dialog-head { position: sticky; top: 0; z-index: 1; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 8px 16px; }
.dialog-body { padding: 12px 16px 16px; }
.fields { display: grid; gap: 8px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field, .wide { min-width: 0; }
.wide { grid-column: 1 / -1; }
.field { display: grid; gap: 4px; align-content: start; font-size: .9rem; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 8px; color: var(--ink); background: var(--white); font-size: 1rem; }
.field input[type="color"] { padding: 4px; }
.field textarea { resize: vertical; min-height: 56px; }
.dialog-body .actions { margin-top: 12px; }
.dialog-body .actions .primary { flex: 1; }
.form-error { color: var(--danger); margin-top: 4px; font-size: .9rem; }
.file-pick { position: relative; overflow: clip; }
.file-pick input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-pick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
#feedback:not(:empty) { position: fixed; z-index: 3; right: 16px; bottom: 12px; max-width: min(460px, calc(100% - 32px)); padding: 8px 16px; background: var(--ink); color: var(--cream); border-radius: 10px; }
@media (max-width: 479px) {
  .mast-inner { justify-content: space-between; gap: 0 4px; }
  .brand { font-size: 1.23rem; gap: 8px; }
  .brand-mark { padding: 8px; }
  nav a { padding-inline: 8px; font-size: .84rem; }
}
@media (max-width: 335px) {
  .course-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 680px) {
  .mast-inner { min-height: 70px; }
  .page-head { margin-top: 32px; }
  h1 { font-size: 2.4rem; }
  .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .course-link { padding: 16px; }
  .count strong { font-size: 3.22rem; }
}
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 318px; }
  .reminders { grid-area: 1 / 2; padding: 20px; }
  .course-grid { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
.record-section, .results { margin-top: 16px; }
#lead-form { align-items: end; }
#lead-form input { max-width: 12rem; }
#lookup-date { max-width: 20rem; }

.btn:active:not(:disabled), .course-link:active { box-shadow: inset 0 2px 0 var(--shadow); }
@media (min-width: 1120px) {
  .layout .course-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
body:has(.sticky-action) #feedback:not(:empty) { bottom: calc(76px + env(safe-area-inset-bottom)); }
