/* Parent dashboard, Look B (Playful). One accent (violet) for the primary action, the selected
   level and the usage ring. Warm paper background, soft pastel tiles for meaning, not decoration.
   Type scale: 12 / 14 / 15 / 18 / 24 / 30. Spacing rhythm: 4 / 8 / 12 / 16 / 24. */

:root {
  color-scheme: light;
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #231942;
  --mute: #6b6385;
  --line: #efe6da;
  --soft: #f6f2ff;
  --sand: #faf7f2;
  --track: #ece6ff;
  --acc: #6c4cf5;
  --acc-text: #6c4cf5;
  --fill: #6c4cf5;
  --sun: #ffe8a3;
  --mint: #d3f4e4;
  --sky: #dbeaff;
  --rose: #ffe0e6;
  --warn: #ffb347;
  --bad: #c2255c;
  --good: #1f7a52;
  --shadow: 0 2px 0 var(--line);
  --r-card: 24px;
  --r-tile: 20px;
  --r-bub: 18px;
  --r-field: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
[hidden] { display: none !important; }

/* Every press target: no iOS callout, no text selection, no double-tap zoom. Written with the element. */
button, [role="switch"], .pressable, summary {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}
button *, .pressable *, summary * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; text-align: center; }
button[disabled] { cursor: default; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fill); outline-offset: 2px; }

/* ---------------------------------------------------------------- header */
.bar {
  max-width: 560px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 16px) 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
