/* Widhura Web — Ola design language */
@font-face { font-family: "WidAtlasChirani"; src: url("../fonts/library/atlas-chirani.ttf"); }
@font-face { font-family: "WidManame"; src: url("../fonts/library/maname.ttf"); }
@font-face { font-family: "WidAbhayaLibre"; src: url("../fonts/library/abhayalibre.ttf"); }
@font-face { font-family: "WidFontoshan"; src: url("../fonts/library/fontoshan.ttf"); }
@font-face { font-family: "WidCCMotta"; src: url("../fonts/library/CCMottaTypeOne.ttf"); }
@font-face { font-family: "WidCCRustic"; src: url("../fonts/library/CCRustic.ttf"); }
@font-face { font-family: "WidTharuSansala"; src: url("../fonts/library/tharu_digital_sansala.ttf"); }
@font-face { font-family: "WidTharuRusiru"; src: url("../fonts/library/tharu_digital_rusiru.ttf"); }
@font-face { font-family: "WidTharuRun"; src: url("../fonts/library/tharu_digital_run.ttf"); }
@font-face { font-family: "WidTharuNidahasa"; src: url("../fonts/library/tharu_digital_nidahasa.ttf"); }
@font-face { font-family: "WidIskoola"; src: url("../fonts/iskpota.ttf"); }
@font-face { font-family: "WidIskoolaB"; src: url("../fonts/iskpotab.ttf"); font-weight: 700; }
@font-face { font-family: "WidFMAbhaya"; src: url("../fonts/fm-abha0.ttf"); }

:root {
  --bg: #F2EDE3; --surface: #FBF8F1; --ink: #2B2620; --muted: #8A8072;
  --amber: #F5A623; --amber-deep: #C77E0A; --amber-soft: #FCEBCF;
  --line: #E4DCCB; --green: #3E9B4F; --red: #C0392B;
  --surface-2: #FAF8F4; --rail: #1A1611; --rail-ink: #B8AC9B; --rail-active: #FFF3E2;
  --shadow: 0 2px 10px rgba(43, 38, 32, .06); --r: 14px;
}
html[data-theme="dark"] {
  --bg: #171310; --surface: #241F19; --ink: #F6EFDF; --muted: #A79B87;
  --amber-soft: #3A2E17; --line: #3A342C; --surface-2: #1E1A16;
  --rail: #0B0907; --rail-ink: #9A8F80;
  --shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
html[data-size="s"] { font-size: 13px; }
html[data-size="m"] { font-size: 14px; }
html[data-size="l"] { font-size: 16px; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Noto Sans Sinhala", sans-serif;
  -webkit-font-smoothing: antialiased;
}
html[data-motion="off"] * { transition: none !important; animation: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; outline: none; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 22%, transparent); }
textarea { resize: vertical; }
select { width: auto; }
a { color: var(--amber-deep); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: .95rem; margin-bottom: 8px; }
.muted { color: var(--muted); }
.tiny { font-size: .74rem; }
.mt { margin-top: 16px; }
[hidden] { display: none !important; }

