/* English Bol app — brand tokens from the English Bol design system */
:root {
  --navy: #1A2D47;
  --gold: #B08A3E;
  --yellow: #F9C001;
  --black: #000103;
  --paper: #FFFFFF;
  --ink: #1A2D47;
  --ink-muted: #4A5A70;
  --accent: #8A6410;
  --line: #C9CFD8;
  --highlight: #FFF1B8;
  --soft: #F3F5F8;
  --ok-bg: #E6F4EA;
  --ok-ink: #1E5B31;
  --radius-sm: 4px;
  --radius-md: 8px;
  --font-sans: "Montserrat", system-ui, sans-serif;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-deva: "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  --font-serif: "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--soft); color: var(--ink); font-family: var(--font-sans); }
body { min-height: 100vh; }
a { color: var(--accent); }
a:hover { color: var(--navy); }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
img { max-width: 100%; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--black); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }

/* Phone-first frame; on desktop the app sits in a centred column */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--paper); display: flex; flex-direction: column; outline: none; }
.app.wide { max-width: 1240px; }
.loading { padding: 48px 24px; text-align: center; color: var(--ink-muted); }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 2; }
.top img { height: 52px; width: auto; display: block; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--navy); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; }

/* Content */
.page { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.label { font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--ink-muted); text-transform: uppercase; }
.label.accent { color: var(--accent); }
.h1 { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.2; margin: 0; }
.hi { font-family: var(--font-deva); line-height: 1.7; }
.muted { color: var(--ink-muted); }
.tag-book { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 8px; background: var(--navy); color: #fff; }
.tag-practice { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 8px; background: var(--yellow); color: var(--black); }
.tag-suggestion { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 8px; background: var(--highlight); color: var(--accent); }
.mark { background: var(--highlight); font-weight: 700; }

.card { padding: 14px; background: var(--soft); display: flex; flex-direction: column; gap: 8px; }
.card.dark { background: var(--black); color: #fff; }
.card.navy { background: var(--navy); color: #fff; border-radius: var(--radius-md); text-decoration: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; min-height: 64px; border-radius: var(--radius-md); background: var(--soft); color: var(--ink); text-decoration: none; }
.tile strong { font-size: 13px; }
.tile span { font-family: var(--font-deva); font-size: 12px; color: var(--ink-muted); }
.tile[aria-disabled="true"] { opacity: .55; }

/* Buttons */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: var(--radius-sm); border: 2px solid var(--navy); background: var(--paper); color: var(--navy); font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; width: 100%; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.btn.ghost { border-color: var(--line); }
.btn.small { min-height: 44px; font-size: 14px; width: auto; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.field input { min-height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--soft); color: var(--ink); padding: 0 14px; }
.error { padding: 10px 12px; background: var(--highlight); color: var(--accent); font-weight: 600; }
.ok { padding: 10px 12px; background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Bottom nav */
.bottom { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-top: 1px solid var(--line); background: var(--paper); position: sticky; bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.bottom a { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--ink-muted); text-decoration: none; }
.bottom a[aria-current="page"] { color: var(--navy); font-weight: 700; }
.bottom svg { width: 22px; height: 22px; }

/* Chapter template */
.steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.steps div { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.steps i { width: 100%; height: 5px; background: var(--line); }
.steps i.on { background: var(--yellow); }
.steps span { font-size: 8px; font-weight: 700; color: var(--ink-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps div[aria-current="step"] span { color: var(--navy); }
.chip { min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm); border: 2px solid var(--navy); background: var(--paper); color: var(--navy); font-size: 18px; font-weight: 600; cursor: pointer; }
.chip.hot { background: var(--yellow); border-color: var(--yellow); }
.sentence { min-height: 120px; padding: 20px; background: var(--black); color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 24px; font-weight: 600; line-height: 1.4; }
.bar { height: 6px; border-radius: 3px; background: var(--soft); }
.bar > i { display: block; height: 6px; border-radius: 3px; background: var(--yellow); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

@media print { .no-print, .top, .bottom { display: none !important; } .page { padding: 0; } }

/* Navigation progress bar (shows only when a screen takes longer than a blink) */
#eb-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--yellow); z-index: 200; opacity: 0; transition: none; pointer-events: none }
#eb-bar.on { opacity: 1; width: 85%; transition: width 2.5s cubic-bezier(.1,.7,.2,1), opacity .2s }

/* Content protection (students) */
.eb-protect body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none }
.eb-protect input, .eb-protect textarea, .eb-protect select { -webkit-user-select: text; user-select: text }
.eb-protect img { -webkit-user-drag: none; pointer-events: none }
#eb-mark { position: fixed; inset: 0; z-index: 90; pointer-events: none; background-repeat: repeat }
.eb-hidden #app { filter: blur(18px) }
@media print { .eb-protect body { display: none } }

/* Sound button and short notices */
.sound-btn { all: unset; cursor: pointer; font-size: 20px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50% }
.sound-btn:focus-visible { outline: 3px solid var(--yellow) }
.sound-btn:disabled { opacity: .5; cursor: not-allowed }
.eb-toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 150; background: #1A2D47; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.2); max-width: 90vw; text-align: center }