/* School lockup: the round badge and the wordmark, centered on one line. 12px between is the
   bar's own gap. The wordmark is two lines (APHRODITE over LAUREL ACADEMY) at 38px tall, so it
   reads at the weight of the old 15px title; under about 360px wide it shrinks, never wraps. */
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.brand-badge { flex: none; width: 80px; height: 80px; display: block; } /* 80: Carlos asked twice for bigger (10-15) */
.brand-word { flex: 0 1 175px; min-width: 0; height: auto; display: block; }
.brand.pending .school { visibility: hidden; }
.school { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.bar .link { flex: none; }

/* ---------------------------------------------------------------- layout */
.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px max(env(safe-area-inset-bottom), 48px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (min-width: 880px) {
  .bar, .wrap.dash { max-width: 1080px; }
  .wrap.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
  .col { gap: 24px; }
}

/* ---------------------------------------------------------------- text */
h1 { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 18px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 12px; }
.sub-h { font-size: 14px; font-weight: 800; margin: 16px 0 4px; }
.label { font-size: 12px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: 0.04em; }
.mute { color: var(--mute); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.link { font-size: 14px; font-weight: 700; color: var(--mute); min-height: 44px; padding: 0 8px; }
.empty { color: var(--mute); font-weight: 700; padding: 8px 0; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--card); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow); }
.card > h2:only-child { margin-bottom: 0; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.head-row h2 { margin: 0; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 99px;
  background: var(--acc);
  color: #fff;
  font-weight: 700;
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.btn:active:not([disabled]) { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; }
.btn.ghost { background: transparent; color: var(--acc-text); box-shadow: inset 0 0 0 2px var(--acc-text); }
.btn.danger-ish { background: var(--ink); color: var(--bg); }
@media (hover: hover) { .btn:hover:not([disabled]) { filter: brightness(1.08); } .link:hover { color: var(--ink); } }

/* ---------------------------------------------------------------- fields */
.field { flex: 1; min-width: 0; min-height: 44px; border: 2px solid var(--line); border-radius: var(--r-field); padding: 0 16px; background: var(--card); font-size: 16px; }
.field:focus-visible { outline-offset: 0; border-color: var(--fill); }
.row-form { display: flex; gap: 8px; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; }
.form-error { color: var(--bad); font-weight: 700; font-size: 14px; min-height: 1.45em; }

/* ---------------------------------------------------------------- login */
.login { max-width: 400px; margin: 24px auto 0; }
.login h1 { margin-bottom: 4px; }
.login .mute { margin-bottom: 20px; }

/* ---------------------------------------------------------------- hero: switch + today */
.hero { background: var(--mint); border-radius: 28px; padding: 24px 20px; }
.kicker { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--good); }
.date { color: var(--mute); font-weight: 700; margin: 4px 0 16px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: color-mix(in srgb, var(--card) 60%, transparent); border-radius: 99px; padding: 4px; }
.seg button { min-height: 44px; padding: 0 4px; border-radius: 99px; font-weight: 700; transition: background-color 150ms ease-out, color 150ms ease-out, transform 120ms ease-out; }
.seg button:active:not([disabled]) { transform: scale(0.97); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button.confirming { background: var(--bad); color: #fff; }
.seg button small { display: block; font-size: 12px; font-weight: 700; opacity: 0.75; line-height: 1.2; }
.seg.lvl { background: var(--soft); border-radius: 22px; }
.seg.lvl button { border-radius: 18px; padding: 8px 4px; }
.seg.lvl button[aria-pressed="true"] { background: var(--acc); color: #fff; }
/* Lessons: the same soft segment as the teaching level, for the plan being edited and the weekday tabs. */
.seg.soft { background: var(--soft); border-radius: 22px; }
.seg.soft button { position: relative; border-radius: 18px; padding: 8px 4px; }
.seg.soft button[aria-pressed="true"] { background: var(--acc); color: #fff; }
.seg.days { grid-template-columns: repeat(7, 1fr); margin-top: 8px; }
.seg.days button { font-size: 14px; padding: 8px 0; }
.seg.soft button.dirty::after { content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.mode-line { margin-top: 12px; font-weight: 700; }
/* Internet block: the same segment control as the access switch, two positions, and a row of times on the second tap. */
.block { margin-top: 24px; }
.block .label { margin-bottom: 8px; }
.seg.two { grid-template-columns: repeat(2, 1fr); }
.dur { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; animation: dur-in 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.dur button { min-height: 44px; padding: 0 16px; border-radius: 99px; font-weight: 700; background: color-mix(in srgb, var(--card) 60%, transparent); transition: background-color 150ms ease-out, color 150ms ease-out, transform 120ms ease-out; }
.dur button:active:not([disabled]) { transform: scale(0.97); }
@media (hover: hover) { .dur button:hover:not([disabled]) { background: var(--card); } }
@keyframes dur-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.banner { background: var(--sun); border-radius: var(--r-bub); padding: 12px 16px; margin-bottom: 12px; font-weight: 700; }
.pause-strip { margin-top: 16px; background: var(--rose); border-radius: var(--r-tile); padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.pause-strip p { font-weight: 700; }
.pending-note { margin-top: 12px; font-weight: 700; color: var(--mute); font-size: 14px; }
.today { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.tile { background: var(--card); border-radius: var(--r-tile); padding: 16px; min-width: 0; }
.tile.wide { grid-column: 1 / -1; }
.tile .v { font-size: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; margin-top: 4px; }
.tile .s { font-size: 14px; color: var(--mute); font-weight: 700; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip { background: var(--sky); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 14px; }
.photo { display: block; width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; background: var(--sand); margin-bottom: 12px; }
.photo.open { max-height: none; object-fit: contain; }
.photo-btn { display: block; width: 100%; }
.act { display: flex; flex-wrap: wrap; gap: 8px; }
.status-pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 99px; background: var(--sand); color: var(--mute); }
.status-pill.pending { background: var(--sun); color: var(--ink); }
.status-pill.approved { background: var(--mint); color: var(--good); }
.status-pill.denied { background: var(--rose); color: var(--bad); }

/* ---------------------------------------------------------------- usage */
.usage { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.usage .card { padding: 16px; }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(var(--fill) calc(var(--p) * 1%), var(--track) 0); display: grid; place-items: center; margin: 4px auto 12px; }
.ring > div { width: 72px; height: 72px; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring b { font-size: 24px; font-weight: 800; display: block; }
.ring span { font-size: 12px; color: var(--mute); font-weight: 700; display: block; }
.u-cap { text-align: center; font-size: 14px; font-weight: 700; color: var(--mute); }
.spend { display: flex; flex-direction: column; justify-content: center; }
.spend h2 { margin-bottom: 0; }
.bar-meter { height: 16px; border-radius: 99px; background: var(--line); position: relative; margin: 12px 0; overflow: hidden; }
.bar-meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--warn); min-width: 16px; }
.bar-meter.hot i { background: var(--bad); }
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 99px; background: var(--sand); color: var(--mute); }
.pill.bad { background: var(--rose); color: var(--bad); }
.pill.mark { margin-top: 8px; }

/* ---------------------------------------------------------------- alerts */
.alerts li { border-radius: var(--r-bub); padding: 16px; background: var(--sand); margin-bottom: 8px; }
.alerts li:last-child { margin-bottom: 0; }
.alerts li.flag { background: var(--rose); }
.a-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; font-weight: 700; color: var(--mute); }
.flag .a-tag { color: var(--bad); }
.a-text { margin: 4px 0 12px; font-weight: 700; }
.a-text.done { margin-bottom: 0; }
.ok { font-weight: 700; color: var(--mute); font-size: 14px; }
.a-text.done + .ok { margin-top: 4px; }

/* ---------------------------------------------------------------- what they are doing */
.shot { border-radius: 16px; overflow: hidden; background: #1e1f24; margin-bottom: 12px; }
.shot-bar { display: flex; gap: 4px; align-items: center; padding: 8px 12px; background: #2a2c33; }
.shot-bar i { width: 8px; height: 8px; border-radius: 50%; background: #5a5d68; flex: none; }
.shot-bar b { font: 700 12px/1 ui-monospace, Menlo, Consolas, monospace; color: #9aa0ad; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot img { display: block; width: 100%; height: auto; }
.shot-empty { padding: 32px 16px; text-align: center; color: #9aa0ad; font-weight: 700; }
.now > div { padding: 12px 0; border-top: 2px dashed var(--line); }
.now > div:first-child { border-top: 0; padding-top: 0; }
.now dd { font-weight: 700; margin-top: 4px; }

/* ---------------------------------------------------------------- chat */
.thread { display: flex; flex-direction: column; gap: 16px; max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.msg { display: flex; gap: 12px; align-items: flex-end; }
.who { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--sun); color: var(--ink); font-weight: 800; font-size: 15px; }
.who.robot { background: var(--sky); font-size: 18px; }
.who.kid { background: var(--mint); }
.bub { background: var(--soft); padding: 12px 16px; border-radius: var(--r-bub) var(--r-bub) var(--r-bub) 6px; min-width: 0; }
.bub small { display: block; color: var(--mute); font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.msg.parent .bub { background: var(--sun); }
.msg.kid .bub { background: var(--sand); }
.bub .flagline { display: block; margin-top: 8px; color: var(--bad); font-size: 12px; font-weight: 800; }
.bub .held { display: block; margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--line); color: var(--mute); font-size: 14px; }
.composer { display: flex; gap: 8px; margin-top: 16px; }

/* ---------------------------------------------------------------- concepts */
.concepts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.concepts li { border-radius: 16px; padding: 12px 4px; text-align: center; display: flex; flex-direction: column-reverse; gap: 4px; min-width: 0; }
.concepts li:nth-child(1) { background: var(--sky); }
.concepts li:nth-child(2) { background: var(--mint); }
.concepts li:nth-child(3) { background: var(--sun); }
.concepts li:nth-child(4) { background: var(--sand); }
.concepts li:nth-child(5) { background: var(--rose); }
.c-num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.c-name { font-size: 12px; font-weight: 800; color: var(--mute); overflow-wrap: normal; }
@media (max-width: 359px) { .c-name { font-size: 11px; } }

/* ---------------------------------------------------------------- lists */
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; min-height: 44px; }
.rows li + li { border-top: 2px dashed var(--line); }
.rows b { font-weight: 800; }
.rows small { display: block; font-size: 14px; color: var(--mute); font-weight: 700; }
.rows .grow { min-width: 0; flex: 1; }
.rows .st.on { color: var(--good); }
.rows .domain { font-weight: 700; min-width: 0; }
.add { margin: 12px 0 0; }
.note { margin-top: 12px; font-weight: 700; font-size: 14px; color: var(--mute); }
.note.bad { color: var(--bad); }

/* ---------------------------------------------------------------- lessons editor */
.lessons-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.lesson { background: var(--sand); border-radius: var(--r-tile); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.lesson label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lesson .field { flex: none; width: 100%; }
.lesson .times { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesson-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 -4px; }
.link-note { font-size: 14px; font-weight: 700; color: var(--mute); }
.link-note.warn { color: var(--bad); }
.link-note .btn { margin-top: 8px; }
.lesson-act { margin-top: 16px; align-items: center; }
.lessons-list .empty { background: var(--sand); border-radius: var(--r-tile); padding: 16px; }

.diary li { background: var(--sand); border-radius: var(--r-bub); padding: 12px 16px; margin-bottom: 8px; }
.diary li:last-child { margin-bottom: 0; }
.diary small { font-weight: 800; color: var(--acc-text); font-size: 12px; display: block; margin-bottom: 4px; }
.diary p + p { margin-top: 4px; }
.diary b { font-weight: 800; }

.summary-text { background: var(--sand); border-radius: var(--r-bub); padding: 12px 16px; margin-bottom: 12px; font-weight: 700; }

/* ---------------------------------------------------------------- toast + loading */
#toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(env(safe-area-inset-bottom), 16px);
  z-index: 10;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
#toast .t { background: var(--ink); color: var(--bg); font-weight: 700; padding: 12px 20px; border-radius: 99px; max-width: 520px; text-align: center; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
#toast .t.bad { background: var(--bad); color: #fff; }
.loading { text-align: center; padding: 48px 0; color: var(--mute); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .btn, .seg button, .dur button { transition: none; }
  .btn:active:not([disabled]), .seg button:active:not([disabled]), .dur button:active:not([disabled]) { transform: none; }
  .dur { animation: none; }
}