.shell { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--rail); display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 12px; gap: 2px; position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.logo.center { justify-content: center; padding: 0 0 14px; }
.mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--amber), var(--amber-deep));
  color: #241F19; font-weight: 700; font-size: 20px; box-shadow: var(--shadow);
}
.sidenav { display: flex; flex-direction: column; align-items: center; gap: 2px; overflow-y: auto; width: 100%; }
.snav {
  width: 62px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 9px 0 7px; border: 0; border-radius: 10px; background: none;
  color: var(--rail-ink); font-weight: 600; font-size: 10px; text-align: center; flex: none;
}
.snav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.snav:hover { background: rgba(255, 255, 255, .06); color: var(--rail-active); }
.snav.is-on { background: rgba(255, 255, 255, .09); color: var(--rail-active); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px; width: 100%; }
.userchip { display: flex; flex-direction: column; align-items: center; gap: 5px; background: none; border: 0; padding: 6px 4px; border-radius: 10px; }
.userchip:hover { background: rgba(255, 255, 255, .06); }
.uchip-txt { display: flex; flex-direction: column; align-items: center; max-width: 66px; }
.uchip-txt b { font-size: 9px; color: var(--rail-active); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uchip-txt small { display: none; }
.ava {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--amber), var(--amber-deep)); color: #241F19; font-weight: 700; font-size: .85rem;
}
.ava.big { width: 52px; height: 52px; font-size: 1.2rem; }
.ava.top { border: 0; box-shadow: var(--shadow); width: 30px; height: 30px; font-size: .72rem; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px; height: 48px; padding-left: 14px;
  position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(150deg, #FFDCA6, #E2A03F 52%, #B97A1B); color: #3A2408; font-weight: 700; font-size: 16px;
}
.brand-txt { font-weight: 800; font-size: 13px; line-height: 1.15; letter-spacing: -.01em; }
.brand-txt small { display: block; font-size: 8.5px; letter-spacing: .18em; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.topbar h1 { display: none; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; font-size: 15px; flex: none;
}
.iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:hover { border-color: var(--amber); }
.iconbtn.sm { width: 30px; height: 30px; border: 0; background: none; }
.iconbtn.close { position: absolute; top: 14px; right: 14px; }
.menu { display: none; }
.omni { position: relative; flex: 1; max-width: 430px; display: flex; align-items: center; }
.omni > svg { position: absolute; left: 10px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.omni input { padding: 0 62px 0 32px; height: 30px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.omnikbd { position: absolute; right: 6px; font-size: 10px; padding: 1px 6px; color: var(--muted); pointer-events: none; }
.omnilist {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  max-height: 340px; overflow: auto; padding: 6px;
}
.omniitem { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; text-align: left; }
.omniitem:hover, .omniitem.is-sel { background: var(--amber-soft); }
.omniitem .k { font-size: .62rem; font-weight: 700; letter-spacing: .08em; color: var(--amber-deep); background: color-mix(in srgb, var(--amber) 18%, transparent); padding: 3px 6px; border-radius: 6px; flex: none; }
.omniitem .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omniitem .t small { display: block; color: var(--muted); font-size: .72rem; }
.topactions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tbtn { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: none; font-size: 12px; font-weight: 600; color: var(--ink); }
.tbtn:hover { background: var(--surface-2); }
.tbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.streakchip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 10px; font-size: .72rem; white-space: nowrap; }
.avawrap { position: relative; margin: 0 4px; }
.avamenu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 50; }
.avamenu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 9px; font-size: .87rem; }
.avamenu button:hover { background: var(--amber-soft); }
.danger { color: var(--red) !important; }

#content { padding: 18px 22px 40px; max-width: 1240px; width: 100%; margin: 0 auto; }
.view { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.btn {
  border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: .82rem;
  background: linear-gradient(140deg, var(--amber), var(--amber-deep)); color: #241F19;
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.btn.ghost:hover { border-color: var(--amber); }
.btn.sm { padding: 7px 12px; font-size: .8rem; }
.btn.block { width: 100%; }
.btn.danger { background: var(--red); color: #fff; }
.btnrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btnrow.end { justify-content: flex-end; }
.btnrow.center { justify-content: center; }
.linklike { border: 0; background: none; color: var(--amber-deep); font-weight: 600; padding: 0; text-decoration: underline; }
.linklike.center { display: block; margin: 14px auto 0; }
.empty { color: var(--muted); font-size: .88rem; }
.empty.big { text-align: center; padding: 28px 10px; }
.chipwrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; font-size: .8rem; font-weight: 600; color: var(--muted);
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chipword { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: .85rem; }
.chipword:hover { border-color: var(--amber); }

.homehead { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.homehead h2 { font-size: 1.35rem; letter-spacing: -.02em; }
.goalwrap { position: relative; width: 52px; height: 52px; flex: none; }
.ring { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ringbg { stroke: var(--line); }
.ringfg { stroke: var(--amber); stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset .5s; }
.goalwrap span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .68rem; font-weight: 700; }
.eyebrow { font-size: .66rem; font-weight: 800; letter-spacing: .18em; color: var(--amber-deep); }
.wod { background: linear-gradient(140deg, var(--amber-soft), var(--surface) 70%); }
.wodrow { display: flex; justify-content: space-between; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.wodsi { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; }
.wodlatin { color: var(--amber-deep); font-weight: 600; }
.woden { color: var(--muted); margin-top: 2px; }
.wodbtns { display: flex; gap: 8px; flex-wrap: wrap; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.statgrid.three { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; flex-direction: column; align-items: center; padding: 10px; gap: 2px; }
.stat b { font-size: 1.3rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .76rem; }
.homegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.homegrid.two { grid-template-columns: 1fr 1fr; }
.commlist { display: flex; flex-direction: column; gap: 10px; }
.commrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.commrow:last-child { border: 0; padding-bottom: 0; }
.commrow b { font-size: 1.02rem; }
.commrow small { display: block; color: var(--muted); font-size: .72rem; }
.fotwprev { font-size: 1.45rem; padding: 8px 4px; line-height: 1.5; }
.fotwrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.searchrow { position: relative; }
.searchbox { display: flex; align-items: center; position: relative; }
.searchbox > svg { position: absolute; left: 13px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.searchbox input { padding: 13px 44px 13px 42px; border-radius: 16px; font-size: 1rem; }
.searchbox .iconbtn.sm { position: absolute; right: 8px; }
.searchbox.grow { flex: 1; }
.searchbox.grow input { padding: 10px 82px 10px 38px; }
.searchbox #dmic { right: 44px; }
#dmic.listening { color: var(--red); animation: micpulse 1.1s ease-in-out infinite; }
@keyframes micpulse { 50% { opacity: .35; } }
.sugbox { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.osk { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.osklive { text-align: center; color: var(--amber-deep); font-weight: 600; min-height: 26px; margin-bottom: 8px; }
.oskkeys { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.oskkeys button { min-width: 34px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; }
.oskkeys button:hover { border-color: var(--amber); }
.resultlist { display: flex; flex-direction: column; gap: 8px; }
.result {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
}
.result:hover { border-color: var(--amber); }
.result .si { font-size: 1.05rem; font-weight: 700; min-width: 96px; }
.result .mid { flex: 1; min-width: 0; }
.result .mid small { display: block; color: var(--muted); font-size: .76rem; }
.result .en { color: var(--muted); font-size: .88rem; }
.result .star { border: 0; background: none; font-size: 17px; color: var(--muted); flex: none; }
.result .star.on { color: var(--amber); }
.poschip { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-deep); background: color-mix(in srgb, var(--amber) 16%, transparent); border-radius: 6px; padding: 3px 7px; }
.viewhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.miniinput { width: 180px; padding: 7px 10px; border-radius: 10px; }

.readerdoc { font-size: 1.15rem; line-height: 2; }
.readerdoc .w { border-radius: 6px; padding: 1px 2px; cursor: pointer; }
.readerdoc .w:hover { background: var(--amber-soft); color: var(--amber-deep); }
.check { display: flex; align-items: center; gap: 7px; font-size: .84rem; color: var(--muted); }
.check input { width: auto; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 7px 13px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.maprow label { font-size: .84rem; color: var(--muted); }
.convstatus { font-size: .76rem; margin: 6px 2px; }
#convOut { background: var(--bg); }

.gamehub { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gamecard { text-align: left; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); }
.gamecard:hover { border-color: var(--amber); transform: translateY(-1px); }
.gicon { font-size: 1.6rem; }
.gamecard p { margin: 0; font-size: .82rem; }
.gamearea .playcard { display: flex; flex-direction: column; gap: 12px; }
.playlabel { font-size: .68rem; font-weight: 800; letter-spacing: .16em; color: var(--amber-deep); }
.playgloss { font-size: 1.6rem; font-weight: 700; }
.playhint { color: var(--muted); }
.playmark { font-weight: 700; }
.playmark.ok { color: var(--green); }
.playmark.no { color: var(--red); }
.playstats { display: flex; gap: 18px; color: var(--muted); font-size: .84rem; }
.playstats b { color: var(--ink); }
.scramchips { display: flex; gap: 8px; flex-wrap: wrap; }
.scramchips button { width: 40px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 1.1rem; font-weight: 700; }
.scramchips button.used { opacity: .25; pointer-events: none; }
.scramanswer { min-height: 48px; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; font-size: 1.2rem; letter-spacing: .12em; font-weight: 700; }
.quizopts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quizopts button { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 1.25rem; font-weight: 700; }
.quizopts button.ok { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.quizopts button.no { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.lb { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.lb li::marker { color: var(--amber-deep); font-weight: 700; }
.lb .me { color: var(--amber-deep); font-weight: 700; }
.lb b { float: right; }
.xplist { margin: 0; padding-left: 18px; color: var(--muted); font-size: .88rem; display: flex; flex-direction: column; gap: 6px; }

.duechip { display: inline-block; background: var(--amber); color: #3A2408; font-size: .62rem; font-weight: 800; border-radius: 99px; padding: 2px 8px; vertical-align: 2px; }
.fccard { text-align: center; padding: 26px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.fccat { font-size: .68rem; font-weight: 800; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.fcfront { font-size: 1.7rem; font-weight: 700; }
.fcsi { font-size: 2.2rem; font-weight: 700; color: var(--amber-deep); }
.fclatin { color: var(--muted); font-size: .95rem; }
.fcratings { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fcratings button { border-radius: 12px; padding: 10px 18px; font-weight: 700; border: 1px solid var(--line); background: var(--surface); }
.fcratings button small { display: block; font-weight: 600; font-size: .64rem; color: var(--muted); }
.fcratings .fc-again { border-color: var(--red); color: var(--red); }
.fcratings .fc-good { border-color: var(--amber); color: var(--amber-deep); }
.fcratings .fc-easy { border-color: var(--green); color: var(--green); }
.badgegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.badge .bico { font-size: 1.5rem; }
.badge b { font-size: .7rem; line-height: 1.2; }
.badge small { font-size: .6rem; color: var(--muted); line-height: 1.25; }
.badge.off { opacity: .38; filter: grayscale(1); }
.actchart { display: flex; gap: 8px; align-items: flex-end; height: 130px; padding-top: 6px; position: relative; }
.actcol { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.actbar { width: 100%; max-width: 36px; background: var(--amber); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.actcol.today .actbar { background: var(--amber-deep); }
.actcol .actn { font-size: .66rem; font-weight: 700; color: var(--ink); }
.actcol .actd { font-size: .64rem; color: var(--muted); }
.actgoalline { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--muted); opacity: .55; pointer-events: none; }
#printSheet { font-family: inherit; }
@media print {
  body.printing > *:not(#printSheet) { display: none !important; }
  #printSheet { display: block !important; }
  #printSheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
  #printSheet th, #printSheet td { border: 1px solid #999; padding: 6px 8px; text-align: left; }
}
.xplist b { color: var(--amber-deep); }

.gate { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.contribgrid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; align-items: start; }
.frow { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.frow label { font-size: .8rem; font-weight: 600; color: var(--muted); }
.frow.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.frow.two > div { display: flex; flex-direction: column; gap: 6px; }
.frow .btnrow input { flex: 1; }
.formerr { color: var(--red); font-size: .82rem; font-weight: 600; }
.cwprev { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; }
.cwsi { font-size: 1.5rem; font-weight: 700; }
.cwlatin { color: var(--amber-deep); font-size: .88rem; }
.cwen { color: var(--muted); font-size: .88rem; }
.subrow { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.subrow .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.subrow b { font-size: 1.02rem; }
.subrow small { color: var(--muted); display: block; font-size: .74rem; }
.status { font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.status.pending { background: color-mix(in srgb, var(--amber) 20%, transparent); color: var(--amber-deep); }
.status.approved { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.status.rejected { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }

.fonthead { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.countpill { background: var(--amber-soft); color: var(--amber-deep); font-weight: 700; font-size: .8rem; border-radius: 999px; padding: 7px 14px; white-space: nowrap; }
.fontbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; }
.typetester { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.typetester input[type="search"], .typetester > input { flex: 1; min-width: 220px; border: 0; background: none; font-size: 1rem; padding: 6px 2px; }
.typetester > input:focus { box-shadow: none; border-bottom: 1px dashed var(--amber); border-radius: 0; }
.sizer { display: flex; align-items: center; gap: 10px; }
.sizer input[type="range"] { width: 150px; padding: 0; border: 0; accent-color: var(--amber); }
.sizer span { font-size: .78rem; color: var(--muted); min-width: 42px; }
.fontgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fontcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.fontcard .prev { min-height: 74px; display: flex; align-items: center; overflow: hidden; line-height: 1.5; word-break: break-word; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.fontcard .fname { font-weight: 700; }
.fontcard .fauthor { color: var(--muted); font-size: .76rem; }
.fontcard .fmeta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fontcard .fdownloads { margin-left: auto; color: var(--muted); font-size: .72rem; }
.fontcard .btnrow { margin-top: auto; }
.dlbadge { font-size: .64rem; font-weight: 700; color: var(--green); }
.fmpreview { font-size: 34px; line-height: 1.6; margin-top: 12px; }
.fmmeta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.fmmeta div { display: flex; flex-direction: column; gap: 3px; font-size: .84rem; }
.fmmeta span { font-size: .7rem; }

.setgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.setrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setrow:last-of-type { border: 0; }
.setrow label { font-size: .9rem; }
.switch { width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); position: relative; flex: none; padding: 0; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: left .18s, background .18s; }
.switch[aria-checked="true"] { background: var(--amber); border-color: var(--amber); }
.switch[aria-checked="true"] .knob { left: 22px; background: #fff; }
.profrow { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }

/* desktop-parity: dictionary toolbar, alphabet rail, osk tabs */
.dictbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.langpair { display: flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.lang-btn { display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 7px 10px; border-radius: 10px; font-weight: 600; font-size: .85rem; }
.lang-btn:hover { background: var(--amber-soft); }
.lang-btn svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang-code { font-size: .68rem; font-weight: 800; color: var(--amber-deep); background: color-mix(in srgb, var(--amber) 18%, transparent); padding: 3px 6px; border-radius: 6px; }
.langpop { position: fixed; z-index: 75; width: 264px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: 320px; overflow: auto; }
.langpop-row { display: flex; gap: 8px; align-items: center; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 9px; text-align: left; font-size: .85rem; }
.langpop-row:hover, .langpop-row.is-active { background: var(--amber-soft); }
.langpop-row.is-active { color: var(--amber-deep); font-weight: 700; }
.lp-code { font-weight: 800; font-size: .7rem; width: 26px; flex: none; }
.lp-native { margin-left: auto; color: var(--muted); font-size: .78rem; }
.oskhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dictwork { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.alpha { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 76px; max-height: calc(100vh - 110px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px; }
.alpha button { border: 0; background: none; border-radius: 8px; padding: 5px 0; font-size: .95rem; color: var(--ink); }
.alpha button:hover { background: var(--amber-soft); }
.alpha button.is-active { background: var(--ink); color: var(--bg); font-weight: 700; }
.alpha button.is-empty { color: var(--line); }
.alpha-label { font-size: .56rem; font-weight: 800; letter-spacing: .08em; color: var(--muted); text-align: center; margin-top: 6px; text-transform: uppercase; }
.dictresults { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.resulthead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#savedToggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.result.is-sel { border-color: var(--amber); background: var(--amber-soft); }

/* desktop-parity: reader speech, history tabs, statusbar, quick, packs, credits */
.readtoolbar .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; }
.readtoolbar select { max-width: 230px; }
.readerdoc .w.is-speaking { background: var(--amber); color: #241F19; }
.histtabs { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dayhead { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 8px 0 2px; }
.statusbar { margin-top: auto; display: flex; align-items: center; gap: 10px; height: 26px; padding: 0 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; background: var(--surface); }
.statusbar .spacer { flex: 1; }
.statusbar kbd { font-size: 10px; padding: 0 5px; border-radius: 4px; }
.kbdhint { display: flex; align-items: center; gap: 6px; flex: none; }
#statusHint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.statussep { width: 1px; height: 12px; background: var(--line); }
.quickhead { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.livedot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.quickbody { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 300px; overflow: auto; }
.statcard { display: flex; gap: 18px; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.statcard .stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.statcard .stat b { font-size: 1.2rem; }
.statcard .stat span { color: var(--muted); font-size: .72rem; }
.packlist .pack { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.packlist .pack small { display: block; color: var(--muted); font-size: .72rem; }
.badge { font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); flex: none; }
.badge.ok { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.creditlist div { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.creditlist div:last-child { border: 0; }
.creditlist span { color: var(--muted); font-size: .76rem; }
.helpsec h4 { margin: 14px 0 4px; font-size: .9rem; }
.helpsec p { margin: 0; color: var(--muted); font-size: .85rem; }

.scrim { position: fixed; inset: 0; background: rgba(23, 19, 16, .45); z-index: 60; backdrop-filter: blur(2px); }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; overflow: auto; }
.modalcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 22px; width: min(560px, 100%); }
.modalcard.wide { width: min(720px, 100%); }
.modalcard.small { width: min(420px, 100%); }
.modalcard.auth { width: min(430px, 100%); }
.modalcard.pal { padding: 10px; width: min(620px, 100%); }
.modalcard.pal input { border: 0; background: none; font-size: 1.05rem; padding: 12px 14px; }
.modalcard.pal input:focus { box-shadow: none; }
.pallist { max-height: 380px; overflow: auto; border-top: 1px solid var(--line); padding-top: 6px; }
.enhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ensi { font-size: 2rem; font-weight: 700; }
.enlatin { color: var(--amber-deep); font-weight: 600; margin: 2px 0 10px; }
.exbox { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.exbox div:first-child { font-size: 1.05rem; }
.legacyrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.legacyrow code { background: var(--bg); border-radius: 8px; padding: 5px 9px; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.keys { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
kbd { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; font-size: .78rem; font-family: inherit; }

.tour { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--bg) 94%, transparent); display: grid; place-items: center; padding: 24px; }
.tourcard { max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.obicon { width: 74px; height: 74px; border-radius: 22px; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #241F19; background: linear-gradient(140deg, var(--amber), var(--amber-deep)); box-shadow: var(--shadow); }
.obdots { display: flex; gap: 6px; }
.obdots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); }
.obdots i.is-on { width: 20px; background: var(--amber-deep); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: end; }
.toast {
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 16px; font-size: .87rem;
  display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); max-width: 360px;
  animation: tin .22s ease;
}
.toast button { border: 0; background: none; color: var(--amber); font-weight: 700; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.bottomnav { display: none; }
@media (min-width: 901px) {
  #content { flex: 1; display: flex; flex-direction: column; }
  #view-home { flex: 1; }
  #view-home .homegrid { flex: 1; }
}
@media (max-width: 1020px) {
  .homegrid, .fontgrid, .gamehub { grid-template-columns: 1fr 1fr; }
  .contribgrid, .setgrid, .homegrid.two { grid-template-columns: 1fr; }
  .kbdhint, #statusHint { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 65; height: 100dvh;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow);
    align-items: stretch; padding: 14px 10px;
  }
  .sidebar.open { transform: none; }
  .sidenav { align-items: stretch; }
  .snav { width: auto; flex-direction: row; justify-content: flex-start; gap: 11px; padding: 10px 12px; font-size: .85rem; border-radius: 12px; text-align: left; }
  .snav svg { width: 19px; height: 19px; }
  .side-foot { align-items: stretch; padding: 10px 6px 0; }
  .userchip { flex-direction: row; justify-content: flex-start; gap: 10px; }
  .uchip-txt { align-items: flex-start; max-width: none; }
  .uchip-txt b { font-size: .85rem; max-width: 150px; }
  .uchip-txt small { display: block; color: var(--rail-ink); font-size: .7rem; }
  .menu { display: grid; }
  .topbar { padding: 10px 14px; gap: 8px; height: auto; }
  .brand-txt, #settingsBtn { display: none; }
  .omnikbd, .tbtn-label, .streakchip { display: none; }
  .omni input { padding-right: 12px; }
  #content { padding: 16px 14px 90px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .bottomnav button { border: 0; background: none; color: var(--muted); font-size: .7rem; font-weight: 700; padding: 6px 2px; border-radius: 10px; }
  .bottomnav button.is-on { color: var(--amber-deep); }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .homegrid, .fontgrid, .gamehub { grid-template-columns: 1fr; }
  .quizopts { grid-template-columns: 1fr; }
  .wodsi { font-size: 1.7rem; }
  .dictwork { grid-template-columns: 1fr; }
  .alpha { position: static; flex-direction: row; overflow-x: auto; max-height: none; flex-wrap: nowrap; padding: 6px; }
  .alpha button { flex: none; padding: 5px 9px; }
  .alpha-label { display: none; }
  .lang-name { display: none; }
  .setrow { flex-wrap: wrap; }
  .setrow label { flex: 1 1 auto; min-width: 0; }
  .setrow > :not(label) { max-width: 100%; }
  .sizer { min-width: 0; }
  .sizer input[type="range"] { width: 110px; }
  .statusbar { display: none; }
  .toasts { right: 12px; left: 12px; bottom: 76px; align-items: stretch; }
  .toast { max-width: none; }
}