/* Daycare shortlist - mobile-first stylesheet.
   Phone comes first; wider screens are progressive enhancement.
   Rules of thumb used throughout:
   - inputs never below 16px, so iOS does not zoom on focus
   - interactive targets at least 44px tall
   - safe-area padding so the sticky bar clears the iPhone home indicator */

:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-2: #fbf9f6;
  --ink: #22201d;
  --ink-2: #5c564e;
  --ink-3: #8b8378;
  --line: #e5dfd5;
  --line-2: #d6cec1;
  --accent: #2f6f5e;
  --accent-soft: #e4efea;
  --accent-ink: #1f5145;
  --warn: #9a5b16;
  --warn-soft: #fbeedd;
  --danger: #a33a2c;
  --danger-soft: #fbe8e4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(34, 32, 29, .06), 0 4px 14px rgba(34, 32, 29, .05);
  --tap: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #201e18;
    --surface-2: #262319;
    --ink: #f2ede3;
    --ink-2: #c3bcae;
    --ink-3: #948c7e;
    --line: #35312a;
    --line-2: #453f36;
    --accent: #7fc8ae;
    --accent-soft: #22352e;
    --accent-ink: #a8e0ca;
    --warn: #e0a662;
    --warn-soft: #362a1a;
    --danger: #e58b7c;
    --danger-soft: #3a221e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-wrap: break-word;
}

a { color: var(--accent-ink); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .4em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }

.site-main { padding: 16px 0 96px; }
.site-main .wrap > section { margin-bottom: 20px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand who who" "nav nav nav";
  align-items: center;
  gap: 8px 12px;
  padding-top: 10px;
  padding-bottom: 8px;
}

.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: inherit;
  min-height: 34px;
}

.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #c7a86a));
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .95rem; }
.brand-text small { font-size: .72rem; color: var(--ink-3); }

.nav { grid-area: nav; display: flex; gap: 6px; }

.nav-link {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: .88rem;
  font-weight: 550;
  text-decoration: none;
  color: var(--ink-2);
}
.nav-link.is-active { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow); }

.who {
  grid-area: who;
  justify-self: end;
  font-size: .78rem;
  color: var(--ink-3);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  max-width: 42vw;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (min-width: 620px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav who";
  }
  .nav-link { flex: none; }
}

/* ---------- cards + generic surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.card + .card { margin-top: 12px; }

.muted { color: var(--ink-3); }
.small { font-size: .82rem; }
.tiny { font-size: .74rem; }

.stack > * + * { margin-top: 10px; }

/* ---------- page intro ---------- */

.page-intro { margin-bottom: 14px; }
.page-intro h1 { margin-bottom: 4px; }
.page-intro p { color: var(--ink-2); font-size: .9rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 6px;
}

