/* Saudi Arabic — app styles. Mobile first, light + dark. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --text: #1c1b18;
  --muted: #6b6860;
  --line: #e3e1d9;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --accent-soft: #d8efec;
  --warn-soft: #fdf0d5;
  --warn-ink: #7a4d00;
  --bad: #b42318;
  --bad-soft: #fde7e5;
  --good: #067647;
  --good-soft: #dcfae6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-ar: "Noto Naskh Arabic", "Geeza Pro", "Arabic Typesetting", "Traditional Arabic", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121412;
    --surface: #1b1e1c;
    --surface-2: #232725;
    --text: #ecebe6;
    --muted: #a09d94;
    --line: #2f3431;
    --accent: #2bb3a3;
    --accent-ink: #06201d;
    --accent-soft: #163c38;
    --warn-soft: #3a2e14;
    --warn-ink: #f3c56b;
    --bad: #f97066;
    --bad-soft: #3d1a17;
    --good: #47cd89;
    --good-soft: #143325;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 2rem 1rem; }
[lang="ar"] { font-family: var(--font-ar); }

/* ---------- layout ---------- */
.container { max-width: 760px; margin: 0 auto; padding: 1rem 16px 3rem; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand [lang="ar"] { color: var(--accent); font-weight: 600; margin-left: .25rem; }
.tabs { display: flex; gap: .25rem; margin-left: auto; }
.tabs a {
  padding: .4rem .75rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500;
}
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.logout { color: var(--muted); text-decoration: none; font-size: .85rem; padding: .25rem; white-space: nowrap; }
@media (max-width: 420px) {
  .brand .en { display: none; }
  .brand [lang="ar"] { margin: 0; font-size: 1.15rem; }
  .tabs a { padding: .4rem .6rem; }
}

/* ---------- basics ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 10px; padding: .7rem 1.1rem; min-height: 44px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem .75rem; min-height: 44px; width: 100%;
}
input:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: block; font-weight: 500; }
label input { margin-top: .35rem; }
.stack > * + * { margin-top: .9rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
}
.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem;
  border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.badge.lvl-1 { background: var(--good-soft); color: var(--good); }
.badge.lvl-2 { background: var(--accent-soft); color: var(--accent); }
.badge.lvl-3 { background: var(--warn-soft); color: var(--warn-ink); }
.badge.sugg { background: var(--warn-soft); color: var(--warn-ink); }
.notice { padding: .75rem 1rem; border-radius: 10px; }
.notice.ok { background: var(--good-soft); color: var(--good); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- standalone pages (login, install) ---------- */
.page-narrow { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.panel {
  width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.login { text-align: center; max-width: 360px; }
.login form { text-align: left; }
.brand-big { font-family: var(--font-ar); font-size: 2.2rem; color: var(--accent); line-height: 2; }
.checks { list-style: none; padding: 0; margin: 1rem 0; }
.checks li { display: flex; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.checks .dot { font-weight: 700; width: 1.2rem; flex: none; }
.checks .pass .dot { color: var(--good); }
.checks .fail .dot { color: var(--bad); }
.fix { font-size: .9rem; color: var(--muted); margin-top: .2rem; }
pre.err { white-space: pre-wrap; font-size: .8rem; background: var(--bad-soft); color: var(--bad); padding: .6rem; border-radius: 8px; }

/* ---------- home ---------- */
.hero { margin: .5rem 0 1.25rem; }
.hero .ar-greet { font-family: var(--font-ar); font-size: 1.6rem; color: var(--accent); line-height: 1.9; }
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1.25rem; }
.level-tile { text-decoration: none; color: var(--text); text-align: center; padding: 1rem .5rem; }
.level-tile .n { font-size: 1.6rem; font-weight: 700; }
.level-tile .t { font-size: .85rem; color: var(--muted); }
.soon { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; }
.cat-list a {
  display: flex; justify-content: space-between; text-decoration: none; color: var(--text);
  padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.cat-list a span:last-child { color: var(--muted); }

/* ---------- browse ---------- */
.filters { display: grid; gap: .6rem; margin-bottom: 1rem; }
.filter-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .9rem; cursor: pointer; min-height: 36px;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-row select { flex: 1 1 180px; width: auto; }
.toggle { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; cursor: pointer; }
.filter-row .toggle { white-space: nowrap; }
.toggle input { width: auto; min-height: 0; margin: 0; }
.count-line { font-size: .9rem; color: var(--muted); margin: .25rem 0 .75rem; }
.phrase-list { display: grid; gap: .6rem; }
.phrase { padding: .9rem 1rem; }
.phrase .top { display: flex; align-items: flex-start; gap: .75rem; }
.phrase .ar {
  flex: 1; font-family: var(--font-ar); font-size: 1.75rem; line-height: 2.1;
  text-align: right; direction: rtl;
}
.phrase .tr { color: var(--accent); font-style: italic; }
.phrase .en { font-weight: 500; }
.phrase .note { font-size: .88rem; color: var(--muted); margin-top: .25rem; }
.phrase .meta { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 1.1rem; cursor: pointer;
}
.icon-btn:active { transform: scale(.95); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- forms extras ---------- */
.block { width: 100%; }
.field-label { font-weight: 500; margin-bottom: .35rem; }
.help { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); margin-top: .3rem; }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .9rem;
  padding: .5rem .25rem; border-radius: 8px; cursor: pointer; min-height: 40px;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 10px; max-width: calc(100% - 32px);
}

/* ---------- home: today ---------- */
.today { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.today h2 { margin: 0 0 .15rem; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .4rem; text-align: center; }
.stat b { display: block; font-size: 1.25rem; }
.stat span { font-size: .75rem; color: var(--muted); }
.cat-list + p, .levels + h2 { margin-top: 1rem; }

/* ---------- study ---------- */
.study-counts { display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.study-top { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.study-top .x { text-decoration: none; color: var(--muted); font-size: 1.2rem; padding: .25rem .4rem; }
.study-top .bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.study-top .bar span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.study-top .left { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.flashcard {
  min-height: 300px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: .5rem; padding: 1.25rem 1rem; cursor: pointer; position: relative; user-select: none;
}
.flashcard.flipped { cursor: default; }
.fc-meta { position: absolute; top: .75rem; left: .75rem; right: .75rem; display: flex; gap: .35rem; align-items: center; }
.fc-meta .icon-btn { margin-left: auto; }
.fc-ar { font-family: var(--font-ar); font-size: 2.4rem; line-height: 2.1; direction: rtl; margin-top: 1.5rem; }
.fc-ar.sm { font-size: 1.7rem; margin-top: 0; }
.fc-en { font-size: 1.5rem; font-weight: 600; margin-top: 1.5rem; }
.fc-en.sm { font-size: 1.2rem; margin-top: 0; }
.fc-hint { color: var(--muted); font-size: .9rem; }
.flipped .fc-hint { display: none; }
.fc-back { border-top: 1px dashed var(--line); padding-top: .75rem; margin-top: .5rem; width: 100%; display: grid; gap: .3rem; }
.fc-back .fc-ar { margin-top: 0; }
.fc-back .tr { color: var(--accent); font-style: italic; font-size: 1.05rem; }
.fc-back .note { font-size: .9rem; color: var(--muted); }
.fc-actions { margin-top: 1rem; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.rate-btn {
  border: 0; border-radius: 12px; padding: .6rem .25rem; min-height: 60px; font: inherit; font-weight: 600;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
}
.rate-btn small { font-weight: 500; font-size: .75rem; opacity: .8; }
.rate-btn:disabled { opacity: .5; }
.rate-btn.again { background: var(--bad-soft); color: var(--bad); }
.rate-btn.hard { background: var(--warn-soft); color: var(--warn-ink); }
.rate-btn.good { background: var(--good-soft); color: var(--good); }
.rate-btn.easy { background: var(--accent-soft); color: var(--accent); }
.kbd-hint { text-align: center; font-size: .8rem; margin-top: .75rem; }
@media (hover: none) { .kbd-hint { display: none; } }
.icon-btn.sm { width: 36px; height: 36px; font-size: .95rem; }
.done { padding: 2rem 1.25rem; }
.done .big { font-size: 3rem; }

/* ---------- quiz ---------- */
.quiz-q {
  min-height: 190px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: .35rem; padding: 1.25rem 1rem; position: relative;
}
.options { display: grid; gap: .5rem; margin-top: 1rem; }
.opt {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--line); border-radius: 12px;
  padding: .7rem .9rem; min-height: 56px; font: inherit; font-weight: 500; cursor: pointer;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt .k {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 700;
}
.opt .t { flex: 1; }
.ar-opts .opt .t { text-align: right; font-family: var(--font-ar); font-size: 1.4rem; line-height: 1.9; }
.opt:disabled { cursor: default; opacity: .55; }
.opt.right { border-color: var(--good); background: var(--good-soft); opacity: 1; }
.opt.right .k { background: var(--good); color: var(--surface); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); opacity: 1; }
.opt.wrong .k { background: var(--bad); color: var(--surface); }
.typed { margin-top: 1rem; display: grid; gap: .6rem; }
.typed input { font-size: 1.15rem; min-height: 52px; }
.row { display: flex; gap: .5rem; align-items: center; }
.row .btn { flex: 1; }
.feedback { margin-top: 1rem; display: grid; gap: .6rem; }
.verdict { font-weight: 700; font-size: 1.1rem; }
.verdict.ok { color: var(--good); }
.verdict.close { color: var(--warn-ink); }
.verdict.bad { color: var(--bad); }
.yours { font-size: .95rem; color: var(--muted); }
.strike { text-decoration: line-through; text-decoration-color: var(--bad); }
.answer { background: var(--surface-2); border-radius: 10px; padding: .6rem .8rem; text-align: center; display: grid; gap: .2rem; }
.answer .fc-ar { margin: 0; }
.answer .tr { color: var(--accent); font-style: italic; }
.answer .en { font-weight: 600; }
.answer .note { font-size: .88rem; color: var(--muted); }
.today + .today { margin-top: -.25rem; }
@media (max-width: 380px) {
  .brand { display: none; }
  .tabs { margin-left: 0; flex: 1; justify-content: space-between; }
  .tabs a { padding: .4rem .55rem; }
}

/* ---------- streak & progress ---------- */
:root {
  --heat-1: #c9ebe6; --heat-2: #8fd3c9; --heat-3: #3fa89b; --heat-4: #0f766e;
  --freeze: #d6e6fb; --freeze-ink: #1d4f91;
}
@media (prefers-color-scheme: dark) {
  :root {
    --heat-1: #173f3a; --heat-2: #1f6a61; --heat-3: #2a9a8c; --heat-4: #4fd1c1;
    --freeze: #1d3450; --freeze-ink: #9cc3f5;
  }
}
.small { font-size: .85rem; }
.grow { flex: 1; min-width: 0; }
.streak-card {
  display: flex; align-items: center; gap: .9rem; margin-bottom: .75rem; text-decoration: none; color: var(--text);
}
.streak-card .flame { font-size: 2rem; line-height: 1; }
.flame.off { filter: grayscale(1); opacity: .45; }
.streak-n { font-weight: 700; font-size: 1.15rem; }
.streak-card .chev { color: var(--muted); font-size: 1.5rem; }
.goal-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: .35rem 0 .3rem; }
.goal-bar span { display: block; height: 100%; background: var(--warn-ink); border-radius: 999px; transition: width .3s; }
.streak-card.met .goal-bar span { background: var(--good); }
.big-streak { margin-bottom: 1rem; }
.big-streak .flame { font-size: 3rem; }
.big-streak .streak-n { font-size: 1.6rem; }
a.stats-row.plain { text-decoration: none; color: var(--text); }

.card + .card, .stats-row + .card, .card + .stats-row { margin-top: .75rem; }
.stats-row + .card { margin-top: 0; }
.cal-wrap { overflow: hidden; }
.cal-months { display: grid; gap: 3px; font-size: .7rem; color: var(--muted); margin-bottom: 3px; }
.cal-months span { white-space: nowrap; overflow: visible; }
.cal { display: grid; gap: 3px; }
.cal-col { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.cal-cell {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 3px; background: var(--surface-2);
  font-size: .55rem; color: var(--freeze-ink); cursor: default; min-width: 8px;
}
.cal-cell[data-tip] { cursor: pointer; }
.cal-cell.s1 { background: var(--heat-1); }
.cal-cell.s2 { background: var(--heat-2); }
.cal-cell.s3 { background: var(--heat-3); }
.cal-cell.s4 { background: var(--heat-4); }
.cal-cell.frozen { background: var(--freeze); }
.cal-cell.future { background: transparent; border: 1px dashed var(--line); }
.cal-cell.today { outline: 2px solid var(--text); outline-offset: 1px; }
.cal-legend { display: flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--muted); margin-top: .6rem; flex-wrap: wrap; }
.cal-legend .cal-cell { width: 12px; }
.cal-legend .cal-cell.frozen { margin-left: .75rem; }
.cal-tip { font-size: .85rem; margin-top: .4rem; min-height: 1.3em; }

.legend { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: .5rem; }
.legend .key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: .4rem; }
.legend .key.m { background: var(--heat-4); }
.legend .key.l { background: var(--heat-2); }
.legend .key.n { background: var(--surface-2); border: 1px solid var(--line); }
.bar-row { display: grid; grid-template-columns: minmax(110px, 44%) 1fr auto; align-items: center; gap: .6rem; padding: .35rem 0; }
.bar-row.link { text-decoration: none; color: var(--text); border-radius: 6px; }
.bar-row.link:hover .sbar { outline: 1px solid var(--line); }
.bar-label { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-val { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sbar { display: flex; gap: 2px; height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sbar span { height: 100%; border-radius: 4px; }
.sbar .m { background: var(--heat-4); }
.sbar .l { background: var(--heat-2); }
.weak-list { display: grid; gap: .4rem; }
.weak { display: grid; grid-template-columns: 1fr auto; gap: 0 .75rem; padding: .5rem .6rem; background: var(--surface-2); border-radius: 10px; }
.weak .ar { grid-column: 1 / -1; font-family: var(--font-ar); font-size: 1.35rem; line-height: 1.8; text-align: right; direction: rtl; }
.weak .en { font-size: .9rem; }
.weak .miss { font-size: .8rem; color: var(--bad); white-space: nowrap; }

/* ---------- settings: email ---------- */
.notif-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.notif-row .toggle { flex: 1 1 160px; }
.notif-row input[type="time"], .notif-row select { width: auto; flex: 0 0 auto; }
.notif-row + .help { margin-top: -.6rem; }
.stack label .help { margin-top: .3rem; }
.howto summary { cursor: pointer; font-weight: 500; color: var(--accent); }
.howto ol { padding-left: 1.2rem; margin: .6rem 0; }
.howto li { margin-bottom: .4rem; }
.howto pre, .howto code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem;
  background: var(--surface-2); border-radius: 6px; padding: .1rem .35rem; word-break: break-all; white-space: pre-wrap;
}
.howto pre { padding: .5rem .6rem; margin: .35rem 0 0; }
.email-log { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .85rem; }
.email-log li { padding: .2rem 0; border-top: 1px solid var(--line); }
.err-text { color: var(--bad); }

/* ---------- manage / edit ---------- */
.page-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.page-head h1 { margin: 0 auto 0 0; }
.btn.sm { min-height: 36px; padding: .4rem .8rem; font-size: .9rem; }
a.icon-btn { display: grid; place-items: center; text-decoration: none; }
.icon-btn.edit { width: 36px; height: 36px; font-size: .95rem; color: var(--muted); background: transparent; }
.ar-input { font-family: var(--font-ar); font-size: 1.5rem; min-height: 56px; line-height: 1.8; }
.req { color: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
.two label input[name="category_new"] { margin-top: .4rem; }
.marks { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.mark {
  min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
  color: var(--text); font-family: var(--font-ar); font-size: 1.4rem; cursor: pointer; line-height: 1;
}
.mark.wide { font-family: var(--font); font-size: .85rem; padding: 0 .6rem; }
.preview { font-family: var(--font-ar); font-size: 1.3rem; color: var(--text); }
#harakat-warn { margin-top: .5rem; }
.danger-zone { display: flex; gap: .5rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: .9rem; }
.btn.danger { color: var(--bad); }
.manage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.manage-grid a {
  text-decoration: none; color: var(--text); text-align: center; padding: .6rem .3rem;
  background: var(--surface-2); border-radius: 10px;
}
.manage-grid b { display: block; font-size: 1.3rem; }
.manage-grid span { font-size: .75rem; color: var(--muted); }
.file-drop {
  display: flex; align-items: center; justify-content: center; min-height: 72px; border: 2px dashed var(--line);
  border-radius: 12px; cursor: pointer; color: var(--accent); font-weight: 600; text-align: center; padding: .75rem;
}
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop:focus-within { border-color: var(--accent); }
textarea {
  width: 100%; font: .9rem/1.5 ui-monospace, Menlo, monospace; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: .6rem; margin: .5rem 0;
}
details summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.import-sum { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.import-list { display: grid; gap: .4rem; max-height: 60vh; overflow: auto; margin-bottom: .75rem; }
.import-row { padding: .5rem .7rem; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--line); }
.import-row.new { border-left-color: var(--good); }
.import-row.error { border-left-color: var(--bad); }
.import-row .ir-head { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; font-size: .8rem; }
.import-row .ir-ar { font-family: var(--font-ar); font-size: 1.3rem; line-height: 1.8; text-align: right; }
.import-row .tr { color: var(--accent); font-style: italic; }
.bad-badge { background: var(--bad-soft); color: var(--bad); }
.warn-text { color: var(--warn-ink); }
.dl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem; }
.foot-links { text-align: center; display: flex; gap: 1.25rem; justify-content: center; margin-top: 1rem; }
