/* Is There School? — styles.
   The status panel's color carries the answer: green open, amber delayed/early, red closed, slate no school. */

:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --text: #14171c;
  --text-2: #5b616c;
  --text-3: #868c96;
  --line: #e3e6eb;
  --hover: #f6f7f9;
  --link: #1d5bd8;

  --open: #17694a;
  --delay: #9a4f08;
  --closed: #b3261e;
  --off: #3a4a66;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1114;
    --surface: #1a1d22;
    --text: #eceef1;
    --text-2: #a6acb6;
    --text-3: #7d838d;
    --line: #2a2e35;
    --hover: #22262c;
    --link: #78a2ff;
    --open: #1b7352;
    --delay: #a8590f;
    --closed: #a8261f;
    --off: #36445d;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 10px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.muted { color: var(--text-3); }

.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 720px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }

/* ── Header ───────────────────────────────────────────────── */
.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header__bar { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 32px; height: 32px; flex: none; }
.nav { display: flex; gap: 22px; font-size: 15px; font-weight: 500; }
.nav a { color: var(--text-2); white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); }
@media (max-width: 560px) { .nav .nav__about { display: none; } .nav { gap: 16px; } .brand { font-size: 17px; } }
@media (max-width: 440px) { .nav .nav__mine { display: none; } }

.crumbs { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text-3); margin: 16px 0 12px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.crumbs svg { width: 14px; height: 14px; }

/* ── Status panel ─────────────────────────────────────────── */
.panel { --tone: var(--off); background: var(--tone); color: #fff; border-radius: 20px; padding: 22px 20px 16px; margin: 16px 0 0; }
.crumbs + .panel { margin-top: 0; }
.panel--open { --tone: var(--open); }
.panel--delay { --tone: var(--delay); }
.panel--closed { --tone: var(--closed); }
.panel--off { --tone: var(--off); }
.panel a { color: #fff; text-decoration: underline; }
/* Scene illustration across the top of the panel, fading into the panel color */
.panel--art { overflow: hidden; }
.panel__art { position: relative; margin: -22px -20px 16px; height: 150px; }
.panel__art img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; display: block; }
.panel__art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, transparent, var(--tone)); }
@media (min-width: 560px) { .panel__art { height: 210px; } }
@media (min-width: 860px) { .panel__art { margin: -28px -32px 20px; height: 280px; } }
.panel__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel__title { font-size: 17px; font-weight: 600; margin: 0; line-height: 1.3; }
.panel__date { font-size: 15px; margin: 2px 0 0; opacity: 0.88; }

