/* SIGS — مدرسة بوابة الذكاء الفائق · نظام التصميم (النسخة التجريبية المستقلة)
   كحلي عميق، عاجي، لمسات نحاسية. التابلت أولاً، RTL، لمس ≥ 44px، تباين AA. */
:root {
  --navy-900: #0d1e31; --navy-800: #13283f; --navy-700: #1b3654; --navy-600: #24466b; --navy-100: #e6ecf3;
  --ivory: #f6f2e9; --ivory-2: #efe8d9; --paper: #fffdf8; --line: #e4dccb; --line-2: #d6ccb6;
  --copper: #9c6339; --copper-600: #87542f; --copper-300: #c79a72; --copper-100: #f4e7da; --gold: #b0894a;
  --ink: #142334; --ink-2: #3c4654; --muted: #6a6253; --ok: #2c7a4f; --ok-100: #e3f2e9; --bad: #b0412e; --bad-100: #f8e4e0;
  --warn: #946200; --warn-100: #fbf0d6; --info: #24466b; --info-100: #e6eef7;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(19,40,63,.06), 0 6px 18px rgba(19,40,63,.06);
  --font: 'Thmanyah Sans', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Thmanyah Serif Display', 'Thmanyah Sans', 'IBM Plex Sans Arabic', Georgia, serif;   /* العناوين (دليل جماليات ثمانية) */
  --font-math: 'Cambria Math', 'STIX Two Math', 'Segoe UI', serif;
  --side-w: 240px; --top-h: 68px;
}
* { box-sizing: border-box; }
svg { width: 1.25em; height: 1.25em; vertical-align: -.22em; flex: none; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--ivory); color: var(--ink); font-size: 16px; line-height: 1.7; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.35; color: var(--navy-900); font-weight: 700; }
h1 { font-size: clamp(1.6rem, 2.4vw + .8rem, 2.4rem); font-family: var(--font-display); }
.ox-h1 { font-family: var(--font-display); }
h2 { font-size: clamp(1.25rem, 1.2vw + .8rem, 1.6rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
a { color: var(--navy-600); }
small, .muted { color: var(--muted); }
.m, bdi.m { font-family: var(--font-math); direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-weight: 600; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .06em; direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 3px solid var(--copper-300); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--navy-800); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: 0 20px; border-radius: 12px;
  border: 1.5px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--copper-600); }
.btn-navy { background: var(--navy-800); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: var(--paper); color: var(--navy-800); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--ivory-2); }
.btn-outline-copper { background: transparent; color: var(--copper-600); border-color: var(--copper-300); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: #e3b5ab; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--navy-600); text-decoration: underline; font: inherit; cursor: pointer; padding: 6px; min-height: 44px; }
label.field { display: block; margin-bottom: 16px; }
label.field > span, .field-label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy-900); }
.req { color: var(--bad); margin-inline-start: 2px; }
.input, select.input, textarea.input { width: 100%; min-height: 50px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: var(--paper); font: inherit; color: var(--ink); }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { border-color: var(--navy-600); outline: none; box-shadow: 0 0 0 3px rgba(36,70,107,.15); }
.input[readonly], .input:disabled { background: var(--ivory-2); color: var(--ink-2); }
.input.code-input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; direction: ltr; text-align: center; font-size: 1.25rem; }
.field-hint { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.field-error { color: var(--bad); font-size: .92rem; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--copper); }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.card-head .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--copper-100); color: var(--copper-600); display: grid; place-items: center; flex: none; }
.card-head .ico svg { width: 22px; height: 22px; }
.ornament { height: 2px; width: 70px; background: linear-gradient(90deg, transparent, var(--copper-300), transparent); margin: 6px 0 14px; position: relative; }
.ornament::after { content: '✦'; position: absolute; inset-inline-start: 31px; top: -10px; color: var(--copper-300); font-size: 12px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: .86rem; font-weight: 600; background: var(--ivory-2); color: var(--ink-2); white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.chip-ok { background: var(--ok-100); color: var(--ok); }
.chip-bad { background: var(--bad-100); color: var(--bad); }
.chip-warn { background: var(--warn-100); color: var(--warn); }
.chip-info { background: var(--info-100); color: var(--info); }
.chip-copper { background: var(--copper-100); color: var(--copper-600); }
.trial-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; background: #f1e4d6; color: #7a4a26; font-size: .82rem; font-weight: 700; border: 1px solid #e3cdb5; white-space: nowrap; }
.trial-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #a4532f; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--copper); display: inline-block; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy-800); color: #dfe6ee; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px;
  background-image: radial-gradient(circle at 20% 110%, rgba(176,137,74,.18), transparent 45%); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 6px 18px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 14px; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand b { display: block; font-size: 1.45rem; letter-spacing: .04em; line-height: 1.1; font-family: 'Thmanyah Serif Display', Georgia, 'Times New Roman', serif; font-weight: 700; }
.brand small { display: block; color: #cdbb98; font-size: .78rem; line-height: 1.3; }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 48px; border-radius: 12px; color: #dfe6ee; text-decoration: none; font-weight: 500; }
.side nav a svg { width: 22px; height: 22px; flex: none; opacity: .9; }
.side nav a:hover { background: rgba(255,255,255,.07); }
.side nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(156,99,57,.9), rgba(176,124,82,.95)); color: #fff; box-shadow: inset -3px 0 0 #e6c79b; }
.side nav .sep { height: 1px; background: rgba(255,255,255,.12); margin: 10px 6px; }
.side .side-foot { padding: 10px 6px 0; color: #b9c4d1; font-size: .82rem; text-align: center; }
.side .side-art { height: 90px; margin-top: 8px; opacity: .55; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 26px; background: rgba(255,253,248,.9); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.top .menu-btn { display: none; }
.icon-btn { width: 46px; height: 46px; border-radius: 12px; border: 0; background: transparent; color: var(--navy-800); cursor: pointer; display: grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--ivory-2); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn .count { position: absolute; top: 6px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--copper); color: #fff; font-size: .72rem; display: grid; place-items: center; padding: 0 4px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 12px; }
.user-chip .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--copper-100); color: var(--copper-600); display: grid; place-items: center; font-weight: 700; }
.user-chip b { display: block; line-height: 1.2; }
.user-chip small { display: block; line-height: 1.2; }
.content { padding: 28px 30px 60px; max-width: 1240px; width: 100%; }
.page-title { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title h1 { margin: 0; }
.page-title .sub { color: var(--muted); }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
.save-state.pending { color: var(--warn); }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--bad); }

