:root {
  --bg: #f3f5fb;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --border: #e4e7f1;
  --text: #141a33;
  --muted: #667090;
  --primary: #5b2aa3;
  --primary-600: #47208a;
  --primary-50: #f2ecfc;
  --navy: #2a1060;
  --gold: #f79e0e;
  --danger: #d33a4a;
  --warn: #b7791f;
  --warn-bg: #fff6e6;
  --ok: #18875a;
  --ok-bg: #e7f7ef;
  --info-bg: #eaf1ff;
  /* performance bands */
  --excellent: #18875a;
  --vgood: #2f7fd1;
  --good: #6a3fc0;
  --pass: #c27b10;
  --weak: #d33a4a;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 26, 51, .04), 0 8px 24px rgba(20, 26, 51, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1222;
    --surface: #161b30;
    --surface-2: #1b2139;
    --border: #2a3152;
    --text: #e8ebf7;
    --muted: #9aa3c2;
    --primary: #a685f5;
    --primary-600: #bba2fa;
    --primary-50: #2a1d50;
    --warn-bg: #33270f;
    --warn: #f0b75a;
    --ok-bg: #11301f;
    --ok: #4cc98b;
    --info-bg: #1a2546;
    --excellent: #38c07e;
    --vgood: #5aa6f0;
    --good: #a685f5;
    --pass: #e7a43a;
    --weak: #f06473;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .25em; line-height: 1.3; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75em; }
code { overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.text-center { text-align: center; }
.text-warn { color: var(--warn); font-weight: 600; }
.print-only { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; color: inherit; padding: 6px; border-radius: 8px; cursor: pointer; }

/* ---------- topbar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1400px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand img { border-radius: 50%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; }
.brand-text small { color: var(--muted); font-size: .75rem; }
.user-menu { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.user-menu form { margin: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700;
  background: var(--primary-50); color: var(--primary);
}
.avatar-lg { width: 72px; height: 72px; font-size: 1.8rem; background: linear-gradient(135deg, var(--primary), var(--navy)); color: #fff; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; max-width: 220px; }
.user-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--muted); font-size: .75rem; }
.nav-toggle { display: none; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 20px 40px; flex: 1; }
.center-page { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card.p-0 { padding: 0; overflow: hidden; }
.card.narrow { max-width: 480px; margin-inline: auto; }
.card.narrow-wide { max-width: 760px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 { margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-block; font-size: .88rem; margin-bottom: 6px; }
.site-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }
.big-icon { font-size: 2.2rem; width: 64px; height: 64px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-50); color: var(--primary); font-weight: 700; }
.empty-state { text-align: center; padding: 48px 22px; }

/* ---------- alerts / tags ---------- */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid transparent; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; transition: opacity .4s; }
.alert.fade { opacity: 0; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert-error { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert-info { background: var(--info-bg); color: var(--primary); }
.alert .btn { margin-inline-start: auto; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-muted { background: var(--surface-2); color: var(--muted); }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.tag.band-excellent { background: color-mix(in srgb, var(--excellent) 14%, transparent); color: var(--excellent); }
.tag.band-vgood { background: color-mix(in srgb, var(--vgood) 14%, transparent); color: var(--vgood); }
.tag.band-good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.tag.band-pass { background: color-mix(in srgb, var(--pass) 14%, transparent); color: var(--pass); }
.tag.band-weak { background: color-mix(in srgb, var(--weak) 14%, transparent); color: var(--weak); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .88rem; }
input[type=text], input[type=password], input[type=search], input[type=number], input:not([type]), select {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
input[dir=ltr] { text-align: left; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 70px; }
.pw-toggle { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font: inherit; font-size: .8rem; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.hint { margin-top: 20px; background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 14px 16px; font-size: .88rem; color: var(--muted); }
.hint ul { margin: 8px 0 0; padding-inline-start: 18px; }
.hint li { margin-bottom: 4px; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { width: 44px; height: 24px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: right .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { right: 23px; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; color: var(--primary); background: var(--surface-2); position: relative; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-50); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone b { color: var(--text); }
.w-num { max-width: 110px; }
.w-40 { width: 34%; }
.danger-title { color: var(--danger); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: start; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 3%, transparent); }
.table.compact th, .table.compact td { padding: 9px 10px; }
.card > .table th:first-child, .card > .table td:first-child { padding-inline-start: 0; }
.card.p-0 .table th:first-child, .card.p-0 .table td:first-child { padding-inline-start: 22px; }
.row-actions { text-align: end; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; min-width: 150px; }

/* bars */
.bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); min-width: 60px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.bar.band-excellent i { background: var(--excellent); }
.bar.band-vgood i { background: var(--vgood); }
.bar.band-good i { background: var(--good); }
.bar.band-pass i { background: var(--pass); }
.bar.band-weak i { background: var(--weak); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 500; }
.stat b { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat small { color: var(--muted); font-size: .78rem; }
.stat-link { text-decoration: none !important; transition: border-color .15s; }
.stat-link:hover { border-color: var(--primary); }
.stat-warn b { color: var(--warn); }

/* ---------- admin layout ---------- */
.admin-layout { display: grid; grid-template-columns: 250px 1fr; flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; }
.sidebar { padding: 20px 14px; border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; gap: 20px; position: sticky; top: 57px; height: calc(100vh - 57px); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; color: var(--muted); font-weight: 500; text-decoration: none; }
.sidebar nav a:hover { background: var(--surface); color: var(--text); }
.sidebar nav a.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.sidebar-foot { margin-top: auto; }
.admin-main { padding: 26px 28px 40px; min-width: 0; }
.admin .site-footer { border-top: 1px solid var(--border); }

/* score editor */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.score-field { display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.score-field > span { font-weight: 600; font-size: .88rem; }
.score-input { display: flex; align-items: center; gap: 8px; }
.score-input input { text-align: center; font-weight: 700; font-size: 1.05rem; }
.score-input em { font-style: normal; color: var(--muted); white-space: nowrap; }

/* ---------- login ---------- */
.login-page { background: var(--surface); }
.login-wrap { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; color: #fff; display: grid; place-items: center; padding: 40px;
  background: radial-gradient(circle at 30% 20%, #4f63e6 0%, #1b2a6b 55%, #0c1440 100%);
}
.hero-copy { position: relative; text-align: center; max-width: 360px; }
.hero-copy img { border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.3); margin-bottom: 16px; }
.hero-copy h2 { font-size: 2rem; margin-bottom: 8px; }
.hero-copy p { color: rgba(255,255,255,.8); font-size: 1.05rem; }
.orbit { position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.orbit-1 { width: 520px; height: 520px; }
.orbit-2 { width: 820px; height: 820px; border-color: rgba(242,179,61,.18); }
.orbit-1::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); top: 40px; right: 90px; box-shadow: 0 0 20px var(--gold); }
.login-panel { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.7rem; }

/* ---------- student report ---------- */
.profile-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface) 60%, var(--primary-50) 100%); }
.profile-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.eyebrow { color: var(--primary); font-weight: 600; font-size: .8rem; margin-bottom: 2px; letter-spacing: .02em; }
.student-name { font-size: 1.55rem; word-break: break-word; }
.meta-list { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 0; }
.meta-list div { display: flex; flex-direction: column; }
.meta-list dt { color: var(--muted); font-size: .76rem; }
.meta-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-ring { display: flex; align-items: center; gap: 16px; --c: var(--primary); }
.score-ring.band-excellent { --c: var(--excellent); }
.score-ring.band-vgood { --c: var(--vgood); }
.score-ring.band-good { --c: var(--good); }
.score-ring.band-pass { --c: var(--pass); }
.score-ring.band-weak { --c: var(--weak); }
.ring { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--border) 0); }
.ring::before { content: ''; grid-area: 1 / 1; width: 88px; height: 88px; border-radius: 50%; background: var(--surface); }
.ring-value { grid-area: 1 / 1; position: relative; font-weight: 700; font-size: 1.3rem; color: var(--c); font-variant-numeric: tabular-nums; direction: ltr; }
.ring-meta { display: flex; flex-direction: column; gap: 2px; }
.ring-meta strong { color: var(--c); font-size: 1.15rem; }
.ring-meta span { color: var(--muted); font-size: .88rem; }
.ring-meta b { color: var(--text); }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.summary-strip div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.summary-strip span { color: var(--muted); font-size: .78rem; }
.summary-strip b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th { text-align: start; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.results-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .subject { font-weight: 600; }
.results-table .score b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.results-table .pct { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.results-table .pct .bar { flex: 1; }
.pct-num { width: 44px; text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; direction: ltr; }
.footnote { color: var(--muted); font-size: .8rem; margin: 16px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .sidebar { position: fixed; top: 57px; right: 0; bottom: 0; height: auto; width: 260px; background: var(--surface); z-index: 30; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .admin-main { padding: 20px 16px 32px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .login-page { overflow-x: hidden; }
  .login-hero { min-height: 220px; padding: 28px 16px; }
  .hero-copy h2 { font-size: 1.5rem; }
  .hero-copy img { width: 52px; height: 52px; }
  .orbit-1 { width: 360px; height: 360px; }
  .login-panel { padding: 0 16px 32px; background: var(--surface); }
  .login-card { margin-top: -28px; position: relative; padding: 24px 20px; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 16px; gap: 8px; }
  .brand-text small, .user-meta { display: none; }
  .container { padding: 16px 16px 32px; }
  .card { padding: 18px 16px; }
  .grid-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .profile-main { flex-direction: column; }
  .avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }
  .results-table thead { display: none; }
  .results-table, .results-table tbody, .results-table tr, .results-table td { display: block; width: 100%; }
  .results-table tr { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; background: var(--surface-2); }
  .results-table td { border: 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .results-table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 500; }
  .results-table td.subject { font-size: 1.02rem; }
  .results-table td.subject::before { display: none; }
  .results-table .pct { min-width: 0; }
  .results-table .pct .bar { max-width: 55%; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 1.5rem; }
}

/* ---------- print ---------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .no-print, .topbar, .site-footer, .alert { display: none !important; }
  .print-only { display: flex !important; }
  .print-head { align-items: center; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 16px; }
  .container { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; background: #fff !important; }
  .results-table thead { display: table-header-group !important; }
  .bar, .ring { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* total score box (student profile) */
.total-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 150px; padding: 16px 24px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); --c: var(--primary); }
.total-box.band-excellent { --c: var(--excellent); } .total-box.band-vgood { --c: var(--vgood); } .total-box.band-good { --c: var(--good); }
.total-box.band-pass { --c: var(--pass); } .total-box.band-weak { --c: var(--weak); }
.total-box span { color: var(--muted); font-size: .85rem; }
.total-box b { font-size: 2.4rem; line-height: 1.1; color: var(--c); font-variant-numeric: tabular-nums; }
.total-box strong { color: var(--c); font-size: 1rem; }
.results-table .score-val { font-size: 1.2rem; }

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .85rem; text-decoration: none !important; white-space: nowrap; transition: border-color .15s, color .15s; }
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- LTR (English) adjustments ---------- */
html[dir=ltr] .pw-wrap input { padding-left: 12px; padding-right: 70px; }
html[dir=ltr] .pw-toggle { left: auto; right: 6px; }
html[dir=ltr] .switch i::after { right: auto; left: 3px; transition: left .2s; }
html[dir=ltr] .switch input:checked + i::after { right: auto; left: 23px; }
@media (max-width: 860px) {
  html[dir=ltr] .sidebar { right: auto; left: 0; transform: translateX(-100%); }
  html[dir=ltr] .sidebar.open { transform: none; }
}
@media (max-width: 640px) { .lang-switch span { display: none; } .lang-switch { padding: 7px; } }
