/* «Сад · Шафран»: одна колонка под телефон, мягкие плитки на тёплом фоне. Правила стиля — в DESIGN.md. */
:root {
  --bg: linear-gradient(170deg, #FCF5E9 0%, #F8EBE3 100%);
  --bg-solid: #FAF0E6;
  --blob-a: #FFCB6B; --blob-b: #F7A07E; --blob-o: .55;
  --tile: rgba(255, 255, 255, .74);
  --tile-line: rgba(110, 70, 20, .1);
  --ink: #2A2017;
  --muted: #6A5B4A;
  --soft: rgba(225, 140, 40, .15);
  --acc: linear-gradient(135deg, #F0B144 0%, #E0703F 100%);
  --acc-ink: #98520F;
  --on-acc: #2A1607;
  --acc-shadow: 0 10px 28px rgba(224, 112, 63, .3);
  --shadow: 0 6px 20px rgba(110, 70, 20, .06);
  --inv-bg: #2A1607; --inv-fg: #FFF4E6;
  --good: #2F7A3E; --good-soft: rgba(47, 122, 62, .12);
  --bad: #B3402A; --bad-soft: rgba(179, 64, 42, .12);
  --font-ar: "Scheherazade New", "Noto Naskh Arabic", "Geeza Pro", serif;
  --font-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tap: 44px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: linear-gradient(170deg, #1A130C 0%, #22140F 100%); --bg-solid: #1E130E;
    --blob-a: #C27A22; --blob-b: #A2391F; --blob-o: .32;
    --tile: rgba(255, 240, 220, .06); --tile-line: rgba(255, 220, 180, .1);
    --ink: #F6EDE2; --muted: #B8A792; --soft: rgba(240, 170, 70, .15);
    --acc-ink: #F3B861; --acc-shadow: 0 10px 34px rgba(224, 112, 63, .35); --shadow: none;
    --good: #7CCB8A; --good-soft: rgba(124, 203, 138, .14); --bad: #F08A72; --bad-soft: rgba(240, 138, 114, .14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: linear-gradient(170deg, #1A130C 0%, #22140F 100%); --bg-solid: #1E130E;
  --blob-a: #C27A22; --blob-b: #A2391F; --blob-o: .32;
  --tile: rgba(255, 240, 220, .06); --tile-line: rgba(255, 220, 180, .1);
  --ink: #F6EDE2; --muted: #B8A792; --soft: rgba(240, 170, 70, .15);
  --acc-ink: #F3B861; --acc-shadow: 0 10px 34px rgba(224, 112, 63, .35); --shadow: none;
  --good: #7CCB8A; --good-soft: rgba(124, 203, 138, .14); --bad: #F08A72; --bad-soft: rgba(240, 138, 114, .14);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg-solid); }
body {
  min-height: 100vh; color: var(--ink);
  font: 16px/1.5 var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--acc-ink); outline-offset: 2px; }

/* Фон: тёплый градиент и два медленно плавающих пятна. */
.bgfx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.bgfx span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-o); }
.bgfx span:nth-child(1) { width: 340px; height: 340px; background: var(--blob-a); top: -90px; right: -100px; animation: drift1 18s ease-in-out infinite alternate; }
.bgfx span:nth-child(2) { width: 300px; height: 300px; background: var(--blob-b); bottom: 10%; left: -130px; animation: drift2 22s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-60px, 80px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(70px, -60px) scale(1.1); } }

.scr {
  max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100svh;
  padding-top: max(20px, env(safe-area-inset-top, 0px));
  padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
.scr.enter { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: .4; transform: translateY(14px); } }

