/* Generated by npm run build. Edit css/source/ sources. */
/* ───────── الرموز ───────── */
:root {
  color-scheme: dark;
  --bg: #0d0f14;
  --surface: #14171e;
  --surface-2: #1b1f28;
  --line: #262b37;
  --text: #eef0f5;
  --muted: #8d95a8;
  --faint: #4a5163;
  --accent: #f5b544;
  --accent-ink: #1a1405;
  --accent-soft: rgba(245, 181, 68, .13);
  --ok: #4fd1a5;
  --ok-soft: rgba(79, 209, 165, .13);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .14);
  --info: #7aa7ff;
  --radius: 18px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
  --ar: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --en: 'Fraunces', Georgia, 'Times New Roman', serif;
  --en-ui: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f2e9;
  --surface: #fffdf8;
  --surface-2: #f0ebdf;
  --line: #e2dccd;
  --text: #1d1b16;
  --muted: #6f6a5d;
  --faint: #b9b2a1;
  --accent: #9a5f00;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(154, 95, 0, .12);
  --ok: #0f8f68;
  --ok-soft: rgba(15, 143, 104, .12);
  --bad: #d13b3b;
  --bad-soft: rgba(209, 59, 59, .1);
  --info: #2f62c9;
  --shadow: 0 18px 40px -22px rgba(60, 45, 10, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--ar); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.en { font-family: var(--en-ui); direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* ───────── الهيكل ───────── */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-mark { width: 36px; height: 36px; flex: none; display: block; }
.brand b { font-size: 19px; letter-spacing: -.2px; }
.brand b::after { content: ''; display: inline-block; width: .5em; height: .11em; margin-inline-start: .22em; border-radius: 3px; background: var(--accent); animation: blink 1.1s steps(2) infinite; }
.brand small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a .ico { width: 22px; text-align: center; font-size: 17px; }
.nav a .pill { margin-inline-start: auto; }
.side-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; font-size: 17px; transition: border-color .15s;
}
.icon-btn:hover { border-color: var(--faint); }
main#view { padding: 34px clamp(18px, 4vw, 52px) 90px; max-width: 1080px; width: 100%; }
.tabbar { display: none; }
.topbar { display: none; }

/* ───────── عناصر عامة ───────── */
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(25px, 3.4vw, 34px); line-height: 1.3; letter-spacing: -.3px; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); transition: transform .12s, filter .15s;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.sm { padding: 7px 13px; font-size: 14px; border-radius: 10px; }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--muted);
}
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stars { color: var(--accent); letter-spacing: 2px; font-size: 14px; }
.stars i { font-style: normal; color: var(--faint); }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button small { font-family: var(--en-ui); font-weight: 700; margin-inline-start: 6px; opacity: .8; }
.tabs button.on { color: var(--text); border-color: var(--accent); }

.bar { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .22s ease; }
.bar.ok > i { background: var(--ok); }

/* ───────── الرئيسية ───────── */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 16px; }
.next-card { position: relative; overflow: hidden; padding: 26px; display: flex; flex-direction: column; gap: 8px; min-height: 230px; }
.next-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(520px 260px at 10% 0%, var(--accent-soft), transparent 70%);
}
.next-card > * { position: relative; }
.next-card .kicker { color: var(--accent); font-weight: 600; font-size: 13.5px; }
.next-card h2 { font-family: var(--en-ui); font-weight: 700; letter-spacing: -.5px; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; direction: ltr; text-align: right; }
.next-card .btn { align-self: flex-start; margin-top: auto; }
.goal-card { display: flex; flex-direction: column; gap: 14px; }
.streak { display: flex; align-items: center; gap: 12px; }
.streak .flame { font-size: 34px; line-height: 1; filter: grayscale(1) opacity(.5); }
.streak.live .flame { filter: none; }
.streak b { font-size: 30px; line-height: 1; font-family: var(--en-ui); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; align-items: end; height: 74px; direction: ltr; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.week i { width: 100%; max-width: 26px; border-radius: 6px; background: var(--surface-2); min-height: 5px; }
.week i.has { background: var(--accent); }
.week span { font-size: 11px; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px; }
.stat b { display: block; font-family: var(--en-ui); font-size: 27px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13.5px; }
.section-title { font-size: 17px; margin: 26px 0 12px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { padding: 14px; text-align: center; opacity: .38; }
.badge.got { opacity: 1; border-color: var(--accent); }
.badge .ico { font-size: 26px; }
.badge b { display: block; font-size: 14px; }
.badge span { font-size: 12px; color: var(--muted); display: block; line-height: 1.4; }

/* ───────── القوائم ───────── */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; transition: border-color .15s, transform .15s;
}
.item:hover { border-color: var(--faint); transform: translateX(-3px); }
.item.up-next { border-color: var(--accent); }
.item .ico { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font-size: 25px; }
.item h3 { font-family: var(--en-ui); font-size: 17px; direction: ltr; text-align: right; }
.item p { color: var(--muted); font-size: 14px; }
.item .end { text-align: left; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* ───────── صفحات النصوص ───────── */
.reader { max-width: 760px; }
.reader-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.passage { padding: clamp(20px, 4vw, 38px); }
.passage .ln { padding: 9px 12px; margin: 0 -12px; border-radius: 12px; transition: background .2s; direction: ltr; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; }
.passage .ln-say { grid-row: 1 / span 2; align-self: start; margin-top: 4px; opacity: .55; }
.passage .ln:hover .ln-say, .passage .ln-say:focus-visible { opacity: 1; }
.passage .ln-ar { grid-column: 2; direction: rtl; }
.passage .ln-en { font-family: var(--en); font-size: clamp(20px, 2.5vw, 25px); line-height: 1.6; direction: ltr; text-align: left; }
.passage .ln-en span { cursor: pointer; border-radius: 6px; padding: 1px 2px; transition: background .12s; }
.passage .ln-en span:hover, .passage .ln-en span.sel { background: var(--accent-soft); color: var(--accent); }
.passage .ln-ar { color: var(--muted); font-size: 15.5px; margin-top: 2px; text-align: left; }
.tipbox bdi { font-weight: 600; }
.passage.no-ar .ln-ar { display: none; }
#wordbar { position: sticky; bottom: 14px; z-index: 5; }
.wordbar {
  margin-top: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); border-color: var(--accent);
}
.wordbar b { font-family: var(--en); font-size: 22px; direction: ltr; }
.wordbar span { color: var(--muted); }
.tipbox { border-inline-start: 3px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; }
.tipbox b { color: var(--accent); display: block; font-size: 14px; }

.table { width: 100%; border-collapse: collapse; text-align: right; }
[dir='ltr'] .table { text-align: left; }
/* اتجاه الإنجليزية داخل الخلية لا يغيّر محاذاتها مقارنة ببقية العمود. */
.table td, .table th { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: inherit; }
.table th { font-size: 13px; font-weight: 500; color: var(--muted); }
.table .cell-number { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .w { font-family: var(--en); font-size: 19px; direction: ltr; text-align: left; white-space: nowrap; }
.table .ex { font-family: var(--en-ui); direction: ltr; text-align: left; color: var(--muted); font-size: 14.5px; }
.say { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); display: inline-grid; place-items: center; font-size: 14px; }
.say:hover { background: var(--accent-soft); }

/* ───────── النماذج ───────── */
textarea, input[type='text'], select {
  width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font: inherit;
}
textarea { min-height: 170px; resize: vertical; font-family: var(--en-ui); direction: ltr; text-align: left; line-height: 1.6; }
.setting { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting > div:first-child { flex: 1; }
.setting b { display: block; }
.setting small { color: var(--muted); font-size: 13.5px; }
.setting select { width: auto; min-width: 170px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 13px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.switch { width: 46px; height: 27px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { transform: translateX(-19px); background: var(--accent-ink); }

/* ───────── المشغّل ───────── */
.player { min-height: 100vh; display: flex; flex-direction: column; padding: 16px clamp(16px, 4vw, 40px) 20px; max-width: 1040px; margin: 0 auto; }
.p-top { display: flex; align-items: center; gap: 14px; }
.p-top h1 { font-family: var(--en-ui); font-size: 16px; font-weight: 600; direction: ltr; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-top .bar { flex: 1; direction: ltr; }
.p-top .count { font-family: var(--en-ui); color: var(--muted); font-size: 14px; direction: ltr; }
.p-tools { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.chip-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--muted); }
.chip-btn:hover { color: var(--text); border-color: var(--faint); }
.chip-btn.on { color: var(--accent); border-color: var(--accent); }
.stage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 26px 0; min-height: 320px; cursor: text; direction: ltr; }
.gloss { min-height: 40px; display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.gloss b { font-family: var(--en); font-size: 23px; }
.gloss span { color: var(--accent); font-family: var(--ar); font-size: 19px; direction: rtl; }
.sentence { font-family: var(--en); font-weight: 700; font-size: clamp(30px, 5vw, 58px); line-height: 1.28; letter-spacing: -.5px; word-spacing: .06em; }
.sentence.long { font-size: clamp(24px, 3.6vw, 40px); }
.sentence.xlong { font-size: clamp(21px, 2.9vw, 32px); }
.sentence .w { display: inline-block; white-space: pre; cursor: pointer; }
.sentence .c.reveal:not(.done) { color: var(--accent) !important; }
.sentence .c { color: var(--faint); position: relative; transition: color .08s; }
.sentence .c.done { color: var(--text); }
.sentence .c.done.miss { color: var(--accent); }
.sentence .c.cur::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -.06em; height: .075em; min-width: .3em;
  background: var(--accent); border-radius: 3px; animation: blink 1.1s steps(2) infinite;
}
.sentence .c.bad { color: var(--bad) !important; animation: shake .22s; }
.sentence.hide .c:not(.done) { color: transparent; }
.sentence.hide .c:not(.done):not(.sp) { box-shadow: inset 0 -.08em 0 var(--line); }
.sentence.hide.peek .c:not(.done) { color: var(--faint); }
.sentence.complete .c.done { color: var(--ok); }
.sentence.complete .c.done.miss { color: var(--accent); }
@keyframes blink { 50% { opacity: .25; } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.underbar { width: 160px; height: 3px; border-radius: 9px; background: var(--line); margin: 22px 0 16px; overflow: hidden; }
.underbar i { display: block; height: 100%; background: var(--accent); transition: width .12s; }
.trans { font-family: var(--ar); direction: rtl; text-align: left; font-size: clamp(17px, 2.1vw, 22px); color: var(--muted); min-height: 38px; }
.trans.prompt { color: var(--text); font-size: clamp(20px, 2.6vw, 27px); }
.trans.hidden { visibility: hidden; }
.listen-big { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-family: var(--ar); font-weight: 600; margin-bottom: 18px; direction: rtl; }
.p-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.p-stats .pill { padding: 6px 15px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); }
.p-stats .pill b { font-family: var(--en-ui); color: var(--text); }
.p-hints { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; color: var(--muted); font-size: 13px; }
kbd { font-family: var(--en-ui); font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 7px; padding: 2px 7px; color: var(--text); }
.next-btn { margin-top: 20px; align-self: flex-start; direction: rtl; }
.tap-hint { display: none; }
.ghost-input { position: fixed; top: 40%; left: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; font-size: 16px; }

/* ───────── الاختبار والملخص ───────── */
.center-wrap { flex: 1; display: grid; place-items: center; padding: 24px 0; }
.panel { width: min(620px, 100%); padding: clamp(22px, 4vw, 36px); }
.q-text { font-family: var(--en); font-size: clamp(22px, 3vw, 28px); line-height: 1.4; direction: ltr; text-align: left; margin: 10px 0 20px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { text-align: left; direction: ltr; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-family: var(--en-ui); font-size: 16.5px; transition: border-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.sum-head { text-align: center; }
.sum-head .big-stars { font-size: 44px; letter-spacing: 8px; color: var(--accent); }
.sum-head .big-stars i { font-style: normal; color: var(--faint); }
.sum-head h2 { font-size: 26px; margin-top: 4px; }
.sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 22px 0; }
.sum-grid div { background: var(--surface-2); border-radius: 14px; padding: 13px 8px; text-align: center; }
.sum-grid b { display: block; font-family: var(--en-ui); font-size: 23px; }
.sum-grid span { font-size: 12.5px; color: var(--muted); }
.missed { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 22px; }
.missed button { direction: ltr; padding: 6px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-family: var(--en-ui); font-weight: 600; font-size: 14.5px; }
.missed button small { color: var(--muted); font-family: var(--ar); font-weight: 400; margin-left: 6px; }
.sum-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  transition: transform .2s, opacity .2s; z-index: 50; max-width: 90vw; text-align: center;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .ico { font-size: 44px; }

/* ───────── الجوال ───────── */
@media (pointer: coarse) {
  .tap-hint {
    display: block; position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 10; white-space: nowrap;
    background: var(--accent); color: var(--accent-ink); padding: 11px 20px; border-radius: 99px; font-weight: 600; box-shadow: var(--shadow);
  }
  .ghost-input:focus + .tap-hint { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 15; padding: calc(9px + env(safe-area-inset-top)) 16px 9px;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand { padding: 0; }
  .player { padding: 10px 14px 14px; min-height: 100dvh; }
  .p-tools { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-top: 10px; scrollbar-width: none; }
  .p-tools > * { flex: none; }
  .stage { justify-content: flex-start; padding: 18px 0; min-height: 0; }
  .p-stats .pill { padding: 4px 10px; font-size: 12.5px; }
  .side { display: none; }
  main#view { padding: 22px 16px 100px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 20;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; color: var(--muted); padding: 5px 0; border-radius: 10px; }
  .tabbar a .ico { font-size: 19px; }
  .tabbar a.on { color: var(--accent); }
  .hero { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .sum-grid { grid-template-columns: repeat(2, 1fr); }
  .item { grid-template-columns: 44px 1fr; }
  .item .ico { width: 44px; height: 44px; font-size: 21px; }
  .item .end { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; }
  /* قائمة الدروس طويلة: الحالة بجانب العنوان بدل سطر مستقل */
  .item.lesson { grid-template-columns: 44px 1fr auto; }
  .item.lesson .end { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 2px; }
  .item .end:empty { display: none; }
  .p-hints { display: none; }
  .table .ex { display: none; }
  #wordbar { bottom: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ───────── الواجهة الإنجليزية (من اليسار لليمين) ───────── */
.tar { text-align: right; }
[dir='ltr'] .tar,
[dir='ltr'] .next-card h2,
[dir='ltr'] .item h3,
[dir='ltr'] body { font-family: var(--en-ui); }
[dir='ltr'] .switch.on::after { transform: translateX(19px); }
[dir='ltr'] .item:hover { transform: translateX(3px); }
[dir='ltr'] .item .end { text-align: right; }
[dir='ltr'] .listen-big, [dir='ltr'] .next-btn { direction: ltr; }
[dir='ltr'] .missed button small { margin-left: 6px; }
[lang='ar'] { font-family: var(--ar); }

/* ───────── الحساب والأصدقاء ───────── */
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--en-ui); font-weight: 700; vertical-align: middle; }
.profile { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile .avatar { width: 52px; height: 52px; font-size: 20px; }
.profile b { font-size: 18px; display: block; }
.profile small { display: block; }
.table td.cell-end { text-align: left; white-space: nowrap; }
[dir='ltr'] .table td.cell-end { text-align: right; }
.table.lb td { vertical-align: middle; }
.table.lb .rank { width: 38px; text-align: center; font-family: var(--en-ui); font-weight: 700; font-size: 17px; }

.table.lb .num { white-space: nowrap; text-align: left; }
.table.lb tr.is-me td { background: var(--accent-soft); }
.table.lb tr.is-me td:first-child { border-radius: 0 12px 12px 0; }
.table.lb tr.is-me td:last-child { border-radius: 12px 0 0 12px; }
[dir='ltr'] .table.lb tr.is-me td:first-child { border-radius: 12px 0 0 12px; }
[dir='ltr'] .table.lb tr.is-me td:last-child { border-radius: 0 12px 12px 0; }
.link { color: var(--accent); text-decoration: underline; padding: 0; }
.empty b { display: block; color: var(--text); font-size: 17px; margin-top: 6px; }

/* دعوة تسجيل الدخول في الرئيسية */
.invite { display: flex; align-items: center; gap: 14px; margin-top: 16px; transition: border-color .15s; }
.invite:hover { border-color: var(--faint); }
.invite .ico { font-size: 28px; }
.invite div { flex: 1; }
.invite b { display: block; }
.invite div span { color: var(--muted); font-size: 14px; }

/* ───────── التحدي ───────── */
.race { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; direction: ltr; }
.lane { display: grid; grid-template-columns: minmax(70px, 130px) 1fr 44px; gap: 10px; align-items: center; font-size: 13.5px; color: var(--muted); }
.lane span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane.mine { color: var(--text); font-weight: 600; }
.lane .pct { text-align: right; }
.countdown { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 78%, transparent); }
.countdown span { font-family: var(--en-ui); font-weight: 700; font-size: 140px; color: var(--accent); line-height: 1; }
.friends-pick { display: flex; flex-direction: column; gap: 4px; }
.friends-pick label { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 10px; cursor: pointer; }
.friends-pick label:hover { background: var(--surface-2); }
.friends-pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.invite + .invite, .invite { margin-bottom: 0; }

/* ───────── تحسينات التجربة ───────── */
#view.enter { animation: view-in .22s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.acct { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-top: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s; }
.acct:hover { border-color: var(--faint); }
.acct b { display: block; font-size: 14.5px; line-height: 1.3; }
.acct small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; }
.acct > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct + .side-foot { margin-top: 10px; }
.icon-btn { position: relative; }
.dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.btn.busy, .say.busy, .link.busy { opacity: .55; pointer-events: none; }
.hint-line { margin: -6px 0 12px; font-size: 14px; }
[hidden] { display: none !important; }
@media (pointer: coarse) {
  .say { width: 40px; height: 40px; font-size: 16px; }
  .icon-btn { width: 44px; height: 44px; }
  .chip-btn { padding: 10px 14px; }
  .seg button { padding: 9px 14px; }
}
@media (max-width: 860px) {
  /* الصفوف لا تتمدد: الشريط العلوي يبقى بارتفاعه والمحتوى يأخذ الباقي */
  .shell { grid-template-rows: auto 1fr; align-content: start; }
}

@media (max-width: 560px) {
  .invite { flex-wrap: wrap; }
  .invite div { flex: 1 1 60%; }
  .invite .btn { width: 100%; }
}

/* ───────── الهوية: الشرطة الكهرمانية تحت العنصر النشط ───────── */
.nav a { position: relative; }
.nav a.on::after { content: ''; position: absolute; bottom: 5px; inset-inline-start: 45px; width: 16px; height: 3px; border-radius: 3px; background: var(--accent); }
@media (max-width: 860px) {
  .tabbar a { position: relative; }
  .tabbar a.on::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 16px; height: 3px; margin-left: -8px; border-radius: 3px; background: var(--accent); }
}

/* ───────── الجوال: لا شيء يتمدد أعرض من الشاشة ───────── */
.shell > * { min-width: 0; }
main#view { min-width: 0; }
.card { min-width: 0; }

body { overflow-x: clip; }
/* جداول الترتيب: أعمدة ثابتة العرض والاسم يُختصر بنقاط بدل أن يمدّد الجدول */
.table.lb { table-layout: fixed; }
.table.lb .av { width: 50px; }
.table.lb .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table.lb .num { width: 86px; }
.table.lb .num.sm { width: 58px; }
.table.lb .num.lg { width: 124px; }
.table.lb .num.wide { width: 210px; white-space: nowrap; }
.table.lb .rm { width: 46px; }
.table.lb .st { width: 118px; }
.table td.en { overflow-wrap: anywhere; }
.profile > div { min-width: 0; }
.profile b { overflow-wrap: anywhere; }
.invite div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .xs-hide { display: none; }
  .table.lb .num.wide { width: 150px; }
  .table.lb .num { width: 76px; }
  .page-head h1 { overflow-wrap: anywhere; }
}

.table td.acts { white-space: nowrap; }
@media (max-width: 560px) {
  .table td { padding: 10px 5px; }
  .table .w { white-space: normal; overflow-wrap: break-word; font-size: 17px; }
  .table td.acts { white-space: normal; }
  .table td.acts .pill { margin-bottom: 4px; }
  .table.lb .rm { width: 44px; }
  .table.lb .av { width: 46px; }
}

/* الإعدادات على الجوال: الشرح يأخذ السطر، وعنصر التحكم ينزل تحته إن لم يتسع */
@media (max-width: 560px) {
  .setting { flex-wrap: wrap; gap: 10px 14px; }
  .setting > div:first-child { flex: 1 1 190px; }
  .setting select { flex: 1 1 100%; width: 100%; min-width: 0; }
  .setting .seg { flex-wrap: wrap; }
  .table td.acts { width: 62px; }
}

/* تبويبات المستويات تتسع كلها في عرض الجوال */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
  .tabs { gap: 0; }
  .tabs button { flex: 1 1 0; padding: 10px 4px; font-size: 14.5px; }
  .tabs button small { margin-inline-start: 3px; }
}

/* ───────── الإشعارات ───────── */
.icon-btn .count { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font: 700 11.5px/19px var(--en-ui); font-style: normal; text-align: center; }
.notif { position: fixed; z-index: 40; bottom: 74px; inset-inline-start: 16px; width: 330px; max-width: calc(100vw - 24px); padding: 0; box-shadow: var(--shadow); overflow: hidden; animation: view-in .18s ease-out; }
.n-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.n-head .link { font-size: 13px; }
.n-list { max-height: min(420px, 60vh); overflow-y: auto; }
.n-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.n-item:last-child { border-bottom: 0; }
.n-item.new, .n-item.live { background: var(--accent-soft); }
.n-ico { font-size: 20px; line-height: 1.4; flex: none; }
.n-item div { min-width: 0; flex: 1; }
.n-item b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.n-item small { display: block; color: var(--muted); font-size: 12.5px; }
.n-acts { display: flex; gap: 8px; margin-top: 8px; }
@media (max-width: 860px) {
  .notif { top: 66px; bottom: auto; inset-inline: 12px; width: auto; }
}

/* ───────── التمارين الخفيفة ───────── */
.x-ar { font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); margin: 14px 0 16px; }
.x-line { min-height: 62px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 8px 0 12px; margin-bottom: 16px; border-bottom: 2px dashed var(--line); }
.x-line.ok { border-bottom-color: var(--ok); }
.x-full { font-family: var(--en); font-weight: 700; font-size: clamp(20px, 2.8vw, 26px); color: var(--ok); line-height: 1.4; }
.x-bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 50px; }
.chip { padding: 9px 15px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--en); font-weight: 500; font-size: 18px; line-height: 1.3; transition: border-color .12s, transform .1s; }
.chip:hover { border-color: var(--accent); }
.chip:active { transform: translateY(1px); }
.chip.used { visibility: hidden; }
.chip.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); animation: shake .22s; }
.x-gap { display: inline-block; min-width: 76px; text-align: center; border-bottom: 3px solid var(--accent); color: var(--ok); }
.panel .q-text { margin-top: 14px; }
/* المطوّر ومشاركة الرابط */
.dev p { color: var(--muted); margin-bottom: 14px; }
.share { display: flex; flex-direction: column; gap: 12px; }
.share input { font-size: 14px; }
.friends-pick small { display: block; }
@media (pointer: coarse) { .chip { padding: 11px 16px; } }

