@font-face { font-family: 'Vazirmatn'; src: url('fonts/vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-display: block; }
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Inter'; src: url('fonts/inter-ext.woff2') format('woff2'); font-weight: 100 900; unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  --bg: #0A0B12;
  --surface: #10121C;
  --surface-2: #151826;
  --surface-3: #1B1F31;
  --hover: rgba(255, 255, 255, .045);
  --border: rgba(255, 255, 255, .07);
  --border-2: rgba(255, 255, 255, .11);
  --text: #ECEEF8;
  --text-2: #A3A8C3;
  --text-3: #7B819E;
  --violet: #8B7BFF;
  --blue: #5B8DFF;
  --accent: #A99CFF;
  --accent-soft: rgba(139, 123, 255, .12);
  --accent-line: rgba(139, 123, 255, .38);
  --grad: linear-gradient(135deg, #7C6CFF 0%, #4F8BFF 100%);
  --ok: #5EE0A0;
  --err: #FF7D8E;
  --der: #6FA8FF; --die: #FF8FB1; --das: #6EE0B4;
  --r: 12px;
  --r-lg: 16px;
  --fa: 'Vazirmatn', system-ui, sans-serif;
  --de: 'Inter', 'Vazirmatn', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--fa); font-size: 14.5px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow: hidden; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(139, 123, 255, .3); }
.de { font-family: var(--de); direction: ltr; unicode-bidi: isolate; }
.sel { user-select: text; }
.muted { color: var(--text-3); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 8px; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
svg.i.filled { fill: currentColor; }
.side-foot#account { gap: 6px; }
.side-foot#account .em { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-2); text-align: left; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .28s var(--ease) both; }
@keyframes fadeIn { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 216px 1fr; height: 100vh; }
.sidebar { display: flex; flex-direction: column; padding: 58px 12px 16px; border-inline-end: 1px solid var(--border); background: linear-gradient(180deg, #0D0F19, #0A0B12); -webkit-app-region: drag; }
.sidebar > * { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--grad); display: grid; place-items: center; font: 800 14px var(--de); color: #fff; box-shadow: 0 6px 18px rgba(91, 110, 255, .35); }
.brand b { font: 600 14.5px var(--de); letter-spacing: -.01em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--text-2); text-align: start; transition: background .18s, color .18s; }
.nav button:hover { background: var(--hover); color: var(--text); }
.nav button.on { background: var(--accent-soft); color: var(--text); }
.nav button.on svg { color: var(--accent); }
.nav .count { margin-inline-start: auto; font-size: 11.5px; color: var(--text-3); }
.nav button.on .count { color: var(--accent); }
.side-foot { margin-top: auto; padding: 0 12px; font-size: 12px; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }
kbd { font-family: var(--de); font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 6px; direction: ltr; display: inline-block; line-height: 1.6; }

.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar { height: 48px; flex: none; -webkit-app-region: drag; }
.view { flex: 1; overflow-y: auto; padding: 0 48px 64px; }
.view-inner { max-width: 900px; margin: 0 auto; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 22px; }
.head h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 500; transition: background .18s, border-color .18s, transform .12s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 18px rgba(91, 110, 255, .25); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.ib { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 0; background: none; color: var(--text-3); transition: background .18s, color .18s; }
.ib:hover { background: var(--hover); color: var(--text); }
.ib.on { color: var(--accent); }
.ib.on svg { fill: var(--accent); }
.ib.sm { width: 28px; height: 28px; }
.ib.sm svg { width: 16px; height: 16px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.tag.acc { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.tag.ok { color: var(--ok); background: rgba(94, 224, 160, .08); border-color: transparent; }
.tag.err { color: var(--err); background: rgba(255, 125, 142, .08); border-color: transparent; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
button.tag { cursor: pointer; transition: color .15s, background .15s; }
button.tag:hover { color: var(--text); background: var(--surface-3); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.field { width: 100%; height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); outline: none; user-select: text; transition: border-color .18s, box-shadow .18s; }
.field:focus { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.field::placeholder { color: var(--text-3); }
select.field { appearance: none; padding-inline-end: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237B819E' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 11px center; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-3); font-size: 12.5px; transition: background .18s, color .18s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.sec { font-size: 12.5px; color: var(--text-3); font-weight: 500; margin: 30px 0 10px; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty .ic { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--accent); }
.empty h3 { margin: 0 0 4px; color: var(--text); font-size: 15.5px; font-weight: 600; }
.empty p { margin: 0 auto; max-width: 380px; font-size: 13.5px; }

/* ---------- composer & sentences ---------- */
.composer { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-2); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer input { flex: 1; height: 40px; border: 0; background: none; outline: none; padding: 0 12px; font-size: 15px; user-select: text; }
.composer input::placeholder { color: var(--text-3); }
.composer .btn { height: 38px; width: 38px; padding: 0; border-radius: 10px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.toolbar .sp { flex: 1; }
.toolbar .field { height: 32px; max-width: 220px; font-size: 13px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.daylabel { font-size: 12.5px; color: var(--text-3); margin: 22px 4px 8px; }
.item { border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); transition: border-color .2s; }
.item:hover, .item.open { border-color: var(--border-2); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; }
.row .txt { flex: 1; min-width: 0; }
.row .de-line { direction: ltr; font: 500 15.5px/1.5 var(--de); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .fa-line { font-size: 13px; color: var(--text-3); }
.row .fa-only { font-size: 15px; }
.row .st { flex: none; }
.body { padding: 2px 18px 18px; animation: fadeIn .25s var(--ease); }
.de-big { display: flex; gap: 6px; align-items: flex-start; padding: 14px 0 4px; border-top: 1px solid var(--border); }
.de-big .s { flex: 1; font: 600 21px/1.5 var(--de); letter-spacing: -.01em; text-align: left; }
.alt { font: 400 14px var(--de); color: var(--text-2); text-align: left; margin-top: 2px; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.meta .sp { flex: 1; }
.struct { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; }
.struct .p { padding: 6px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.struct .p b { font: 600 14px var(--de); display: block; }
.struct .p span { font: 500 11px var(--de); color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.notes { display: grid; gap: 6px; }
.note { padding: 10px 13px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.note b { color: var(--text); font-weight: 600; margin-inline-end: 6px; }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.voc { display: flex; align-items: baseline; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: background .15s; }
.voc:hover { background: var(--surface-3); }
.voc .w { font: 600 14px var(--de); direction: ltr; }
.voc .m { font-size: 13px; color: var(--text-2); }
.voc .g { font: 600 11px var(--de); }
.g-der { color: var(--der); } .g-die { color: var(--die); } .g-das { color: var(--das); }
.pending { color: var(--text-3); font-size: 13.5px; padding: 14px 0 2px; border-top: 1px solid var(--border); }
.err-text { color: var(--err); font-size: 13.5px; padding: 14px 0 2px; border-top: 1px solid var(--border); }
.verbs-inline { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- verbs ---------- */
.search { position: sticky; top: 0; z-index: 5; padding: 2px 0 16px; background: linear-gradient(var(--bg) 80%, transparent); }
.search form { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border-2); transition: border-color .2s, box-shadow .2s; }
.search form:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 5px var(--accent-soft); }
.search form > svg { color: var(--text-3); width: 20px; height: 20px; }
.search input { flex: 1; height: 100%; border: 0; outline: none; background: none; font-size: 17px; user-select: text; }
.search input::placeholder { color: var(--text-3); font-size: 15px; }
.cands { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cands .tag { font-family: var(--de); }
.cands .tag.on { color: var(--accent); background: var(--accent-soft); }
.cands small { font-family: var(--fa); color: var(--text-3); }
.notice { font-size: 13px; color: var(--text-2); margin-bottom: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vhead { padding: 24px 26px 20px; position: relative; overflow: hidden; }
.vhead::before { content: ''; position: absolute; top: -120px; left: -80px; width: 360px; height: 300px; background: radial-gradient(closest-side, rgba(124, 108, 255, .16), transparent); pointer-events: none; }
.vtop { display: flex; gap: 6px; align-items: flex-start; position: relative; }
.vtop .grow { flex: 1; min-width: 0; }
.inf { font: 700 40px/1.1 var(--de); letter-spacing: -.03em; text-align: right; direction: ltr; }
.inf .pre { background: var(--grad); -webkit-background-clip: text; color: transparent; }
.inf .refl { font-weight: 400; color: var(--text-3); font-size: 26px; margin-right: 8px; }
.vmean { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.vmeta { margin-top: 10px; font: 400 13px var(--de); color: var(--text-3); direction: ltr; text-align: right; }
.vmeta b { color: var(--text-2); font-weight: 500; }
.forms3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 20px; direction: ltr; border-top: 1px solid var(--border); padding-top: 16px; position: relative; }
.forms3 > div { cursor: pointer; padding: 0 4px; }
.forms3 .l { font: 500 11px var(--de); color: var(--text-3); letter-spacing: .05em; text-transform: uppercase; }
.forms3 .v { font: 600 18px var(--de); margin-top: 2px; }
.forms3 .v .aux { color: var(--text-3); font-weight: 400; }
.irr { color: var(--accent) !important; }
.tabs-row { direction: ltr; display: flex; align-items: center; gap: 8px; margin: 22px 0 12px; flex-wrap: wrap; }
.tabs-row .sp { flex: 1; }
.tgrid { direction: ltr; display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 10px; }
.tcard { padding: 12px 6px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.tcard h4 { margin: 0 12px 6px; font: 600 13px var(--de); color: var(--text-2); direction: ltr; text-align: left; display: flex; justify-content: space-between; align-items: center; }
.ct { width: 100%; direction: ltr; border-collapse: collapse; }
.ct td { padding: 5px 12px; font: 400 14.5px var(--de); }
.ct tr { cursor: pointer; }
.ct tr:hover td { background: var(--hover); }
.ct tr td:first-child { border-radius: 8px 0 0 8px; } .ct tr td:last-child { border-radius: 0 8px 8px 0; }
.ct td.p { color: var(--text-3); width: 68px; font-size: 12.5px; white-space: nowrap; }
.ct td.f { font-weight: 500; white-space: nowrap; font-size: 14px; }
.ct .alt2 { color: var(--text-3); font-weight: 400; font-size: 12.5px; }
.preps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.prep { padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.prep .pv { font: 600 14px var(--de); direction: ltr; text-align: right; }
.prep .pv em { font-style: normal; color: var(--accent); }
.prep .pv small { color: var(--text-3); font-weight: 500; margin-left: 6px; font-size: 11.5px; }
.prep .pf { font-size: 12.5px; color: var(--text-3); }
.exs { display: grid; gap: 6px; }
.ex { display: flex; gap: 8px; align-items: center; padding: 10px 12px 10px 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.ex .grow { flex: 1; min-width: 0; }
.ex .d { font: 400 15px var(--de); text-align: left; }
.ex .d mark { background: none; color: var(--accent); font-weight: 600; }
.ex .f { font-size: 12.5px; color: var(--text-3); }
details.gl summary { cursor: pointer; list-style: none; font-size: 12.5px; color: var(--text-3); margin: 26px 0 8px; display: flex; align-items: center; gap: 6px; }
details.gl summary::-webkit-details-marker { display: none; }
details.gl[open] summary svg { transform: rotate(180deg); }
details.gl ol { margin: 0; padding: 0 0 0 20px; direction: ltr; text-align: left; font: 400 13.5px/1.7 var(--de); color: var(--text-2); }
.vhome { display: grid; gap: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .tag { font-family: var(--de); height: 28px; padding: 0 11px; font-size: 13px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.vcard { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-align: right; cursor: pointer; color: inherit; transition: border-color .18s, transform .18s var(--ease); }
.vcard:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.vcard .a { font: 600 16px var(--de); direction: ltr; }
.vcard .b { font: 400 12.5px var(--de); color: var(--text-3); direction: ltr; margin-top: 2px; }
.vcard .c { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }

/* ---------- quiz ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 6, 12, .6); backdrop-filter: blur(8px); animation: fadeIn .2s; }
.modal { width: min(460px, calc(100vw - 32px)); padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal .mh { display: flex; align-items: center; gap: 8px; }
.modal .mh b { flex: 1; font-size: 15px; }
.qq { margin: 18px 0 12px; padding: 18px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.qq .t { font: 500 12.5px var(--de); color: var(--accent); }
.qq .p { font: 600 22px var(--de); margin-top: 4px; }
.qfb { min-height: 24px; margin-top: 10px; font-size: 13.5px; }
.qfb.ok { color: var(--ok); } .qfb.bad { color: var(--err); }
.uml { display: flex; gap: 6px; margin-top: 8px; direction: ltr; }
.uml button { width: 32px; height: 28px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); font-family: var(--de); }

/* ---------- review ---------- */
.flash-wrap { max-width: 560px; margin: 30px auto 0; }
.flash { min-height: 260px; padding: 32px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; }
.flash .front { font-size: 21px; font-weight: 600; line-height: 1.6; }
.flash .front.de { font-size: 30px; }
.flash .back { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); width: 100%; animation: fadeIn .25s; }
.flash .back .de { font-size: 20px; font-weight: 600; }
.flash .back .sub { color: var(--text-3); font-size: 13.5px; margin-top: 6px; }
.flash .hint { color: var(--text-3); font-size: 12.5px; margin-top: 22px; }
.grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.grades .btn { height: 44px; }
.progress { height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 16px; }
.progress div { height: 100%; background: var(--grad); transition: width .35s var(--ease); }

/* ---------- settings ---------- */
.sgroup { padding: 4px 20px; margin-bottom: 14px; }
.srow { display: flex; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.srow:last-child { border-bottom: 0; }
.srow .info { flex: 1; }
.srow .info b { display: block; font-size: 14px; font-weight: 600; }
.srow .info span { color: var(--text-3); font-size: 12.5px; }
.srow .ctl { display: flex; gap: 8px; align-items: center; }
.srow .ctl .field { width: auto; min-width: 140px; height: 36px; }
.rec { min-width: 150px; height: 36px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); font-family: var(--de); direction: ltr; padding: 0 12px; }
.rec.on { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--accent); }
.switch { width: 40px; height: 24px; border-radius: 20px; border: 0; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #8B90AA; transition: transform .22s var(--ease), background .2s; }
.switch.on { background: var(--grad); }
.switch.on::after { transform: translateX(-16px); background: #fff; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); opacity: 0; z-index: 60; pointer-events: none; display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-2); font-size: 13.5px; box-shadow: 0 12px 40px rgba(0,0,0,.45); transition: opacity .22s, transform .22s var(--ease); }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media (max-width: 1000px) { .view { padding: 0 28px 48px; } }

/* ---------- web: shared ---------- */
body.web .topbar { -webkit-app-region: no-drag; height: max(28px, env(safe-area-inset-top)); }
body.web .sidebar { padding-top: 26px; -webkit-app-region: no-drag; }
a.btn { text-decoration: none; }

/* ---------- phones & small windows ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .sidebar, body.web .sidebar {
    position: fixed; z-index: 30; inset: auto 0 0 0; height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom);
    flex-direction: row; border-inline-end: 0; border-top: 1px solid var(--border);
    background: rgba(12, 13, 22, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; width: 100%; gap: 0; }
  .nav button { flex: 1; flex-direction: column; gap: 2px; padding: 6px 0; font-size: 11px; justify-content: center; align-items: center; background: none !important; min-height: 48px; }
  .nav button svg { width: 22px; height: 22px; }
  .nav button.on { color: var(--accent); }
  .nav .count { position: absolute; top: 2px; left: calc(50% + 8px); margin: 0; font-size: 10px; background: var(--violet); color: #fff !important; border-radius: 10px; padding: 0 5px; line-height: 16px; }
  .topbar { height: max(12px, env(safe-area-inset-top)); }
  .view { padding: 0 16px calc(90px + env(safe-area-inset-bottom)); }
  .head { margin: 10px 0 16px; }
  .head h1 { font-size: 22px; }
  .composer input, .search input, .field, #qa { font-size: 16px; }
  .row { padding: 13px 14px; }
  .body { padding: 2px 14px 16px; }
  .de-big .s { font-size: 18px; }
  .search form { height: 50px; border-radius: 14px; }
  .search kbd { display: none; }
  .vhead { padding: 18px 16px 16px; }
  .inf { font-size: 32px; }
  .forms3 .v { font-size: 15px; }
  .tabs-row { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs-row::-webkit-scrollbar { display: none; }
  .tgrid { grid-template-columns: 1fr; }
  .ct td { padding: 7px 12px; }
  .preps, .vocab { grid-template-columns: 1fr; }
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .srow { flex-wrap: wrap; gap: 10px; }
  .srow .ctl { width: 100%; flex-wrap: wrap; }
  .srow .ctl .field { flex: 1; min-width: 0 !important; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .field { max-width: none; flex: 1; }
  .flash { min-height: 220px; padding: 24px 18px; }
  .flash .front.de { font-size: 26px; }
  .modal { padding: 18px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .ib { width: 40px; height: 40px; }
  .ib.sm { width: 36px; height: 36px; }
}
.mobile-only { display: none; }
@media (max-width: 760px) { .mobile-only { display: inline-grid; } }
@media (hover: none) { .item:hover { border-color: var(--border); } .vcard:hover { transform: none; } }