/* ---------- toast & modal ---------- */
.toast-wrap { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
[dir="rtl"] .toast-wrap { transform: translateX(50%); }
.toast { background: var(--navy-800); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }
.modal-bg { position: fixed; inset: 0; background: rgba(13,30,49,.45); display: grid; place-items: center; z-index: 150; padding: 16px; }
.modal { background: var(--paper); border-radius: 18px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal h2 { margin-bottom: 10px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 18px; flex-wrap: wrap; }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { background: var(--ivory-2); color: var(--navy-900); font-weight: 700; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.sel td { background: var(--copper-100); }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 14px 4px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }
.empty svg { width: 46px; height: 46px; color: var(--line-2); display: block; margin: 0 auto 8px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 0 14px; min-height: 48px; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--copper-600); border-bottom-color: var(--copper); }
.tabs button .opt { font-weight: 400; font-size: .8rem; color: var(--muted); }

/* ---------- stats ---------- */
.stat { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.stat .ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.stat .ico svg { width: 28px; height: 28px; }
.stat b { display: block; font-size: 1.65rem; line-height: 1.2; color: var(--navy-900); }
.stat small { display: block; }
.stat.blue { background: #eef3f9; } .stat.blue .ico { background: #d9e5f3; color: var(--navy-600); }
.stat.copper { background: #fbf4ec; } .stat.copper .ico { background: var(--copper-100); color: var(--copper-600); }
.stat.green { background: #f1f7f2; } .stat.green .ico { background: #dcebe0; color: var(--ok); }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .kpi-top { display: flex; gap: 10px; align-items: flex-start; }
.kpi .kpi-top .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--copper-100); color: var(--copper-600); display: grid; place-items: center; flex: none; margin-inline-start: auto; }
.kpi .kpi-top .ico svg { width: 22px; height: 22px; }
.kpi b.v { font-size: 2.1rem; line-height: 1.1; color: var(--navy-900); }
.kpi .def { font-size: .82rem; color: var(--muted); }
.progress { height: 8px; background: var(--ivory-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--gold); border-radius: 99px; width: 0; }

/* ---------- stepper ---------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin: 4px 0 22px; }
.stepper .st { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; color: var(--muted); font-size: .9rem; }
.stepper .st i { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-style: normal; font-weight: 700; background: var(--paper); }
.stepper .st.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .st.cur { color: var(--navy-900); font-weight: 700; }
.stepper .st.cur i { background: var(--navy-800); border-color: var(--copper-300); color: #fff; box-shadow: 0 0 0 3px var(--copper-100); }
.stepper .bar { height: 2px; width: 70px; background: var(--line-2); margin-bottom: 26px; }
.stepper .bar.done { background: var(--ok); }

/* ---------- landing ---------- */
.land-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 32px; border-bottom: 1px solid var(--line-2); gap: 16px; flex-wrap: wrap; }
.land-top nav { display: flex; gap: 22px; }
.land-top nav a { color: var(--navy-800); text-decoration: none; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.land-brand { display: flex; align-items: center; gap: 12px; color: var(--navy-900); text-decoration: none; }
.land-brand svg { width: 64px; height: 64px; }
.land-brand b { font-family: 'Thmanyah Serif Display', Georgia, 'Times New Roman', serif; font-size: 2rem; letter-spacing: .05em; display: block; line-height: 1; }
.land-brand small { display: block; font-weight: 700; color: var(--navy-800); }
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; padding: 34px 32px 10px; max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: .2em; }
.hero p.lead { font-size: 1.3rem; color: var(--ink-2); }
.hero-art { border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); background: linear-gradient(180deg, #f3e7d3, #e8d6b7); aspect-ratio: 16 / 10; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding: 26px 32px 40px; max-width: 1280px; margin: 0 auto; }
.role-card { border: 1px solid var(--line-2); border-radius: 18px; padding: 24px; text-align: center; background: var(--paper); position: relative; }
.role-card::before { content: ''; position: absolute; inset: 7px; border: 1px solid var(--copper-100); border-radius: 13px; pointer-events: none; }
.role-card .ico { width: 78px; height: 78px; border-radius: 50%; background: var(--copper-100); color: var(--copper-600); display: grid; place-items: center; margin: 0 auto 10px; }
.role-card .ico svg { width: 38px; height: 38px; }
.role-card h2 { margin-bottom: .1em; }
.role-card p { color: var(--ink-2); }
.role-card .btn { width: 100%; position: relative; }
.land-foot { text-align: center; color: var(--muted); padding: 10px 16px 30px; font-size: .9rem; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }
.auth-main { padding: 26px clamp(16px, 4vw, 54px); }
.auth-side { background: var(--navy-800); color: #eadfca; padding: 40px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background-image: radial-gradient(circle at 50% 0%, rgba(199,154,114,.25), transparent 55%); }
.auth-side h2 { color: #fff; }
.auth-side svg.big { width: 220px; height: 220px; margin-bottom: 18px; }
.auth-card { max-width: 620px; margin: 30px auto 0; }
.device-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.device-pick label { border: 1.5px solid var(--line-2); border-radius: 14px; padding: 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; background: var(--paper); min-height: 76px; }
.device-pick label:has(input:checked) { border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-100); }
.device-pick input { accent-color: var(--copper); width: 20px; height: 20px; }
.device-pick .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--ivory-2); display: grid; place-items: center; flex: none; }
.device-pick .ico svg { width: 24px; height: 24px; }

/* ---------- nickname grid ---------- */
.nick-group h3 { font-size: 1rem; color: var(--muted); margin: 16px 0 8px; }
.nick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.nick { border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); padding: 14px 8px; text-align: center; cursor: pointer; font: inherit; color: var(--ink); min-height: 120px; position: relative; }
.nick svg { width: 40px; height: 40px; color: var(--copper); display: block; margin: 0 auto 6px; }
.nick b { display: block; font-size: 1.05rem; }
.nick small { display: block; }
.nick[aria-pressed="true"] { background: var(--navy-800); color: #fff; border-color: var(--copper-300); }
.nick[aria-pressed="true"] small { color: #d6c8ae; }
.nick[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 8px; inset-inline-start: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--copper-300); color: #fff; display: grid; place-items: center; font-size: .8rem; }

/* ---------- student home ---------- */
.continue { border-radius: 18px; padding: 26px 28px; color: #fff; background: var(--navy-800); display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; overflow: hidden; position: relative; }
.continue::after { content: ''; position: absolute; inset-inline-end: -40px; top: -40px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(230,199,155,.35);
  box-shadow: 0 0 0 30px rgba(230,199,155,.06), 0 0 0 60px rgba(230,199,155,.04); }
.continue h2 { color: #fff; margin: 0; }
.continue p { color: #d9cfbd; margin: 4px 0 12px; }
.continue .btn { position: relative; z-index: 1; }
.books { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.book { display: grid; grid-template-columns: 18px 1fr; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); min-height: 132px; box-shadow: var(--shadow); }
.book .spine { background: var(--navy-700); background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0 2px, transparent 2px 14px); }
.book .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.book .body h3 { margin: 0; display: flex; gap: 8px; align-items: center; }
.book .body h3 svg { width: 22px; height: 22px; }
.book .meta { color: var(--muted); font-size: .88rem; }
.subj-math .spine { background-color: #24467a; } .subj-math h3 svg { color: #24467a; }
.subj-bio .spine { background-color: #2f6b4c; } .subj-bio h3 svg { color: #2f6b4c; }
.subj-phys .spine { background-color: #4a3d8f; } .subj-phys h3 svg { color: #4a3d8f; }
.subj-chem .spine { background-color: #8e3b30; } .subj-chem h3 svg { color: #8e3b30; }
.subj-eng .spine { background-color: #1f5d78; } .subj-eng h3 svg { color: #1f5d78; }
.subj-social .spine { background-color: #8b5a2b; } .subj-social h3 svg { color: #8b5a2b; }
.timeline { display: flex; gap: 0; overflow-x: auto; padding: 8px 4px; }
.timeline .slot { min-width: 130px; text-align: center; position: relative; padding-top: 22px; }
.timeline .slot::before { content: ''; position: absolute; top: 9px; inset-inline: 0; height: 2px; background: var(--line-2); }
.timeline .slot i { position: absolute; top: 0; inset-inline-start: calc(50% - 10px); width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 3px solid var(--copper-300); }
.timeline .slot.now i { background: var(--navy-800); border-color: var(--copper); }
.timeline .slot b { display: block; }

/* ---------- lesson ---------- */
.lesson-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.lesson-item + .lesson-item { margin-top: 14px; }
.q-text { font-size: 1.12rem; font-weight: 600; margin-bottom: 12px; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--paper); font: inherit; text-align: start; }
.choice[aria-pressed="true"] { border-color: var(--navy-600); background: var(--info-100); }
.answer-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.answer-row .input { max-width: 220px; direction: ltr; text-align: center; font-family: var(--font-math); font-size: 1.2rem; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: 12px; }
.feedback.ok { background: var(--ok-100); color: var(--ok); }
.feedback.bad { background: var(--bad-100); color: var(--bad); }
.feedback.wait { background: var(--warn-100); color: var(--warn); }
.hint-box { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--copper-100); color: #6b3f1d; }
.sol-box { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--info-100); }
.numline { width: 100%; }
.numline input[type=range] { width: 100%; accent-color: var(--copper); direction: ltr; }

/* ---------- report rows (parent) ---------- */
.rep-row { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 6px; border-bottom: 1px solid var(--line); }
.rep-row:last-child { border-bottom: 0; }
.rep-row .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.rep-row .ic svg { width: 24px; height: 24px; }
.rep-row .ic.ok { background: var(--ok-100); color: var(--ok); }
.rep-row .ic.bad { background: var(--bad-100); color: var(--bad); }
.rep-row .ic.none { background: var(--ivory-2); color: var(--muted); }
.events-line { display: flex; gap: 10px; overflow-x: auto; padding-top: 6px; }
.events-line .ev { min-width: 170px; display: flex; gap: 10px; align-items: flex-start; }
.events-line .ev .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--info-100); color: var(--navy-600); display: grid; place-items: center; flex: none; }
.events-line .ev .ic svg { width: 20px; height: 20px; }
.note-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--ivory-2); border-radius: 12px; color: var(--ink-2); font-size: .92rem; }
.note-box svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--copper); }

/* ---------- print cards (batch) ---------- */
.print-sheet { background: #fff; }
.pcard { width: 100%; max-width: 760px; margin: 0 auto 24px; break-inside: avoid; }
.pcard .half { border: 2px solid #b08a5a; border-radius: 14px; padding: 18px 22px; display: grid; grid-template-columns: 1fr 150px; gap: 16px; align-items: center; background: #fffdf8; }
.pcard .half h3 { font-size: 1.4rem; text-align: center; }
.pcard .cut { border-top: 2px dashed #9c6339; margin: 14px 0; position: relative; text-align: center; }
.pcard .cut span { position: relative; top: -12px; background: #fff; padding: 0 10px; color: #9c6339; font-size: .85rem; }
.pcard .qr svg { width: 140px; height: 140px; }
.pcard .bigcode { font-family: ui-monospace, Consolas, monospace; font-size: 1.35rem; letter-spacing: .12em; direction: ltr; text-align: center; padding: 8px; border: 1px dashed #c7a77f; border-radius: 10px; }
.pcard .warn { font-size: .85rem; color: #7a4a26; }
@media print {
  body { background: #fff; }
  .no-print, .side, .top, .toast-wrap { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .pcard { page-break-inside: avoid; }
}

/* ---------- responsive: tablet & phone ---------- */
@media (max-width: 1100px) {
  :root { --side-w: 210px; }
  .books { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 60; transform: translateX(100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: -10px 0 40px rgba(0,0,0,.3); }
  .top .menu-btn { display: grid; }
  .cols, .hero, .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .roles { grid-template-columns: 1fr; }
  .content { padding: 20px 16px 50px; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .grid-2, .cols-3, .cols-2, .device-pick { grid-template-columns: 1fr; }
  .books { grid-template-columns: 1fr; }
  .nick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { padding: 0 10px; gap: 6px; }
  .top .user-chip .who { display: none; }
  .land-top { padding: 12px 16px; }
  .land-top nav { display: none; }
  .hero, .roles { padding-inline: 16px; }
  .continue { grid-template-columns: 1fr; }
  .rep-row { grid-template-columns: 44px 1fr; }
  .rep-row > :nth-child(3), .rep-row > :nth-child(4) { grid-column: 2; }
  .pcard .half { grid-template-columns: 1fr; }
}
.mt { margin-top: 22px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; }
.continue .hero-art { width: 220px; height: 130px; aspect-ratio: auto; background: none; border: 0; }
@media (max-width: 600px) { .continue .hero-art { display: none; } }

.auth-side > svg { width: 280px; height: 170px; margin-bottom: 14px; }
.side .side-art svg { width: 100%; height: 100%; }
.qr svg, svg.qr { width: 180px; height: 180px; }
.empty svg { width: 46px; height: 46px; }

/* ---------- parent & teacher portals (.pt-*) ---------- */
.pt-auth-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 18px; flex-wrap: wrap; }
.pt-auth-tabs a { min-height: 46px; display: inline-flex; align-items: center; padding: 0 14px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; }
.pt-auth-tabs a[aria-current="page"] { color: var(--copper-600); border-bottom-color: var(--copper); }
.pt-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-100); color: #6a4a00; border: 1px solid #ecd7a4; margin-bottom: 18px; }
.pt-banner svg { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.pt-banner.info { background: var(--info-100); color: var(--navy-700); border-color: #cfdcec; }
.pt-banner p { margin: 0; }
.pt-check-result { border: 1.5px solid var(--copper-300); background: #fbf4ec; border-radius: var(--radius); padding: 16px 18px; margin: 4px 0 18px; }
.pt-check-result dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.pt-check-result dt { color: var(--muted); }
.pt-check-result dd { margin: 0; font-weight: 600; }
.pt-children { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pt-children .card + .card { margin-top: 0; }
.pt-child-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.pt-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--navy-100); color: var(--navy-700); display: grid; place-items: center; font-weight: 700; font-size: 1.35rem; flex: none; }
.pt-child-head h2 { margin: 0; font-size: 1.25rem; }
.pt-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: .92rem; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pt-secret { text-align: center; }
.pt-secret .pt-code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 1.6rem; letter-spacing: .1em; direction: ltr; unicode-bidi: isolate;
  padding: 12px 10px; border: 2px dashed var(--copper-300); border-radius: 12px; background: #fffaf3; margin: 10px 0; word-break: break-all; user-select: all; }
.pt-secret .qr { display: flex; justify-content: center; margin: 8px 0; }
.pt-once { display: flex; gap: 8px; align-items: flex-start; text-align: start; padding: 10px 14px; border-radius: 12px; background: var(--bad-100); color: #7d2a1c; font-size: .93rem; }
.pt-once svg { width: 20px; height: 20px; flex: none; margin-top: 3px; }
.pt-report-top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.pt-report-top .page-title { margin-bottom: 0; flex: 1 1 320px; }
.pt-child-pick { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; box-shadow: var(--shadow); min-width: 0; max-width: 100%; }
.pt-child-pick .pt-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
.pt-child-pick select { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--navy-900); min-height: 44px; max-width: 100%; min-width: 0; }
.pt-days { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.pt-days a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--paper); color: var(--navy-800); text-decoration: none; font-weight: 600; font-size: .92rem; }
.pt-days a[aria-current="true"] { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.pt-stat-def { font-size: .82rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.pt-rep { background: var(--ivory); border-radius: var(--radius-sm); padding: 4px 14px; }
.pt-rep .rep-row b { display: block; }
.pt-rep .rep-row .ic.help { background: var(--copper-100); color: var(--copper-600); }
.pt-rep .rep-row .ic.info { background: var(--info-100); color: var(--navy-600); }
.pt-count { font-size: 1.35rem; font-weight: 700; color: var(--navy-900); min-width: 2ch; text-align: center; }
.pt-totals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pt-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pt-skill { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: var(--paper); display: flex; flex-direction: column; gap: 8px; }
.pt-skill h4 { margin: 0; font-size: 1rem; }
.pt-skill .row { gap: 6px; }
.pt-next { background: #fbf4ec; border-radius: var(--radius-sm); padding: 16px; }
.pt-next h3 { margin-bottom: 6px; }
.pt-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.pt-lessons li { position: relative; padding: 0 0 0 0; display: flex; gap: 10px; align-items: center; min-width: 200px; flex: 1 1 200px; padding-bottom: 8px; }
.pt-lessons li .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--info-100); color: var(--navy-600); display: grid; place-items: center; flex: none; }
.pt-lessons li .ic svg { width: 20px; height: 20px; }
.pt-thread { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding: 4px 2px; }
.pt-msg { max-width: 82%; border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); align-self: flex-end; }
.pt-msg.mine { align-self: flex-start; background: var(--info-100); border-color: #cfdcec; }
.pt-msg p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pt-msg .row { gap: 8px; font-size: .85rem; color: var(--muted); }
.pt-msg.flagged { border-color: #e3b5ab; }
.pt-counter { font-size: .85rem; color: var(--muted); text-align: end; margin-top: -10px; margin-bottom: 12px; direction: ltr; }
.pt-to { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--ivory-2); margin-bottom: 14px; font-weight: 600; }
.pt-to svg { color: var(--copper-600); }
table.t tr.pt-click { cursor: pointer; }
table.t tr.pt-click:hover td { background: #fbf6ee; }
table.t .pt-exp { min-height: 44px; min-width: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--navy-800); cursor: pointer; border-radius: 10px; }
table.t .pt-exp svg { transition: transform .15s; }
table.t .pt-exp[aria-expanded="true"] svg { transform: rotate(-90deg); }
.pt-detail-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.pt-guide dl { margin: 0; }
.pt-guide dt { font-weight: 700; color: var(--navy-900); margin-top: 12px; }
.pt-guide dd { margin: 2px 0 0; color: var(--ink-2); }
.pt-page-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 22px 0 10px; }
.pt-page-head h2 { margin: 0; flex: 1; font-size: 1.2rem; }
.pt-item-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pt-item-head .spacer { min-width: 8px; }
.pt-choices { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.pt-choices li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pt-note-ctx { font-size: .9rem; color: var(--ink-2); background: var(--ivory-2); padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.pt-scope { display: grid; gap: 4px; margin-bottom: 14px; }
.pt-status-pending { background: var(--warn-100); color: var(--warn); }
fieldset.pt-fs { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.pt-fs legend { font-weight: 600; color: var(--navy-900); margin-bottom: 6px; padding: 0; }
.pt-subjects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
.pt-list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pt-wrap { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 900px) { .pt-children, .pt-skills { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .pt-subjects { grid-template-columns: 1fr 1fr; }
  .pt-msg { max-width: 94%; }
  .pt-secret .pt-code { font-size: 1.2rem; }
  .pt-child-pick { width: 100%; }
}
@media print {
  body.pt-printing > :not(.modal-bg) { display: none !important; }
  body.pt-printing .modal-bg { position: static; background: none; padding: 0; display: block; }
  body.pt-printing .modal { box-shadow: none; max-height: none; overflow: visible; max-width: none; }
  body.pt-printing .no-print { display: none !important; }
}
.pt-form-error { color: var(--bad); background: var(--bad-100); border-radius: 10px; padding: 8px 12px; font-size: .92rem; margin: 4px 0 14px; }
.pt-cols > * { min-width: 0; }
.pt-tw { position: relative; }

/* ---------- admin portal (.ox-*) ---------- */
.ox-h1 { font-size: clamp(1.4rem, 1.6vw + .8rem, 1.9rem); margin: 0; flex: 1; }
.ox-head-t { flex: 1; min-width: 0; }
.ox-head-t h2, .ox-head-t h3 { margin: 0; }
.ox-pid { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .9em; letter-spacing: .02em; white-space: nowrap; }
.ox-pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; }
.ox-grow { flex: 1; min-width: 0; }
.ox-w-auto { width: auto; max-width: 100%; }
.ox-ul { margin: 0 0 10px; padding-inline-start: 20px; }
.ox-steps { padding-inline-start: 22px; color: var(--ink-2); }
.ox-loading { display: flex; align-items: center; gap: 12px; padding: 40px 10px; color: var(--muted); justify-content: center; }
.ox-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--copper); animation: ox-spin 1s linear infinite; }
@keyframes ox-spin { to { transform: rotate(360deg); } }
.ox-error { display: flex; gap: 14px; align-items: flex-start; border-color: #e3b5ab; }
.ox-error > svg { width: 28px; height: 28px; color: var(--bad); }
.ox-inline { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; flex-wrap: wrap; }
.ox-inline .input { min-height: 46px; }
.ox-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ox-search { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ox-search .input { flex: 1; min-width: 200px; }
table.t td .ox-actions { flex-wrap: nowrap; }
.ox-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 18px; }
.ox-summary > div { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.ox-summary b { font-size: 1.2rem; color: var(--navy-900); }
.ox-summary .ox-span { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); }
.ox-x { background: none; border: 0; padding: 0 2px; cursor: pointer; color: inherit; min-height: 28px; display: inline-grid; place-items: center; }
.ox-x svg { width: 14px; height: 14px; }
.ox-check-sm { min-height: 44px; align-items: center; white-space: nowrap; }
.ox-check-sm input { margin-top: 0; }
.ox-check-pad { padding-top: 34px; }
.ox-info { display: flex; gap: 8px; align-items: center; background: var(--ivory-2); border-radius: 10px; padding: 10px 12px; font-size: .88rem; color: var(--muted); margin: 14px 0 0; }
.ox-alert { background: var(--bad-100); color: var(--bad); border-radius: 10px; padding: 10px 14px; flex-basis: 100%; }
.ox-once { display: flex; gap: 10px; align-items: center; background: var(--warn-100); color: #6d4a00; border: 1px solid #ecd59a; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.ox-once svg { width: 20px; height: 20px; flex: none; }
.ox-once-inline { margin: 0; padding: 6px 12px; }
.ox-bigcode { font-family: ui-monospace, Consolas, monospace; font-size: 1.45rem; letter-spacing: .12em; direction: ltr; text-align: center; padding: 12px; border: 1.5px dashed var(--copper-300); border-radius: 12px; background: #fffaf2; margin: 10px 0; overflow-wrap: anywhere; }
.ox-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; padding-inline-start: 26px; margin: 0 0 16px; }
.ox-codes li { font-size: 1.1rem; }
.ox-enroll { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: center; }
.ox-qr { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; width: 200px; }
.ox-qr svg { width: 100%; height: auto; display: block; }
.ox-secret { font-family: ui-monospace, Consolas, monospace; font-size: 1rem; letter-spacing: .08em; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; overflow-wrap: anywhere; background: var(--ivory); }

/* sub-navigation inside a section */
.ox-subnav { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; overflow-x: auto; scrollbar-width: thin; }
.ox-subnav a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-bottom: 3px solid transparent; color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.ox-subnav a svg { width: 19px; height: 19px; }
.ox-subnav a[aria-current="page"] { color: var(--copper-600); border-bottom-color: var(--copper); }
.ox-subnav a:hover { color: var(--navy-800); }

/* dashboard */
.ox-hero { position: relative; }
.ox-hero .page-title { position: relative; z-index: 1; }
.ox-hero-art { position: absolute; inset-inline-end: 0; top: -14px; width: 260px; height: 120px; opacity: .55; pointer-events: none; }
.ox-hero-art svg { width: 100%; height: 100%; }
.ox-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ox-kpi { box-shadow: var(--shadow); }
.ox-kpi-wide { grid-column: span 2; }
.ox-kpi-t { font-size: 1rem; margin: 0 0 2px; color: var(--ink-2); }
.ox-kpi-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.ox-kpi-meta .chip { white-space: normal; font-weight: 500; font-size: .8rem; }
.ox-kpi-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; color: var(--copper-600); text-decoration: none; margin-top: auto; }
.ox-kpi-link:hover { text-decoration: underline; }
.ox-trend { color: var(--ok); font-weight: 600; }
.ox-trend svg { width: 14px; height: 14px; }
.ox-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ox-p-ok > span { background: var(--ok); }

/* forms: issue, compose, settings */
.ox-issue { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ox-form-rows .field { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 12px; }
.ox-form-rows .field > span { margin: 0; }
.ox-seg { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; border: 0; padding: 0; }
.ox-seg .btn[aria-pressed="true"] { background: var(--copper); color: #fff; border-color: var(--copper); }
.ox-seg .btn { min-width: 76px; }
.ox-seg-custom { flex: 1; min-width: 170px; }
.ox-seg-r label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--paper); font-weight: 600; }
.ox-seg-r label:has(input:checked) { border-color: var(--copper); background: var(--copper-100); color: var(--copper-600); }
.ox-seg-r input { accent-color: var(--copper); width: 18px; height: 18px; }
.ox-fs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 4px; margin: 0 0 16px; min-width: 0; }
.ox-fs legend { font-weight: 700; color: var(--navy-900); padding: 0 6px; display: inline-flex; gap: 6px; align-items: center; }
.ox-roles { gap: 6px 22px; margin-bottom: 8px; }
.ox-roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 14px; }
.ox-ph { gap: 8px; }
.ox-filters { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.ox-filters .field { margin: 0; flex: 1; min-width: 150px; }
.ox-supp td { color: var(--muted); background: var(--ivory); }
.ox-supp svg { width: 16px; height: 16px; }
.ox-sample .pcard { margin: 0; }
.ox-sample .pcard .half { grid-template-columns: 1fr 110px; padding: 14px; gap: 10px; }
.ox-sample .pcard .qr svg { width: 100px; height: 100px; color: var(--navy-800); }
.ox-qr-ph { display: grid; place-items: center; }

/* toggle switch */
.ox-switch { position: relative; display: inline-flex; width: 58px; min-height: 44px; align-items: center; cursor: pointer; flex: none; }
.ox-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.ox-switch span { width: 54px; height: 30px; border-radius: 99px; background: #cfc6b4; position: relative; transition: background .15s; }
.ox-switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: inset-inline-start .15s; }
.ox-switch input:checked + span { background: var(--ok); }
.ox-switch input:checked + span::after { inset-inline-start: 27px; }
.ox-switch input:focus-visible + span { outline: 3px solid var(--copper-300); outline-offset: 2px; }
.ox-switch input:disabled + span { opacity: .5; }
.ox-switch input:disabled { cursor: not-allowed; }

/* settings */
.ox-set-group h2 { font-size: 1.2rem; }
.ox-set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.ox-set-row p { margin: 4px 0; }
.ox-set-row.ox-dis b { color: var(--ink-2); }
.ox-set-v { min-width: 0; }
.ox-set-in { width: 150px; min-height: 46px; }
.ox-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; margin-top: 16px;
  background: rgba(255,253,248,.96); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 18px rgba(19,40,63,.08); }
.ox-guard { background: var(--navy-800); color: #dfe6ee; border-radius: var(--radius); padding: 22px; position: sticky; top: calc(var(--top-h) + 16px);
  background-image: radial-gradient(circle at 20% 110%, rgba(176,137,74,.25), transparent 50%); }
.ox-guard h2 { color: #fff; }
.ox-guard .card-head .ico { background: rgba(230,199,155,.15); color: #e6c79b; }
.ox-guard-box { display: flex; gap: 12px; align-items: flex-start; border: 1px solid rgba(230,199,155,.35); border-radius: 12px; padding: 12px 14px; margin: 6px 0 14px; }
.ox-guard-box > svg { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--ok); color: #fff; flex: none; }
.ox-guard-box small { display: block; color: #b9c4d1; }
.ox-guard-list { list-style: none; padding: 0; margin: 0 0 14px; }
.ox-guard-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.1); flex-wrap: wrap; }
.ox-guard-list.ox-light li { border-bottom-color: var(--line); }
.ox-guard .btn-outline-copper { color: #f1d9b8; border-color: rgba(230,199,155,.6); }
.ox-flag .ox-pilots { border: 1px dashed var(--line-2); border-radius: 12px; padding: 8px 14px; }
.ox-flag .ox-pilots[hidden] { display: none; }

/* content */
.ox-cluster .list > li { align-items: flex-start; flex-wrap: wrap; }
.ox-note-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; width: 100%; }
.ox-note-act .input { min-height: 44px; flex: 1; min-width: 160px; }
.ox-note-act select.input { flex: 0 1 auto; }
.ox-page-h { font-size: 1.1rem; color: var(--muted); margin: 18px 0 10px; }
.ox-item details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--navy-700); }
.ox-body { background: var(--ivory); border-radius: 12px; padding: 12px 16px; }
.ox-b-t { font-size: 1.05rem; }
.ox-b-l ol { margin: 4px 0 8px; padding-inline-start: 22px; }
.ox-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ox-diff > div { background: var(--ivory); border-radius: 12px; padding: 14px; min-width: 0; }
.ox-diff > div + div { background: var(--ok-100); }
.ox-guides { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.ox-lessons { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.ox-lessons a { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.ox-lessons a .chip { align-self: flex-start; }
.ox-lessons a[aria-current="page"] { background: var(--copper-100); box-shadow: inset -3px 0 0 var(--copper); }
.ox-nick-ico svg { width: 26px; height: 26px; color: var(--copper); }
.ox-scope { font-size: .82rem; color: var(--ink-2); display: inline-block; max-width: 340px; overflow-wrap: anywhere; }

/* notification composer + phone preview */
.ox-compose { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ox-phone-wrap { position: sticky; top: calc(var(--top-h) + 16px); background: linear-gradient(180deg, #efe1c9, #d9bf98 70%, #b98f5f); border-radius: 18px; padding: 18px; min-width: 0; }
.ox-phone-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.ox-phone-head .ico { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.6); display: grid; place-items: center; color: var(--navy-800); }
.ox-phone-head small { display: block; color: #5d4630; }
.ox-phone { padding: 30px 8px; }
.ox-notif { background: rgba(255,253,248,.97); border-radius: 22px; padding: 22px; box-shadow: 0 18px 40px rgba(19,40,63,.22); }
.ox-notif-top { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.ox-notif-top small { display: block; color: var(--muted); }
.ox-app { width: 56px; height: 56px; border-radius: 14px; background: var(--navy-800); display: grid; place-items: center; flex: none; }
.ox-app svg { width: 40px; height: 40px; }
.ox-notif h3 { font-size: 1.35rem; overflow-wrap: anywhere; }
.ox-notif p { overflow-wrap: anywhere; color: var(--ink-2); }

/* two-part print cards (extends .pcard) */
.ox-pc-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ox-pc-brand svg { width: 34px; height: 34px; }
.ox-pc-brand b { font-family: Georgia, 'Times New Roman', serif; display: block; line-height: 1; color: var(--navy-900); }
.ox-pc-brand small { display: block; font-size: .68rem; line-height: 1.2; }
.ox-pc-tag { margin-inline-start: auto; background: var(--copper); color: #fff; font-size: .78rem; font-weight: 700; padding: 3px 12px; border-radius: 6px; }
.ox-pc-meta { text-align: center; font-size: .86rem; color: var(--ink-2); margin-bottom: 8px; }
.ox-pc-ico { display: grid; place-items: center; color: #b08a5a; }
.ox-pc-ico svg { width: 90px; height: 90px; }
.ox-printview { position: fixed; inset: 0; z-index: 140; background: var(--ivory); overflow: auto; }
.ox-print-bar { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 20px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.ox-sheet { max-width: 820px; margin: 22px auto; padding: 20px; border-radius: var(--radius); }
.ox-print-head { text-align: center; margin-bottom: 18px; }
@media print {
  body.ox-printing > *:not(.ox-printview) { display: none !important; }
  body.ox-printing .ox-printview { position: static; overflow: visible; background: #fff; }
  body.ox-printing .ox-sheet { margin: 0; padding: 0; max-width: none; }
  .ox-printview .pcard { page-break-inside: avoid; break-inside: avoid; }
  .modal-bg .modal { box-shadow: none; }
}

@media (max-width: 1100px) {
  .ox-issue, .ox-compose { grid-template-columns: 1fr; }
  .ox-phone-wrap, .ox-guard { position: static; }
  .ox-hero-art { display: none; }
}
@media (max-width: 900px) {
  .ox-guides { grid-template-columns: 1fr; }
  .ox-lessons { flex-direction: row; overflow-x: auto; }
  .ox-lessons a { min-width: 190px; }
}
@media (max-width: 600px) {
  .ox-kpi-wide { grid-column: auto; }
  .ox-kpis { grid-template-columns: 1fr; }
  .ox-bars, .ox-diff, .ox-codes { grid-template-columns: 1fr; }
  .ox-enroll { grid-template-columns: 1fr; justify-items: center; }
  .ox-form-rows .field { grid-template-columns: 1fr; gap: 4px; }
  .ox-set-row { grid-template-columns: 1fr; }
  .ox-set-in { width: 100%; }
  .ox-seg .btn { min-width: 0; flex: 1; }
  .ox-print-bar { padding: 10px 12px; }
  .ox-sheet { padding: 8px; }
  .ox-sample .pcard .half { grid-template-columns: 1fr; }
}
.cols > *, .cols-2 > *, .cols-3 > *, .ox-issue > *, .ox-compose > *, .ox-guides > *, .ox-kpis > * { min-width: 0; }

/* phone: the 3-step stepper must fit 390px without horizontal scroll */
@media (max-width: 520px) {
  .stepper .st { min-width: 0; flex: 1 1 0; font-size: .78rem; text-align: center; }
  .stepper .bar { width: auto; flex: 0 1 28px; }
  .stepper .st i { width: 32px; height: 32px; }
}
@media (max-width: 600px) {
  .pt-rep .rep-row { grid-template-columns: 44px 1fr auto; row-gap: 6px; }
  .pt-rep .rep-row > :nth-child(3) { grid-column: 2; grid-row: 2; }
  .pt-rep .rep-row > :nth-child(4) { grid-column: 3; grid-row: 1 / span 2; }
}
.ox-tw { position: relative; } /* keeps absolutely-positioned sr-only labels inside the scroll box */
.ox-fs .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ox-fs .grid-2 > *, .ox-fs .input { min-width: 0; }
.ox-sample .bigcode { font-size: 1rem; letter-spacing: .04em; white-space: nowrap; overflow: hidden; }
@media (max-width: 600px) { .ox-fs .grid-2 { grid-template-columns: 1fr; } }
.ox-form-err { color: var(--bad); background: var(--bad-100); border-radius: 10px; padding: 8px 12px; font-size: .92rem; margin: 4px 0 14px; }
.cols > .card + .card, .cols-2 > .card + .card, .ox-issue > .card + .card, .ox-compose > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .cols-2 > .card + .card { margin-top: 0; } }
.ox-note-act select.input { width: auto; }
.ox-reason { display: inline-block; max-width: 300px; font-size: .9rem; }

/* save state: short label on narrow screens so the header never wraps */
.save-state { white-space: nowrap; position: relative; }
.save-state .ss-short { display: none; }
@media (max-width: 600px) {
  .save-state .ss-long { position: absolute; inset-inline-start: 0; top: 0; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .save-state .ss-short { display: inline; font-size: .78rem; }
}
@media (max-width: 420px) {
  .top { gap: 6px; }
  .top .user-chip { display: none; }          /* the name is in the side menu; keeps the header on one line at 390px */
  .trial-badge { padding: 4px 10px; font-size: .76rem; }
}
.ox-switch span { pointer-events: none; }

/* ================= art (SIGS-clean-assets) ================= */
img.art, img.cover, img.logo { display: block; max-width: 100%; }
/* emblem */
.brand .logo { width: 48px; height: 48px; flex: none; object-fit: contain; background: #fbf6ec; border-radius: 50%; padding: 4px; box-shadow: 0 0 0 1px rgba(230,199,155,.45); }
.land-brand .logo { width: 72px; height: 64px; object-fit: contain; }
.ox-app .logo { width: 44px; height: 44px; object-fit: contain; background: #fbf6ec; border-radius: 10px; padding: 3px; }
.ox-pc-brand .logo { width: 34px; height: 30px; object-fit: contain; }
/* landing hero photograph */
.hero-art { background: #e8d6b7; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.land-linework { max-width: 640px; margin: 18px auto 0; padding: 0 16px; opacity: .8; }
.land-linework img { width: 100%; height: auto; }
/* Iraqi brick arch: arch-shaped frame */
img.arch-art { object-fit: cover; border-radius: 999px 999px 14px 14px; }
.side .side-art { height: auto; opacity: 1; margin: 14px auto 0; width: 150px; }
.side .side-art img { width: 150px; height: 210px; box-shadow: 0 0 0 1px rgba(230,199,155,.4), 0 10px 24px rgba(0,0,0,.25); }
.auth-side > img.arch-art { width: 230px; height: 320px; margin-bottom: 18px; box-shadow: 0 0 0 1px rgba(230,199,155,.45), 0 14px 30px rgba(0,0,0,.3); }
/* continue banner: astrolabe paper at the inline-end, text on the clear area */
.continue.has-art { background: #f3ead8; color: var(--navy-900); border: 1px solid var(--line-2); min-height: 190px; grid-template-columns: minmax(0, 1fr); }
.continue.has-art::after { display: none; }
.continue.has-art::before { content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to left, rgba(243,234,216,.97) 0%, rgba(243,234,216,.92) 48%, rgba(243,234,216,0) 78%); }
.continue.has-art .continue-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; z-index: 0; }
.continue.has-art > div { position: relative; z-index: 2; max-width: 60%; }
.continue.has-art h2 { color: var(--navy-900); }
.continue.has-art p { color: var(--ink-2); }
@media (max-width: 600px) {
  .continue.has-art::before { background: linear-gradient(to left, rgba(243,234,216,.97) 0%, rgba(243,234,216,.9) 70%, rgba(243,234,216,.55) 100%); }
  .continue.has-art > div { max-width: 100%; }
}
/* book cards: subject cover art at the inline-end (like the mockup) */
.book { grid-template-columns: 18px minmax(0, 1fr) 118px; }
.book .book-cover { grid-column: 3; grid-row: 1; width: 118px; height: 100%; min-height: 132px; object-fit: contain; object-position: center; padding: 8px;
  background: linear-gradient(to left, #f6efe2, #fbf7ef); border-inline-start: 1px solid var(--line); }
.book .body { grid-column: 2; grid-row: 1; }
@media (max-width: 420px) { .book { grid-template-columns: 14px minmax(0, 1fr) 92px; } .book .book-cover { width: 92px; } }
.card-head img.thumb { width: 56px; height: 56px; object-fit: contain; flex: none; background: #f6efe2; border-radius: 12px; padding: 4px; border: 1px solid var(--line); }
/* ops dashboard ornament & notification preview backdrop */
.ox-hero-art { opacity: .75; }
.ox-hero-art img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
.ox-phone-wrap { background: #c8a678 url('/assets/img/riverside-portrait-720.webp') center / cover no-repeat; }
.ox-phone-head { background: rgba(251,247,239,.94); border-radius: 14px; padding: 10px 12px; }
/* sidebar: the navigation never shrinks; the arch takes only the space left */
.side nav { flex: 1 0 auto; }
.side .side-art { flex: 0 1 222px; min-height: 0; width: auto; display: flex; justify-content: center; align-items: flex-end; margin: 12px 0 0; }
.side .side-art img { height: 100%; max-height: 210px; width: auto; aspect-ratio: 150 / 210; }
@media (max-height: 760px) { .side .side-art { display: none; } }

/* production: no «trial» labels */
html[data-env="production"] .trial-badge, html[data-env="production"] .trial-only { display: none !important; }

/* ---- التسجيل الذاتي وبطاقة الرمز وحسابي (2026-10-31) ---- */
.btn-lg{min-height:56px;font-size:1.1rem;padding-inline:22px}
.center{text-align:center}
.code-card{display:flex;flex-wrap:wrap;gap:16px;align-items:center;padding:16px;border:2px dashed #C8A24A;border-radius:14px;background:#FFFCF2}
.code-card .qr svg{width:132px;height:132px;display:block}
.code-card .bigcode{font-size:2rem;letter-spacing:.12em;font-weight:800;direction:ltr;unicode-bidi:isolate}
.big-check{display:flex;align-items:center;gap:10px;min-height:48px;font-weight:700}
.big-check input{width:24px;height:24px}
#startBtn{margin-bottom:6px}
@media (max-width:480px){.code-card{justify-content:center;text-align:center}.code-card .bigcode{font-size:1.7rem}}
.grid-4{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px}
.ox-stat{display:flex;flex-direction:column;gap:4px;padding:14px}.ox-stat b{font-size:1.5rem}