/* ───────── حيل الكلمات ───────── */
.pat { display: flex; flex-direction: column; gap: 12px; }
.pat-head { display: flex; gap: 16px; align-items: flex-start; }
.pat-key { flex: none; min-width: 92px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-family: var(--en); font-weight: 700; font-size: 22px; text-align: center; }
.pat-head b { font-size: 17px; display: block; }
.pat-head p { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.pat .tipbox { margin: 0; }
.pat-ex { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ex { text-align: start; direction: ltr; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.45; transition: border-color .12s; }
.ex:hover { border-color: var(--accent); }
.ex .base { color: var(--muted); font-size: 13.5px; margin-right: 6px; }
.ex b { font-family: var(--en); font-size: 17.5px; }
.ex small { display: block; color: var(--muted); font-size: 13.5px; direction: rtl; text-align: left; }
/* ───────── تقدّمي ───────── */
.pg-hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 12px; }
.pg-kicker { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.rank-card { display: flex; align-items: center; gap: 18px; background-image: linear-gradient(135deg, var(--accent-soft), transparent 60%); }
.rank-ico { font-size: 44px; line-height: 1; width: 80px; height: 80px; flex: none; border-radius: 22px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.rank-name { font-size: 24px; line-height: 1.35; }
.rank-xp { font-weight: 700; font-size: 15px; color: var(--accent); }
.pg-today { display: flex; align-items: center; gap: 16px; }
.pg-ring { position: relative; width: 80px; height: 80px; flex: none; }
.pg-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.pg-ring circle { fill: none; stroke-width: 8; stroke: var(--surface-2); }
.pg-ring circle.v { stroke: var(--accent); stroke-linecap: round; }
.pg-ring.ok circle.v { stroke: var(--ok); }
.pg-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 17px var(--en-ui); }
.pg-ring.ok b { color: var(--ok); font-size: 24px; }
.pg-goal { display: block; width: fit-content; max-width: 100%; font-size: 19px; line-height: 1.4; }
.pg-chips { gap: 6px; margin-top: 8px; }
.pg-h { gap: 8px; align-items: baseline; margin: 26px 0 12px; font-size: 13.5px; }
.pg-h .section-title { margin: 0; }
.pg-tracks { padding: 4px 20px; }
.pg-track { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.pg-track:last-child { border-bottom: 0; }
.pg-track .ico { grid-row: span 2; align-self: start; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 20px; }
.pg-track b { font-size: 15.5px; }
.pg-track:hover b { color: var(--accent); }
.pg-track .n { font-weight: 600; font-size: 14px; color: var(--muted); }
.pg-track > .bar, .pg-seg { grid-column: 2 / 4; }
.pg-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pg-seg small { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { margin-bottom: 8px; }
.cal-head span { text-align: center; font-size: 12px; color: var(--muted); }
.cal i { font-style: normal; height: 42px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font: 500 12.5px var(--en-ui); color: var(--faint); }
.cal i.some { background: var(--accent-soft); color: var(--accent); }
.cal i.full { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal i.ice { background: color-mix(in srgb, var(--info) 18%, transparent); }
.cal i.future { background: var(--surface-2); opacity: .35; }
.cal i.today { box-shadow: inset 0 0 0 2px var(--text); }
.cal-key { margin-top: 14px; font-size: 13px; color: var(--muted); gap: 6px 16px; }
.cal-key .k { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -1px; }
.cal-key .k.some { background: var(--accent-soft); border: 1px solid var(--accent); }
.cal-key .k.full { background: var(--accent); }
.cal-key .k.now { border: 2px solid var(--text); }
.pg-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.spark { width: 100%; height: 70px; display: block; margin: 10px 0 6px; overflow: visible; }
.pg-chart .top { display: flex; align-items: center; gap: 10px; }
.pg-chart .val { font-size: 28px; line-height: 1.3; }
.pg-chart .val small { font-size: 14px; font-weight: 500; color: var(--muted); }
.pg-chart .foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.pg-delta { font-size: 12.5px; font-weight: 600; padding: 1px 9px; border-radius: 99px; }
.pg-delta.up { background: var(--ok-soft); color: var(--ok); }
.pg-delta.down { background: var(--bad-soft); color: var(--bad); }
.pg .badges { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); }
.pg .badge { opacity: 1; padding: 16px 12px 14px; display: flex; flex-direction: column; align-items: center; }
.pg .badge .ico { font-size: 30px; line-height: 1.3; }
.pg .badge span { margin-top: 2px; }
.pg .badge:not(.got) .ico { filter: grayscale(1); opacity: .45; }
.pg .badge:not(.got) b { color: var(--muted); }
.pg .badge.got { border-color: var(--accent); background-image: linear-gradient(180deg, var(--accent-soft), transparent 75%); }
.pg .badge.got span { color: var(--accent); }
.pg .badge .bar { width: 100%; height: 5px; margin-top: 10px; }
.pg .badge small { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pg-ranks { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.pg-rank { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 4px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.pg-rank .ico { font-size: 26px; line-height: 1.3; filter: grayscale(1); opacity: .45; }
.pg-rank b { font-size: 13.5px; color: var(--muted); }
.pg-rank small { font-size: 11.5px; color: var(--muted); }
.pg-rank.done .ico, .pg-rank.cur .ico { filter: none; opacity: 1; }
.pg-rank.done b, .pg-rank.cur b { color: var(--text); }
.pg-rank.cur { border-color: var(--accent); background-image: linear-gradient(180deg, var(--accent-soft), transparent 75%); }
.pg-rank .pill { font-size: 11px; margin-top: 6px; padding: 1px 8px; }
.pg-rank .tick { margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--ok); }
.item.more h3 { font-size: 16.5px; }
/* ───────── صفحة الزائر الجديد ───────── */
.landing { max-width: 1080px; margin: 0 auto; padding: 18px clamp(16px, 4vw, 40px) 50px; }
.l-top { display: flex; align-items: center; gap: 8px; }
.l-top .brand { padding: 0; }
.l-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; padding: clamp(36px, 8vh, 90px) 0 clamp(30px, 6vh, 60px); }
.l-hero h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.2; letter-spacing: -1px; margin: 16px 0 14px; }
.l-hero h1 em { font-style: normal; color: var(--accent); }
.l-hero p { color: var(--muted); font-size: clamp(16px, 1.8vw, 19px); max-width: 46ch; margin-bottom: 22px; }
.l-hero small { display: block; margin-top: 12px; }
.l-cta { padding: 14px 26px; font-size: 17px; }
.l-demo { padding: clamp(22px, 3vw, 34px); direction: ltr; box-shadow: var(--shadow); }
.l-gloss { display: flex; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.l-gloss b { font-family: var(--en); font-size: 20px; }
.l-gloss span { color: var(--accent); font-size: 17px; }
.l-sent { font-family: var(--en); font-weight: 700; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.3; color: var(--faint); }
.l-sent i { font-style: normal; color: var(--text); }
.l-sent u { text-decoration: none; position: relative; }
.l-sent u::after { content: ''; position: absolute; left: 0; right: 0; bottom: -.04em; height: .075em; background: var(--accent); border-radius: 3px; animation: blink 1.1s steps(2) infinite; }
.l-ar { direction: rtl; text-align: left; color: var(--muted); font-size: 18px; }
.l-feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.l-feats .ico { font-size: 26px; }
.l-feats b { display: block; font-size: 16.5px; margin: 6px 0 4px; }
.l-feats p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.l-foot { text-align: center; margin-top: 30px; font-size: 14px; }
/* ───────── لوحة المطوّر ───────── */
.a-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 110px; align-items: end; direction: ltr; }
.a-days div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.a-days i { width: 100%; max-width: 30px; background: var(--accent); border-radius: 6px 6px 2px 2px; }
.a-days span { font: 11px var(--en-ui); color: var(--muted); }
.a-form { display: flex; flex-direction: column; gap: 10px; }
.a-form select { width: auto; }
@media (max-width: 860px) {
  .l-hero { grid-template-columns: 1fr; }
  .l-feats { grid-template-columns: 1fr 1fr; }
  .charts { grid-template-columns: 1fr; }
  .pg-hero { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pat-head { flex-direction: column; gap: 10px; }
  .pat-key { align-self: flex-start; }
  .pat-ex { grid-template-columns: 1fr 1fr; }
  .l-feats { grid-template-columns: 1fr; }
  .l-top .btn { padding: 7px 10px; }
  .rank-ico { font-size: 34px; width: 62px; height: 62px; border-radius: 18px; }
  .rank-card { gap: 14px; }
  .pg-ranks { grid-template-columns: repeat(4, 1fr); }
  .pg .badges { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pg .badge { padding: 12px 6px 10px; }
  .pg .badge .ico { font-size: 26px; }
  .pg .badge b { font-size: 13px; line-height: 1.5; }
  .pg .badge span { font-size: 11.5px; }
  .pg-seg { grid-template-columns: repeat(2, 1fr); gap: 10px 8px; }
}

/* ───────── لوحة المطوّر (موسّعة) ───────── */
.reader.wide { max-width: 980px; }
.stat small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; line-height: 1.4; }
.a-days { height: 130px; gap: 4px; }
.a-days em { font: 600 10.5px var(--en-ui); font-style: normal; color: var(--muted); min-height: 12px; }
.a-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.a-two .card > b { display: block; margin-bottom: 10px; }
.a-bars { display: flex; flex-direction: column; gap: 9px; margin-bottom: 8px; }
.a-bar { display: grid; grid-template-columns: minmax(96px, 150px) 1fr 54px; gap: 10px; align-items: center; font-size: 14px; }
.a-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-bar > b { text-align: left; font-size: 14px; }
[dir='ltr'] .a-bar > b { text-align: right; }
.a-funnel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.a-funnel div { flex: 1 1 110px; background: var(--surface-2); border-radius: 14px; padding: 12px; text-align: center; }
.a-funnel div b { display: block; font-size: 24px; }
.a-funnel div span { font-size: 13px; color: var(--muted); }
.a-funnel div em { font-style: normal; color: var(--accent); font-weight: 600; margin-inline-start: 4px; }
.a-funnel > i { font-style: normal; color: var(--faint); }
.a-table-wrap { overflow: auto; padding: 0; max-height: 65vh; overscroll-behavior-inline: contain; }
.a-table-wrap .table { margin: 0; }
.a-table-wrap .table :is(th, td) { padding: 15px 14px; vertical-align: middle; }
.a-table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); white-space: nowrap; }
.a-users { table-layout: fixed; min-width: 860px; }
.a-users .a-col-user { width: 26%; }
.a-users .a-col-rank { width: 16%; }
.a-users .a-col-number { width: 8%; }
.a-users .a-col-time { width: 18%; }
.a-users .avatar { width: 36px; height: 36px; }
.a-user-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.a-user-identity > div { min-width: 0; }
.a-user-identity :is(b, small) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: inherit; }
.a-user-identity small { margin-top: 4px; font-size: 12px; }
.a-user-rank { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.a-user-time { font-size: 13px; white-space: nowrap; }
.a-user-toolbar { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 2fr); gap: 16px; align-items: end; margin-bottom: 18px; }
.a-user-search, .a-user-sort { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.a-user-search input { width: 100%; min-width: 0; }
.a-user-sort .seg { flex-wrap: wrap; align-self: flex-start; }
.a-user-sort .seg button { flex: 1 0 auto; }
.a-performance { min-width: 620px; }
.a-performance :is(th, td):first-child { width: 44%; }
.a-performance .cell-number { width: 14%; }
.a-table-hint { display: none; font-size: 12px; margin-bottom: 8px; }
@media (max-width: 860px) { .a-two { grid-template-columns: 1fr; } .a-funnel > i { display: none; } }

.a-bar span[dir] { text-align: start; }
[dir='rtl'] .a-bar span[dir='auto'] { text-align: right; }

/* مركز الإدارة: مكتبة قابلة للبحث ومحرّر مستقل عن تحميل الإحصاءات. */
.reader.admin-page { max-width: 1140px; }
.a-head, .a-section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.a-head { padding: 12px 0 24px; }
.a-head h1 { font-size: clamp(27px, 3.4vw, 36px); margin: 5px 0; }
.a-head p, .a-section-head p { margin: 5px 0 0; font-size: 14px; }
.a-eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; }
.a-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.a-status { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.a-nav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 24px; overflow-x: auto; }
.a-nav button { display: flex; align-items: center; gap: 8px; padding: 11px 14px; white-space: nowrap; color: var(--muted); border: 1px solid transparent; border-radius: 10px; background: transparent; font-weight: 600; }
.a-nav button.on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.a-nav small { padding: 1px 6px; background: var(--surface-2); border-radius: 5px; }
.a-quick { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); display: flex; gap: 18px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.a-quick h2 { margin: 5px 0 8px; font-size: 24px; }
.a-quick p { margin: 0; font-size: 14px; }
.a-quick-buttons, .a-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.a-section-head { margin-bottom: 18px; }
.a-section-head h2 { margin: 0; font-size: 21px; }
.a-library-stats { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.a-library-stats b { color: var(--text); font: 700 19px var(--en-ui); margin-inline-end: 5px; }
.a-filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(120px, 1fr)); gap: 12px; }
.a-filters label, .a-editor label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; min-width: 0; }
.a-filters input, .a-filters select, .a-editor input, .a-editor textarea, .a-editor select { width: 100%; min-width: 0; }
.admin-page input[type='search'] { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font: inherit; }
.admin-page input[type='search']:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.a-results { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin: 14px 0 10px; font-size: 13px; }
.a-catalog-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-height: 560px; overflow-y: auto; }
.a-content-row { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.a-content-row:last-child { border-bottom: 0; }
.a-content-row:hover { background: var(--surface-2); }
.a-content-row.is-hidden { border-inline-start: 3px solid var(--muted); }
.a-content-icon { font-size: 26px; width: 40px; text-align: center; flex-shrink: 0; }
.a-content-title { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.a-content-title b { font-size: 15px; text-align: right; }
[dir='ltr'] .a-content-title b { text-align: left; }
.a-content-title > span { font-size: 13px; }
.a-content-title small { font-size: 11px; }
.a-content-row .btn { font-size: 12px; padding: 7px 11px; }
.a-editor, .a-editor-empty { margin-top: 24px; }
.a-editor { scroll-margin-top: 24px; }
.a-editor fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.a-editor-grid { display: grid; grid-template-columns: 1fr 1fr 100px; gap: 14px; }
.a-editor-grid.two { grid-template-columns: 1fr 1fr; }
.a-editor textarea { font: 14px/1.9 var(--en-ui); text-align: left; resize: vertical; }
.a-editor summary { cursor: pointer; font-size: 14px; padding: 12px 0; }
.a-editor .a-checkbox { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.a-checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }
.a-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.a-note { font-size: 12px; font-weight: 400; line-height: 1.8; }
.a-preview-card { margin-top: 18px; padding: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; max-height: 500px; overflow: auto; }
.a-preview-card ol { padding-inline-start: 24px; }
.a-preview-card li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.a-preview-card li p { margin: 0 0 4px; }
.a-preview-card small { color: var(--muted); }
.a-errors { background: var(--bad-soft); color: var(--bad); padding: 16px 34px; border-radius: 10px; font-size: 13px; }
.a-danger-zone { border-top: 1px solid var(--line); margin-top: 20px; }
.a-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.a-guide h3 { font-size: 17px; margin: 8px 0; }
.a-guide p { font-size: 13px; line-height: 1.9; }
.a-guide code, .a-command code { display: block; font-size: 12px; color: var(--text); overflow-wrap: anywhere; text-align: left; margin: 10px 0; }
.a-command { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.a-command:last-child { border: 0; }
.a-command > div { min-width: 0; }
.a-command b { font-size: 13px; }
.a-command .btn { flex-shrink: 0; }
.a-error { margin-bottom: 20px; }
.a-pagination { margin: 16px 0; font-size: 13px; }
.a-privacy { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 16px; font-size: 12px; }
@media (max-width: 700px) {
  .a-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .a-nav button { justify-content: center; padding: 10px 8px; font-size: 13px; }
  .a-nav button:last-child { grid-column: 1 / -1; }
  .a-user-toolbar { grid-template-columns: 1fr; }
  .a-user-sort .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .a-user-sort .seg button { padding: 9px 6px; }
  .a-table-hint { display: block; }
  .a-table-wrap { max-height: 60vh; }
  .a-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-filters .a-search { grid-column: 1 / -1; }
  .a-content-row { flex-wrap: wrap; padding: 14px; gap: 10px; }
  .a-content-row .a-row-actions { width: 100%; padding-inline-start: 50px; }
  .a-guide-grid, .a-editor-grid.two { grid-template-columns: 1fr; }
  .a-editor-grid { grid-template-columns: 1fr 1fr; }
  .a-quick { padding: 18px; }
  .a-head-actions { width: 100%; }
  .a-command { align-items: flex-start; }
}

/* ───────── تبسيط: منطقة البدء وشريط أدوات النص ───────── */
.start { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.btn.big { align-self: flex-start; padding: 14px 30px; font-size: 17px; }
.alt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
a.chip-btn { text-decoration: none; }
.pass-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.nav a.sep { margin-top: 14px; }
.nav a.sep::before { content: ''; position: absolute; top: -8px; inset-inline: 12px; height: 1px; background: var(--line); }
.sum-actions .btn:first-child { min-width: 150px; }
@media (max-width: 860px) {
  #toast { bottom: 84px; }
  .btn.big { align-self: stretch; }
}

/* تبويبا صفحة الكلمات */
.seg a { padding: 6px 13px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
@media (pointer: coarse) { .seg a { padding: 9px 14px; } }

/* ───────── تحديد المستوى ───────── */
.pl { display: flex; flex-direction: column; gap: 12px; }
.pl > .row { gap: 10px; flex-wrap: wrap; }
.pl-ar { font-size: 22px; font-weight: 600; line-height: 1.6; }
.pl .chip-btn { align-self: flex-start; }
#pl-in { width: 100%; font-size: 19px; padding: 14px 16px; }
.pl-fb { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bad-soft); }
.pl-fb.ok { background: var(--ok-soft); }
.pl-fb b { color: var(--bad); } .pl-fb.ok b { color: var(--ok); }
.pl-fb .en { font-size: 18px; }
.pl-lv { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.pl-lv div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); color: var(--muted); }
.pl-lv div.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.pl-lv b { font-size: 20px; } .pl-lv span { font-size: 13px; }

/* ───────── تحليل الأخطاء ───────── */
.mis { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.mis > .row { gap: 8px; flex-wrap: wrap; }
.mis .ico { font-size: 22px; }
.mis p { margin: 0; font-size: 14.5px; }
.mis .missed { margin: 0; }
.mis .btn { align-self: flex-start; }
.missed u { text-decoration: none; color: var(--accent); font-weight: 700; border-bottom: 2px solid var(--accent); }
.kbd { display: inline-block; min-width: 28px; text-align: center; padding: 1px 8px; margin: 0 3px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); }

/* ───────── كتابة حرة ───────── */
.w-card { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.w-card > .row { gap: 10px; flex-wrap: wrap; }
.w-q { font-size: 21px; font-weight: 700; line-height: 1.4; text-align: left; }
#w-text { min-height: 190px; font-size: 17px; line-height: 1.7; text-align: left; }
.w-res { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.w-text { text-align: left; white-space: pre-wrap; font-size: 17px; line-height: 1.9; padding: 14px 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); overflow-wrap: anywhere; }
.w-fixed { border-color: var(--ok); }
.w-text mark { color: inherit; padding: 1px 3px; border-radius: 5px; }
mark.m-sp { background: var(--bad-soft); box-shadow: inset 0 -2px var(--bad); }
mark.m-gr { background: var(--accent-soft); box-shadow: inset 0 -2px var(--accent); }
mark.m-pn { background: var(--ok-soft); box-shadow: inset 0 -2px var(--ok); }
.pill.sp { background: var(--bad-soft); color: var(--bad); }
.pill.gr { background: var(--accent-soft); color: var(--accent); }
.pill.pn { background: var(--ok-soft); color: var(--ok); }
.w-list { display: flex; flex-direction: column; }
.w-iss { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.w-iss:last-child { border-bottom: 0; }
.w-iss s { color: var(--muted); }
.w-iss small { flex: 1 1 160px; }
button.w-old { width: 100%; text-align: start; cursor: pointer; font: inherit; color: inherit; }
.w-old h3 { font-family: var(--en-ui); direction: ltr; text-align: left; font-size: 15.5px; }
.page-head.row { align-items: center; gap: 10px; }
@media (max-width: 860px) {
  .pl-ar { font-size: 19px; }
  .w-q { font-size: 18px; }
}

/* مساحة الكتابة الحرة */
.w-workspace { max-width: 1080px; margin-inline: auto; }
main#view:has(.w-workspace) { max-width: 1320px; }
.w-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.w-eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.w-heading h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.45; letter-spacing: -1.4px; }
.w-heading-dot { color: var(--accent); margin-inline-start: 3px; }
.w-heading p { color: var(--muted); font-size: 15px; }
.w-heading-icon { display: grid; place-items: center; width: 76px; height: 76px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 24px; transform: rotate(-7deg); }
.w-heading-icon svg { width: 32px; height: 32px; }
.w-heading-icon, .w-bottom-note { color: var(--accent); }
.w-levels { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.w-levels > span { font-size: 13px; color: var(--muted); }
.w-levels .tabs { margin: 0; gap: 6px; }
.w-levels .tabs button { padding: 7px 12px; font-size: 13px; }
.w-levels .tabs small { margin-inline-start: 7px; }
.w-prompt { padding: 20px 24px; border: 1px solid var(--line); border-inline-start: 3px solid var(--accent); border-radius: 14px; background: linear-gradient(115deg, var(--surface), var(--surface-2)); margin-bottom: 22px; }
.w-prompt-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.w-prompt-top .chip-btn { padding: 4px 10px; font-size: 12px; background: var(--surface); }
.w-prompt .w-q { font-family: var(--en); font-size: clamp(19px, 2vw, 24px); font-weight: 500; line-height: 1.5; }
.w-prompt-ar { margin-top: 6px; font-size: 14px; color: var(--muted); }
.w-prompt-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 17px; color: var(--muted); font-size: 11.5px; }
.w-goal-label b { color: var(--accent); margin-inline: 3px; }
.w-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 20px; }
.w-editor, .w-review { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.w-editor:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.w-editor-toolbar, .w-review-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.w-editor h2, .w-review h2 { font-size: 14px; font-weight: 600; }
.w-tool-actions { display: flex; gap: 6px; }
.w-tool { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.w-tool:hover, .w-tool[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); }
.w-tool svg, .w-check svg { width: 18px; height: 18px; flex-shrink: 0; }
.w-workspace #w-text { display: block; width: 100%; min-height: 340px; padding: 24px; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 18px; line-height: 1.95; resize: vertical; outline: none; box-shadow: none; }
.w-workspace #w-text::placeholder { color: var(--faint); font-family: var(--en); font-size: 22px; line-height: 1.8; }
.w-editor-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 22px 14px; font-size: 11px; color: var(--muted); }
.w-editor-meta > .en { white-space: nowrap; font-size: 12px; }
.w-editor-meta b { color: var(--text); }
.w-progress { appearance: none; display: block; width: 100%; height: 3px; border: 0; background: var(--line); color: var(--accent); }
.w-progress::-webkit-progress-bar { background: var(--line); }
.w-progress::-webkit-progress-value { background: var(--accent); transition: width .2s; }
.w-progress::-moz-progress-bar { background: var(--accent); }
.w-editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; background: var(--surface-2); }
.w-editor-footer small { font-size: 11px; color: var(--muted); }
.w-shortcut { display: block; width: fit-content; font-size: 10px; margin-top: 3px; color: var(--faint); }
.w-check { white-space: nowrap; font-size: 13px; padding: 11px 16px; }
.w-error { color: var(--bad); font-size: 13px; padding: 0 20px; }
.w-error:not(:empty) { padding-block: 12px; }
.w-review-header { padding: 19px 18px; }
.w-review-header .pill { font-size: 10px; }
.w-empty { text-align: center; padding: 40px 24px 32px; }
.w-empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 20px; border: 1px dashed var(--faint); border-radius: 16px; color: var(--accent); background: var(--accent-soft); }
.w-empty-icon svg { width: 25px; height: 25px; }
.w-empty h3 { font-size: 16px; margin-bottom: 10px; }
.w-empty p { color: var(--muted); font-size: 13px; line-height: 1.9; }
.w-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; margin-top: 30px; font-size: 11px; color: var(--muted); }
.w-legend span::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-inline-end: 5px; }
.w-legend .sp::before { background: var(--bad); }
.w-legend .gr::before { background: var(--accent); }
.w-review-note { padding: 16px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.9; }
.w-review-summary { display: flex; align-items: center; gap: 12px; padding: 18px; }
.w-review-summary > b { font-size: 35px; font-weight: 500; color: var(--accent); }
.w-review-summary strong { font-size: 13px; }
.w-review-summary p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.w-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 14px; border-bottom: 1px solid var(--line); }
.w-filters button { display: flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; font-size: 10px; color: var(--muted); }
.w-filters .on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.w-suggestions { max-height: 460px; overflow-y: auto; scrollbar-width: thin; }
.w-suggestion { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.w-suggestion:last-child { border-bottom: 0; }
.w-suggestion > .pill { font-size: 10px; padding: 1px 8px; }
.w-change { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-block: 9px; font-size: 16px; overflow-wrap: anywhere; }
.w-change s { color: var(--muted); text-decoration-color: var(--bad); }
.w-change b { color: var(--ok); font-weight: 600; }
.w-suggestion > p { font-size: 12px; color: var(--muted); }
.w-suggestion-actions { display: flex; gap: 10px; margin-top: 12px; }
.w-suggestion-actions button { border: 1px solid var(--line); border-radius: 6px; padding: 3px 12px; font-size: 11px; color: var(--muted); }
.w-suggestion-actions button:first-child { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.w-restore { display: block; margin: 12px auto; text-decoration: underline; color: var(--muted); font-size: 11px; }
.w-filter-empty { padding: 20px; font-size: 13px; color: var(--muted); }
.w-result { margin-top: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 24px; }
.w-result-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.w-result h2 { font-size: 21px; margin-top: 4px; }
.w-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.w-comparison > div { min-width: 0; }
.w-comparison h3 { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 500; }
.w-comparison .w-text { font-size: 15px; min-height: 120px; max-height: 380px; overflow-y: auto; }
.w-result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.w-result-actions .btn { font-size: 12px; padding: 9px 14px; }
.w-practice-link { font-size: 12px; color: var(--accent); margin-inline-start: auto; }
.w-history { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.w-history summary { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 16px; }
.w-history summary::before { content: '+'; color: var(--muted); }
.w-history[open] summary::before { content: '−'; }
.w-history-hint { font-size: 12px; margin: 8px 0 14px; }
.w-history-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.w-history-grid .w-old { display: flex; align-items: center; gap: 12px; text-align: start; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
.w-history-grid .w-old:hover { border-color: var(--faint); background: var(--surface-2); }
.w-history-grid .w-old > div { min-width: 0; flex: 1; }
.w-history-grid .w-old h3 { font-size: 12px; font-weight: 500; line-height: 1.6; overflow-wrap: anywhere; }
.w-history-grid .w-old p { color: var(--muted); font-size: 10px; margin-top: 6px; }
.w-history-number { color: var(--faint); font-size: 19px; }
.w-history-empty { padding-block: 18px; font-size: 13px; }
.w-bottom-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 30px; font-size: 11px; color: var(--muted); }
.w-bottom-note svg { width: 14px; height: 14px; }
.w-bottom-note > span { display: flex; color: var(--ok); }
.w-focused .w-prompt, .w-focused .w-levels, .w-focused .w-review, .w-focused .w-history, .w-focused .w-bottom-note { display: none; }
.w-focused .w-layout { grid-template-columns: minmax(0, 1fr); max-width: 780px; margin-inline: auto; }
.w-focused #w-text { min-height: 58vh; }
@media (max-width: 1100px) and (min-width: 861px) {
  .w-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; }
  .w-editor-footer { flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .w-heading { margin-bottom: 22px; gap: 12px; }
  .w-heading-icon { width: 52px; height: 52px; border-radius: 16px; }
  .w-heading-icon svg { width: 24px; height: 24px; }
  .w-heading p { font-size: 12px; }
  .w-levels { display: block; }
  .w-levels > span { display: block; margin-bottom: 8px; }
  .w-levels .tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; }
  .w-levels .tabs button { padding: 7px 4px; font-size: 11px; }
  .w-levels .tabs small { display: block; margin: 0; font-size: 10px; }
  .w-prompt { padding: 16px; }
  .w-prompt-foot { font-size: 11px; }
  .w-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .w-workspace #w-text { min-height: 300px; padding: 20px; font-size: 17px; }
  .w-editor-footer { flex-wrap: wrap; padding: 15px; }
  .w-editor-footer small { font-size: 10px; }
  .w-check { padding: 10px 13px; font-size: 12px; }
  .w-empty { padding: 24px; }
  .w-empty-icon { margin-bottom: 12px; }
  .w-legend { margin-top: 18px; }
  .w-result { padding: 18px; }
  .w-result h2 { font-size: 18px; }
  .w-comparison, .w-history-grid { grid-template-columns: minmax(0, 1fr); }
  .w-result-actions .btn { flex: 1; }
  .w-practice-link { width: 100%; text-align: center; margin: 8px 0 0; }
  .w-suggestions { max-height: 410px; }
}
@media (prefers-reduced-motion: reduce) { .w-progress::-webkit-progress-value { transition: none; } }

/* شريط أدوات التمرين على الجوال: تدرّج عند الحافة يدل على أن الشريط يُسحب */
@media (max-width: 860px) {
  .p-tools { -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); mask-image: linear-gradient(to left, #000 88%, transparent); padding-inline-end: 24px; }
}
.l-hero small .link { font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* ───────── حيل الكلمات: الفهرس والتدريب الشامل ───────── */
.pat { scroll-margin-top: 76px; }
.pat-index { display: flex; flex-wrap: wrap; gap: 7px; direction: ltr; justify-content: flex-end; }
.pat-index .chip-btn { padding: 5px 11px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.mixcard { border-color: var(--accent); background: var(--accent-soft); margin-top: 18px; }
.mixcard .stars { margin-inline-end: 4px; }
.invite b span { color: inherit; font-size: inherit; }


/* نص لقارئات الشاشة فقط */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* مفتاح الإعداد: مساحة لمس أكبر من شكله الظاهر */
.switch::before { content: ''; position: absolute; inset: -10px -6px; }
/* الرئيسية: اختصارات الأقسام */
.home-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-quick .quick { display: flex; align-items: center; gap: 12px; padding: 14px 16px; transition: border-color .15s, transform .15s; }
.home-quick .quick:hover { border-color: var(--accent); transform: translateY(-1px); }
.home-quick .ico { font-size: 26px; flex: none; }
.home-quick .quick > span:last-child { min-width: 0; }
.home-quick b { display: block; font-size: 15px; }
.home-quick small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* تبويبات المستويات: عدد المكتمل تحت اسم المستوى على الشاشات الضيقة */
.tabs button .pill { font-size: 11.5px; padding: 1px 7px; }
@media (max-width: 860px) { .home-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .home-quick { gap: 8px; }
  .home-quick .quick { padding: 12px; gap: 10px; }
  .home-quick .ico { font-size: 22px; }
  .tabs button .pill { display: block; width: max-content; margin: 4px auto 0; }
}
@media (prefers-reduced-motion: reduce) { .home-quick .quick:hover { transform: none; } }
/* مكتبة الألعاب */
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.game-mode { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.game-mode .row { justify-content: space-between; }
.game-mode-icon { font-size: 36px; }
.game-mode h2 { margin: 0; font-size: 24px; }
.game-mode p { margin: 0; line-height: 1.8; flex: 1; }
.game-mode .btn { text-align: center; justify-content: center; }
.games-note { margin-top: 18px; }
@media (max-width: 600px) { .games-grid { grid-template-columns: 1fr; } }

.hunt-card { display: flex; flex-direction: column; gap: 16px; }
.hunt-card p { margin: 0; }
.hunt-meta { justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.hunt-sentence { font-size: clamp(22px, 4vw, 30px); line-height: 1.6; overflow-wrap: anywhere; }
.hunt-answer { width: 100%; min-width: 0; font-size: 18px; }
.hunt-feedback { background: var(--accent-soft); border-radius: 12px; padding: 16px; line-height: 1.8; }
.hunt-feedback p { margin: 8px 0 0; }
.hunt-feedback.hunt-ok { background: var(--ok-soft); }
.hunt-review { display: grid; gap: 12px; }
.hunt-results { display: grid; gap: 16px; }
.hunt-results .row { flex-wrap: wrap; overflow-wrap: anywhere; }
.creative-intro, .creative-editor, .creative-list { display: grid; gap: 16px; }
.creative-intro p, .creative-editor p { margin: 0; }
.creative-editor { margin-top: 16px; }
.creative-editor textarea { width: 100%; min-width: 0; min-height: 130px; font-size: 18px; line-height: 1.7; }
.creative-story, .creative-prompt { margin-bottom: 16px; overflow-wrap: anywhere; }
.creative-opening { font-size: 22px; color: var(--accent); line-height: 1.7; }
.creative-line { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; overflow-wrap: anywhere; }
.creative-line p { font-size: 18px; line-height: 1.7; }
#creative-error { color: var(--bad); }

/* صيد الأخطاء: شريط الوقت وتظليل الكلمة المصحَّحة */
.hunt-bar { direction: ltr; }
.hunt-bar i { transition: width .2s linear; }
.hunt-bar.low i { background: var(--bad); }
.hunt-feedback mark { background: var(--ok-soft); color: inherit; box-shadow: inset 0 -2px var(--ok); padding: 1px 4px; border-radius: 5px; font-weight: 700; }
.hunt-review .card p { margin: 0 0 8px; }
.hunt-sentence { font-weight: 600; }

/* Connection feedback is shared by room screens and the typing player. */
.game-connection { border-color: var(--bad); margin: 12px auto; max-width: 900px; padding: 12px 16px; }
.game-connection[hidden] { display: none; }
.game-connection .btn { margin-inline-start: 8px; }
[data-player-state] { margin-inline-end: 8px; }

/* مكتبة الألعاب: ما تدرّبه كل لعبة، أرقام اللاعب، وزرّا الفردي والأصدقاء */
.game-mode h2 a { color: inherit; text-decoration: none; }
.game-mode h2 a:hover { color: var(--accent); }
.game-mode-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.game-mode-meta .lock { color: var(--accent); }
.game-mode .game-mode-stat { flex: none; font-size: 14px; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; line-height: 1.6; }
.game-mode-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-steps { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.game-best { margin: 0; font-size: 15px; }
.game-record { color: var(--ok); font-weight: 700; margin: 8px 0 0; }
.race-place { margin: 8px 0 0; font-size: 14.5px; }
.ch-pick { gap: 8px; }
.ch-pick select { flex: 1; min-width: 0; }
.ch-pick .chip-btn { flex-shrink: 0; cursor: pointer; }

/* صيد الأخطاء: نقاط الجولات وكلمات قابلة للضغط */
.hunt-dots { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.hunt-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); }
.hunt-dots i.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hunt-dots i.ok { background: var(--ok); border-color: var(--ok); }
.hunt-dots i.bad { background: var(--bad); border-color: var(--bad); }
.hunt-dots.big { margin: 4px 0 18px; }
.hunt-dots.big i { width: 16px; height: 16px; }
.hunt-sentence .hw { font: inherit; color: inherit; background: none; border: 0; border-bottom: 2px dashed var(--line); border-radius: 6px 6px 0 0; padding: 0 3px; margin: 2px 0; cursor: pointer; transition: background .15s, border-color .15s; }
.hunt-sentence .hw:hover, .hunt-sentence .hw:focus-visible { background: var(--accent-soft); border-bottom-color: var(--accent); outline: none; }
.hunt-sentence .hw.on { background: var(--accent-soft); border-bottom: 2px solid var(--accent); color: var(--accent); }

/* ألعاب الكتابة: كلمات الربط، العدّاد الحيّ، والأفكار البديلة */
.creative-story-head { margin-bottom: 10px; }
.creative-story-head .chip-btn, .creative-starters .chip-btn, .creative-alts .chip-btn { cursor: pointer; }
.creative-starters { display: flex; flex-wrap: wrap; gap: 6px; }
.creative-starters .chip-btn, .creative-alts .chip-btn { padding: 5px 11px; font-size: 14px; }
.creative-meter { gap: 10px; flex-wrap: wrap; }
#creative-count { font-weight: 700; color: var(--muted); }
#creative-count.ok { color: var(--ok); }
#creative-count.bad { color: var(--bad); }
.creative-alts { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.creative-alts summary { cursor: pointer; color: var(--accent); font-size: 14.5px; }
.creative-alts p { margin: 12px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 600px) { .game-mode-actions { grid-template-columns: 1fr; } }
/* ───────── الطباعة باللمس ───────── */
.kb { --k: clamp(20px, 5.6vw, 46px); display: flex; flex-direction: column; gap: calc(var(--k) * .12); align-items: flex-start; width: max-content; max-width: 100%; margin: 0 auto; font-family: var(--en-ui); user-select: none; }
.kb-row { display: flex; gap: calc(var(--k) * .12); }
.kb-row.r1 { padding-left: calc(var(--k) * .5); }
.kb-row.r2 { padding-left: calc(var(--k) * .8); }
.kb-row:last-child { align-self: center; }
.kb .k { width: var(--k); height: var(--k); display: grid; place-items: center; position: relative; border-radius: calc(var(--k) * .18); font-style: normal; font-weight: 600; font-size: calc(var(--k) * .36); line-height: 1; color: var(--text); background: var(--fc, var(--surface)); border: 1px solid var(--line); }
.kb .k small { position: absolute; top: 8%; left: 14%; font-size: .68em; opacity: .6; }
.kb .k.wide { width: calc(var(--k) * 1.35); font-size: calc(var(--k) * .24); color: var(--muted); }
.kb .k.space { width: calc(var(--k) * 6); font-size: calc(var(--k) * .26); color: var(--muted); }
.kb .k.home::after { content: ''; position: absolute; bottom: 14%; width: 26%; height: 2px; border-radius: 2px; background: currentColor; opacity: .7; }
.kb .k.next { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 0 0 3px var(--accent-soft); }
.kb .k.bad { background: var(--bad); color: #fff; border-color: var(--bad); }
/* لون لكل إصبع، واليدان متناظرتان */
.f0, .f7 { --fc: rgba(232, 121, 249, .16); --fd: #e879f9; }
.f1, .f6 { --fc: rgba(96, 165, 250, .16); --fd: #60a5fa; }
.f2, .f5 { --fc: rgba(79, 209, 165, .16); --fd: #4fd1a5; }
.f3, .f4 { --fc: rgba(251, 146, 60, .18); --fd: #fb923c; }
.f8 { --fc: rgba(148, 163, 184, .16); --fd: #94a3b8; }
.tt .dot, .tt-fingers .dot { position: static; display: inline-block; width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--fd); vertical-align: middle; }
.tt .tt-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px 0; }
.tt-hint { min-height: 34px; display: flex; align-items: center; gap: 8px; font-size: 16px; }
.tt-hint .kbd { font-size: 18px; min-width: 38px; padding: 3px 10px; }
.tt-line { font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: clamp(22px, 3.6vw, 38px); line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.tt-line .c { color: var(--faint); border-bottom: 3px solid transparent; }
.tt-line .c.done { color: var(--ok); }
.tt-line .c.cur { color: var(--text); border-bottom-color: var(--accent); }
.tt-line .c.sp.cur { background: var(--accent-soft); }
.tt-line .c.bad { color: var(--bad); animation: shake .22s; }
.tt-next { font-family: ui-monospace, 'Cascadia Mono', Consolas, Menlo, monospace; font-size: 16px; min-height: 24px; opacity: .55; text-align: center; }
.tt-touch { display: none; text-align: center; font-size: 14px; margin-top: 12px; }
@media (hover: none) and (pointer: coarse) { .tt-touch { display: block; } }
.tt-hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-bottom: 26px; }
.tt-speed { display: flex; flex-direction: column; gap: 10px; }
.tt-speed p { margin: 0; flex: 1; font-size: 14.5px; }
.tt-best b { font-size: 26px; }
.tt-rules { display: flex; flex-direction: column; gap: 12px; }
.tt-rules ol { margin: 0; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 6px; }
.tt-legend .kb, .tt-preview .kb { --k: clamp(18px, 4.6vw, 40px); }
.tt-fingers { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; font-size: 14px; color: var(--muted); }
.tt-fingers .dot { margin-inline-end: 6px; }
.tt-preview { margin: 16px 0; overflow: hidden; }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tt-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; text-align: center; transition: border-color .15s; }
.tt-item:hover, .tt-item.cur { border-color: var(--accent); }
.tt-item.done .tt-keys { color: var(--ok); }
.tt-keys { font-size: 24px; font-weight: 700; letter-spacing: 2px; }
.tt-name { font-size: 14px; }
@media (max-width: 860px) { .tt-line { font-size: clamp(19px, 5.4vw, 28px); } }

/* مسار واضح: توصية واحدة، موضع اليدين، ثم مراحل يمكن فتحها للمراجعة. */
.tt-course .page-head { margin-bottom: 22px; }
.tt-recommended { border-color: var(--accent); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 80%); }
.tt-recommended h2 { font-size: 27px; margin: 10px 0; }
.tt-recommended p { margin: 10px 0 18px; }
.tt-progress-card { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.tt-progress-number { display: flex; gap: 10px; align-items: baseline; margin: 0; }
.tt-progress-number b { font: 700 42px var(--en-ui); }
.tt-progress-number span { color: var(--muted); }
.tt-progress-card p.muted { font-size: 14px; margin: 0; }
.tt-progress-card progress { width: 100%; height: 8px; border: 0; border-radius: 20px; background: var(--surface-2); accent-color: var(--accent); }
.tt-progress-card progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 20px; }
.tt-progress-card progress::-webkit-progress-value { background: var(--accent); border-radius: 20px; }
.tt-progress-card progress::-moz-progress-bar { background: var(--accent); border-radius: 20px; }
.tt-setup { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 0 16px; }
.tt-setup b { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.tt-setup b span, .tt-stage-number { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-family: var(--en-ui); }
.tt-setup p { color: var(--muted); font-size: 14px; margin: 8px 0; }
.tt-hand-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.tt-hand-guide h3 { text-align: center; font-size: 15px; margin: 0 0 12px; }
.tt-hand-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tt-hand-keys > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tt-hand-keys .kbd { border-top: 3px solid var(--fd); padding: 8px 0; width: 100%; max-width: 58px; text-align: center; font-size: 21px; }
.tt-hand-keys span { font-size: 12px; color: var(--muted); }
.tt-thumb { text-align: center; font-size: 14px; margin: 4px 0; }
.tt-hands { margin: 0 auto; width: min(100%, 300px); }
.tt-hands-titles { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; text-align: center; font-size: 14px; margin-bottom: 12px; }
.tt-hands-svg { display: block; width: 100%; height: auto; overflow: visible; }
.tt-hands-svg text { text-anchor: middle; font-family: var(--en-ui); font-size: 12px; font-weight: 600; fill: var(--text); }
.tt-hand-keyboard { fill: var(--surface-2); stroke: var(--line); }
.tt-hand-key rect { fill: var(--fc, var(--surface)); stroke: var(--fd, var(--line)); stroke-opacity: .5; }
.tt-hand-palm { fill: var(--surface-2); }
.tt-hand-outline { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-linejoin: round; }
.tt-hand-crease { fill: none; stroke: var(--line); stroke-width: 1.5; stroke-linecap: round; }
.tt-hand-digit { fill: var(--fc); stroke: var(--fd); stroke-width: 1; stroke-opacity: .35; }
.tt-hand-link { fill: none; stroke: var(--fd); stroke-width: 1.4; stroke-dasharray: 3 4; opacity: .65; }
.tt-hand-mark circle { fill: var(--surface); stroke: var(--fd); stroke-opacity: .7; }
.tt-hand-mark text { font-size: 11px; }
.tt-hand-digit.is-active { fill: var(--fd); fill-opacity: .4; stroke-width: 2.5; stroke-opacity: 1; }
.tt-hand-mark.is-active circle { fill: var(--fd); stroke: var(--text); stroke-width: 2; }
.tt-hand-mark.is-active text { fill: var(--bg); font-weight: 800; }
.tt-hands figcaption { font-size: 13px; text-align: center; color: var(--muted); margin: 4px 0 12px; }
#tt-kbwrap { width: 100%; }
/* شاشة التمرين: الكيبورد ولوحة اليدين زوج واحد في الوسط، واليدان على اليمين بحجم يُقرأ من أول نظرة */
.player.tt { max-width: 1240px; }
.tt #tt-kbwrap { --hw: clamp(290px, min(31vw, 44vh), 400px); display: grid; grid-template-columns: auto var(--hw); justify-content: center; align-items: center; gap: clamp(20px, 3vw, 44px); }
[dir="rtl"] .tt #tt-kbwrap { grid-template-columns: var(--hw) auto; }
[dir="rtl"] .tt #tt-kbwrap .tt-hands { order: -1; }
.tt #tt-kbwrap .kb { --k: clamp(17px, 3.3vw, 44px); margin: 0; }
.tt [hidden] { display: none !important; }
.tt .tt-hands { width: 100%; margin: 0; padding: 12px 14px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.tt .tt-hands-titles { margin-bottom: 4px; font-size: 13px; gap: 12px; }
.tt .tt-hands-titles b { color: var(--muted); transition: color .15s; }
.tt .tt-hands-titles b:not(.is-idle) { color: var(--text); }
.tt .tt-hands-svg [data-tt-hand] { transition: opacity .15s; }
.tt .tt-hands-svg [data-tt-hand].is-idle { opacity: .5; }
.tt .tt-hand-mark text { font-size: 12.5px; }
.tt .tt-hand-digit.is-active { fill-opacity: .6; }
.tt .tt-hand-mark.is-active circle { animation: tt-finger 1.2s ease-in-out infinite; }
@keyframes tt-finger { 50% { stroke-width: 5; stroke-opacity: .45; } }
.tt .tt-hands figcaption { min-height: 26px; display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; margin: 6px 0 0; font-size: 13.5px; }
.tt .tt-hands figcaption b { color: var(--text); font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .tt .tt-hand-mark.is-active circle { animation: none; } }
/* اللوحة واليدان متجاورتان، فتظهر الصفحة كلها دون تمرير طويل */
.tt-preview { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; gap: 20px; }
.tt-preview .kb { --k: clamp(18px, 3.3vw, 31px); }
.tt-preview .tt-hands { max-width: 220px; margin: 0; }
.tt-preview .tt-hands-titles, .tt-home .tt-hands-titles { margin-bottom: 6px; font-size: 12px; gap: 12px; }
.tt-preview .tt-hands figcaption { font-size: 12px; margin-bottom: 0; }
.tt-home { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: center; gap: 24px; }
.tt-home.solo { grid-template-columns: 1fr; }
.tt-home .tt-hands figcaption { margin-bottom: 0; }
.tt-lesson-nav { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.tt-lesson-nav span { display: flex; gap: 16px; }
.tt-lesson-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin: 10px 0 14px; }
.tt-lesson-head .page-head { margin: 0; }
.tt-start { margin: 0; flex-direction: row; align-items: center; flex-wrap: wrap; }
.tt-start span { font-size: 13px; }
.tt-lesson-head + .tt-lesson-goals { margin: 0 0 16px; }
.tt-foundation > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.tt-foundation > summary::-webkit-details-marker { display: none; }
.tt-foundation > summary h2 { margin: 0; }
.tt-foundation > summary::after { content: '+'; color: var(--muted); font-size: 22px; }
.tt-foundation[open] > summary::after { content: '−'; }
.tt-foundation[open] > summary { margin-bottom: 14px; }
.tt-test-how { margin-top: 14px; }
.tt-test-how summary { cursor: pointer; }
.tt-test-how ul { padding-inline-start: 22px; line-height: 2; margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.tt-test-intro .start { margin-bottom: 0; }
.tt-enter-hint { text-align: center; font-size: 13px; margin: 14px 0 0; }
@media (hover: none) and (pointer: coarse) { .tt-enter-hint, .tt-start span { display: none; } }
@media (max-width: 700px) {
  .tt-preview, .tt-home { grid-template-columns: 1fr; gap: 14px; }
  .tt-preview .kb { --k: clamp(18px, 5.2vw, 34px); }
  .tt-preview .tt-hands, .tt-home .tt-hands { max-width: 230px; margin: 0 auto; }
  .tt-start { width: 100%; }
  .tt-start .btn { flex: 1; }
}
@media (max-width: 860px) {
  .tt #tt-kbwrap, [dir="rtl"] .tt #tt-kbwrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tt #tt-kbwrap .kb { --k: clamp(17px, 4.8vw, 36px); margin: 0 auto; }
  .tt #tt-kbwrap .tt-hands, [dir="rtl"] .tt #tt-kbwrap .tt-hands { order: 0; width: min(100%, 320px); margin: 0 auto; }
}
.tt-keyboard-details { border-top: 1px solid var(--line); padding-top: 14px; }
.tt-keyboard-details summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.tt-keyboard-details .tt-legend { padding-top: 20px; }
.tt-keyboard-details p { font-size: 14px; margin-bottom: 0; }
.tt-path-heading { margin: 28px 0 14px; }
.tt-path-heading h2 { margin: 0 0 4px; }
.tt-path-heading > span { font-size: 14px; }
.tt-stage-card { margin-bottom: 12px; padding: 0; overflow: hidden; }
.tt-stage-card > summary { display: flex; align-items: center; gap: 12px; padding: 18px; cursor: pointer; list-style: none; }
.tt-stage-card > summary::-webkit-details-marker { display: none; }
.tt-stage-card > summary > span:nth-child(2) { flex: 1; min-width: 0; }
.tt-stage-card summary b { display: block; font-size: 16px; }
.tt-stage-card summary small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; font-weight: 400; }
.tt-stage-card summary::after { content: '+'; color: var(--muted); font-size: 23px; }
.tt-stage-card[open] > summary::after { content: '−'; }
.tt-stage-card .tt-grid { padding: 0 18px 18px; }
.tt-item { background: var(--surface-2); }
.tt-status { font-size: 12px; color: var(--muted); }
.tt-status.passed { color: var(--ok); }
.tt-speed { flex-direction: row; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; }
.tt-speed .btn { flex-shrink: 0; }
.tt-speed p { margin: 8px 0; }
.tt-finger-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.tt-finger-card { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tt-finger-card > .kbd { border-top: 3px solid var(--fd); font-size: 22px; min-width: 46px; text-align: center; }
.tt-finger-card b { font-size: 14px; }
.tt-finger-card small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.tt-lesson-goals { display: flex; gap: 10px 20px; flex-wrap: wrap; margin: 20px 0 0; font-size: 14px; color: var(--accent); }
.tt-howto { color: var(--muted); font-size: 15px; margin-top: 14px; }
.tt-test-intro ul { padding-inline-start: 22px; line-height: 2; margin-bottom: 24px; }
.tt-content { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; outline: none; }
.tt-content:focus-visible { outline: none; }
.tt-session-guide { text-align: center; font-size: 14px; margin: 0; }
.tt-hint { flex-wrap: wrap; justify-content: center; }
.tt-feedback { min-height: 48px; margin: 0; max-width: 610px; text-align: center; font-size: 14px; color: var(--muted); }
.tt-pause { text-align: center; width: min(460px, 100%); }
.tt-pause p { color: var(--muted); margin: 12px 0 22px; }
.tt-result-advice { text-align: center; color: var(--muted); font-size: 15px; margin: 18px 0; }
.tt-result-review { margin: 22px 0; border-top: 1px solid var(--line); padding-top: 18px; }
.tt-result-review h3 { font-size: 17px; }
.tt-result-review p { font-size: 14px; }
@media (max-width: 600px) {
  .tt-hero { grid-template-columns: 1fr; }
  .tt-setup { grid-template-columns: 1fr; gap: 8px; }
  .tt-hand-guide { gap: 14px; }
  .tt-hand-keys { gap: 4px; }
  .tt-hand-keys span { font-size: 11px; }
  .tt-rules { padding: 16px 12px; }
  .tt-speed { flex-direction: column; align-items: stretch; }
  .tt-stage-card > summary { padding: 14px 12px; gap: 8px; }
  .tt-stage-card summary small { font-size: 12px; }
  .tt-stage-card .tt-grid { padding: 0 12px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt .p-top { flex-wrap: wrap; gap: 8px; }
  .tt .p-top h1 { flex: 1; }
  .tt .p-top .bar { order: 1; flex: 0 0 100%; }
  .tt .kb { --k: clamp(17px, 4.8vw, 27px); }
  .tt-content { gap: 14px; }
  .tt-result-review .tt-finger-guide { grid-template-columns: 1fr; }
}

/* تحسينات التمرين: الكلمة لا تنكسر، وميض المفتاح المضغوط، وسلسلة الضغطات الصحيحة */
.tt-line .w { display: inline-block; white-space: pre; }
.tt-line .c.cur { animation: tt-caret 1.1s steps(1) infinite; }
@keyframes tt-caret { 50% { border-bottom-color: transparent; } }
.kb .k.hit { animation: tt-hit .22s ease-out; }
@keyframes tt-hit { from { background: var(--ok); color: #fff; transform: translateY(1px) scale(.94); } }
.tt-combo { transition: color .2s, background .2s; }
.tt-combo.hot { background: var(--accent-soft); color: var(--accent); }
.tt .p-top .count.low { color: var(--bad); font-weight: 700; }
.tt .p-top .chip-btn { flex-shrink: 0; }
.tt-result-extra { text-align: center; font-size: 14px; margin: 14px 0 0; }
.tt-good { color: var(--ok); }
/* المفاتيح الضعيفة والتمرين المخصص */
.tt-weak { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; border-color: var(--line); }
.tt-weak p { margin: 8px 0 12px; font-size: 14.5px; }
.tt-weak .btn { flex-shrink: 0; }
.tt-weak-keys { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.tt-weak-keys span { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.tt-weak-keys .kbd { border-top: 3px solid var(--fd); font-size: 19px; min-width: 44px; padding: 5px 8px; margin: 0; }
.tt-weak-keys small { font-size: 12px; color: var(--muted); }
[dir="ltr"] .tt-weak-keys { justify-content: flex-start; }
/* بطاقات الدروس: النجوم وأفضل سرعة */
.tt-stars { color: var(--accent); font-size: 13px; letter-spacing: 2px; }
.tt-stars i { font-style: normal; opacity: .25; }
/* اختبار السرعة: المدة ورسم التقدّم */
.tt-secs-title { font-size: 15px; margin: 0 0 10px; }
.tt-secs { margin-bottom: 10px; }
.tt-secs-best { font-size: 14px; margin: 0 0 14px; }
.tt-spark { margin: 0; flex: 0 0 200px; max-width: 100%; }
.tt-spark svg { display: block; width: 100%; height: auto; overflow: visible; }
.tt-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tt-spark circle { fill: var(--accent); }
.tt-spark figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 4px; }
.tt-test-intro .tt-spark { width: 240px; margin-bottom: 18px; }
@media (max-width: 600px) {
  .tt-weak { flex-direction: column; align-items: stretch; }
  .tt-weak-keys { justify-content: flex-start; }
  .tt-spark { flex-basis: auto; width: 100%; max-width: 260px; align-self: center; }
}
@media (prefers-reduced-motion: reduce) { .tt-line .c.cur, .kb .k.hit { animation: none; } }
.tt-line .c.cur.bad { animation: shake .22s; }
/* مكتبة النصوص الشخصية */
.c-workspace { max-width: 1080px; margin-inline: auto; }
main#view:has(.c-workspace) { max-width: 1320px; }
.c-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.c-eyebrow { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: .06em; }
.c-heading h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.45; letter-spacing: -1.2px; }
.c-heading h1 > span { color: var(--accent); margin-inline-start: 4px; }
.c-heading p { font-size: 15px; color: var(--muted); }
.c-heading-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 24px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); transform: rotate(-6deg); }
.c-heading-icon svg { width: 34px; height: 34px; }
.c-steps { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; margin: 0 0 26px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.c-steps span { display: flex; gap: 8px; align-items: center; }
.c-steps b { display: grid; place-items: center; font-family: var(--en-ui); font-size: 10px; border: 1px solid var(--line); border-radius: 50%; width: 25px; height: 25px; font-weight: 500; }
.c-steps .on { color: var(--text); }
.c-steps .on b { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.c-steps > i { height: 1px; width: 30px; background: var(--line); }
.c-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.c-editor, .c-preview { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.c-editor-head { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.c-editor-head h2 { font-size: 15px; font-weight: 600; }
.c-editor-actions { display: flex; align-items: center; gap: 8px; }
.c-editor-head .chip-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.c-editor-head svg { width: 15px; height: 15px; }
.c-import { position: relative; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); cursor: pointer; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.c-import:hover { color: var(--accent); border-color: var(--accent); }
.c-import:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.c-import input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; font-size: 0; }
.c-fields { padding: 20px 22px 16px; }
.c-fields label { display: block; font-size: 12px; margin-bottom: 7px; font-weight: 500; }
.c-fields label small { font-weight: 400; color: var(--muted); margin-inline-start: 6px; font-size: 10px; }
.c-fields #c-title { border-radius: 9px; font-size: 13px; padding: 10px 12px; background: var(--bg); }
.c-text-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 21px; }
.c-text-label > small { color: var(--muted); font-size: 10px; }
.c-workspace #c-text { font-size: 16px; line-height: 1.95; min-height: 270px; padding: 18px; border-radius: 11px; background: var(--bg); }
.c-workspace #c-text:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.c-workspace #c-text::placeholder { font-family: var(--en); font-size: 20px; color: var(--faint); line-height: 1.8; }
.c-editor-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; margin-top: 9px; }
.c-editor-meta > .en { white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-samples { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 18px; }
.c-samples[hidden] { display: none; }
.c-samples > span { font-size: 11px; color: var(--muted); margin-inline-end: 3px; }
.c-samples button { border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; font-size: 11px; }
.c-samples button:hover { border-color: var(--accent); color: var(--accent); }
.c-mode-section { padding: 17px 22px; border-top: 1px solid var(--line); }
.c-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.c-label-row h3 { font-size: 13px; font-weight: 500; }
.c-step-number { color: var(--faint); font-size: 12px; }
.c-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.c-mode { display: flex; gap: 10px; align-items: center; text-align: start; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.c-mode > svg { width: 21px; height: 21px; color: var(--muted); flex-shrink: 0; }
.c-mode > span { flex: 1; min-width: 0; }
.c-mode b { display: block; font-size: 13px; font-weight: 500; }
.c-mode small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.c-mode > i { width: 13px; height: 13px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--faint); }
.c-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.c-mode.on > svg, .c-mode.on b { color: var(--accent); }
.c-mode.on > i { border: 4px solid var(--accent); background: var(--surface); }
.c-editor-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 22px; background: var(--surface-2); border-top: 1px solid var(--line); }
.c-start { font-size: 12px; padding: 11px 15px; }
.c-start svg { width: 17px; height: 17px; }
[dir='rtl'] .c-start svg { transform: rotate(180deg); }
.c-save-only { color: var(--text); font-size: 12px; padding: 8px; }
.c-save-only:hover { color: var(--accent); }
.c-editor-footer > small { width: 100%; font-size: 10px; color: var(--muted); }
.c-error { color: var(--bad); font-size: 12px; }
.c-error:not(:empty), .c-edit-note { padding: 12px 22px; }
.c-edit-note { color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.c-preview-head { padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.c-preview-head h2 { font-size: 17px; margin-top: 4px; }
.c-preview-empty { text-align: center; padding: 30px 24px; }
.c-preview-empty > span { display: grid; place-items: center; color: var(--accent); margin: 0 auto 18px; border: 1px dashed var(--faint); background: var(--accent-soft); border-radius: 16px; width: 58px; height: 58px; }
.c-preview-empty svg { width: 26px; height: 26px; }
.c-preview-empty h3 { font-size: 15px; margin-bottom: 9px; }
.c-preview-empty p { font-size: 12px; color: var(--muted); line-height: 1.9; }
.c-preview-lines { padding: 22px 16px 0; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.c-preview-lines i { width: 100%; height: 4px; border-radius: 2px; background: var(--line); }
.c-preview-lines i:nth-child(2) { width: 80%; }
.c-preview-lines i:last-child { width: 60%; }
.c-preview-tip { border-top: 1px solid var(--line); padding: 18px 20px; background: color-mix(in srgb, var(--accent-soft) 30%, var(--surface)); }
.c-preview-tip b { color: var(--accent); font-size: 12px; font-weight: 500; }
.c-preview-tip p { font-size: 11px; line-height: 1.9; color: var(--muted); margin-top: 6px; }
.c-preview-stats { display: grid; grid-template-columns: 1fr 1fr; padding: 18px; }
.c-preview-stats > div { text-align: center; }
.c-preview-stats > div + div { border-inline-start: 1px solid var(--line); }
.c-preview-stats b { display: block; font-size: 29px; line-height: 1.3; font-weight: 500; color: var(--accent); }
.c-preview-stats span { font-size: 10px; color: var(--muted); }
.c-sentence-caption { font-size: 10px; color: var(--muted); padding: 0 18px 10px; }
.c-sentence-list { padding: 0 18px; margin: 0; list-style: none; max-height: 330px; overflow-y: auto; scrollbar-width: thin; }
.c-sentence-list li { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.c-sentence-list li > span { font-size: 10px; color: var(--faint); }
.c-sentence-list p { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.c-preview-warning { color: var(--bad); font-size: 11px; padding: 0 18px 14px; }
.c-more-sentences summary { color: var(--accent); font-size: 11px; cursor: pointer; padding: 12px 18px; }
.c-normalized-note { color: var(--muted); font-size: 10px; padding: 12px 18px; }
.c-library { margin-top: 36px; padding-top: 25px; border-top: 1px solid var(--line); }
.c-library-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.c-library-head h2 { font-size: 24px; margin-top: 4px; }
.c-library-head .pill { vertical-align: middle; margin-inline-start: 5px; }
.c-library-note { color: var(--muted); font-size: 11px; }
.c-library-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.c-search { display: flex; align-items: center; gap: 8px; background: var(--surface); padding-inline: 12px; border: 1px solid var(--line); border-radius: 9px; flex: 1; min-width: 180px; max-width: 330px; }
.c-search:focus-within { border-color: var(--accent); }
.c-search svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.c-search input { background: transparent; color: var(--text); border: 0; width: 100%; min-width: 0; padding: 10px 0; font: inherit; font-size: 12px; outline: none; }
.c-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.c-filters button { color: var(--muted); font-size: 11px; border-radius: 7px; padding: 7px 10px; border: 1px solid transparent; }
.c-filters button.on { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.c-library-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line); padding: 34px 24px; border-radius: 14px; }
.c-library-empty svg { width: 25px; height: 25px; color: var(--faint); margin-bottom: 12px; }
.c-library-empty h3 { font-size: 15px; font-weight: 500; }
.c-library-empty p { font-size: 12px; margin-top: 5px; color: var(--muted); }
.c-library-results { font-size: 10px; color: var(--muted); margin-bottom: 12px; }
.c-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.c-text-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 18px; min-width: 0; display: flex; flex-direction: column; }
.c-text-card:hover { border-color: var(--faint); }
.c-text-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 15px; }
.c-text-card-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); }
.c-text-card-icon svg { width: 17px; height: 17px; }
.c-text-card-top .pill { font-size: 9px; padding: 2px 8px; }
.c-text-card h3 { font-size: 15px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.c-text-excerpt { font-size: 13px; line-height: 1.9; color: var(--muted); margin: 9px 0 14px; overflow-wrap: anywhere; min-height: 63px; }
.c-text-card-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: auto; margin-bottom: 16px; }
.c-text-card-meta b { color: var(--text); font-weight: 400; }
.c-text-card-practice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.c-text-card-practice .btn { font-size: 12px; padding: 7px; border-radius: 8px; min-height: 40px; }
.c-text-card-practice svg { width: 13px; height: 13px; }
.c-text-card-tools { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; margin-top: 14px; border-top: 1px solid var(--line); }
.c-text-card-tools button { font-size: 12px; color: var(--muted); padding: 6px 0; min-height: 36px; }
.c-text-card-tools button:hover { color: var(--accent); }
.c-text-card-tools button:last-child { margin-inline-start: auto; }
.c-text-card-tools button:last-child:hover { color: var(--bad); }
.c-trash-details { border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; margin-top: 20px; }
.c-trash-details summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.c-trash-details summary .pill { margin-inline-start: 7px; font-size: 10px; }
.c-trash-details > p { color: var(--muted); font-size: 11px; margin-top: 8px; }
.c-trash-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 11px 0; margin-top: 8px; }
.c-trash-row > span { font-size: 12px; overflow-wrap: anywhere; min-width: 0; }
.c-trash-row .chip-btn { font-size: 11px; }
.c-storage-note { display: flex; gap: 7px; align-items: center; justify-content: center; margin-top: 28px; color: var(--muted); font-size: 10px; }
.c-storage-note svg { width: 13px; height: 13px; flex-shrink: 0; }
@media (max-width: 1100px) and (min-width: 861px) {
  .c-layout { grid-template-columns: minmax(0, 1fr) 255px; gap: 14px; }
  .c-modes { grid-template-columns: 1fr; }
  .c-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .c-heading { gap: 12px; margin-bottom: 20px; }
  .c-heading-icon { width: 54px; height: 54px; border-radius: 16px; }
  .c-heading-icon svg { width: 25px; height: 25px; }
  .c-heading p { font-size: 12px; }
  .c-eyebrow { font-size: 10px; }
  .c-steps { justify-content: space-between; gap: 5px; font-size: 9px; }
  .c-steps span { gap: 5px; }
  .c-steps b { width: 20px; height: 20px; font-size: 8px; flex-shrink: 0; }
  .c-steps > i { width: 8px; }
  .c-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .c-editor-head { padding: 15px 17px; }
  .c-fields { padding: 18px 17px 14px; }
  .c-workspace #c-text { min-height: 240px; font-size: 16px; padding: 15px; }
  .c-workspace #c-text::placeholder { font-size: 18px; }
  .c-mode-section { padding: 16px 17px; }
  .c-mode { padding: 11px 8px; gap: 7px; }
  .c-mode > svg { width: 17px; height: 17px; }
  .c-mode small { font-size: 10px; }
  .c-mode b { font-size: 12px; }
  .c-editor-footer { padding: 16px 17px; gap: 8px; }
  .c-start { font-size: 12px; padding: 10px 12px; min-height: 44px; }
  .c-save-only { font-size: 12px; padding: 6px; min-height: 44px; }
  .c-preview-empty { padding: 24px; }
  .c-preview-tip { padding: 16px 20px; }
  .c-library-head h2 { font-size: 21px; }
  .c-library-note { display: none; }
  .c-library-tools { display: block; }
  .c-search { max-width: none; }
  .c-filters { margin-top: 10px; }
  .c-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .c-text-card { padding: 14px; }
  .c-storage-note { align-items: flex-start; }
}
@media (max-width: 460px) {
  .c-library-grid { grid-template-columns: minmax(0, 1fr); }
  .c-editor-meta { font-size: 9px; gap: 6px; }
}
@media (max-width: 360px) { .c-editor-head { flex-wrap: wrap; } }
/* الإعدادات: التنقل بين الأقسام، أدوات التفضيلات ومراجعة البيانات */
.s-workspace { max-width: 1080px; margin-inline: auto; }
main#view:has(.s-workspace) { max-width: 1320px; }
.s-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.s-eyebrow { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: .06em; }
.s-heading h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.45; letter-spacing: -1.2px; }
.s-heading h1 > span { color: var(--accent); margin-inline-start: 4px; }
.s-heading p { color: var(--muted); font-size: 15px; }
.s-heading-icon { display: grid; place-items: center; width: 76px; height: 76px; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent); border-radius: 24px; transform: rotate(-6deg); }
.s-heading-icon svg { width: 35px; height: 35px; }
.s-account-strip { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(120deg,var(--surface),var(--surface-2)); padding: 18px 22px; margin-bottom: 30px; }
.s-account-icon { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; color: var(--accent); background: var(--surface); }
.s-account-icon svg { width: 20px; height: 20px; }
.s-account-strip > div { flex: 1; min-width: 0; }
.s-account-strip b { font-size: 14px; font-weight: 500; }
.s-account-strip p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.s-account-strip .btn { font-size: 12px; flex-shrink: 0; min-height: 38px; }
.s-layout { display: grid; grid-template-columns: 174px minmax(0,1fr); align-items: start; gap: 28px; }
.s-sidebar { position: sticky; top: 26px; }
.s-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.s-sidebar nav button { display: flex; gap: 10px; align-items: center; text-align: start; font-size: 12px; color: var(--muted); padding: 12px 10px; border-radius: 9px; min-height: 44px; }
.s-sidebar nav svg { width: 17px; height: 17px; flex-shrink: 0; }
.s-sidebar nav button:hover { color: var(--text); background: var(--surface); }
.s-sidebar nav .on { color: var(--accent); background: var(--accent-soft); }
.s-save-state { display: flex; align-items: flex-start; gap: 7px; margin-top: 19px; padding: 17px 10px 0; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.s-save-state svg { width: 14px; height: 14px; color: var(--ok); flex-shrink: 0; margin-top: 3px; }
.s-save-state.error, .s-save-state.error svg { color: var(--bad); }
.s-sections { min-width: 0; }
.s-section { scroll-margin-top: 24px; margin-bottom: 36px; }
.s-section-heading { display: flex; gap: 12px; align-items: center; margin-bottom: 17px; }
.s-section-heading > span { display: grid; place-items: center; width: 36px; height: 36px; color: var(--accent); border: 1px solid var(--line); border-radius: 10px; }
.s-section-heading svg { width: 18px; height: 18px; }
.s-section-heading h2 { font-size: 21px; line-height: 1.6; }
.s-section-heading p { font-size: 12px; color: var(--muted); }
.s-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; margin-bottom: 14px; overflow: hidden; }
.s-row { display: flex; align-items: center; gap: 18px; justify-content: space-between; padding: 20px 0; border-bottom: 1px solid var(--line); }
.s-row:last-child { border-bottom: 0; }
.s-row > div:first-child { flex: 1; min-width: 0; }
.s-row b, .s-goal-top b { display: block; font-size: 14px; font-weight: 500; }
.s-row p, .s-goal-top p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.8; }
.s-row > select { flex: 0 1 235px; width: 235px; max-width: 100%; min-width: 0; padding: 10px 12px; font-size: 12px; border-radius: 9px; }
.s-row .switch { flex-shrink: 0; }
.s-row:has(.s-seg) { flex-wrap: wrap; }
.s-seg { flex-wrap: wrap; border-radius: 9px; max-width: 100%; gap: 3px; }
.s-seg button { font-size: 12px; padding: 8px 12px; min-height: 36px; border-radius: 6px; }
.s-theme-options { display: flex; gap: 10px; }
.s-theme { padding: 10px 11px; min-width: 88px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 1fr auto; text-align: start; gap: 8px; font-size: 12px; }
.s-theme.on { border-color: var(--accent); background: var(--accent-soft); }
.s-theme b { font-family: var(--en-ui); font-size: 12px; color: var(--accent); }
.s-theme-swatch { display: flex; flex-direction: column; gap: 5px; grid-column: 1/-1; height: 40px; padding: 8px; border-radius: 5px; background: #0d0f14; border: 1px solid #262b37; }
.s-theme.light .s-theme-swatch { background: #f6f2e9; border-color: #e2dccd; }
.s-theme-swatch i { height: 3px; width: 70%; border-radius: 2px; background: #4a5163; }
.s-theme-swatch i:first-child { width: 40%; background: #f5b544; }
.s-theme.light .s-theme-swatch i { background: #b9b2a1; }
.s-theme.light .s-theme-swatch i:first-child { background: #9a5f00; }
.s-goal-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 20px; }
.s-today { color: var(--accent); font-size: 12px; white-space: nowrap; }
.s-goals { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.s-goals button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; text-align: start; padding: 12px 15px; }
.s-goals button.on { border-color: var(--accent); background: var(--accent-soft); }
.s-goals b { display: block; width: fit-content; max-width: 100%; font-size: 23px; font-weight: 500; line-height: 1.4; }
.s-goals b small { font-size: 10px; color: var(--muted); margin-inline-start: 5px; }
.s-goals span { color: var(--muted); font-size: 11px; }
.s-goals .on b { color: var(--accent); }
.s-goal-progress { appearance: none; display: block; height: 3px; width: 100%; background: var(--line); border: 0; color: var(--accent); margin-bottom: 20px; border-radius: 3px; }
.s-goal-progress::-webkit-progress-bar { background: var(--line); }
.s-goal-progress::-webkit-progress-value { background: var(--accent); }
.s-goal-progress::-moz-progress-bar { background: var(--accent); }
.s-placement { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 0; }
.s-placement p { font-size: 11px; color: var(--muted); }
.s-text-link { font-size: 12px; color: var(--accent); }
.s-writing-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 20px; }
.s-writing-top h3 { font-size: 15px; font-weight: 500; }
.s-writing-top .pill { font-size: 10px; }
.s-writing-help { color: var(--muted); font-size: 11px; margin-top: 5px; }
.s-presets { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 17px 0 6px; }
.s-presets button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 13px; text-align: start; }
.s-presets b { font-size: 12px; display: block; font-weight: 500; }
.s-presets small { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; }
.s-presets button.on { border-color: var(--accent); background: var(--accent-soft); }
.s-presets .on b { color: var(--accent); }
.s-restore-prefs { display: block; margin: 14px 0 18px; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
.s-audio-sample { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 16px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 20px; }
.s-audio-sample > div { min-width: 0; }
.s-audio-sample p { font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.s-audio-sample small { color: var(--muted); font-size: 10px; }
.s-audio-sample .btn { flex-shrink: 0; font-size: 11px; min-height: 40px; }
.s-audio-sample svg { width: 13px; height: 13px; }
.s-workspace button:disabled, .s-workspace select:disabled { opacity: .45; cursor: not-allowed; }
.s-data-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.s-data-stats > div { text-align: center; }
.s-data-stats > div + div { border-inline-start: 1px solid var(--line); }
.s-data-stats b { display: block; color: var(--accent); font-size: 26px; line-height: 1.4; font-weight: 500; }
.s-data-stats span { font-size: 11px; color: var(--muted); }
.s-backup-row { padding: 20px 0; }
.s-backup-row h3 { font-size: 15px; font-weight: 500; }
.s-backup-row p { font-size: 12px; color: var(--muted); margin-top: 5px; }
.s-backup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.s-backup-actions .btn { min-height: 40px; font-size: 12px; }
.s-import-label { position: relative; overflow: hidden; cursor: pointer; }
.s-import-label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.s-import-label input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; font-size: 0; }
.s-import-preview { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.s-import-preview h3 { font-size: 18px; margin-top: 4px; }
.s-import-preview p { font-size: 12px; line-height: 1.9; margin-top: 8px; }
.s-backup-name { color: var(--muted); overflow-wrap: anywhere; }
.s-import-stats { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 12px; font-size: 12px; }
.s-import-stats b { color: var(--accent); margin-inline-end: 4px; }
.s-import-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.s-import-actions .btn { font-size: 12px; min-height: 40px; }
.s-data-message { color: var(--muted); font-size: 12px; }
.s-data-message:not(:empty) { padding-bottom: 18px; }
.s-undo { padding: 14px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.s-undo > span { font-size: 12px; color: var(--muted); }
.s-undo .chip-btn { font-size: 11px; flex-shrink: 0; }
.s-danger { border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; }
.s-danger summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.s-danger > div { padding-top: 12px; }
.s-danger p { font-size: 12px; color: var(--muted); line-height: 1.9; }
.s-danger .btn { margin-top: 14px; min-height: 40px; font-size: 12px; }
.s-about { padding-block: 22px; }
.s-about b { font-size: 19px; }
.s-about p { margin-top: 7px; font-size: 13px; color: var(--muted); }
.s-about-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.s-about-links .btn { min-height: 40px; font-size: 12px; }
@media (max-width: 1100px) and (min-width: 861px) {
  .s-layout { grid-template-columns: 150px minmax(0,1fr); gap: 18px; }
  .s-sidebar nav button { font-size: 11px; gap: 7px; }
  .s-row:has(select) { flex-wrap: wrap; }
  .s-row > select { flex: 1 1 100%; width: 100%; }
  .s-seg { flex-basis: 100%; }
  .s-audio-sample { flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .s-heading { margin-bottom: 22px; gap: 12px; }
  .s-heading-icon { width: 54px; height: 54px; border-radius: 16px; }
  .s-heading-icon svg { width: 25px; height: 25px; }
  .s-heading p { font-size: 12px; }
  .s-account-strip { padding: 15px; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
  .s-account-strip p { font-size: 11px; }
  .s-account-strip > div { flex-basis: calc(100% - 60px); }
  .s-account-strip .btn { margin-inline-start: 50px; }
  .s-layout { grid-template-columns: minmax(0,1fr); gap: 22px; }
  .s-sidebar { position: static; min-width: 0; }
  .s-sidebar nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 5px; }
  .s-sidebar nav button { border: 1px solid var(--line); padding: 8px 10px; font-size: 11px; min-height: 40px; gap: 6px; }
  .s-sidebar nav svg { width: 14px; height: 14px; }
  .s-save-state { border: 0; margin-top: 9px; padding: 0; font-size: 10px; }
  .s-section { scroll-margin-top: 75px; margin-bottom: 28px; }
  .s-section-heading h2 { font-size: 20px; }
  .s-section-heading p { font-size: 11px; }
  .s-card { padding-inline: 17px; }
  .s-row { gap: 12px; padding-block: 18px; }
  .s-row b { font-size: 13px; }
  .s-row p { font-size: 11px; }
  .s-row:has(select), .s-row:has(.s-theme-options) { flex-wrap: wrap; }
  .s-row > select { flex: 1 1 100%; width: 100%; }
  .s-seg { flex-basis: 100%; }
  .s-seg button { flex: 1; padding: 8px; font-size: 11px; min-height: 40px; }
  .s-theme-options { width: 100%; }
  .s-theme { flex: 1; }
  .s-goal-top { flex-wrap: wrap; }
  .s-goal-top p { font-size: 11px; }
  .s-goals { gap: 7px; }
  .s-goals button { padding: 10px; }
  .s-goals b { font-size: 22px; }
  .s-goals span { font-size: 10px; }
  .s-presets { gap: 8px; }
  .s-presets button { padding: 11px; }
  .s-presets small { font-size: 10px; }
  .s-audio-sample { padding: 13px; gap: 10px; flex-wrap: wrap; }
  .s-audio-sample p { font-size: 13px; }
  .s-data-stats span { font-size: 10px; }
  .s-import-preview { padding: 15px; }
  .s-undo { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .s-section { scroll-behavior: auto; } }
/* كلماتي — مساحة هادئة للكلمات والتدريب، بألوان هوية حرف. */
main#view:has(.rv-workspace) { max-width: 1380px; }
.rv-workspace { --rv-border: color-mix(in srgb, var(--line), var(--text) 5%); }
.rv-workspace svg { width: 20px; height: 20px; flex: none; }
.rv-workspace button:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.rv-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.rv-eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .6px; }
.rv-heading h1 { font-size: clamp(38px, 4.5vw, 54px); line-height: 1.35; letter-spacing: -1.3px; margin-top: 7px; }
.rv-heading-dot { color: var(--accent); }
.rv-heading p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.rv-add-open { padding: 10px 16px; font-size: 13px; flex: none; }
.rv-overview { background: linear-gradient(115deg, var(--surface), color-mix(in srgb, var(--surface), var(--accent) 5%)); border: 1px solid var(--rv-border); border-radius: 18px; padding: 22px 26px; margin-bottom: 28px; display: flex; flex-direction: column; gap: 22px; position: relative; overflow: hidden; }
.rv-overview::after { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--accent); opacity: .8; }
.rv-overview-note { display: flex; gap: 14px; align-items: center; }
.rv-book-icon { width: 44px; height: 44px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent), transparent 78%); display: grid; place-items: center; border-radius: 13px; color: var(--accent); flex: none; }
.rv-book-icon svg { width: 23px; height: 23px; }
.rv-overview-note b { font-size: 15px; font-weight: 500; }
.rv-overview-note p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.rv-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 18px; border-top: 1px solid var(--rv-border); }
.rv-stats > div { display: flex; gap: 12px; align-items: center; padding-inline: 22px; border-inline-start: 1px solid var(--rv-border); }
.rv-stats > div:first-child { border: 0; padding-inline-start: 0; }
.rv-stats b { font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.8px; }
.rv-stats span { color: var(--muted); font-size: 12px; }
.rv-stat-near b { color: var(--ok); }
.rv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.rv-collection { min-width: 0; }
.rv-collection-head { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.rv-collection-head h2 { font-size: 19px; font-weight: 600; }
.rv-collection-total { font-size: 12px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.rv-tabs { display: flex; gap: 17px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.rv-tabs button { display: flex; gap: 6px; align-items: center; white-space: nowrap; padding: 0 0 12px; border-bottom: 2px solid transparent; font-size: 12px; color: var(--muted); }
.rv-tabs button span { font-size: 10px; background: var(--surface-2); border-radius: 4px; padding: 0 5px; }
.rv-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.rv-tabs button.on span { background: var(--accent-soft); }
.rv-search-tools { display: flex; gap: 10px; margin: 18px 0 13px; }
.rv-search { display: flex; align-items: center; gap: 9px; padding-inline: 12px; background: var(--surface); border: 1px solid var(--rv-border); border-radius: 10px; flex: 1; min-width: 0; color: var(--muted); }
.rv-search:focus-within { border-color: var(--accent); }
.rv-search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text); padding: 11px 0; font: inherit; font-size: 12px; outline: none; }
.rv-search input::placeholder { color: var(--muted); opacity: .85; }
.rv-search-tools select { min-width: 0; max-width: 160px; border-radius: 10px; background: var(--surface); border: 1px solid var(--rv-border); color: var(--muted); padding: 0 9px; font: inherit; font-size: 11px; }
.rv-list-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; padding: 4px 3px 12px; }
.rv-list-meta label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rv-remove-selected { display: inline-flex; align-items: center; gap: 6px; color: var(--bad); border: 1px solid currentColor; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 11px; margin-inline-end: auto; }
.rv-remove-selected svg { width: 13px; height: 13px; }
.rv-remove-selected:hover { background: var(--bad-soft); }
.rv-checkbox { appearance: auto; accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }
.rv-word-list { border: 1px solid var(--rv-border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.rv-word-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 105px auto; gap: 15px; padding: 17px 16px; align-items: center; border-bottom: 1px solid var(--line); transition: background .15s; }
.rv-word-row:last-child { border-bottom: 0; }
.rv-word-row:hover { background: color-mix(in srgb, var(--surface), var(--text) 2%); }
.rv-word-row.is-selected { background: var(--accent-soft); }
.rv-word-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.rv-english { font-family: var(--en); font-size: 21px; font-weight: 500; letter-spacing: -.2px; overflow-wrap: anywhere; line-height: 1.35; }
.rv-meaning { font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.rv-word-progress { display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.rv-dots { display: flex; gap: 4px; direction: ltr; }
.rv-dots i { display: block; height: 5px; width: 22px; background: var(--rv-border); border-radius: 2px; }
.rv-dots i.done { background: var(--ok); }
.rv-word-progress small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.rv-saved-label { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.rv-saved-label svg { width: 13px; height: 13px; }
.rv-word-actions { display: flex; gap: 2px; }
.rv-icon-btn { display: inline-grid; place-items: center; width: 32px; height: 34px; border-radius: 8px; color: var(--muted); flex: none; }
.rv-icon-btn svg { width: 16px; height: 16px; }
.rv-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.rv-icon-btn.is-saved { color: var(--accent); }
.rv-icon-btn.is-saved svg { fill: var(--accent-soft); }
.rv-icon-btn.rv-delete:hover { color: var(--bad); background: var(--bad-soft); }
.rv-rail { display: flex; flex-direction: column; gap: 18px; }
.rv-session { border: 1px solid var(--rv-border); background: var(--surface); border-radius: 16px; padding: 22px; }
.rv-session h2 { font-size: 22px; margin-top: 7px; font-weight: 600; letter-spacing: -.3px; }
.rv-session-intro { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.8; min-height: 44px; }
.rv-fieldset { margin: 23px 0 0; padding: 0; border: 0; min-width: 0; }
.rv-fieldset legend { padding: 0; font-size: 12px; font-weight: 500; margin-bottom: 10px; }
.rv-modes { display: flex; flex-direction: column; gap: 7px; }
.rv-mode { display: flex; align-items: center; gap: 10px; text-align: start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--muted); }
.rv-mode > svg { width: 18px; height: 18px; }
.rv-mode > span { flex: 1; }
.rv-mode b { display: block; font-size: 13px; font-weight: 500; color: var(--text); }
.rv-mode small { display: block; font-size: 11px; margin-top: 1px; }
.rv-mode > i { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--faint); flex: none; }
.rv-mode.on { border-color: color-mix(in srgb, var(--accent), transparent 35%); background: var(--accent-soft); color: var(--accent); }
.rv-mode.on > i { border: 4px solid var(--accent); }
.rv-mode-note { color: var(--muted); font-size: 10px; margin-top: 8px; }
.rv-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; direction: ltr; }
.rv-counts button { border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: 500 13px var(--en-ui); color: var(--muted); }
.rv-counts button.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.rv-start { width: 100%; font-size: 14px; margin-top: 22px; gap: 10px; }
.rv-start > span { margin-inline-start: auto; padding: 0 6px; background: color-mix(in srgb, var(--accent-ink), transparent 90%); border-radius: 4px; font-size: 11px; }
.rv-start > svg { width: 17px; height: 17px; }
[dir='rtl'] .rv-start > svg, [dir='rtl'] .rv-quick .btn svg, [dir='rtl'] .rv-footer a svg, [dir='rtl'] .rv-how a svg, [dir='rtl'] .rv-empty a svg { transform: rotate(180deg); }
.rv-session-foot { text-align: center; color: var(--muted); font-size: 11px; margin-top: 11px; }
.rv-text-btn { color: var(--accent); font-size: 11px; padding: 5px 0; text-decoration: underline; text-underline-offset: 3px; }
.rv-how { padding: 6px 16px 12px; }
.rv-how-icon { color: var(--ok); display: block; margin-bottom: 5px; }
.rv-how h3 { font-size: 14px; font-weight: 500; }
.rv-how p { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.9; }
.rv-how-steps { display: flex; align-items: center; gap: 8px; direction: ltr; margin: 15px 0 10px; }
.rv-how-steps span { border: 1px solid var(--line); border-radius: 7px; padding: 2px 10px; font: 500 12px/1.8 var(--en-ui); color: var(--muted); }
.rv-how-steps span:last-child { border-color: color-mix(in srgb, var(--ok), transparent 70%); color: var(--ok); background: var(--ok-soft); }
.rv-how-steps i { height: 1px; background: var(--line); flex: 1; }
.rv-how a { color: var(--accent); display: flex; align-items: center; gap: 7px; font-size: 11px; margin-top: 13px; }
.rv-how a svg { width: 14px; height: 14px; }
.rv-empty { border: 1px dashed var(--rv-border); border-radius: 14px; padding: 45px 24px; text-align: center; background: var(--surface); }
.rv-empty > svg { width: 38px; height: 38px; color: var(--accent); margin-bottom: 12px; }
.rv-empty h3 { font-size: 18px; font-weight: 500; }
.rv-empty p { font-size: 13px; color: var(--muted); max-width: 35ch; margin: 10px auto 20px; }
.rv-empty .btn { font-size: 12px; }
.rv-pagination { display: flex; justify-content: center; gap: 18px; align-items: center; margin-top: 16px; font-size: 12px; color: var(--muted); }
.rv-pagination button { border: 1px solid var(--line); font-size: 20px; }
.rv-footer { display: flex; align-items: center; gap: 8px; margin-top: 32px; border-top: 1px solid var(--line); padding-top: 17px; font-size: 10px; color: var(--muted); }
.rv-footer > svg { width: 13px; height: 13px; }
.rv-footer a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); margin-inline-start: auto; white-space: nowrap; }
.rv-footer a svg { width: 13px; height: 13px; }
.rv-add-panel { padding: 22px; background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; margin-bottom: 24px; }
.rv-add-panel[hidden] { display: none; }
.rv-add-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rv-add-title h2 { font-size: 18px; }
.rv-add-panel p { font-size: 12px; color: var(--muted); margin-top: 6px; }
.rv-add-panel form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 14px; margin-top: 18px; }
.rv-add-panel label { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 12px; }
.rv-add-panel input { background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 12px; border-radius: 9px; font: inherit; width: 100%; }
.rv-add-panel .btn { font-size: 13px; }
.rv-add-panel p.rv-add-error { color: var(--bad); }
.rv-undo { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--rv-border); background: var(--accent-soft); padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 12px; }
.rv-undo button { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.rv-quick { display: none; }
@media (min-width: 1500px) { .rv-overview { flex-direction: row; align-items: center; } .rv-stats { border-top: 0; padding-top: 0; flex: 1; } .rv-overview-note { flex: 1.1; } .rv-stats > div { flex-direction: column; align-items: flex-start; gap: 8px; } }
@media (min-width: 861px) and (max-width: 1170px) { .rv-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; } .rv-session { padding: 18px; } .rv-word-row { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; } .rv-word-progress { grid-column: 2; grid-row: 2; } .rv-word-row > .rv-checkbox { grid-row: 1 / 3; } .rv-word-actions { grid-column: 3; grid-row: 1 / 3; } .rv-tabs { gap: 12px; } }
@media (max-width: 860px) { .rv-heading { margin-top: 7px; } .rv-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 20px; } .rv-word-row { grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; } .rv-word-progress { grid-column: 2; grid-row: 2; } .rv-word-row > .rv-checkbox { grid-row: 1 / 3; } .rv-word-actions { grid-column: 3; grid-row: 1 / 3; } }
@media (max-width: 700px) {
  .rv-heading { gap: 12px; margin-bottom: 22px; align-items: center; }
  .rv-heading h1 { font-size: 39px; }
  .rv-heading p { font-size: 12px; }
  .rv-eyebrow { font-size: 10px; }
  .rv-add-open { padding: 9px 11px; font-size: 11px; gap: 4px; }
  .rv-add-open svg { width: 16px; height: 16px; }
  .rv-overview { padding: 18px; gap: 17px; margin-bottom: 24px; }
  .rv-overview-note b { font-size: 13px; }
  .rv-overview-note p { font-size: 10px; }
  .rv-book-icon { width: 36px; height: 36px; }
  .rv-stats > div { flex-direction: column; align-items: flex-start; gap: 7px; padding-inline: 15px; }
  .rv-stats b { font-size: 27px; }
  .rv-stats span { font-size: 10px; }
  .rv-layout { display: flex; flex-direction: column; gap: 24px; }
  .rv-quick { display: flex; align-items: center; gap: 16px; margin: 0 0 25px; }
  .rv-quick .btn { flex: 1; font-size: 13px; padding: 10px; }
  .rv-quick .btn span { padding-inline: 6px; border-inline-start: 1px solid currentColor; font-size: 12px; }
  .rv-quick .rv-text-btn { font-size: 12px; }
  .rv-collection, .rv-rail { width: 100%; }
  .rv-session { padding: 20px; }
  .rv-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .rv-mode { padding: 12px 7px; flex-direction: column; text-align: center; gap: 5px; }
  .rv-mode > i { display: none; }
  .rv-mode b { font-size: 12px; }
  .rv-mode small { font-size: 10px; }
  .rv-session-intro { min-height: 0; }
  .rv-fieldset { margin-top: 18px; }
  .rv-how { padding: 2px 4px; }
  .rv-how-steps { max-width: 240px; }
  .rv-footer { flex-wrap: wrap; font-size: 10px; }
  .rv-footer > span { flex: 1; }
  .rv-footer a { width: 100%; margin-inline-start: 21px; }
  .rv-add-panel form { grid-template-columns: 1fr 1fr; }
  .rv-add-panel form > button { grid-column: 1 / -1; }
}
@media (max-width: 380px) { .rv-heading { flex-wrap: wrap; } .rv-heading .rv-add-open { width: 100%; } .rv-search-tools { flex-wrap: wrap; } .rv-search { flex-basis: 100%; } .rv-search-tools select { height: 36px; max-width: none; width: 100%; } .rv-word-row { padding: 14px 10px; gap: 9px; } .rv-word-actions { gap: 0; } .rv-icon-btn { width: 29px; } .rv-tabs { gap: 13px; } }
@media (pointer: coarse) { .rv-word-actions .rv-icon-btn { width: 36px; height: 44px; } .rv-list-meta label { min-height: 36px; } .rv-tabs button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .rv-word-row { transition: none; } }
/* الأصدقاء — نفس هوية حرف، بترتيب قابل للقراءة ومساحة واضحة للطلبات. */
main#view:has(.fp-workspace) { max-width: 1390px; }
.fp-workspace { --fp-border: color-mix(in srgb, var(--line), var(--text) 4%); }
.fp-workspace svg { width: 20px; height: 20px; flex: none; }
.fp-workspace [hidden] { display: none !important; }
.fp-workspace button:disabled { opacity: .45; cursor: not-allowed; }
.fp-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.fp-eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--accent); }
.fp-heading h1 { font-size: clamp(37px, 4.5vw, 51px); line-height: 1.35; letter-spacing: -1.2px; margin-top: 7px; }
.fp-heading h1 > span, .fp-guest-story h2 span { color: var(--accent); }
.fp-heading p { color: var(--muted); font-size: 14px; margin-top: 5px; }
.fp-heading > .btn { font-size: 13px; padding: 11px 17px; flex: none; }
.fp-heading-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.fp-heading-actions .btn { font-size: 12px; padding: 10px 14px; }
.fp-profile-strip { display: flex; gap: 13px; align-items: center; padding: 18px 22px; border: 1px solid var(--fp-border); border-radius: 15px; background: var(--surface); margin-bottom: 17px; }
.fp-profile-strip .avatar { width: 44px; height: 44px; }
.fp-my-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fp-my-name > bdi { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.fp-my-name > span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.fp-profile-status { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ok); margin-inline-start: auto; }
.fp-profile-status svg { width: 16px; height: 16px; }
.fp-subtle-link { color: var(--accent); display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 12px; padding: 0; }
.fp-subtle-link svg { width: 15px; height: 15px; }
.fp-profile-strip > a { color: var(--muted); border-inline-start: 1px solid var(--line); padding-inline-start: 16px; margin-inline-start: 8px; }
.fp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 28px; }
.fp-stats > * { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--fp-border); padding: 20px; border-radius: 13px; text-align: start; }
.fp-stats > * > svg:first-child { width: 36px; height: 36px; padding: 7px; box-sizing: content-box; background: var(--accent-soft); color: var(--accent); border-radius: 12px; }
.fp-stats > *:nth-child(2) > svg:first-child { color: var(--ok); background: var(--ok-soft); }
.fp-stats > *:nth-child(3) > svg:first-child { color: var(--info); background: color-mix(in srgb, var(--info), transparent 90%); }
.fp-stats span { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.fp-stats b { font-size: 29px; line-height: 1.1; font-weight: 600; letter-spacing: -.7px; }
.fp-stats b i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.fp-stats small { color: var(--muted); font-size: 11px; }
.fp-stats button > svg:last-child { width: 15px; height: 15px; color: var(--muted); margin-inline-start: auto; }
.fp-stats button:hover { border-color: var(--accent); }
.fp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 24px; align-items: start; }
.fp-main, .fp-rail { min-width: 0; }
.fp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.fp-section-head h2 { font-size: 20px; font-weight: 600; }
.fp-refresh-btn { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.fp-refresh-btn svg { width: 15px; height: 15px; }
.fp-refresh-btn:hover { color: var(--accent); }
.fp-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.fp-tabs button { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 0 0 13px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
.fp-tabs button span { font-size: 10px; background: var(--surface-2); padding: 0 6px; border-radius: 5px; }
.fp-tabs button.on { color: var(--accent); border-color: var(--accent); }
.fp-tabs button.on span { background: var(--accent-soft); }
.fp-list-tools { display: flex; gap: 10px; margin-top: 18px; }
.fp-search { display: flex; align-items: center; gap: 9px; padding-inline: 12px; border: 1px solid var(--fp-border); background: var(--surface); border-radius: 10px; flex: 1; min-width: 0; color: var(--muted); }
.fp-search:focus-within { border-color: var(--accent); }
.fp-search input { background: transparent; border: 0; color: var(--text); font: inherit; font-size: 12px; width: 100%; min-width: 0; outline: none; padding: 11px 0; }
.fp-search input::placeholder { color: var(--muted); opacity: .9; }
.fp-list-tools select { max-width: 155px; min-width: 0; font: inherit; font-size: 11px; padding: 8px; border: 1px solid var(--fp-border); border-radius: 10px; background: var(--surface); color: var(--muted); }
.fp-list-note { font-size: 11px; color: var(--muted); margin: 12px 0 14px; }
.fp-people { border: 1px solid var(--fp-border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.fp-person { display: grid; grid-template-columns: 28px 38px minmax(0, 1fr) 90px 44px auto; gap: 11px; align-items: center; padding: 18px 14px; border-bottom: 1px solid var(--line); }
.fp-person:last-child { border-bottom: 0; }
.fp-person.is-me { background: var(--accent-soft); box-shadow: inset -3px 0 var(--accent); }
[dir='ltr'] .fp-person.is-me { box-shadow: inset 3px 0 var(--accent); }
.fp-place { font: 500 13px var(--en-ui); color: var(--muted); direction: ltr; text-align: center; }
.fp-place.place-1 { color: var(--accent); font-size: 17px; font-weight: 700; }
.fp-place.place-2 { color: var(--text); }
.fp-place.place-3 { color: var(--accent); opacity: .8; }
.fp-person-name { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fp-person-name > bdi { align-self: flex-start; max-width: 100%; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.fp-person-name small { display: flex; gap: 7px; align-items: center; font-size: 10px; color: var(--muted); }
.fp-you { font-size: 9px; background: var(--accent-soft); color: var(--accent); padding: 0 5px; border-radius: 4px; }
.fp-person-score { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; }
.fp-person-score b { font-size: 17px; font-weight: 600; }
.fp-person-score small { font-size: 9px; color: var(--muted); }
.fp-person-streak { display: flex; gap: 4px; color: var(--faint); align-items: center; font-size: 11px; }
.fp-person-streak svg { width: 15px; height: 15px; }
.fp-person-streak.active { color: var(--accent); }
.fp-person-actions { display: flex; align-items: center; gap: 4px; }
.fp-challenge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.fp-challenge svg { width: 16px; height: 16px; }
.fp-challenge:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.fp-icon-btn { display: inline-grid; place-items: center; border-radius: 8px; width: 30px; height: 34px; color: var(--muted); flex: none; }
.fp-icon-btn svg { width: 16px; height: 16px; }
.fp-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.fp-remove:hover { color: var(--bad); background: var(--bad-soft); }
.fp-mine { color: var(--accent); font-size: 10px; text-align: center; max-width: 78px; }
.fp-confirm { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 13px; background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad), transparent 70%); border-radius: 9px; }
.fp-confirm p { width: 100%; font-size: 12px; }
.fp-confirm .btn { font-size: 11px; }
.fp-rail { display: flex; flex-direction: column; gap: 17px; }
.fp-add-card { border: 1px solid var(--fp-border); background: var(--surface); border-radius: 15px; padding: 23px; position: relative; }
.fp-add-card h2 { font-size: 23px; font-weight: 600; margin-top: 6px; }
.fp-add-card p { color: var(--muted); font-size: 12px; margin-top: 9px; line-height: 1.9; }
.fp-add-card form { margin-top: 21px; display: flex; flex-direction: column; gap: 9px; }
.fp-add-card label, .fp-auth-card label { display: block; font-size: 11px; font-weight: 500; }
.fp-username-input { display: flex; align-items: center; gap: 6px; direction: ltr; background: var(--bg); border: 1px solid var(--fp-border); border-radius: 9px; padding: 11px; color: var(--muted); }
.fp-username-input:focus-within { border-color: var(--accent); }
.fp-username-input input { min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 12px; outline: 0; }
.fp-add-card .btn { font-size: 12px; width: 100%; margin-top: 3px; }
.fp-add-card > small { display: block; text-align: center; font-size: 10px; color: var(--muted); margin-top: 11px; }
.fp-share-card { background: var(--surface); border: 1px dashed var(--fp-border); border-radius: 14px; padding: 20px 22px; }
.fp-share-icon { display: block; color: var(--accent); margin-bottom: 8px; }
.fp-share-icon svg { width: 18px; height: 18px; }
.fp-share-card h3 { font-size: 15px; font-weight: 500; }
.fp-share-card p { color: var(--muted); font-size: 11px; margin-top: 6px; }
.fp-copy-row { display: flex; align-items: center; gap: 4px; padding: 3px 5px 3px 10px; margin-top: 13px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; direction: ltr; }
.fp-copy-row input { width: 100%; min-width: 0; font-size: 12px; background: none; color: var(--text); border: 0; padding: 0; }
.fp-copy-row .fp-icon-btn { color: var(--accent); }
.fp-play-card { padding: 8px 13px 10px; }
.fp-play-card > span { color: var(--accent); }
.fp-play-card h3 { font-size: 14px; font-weight: 500; margin-top: 5px; }
.fp-play-card p { color: var(--muted); font-size: 11px; line-height: 1.9; margin-top: 7px; }
.fp-play-card a { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); font-size: 12px; margin-top: 14px; }
.fp-play-card a svg { width: 15px; height: 15px; }
.fp-footer { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 16px; color: var(--muted); font-size: 10px; }
.fp-footer > svg { width: 14px; height: 14px; }
.fp-footer > span { margin-inline-start: auto; white-space: nowrap; }
.fp-message { display: flex; align-items: center; gap: 9px; background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok), transparent 75%); padding: 13px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 17px; overflow-wrap: anywhere; }
.fp-message.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad), transparent 75%); }
.fp-load-error { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 15px; background: var(--bad-soft); border-radius: 12px; margin-bottom: 20px; }
.fp-load-error b { font-size: 13px; }
.fp-load-error p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.fp-invites { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.fp-invites article { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid color-mix(in srgb, var(--accent), transparent 60%); border-radius: 12px; background: var(--accent-soft); }
.fp-invites article > svg { color: var(--accent); }
.fp-invites article > div { flex: 1; min-width: 0; }
.fp-invites b { font-size: 13px; overflow-wrap: anywhere; }
.fp-invites p { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.fp-request-group { margin-top: 24px; }
.fp-section-label { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.fp-section-label h3 { font-size: 15px; font-weight: 500; }
.fp-section-label > span { color: var(--muted); font-size: 11px; padding: 0 6px; background: var(--surface-2); border-radius: 5px; }
.fp-request { display: flex; align-items: center; gap: 11px; padding: 16px; border: 1px solid var(--fp-border); border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.fp-request > div:first-of-type { flex: 1; min-width: 0; }
.fp-request bdi { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.fp-request small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.fp-request-actions { display: flex; gap: 7px; }
.fp-request-actions .btn { font-size: 11px; padding: 6px 10px; }
.fp-request-actions svg { width: 14px; height: 14px; }
.fp-request-empty { font-size: 13px; color: var(--muted); padding: 22px 17px; background: var(--surface); border: 1px dashed var(--fp-border); border-radius: 12px; }
.fp-empty { text-align: center; border: 1px dashed var(--fp-border); border-radius: 13px; background: var(--surface); padding: 40px 22px; }
.fp-empty > svg { width: 38px; height: 38px; color: var(--accent); margin-bottom: 12px; }
.fp-empty h3 { font-size: 18px; font-weight: 500; }
.fp-empty p { color: var(--muted); font-size: 13px; max-width: 36ch; margin: 10px auto 20px; }
.fp-first-friend { padding: 20px; margin-top: 16px; border: 1px dashed var(--fp-border); border-radius: 12px; text-align: center; }
.fp-first-friend > svg { color: var(--accent); width: 27px; height: 27px; }
.fp-first-friend p { color: var(--muted); font-size: 12px; max-width: 45ch; margin: 8px auto 13px; }
.fp-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 15px; }
.fp-pagination .fp-icon-btn { border: 1px solid var(--line); font-size: 20px; }
.fp-guest-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 70px); align-items: start; padding: 26px 0 20px; }
.fp-guest-story { padding-block: 10px; }
.fp-guest-story h2 { font-size: clamp(34px, 4vw, 48px); font-weight: 600; line-height: 1.45; letter-spacing: -.7px; margin-top: 14px; }
.fp-guest-story > p { color: var(--muted); font-size: 14px; max-width: 38ch; line-height: 2; margin-top: 16px; }
.fp-guest-features { display: flex; flex-direction: column; gap: 23px; margin-top: 32px; }
.fp-guest-features > div { display: flex; align-items: center; gap: 14px; }
.fp-guest-features svg { width: 22px; height: 22px; padding: 10px; box-sizing: content-box; border: 1px solid var(--line); border-radius: 12px; color: var(--accent); background: var(--surface); }
.fp-guest-features b { font-size: 14px; font-weight: 500; }
.fp-guest-features small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.fp-guest-story > a { margin-top: 28px; }
.fp-auth-card { display: flex; align-items: flex-start; flex-direction: column; padding: clamp(25px, 3vw, 38px); background: var(--surface); border: 1px solid var(--fp-border); border-radius: 20px; position: relative; overflow: hidden; margin-top: 16px; }
.fp-auth-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 0% 0%, var(--accent-soft), transparent 60%); pointer-events: none; }
.fp-auth-card > * { position: relative; }
.fp-auth-symbol { display: grid; place-items: center; width: 58px; height: 58px; background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent), transparent 80%); border-radius: 17px; margin-bottom: 30px; }
.fp-auth-symbol svg { width: 28px; height: 28px; }
.fp-auth-card h2 { font-size: 27px; font-weight: 600; line-height: 1.5; margin-top: 10px; }
.fp-auth-card > p { color: var(--muted); font-size: 13px; line-height: 2; margin-top: 12px; }
.fp-auth-card > small { color: var(--muted); font-size: 11px; line-height: 1.9; margin-top: 15px; }
.fp-google { margin-top: 28px; width: 100%; font-size: 13px; background: var(--text); color: var(--bg); }
.fp-google-mark { font-size: 19px; font-weight: 700; margin-inline-end: 4px; }
.fp-auth-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 22px; width: 100%; margin-top: 29px; color: var(--muted); font-size: 11px; }
.fp-auth-foot svg { width: 16px; height: 16px; }
.fp-auth-card > .fp-subtle-link { margin-top: 20px; }
.fp-auth-card > .btn { margin-top: 22px; }
.fp-auth-card form { width: 100%; margin-top: 22px; }
.fp-auth-card form label { margin-bottom: 9px; }
.fp-auth-card form .btn { width: 100%; margin-top: 14px; font-size: 13px; }
.fp-auth-card #fp-message { width: 100%; margin-top: 17px; }
.fp-auth-card .fp-message { font-size: 12px; }
.fp-pending-invite { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); margin-bottom: 15px; }
.fp-pending-invite > svg { color: var(--accent); width: 26px; height: 26px; }
.fp-pending-invite b { font-size: 14px; }
.fp-pending-invite p { color: var(--muted); font-size: 12px; margin-top: 4px; }
[dir='rtl'] .fp-subtle-link svg, [dir='rtl'] .fp-play-card a svg, [dir='rtl'] .fp-stats button > svg:last-child { transform: rotate(180deg); }
@media (min-width: 861px) and (max-width: 1200px) { .fp-layout { grid-template-columns: minmax(0, 1fr) 255px; gap: 18px; } .fp-person { grid-template-columns: 23px 32px minmax(0, 1fr) 77px auto; gap: 8px; padding-inline: 11px; } .fp-person .avatar { width: 32px; height: 32px; } .fp-person-streak { display: none; } .fp-challenge span { display: none; } .fp-mine { max-width: 50px; font-size: 9px; } .fp-stats > * { padding: 16px; gap: 10px; } .fp-stats > * > svg:first-child { width: 26px; height: 26px; } .fp-stats small { font-size: 10px; } .fp-profile-status { font-size: 10px; } }
@media (max-width: 860px) { .fp-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; } .fp-person { grid-template-columns: 22px 32px minmax(0, 1fr) 70px auto; gap: 8px; padding-inline: 10px; } .fp-person .avatar { width: 32px; height: 32px; } .fp-person-streak { display: none; } .fp-challenge span { display: none; } .fp-mine { font-size: 9px; max-width: 44px; } .fp-stats > * { padding: 16px; gap: 10px; } .fp-stats > * > svg:first-child { width: 24px; height: 24px; } }
@media (max-width: 700px) {
  .fp-heading { gap: 12px; margin-top: 5px; margin-bottom: 22px; }
  .fp-heading h1 { font-size: 38px; }
  .fp-heading p { font-size: 12px; }
  .fp-eyebrow { font-size: 10px; }
  .fp-heading > .btn { font-size: 11px; padding: 9px 11px; gap: 6px; }
  .fp-heading > .btn svg { width: 17px; height: 17px; }
  .fp-heading-actions { width: 100%; }
  .fp-heading:has(.fp-heading-actions) { flex-wrap: wrap; }
  .fp-heading-actions .btn { flex: 1; padding: 9px 11px; font-size: 12px; }
  .fp-heading-actions svg { width: 17px; height: 17px; }
  .fp-profile-strip { padding: 16px; flex-wrap: wrap; gap: 10px; }
  .fp-profile-status { width: 100%; order: 4; margin: 3px 0 0; font-size: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
  .fp-profile-strip > a { margin-inline-start: auto; border: 0; padding: 0; font-size: 10px; }
  .fp-my-name > bdi { font-size: 14px; }
  .fp-my-name > span { font-size: 10px; }
  .fp-stats { gap: 8px; margin-bottom: 24px; }
  .fp-stats > * { flex-direction: column; align-items: flex-start; gap: 10px; padding: 13px; }
  .fp-stats > * > svg:first-child { width: 18px; height: 18px; padding: 5px; border-radius: 8px; }
  .fp-stats button > svg:last-child { display: none; }
  .fp-stats b { font-size: 25px; }
  .fp-stats b i { font-size: 10px; }
  .fp-stats small { font-size: 9px; line-height: 1.7; }
  .fp-layout { display: flex; flex-direction: column; gap: 26px; }
  .fp-main, .fp-rail { width: 100%; }
  .fp-tabs { gap: 22px; }
  .fp-person { grid-template-columns: 23px 33px minmax(0, 1fr) auto; gap: 9px; padding: 16px 11px; }
  .fp-person-score { grid-column: 3; grid-row: 2; flex-direction: row; align-items: baseline; gap: 7px; }
  .fp-person-score b { font-size: 14px; }
  .fp-person-score small { font-size: 9px; }
  .fp-person .fp-place { grid-row: 1 / 3; }
  .fp-person .avatar { grid-row: 1 / 3; }
  .fp-person-actions { grid-column: 4; grid-row: 1 / 3; }
  .fp-person-name { gap: 4px; }
  .fp-person-name > bdi { font-size: 12px; }
  .fp-person-name small { font-size: 9px; }
  .fp-person-actions .fp-icon-btn { width: 28px; }
  .fp-person-actions .fp-challenge { padding: 5px 7px; }
  .fp-mine { max-width: 50px; }
  .fp-rail { display: grid; grid-template-columns: minmax(0, 1fr); }
  .fp-add-card { padding: 22px; }
  .fp-add-card form { margin-top: 17px; }
  .fp-request { flex-wrap: wrap; padding: 14px; }
  .fp-request-actions { width: 100%; padding-inline-start: 49px; }
  .fp-request-actions .btn { min-height: 37px; }
  .fp-invites article { flex-wrap: wrap; padding: 14px; }
  .fp-invites article > div { min-width: 180px; }
  .fp-invites article .btn { margin-inline-start: 32px; }
  .fp-load-error { flex-wrap: wrap; }
  .fp-footer { flex-wrap: wrap; font-size: 10px; }
  .fp-footer > span { width: 100%; margin-inline-start: 22px; }
  .fp-guest-layout { display: flex; flex-direction: column; padding-top: 10px; gap: 30px; }
  .fp-auth-card { order: -1; width: 100%; margin-top: 0; padding: 25px; }
  .fp-auth-symbol { width: 45px; height: 45px; border-radius: 13px; margin-bottom: 20px; }
  .fp-auth-card h2 { font-size: 25px; }
  .fp-auth-card .fp-google { margin-top: 21px; }
  .fp-guest-story { padding: 0 7px; }
  .fp-guest-story h2 { font-size: 32px; }
  .fp-guest-story > p { font-size: 13px; }
  .fp-guest-features { margin-top: 25px; gap: 20px; }
}
@media (max-width: 370px) { .fp-list-tools { flex-wrap: wrap; } .fp-search { flex-basis: 100%; } .fp-list-tools select { width: 100%; max-width: none; height: 35px; } .fp-tabs { gap: 16px; } .fp-tabs button { font-size: 12px; } .fp-heading { flex-wrap: wrap; } .fp-heading > .btn { width: 100%; } .fp-stats > * { padding: 11px; } .fp-stats small { font-size: 9px; } .fp-profile-strip > a { width: 100%; margin-inline-start: 54px; } }
@media (pointer: coarse) { .fp-tabs button { min-height: 44px; } .fp-icon-btn { width: 36px; height: 42px; } .fp-challenge { min-height: 38px; } .fp-person-actions .fp-icon-btn { width: 30px; height: 42px; } }
