/* Sylvie phone app — the look of the current learning pages (public-sylvie/learn.css): warm ivory,
   forest green, sage, restrained apricot. Apricot means ONE thing: something waiting for you.
   Every style lives in this file: the CSP allows no inline styles. */
:root {
  --page: #f7f3ea; --surface: #fffdf8; --ink: #1f2a22; --muted: #687066; --line: rgba(31, 77, 54, .13);
  --forest: #1f4d36; --forest-ink: #ffffff; --sage: #e6ecdf; --sage-ink: #3f5f44; --sage-deep: #c9d8c3;
  --apricot: #f8dfca; --apricot-ink: #a5522a; --blush: #f9ece4; --grey: #ecebe6; --grey-ink: #5d625b;
  --danger: #a3332b; --focus: #57a06b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Apple SD Gothic Neo", Helvetica, Arial, sans-serif;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #151a16; --surface: #1d241f; --ink: #ecefe8; --muted: #a3ab9f; --line: rgba(201, 216, 195, .14);
    --forest: #8fc29f; --forest-ink: #10251a; --sage: #263228; --sage-ink: #b9d3bd; --sage-deep: #34453a;
    --apricot: #4a3020; --apricot-ink: #f3b98f; --blush: #2c2420; --grey: #2a2f2b; --grey-ink: #c2c7bf; --danger: #f08a80;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { min-height: 100vh; }
main { padding: max(12px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; outline: none; }
.top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.mark, .rail-mark { font-family: var(--serif); font-size: 30px; color: var(--forest); letter-spacing: .01em; }
.rail-mark { display: none; }

h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 9vw, 44px); line-height: 1.05; margin: 18px 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 26px 0 10px; font-weight: 650; }
h3 { font-size: 16px; margin: 0 0 4px; font-weight: 650; }
.sub { color: var(--muted); font-size: 15px; margin: 2px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.top-gap { margin-top: 14px; }
.grow { flex: 1; min-width: 0; }
.steps { padding-left: 20px; } .steps li { margin: 6px 0; }

/* tabs: bottom bar on a phone, left rail on a wide screen */
.tabs { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--surface) 94%, transparent); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: var(--muted); font-size: 12.5px; min-height: 52px; position: relative; }
.tab-ic { font-size: 21px; line-height: 1.1; }
.tab[aria-current="page"] { color: var(--forest); font-weight: 650; }
.tab-badge { position: absolute; top: 2px; right: calc(50% - 22px); background: var(--apricot-ink); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 6px; min-width: 18px; }
@media (min-width: 900px) {
  .tabs { top: 0; bottom: 0; right: auto; width: 200px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 24px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .rail-mark { display: block; margin: 0 0 18px 12px; }
  .tab { flex: 0; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 15.5px; }
  .tab[aria-current="page"] { background: var(--sage); }
  main { margin-left: 200px; max-width: 1040px; padding: 24px 40px 48px; }
  .top .mark { visibility: hidden; }
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card + .card { margin-top: 10px; }
.focus { background: var(--sage); border-color: transparent; }
.blush { background: var(--blush); border-color: transparent; }
.notice { background: var(--apricot); color: var(--apricot-ink); border-color: transparent; }
.home-note { margin-top: 10px; }
.home-note .btn { margin-top: 6px; }
.gentle-card, .notice-card { display: flex; gap: 12px; align-items: center; }
.gentle-card { margin-top: 18px; }
.sent { color: var(--sage-ink); font-weight: 600; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; color: inherit; font-weight: 600; }

/* list rows */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 14px; min-height: 60px; }
.row:first-child { border-top: 0; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; }
.row .s { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.row .s.sent { color: var(--sage-ink); }
.row .chev { color: var(--muted); font-size: 20px; }
.s.block { display: block; }
.day { width: 44px; flex: none; font-size: 11.5px; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.day-date { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-top: 2px; white-space: nowrap; }
label.row.tick { display: flex; align-items: center; gap: 10px; cursor: pointer; }
label.row.tick input { width: 22px; height: 22px; flex: none; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 10px; padding: 4px 10px; font-size: 13px; white-space: nowrap; background: var(--grey); color: var(--grey-ink); }
.chip.sage { background: var(--sage); color: var(--sage-ink); }
.chip.apricot { background: var(--apricot); color: var(--apricot-ink); }
.chip.outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.chip.code { margin-left: 8px; font-weight: 500; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--forest); background: var(--forest); color: var(--forest-ink); font-weight: 600; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--forest); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.warm { background: var(--blush); border-color: transparent; color: var(--ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.inline-actions .btn { min-height: 42px; padding: 8px 14px; }

/* banner + states */
.banner { margin: 8px 0; padding: 12px 14px; border-radius: 12px; background: var(--apricot); color: var(--apricot-ink); font-size: 15px; }
.skeleton { height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--grey), var(--surface), var(--grey)); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin: 12px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.error { color: var(--danger); font-size: 14.5px; margin-top: 8px; min-height: 1em; }

/* switch */
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 999px; background: var(--grey); position: relative; border: 0; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch:checked { background: var(--forest); }
.switch:checked::after { transform: translateX(20px); }

/* capture */
.big { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big button, .big label { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; min-height: 96px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; font-weight: 600; cursor: pointer; }
.big .ic { font-size: 24px; }
.big .wide { grid-column: span 2; background: var(--forest); color: var(--forest-ink); border-color: var(--forest); }
.big input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.rec { text-align: center; padding: 24px 0; }
.rec .time { font-family: var(--serif); font-size: 48px; }
audio { width: 100%; margin: 8px 0; }
label.field { display: block; margin: 12px 0 4px; font-size: 14px; font-weight: 600; }
input[type=text], input[type=password], select, textarea { width: 100%; font-size: 16px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
textarea { min-height: 96px; resize: vertical; }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(15, 25, 18, .35); }
.sheet-card { position: relative; background: var(--page); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-card { border-radius: 20px; } }
.sheet-x { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; color: var(--muted); }

/* Today: one section per child, then the rest smaller below */
.card.kid { margin: 14px 0; } .card.kid h2 { margin-top: 0; }
.older { padding: 10px 14px 0; }
.below-kids { margin-top: 22px; font-size: 15px; } .below-kids h2 { font-size: 17px; }
@media (max-width: 600px) { .card.kid { padding: 12px 6px; } .card.kid h2, .card.kid > p { padding: 0 8px; } }
.practice { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 12px; }
.practice .label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--grey-ink); }