/* ---------- filters ---------- */

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.search-row { display: flex; gap: 8px; }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 8px 13px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: .82rem;
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .chip.is-active { color: #10201a; } }

.result-count { font-size: .8rem; color: var(--ink-3); }

/* ---------- center list ---------- */

.center-card { display: block; text-decoration: none; color: inherit; position: relative; }
.center-card:active { transform: scale(.995); }

.center-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.center-name { font-size: 1.05rem; font-weight: 650; margin: 0; }
.center-sub { font-size: .8rem; color: var(--ink-3); margin: 2px 0 0; }

.rank {
  flex: none;
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 7px;
  background: var(--surface-2);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 9px;
  font-size: .82rem;
  color: var(--ink-2);
}
.meta-row b { font-weight: 600; color: var(--ink); }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.badge { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.pill.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }

.status-pill { border-color: transparent; }
.status-to-research { background: var(--surface-2); color: var(--ink-3); border-color: var(--line-2); }
.status-contacted { background: #eef1fb; color: #3f4f96; }
.status-waitlisted { background: var(--warn-soft); color: var(--warn); }
.status-tour-scheduled { background: #e8f0fb; color: #2c5d99; }
.status-toured { background: var(--accent-soft); color: var(--accent-ink); }
.status-finalist { background: var(--accent); color: #fff; }
.status-ruled-out { background: var(--danger-soft); color: var(--danger); }

@media (prefers-color-scheme: dark) {
  .status-contacted { background: #232a44; color: #a9b8ef; }
  .status-tour-scheduled { background: #1e2c3f; color: #9fc3ee; }
  .status-finalist { color: #10201a; }
}

.stars { color: var(--warn); letter-spacing: 1px; font-size: .85rem; }

.summary-text { margin-top: 9px; font-size: .87rem; color: var(--ink-2); }

/* ---------- detail ---------- */

.detail-head { margin-bottom: 12px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .84rem;
  text-decoration: none;
  color: var(--ink-3);
  min-height: 34px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.fact {
  background: var(--surface);
  padding: 10px 12px;
}
.fact dt {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  font-weight: 700;
  margin-bottom: 2px;
}
.fact dd { margin: 0; font-size: .87rem; }

.verify-box {
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: .86rem;
  color: var(--ink);
}
.verify-box .eyebrow { color: var(--warn); }

/* ---------- forms ---------- */

label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }

input[type="text"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: var(--tap);
  appearance: none;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }

input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field + .field { margin-top: 12px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary { color: #10201a; } }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 7px 12px; font-size: .82rem; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- sticky action bar ---------- */

.action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
}
.action-bar .btn { flex: 1; }
.has-action-bar .site-main { padding-bottom: calc(96px + var(--safe-b)); }

/* ---------- checklist ---------- */

.check-item { border-top: 1px solid var(--line); padding: 12px 0; }
.check-item:first-of-type { border-top: 0; }
.check-q { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; font-weight: 600; }
.check-num {
  flex: none;
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 5px;
  margin-top: 1px;
}
.check-item textarea { margin-top: 8px; min-height: 62px; }
.check-item.is-answered .check-num { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

.progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.save-hint {
  font-size: .72rem;
  color: var(--ink-3);
  min-height: 16px;
  margin-top: 6px;
  transition: opacity .25s;
}
.save-hint[data-state="saved"] { color: var(--accent-ink); }
.save-hint[data-state="error"] { color: var(--danger); }

/* ---------- notes ---------- */

.note { border-top: 1px solid var(--line); padding: 11px 0; }
.note:first-of-type { border-top: 0; }
.note-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.note-author { font-size: .82rem; font-weight: 650; }
.note-time { font-size: .72rem; color: var(--ink-3); white-space: nowrap; }
.note-body { margin-top: 4px; font-size: .9rem; white-space: pre-wrap; }
.note-actions { margin-top: 6px; display: flex; gap: 4px; }

/* ---------- unlock ---------- */

.gate {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-b));
}
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-card .brand-mark { width: 40px; height: 40px; border-radius: 12px; margin: 0 auto 14px; }
.gate-card h1 { font-size: 1.25rem; }
.gate-card p { font-size: .87rem; color: var(--ink-2); }
.gate-card form { margin-top: 16px; text-align: left; }
.error-note {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .84rem;
  margin-bottom: 12px;
}

/* ---------- guide page ---------- */

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl-item:first-child { border-top: 0; }
.tl-when { font-size: .7rem; font-weight: 700; letter-spacing: .05em; color: var(--accent-ink); padding-top: 2px; }
.tl-what { font-size: .9rem; font-weight: 600; }
.tl-detail { font-size: .82rem; color: var(--ink-2); }

.weight-item { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.weight-item:first-of-type { border-top: 0; }
.weight-num { font-size: .95rem; font-weight: 700; color: var(--accent-ink); }

.link-list { display: flex; flex-direction: column; }
.link-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  min-height: var(--tap);
}
.link-item:first-of-type { border-top: 0; }
.link-item .arrow { color: var(--ink-3); flex: none; }

.empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--ink-3);
  font-size: .88rem;
}

.footnote { font-size: .72rem; color: var(--ink-3); margin-top: 18px; }

@media (min-width: 620px) {
  h1 { font-size: 1.75rem; }
  .site-main { padding-top: 22px; }
  .fact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .action-bar {
    max-width: 720px;
    margin: 0 auto;
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--line);
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
