/* System fonts match the working v0.9 stack. No remote fonts or font substitution. */
body, button, input, select, textarea, .reader, .notice, .reader-empty {
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}
body { overflow-wrap: anywhere; }
.reader { color: var(--readerText); font-size: var(--fontSize); }
.reader h1, .reader p { letter-spacing: normal; word-spacing: normal; }
a { color: var(--gold2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button, a, select, input { touch-action: manipulation; }
button.tile { color: var(--text); text-align: left; font: inherit; }
.tile .tag { display: block; margin-top: 12px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sidebar-close { display: none; }
.reading-status { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; color:var(--muted); margin:12px 0; }
.mode-controls { display:flex; gap:8px; margin:0 0 24px; flex-wrap:wrap; }
.rc-btn[aria-pressed="true"] { border-color:var(--gold); color:var(--gold2); background:#31291e; }
.reader-controls { position:static; }
.app-status { background:#3b3020; color:#ffe0aa; padding:12px 20px; font-size:13px; line-height:1.6; border-bottom:1px solid #806641; }
.menu-open, .modal-open { overflow:hidden; }
.modal-backdrop { z-index:60; padding:max(20px,env(safe-area-inset-top)) 20px max(20px,env(safe-area-inset-bottom)); }
.modal { position:relative; max-height:calc(100dvh - 40px); overflow:auto; padding:28px; }
.modal-close { position:absolute; top:10px; right:10px; min-height:44px; min-width:44px; }
.modal .eyebrow { padding-right:42px; line-height:1.8; }
.modal h2 { padding-right:32px; }
.admin-link { display:inline-block; text-decoration:none; }
.field textarea { line-height:1.65; }
.switchrow input { width:24px; height:24px; accent-color:var(--gold); }
.sublogo { line-height:1.8; letter-spacing:.02em; }
.topbar { background:var(--bg); }
body.light .reader { color:var(--readerText); }
body.light .reader-controls,body.light .rc-btn,body.light .rc-value { background:#f8f3e9; color:#342f29; border-color:#b5a28b; }
body.light .rc-btn[aria-pressed="true"] { background:#dfd0ba; }
body.light .crumb,body.light .hero p,body.light .help,body.light .reading-status { color:#5c625f; }
body.light .crumb b,body.light .mini b { color:#805723; }
body.light .quest small,body.light .itemcard small { color:#595e60; }
body.night-reading { --bg:#080b0f; --panel:#10151b; --stroke:#252d35; --text:#d0ccc3; --readerText:#c6c0b5; --gold2:#d4b27e; }
body.night-reading .reader { color:var(--readerText); }
.immersive .app { display:block; }
.immersive .left,.immersive .right,.immersive .topbar,.immersive .hero,.immersive .banner,.immersive .reader-controls,.immersive .mode-controls { display:none!important; }
.immersive .page { max-width:820px; padding-top:max(24px,env(safe-area-inset-top)); }
.immersive .reading-status { padding-right:150px; }
.immersive-exit { position:fixed; top:max(10px,env(safe-area-inset-top)); right:max(12px,env(safe-area-inset-right)); z-index:35; min-height:44px; background:var(--panel); color:var(--text); box-shadow:0 4px 20px #0004; }
@media(max-width:720px) {
  .page { padding-bottom:calc(84px + env(safe-area-inset-bottom)); }
  .topbar { padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); }
  .topbar .actions { gap:6px; }
  .topbar .iconbtn { min-width:44px; min-height:44px; padding:8px; }
  .topbar .crumb { max-width:100px; }
  .menu-open .topbar { z-index:31; }
  .left { top:64px; height:calc(100dvh - 64px); width:min(300px,calc(100vw - 60px)); z-index:30; padding-bottom:calc(26px + env(safe-area-inset-bottom)); }
  .sidebar-close { display:block; position:absolute; top:9px; right:10px; min-height:44px; min-width:44px; }
  .left .logo { padding-right:40px; font-size:12px; letter-spacing:.08em; }
  .menu-backdrop { position:fixed; inset:64px 0 0; background:#0009; z-index:25; }
  .reader { font-size:var(--fontSize); }
  .rc-btn,.pill { min-height:44px; }
  .reader-controls { gap:12px; }
  .modal { padding:22px; }
  .section h2 { font-size:26px; clear:both; }
  .gridcards { grid-template-columns:minmax(0,1fr); }
  .box { padding:15px; }
  .box>.pill,.box>.primary { margin-bottom:8px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; } }
