:root{
  --ink:#1c1a17; --ink-soft:#494139; --parchment:#f6f1e7; --parchment-2:#efe7d7;
  --card:#fffdf8; --accent:#9a3b2e; --accent-2:#1f4d4a; --gold:#b08a3e; --line:#e2d6c0;
  --shadow:0 12px 40px rgba(40,30,15,.10);
}
*{box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;background:var(--parchment);color:var(--ink);margin:0;line-height:1.5}
.wrap{max-width:880px;margin:0 auto;padding:40px 24px}
.wrap.narrow{max-width:480px}
a{color:var(--accent)}
h1,h2,h3{font-family:Georgia,"Iowan Old Style",serif;letter-spacing:-.3px}
.brand{font-family:Georgia,serif;font-size:1.3rem;margin-bottom:6px}
.brand b{color:var(--accent)}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:28px;box-shadow:var(--shadow);margin-bottom:20px}
label{display:block;font-size:.85rem;color:var(--ink-soft);margin:14px 0 6px;text-transform:uppercase;letter-spacing:.05em}
input,textarea,select{width:100%;padding:11px 14px;border:1px solid var(--line);border-radius:10px;font-family:inherit;font-size:1rem;background:#fff;color:var(--ink)}
textarea{resize:vertical}
button,.btn{font-family:inherit;cursor:pointer;border:none;font-size:.95rem;padding:12px 22px;border-radius:999px;background:var(--accent);color:#fff;transition:.15s}
.btn-ghost{background:transparent;color:var(--ink);border:1px solid var(--ink)}

/* HOVER IS GUARDED, and this is not a nicety.
   Reported 2026-09-08: a student pressed Clear in the maths workspace and the
   button stayed dark red until he pressed something else -- it read as still
   engaged, or still working. The cause was an unqualified `button:hover` here.
   A touch device has no pointer to move away, so after a tap the browser
   leaves :hover applied to the last element touched until another element is
   touched. Every button in Aristos was doing this; the workspace is just where
   it was noticed, because that is where a child taps a button and then watches
   to see whether anything happened.
   `hover: hover` restricts the rule to devices with a real hovering pointer,
   which is what the state was always meant to describe. */
@media (hover: hover) and (pointer: fine) {
  button:hover,.btn:hover{background:#7e2f24}
  .btn-ghost:hover{background:var(--ink);color:var(--parchment)}
}

/* Keyboard focus still needs to be visible; a mouse click no longer leaves a
   ring behind, which is the other half of "the button looks stuck". */
button:focus-visible,.btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.btn-small{padding:7px 14px;font-size:.85rem}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.muted{color:var(--ink-soft);font-size:.92rem}
.err{color:var(--accent);font-size:.9rem;margin-top:8px}
.ok{color:var(--accent-2);font-size:.9rem;margin-top:8px}
table{width:100%;border-collapse:collapse;margin-top:10px}
th,td{text-align:left;padding:10px 8px;border-bottom:1px solid var(--line);font-size:.92rem}
th{color:var(--gold);text-transform:uppercase;font-size:.75rem;letter-spacing:.06em}
.pill{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.75rem;background:var(--parchment-2);border:1px solid var(--line)}
.pill.done{background:rgba(31,77,74,.15);color:var(--accent-2)}
.pill.reading{background:rgba(176,138,62,.18);color:#8a6a2e}
.segment-group{margin-bottom:22px}
.segment-group h4{font-size:.95rem;color:var(--accent-2);margin-bottom:8px}
nav.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 24px;border-bottom:1px solid var(--line);background:rgba(246,241,231,.9)}
.stagechip{font-size:.72rem;padding:2px 8px;border-radius:999px;background:var(--ink);color:var(--parchment);margin-left:8px}

/* Bottom tab navigation, shared across the family-portal pages (Today, Circle, Library, Scholar). */
body.has-bottomnav{padding-bottom:78px}
.bottomnav{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:center;gap:10px;padding:10px 14px;background:rgba(255,253,248,.96);border-top:1px solid var(--line);backdrop-filter:blur(6px);z-index:40}
.bottomnav a{display:flex;flex-direction:column;align-items:center;gap:4px;flex:0 1 100px;min-width:0;padding:8px 6px;border-radius:12px;border:1px solid var(--line);text-decoration:none;color:var(--ink-soft);font-size:.72rem;background:var(--card)}
/* Six destinations rather than five since 2026-08-31. On a narrow phone the
   labels are what overflow first, so they are allowed to shrink and ellipsis
   rather than pushing a nav item off the screen entirely. */
.bottomnav a span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:420px){
  .bottomnav{gap:6px;padding:8px 8px}
  .bottomnav a{font-size:.66rem;padding:7px 3px}
}
.bottomnav a svg{width:20px;height:20px;stroke:currentColor}
.bottomnav a.active{color:var(--accent);border-color:var(--accent);font-weight:600}