.ar { font-family: var(--font-ar); direction: rtl; unicode-bidi: isolate; }
/* Арабские вставки в русском тексте: у этого шрифта мелкий глаз, подтягиваем к кириллице. */
bdi.ar { font-size: 1.3em; line-height: 1; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.center { text-align: center; }
.good-ink { color: var(--good); } .bad-ink { color: var(--bad); }
.grow { flex: 1; }

.tile { background: var(--tile); border: 1px solid var(--tile-line); border-radius: 24px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
.press { transition: transform .15s ease; }
.press:active { transform: scale(.97); }

.btn { border: 0; border-radius: 999px; min-height: 58px; padding: 0 22px; background: var(--acc); color: var(--on-acc);
  font-weight: 600; font-size: 16px; width: 100%; box-shadow: var(--acc-shadow); }
.btn.ghost { background: var(--tile); color: var(--ink); box-shadow: none; border: 1px solid var(--tile-line); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.inv { background: var(--inv-bg); color: var(--inv-fg); box-shadow: none; }
.link { border: 0; background: none; padding: 10px 4px; min-height: var(--tap); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; align-self: flex-start; }
.ibtn { width: var(--tap); height: var(--tap); flex: none; border-radius: 50%; border: 1px solid var(--tile-line); background: var(--tile);
  display: grid; place-items: center; padding: 0; color: var(--ink); }
.ibtn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.av { font-weight: 600; font-size: 16px; background: var(--acc); color: var(--on-acc); border: 0; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row2.wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: var(--tap); }
.top b { font-size: 17px; font-weight: 600; }
.note { background: var(--soft); border-radius: 16px; padding: 10px 14px; font-size: 14px; }
.note .link { padding: 0; min-height: 0; color: var(--acc-ink); }

/* ── Главная ── */
.hdr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 4px; }
.hdr h1 { margin-top: 2px; font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 2px; }
.day { display: grid; place-items: center; border: 0; background: none; padding: 0; min-height: 48px; }
.day i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 600;
  background: var(--tile); border: 1px solid var(--tile-line); color: var(--muted); }
.day i svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.day.done i { background: var(--acc); color: var(--on-acc); border-color: transparent; }
.day.today i { border: 2px solid var(--acc-ink); color: var(--acc-ink); }
.day.today.done i { border: 0; color: var(--on-acc); }
.day.sel i { box-shadow: 0 0 0 3px var(--bg-solid), 0 0 0 5px var(--acc-ink); }

.secthead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 4px; }
.secthead b { font-size: 15px; font-weight: 600; }
.words { display: flex; flex-direction: column; gap: 10px; }
.wtile { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 14px 8px 18px; text-align: left; width: 100%; min-height: 84px; }
.wtile .ru { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wtile .ru b { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.wtile > .ar { font-size: 44px; line-height: 1.7; flex: none; }
.wtile.locked > .ar { filter: blur(10px); opacity: .5; }

.hero { padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.hero.grad { background: var(--acc); color: var(--on-acc); border: 0; box-shadow: var(--acc-shadow); }
.hero.grad .lbl, .hero.grad .muted { color: inherit; opacity: .8; }
.hero h2 { font-size: 23px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }

/* Три состояния слова: значок отличается формой, а не только цветом. */
.st { width: 16px; height: 16px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; }
.st svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.st.new { box-shadow: inset 0 0 0 1.5px var(--muted); opacity: .7; }
.st.learn { background: conic-gradient(var(--acc-ink) 0 50%, transparent 50% 100%); box-shadow: inset 0 0 0 1.5px var(--acc-ink); }
.st.known { background: var(--acc); color: var(--on-acc); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); padding: 0 4px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--soft); color: var(--acc-ink); white-space: nowrap; }
.chip .st { width: 12px; height: 12px; }
.chip .st svg { width: 8px; height: 8px; }
.chip.known { background: var(--acc); color: var(--on-acc); }
.chip.known .st { background: transparent; }
.chip.new { background: transparent; box-shadow: inset 0 0 0 1px var(--tile-line); color: var(--muted); }

.weekrows { display: flex; flex-direction: column; padding: 6px 16px; }
.wrow { display: grid; grid-template-columns: 22px repeat(3, minmax(0, 1fr)); align-items: center; gap: 4px; border-top: 1px solid var(--tile-line); min-height: 58px; }
.wrow:first-child { border-top: 0; }
.wrow .dn { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.wrow button { border: 0; background: none; padding: 0 2px; min-height: 52px; min-width: 0; font-family: var(--font-ar); font-size: 25px; line-height: 1.9;
  color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.wrow button > span { direction: rtl; unicode-bidi: isolate; white-space: nowrap; }
.wrow button > span.l { font-size: 21px; }
.wrow button > span.xl { font-size: 18px; line-height: 1.5; white-space: normal; text-align: center; }
.wrow button.new { color: var(--muted); }
.wrow button:disabled { filter: blur(6px); opacity: .45; cursor: default; }
.fold { border: 0; background: none; width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px; min-height: var(--tap); text-align: left; }
.fold b { font-size: 15px; font-weight: 600; }
.fold svg { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; transition: transform .2s ease; flex: none; }
.fold[aria-expanded="true"] svg { transform: rotate(90deg); }
.wkhead { display: flex; align-items: center; gap: 8px; }
.wkhead .fold { flex: 1; min-width: 0; }
.rep { border: 0; flex: none; font-size: 13px; font-weight: 600; padding: 0 14px; min-height: 36px; border-radius: 999px; background: var(--soft); color: var(--acc-ink); }

/* ── Карточка слова ── */
.prog { flex: 1; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--acc); border-radius: 4px; transition: width .4s ease; }
.count { font-size: 13px; color: var(--muted); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.wcard { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.wcard img { width: 100%; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; display: block; background: var(--soft); }
.cap { font-size: 10px; color: var(--muted); padding: 4px 4px 0; }
.whead { text-align: center; padding: 4px 6px 12px; display: flex; flex-direction: column; align-items: center; }
.whead .ar { font-size: 84px; font-weight: 700; line-height: 1.7; }
.whead .tr { font-size: 24px; font-weight: 600; letter-spacing: -.015em; }
.whead.closed { padding: 70px 6px 60px; }
.reveal { border: 0; background: none; padding: 0; width: 100%; color: inherit; }
.ask { font-size: 14px; color: var(--muted); margin-top: 6px; }
.hidden-tr { filter: blur(9px); user-select: none; opacity: .7; }
.tr-show { animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.9); } }

.sec { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.roots { display: flex; gap: 8px; justify-content: center; direction: rtl; }
.roots span { width: 52px; height: 60px; border-radius: 16px; display: grid; place-items: center; font-family: var(--font-ar); font-size: 34px; background: var(--soft); color: var(--acc-ink); padding-bottom: 8px; }
.pair { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border-top: 1px solid var(--tile-line); }
.pair:first-of-type { border-top: 0; }
.pair .ar { font-size: 24px; line-height: 1.9; flex: none; max-width: 60%; text-align: right; }
.pair > span:last-child { text-align: left; font-size: 14px; }
.ex { display: flex; flex-direction: column; padding: 6px 0; border-top: 1px solid var(--tile-line); }
.ex:first-of-type { border-top: 0; }
.ex .ar { font-size: 24px; line-height: 1.9; text-align: right; }
.ex .muted { font-size: 14px; }
.plural { font-size: 34px; line-height: 1.8; text-align: right; }
.facts { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.ayah { border-top: 1px solid var(--tile-line); padding-top: 8px; }
.ayah:first-of-type { border-top: 0; padding-top: 0; }
.ayah summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: var(--tap); }
.ayah summary::-webkit-details-marker { display: none; }
.ayah .ar { font-size: 24px; line-height: 2; text-align: right; }
.ayah .full { font-size: 22px; }
.ayah mark { background: var(--soft); color: var(--acc-ink); border-radius: 6px; padding: 0 4px; }
.ayah .ref { font-size: 12px; color: var(--muted); }
.ayah .ref b { color: var(--acc-ink); font-weight: 600; }
.ayah[open] .more, .ayah:not([open]) .less { display: none; }
.ayah p { margin-top: 6px; font-size: 14px; }

/* ── Заучивание: выбор слов ── */
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 14px; padding: 12px 16px; width: 100%; text-align: left; min-height: 64px; }
.opt .rd { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--tile-line); flex: none; display: grid; place-items: center; }
.opt[aria-pressed="true"] { border-color: var(--acc-ink); box-shadow: inset 0 0 0 1px var(--acc-ink); }
.opt[aria-pressed="true"] .rd { border-color: var(--acc-ink); }
.opt[aria-pressed="true"] .rd::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--acc-ink); }
.opt b { display: block; font-size: 15px; font-weight: 600; }
.opt small { display: block; font-size: 12px; color: var(--muted); }
.opt .n { margin-left: auto; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt:disabled { opacity: .45; cursor: default; }

/* ── Упражнения ── */
.kind { text-align: center; }
.q { min-height: 170px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 24px 18px; text-align: center; width: 100%; color: inherit; }
.q.big { min-height: 240px; }
.q .ar.qa { font-size: 80px; font-weight: 700; line-height: 1.7; }
.q .qr { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
@media (max-height: 720px) { .q { min-height: 124px; } .q .ar.qa { font-size: 64px; } .q.big { min-height: 210px; } .scr { gap: 14px; } }
@media (max-height: 600px) { .q { min-height: 96px; padding-block: 14px; } .q .ar.qa { font-size: 54px; } .q.big { min-height: 170px; } .scr { gap: 10px; } }
.q .a-ar { font-size: 54px; line-height: 1.7; }
.q .a-ru { font-size: 24px; font-weight: 600; }
.q .extra { font-size: 13px; color: var(--muted); margin-top: 8px; max-width: 280px; }
.flipped { animation: turn .4s ease; }
@keyframes turn { 0% { transform: perspective(900px) rotateY(80deg); opacity: .3; } 100% { transform: none; } }
.sent { font-size: 30px; line-height: 2; text-align: center; }
.sent .gap { display: inline-block; min-width: 2.6em; border-bottom: 2px dashed var(--acc-ink); color: var(--acc-ink); }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice { min-height: 60px; padding: 8px 16px; width: 100%; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.choice .ar { font-size: 32px; font-weight: 400; line-height: 1.8; }
.right { background: var(--good-soft) !important; border-color: var(--good) !important; color: var(--good) !important; }
.wrong { background: var(--bad-soft) !important; border-color: var(--bad) !important; color: var(--bad) !important; animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.match { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 68px; gap: 8px; }
.mt { height: 68px; padding: 0 10px; position: relative; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; text-align: center; width: 100%; min-width: 0; overflow: hidden; }
.mt.ar { font-family: var(--font-ar); font-size: 30px; font-weight: 400; line-height: 1; padding-bottom: 8px; }
.mt.linked { background: var(--soft); border-color: transparent; }
.mt.pick { border-color: var(--acc-ink); box-shadow: inset 0 0 0 1px var(--acc-ink); }
.mt .tag { position: absolute; top: 6px; left: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--acc); color: var(--on-acc); font: 600 10px/18px var(--font-ui); text-align: center; }
.slot { min-height: 96px; display: flex; align-items: center; justify-content: center; font-family: var(--font-ar); font-size: 56px; line-height: 1.7; direction: rtl;
  border: 1px solid var(--tile-line); border-radius: 16px; background: var(--tile); }
.slot.empty { color: var(--muted); font-family: var(--font-ui); font-size: 14px; direction: ltr; }
.letters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: rtl; }
.letters button { width: 56px; height: 60px; font-family: var(--font-ar); font-size: 32px; padding: 0 0 8px; }
.letters button.used { opacity: .25; pointer-events: none; }
.field { width: 100%; min-height: 56px; border-radius: 18px; border: 1px solid var(--tile-line); background: var(--tile); color: var(--ink); font: 500 17px var(--font-ui); padding: 0 18px; }
.field:focus { outline: 3px solid var(--soft); border-color: var(--acc-ink); }
textarea.field { min-height: 90px; font-size: 13px; padding: 12px; }
.tform { display: flex; flex-direction: column; gap: 10px; }
.fb { padding: 14px 16px; border-radius: 18px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.fb b { font-size: 15px; font-weight: 600; }
.fb.ok { background: var(--good-soft); color: var(--good); }
.fb.no { background: var(--bad-soft); color: var(--bad); }
.fb .ar { font-size: 26px; line-height: 1.7; }

/* ── Итог ── */
.donebox { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; position: relative; }
.medal { width: 120px; height: 120px; border-radius: 50%; background: var(--acc); display: grid; place-items: center; box-shadow: var(--acc-shadow);
  color: var(--on-acc); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.medal svg { width: 54px; height: 54px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.donebox h2 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.learned-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.learned-row .ar { font-size: 32px; line-height: 1.8; }
.misses { width: 100%; text-align: left; padding: 8px 16px; }
.misses .pair { width: 100%; border-left: 0; border-right: 0; border-bottom: 0; background: none; color: inherit; min-height: var(--tap); }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--acc); opacity: 0; animation: spark 1.2s ease-out forwards; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4); } }

/* ── Профиль ── */
.me { display: flex; align-items: center; gap: 18px; padding: 18px; }
.me .who { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.me .who b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ring { width: 96px; height: 96px; flex: none; position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring b { font-size: 24px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; text-align: center; }
.ring b small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 14px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 500; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.tchips button { border: 0; font-size: 12px; font-weight: 600; padding: 8px 12px; min-height: 36px; border-radius: 999px; background: var(--soft); color: var(--acc-ink); }
.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; table-layout: fixed; }
.board th { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; text-align: right; padding: 0 4px 8px; }
.board th:first-child, .board td:first-child { text-align: left; width: 46%; }
.board td { padding: 10px 4px; border-top: 1px solid var(--tile-line); text-align: right; }
.board .nm { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.board .nm span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pl { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--soft); color: var(--acc-ink); flex: none; }
.board tr.mine td { color: var(--acc-ink); }
.board tr.mine .pl { background: var(--acc); color: var(--on-acc); }
.menu { display: flex; flex-direction: column; padding: 4px 16px; }
.menu button { border: 0; background: none; border-top: 1px solid var(--tile-line); min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0; text-align: left; font-weight: 500; }
.menu button:first-child { border-top: 0; }
.menu button span:last-child { color: var(--muted); font-size: 14px; }

/* ── Лайфхаки ── */
.hack { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.hack .wz { font-size: 30px; line-height: 1.8; }
.ws { display: flex; gap: 0 16px; flex-wrap: wrap; }
.w { border: 0; background: none; padding: 0; min-height: var(--tap); color: var(--ink); font-size: 26px; line-height: 1.8; }

/* ── Окна ── */
.modal { position: fixed; inset: 0; background: rgba(20, 10, 0, .45); display: grid; place-items: center; z-index: 20; overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.modal .panel { width: 100%; max-width: 420px; background: var(--bg-solid); border: 1px solid var(--tile-line); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal h2 { font-size: 20px; font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }
.row > .field { flex: 1 1 160px; }
.profiles { display: grid; gap: 6px; }
.profile { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 12px; border-radius: 16px;
  border: 1px solid var(--tile-line); background: var(--tile); text-align: left; }
.profile .muted { margin-left: auto; }
.profile.cur { border-color: var(--acc-ink); }
.ava { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--acc); color: var(--on-acc); font-weight: 600; font-size: 14px; flex: none; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Плитка хифза на главной: раздел оформлен в схеме «Небо», плитка намекает на это голубым. */
.hztile { padding: 18px; display: grid; gap: 12px; border-color: rgba(0, 153, 255, .22); background: linear-gradient(135deg, rgba(0, 153, 255, .10), rgba(255, 255, 255, 0) 60%), var(--tile); }
.hzt { display: grid; gap: 2px; }
.hzt b { font-size: 18px; font-weight: 600; line-height: 1.3; }
.hzt .lbl { color: #0071CC; }
.btn.hzbtn:not(.ghost) { background: #0099FF; color: #FFFFFF; box-shadow: 0 10px 24px -12px rgba(0, 120, 220, .7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hzt .lbl { color: #4DB8FF; } }
:root[data-theme="dark"] .hzt .lbl { color: #4DB8FF; }
/* Под часами iPhone: текст, уехавший под строку состояния, размывается, а не лезет под цифры. */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); z-index: 40; pointer-events: none;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
/* Хифз: пока открыт лист мусхафа, страница сайта не прокручивается */
html.hz-lock, html.hz-lock body { overflow: hidden; overscroll-behavior: none; height: 100%; }
