:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #2b2a27;
  --soft: #6b675f;
  --line: #e2ddd2;
  --accent: #2f6f4f;
  --out: #a3412f;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
h1, h2 { text-wrap: balance; margin: 0.4em 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
p, li, .hint { text-wrap: pretty; }
a { color: var(--accent); }
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 12px 0;
  color: inherit;
  text-decoration: none;
}
.card p { margin: 4px 0; }
.kid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.balance { font-weight: 700; font-size: 1.3rem; color: var(--accent); white-space: nowrap; }
.balance.big { font-size: 2rem; }
.hint { color: var(--soft); font-size: 0.9rem; }
.error { color: var(--out); font-weight: 600; min-height: 0; }
.error:empty { display: none; }
.back { text-decoration: none; font-weight: 600; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
button { font: inherit; }
.tab, .primary {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  padding: 8px 12px;
}
.tab.on { border-color: var(--accent); background: #e7f1ec; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; width: 100%; margin-top: 8px; }
.primary:disabled { opacity: 0.6; }
.link { background: none; border: 0; color: var(--soft); text-decoration: underline; padding: 8px 0; }
.field { display: block; margin: 10px 0; }
.field > span:first-child { display: block; font-weight: 600; margin-bottom: 4px; }
input, select {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.history { list-style: none; padding: 0; margin: 0; }
.history li {
  display: grid;
  grid-template-columns: 6.5em 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.when { color: var(--soft); font-size: 0.9rem; }
.amt { font-weight: 700; white-space: nowrap; color: var(--accent); }
.amt.out { color: var(--out); }
.foot { margin-top: 24px; }
.section-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 12px; padding-bottom: 4px; }
.section-tabs .tab { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; min-height: 44px; }

/* A girl's weekly-review signals on her Progress (ui.js linesCard). */
.signals h4 { margin: 12px 0 4px; font-size: 0.95rem; text-wrap: balance; }
.signals ul { margin: 0; padding-left: 1.1em; }
.signals li { margin: 3px 0; text-wrap: pretty; }

/* Charts on a girl's Progress (lineChart in js/ui.js). */
.chart { width: 100%; height: auto; display: block; margin: 8px 0; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .gridline { stroke: #ece7dc; stroke-width: 1; }
.chart .series { stroke: var(--accent); stroke-width: 2; fill: none; }
.chart .trend { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 7 5; opacity: 0.6; }
.chart .pt { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart text { fill: var(--soft); font-size: 15px; font-family: inherit; }
.chart .lbl { fill: var(--ink); font-weight: 700; }
.chart .mark { stroke: var(--soft); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .mark-text { font-size: 13px; }

/* The top of a girl's Progress: the big picture, her skills, and the detail
   folded shut below (ui.js pictureCard, skillsTable, fold). */
.picture ul { margin: 0; padding-left: 1.1em; }
.picture li { margin: 4px 0; text-wrap: pretty; }
.skills td .small { margin-top: 2px; }
.skills th { white-space: nowrap; }
.trend-up { color: var(--accent); font-weight: 700; }
.trend-down { color: var(--out); font-weight: 700; }
:is(.kid-slothy, .kid-doggie) h3.details-head { margin: 20px 0 0; font-size: 1rem; color: var(--soft); text-wrap: balance; }
details.fold { padding: 0; }
details.fold > summary { padding: 14px 16px; min-height: 48px; font-weight: 700; cursor: pointer; text-wrap: balance; }
details.fold[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
details.fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.fold > :last-child { margin-bottom: 14px; }
.gap { margin-top: 10px; }

/* The friends' site: a tablet's set-up code, and the tablets list. */
.code { font-size: 2rem; font-weight: 700; letter-spacing: 0.1em; text-align: center; margin: 12px 0; font-variant-numeric: tabular-nums; }
.tablet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; text-wrap: pretty; }