.save { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 8px 13px 8px 11px;
  background: rgba(255, 255, 255, 0.16); color: #fff; font: 600 14px/1 var(--font); cursor: pointer; transition: background 0.15s; }
.save:hover { background: rgba(255, 255, 255, 0.24); }
.save svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.save[aria-pressed="true"] svg { fill: currentColor; }

.panel__main { margin-top: 24px; }
.status { display: flex; align-items: center; gap: 14px; }
.status__icon { width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--tone); display: grid; place-items: center; flex: none; }
.status__icon svg { width: 30px; height: 30px; }
.status__word { font-size: clamp(42px, 11vw, 64px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin: 0; }
.status__sub { font-size: 17px; margin: 12px 0 0; opacity: 0.92; }

.times { display: flex; gap: 32px; margin-top: 22px; align-items: flex-start; }
.times > div { display: grid; align-content: start; }
.times span { font-size: 14px; opacity: 0.88; }
.times strong { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.times em { font-style: normal; font-size: 14px; opacity: 0.88; }

.notice { margin-top: 18px; background: rgba(0, 0, 0, 0.17); border-radius: 12px; padding: 12px 14px; font-size: 15px; line-height: 1.45; }
.notice b { display: block; margin-bottom: 2px; }

@media (min-width: 860px) {
  .panel { padding: 28px 32px 20px; }
  .panel__main { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 40px; }
  .panel__main .times { margin: 0 0 4px; gap: 48px; }
  .panel__main .times strong { font-size: 40px; }
}

.panel__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.panel__checked { margin: 0; font-size: 14px; opacity: 0.88; flex: 1 1 220px; }
.panel__actions { display: flex; gap: 8px; }
.bar-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; padding: 8px 13px 8px 11px; background: rgba(255, 255, 255, 0.16);
  color: #fff; font: 600 14px/1 var(--font); cursor: pointer; transition: background 0.15s; white-space: nowrap; }
.bar-btn:hover { background: rgba(255, 255, 255, 0.24); }
.bar-btn svg { width: 16px; height: 16px; }
.bar-btn[aria-busy="true"] svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bar-btn[aria-busy="true"] svg { animation: none; } }

.alerts-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.alerts-row[hidden] { display: none; }
.alerts-row__icon { width: 40px; height: 40px; border-radius: 10px; background: #fff4d6; color: #a86b00; display: grid; place-items: center; flex: none; }
.alerts-row__icon svg { width: 22px; height: 22px; }
.alerts-row__text { display: grid; flex: 1 1 220px; }
.alerts-row__text span { font-size: 15px; color: var(--text-2); }
.alerts-row.is-on .alerts-row__icon { background: #dff1e8; color: var(--open); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alerts-row__icon { background: #3a2f12; } :root:not([data-theme="light"]) .alerts-row.is-on .alerts-row__icon { background: #143627; } }

/* Week strip */
.week { list-style: none; margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid rgba(255, 255, 255, 0.18); display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd { display: grid; justify-items: center; text-align: center; border-radius: 12px; padding: 8px 2px 9px; }
.wd--first { background: rgba(255, 255, 255, 0.15); }
.wd__name { font-size: 14px; font-weight: 600; }
.wd__date { font-size: 12px; opacity: 0.88; }
.wd__icon { width: 30px; height: 30px; border-radius: 50%; margin: 7px 0 5px; display: grid; place-items: center; }
.wd__icon svg { width: 18px; height: 18px; }
.k-open { background: #fff; color: var(--open); }
.k-delay { background: #ffd28a; color: #6b3a00; }
.k-closed { background: #ffb4ad; color: #7a130d; }
.k-off { background: rgba(255, 255, 255, 0.22); color: #fff; }
.wd__label { font-size: 12px; opacity: 0.92; }

/* ── Sections and grouped lists ───────────────────────────── */
.sections { display: grid; gap: 28px; margin: 28px 0 0; padding-bottom: 8px; }
@media (min-width: 860px) { .sections { grid-template-columns: 1fr 1fr; gap: 32px 24px; } .sections__wide { grid-column: 1 / -1; } }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 10px 4px; }
.note { font-size: 14px; color: var(--text-3); margin: 8px 4px 0; }

.group { background: var(--surface); border-radius: var(--radius); overflow: hidden; margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; min-height: 50px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.value { color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; display: inline-flex; align-items: center; gap: 6px; }
.value--strong { color: var(--text); font-weight: 600; }
.value svg { width: 16px; height: 16px; color: var(--text-3); }
.row--link { color: var(--text); }
.row--link:hover { background: var(--hover); text-decoration: none; }
.row--stack { display: grid; gap: 2px; justify-content: stretch; }
.row--stack span { color: var(--text-2); font-size: 15px; }

/* Lunch */
.food { display: flex; align-items: center; gap: 12px; }
.food i { width: 8px; height: 8px; border-radius: 50%; background: #e0a43a; flex: none; }
.food--side i { background: #8fbf7c; }
.food--side span { color: var(--text-2); }

.lunch-week { margin-top: 10px; }
.lunch-week summary { cursor: pointer; color: var(--link); font-weight: 500; font-size: 15px; margin: 0 4px 8px; list-style: none; width: fit-content; }
.lunch-week summary::-webkit-details-marker { display: none; }
.lunch-week summary::after { content: " ›"; }
.lunch-week[open] summary::after { content: " ⌄"; }

/* Coming up */
.event { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.cal { width: 46px; flex: none; border-radius: 10px; overflow: hidden; text-align: center; border: 1px solid var(--line); background: var(--surface); }
.cal span { display: block; background: #d64545; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 0; text-transform: uppercase; letter-spacing: 0.02em; }
.cal--early span { background: #d9890f; }
.cal strong { display: block; font-size: 20px; font-weight: 600; line-height: 30px; }
.event__body { display: grid; min-width: 0; }
.event__name { font-weight: 600; }
.event__meta { font-size: 15px; color: var(--text-2); }
.event__when { margin-left: auto; padding-left: 8px; font-size: 14px; color: var(--text-3); white-space: nowrap; align-self: flex-start; padding-top: 2px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: #8a5a00; background: #fff1c7; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
@media (max-width: 460px) { .event__when { display: none; } }

.subscribe { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; }
.subscribe__icon { width: 40px; height: 40px; border-radius: 10px; background: #eaf0fd; color: var(--link); display: grid; place-items: center; flex: none; }
.subscribe__icon svg { width: 22px; height: 22px; }
.subscribe__text { display: grid; flex: 1 1 220px; }
.subscribe__text span { font-size: 15px; color: var(--text-2); }
.subscribe__links { display: flex; gap: 8px; }
.pill { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); font-size: 15px; font-weight: 600; white-space: nowrap; }
.pill:hover { background: var(--hover); text-decoration: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .subscribe__icon { background: #22304d; } }

/* Neighbor tip (Walks for Lucy) */
.tip { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 12px 16px; }
.tip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.tip p { margin: 0; font-size: 15px; color: var(--text-2); }

.about-school p { color: var(--text-2); margin: 0 4px 12px; max-width: 46rem; }

/* ── Search ───────────────────────────────────────────────── */
.finder { position: relative; }
.finder-wrap { margin-top: 16px; }
.finder__box { position: relative; }
.finder__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: grid; pointer-events: none; }
.finder__icon svg { width: 20px; height: 20px; }
.finder__input { width: 100%; height: 52px; padding: 0 16px 0 44px; font: 17px var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; -webkit-appearance: none; appearance: none; }
.finder__input::placeholder { color: var(--text-3); }
.finder__input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 22%, transparent); }
.finder__input::-webkit-search-cancel-button { display: none; }
.finder__list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 20, 30, 0.14); max-height: min(360px, 60vh); overflow: auto; }
.finder__list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.finder__list li[aria-selected="true"] { background: var(--hover); }
.finder__list .n b { font-weight: 700; }
.finder__list .c { color: var(--text-3); font-size: 15px; white-space: nowrap; }
.finder__list .empty { color: var(--text-3); cursor: default; }

/* ── Home ─────────────────────────────────────────────────── */
.intro { padding: 40px 0 28px; max-width: 640px; }
.intro__title { font-size: clamp(32px, 7vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; margin: 0; }
.intro__sub { font-size: 18px; color: var(--text-2); margin: 10px 0 22px; }
.intro .finder__input { height: 56px; box-shadow: 0 1px 2px rgba(15, 20, 30, 0.05); }

[data-when-saved] { display: none; }
.has-schools [data-when-saved] { display: block; }
.has-schools [data-when-empty] { display: none; }
.mine { padding: 24px 0 8px; }
.mine__head { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 12px; }
.mine__title { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
.btn-text { border: 0; background: none; color: var(--link); font: 500 16px var(--font); cursor: pointer; padding: 6px 4px; }
.mine__cards { display: grid; gap: 12px; }
@media (min-width: 760px) { .mine__cards { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); } }
.mine__add { margin: 14px 4px 8px; }
.mine__add summary { cursor: pointer; color: var(--link); font-weight: 500; list-style: none; width: fit-content; }
.mine__add summary::-webkit-details-marker { display: none; }
.mine__add summary::before { content: "+ "; }
.mine__add .finder { margin-top: 10px; }
.districts, .browse { margin-top: 28px; }
.has-schools .districts { margin-top: 32px; }

.card-wrap { position: relative; }
.card { --tone: var(--off); display: block; background: var(--tone); color: #fff; border-radius: 18px; padding: 18px 18px 12px; }
.card:hover { text-decoration: none; filter: brightness(1.04); }
.card--open { --tone: var(--open); }
.card--delay { --tone: var(--delay); }
.card--closed { --tone: var(--closed); }
.card__top { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.card__name { font-weight: 600; }
.card__when { opacity: 0.88; white-space: nowrap; }
.card .status { margin-top: 14px; }
.card .status__icon { width: 40px; height: 40px; }
.card .status__icon svg { width: 22px; height: 22px; }
.card .status__word { font-size: 36px; }
.card__sub { display: block; margin-top: 8px; font-size: 16px; opacity: 0.92; font-variant-numeric: tabular-nums; }
.card .week { margin-top: 14px; padding-top: 10px; }
.card .wd { padding: 6px 2px; }
.card .wd__date { display: none; }
.card .wd__icon { width: 26px; height: 26px; margin: 5px 0 3px; }
.card .wd__icon svg { width: 15px; height: 15px; }
.card-remove { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--text); color: var(--surface);
  font: 600 18px/30px var(--font); cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.is-editing .card { opacity: 0.85; }

/* ── District directory ───────────────────────────────────── */
.dir { border-bottom: 1px solid var(--line); }
.dir:last-child { border-bottom: 0; }
.dir summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 600; }
.dir summary::-webkit-details-marker { display: none; }
.dir summary:hover { background: var(--hover); }
.dir summary svg { transition: transform 0.2s; }
.dir[open] summary svg { transform: rotate(90deg); }
.dir__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); display: grid; }
@media (min-width: 760px) { .dir__list { grid-template-columns: 1fr 1fr; } .dir__list li:nth-child(odd) { border-right: 1px solid var(--line); } }
.dir__list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.dir__list a:hover { background: var(--hover); text-decoration: none; }
.dir__name { display: grid; font-weight: 500; }
.dir__name small { font-size: 13px; color: var(--text-3); font-weight: 400; }
.dir__time { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Reference pages (delay times, early release, differences) ── */
.guide { padding-bottom: 8px; }
.guide h1 { font-size: clamp(28px, 6vw, 36px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; margin: 4px 0 10px; max-width: 30ch; }
.guide .lead { font-size: 18px; color: var(--text-2); max-width: 46rem; margin: 0 0 8px; }
.guide h2 { margin-top: 28px; }
.guide-section { margin-top: 8px; }
.crumbs span[aria-hidden] { color: var(--text-3); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 16px; }
.table th, .table td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child th, .table tbody tr:last-child td { border-bottom: 0; }
.table thead th { font-size: 13px; font-weight: 600; color: var(--text-3); background: var(--hover); white-space: nowrap; }
.table tbody th { font-weight: 500; }
.table tbody th a { color: var(--text); }
.table small { display: block; font-size: 13px; color: var(--text-3); font-weight: 400; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }
.table .strong { color: var(--text); font-weight: 700; }
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot--open { background: var(--open); }
.dot--off { background: var(--off); }
.prose-box { padding: 14px 18px; margin: 14px 0 0; }
.prose-box p { margin: 0 0 6px; }
.prose-box ul { margin: 0; padding-left: 20px; color: var(--text-2); }
.prose-box li { margin: 4px 0; }
@media (max-width: 520px) { .table th, .table td { padding: 10px 12px; font-size: 15px; } }

.holiday-cards { display: grid; gap: 12px; margin: 16px 0 8px; }
@media (min-width: 760px) { .holiday-cards { grid-template-columns: 1fr 1fr; } }
.card__word-line { display: block; font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin-top: 10px; }

/* ── About / prose ────────────────────────────────────────── */
.prose { padding-top: 36px; padding-bottom: 24px; }
.prose h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 10px; }
.prose h2 { margin-top: 32px; }
.prose > p { margin: 0 4px 12px; color: var(--text-2); }
.prose .lead { font-size: 19px; color: var(--text); margin-bottom: 20px; }
.person { display: flex; gap: 18px; align-items: center; padding: 16px; }
.person__photo { margin: 0; flex: none; width: 128px; }
.person__photo img { width: 128px; height: 170px; border-radius: 12px; object-fit: cover; }
.person__photo figcaption { font-size: 12px; color: var(--text-3); margin-top: 6px; text-align: center; }
@media (max-width: 480px) { .person { align-items: flex-start; } .person__photo, .person__photo img { width: 104px; } .person__photo img { height: 138px; } }
.person p { margin: 0; color: var(--text-2); }

/* ── Footer ───────────────────────────────────────────────── */
.footer { margin-top: 48px; background: var(--surface); border-top: 1px solid var(--line); padding: 26px 0 36px; }
.footer__grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .footer__grid { grid-template-columns: 1.2fr 1fr; gap: 48px; } }
.footer__anissa { display: flex; gap: 14px; align-items: center; }
.footer__anissa img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.footer__anissa p { margin: 0; font-size: 15px; color: var(--text-2); }
.footer__fine p { margin: 0 0 6px; font-size: 13px; color: var(--text-3); }

@media print { .header nav, .finder, .save, .footer, .tip { display: none; } .panel { color: #000; background: none; border: 2px solid #000; } }
