:root {
  color-scheme: light;
  --paper: #FBF7F1;
  --ink: #2A2238;
  --terracotta: #D9714E;
  --rust: #9B4027;
  --blue: #35577D;
  --soft: #F1E7DA;
  --green: #4F8A6B;
  --green-ink: #315E47;
  --muted: #665E70;
  --line: #DED5CA;
  --white: #FFFDFA;
  --radius: 20px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button, select, input[type="checkbox"] { cursor: pointer; }
a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button { border: 0; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
input:focus-visible, select:focus-visible { outline-offset: 2px; }
::selection { background: #F5D3BC; color: var(--ink); }
h1, h2, h3, p, ul, ol, blockquote { margin-top: 0; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 500; line-height: 1.18; }
h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.035em; margin-bottom: 16px; }
h2 { font-size: 1.65rem; letter-spacing: -.025em; margin-bottom: 16px; }
h3 { font-size: 1.3rem; margin-bottom: 10px; }
p { margin-bottom: 18px; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 8px; }
svg { flex-shrink: 0; width: 22px; height: 22px; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; z-index: 30; left: 16px; top: -100px; background: var(--ink); color: white; padding: 12px 18px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.app-header { max-width: 1280px; margin: auto; min-height: 94px; padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: Fraunces, Georgia, serif; font-size: 1.1rem; line-height: 1.15; text-decoration: none; color: var(--ink); }
.brand img { border-radius: 12px; }
.brand span span { display: block; }
.child-select { display: flex; align-items: center; gap: 10px; }
.child-select select { max-width: 230px; border-radius: 24px; padding: 8px 32px 8px 14px; min-height: 44px; background-color: var(--soft); border: 1px solid transparent; font-size: .82rem; }
.profile-link { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; text-decoration: none; }
.app-layout { max-width: 1200px; margin: auto; }
main { min-width: 0; padding: 30px 20px 120px; }
main:focus { outline: none; }
#app { max-width: 800px; margin: auto; }
.sidebar { display: none; }
.tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,253,250,.98); border-top: 1px solid var(--line); }
.nav-item { min-height: 54px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .65rem; font-weight: 500; border-radius: 12px; }
.nav-item svg { width: 23px; height: 23px; }
.nav-item[aria-current="page"] { background: var(--soft); color: var(--ink); font-weight: 700; }
.eyebrow { color: var(--rust); text-transform: uppercase; font-size: .68rem; letter-spacing: .14em; font-weight: 700; margin-bottom: 12px; }
.lede, .muted { color: var(--muted); }
.lede { font-size: 1.02rem; max-width: 600px; }
.small { font-size: .82rem; }
.page-head { margin-bottom: 28px; }
.page-head .lede { margin-bottom: 0; }
.section { margin-top: 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading a { font-size: .82rem; flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; }
.card, .empty, .profile-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); padding: 24px; }
.card p:last-child, .empty p:last-child { margin-bottom: 0; }
.empty { color: var(--muted); }
.empty h2 { color: var(--ink); }
.grid { display: grid; gap: 14px; }
.card-link { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); padding: 21px; min-height: 88px; transition: border-color .15s, background .15s; }
.card-link:hover { border-color: var(--blue); background: #F6F2EB; }
.card-link .card-copy { flex: 1; min-width: 0; }
.card-thumbnail { display: block; width: 86px; height: 74px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.card-step { display: inline-block; color: var(--blue); font-size: .75rem; font-weight: 700; margin-bottom: 5px; }
.card-step.done { color: var(--green-ink); }
.card-link h3 { margin-bottom: 6px; overflow-wrap: break-word; }
.card-link p { color: var(--muted); margin: 0; font-size: .82rem; }
.card-link .arrow { width: 20px; color: var(--blue); }
.number { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--soft); font-family: Fraunces, Georgia, serif; font-size: 1.2rem; }
.number.done { background: #E5EFE8; color: var(--green-ink); }
.hero { position: relative; overflow: hidden; border-radius: 24px; background: var(--soft); padding: 28px; }
.hero h2 { font-size: 1.9rem; max-width: 530px; }
.hero .eyebrow { color: var(--blue); }
.hero p { max-width: 520px; }
.hero .btn { margin-top: 4px; }
.hero-accent { position: absolute; right: -35px; top: -40px; width: 180px; height: 180px; border: 24px solid #E8D9C6; border-radius: 50%; pointer-events: none; opacity: .6; }
.hero > :not(.hero-accent) { position: relative; }
.btn { min-height: 48px; padding: 12px 20px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: .9rem; line-height: 1.4; font-weight: 600; background: var(--blue); color: white; text-decoration: none; text-align: center; }
.btn:hover { background: #284363; color: white; text-decoration: none; }
.btn.secondary { color: var(--ink); background: var(--soft); }
.btn.secondary:hover { background: #E6D8C7; }
.btn.outline { border: 1px solid var(--line); background: transparent; color: var(--blue); }
.btn.outline:hover { background: var(--soft); }
.btn.is-done { background: #E5EFE8; color: var(--green-ink); }
.btn.danger { color: #932F36; background: #F9EBE8; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.text-button { min-height: 44px; padding: 8px 0; background: transparent; color: var(--blue); text-decoration: underline; text-underline-offset: .2em; font-size: .85rem; }
.back { display: inline-flex; align-items: center; min-height: 44px; gap: 7px; font-size: .85rem; margin: -10px 0 20px; text-decoration: none; }
.progress-box { margin-top: 24px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; margin-bottom: 8px; }
progress { display: block; width: 100%; height: 8px; border: 0; appearance: none; border-radius: 10px; overflow: hidden; background: var(--line); color: var(--green); }
progress::-webkit-progress-bar { background: var(--line); border-radius: 10px; }
progress::-webkit-progress-value { background: var(--green); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--green); }
.day-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; margin-top: 16px; }
.day-dot { min-width: 0; min-height: 48px; border-radius: 12px; text-align: center; padding: 11px 3px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: .82rem; }
.day-dot.done { background: #E5EFE8; color: var(--green-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .8rem; margin-top: 16px; }
.badge { padding: 3px 10px; border-radius: 20px; background: var(--soft); color: var(--ink); font-size: .72rem; }
.badge.done { background: #E5EFE8; color: var(--green-ink); }
.unit { max-width: 690px; margin: auto; }
.unit-image { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--radius); margin-bottom: 24px; }
.unit > .meta { margin: 0 0 24px; }
.unit-content > * { margin-bottom: 24px; }
.unit-content > h2 { margin-top: 34px; }
.unit-content p { overflow-wrap: break-word; }
.callout { border-radius: var(--radius); padding: 24px; background: var(--soft); }
.callout > :last-child { margin-bottom: 0; }
.callout-label { font-size: .74rem; font-weight: 700; margin-bottom: 10px; color: var(--blue); }
.julie { background: #EFE8DF; border-left: 3px solid var(--terracotta); }
.signature { font-family: Fraunces, Georgia, serif; font-size: 1.3rem; margin-top: 10px; color: var(--rust); }
.echec { background: #FBEEEB; border: 1px solid #ECCFC9; }
.echec .callout-label { color: #8E3540; }
.quote { font-family: Fraunces, Georgia, serif; font-size: 1.2rem; line-height: 1.5; margin-bottom: 12px; }
.why { font-size: .82rem; color: var(--muted); margin-bottom: 0; }
.phrase-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; position: relative; }
.phrase-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.phrase-top .callout-label { margin: 0; }
.favorite { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--blue); font-size: 1.55rem; line-height: 1; flex-shrink: 0; }
.favorite[aria-pressed="true"] { background: #F8E6D8; color: var(--rust); }
.gesture { font-size: .88rem; margin: 14px 0 10px; color: var(--muted); }
.phrase-card .quote { font-size: 1.28rem; }
.attention { background: #FFF1DB; border: 1px solid #D5B376; }
.attention .callout-label { color: #704A17; display: flex; align-items: center; gap: 8px; }
.astuce { background: #EAF0F5; }
.action { background: #E8EFE9; border-left: 3px solid var(--green); }
.action .callout-label { color: var(--green-ink); }
.age-tabs, .segmented { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.chip { min-height: 44px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); padding: 8px 15px; font-size: .82rem; color: var(--muted); }
.chip[aria-selected="true"], .chip[aria-pressed="true"] { color: white; background: var(--blue); border-color: var(--blue); }
.age-panel { border-left: 2px solid var(--line); padding-left: 16px; }
.age-panel > * { margin-bottom: 18px; }
.audio-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: #F0F3F5; }
.audio-label { font-size: .85rem; color: var(--blue); font-weight: 600; margin-bottom: 8px; display: flex; gap: 9px; align-items: center; }
.audio-card audio { display: none; }
.audio-toggle { display: flex; width: 100%; min-height: 60px; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--blue); color: white; text-align: left; font-size: .94rem; font-weight: 600; line-height: 1.35; cursor: pointer; }
.audio-toggle:hover { background: #284363; }
.audio-toggle [data-audio-icon] { flex: 0 0 20px; text-align: center; }
.audio-duration { margin-left: auto; font-size: .8rem; font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
.audio-seek { display: block; width: 100%; min-height: 44px; margin: 5px 0 -6px; accent-color: var(--blue); cursor: pointer; }
.audio-card.is-playing { border-color: var(--blue); }
.audio-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.audio-pair .audio-card { min-width: 0; padding: 12px; }
.audio-pair .audio-label { font-size: .76rem; min-height: 2.8em; align-items: flex-start; }
.audio-pair .audio-toggle { flex-wrap: wrap; padding: 12px 9px; gap: 7px; font-size: .8rem; min-height: 90px; }
.audio-pair .audio-toggle [data-audio-label] { flex: 1; }
.audio-pair .audio-duration { flex-basis: 100%; margin-left: 27px; }
.page-head > .audio-card { margin-top: 20px; }
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; table-layout: fixed; }
th { background: var(--soft); font-weight: 600; text-align: left; }
th, td { padding: 14px 12px; vertical-align: top; overflow-wrap: anywhere; }
tr + tr td { border-top: 1px solid var(--line); }
.checklist { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px; background: var(--white); }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; min-height: 48px; cursor: pointer; }
.check-row + .check-row { border-top: 1px solid var(--line); }
input[type="checkbox"] { width: 22px; height: 22px; min-width: 22px; margin: 3px 0 0; accent-color: var(--blue); }
.check-row:has(input:checked) { color: var(--green-ink); }
.unit-footer { border-top: 1px solid var(--line); margin-top: 34px; padding-top: 24px; }
.filter-box { background: var(--soft); border-radius: var(--radius); padding: 20px; margin: 24px 0; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label, legend { font-size: .85rem; font-weight: 500; }
input:not([type="checkbox"]):not([type="range"]), select { min-height: 48px; width: 100%; border: 1px solid #B7ADB7; border-radius: 10px; padding: 10px 12px; background: var(--white); }
input::placeholder { color: #746D7D; opacity: 1; }
input[type="search"] { padding-left: 40px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 12px; top: 14px; color: var(--muted); width: 19px; height: 19px; pointer-events: none; }
.filters-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.filters-grid .field { margin-bottom: 0; }
.filters-grid select { font-size: .82rem; }
.filter-count { color: var(--muted); font-size: .82rem; margin: 18px 0; }
.results { display: grid; gap: 14px; }
.profile-card { margin: 16px 0; }
.profile-card h3 { font-family: Inter, system-ui, sans-serif; font-size: .95rem; font-weight: 600; }
.profile-card.active { border-color: var(--blue); }
.profile-form { padding-top: 16px; }
fieldset { margin: 0; padding: 0; border: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .field { margin-bottom: 0; }
.form-error { color: #932F36; margin: 12px 0 0; font-size: .85rem; }
.day-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--white); scroll-margin-top: 25px; }
.day-card.done { border-color: var(--green); }
.day-card h2 { margin: 14px 0; }
.day-card .check-row { margin-top: 16px; border-top: 1px solid var(--line); }
.bonus-card { display: flex; flex-direction: column; align-items: flex-start; padding: 25px; }
.bonus-card .bonus-cover { width: 100%; height: auto; aspect-ratio: 400 / 267; margin-bottom: 20px; }
.bonus-card .badge { margin-bottom: 16px; color: var(--rust); background: #F9E7D9; }
.bonus-card h2 { font-size: 1.5rem; }
.bonus-card .btn { margin-top: auto; }
.bonus-card .bonus-meta { display: flex; justify-content: space-between; width: 100%; font-size: .8rem; color: var(--muted); margin: 6px 0 20px; }
.quick-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.inline-note { background: var(--soft); border-radius: 12px; padding: 14px 18px; font-size: .82rem; }
.install-step { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; }
.install-step p { margin: 7px 0 0; }
.toast { position: fixed; bottom: calc(92px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: min(90vw, 500px); width: max-content; z-index: 40; border-radius: 12px; padding: 12px 18px; background: var(--ink); color: white; font-size: .85rem; box-shadow: 0 4px 24px #2A223824; }
.gate { max-width: 490px; margin: 5vh auto; }
.gate .card { padding: 30px; }
body.gated .tabbar, body.gated .sidebar, body.gated #child-switcher { display: none; }
body.gated .app-layout { display: block; }
.loading { color: var(--muted); padding: 24px; }
@media (max-width: 399px) {
  .app-header { padding: 16px; gap: 8px; }
  .brand { font-size: .91rem; gap: 6px; }
  .brand img { width: 34px; height: 34px; }
  .child-select select { max-width: 132px; font-size: .72rem; padding-left: 9px; }
  .profile-link { font-size: .72rem; }
  .profile-link svg { display: none; }
  .hero, .card, .day-card { padding: 22px; }
  .card-link { padding: 16px; gap: 12px; }
  .card-link:has(.card-thumbnail) h3 { font-size: 1.14rem; }
  .card-link > svg { width: 18px; }
  .phrase-card, .callout { padding: 20px; }
  .section-heading h2 { font-size: 1.4rem; }
}
@media (min-width: 600px) {
  main { padding: 40px 32px 120px; }
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two > .card-link { flex-wrap: wrap; }
  .grid.two > .card-link .card-thumbnail { width: 100%; height: auto; aspect-ratio: 400 / 267; }
  .filters-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding: 36px; }
}
@media (min-width: 1000px) {
  .app-header { padding: 22px 40px; min-height: 104px; }
  .brand { font-size: 1.25rem; }
  .app-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); }
  .sidebar { display: block; padding: 40px 18px 40px 20px; position: sticky; top: 0; height: calc(100dvh - 104px); }
  .sidebar .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: .85rem; padding: 12px 16px; margin-bottom: 6px; text-align: left; }
  .sidebar .nav-item svg { width: 20px; height: 20px; }
  .side-extra { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
  .side-extra a { min-height: 44px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .82rem; text-decoration: none; border-radius: 12px; }
  .side-extra a:hover, .side-extra a[aria-current="page"] { background: var(--soft); color: var(--ink); }
  main { padding: 42px 40px 80px; }
  .tabbar { display: none; }
  .toast { bottom: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@page { size: A4; margin: 14mm; }
@media print {
  :root { font-size: 11pt; color: #111; background: white; line-height: 1.45; }
  body { background: white; }
  .app-header, .sidebar, .tabbar, .toast, .skip-link, .back, .no-print, .unit-footer, .favorite, .audio-card, .age-tabs, .unit-image, .card-thumbnail, .quick-links { display: none !important; }
  .app-layout { display: block; max-width: none; }
  main, #app, .unit { padding: 0; margin: 0; max-width: none; }
  h1 { font-size: 25pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }
  h1, h2, h3 { break-after: avoid; }
  p { orphans: 3; widows: 3; }
  .page-head { margin-bottom: 16px; }
  .callout, .phrase-card, .card, .checklist, .day-card { padding: 12px 14px; background: white; border: 1px solid #BBB; border-radius: 6px; box-shadow: none; break-inside: avoid; margin-bottom: 12px; }
  .quote, .phrase-card .quote { font-size: 12pt; }
  .why, .small, .gesture, .meta { font-size: 9pt; }
  .table-scroll { overflow: visible; border-color: #AAA; }
  table { font-size: 10pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  td, th { padding: 8px; border-bottom: 1px solid #CCC; }
  a { color: #111; text-decoration: none; }
  .check-row { padding: 8px 0; }
  input[type="checkbox"] { appearance: none; width: 14px; height: 14px; min-width: 14px; border: 1px solid #555; border-radius: 2px; position: relative; }
  input[type="checkbox"]:checked::after { content: '✓'; position: absolute; top: -6px; left: 1px; color: #111; font-size: 14px; }
  .age-panel[hidden] { display: none !important; }
  body.print-share { font-size: 9pt; line-height: 1.3; }
  .print-share .unit-content > * { margin-bottom: 8px; }
  .print-share .callout, .print-share .phrase-card { padding: 8px 12px; }
  .print-share .phrase-top { margin-bottom: 4px; }
  .print-share .quote, .print-share .phrase-card .quote { font-size: 10pt; margin-bottom: 4px; }
  .print-share h1 { font-size: 21pt; margin-bottom: 6px; }
  .print-share h2 { font-size: 13pt; margin: 10px 0 6px; }
  .print-share p { margin-bottom: 6px; }
  .print-share li + li { margin-top: 3px; }
}
