:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --text: #16213e;
  --muted: #5d6680;
  --line: #e2e5ee;
  --accent: #d92d3b;
  --accent-ink: #ffffff;
  --accent-soft: #fde8ea;
  --ok: #1e9e5a;
  --ok-soft: #e3f5ea;
  --shadow: 0 1px 2px rgba(22, 33, 62, .06), 0 4px 16px rgba(22, 33, 62, .06);
  --radius: 14px;
  --player-h: 0px;
  color-scheme: light;
}
body[data-level="b1"] { --accent: #1a6fc4; --accent-soft: #e4effb; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1424;
    --card: #182036;
    --text: #e8ebf5;
    --muted: #9aa3bd;
    --line: #2a3350;
    --accent: #f0525e;
    --accent-soft: #3a1d26;
    --ok: #3ccf82;
    --ok-soft: #173326;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
  body[data-level="b1"] { --accent: #4d9be8; --accent-soft: #172a45; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
}
button { font: inherit; color: inherit; }
a { color: inherit; }
.loading { padding: 40vh 16px; text-align: center; color: var(--muted); }

#view { max-width: 820px; margin: 0 auto; padding: 0 16px 32px; }
body.wide #view { max-width: 1180px; }

/* ---- top bar ---- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: 10px 16px; min-height: 56px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 17px; margin: 0; line-height: 1.25; flex: 1; min-width: 0; }
.top h1 small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: transparent; cursor: pointer; text-decoration: none;
}
.iconbtn:hover { background: var(--line); }
.ic { width: 22px; height: 22px; fill: currentColor; display: block; }

/* ---- home ---- */
.brand { display: flex; align-items: center; gap: 10px; flex: 1; font-weight: 700; font-size: 18px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.seg { display: flex; background: var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.hero {
  margin-top: 16px; padding: 18px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  display: grid; gap: 10px;
}
.hero .kicker { font-size: 13px; opacity: .85; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.hero .title { font-size: 21px; font-weight: 700; line-height: 1.25; }
.hero .focus { font-size: 14px; opacity: .9; }
.hero a.btn { justify-self: start; background: #fff; color: #16213e; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 4px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12.5px; color: var(--muted); }

h2.sec { font-size: 15px; color: var(--muted); font-weight: 600; margin: 22px 2px 10px; }

.list { display: grid; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); text-decoration: none; cursor: pointer; border: 0; width: 100%; text-align: left;
}
.item:hover { outline: 2px solid var(--accent-soft); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .s { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.badge {
  flex: none; display: grid; place-items: center;
  min-width: 42px; height: 42px; padding: 0 6px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 15px;
}
.item.done .badge { background: var(--ok-soft); color: var(--ok); }
.tick { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.item.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick .ic { width: 16px; height: 16px; opacity: 0; }
.done .tick .ic { opacity: 1; }

.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.item.done .bar i { background: var(--ok); }

.note { background: #fff6dd; color: #6b4e00; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
@media (prefers-color-scheme: dark) { .note { background: #3a3013; color: #f2d98c; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 11px 18px; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
}
.btn.ghost { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.btn.ok { background: var(--ok); }
.btn .ic { width: 20px; height: 20px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: 14px; }
.footer { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- lesson ---- */
.focusline { color: var(--muted); font-size: 14px; margin: 12px 2px 0; }
.tabs {
  position: sticky; top: 56px; z-index: 15;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 12px -16px 0; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; border: 0; background: var(--card); box-shadow: var(--shadow);
  padding: 9px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14.5px;
}
.tabs button.on { background: var(--text); color: var(--bg); }
.tabs button em { font-style: normal; opacity: .6; margin-left: 4px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: thin; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 12px 6px 8px; cursor: pointer; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums;
}
.chip .ic { width: 18px; height: 18px; color: var(--accent); }
.chip.done { border-color: var(--ok); }
.chip.done .ic { color: var(--ok); }
.chip.playing { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.playing .ic { color: inherit; }

.pages { display: grid; gap: 14px; margin-top: 12px; }
.page { margin: 0; }
.page img {
  display: block; width: 100%; height: auto; aspect-ratio: auto 1400 / 1980;
  border-radius: 10px; background: var(--card); box-shadow: var(--shadow); cursor: zoom-in;
}
.page figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; }
.page figcaption a { color: var(--accent); text-decoration: none; font-weight: 600; }

.tracks { display: grid; gap: 8px; margin-top: 12px; }
.track {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border: 0; border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow);
  cursor: pointer; text-align: left;
}
.track .pi { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.track.playing .pi { background: var(--accent); color: var(--accent-ink); }
.track .t { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.track .t small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.done .tick, .vid.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
details.more { margin-top: 16px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 2px; }

.videobox { margin-top: 12px; background: #000; border-radius: 12px; overflow: hidden; }
.videobox video { display: block; width: 100%; max-height: 70vh; background: #000; }
.vid { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; text-align: left; }
.vid.on { outline: 2px solid var(--accent); }
.vid .t { flex: 1; font-weight: 600; }

.finish { margin: 28px 0 8px; display: grid; gap: 10px; }
.actionbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 600; }
.actionbar.ok { justify-content: flex-start; background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.finish .btn { padding: 14px 18px; font-size: 16px; }

/* ---- reader ---- */
.reader { margin-top: 12px; }
.reader img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); background: var(--card); touch-action: pan-y pinch-zoom; }
.reader.zoom { overflow-x: auto; }
.reader.zoom img { width: 200%; max-width: none; cursor: zoom-out; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager input { width: 64px; padding: 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); text-align: center; font: inherit; }

/* ---- login ---- */
.login { min-height: 90vh; display: grid; place-items: center; }
.login form { width: min(360px, 100%); background: var(--card); padding: 28px 22px; border-radius: 20px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login h1 { margin: 0; font-size: 22px; }
.login input { padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.login .err { color: var(--accent); font-size: 14px; min-height: 1.2em; }

/* ---- player ---- */
#player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 24px rgba(22, 33, 62, .12);
  padding-bottom: env(safe-area-inset-bottom);
}
.pbar { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 12px; max-width: 820px; margin: 0 auto; }
.pbar .play { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.pbar .play:hover { background: var(--accent); filter: brightness(1.08); }
.pbar .ptitle { flex: 1; min-width: 0; font-weight: 650; font-size: 14.5px; cursor: pointer; }
.pbar .ptitle small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rate { min-width: 48px; height: 36px; border: 1.5px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; font-weight: 700; font-size: 13.5px; }
.seek { position: absolute; left: 0; right: 0; top: -3px; height: 6px; cursor: pointer; }
.seek i { display: block; height: 3px; margin-top: 3px; background: var(--accent); width: 0; }

.sheet { display: none; border-bottom: 1px solid var(--line); }
#player.open .sheet { display: block; }
.sheet .tools { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; max-width: 820px; margin: 0 auto; }
.toggle { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; padding: 6px 12px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.toggle .ic { width: 18px; height: 18px; }
.toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cues { max-height: 46vh; overflow-y: auto; padding: 4px 12px 14px; max-width: 820px; margin: 0 auto; overscroll-behavior: contain; }
.cue { padding: 7px 10px; border-radius: 10px; cursor: pointer; line-height: 1.4; transition: background .15s; }
.cue:hover { background: var(--bg); }
.cue.on { background: var(--accent-soft); }
.cue b { color: var(--accent); font-weight: 650; }
.cues.hide .cue { filter: blur(5px); user-select: none; }
.cues.hide .cue.peek { filter: none; }
.cues .empty { color: var(--muted); padding: 12px 10px; font-size: 14px; }

#player[hidden] { display: none !important; }

/* ---- accounts, locks, homework ---- */
.brand small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.1; }
.brand > span { display: block; line-height: 1.15; }
.sec a { color: inherit; text-decoration: none; }
.item.locked { opacity: .55; }
.item.locked .badge { background: var(--line); color: var(--muted); }
.item.locked .badge .ic { width: 20px; height: 20px; }
.hwline { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 4px; }
.item.done .hwline { color: var(--ok); }

.lockbox { text-align: center; padding: 40px 16px; }
.lockbox .big .ic { width: 56px; height: 56px; margin: 0 auto; color: var(--muted); }
.lockbox p { color: var(--muted); max-width: 460px; margin: 8px auto 18px; }
.passbox { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 14px; border-radius: 12px; font-weight: 650; }
.passbox.ok { background: var(--ok-soft); color: var(--ok); }

#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-weight: 650; box-shadow: var(--shadow); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(-8px); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 12px; }
.cardtitle { font-size: 18px; margin: 0 0 8px; }
.row.center { justify-content: center; }
.card .row { margin-top: 12px; }

.scorecard { display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 12px 0; }
.scorecard .t { font-weight: 700; font-size: 17px; }
.scorecard .s { color: var(--muted); font-size: 14px; }
.ring { --p: 0; flex: none; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line) 0); }
.ring b { width: 56px; height: 56px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 16px; }
.scorecard.ok .ring { background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--line) 0); }

.wordlist { display: grid; gap: 6px; margin-top: 12px; }
.wordrow { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 6px 12px 6px 6px; box-shadow: var(--shadow); }
.wordrow .body { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.wordrow .body span { color: var(--muted); font-size: 14px; }

.stagebar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.stagebar span { font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--line); color: var(--muted); }
.stagebar span.on { background: var(--accent); color: var(--accent-ink); }
.stagebar span.done { background: var(--ok-soft); color: var(--ok); }
.stagebar .bar { flex-basis: 100%; }

.vcard { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 26px 18px; }
.vcard .word { font-size: 32px; font-weight: 800; letter-spacing: -.01em; }
.vcard .word.uz { font-size: 26px; color: var(--accent); }
.vcard .tr { font-size: 19px; color: var(--accent); font-weight: 650; }
.vcard .ex { background: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.vcard .prompt { color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.vcard .hint { font-family: ui-monospace, Consolas, monospace; color: var(--muted); letter-spacing: .1em; }
.vcard input.answer { width: min(340px, 100%); font: inherit; font-size: 20px; text-align: center; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); }
.done-card { text-align: center; }
.done-card .big { font-size: 46px; }
.done-card .row { justify-content: center; }

.fb { padding: 10px 14px; border-radius: 12px; font-weight: 650; margin-top: 10px; }
.fb.good { background: var(--ok-soft); color: var(--ok); }
.fb.bad { background: var(--accent-soft); color: var(--accent); }

.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.opts.col { flex-direction: column; width: min(380px, 100%); }
.opt { border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: 15px; text-align: left; }
.opt.big { padding: 12px 16px; font-size: 16px; }
.opt:hover { border-color: var(--accent); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.right, .opt.sel.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 650; }
.opt.wrong, .opt.sel.wrong { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); text-decoration: line-through; }
.btn.mic { padding: 14px 22px; font-size: 17px; }

.theory { line-height: 1.6; }
.theory table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 15px; }
.theory th, .theory td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.theory th { background: var(--bg); }
.theory ul { padding-left: 20px; }

.excard h3 { margin: 0; font-size: 16.5px; }
.exhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pill { font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--muted); flex: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.instr { color: var(--muted); font-size: 14.5px; margin: 6px 0 10px; }
.example { font-size: 14px; color: var(--muted); font-style: italic; margin: 6px 0; }
.passage { background: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: 15px; margin: 10px 0; max-height: 360px; overflow-y: auto; }
.passage p { margin: 6px 0; }
.qitems { display: grid; gap: 14px; margin-top: 10px; }
.qitem { border-top: 1px solid var(--line); padding-top: 12px; }
.qitem:first-child { border-top: 0; padding-top: 0; }
.qtext { line-height: 2.1; }
.blank { color: var(--muted); letter-spacing: .05em; }
input.gap { --w: 10ch; width: calc(var(--w) + 18px); max-width: 100%; font: inherit; line-height: 1.3; height: 34px; vertical-align: baseline; padding: 2px 8px; margin: 0 3px; border: 0; border-bottom: 2px solid var(--accent); background: var(--accent-soft); border-radius: 6px 6px 0 0; color: var(--text); }
input.gap.wide { display: block; width: 100%; margin: 6px 0 0; }
input.gap.right { border-color: var(--ok); background: var(--ok-soft); }
input.gap.wrong { border-color: var(--accent); text-decoration: line-through; }
.correct { color: var(--ok); font-weight: 650; margin: 0 4px; }
.correct.block { display: block; margin: 6px 0 0; }
.pool, .built { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; padding: 6px; border-radius: 12px; }
.built { border: 2px dashed var(--line); margin-bottom: 8px; }
.built.right { border-color: var(--ok); background: var(--ok-soft); }
.built.wrong { border-color: var(--accent); }
.pool.lines, .built.lines { flex-direction: column; }
.tok { border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px; padding: 7px 12px; cursor: pointer; font: inherit; font-size: 15px; text-align: left; }
.tok.on { border-color: var(--accent); background: var(--accent-soft); }
.ph { color: var(--muted); font-size: 14px; align-self: center; padding: 0 6px; }
textarea.writing { width: 100%; font: inherit; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); resize: vertical; }

.form { display: grid; gap: 10px; }
.form input, .form select { padding: 11px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--text); font: inherit; }
.okmsg { color: var(--ok); font-weight: 650; }
.levelbar { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 4px; scrollbar-width: none; }
.levelbar::-webkit-scrollbar { display: none; }
.levelbar button { flex: none; display: grid; text-align: left; gap: 1px; border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 7px 12px; cursor: pointer; }
.levelbar button b { font-size: 15px; }
.levelbar button small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.levelbar button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.levelbar button.on small { color: inherit; opacity: .85; }
.bookchips { display: flex; gap: 6px; flex-wrap: wrap; }
.bookchips span { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.accessgrid { display: grid; gap: 6px; }
.accessrow { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; }
.accessrow > b { display: grid; font-size: 15px; min-width: 0; }
.accessrow > b small { font-size: 11px; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.accessrow .check { min-width: 0; padding: 8px; gap: 6px; font-size: 13px; line-height: 1.2; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.creds pre { background: var(--bg); padding: 12px; border-radius: 10px; white-space: pre-wrap; font-size: 15px; }
.redtext { color: var(--accent) !important; font-weight: 650; }
.rank.me { outline: 2px solid var(--accent); }
.rank .coins { flex: none; }
.marks { display: grid; gap: 8px; overflow-x: auto; }
.markrow { display: flex; gap: 6px; align-items: center; }
.markrow > b { width: 34px; flex: none; }
.mark { flex: none; display: grid; text-align: center; min-width: 48px; padding: 4px 6px; border-radius: 8px; background: var(--bg); font-size: 13px; font-weight: 650; }
.mark small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.mark.ok { background: var(--ok-soft); color: var(--ok); }
.mark.low { background: var(--accent-soft); color: var(--accent); }
.writing-view { white-space: pre-wrap; }

@media (min-width: 1100px) {
  body.wide.player-open #view { margin-right: 400px; }
  body.wide #player.open {
    top: 0; left: auto; width: 400px; border-top: 0; border-left: 1px solid var(--line);
    display: flex; flex-direction: column;
  }
  body.wide #player.open .sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  body.wide #player.open .cues { max-height: none; flex: 1; width: 100%; }
}
