/* ==========================================================================
   مدرسة أحمد ضيف الله — design system
   Ink & gold, taken from the school's calligraphic logo.
   Reem Kufi (geometric Kufic) for display, IBM Plex Sans Arabic for reading.
   No inline styles anywhere (strict CSP); dynamic values arrive via CSS custom
   properties set from data-attributes in app.js.
   ========================================================================== */

@font-face { font-family: "Reem Kufi"; src: url("../fonts/reem-kufi-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Reem Kufi"; src: url("../fonts/reem-kufi-arabic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Reem Kufi"; src: url("../fonts/reem-kufi-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: "Reem Kufi"; src: url("../fonts/reem-kufi-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  /* palette */
  --ink: #12263f;          /* calligrapher's ink — rail, primary text, "occupied" */
  --ink-2: #1d3a5c;
  --ink-3: #2c4d73;
  --gold: #d99a06;         /* the logo — "now", primary actions, focus */
  --gold-deep: #9a6b00;    /* gold that passes contrast as text on light */
  --gold-wash: #fbf1d6;
  --slate: #eef2f5;        /* page */
  --paper: #ffffff;
  --line: #d4dde6;
  --line-soft: #e5ebf0;
  --muted: #56677b;
  --ok: #157a55;   --ok-wash: #e2f3ec;
  --late: #a86200; --late-wash: #fdf0dc;
  --bad: #b42318;  --bad-wash: #fbe7e5;

  /* type: Plex body 15/1.75, scale 1.25 */
  --f-body: "Plex Arabic", "Segoe UI", Tahoma, sans-serif;
  --f-display: "Reem Kufi", "Plex Arabic", sans-serif;
  --t-xs: .8125rem; --t-sm: .875rem; --t-md: 1rem; --t-lg: 1.25rem; --t-xl: 1.625rem; --t-2xl: 2.125rem; --t-3xl: 3rem;

  /* shape: controls are tight, surfaces softer, the ribbon is a hard band */
  --r-ctl: 6px; --r-surface: 12px;
  --gap: 1.5rem;
  --rail: 15.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 0.9375rem/1.75 var(--f-body); color: var(--ink); background: var(--slate); font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.25; margin: 0; letter-spacing: 0; }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
p { margin: 0 0 .75em; }
a { color: var(--ink-2); text-underline-offset: 3px; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; inset-inline-start: -999px; top: 0; background: var(--gold); color: var(--ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { inset-inline-start: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-family: var(--f-display); font-weight: 500; }
.muted { color: var(--muted); }

/* ---------- shell ------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; background: linear-gradient(to left, var(--ink) var(--rail), var(--slate) var(--rail)); }
.rail { background: var(--ink); color: #dfe7ef; display: flex; flex-direction: column; padding: 1.5rem 1rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; padding: 0 .5rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 1rem; }
.brand img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 500; font-size: var(--t-sm); line-height: 1.45; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: var(--r-ctl); color: #c9d5e1; text-decoration: none; font-weight: 500; }
.nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--ink-2); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.who { border-top: 1px solid rgba(255,255,255,.1); padding: 1rem .5rem 0; display: grid; gap: .1rem; }
.who-name { color: #fff; font-weight: 600; }
.who-role { font-size: var(--t-xs); color: #9fb2c6; }
.link-btn { background: none; border: 0; padding: 0; margin-top: .5rem; color: var(--gold); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.main { padding: 2rem clamp(1rem, 3vw, 2.75rem) 3rem; min-width: 0; }
.main:focus { outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: .35rem 0 0; }
.page-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.flash p { padding: .75rem 1rem; border-radius: var(--r-ctl); margin-bottom: 1rem; }
.flash-success { background: var(--ok-wash); color: var(--ok); }
.flash-error { background: var(--bad-wash); color: var(--bad); }

/* ---------- surfaces ------------------------------------------------------ */
.surface { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-surface); padding: 1.25rem 1.5rem; }
.surface > h2 { margin-bottom: 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.surface > h2 a { font: 500 var(--t-sm) var(--f-body); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--gap); }
.stack { display: grid; gap: var(--gap); align-content: start; }

/* ---------- THE signature: school-day ribbon ---------------------------- */
.day { margin-bottom: var(--gap); }
.day-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.day-now { font-family: var(--f-display); font-size: var(--t-xl); font-weight: 700; }
.day-now small { font: 400 var(--t-sm) var(--f-body); color: var(--muted); margin-inline-start: .5rem; }
.ribbon { display: flex; gap: 3px; height: 5.5rem; border-radius: var(--r-ctl); overflow: hidden; background: var(--line-soft); position: relative; }
.seg { flex-grow: var(--grow, 1); flex-basis: 0; min-width: 0; position: relative; background: var(--paper); padding: .55rem .65rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.seg-n { font-family: var(--f-display); font-weight: 700; font-size: var(--t-lg); line-height: 1; position: relative; z-index: 1; }
.seg-t { font-size: var(--t-xs); color: var(--muted); position: relative; z-index: 1; white-space: nowrap; direction: ltr; text-align: end; }
.seg.past { background: var(--ink-3); color: #e7eef5; }
.seg.past .seg-t { color: #b8c7d6; }
.seg.now { background: var(--gold-wash); }
.seg.now::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: calc(var(--p, 0) * 1%); background: var(--gold); }
.seg.now .seg-t { color: var(--ink); }
.seg.brk { background: repeating-linear-gradient(-45deg, var(--paper) 0 7px, var(--line-soft) 7px 14px); }
.seg.brk.past { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 7px, var(--ink-2) 7px 14px); }
.seg.brk .seg-n { font-size: var(--t-sm); font-family: var(--f-body); font-weight: 600; }
.day-foot { display: flex; justify-content: space-between; margin-top: .5rem; font-size: var(--t-xs); color: var(--muted); direction: ltr; }
.day-off { padding: 1.5rem; text-align: center; }

/* ---------- attendance strip (one bar, not four cards) ------------------- */
.roll { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem 2rem; align-items: center; }
.roll-total { font-family: var(--f-display); font-size: var(--t-3xl); font-weight: 700; line-height: 1; }
.roll-total span { display: block; font: 400 var(--t-sm) var(--f-body); color: var(--muted); margin-top: .4rem; }
.bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line-soft); }
.bar i { display: block; width: calc(var(--w, 0) * 1%); }
.bar .b-present { background: var(--ok); } .bar .b-late { background: var(--gold); } .bar .b-absent { background: var(--bad); } .bar .b-excused { background: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.legend li { display: flex; align-items: baseline; gap: .5rem; }
.legend b { font-family: var(--f-display); font-size: var(--t-xl); font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; align-self: center; }
.d-present { background: var(--ok); } .d-late { background: var(--gold); } .d-absent { background: var(--bad); } .d-excused { background: var(--ink-3); } .d-none { background: var(--line); }

/* ---------- lists & tables --------------------------------------------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--line-soft); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.row-main { min-width: 0; }
.row-main strong { display: block; font-weight: 600; }
.row-main span { font-size: var(--t-sm); color: var(--muted); }
.row-actions { display: flex; gap: .4rem; flex: none; }
.empty { color: var(--muted); padding: 1rem 0; }

table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-weight: 600; font-size: var(--t-sm); color: var(--muted); padding: .6rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem .75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr:hover { background: #f7f9fb; }
.table-wrap { overflow-x: auto; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

.tag { display: inline-block; font-size: var(--t-xs); font-weight: 600; padding: .1rem .55rem; border-radius: 999px; white-space: nowrap; }
.tag-present, .tag-active, .tag-approved { background: var(--ok-wash); color: var(--ok); }
.tag-late, .tag-warned, .tag-pending_school, .tag-pending_guardian { background: var(--late-wash); color: var(--late); }
.tag-absent, .tag-pending_dismissal, .tag-rejected, .tag-dismissed { background: var(--bad-wash); color: var(--bad); }
.tag-excused, .tag-used, .tag-expired, .tag-transferred { background: var(--line-soft); color: var(--muted); }

/* ---------- controls --------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: var(--r-ctl); padding: .45rem .9rem; font-weight: 600; font-size: var(--t-sm); cursor: pointer; text-decoration: none; line-height: 1.5; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #c58b03; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-danger { background: transparent; border-color: #e7b6b1; color: var(--bad); }
.btn-danger:hover { background: var(--bad-wash); }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; font-size: var(--t-sm); }
.input, select.input { border: 1px solid var(--line); background: var(--paper); border-radius: var(--r-ctl); padding: .5rem .75rem; min-height: 2.5rem; }
.input:focus { border-color: var(--ink-3); outline: 3px solid rgba(217,154,6,.35); outline-offset: 0; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: center; margin-top: 1.25rem; }

/* ---------- rooms --------------------------------------------------------- */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; }
.room { border-radius: var(--r-ctl); padding: .7rem .8rem; min-height: 5.25rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px dashed #b9c6d3; background: var(--paper); }
.room-name { font-family: var(--f-display); font-weight: 700; direction: ltr; text-align: end; }
.room-info { font-size: var(--t-xs); color: var(--muted); line-height: 1.5; }
.room.busy { background: var(--ink); border: 1px solid var(--ink); color: #fff; }
.room.busy .room-info { color: #c3d1de; }
.rooms-lg .room { min-height: 8rem; padding: 1rem; }
.rooms-lg .room-name { font-size: var(--t-lg); }
.rooms-lg .room-info { font-size: var(--t-sm); }
.key { display: flex; gap: 1.25rem; font-size: var(--t-sm); color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: .4rem; }
.sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.sw-busy { background: var(--ink); } .sw-free { border: 1px dashed #9fb0c1; }

/* ---------- student detail ------------------------------------------------ */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; }
.avatar { width: 88px; height: 88px; border-radius: 50%; background: var(--gold-wash); color: var(--gold-deep); display: grid; place-items: center; font-family: var(--f-display); font-size: var(--t-2xl); font-weight: 700; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.meter { margin-top: .5rem; }
.meter-track { height: 10px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.meter-fill { height: 100%; width: calc(var(--w, 0) * 1%); background: var(--ink-3); }
.meter-fill.hot { background: var(--late); }
.meter-fill.over { background: var(--bad); }
.meter-head { display: flex; justify-content: space-between; font-size: var(--t-sm); }
.calendar { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.calendar span { aspect-ratio: 1; border-radius: 4px; }
.c-present { background: var(--ok); } .c-late { background: var(--gold); } .c-absent { background: var(--bad); } .c-excused { background: var(--ink-3); }

/* ---------- timetable builder --------------------------------------------- */
.tt { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--gap); align-items: start; }
.tt-grid { display: grid; grid-template-columns: 5.5rem repeat(var(--days, 5), minmax(7.5rem, 1fr)); gap: 4px; overflow-x: auto; }
.tt-h { font-family: var(--f-display); font-weight: 700; padding: .5rem; text-align: center; }
.tt-p { padding: .5rem; font-size: var(--t-xs); color: var(--muted); display: flex; flex-direction: column; justify-content: center; }
.tt-p b { font-family: var(--f-display); color: var(--ink); font-size: var(--t-md); }
.cell { min-height: 4.5rem; border-radius: var(--r-ctl); border: 1px dashed var(--line); background: var(--paper); padding: .35rem; position: relative; }
.cell.off { background: repeating-linear-gradient(-45deg, var(--slate) 0 6px, var(--line-soft) 6px 12px); border-style: solid; border-color: transparent; }
.cell.over { border: 2px solid var(--gold); background: var(--gold-wash); }
.cell.brk { min-height: 1.75rem; border: 0; background: repeating-linear-gradient(-45deg, var(--paper) 0 6px, var(--line-soft) 6px 12px); grid-column: 2 / -1; text-align: center; font-size: var(--t-xs); color: var(--muted); }
.lesson { border-radius: 5px; padding: .35rem .5rem; color: #fff; background: var(--c, var(--ink-3)); font-size: var(--t-xs); line-height: 1.45; height: 100%; display: flex; flex-direction: column; gap: 1px; }
.lesson b { font-size: var(--t-sm); font-weight: 600; padding-inline-end: 1.5rem; }
.lesson .x { position: absolute; inset-block-start: .3rem; inset-inline-end: .35rem; background: rgba(0,0,0,.25); color: #fff; border: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%; cursor: pointer; line-height: 1; }
.palette { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.chip { display: block; width: 100%; text-align: start; border: 1px solid var(--line); border-inline-start: 5px solid var(--c, var(--ink-3)); background: var(--paper); border-radius: var(--r-ctl); padding: .45rem .6rem; margin-bottom: .4rem; cursor: grab; font-size: var(--t-sm); }
.chip small { display: block; color: var(--muted); }
.chip:active { cursor: grabbing; }
.chip[aria-pressed="true"] { outline: 3px solid var(--gold); }
.toast { position: fixed; inset-block-end: 1.5rem; inset-inline-start: 50%; transform: translateX(50%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r-ctl); box-shadow: 0 8px 30px rgba(18,38,63,.25); z-index: 20; max-width: min(90vw, 34rem); }
.toast.err { background: var(--bad); }
.toast[hidden] { display: none; }
.dialog { border: 0; border-radius: var(--r-surface); padding: 1.5rem; width: min(26rem, 92vw); box-shadow: 0 20px 60px rgba(18,38,63,.3); }
.dialog::backdrop { background: rgba(18,38,63,.45); }
.dialog h2 { margin-bottom: 1rem; }
.dialog .row-actions { margin-top: 1.25rem; justify-content: flex-end; }

/* ---------- auth page --------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); }
.auth-art { background: var(--ink); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 3rem; position: relative; overflow: hidden; }
.auth-art img { width: min(22rem, 70%); height: auto; margin: auto; filter: drop-shadow(0 14px 30px rgba(0,0,0,.35)); }
.auth-art p { font-family: var(--f-display); font-size: var(--t-lg); margin: 0; color: #dfe7ef; max-width: 22rem; }
.auth-art small { color: #93a6ba; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form form { width: min(24rem, 100%); display: grid; gap: 1.1rem; }
.auth-form h1 { font-size: var(--t-2xl); }
.auth-form .btn { padding: .7rem; font-size: var(--t-md); }
.form-error { background: var(--bad-wash); color: var(--bad); padding: .7rem 1rem; border-radius: var(--r-ctl); margin: 0; }

.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.error-page .code { font-family: var(--f-display); font-size: 6rem; color: var(--gold); line-height: 1; }

/* ---------- responsive --------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-2, .tt { grid-template-columns: 1fr; }
  .palette { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; background: var(--slate); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .75rem 1rem; gap: .5rem; }
  .brand { border: 0; margin: 0; padding: 0; }
  .brand img { width: 40px; height: 40px; }
  .brand-name { display: none; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; }
  .nav a { white-space: nowrap; }
  .who { border: 0; padding: 0; margin-inline-start: auto; grid-auto-flow: column; gap: .75rem; align-items: center; }
  .who-role { display: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 2rem; min-height: 14rem; }
  .auth-art img { width: 8rem; }
  .ribbon { height: 4.5rem; }
  .seg-t { display: none; }
  .roll { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .seg.now::before { transition: width .8s ease-out; }
  .room { transition: background-color .3s; }
}
@media print {
  .rail, .page-tools, .row-actions { display: none; }
  .shell { display: block; }
  body { background: #fff; }
}

/* ==========================================================================
   v2 components
   ========================================================================== */
.nav-sec { margin: 1rem .75rem .25rem; font-size: var(--t-xs); color: #8197ad; font-weight: 600; }
.nav { overflow-y: auto; margin-inline: -.25rem; padding-inline: .25rem; scrollbar-width: thin; scrollbar-color: var(--ink-3) transparent; }
.nav a { padding: .45rem .75rem; font-size: var(--t-sm); }
.nav a span { flex: 1; }
.nav .count { background: var(--gold); color: var(--ink); font-size: .7rem; border-radius: 999px; padding: 0 .45rem; min-width: 1.4rem; text-align: center; }
.nav-toggle { display: none; }
.who-name { color: #fff; font-weight: 600; text-decoration: none; }
.who-actions { display: flex; gap: 1rem; align-items: baseline; margin-top: .4rem; font-size: var(--t-sm); }
.who-actions a { color: #b8c7d6; }
.who-actions .link-btn { margin: 0; }

.btn-sm { padding: .25rem .6rem; font-size: var(--t-xs); }
.btn-block { width: 100%; }
.btn-danger-solid { background: var(--bad); color: #fff; }
.input-sm { min-height: 2rem; padding: .2rem .5rem; font-size: var(--t-sm); }
.inline-form { display: flex; gap: .4rem; align-items: center; }
.filters .grow { flex: 1 1 14rem; }
.row-actions { white-space: nowrap; }
td.row-actions { display: table-cell; text-align: end; }
td.row-actions .btn + .btn { margin-inline-start: .3rem; }
.narrow { max-width: 38rem; }
.push { margin-inline-start: auto; }
.text-bad { color: var(--bad); font-weight: 600; }
.req { color: var(--bad); }
.code { background: var(--slate); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .6rem .8rem; font-size: var(--t-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.code.big { font-size: var(--t-md); font-weight: 600; }
.big-code { font-size: var(--t-xl); letter-spacing: .15em; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--c, var(--ink-3)); vertical-align: middle; }

/* forms */
.form { display: grid; gap: 1rem; }
.form > h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field .help { color: var(--muted); font-size: var(--t-xs); }
.field .err, .err { color: var(--bad); font-size: var(--t-sm); }
.field.has-error .input { border-color: var(--bad); }
.field-check { align-self: end; }
.check { display: flex; align-items: center; gap: .6rem; font-weight: 600; cursor: pointer; }
.switch { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .35rem .9rem; max-height: 16rem; overflow: auto; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); padding: .6rem; }
.checks label { display: flex; gap: .45rem; align-items: center; font-size: var(--t-sm); cursor: pointer; }
.checks input { accent-color: var(--ink); }
textarea.input { resize: vertical; }
select[multiple].input { min-height: 7rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); padding: .9rem 0 .2rem; border-top: 1px solid var(--line-soft); margin-top: 1rem; }
.form-error { background: var(--bad-wash); color: var(--bad); padding: .7rem 1rem; border-radius: var(--r-ctl); }
.form-error p { margin: 0; }

/* people */
.who-cell { display: inline-flex; align-items: center; gap: .6rem; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--gold-wash); color: var(--gold-deep); display: inline-grid; place-items: center; font-family: var(--f-display); font-weight: 700; flex: none; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); font-size: var(--t-sm); }
.facts dd { margin: 0; }
.action-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* tabs */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tabs a { padding: .5rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: var(--t-sm); }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--gold); }
.tabs.small { margin: 0; border: 0; }

/* permissions matrix */
.matrix td, .matrix th { text-align: center; }
.matrix td:nth-child(-n+2), .matrix th:nth-child(-n+2) { text-align: start; }
.cbox input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); cursor: pointer; }
.matrix tbody tr:has(input:checked) td:nth-child(2) { font-weight: 600; }

/* settings */
.sched-list { display: grid; gap: .6rem; }
.sched { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: .75rem 1rem; }
.sched.on { border-color: var(--gold); background: var(--gold-wash); }
.sched p { margin: .2rem 0 0; font-size: var(--t-sm); }
.preview-day { padding: .6rem 0; border-top: 1px solid var(--line-soft); }
.preview-day:first-of-type { border-top: 0; }
.preview-day h3 { margin-bottom: .4rem; }
.mini-ribbon { display: flex; gap: 2px; }
.mini-ribbon span { flex: 1; background: var(--ink-3); color: #fff; border-radius: 3px; text-align: center; font-family: var(--f-display); padding: .25rem 0; font-size: var(--t-sm); line-height: 1.2; }
.mini-ribbon span small { display: block; font: 400 .65rem var(--f-body); opacity: .8; }
.mini-ribbon span.brk { background: repeating-linear-gradient(-45deg, var(--gold-wash) 0 5px, #f3dfa8 5px 10px); color: var(--ink); flex: .6; }
.steps-list { padding-inline-start: 1.2rem; }
.steps-list li { margin-bottom: .3rem; }

/* QR cards — 8 per A4 */
.cards-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: 1rem; }
.id-card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; break-inside: avoid; }
.id-card header { background: var(--ink); color: #fff; display: flex; align-items: center; gap: .6rem; padding: .45rem .8rem; font-family: var(--f-display); font-size: var(--t-sm); }
.id-card header img { width: 30px; height: auto; }
.id-body { display: grid; grid-template-columns: 4.5rem 1fr 7.5rem; gap: .75rem; align-items: center; padding: .8rem; }
.id-photo { width: 4.5rem; height: 5.5rem; border-radius: 6px; background: var(--gold-wash); color: var(--gold-deep); display: grid; place-items: center; font: 700 var(--t-2xl) var(--f-display); overflow: hidden; }
.id-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-text { display: grid; gap: .1rem; min-width: 0; }
.id-text strong { font-family: var(--f-display); font-size: var(--t-md); line-height: 1.3; }
.id-text span { font-size: var(--t-xs); color: var(--muted); }
.id-text em { font-style: normal; font-size: var(--t-xs); color: var(--gold-deep); font-weight: 600; }
.id-qr svg { width: 100%; height: auto; }
.id-qr svg path { fill: var(--ink); }

/* live QR */
.live-qr { display: grid; gap: 1rem; justify-items: center; max-width: 26rem; margin-inline: auto; text-align: center; }
.seg-switch { display: inline-flex; background: var(--slate); border-radius: 999px; padding: 3px; }
.seg-switch button { border: 0; background: transparent; padding: .45rem 1rem; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg-switch button[aria-checked="true"] { background: var(--ink); color: #fff; }
.qr-box { width: min(18rem, 80vw); aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 16px; padding: .6rem; background: #fff; }
.qr-box svg { width: 100%; height: auto; }
.qr-timer { width: min(18rem, 80vw); height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.qr-timer-bar { height: 100%; width: calc(var(--w, 0) * 1%); background: var(--gold); transition: width .25s linear; }

/* teacher */
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.lessons li { display: grid; grid-template-columns: 4rem 1fr auto; align-items: center; gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r-ctl); }
.lessons li.now { border-color: var(--gold); background: var(--gold-wash); }
.lessons li.sub { border-style: dashed; }
.lesson-time { display: grid; text-align: center; }
.lesson-time b { font-size: var(--t-xl); line-height: 1; }
.lesson-time span { font-size: var(--t-xs); color: var(--muted); }
.week td { padding: .3rem; min-width: 6rem; }
.wk { display: block; border-inline-start: 4px solid var(--c, var(--ink-3)); background: var(--slate); padding: .3rem .45rem; border-radius: 4px; font-size: var(--t-sm); font-weight: 600; }
.wk small { display: block; font-weight: 400; color: var(--muted); }
.roll-call { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.roll-call li { display: grid; grid-template-columns: 1fr auto auto; gap: .5rem; align-items: center; padding: .45rem .3rem; border-bottom: 1px solid var(--line-soft); }
.pill input { position: absolute; opacity: 0; }
.pill span { display: inline-block; padding: .3rem .85rem; border: 1px solid var(--line); border-radius: 999px; font-size: var(--t-sm); cursor: pointer; user-select: none; }
.pill input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.pill-bad input:checked + span { background: var(--bad); border-color: var(--bad); color: #fff; }
.pill-late input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.pill { position: relative; }
.score { width: 6rem; text-align: center; }
.stat-line { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin-bottom: 1rem; color: var(--muted); }
.stat-line b { font-size: var(--t-xl); color: var(--ink); margin-inline-start: .35rem; }
.grade-inline { display: flex; gap: .35rem; align-items: center; }
.grade-inline .input:not(.score) { width: 10rem; }
.sub-row { flex-wrap: wrap; }

/* substitutions */
.sub-plan h2 { flex-wrap: wrap; justify-content: flex-start; }
.sub-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.5rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: .5rem; }
.choice-list { display: grid; gap: .3rem; max-height: 15rem; overflow: auto; }
.choice { display: flex; gap: .5rem; align-items: center; padding: .35rem .5rem; border-radius: var(--r-ctl); cursor: pointer; }
.choice:hover { background: var(--slate); }
.choice em { font-style: normal; font-size: var(--t-xs); color: var(--ok); font-weight: 600; }
.room-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .4rem; }
.room-opt { position: relative; border: 1px dashed #b9c6d3; border-radius: var(--r-ctl); padding: .5rem .6rem; display: grid; cursor: pointer; }
.room-opt input { position: absolute; opacity: 0; }
.room-opt span { font-weight: 600; text-align: end; }
.room-opt small { color: var(--ok); font-size: var(--t-xs); }
.room-opt.busy { background: var(--ink); border: 1px solid var(--ink); color: #c3d1de; cursor: not-allowed; }
.room-opt.busy small { color: #e8b4ae; }
.room-opt:has(input:checked) { border: 2px solid var(--gold); background: var(--gold-wash); }
.room-opt:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }

/* security desk */
.verify { display: flex; gap: .6rem; margin-bottom: 1.25rem; max-width: 32rem; }
.verify-input { font: 700 var(--t-2xl) var(--f-display); letter-spacing: .2em; text-transform: uppercase; text-align: center; flex: 1; }
.verdict { display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem 1.5rem; border-radius: var(--r-surface); margin-bottom: var(--gap); }
.verdict strong { display: block; font: 700 var(--t-xl) var(--f-display); }
.verdict span { display: block; }
.verdict.good { background: var(--ok-wash); color: var(--ok); border: 2px solid var(--ok); }
.verdict.bad { background: var(--bad-wash); color: var(--bad); border: 2px solid var(--bad); }
.verdict .avatar { width: 72px; height: 72px; }
.verdict form { margin-inline-start: auto; }

/* reports */
.trend { display: flex; align-items: flex-end; gap: 4px; height: 12rem; padding-top: .5rem; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.trend-col i { display: block; width: 100%; height: calc(var(--h, 0) * 1%); background: var(--ink-3); border-radius: 3px 3px 0 0; }
.trend-col i.low { background: var(--gold); }
.trend-col small { font-size: .65rem; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.hbars li { display: grid; grid-template-columns: 9rem 1fr 3.5rem; gap: .75rem; align-items: center; }

/* notifications */
.notes li.unread { background: linear-gradient(to left, var(--gold-wash), transparent 60%); padding-inline: .6rem; border-radius: var(--r-ctl); }

/* ---------- kiosk ------------------------------------------------------- */
.kiosk { background: var(--ink); color: #fff; min-height: 100vh; }
.k-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.k-head strong { display: block; font-family: var(--f-display); font-size: var(--t-lg); }
.k-head span { color: #9fb2c6; font-size: var(--t-sm); }
.k-clock { margin-inline-start: auto; font: 700 var(--t-2xl) var(--f-display); direction: ltr; }
.k-net { font-size: var(--t-xs); padding: .2rem .6rem; border-radius: 999px; background: rgba(21,122,85,.3); color: #9fe3c5; }
.k-net.off { background: rgba(180,35,24,.35); color: #ffc9c3; }
.k-setup { display: grid; place-items: center; min-height: 70vh; color: var(--ink); }
.k-main { display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr auto; gap: 1.25rem; padding: 1.25rem 1.5rem; height: calc(100vh - 5.5rem); }
.k-stage { position: relative; background: #0b1828; border-radius: 16px; overflow: hidden; display: grid; place-items: center; }
.k-stage video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.k-frame { position: absolute; width: min(55%, 22rem); aspect-ratio: 1; border: 4px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 100vmax rgba(11,24,40,.35); }
.k-hint { position: absolute; bottom: 1rem; margin: 0; background: rgba(11,24,40,.75); padding: .4rem 1rem; border-radius: 999px; }
.k-result { border-radius: 16px; background: var(--ink-2); display: grid; place-items: center; padding: 2rem; text-align: center; }
.k-result.is-in { background: var(--ok); }
.k-result.is-out { background: var(--gold); color: var(--ink); }
.k-result.is-err { background: var(--bad); }
.k-idle p { font: 700 var(--t-3xl) var(--f-display); margin: 0 0 .5rem; }
.k-idle span { color: #b8c7d6; font-size: var(--t-lg); }
.k-card { display: grid; gap: 1rem; justify-items: center; }
.k-card img, .k-av { width: 11rem; height: 11rem; border-radius: 50%; object-fit: cover; border: 5px solid rgba(255,255,255,.8); }
.k-av { display: grid; place-items: center; background: rgba(255,255,255,.2); font: 700 4rem var(--f-display); }
.k-text strong { display: block; font: 700 var(--t-3xl) var(--f-display); line-height: 1.2; }
.k-text span { display: block; font-size: var(--t-lg); opacity: .9; }
.k-text b { display: inline-block; margin-top: .8rem; font: 700 var(--t-2xl) var(--f-display); background: rgba(0,0,0,.18); padding: .2rem 1.2rem; border-radius: 999px; }
.k-bar { grid-column: 1 / -1; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; color: #b8c7d6; font-size: var(--t-sm); }
.k-bar .input { min-height: 2.2rem; margin-inline-start: .4rem; }
.k-bar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); margin-inline-start: auto; }
.k-queue { background: var(--gold); color: var(--ink); padding: .1rem .6rem; border-radius: 999px; font-weight: 600; }
.k-wedge { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* ---------- portal (phone) ---------------------------------------------- */
.portal { background: var(--slate); padding-bottom: 5.5rem; }
.p-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .75rem; background: var(--ink); color: #fff; padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top)); }
.p-top strong { display: block; font-family: var(--f-display); font-size: var(--t-lg); line-height: 1.2; }
.p-top span { font-size: var(--t-xs); color: #9fb2c6; }
.p-top form { margin-inline-start: auto; }
.p-top .link-btn { margin: 0; }
.kid-switch { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem 1rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.kid-switch a { white-space: nowrap; padding: .3rem .8rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--line); font-size: var(--t-sm); }
.kid-switch a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.p-main { padding: 1rem; max-width: 40rem; margin-inline: auto; display: grid; gap: .9rem; }
.p-card { background: var(--paper); border-radius: 14px; padding: 1rem 1.1rem; border: 1px solid var(--line); }
.p-card > h2 { font-size: var(--t-md); margin-bottom: .6rem; display: flex; justify-content: space-between; align-items: baseline; }
.p-card > h2 a { font: 500 var(--t-sm) var(--f-body); }
.p-banner { display: grid; gap: .15rem; padding: .9rem 1.1rem; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none; }
.p-banner span { font-size: var(--t-sm); color: #c9d5e1; }
.p-banner.gold { background: var(--gold); color: var(--ink); }
.p-banner.gold span { color: var(--ink-2); }
.p-status { display: inline-block; padding: .3rem .8rem; border-radius: 999px; font-weight: 600; background: var(--line-soft); margin: 0 0 .8rem; }
.p-status.tag-present { background: var(--ok-wash); color: var(--ok); }
.p-status.tag-late { background: var(--late-wash); color: var(--late); }
.p-status.tag-absent { background: var(--bad-wash); color: var(--bad); }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; border-top: 1px solid var(--line-soft); padding-top: .7rem; }
.p-stats b { display: block; font-size: var(--t-xl); }
.p-stats span { font-size: var(--t-xs); color: var(--muted); }
.p-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.p-lessons li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; align-items: baseline; }
.p-lessons small { color: var(--muted); }
.num.big { font-size: var(--t-xl); }
.num.big small { font-size: var(--t-sm); color: var(--muted); }
.permit-row { flex-wrap: wrap; }
.confirm-box { flex-basis: 100%; display: grid; gap: .5rem; margin-top: .4rem; }
.confirm-box summary { cursor: pointer; color: var(--muted); font-size: var(--t-sm); }
.confirm-box .inline-form { margin-top: .4rem; }
.p-tabs { position: fixed; bottom: 0; inset-inline: 0; display: flex; background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.p-tabs a { flex: 1; display: grid; justify-items: center; gap: .1rem; padding: .5rem 0 .45rem; font-size: .7rem; color: var(--muted); text-decoration: none; }
.p-tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.p-tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.p-tabs a[aria-current="page"] svg { stroke: var(--gold-deep); }
.task .form { margin-top: .6rem; }

@media (max-width: 1100px) { .sub-grid { grid-template-columns: 1fr; } .k-main { grid-template-columns: 1fr; height: auto; } .k-stage { min-height: 50vh; } }
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; margin-inline-start: auto; background: var(--ink-2); color: #fff; border: 0; border-radius: var(--r-ctl); padding: .4rem .8rem; }
  .nav { display: none; flex-direction: column; flex: 1 1 100%; order: 4; max-height: 70vh; }
  .nav.open { display: flex; }
  .nav-sec { margin-top: .6rem; }
  .who { order: 3; }
  .who-actions { margin: 0; }
  .facts { grid-template-columns: 1fr; }
  .lessons li { grid-template-columns: 3rem 1fr; }
  .lessons li .btn { grid-column: 1 / -1; }
  .hbars li { grid-template-columns: 6rem 1fr 3rem; }
}
@media print {
  .no-print, .page-head, .flash, .filters, .toast, .p-tabs { display: none !important; }
  .main { padding: 0; }
  .print-cards .cards-sheet { grid-template-columns: 1fr 1fr; gap: 6mm; }
  .id-card { border: 1px solid #999; }
  .id-card header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .surface { border: 0; padding: 0; }
}

/* named breaks editor */
.break-rows { display: grid; gap: .6rem; }
.break-row { display: grid; grid-template-columns: 1.4fr .8fr .8fr auto auto; gap: .6rem; align-items: end; border: 1px solid var(--line-soft); border-radius: var(--r-ctl); padding: .6rem .7rem; }
.break-row .check { padding-bottom: .55rem; font-size: var(--t-sm); }
@media (max-width: 820px) { .break-row { grid-template-columns: 1fr 1fr; } }
.mini-ribbon span.brk small { opacity: .7; }
.seg.brk .seg-n { font-size: var(--t-xs); }
.break-row .input, .form-grid .input { min-width: 0; width: 100%; }
.preview-wide .mini-ribbon span { padding: .4rem 0; font-size: var(--t-md); }

/* ==========================================================================
   v3 — modern layer (overrides above). Same identity, more depth & air.
   ========================================================================== */
:root {
  --slate: #f2f5f9;
  --line: #dbe3ec;
  --line-soft: #e9eef4;
  --r-ctl: 10px; --r-surface: 18px;
  --shadow-1: 0 1px 2px rgba(18,38,63,.05), 0 1px 1px rgba(18,38,63,.03);
  --shadow-2: 0 1px 2px rgba(18,38,63,.04), 0 12px 32px -18px rgba(18,38,63,.28);
  --shadow-3: 0 24px 60px -24px rgba(18,38,63,.45);
  --rail: 17rem;
}
body { background:
  radial-gradient(1200px 500px at 85% -10%, rgba(217,154,6,.07), transparent 60%),
  radial-gradient(900px 600px at -10% 0%, rgba(44,77,115,.08), transparent 55%), var(--slate); background-attachment: fixed; }
.shell { background: none; }

/* --- rail ---------------------------------------------------------------- */
.rail { background: linear-gradient(180deg, #132a46 0%, #0f2139 100%); padding: 1.1rem .85rem 1rem; gap: .35rem; height: 100vh; border-inline-start: 1px solid rgba(255,255,255,.04); }
.rail-top { display: flex; align-items: center; justify-content: space-between; }
.brand { border: 0; margin: 0; padding: .25rem .35rem .75rem; gap: .7rem; }
.brand img { width: 44px; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.brand-name { font-size: .9rem; line-height: 1.4; color: #f3f6fa; }
.rail-close { display: none; }
.nav-search { position: relative; display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 0 .7rem; margin-bottom: .4rem; transition: border-color .2s, background .2s; }
.nav-search:focus-within { background: rgba(255,255,255,.12); border-color: rgba(217,154,6,.7); }
.nav-search svg { width: 18px; height: 18px; fill: none; stroke: #9fb2c6; stroke-width: 2; stroke-linecap: round; flex: none; }
.nav-search input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; padding: .6rem 0; font-size: var(--t-sm); outline: none; }
.nav-search input::placeholder { color: #8ea3b8; }
.nav-search input::-webkit-search-cancel-button { filter: invert(1); }
kbd { font: 500 .68rem var(--f-body); direction: ltr; border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: .05rem .35rem; color: #9fb2c6; white-space: nowrap; }
.nav { gap: 1px; padding-bottom: .5rem; }
.nav-group + .nav-group { margin-top: .35rem; }
.nav-sec { margin: .8rem .75rem .3rem; font-size: .72rem; letter-spacing: 0; color: #7f95ab; }
.nav a { border-radius: 10px; padding: .5rem .75rem; color: #c7d3df; font-size: .9rem; transition: background-color .15s, color .15s; }
.nav a svg { width: 19px; height: 19px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(217,154,6,.08), rgba(217,154,6,.22)); color: #fff; box-shadow: none; position: relative; }
.nav a[aria-current="page"]::after { content: ""; position: absolute; inset-inline-start: -.85rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.nav a[aria-current="page"] svg { stroke: var(--gold); opacity: 1; }
.nav mark { background: rgba(217,154,6,.35); color: #fff; border-radius: 3px; }
.nav-empty { color: #8ea3b8; font-size: var(--t-sm); padding: .5rem .75rem; }
.who { border-top: 1px solid rgba(255,255,255,.08); padding: .85rem .25rem 0; gap: .5rem; }
.who-card { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff; padding: .35rem; border-radius: 12px; }
.who-card:hover { background: rgba(255,255,255,.06); }
.who-card b { display: block; font-size: .88rem; font-weight: 600; }
.who-card small { display: block; color: #8ea3b8; font-size: .75rem; }
.who-av, .avatar-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none; font: 700 1rem var(--f-display);
  background: linear-gradient(135deg, var(--gold), #f0c14b); color: var(--ink); }
.who-av img, .avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.who-actions { padding-inline-start: .4rem; font-size: .8rem; }

/* --- top bar ------------------------------------------------------------- */
.main { padding-top: 1rem; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.4rem; }
.search-pill { display: inline-flex; align-items: center; gap: .6rem; flex: 0 1 26rem; background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem .9rem; color: var(--muted); cursor: pointer; backdrop-filter: blur(8px); box-shadow: var(--shadow-1); font-size: var(--t-sm); }
.search-pill:hover { border-color: #c3cfdb; color: var(--ink); }
.search-pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search-pill span { flex: 1; text-align: start; }
.search-pill kbd { color: var(--muted); border-color: var(--line); }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.8); border: 1px solid var(--line); color: var(--ink); cursor: pointer; box-shadow: var(--shadow-1); }
.icon-btn:hover { border-color: #c3cfdb; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
.dot-count { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font: 600 .68rem/19px var(--f-body); text-align: center; box-shadow: 0 0 0 2px var(--slate); }
.avatar-btn { text-decoration: none; box-shadow: var(--shadow-1); }

/* --- page & surfaces ------------------------------------------------------- */
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.6rem, 2.4vw, 2.15rem); letter-spacing: 0; }
.surface { border: 1px solid rgba(219,227,236,.85); border-radius: var(--r-surface); box-shadow: var(--shadow-2); padding: 1.35rem 1.6rem; background: rgba(255,255,255,.96); }
.surface > h2 { font-size: 1.12rem; }
.grid-2 { gap: 1.25rem; }
.stack { gap: 1.25rem; }
.day { overflow: hidden; }
.ribbon { border-radius: 14px; height: 6rem; }
.seg.now { box-shadow: inset 0 0 0 2px rgba(217,154,6,.5); }
.rows > li { padding: .85rem 0; }
.tag { padding: .15rem .65rem; font-weight: 600; }

/* buttons & inputs */
.btn { border-radius: 10px; padding: .55rem 1.05rem; transition: transform .06s, background-color .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #1d3a5c, #12263f); box-shadow: 0 6px 16px -8px rgba(18,38,63,.6); }
.btn-primary:hover { background: linear-gradient(180deg, #24476f, #17304f); }
.btn-gold { background: linear-gradient(180deg, #e7aa1a, #d99a06); box-shadow: 0 6px 16px -8px rgba(217,154,6,.75); }
.btn-ghost { background: rgba(255,255,255,.8); }
.input, select.input { border-radius: 10px; border-color: var(--line); background: #fff; min-height: 2.65rem; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(217,154,6,.16); }
table { border-collapse: separate; border-spacing: 0; }
thead th { background: #f6f8fb; border-bottom: 1px solid var(--line); }
thead th:first-child { border-start-start-radius: 10px; }
thead th:last-child { border-start-end-radius: 10px; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: #f8fafc; }
.filters { background: rgba(255,255,255,.7); border: 1px solid var(--line-soft); border-radius: 16px; padding: .85rem 1rem; box-shadow: var(--shadow-1); }
.flash p { border-radius: 12px; box-shadow: var(--shadow-1); }
.room { border-radius: 12px; }
.room.busy { background: linear-gradient(160deg, #1d3a5c, #12263f); }
.lessons li { border-radius: 14px; background: #fff; box-shadow: var(--shadow-1); }
.toast { border-radius: 12px; }

/* footer credit */
.credit { margin-top: auto; padding-top: 2.5rem; display: flex; align-items: center; justify-content: center; gap: .45rem; color: #8193a6; font-size: .78rem; }
.credit img { height: 16px; width: auto; opacity: .9; }
.credit-sep { opacity: .5; }

/* --- mobile: drawer + bottom tab bar ---------------------------------------- */
.tabbar { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(10,22,38,.5); backdrop-filter: blur(2px); z-index: 40; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; background: none; }
  .rail { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(19rem, 86vw); z-index: 50; transform: translateX(105%); transition: transform .25s ease; flex-direction: column; flex-wrap: nowrap; padding: 1rem .85rem; height: 100%; }
  .rail.open { transform: none; box-shadow: var(--shadow-3); }
  .rail .nav { display: flex; max-height: none; flex: 1; }
  .rail .who { order: 0; }
  .brand-name { display: block; }
  .rail-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 1.4rem; cursor: pointer; }
  .nav-toggle { display: none; }
  .menu-btn { display: grid; }
  .search-pill kbd, .nav-search kbd { display: none; }
  .main { padding: .8rem 1rem 6.5rem; }
  .topbar { margin-bottom: 1rem; }
  .tabbar { position: fixed; bottom: 0; inset-inline: 0; z-index: 30; display: flex; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(18,38,63,.4); }
  .tabbar a, .tabbar button { position: relative; flex: 1; display: grid; justify-items: center; gap: .15rem; padding: .35rem 0; border: 0; background: none; color: var(--muted); text-decoration: none; font: 500 .68rem var(--f-body); cursor: pointer; border-radius: 12px; }
  .tabbar svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { stroke: var(--gold-deep); }
  .tabbar .dot-count { top: 0; inset-inline-end: calc(50% - 22px); }
  .credit { padding-top: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }
@media print { .topbar, .tabbar, .credit, .rail { display: none !important; } }

/* --- login ------------------------------------------------------------------ */
.auth { background: radial-gradient(900px 500px at 100% 0%, rgba(217,154,6,.08), transparent 60%), #fff; }
.auth-art { background: radial-gradient(700px 400px at 50% 30%, rgba(217,154,6,.18), transparent 60%), linear-gradient(160deg, #17304f, #0e1f35); }
.auth-art img { width: min(19rem, 60%); filter: drop-shadow(0 20px 40px rgba(0,0,0,.45)); }
.auth-form form { background: #fff; padding: 2rem; border-radius: 22px; box-shadow: var(--shadow-3); border: 1px solid var(--line-soft); }
.auth-credit { display: flex; align-items: center; gap: .45rem; color: #9fb2c6; font-size: .78rem; }
.auth-credit img { height: 16px; filter: brightness(0) invert(1); opacity: .85; }
@media (max-width: 960px) {
  .rail .who { order: 0; display: grid; grid-auto-flow: row; margin: 0; padding: .85rem .25rem 0; border-top: 1px solid rgba(255,255,255,.08); }
  .rail .who-role { display: block; }
}

/* ---- splash (first screen of the app) -------------------------------------- */
.splash { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; color: #fff; overflow: hidden;
  background: radial-gradient(800px 520px at 50% 38%, #1d3a5c 0%, #12263f 45%, #0b1729 100%); }
.sp-stage { display: grid; justify-items: center; align-content: center; text-align: center; padding: 2rem 1.5rem; position: relative; }
.sp-glow { position: absolute; width: 34rem; height: 34rem; max-width: 120vw; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -58%);
  background: radial-gradient(circle, rgba(217,154,6,.32) 0%, rgba(217,154,6,.08) 38%, transparent 66%); pointer-events: none; }
.sp-logo { position: relative; width: min(16.5rem, 52vw); height: auto; filter: drop-shadow(0 22px 40px rgba(0,0,0,.5)); }
.sp-name { position: relative; margin: 1.6rem 0 .3rem; font: 700 clamp(1.35rem, 4.6vw, 2.1rem)/1.35 var(--f-display); color: #fff; }
.sp-tag { position: relative; margin: 0; color: #b8c7d6; font-size: clamp(.85rem, 2.6vw, 1rem); }
.sp-bar { position: relative; width: min(14rem, 60vw); height: 4px; margin-top: 2rem; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.sp-bar i { position: absolute; inset-block: 0; width: 40%; border-radius: 4px; background: linear-gradient(90deg, transparent, var(--gold), #f6d77a); }
.sp-credit { display: grid; justify-items: center; gap: .2rem; padding: 1rem 1rem calc(1.4rem + env(safe-area-inset-bottom)); color: #8ea3b8; font-size: .78rem; text-align: center; direction: ltr; }
.sp-credit img { height: 22px; width: auto; margin: .25rem 0 .1rem; filter: brightness(0) invert(1); opacity: .92; }
.sp-company { color: #dfe7ef; font-weight: 600; letter-spacing: .02em; }
.sp-eng { color: #c9d5e1; }
.sp-ar { direction: rtl; margin-top: .35rem; font-size: .74rem; color: #7f95ab; }
@media (prefers-reduced-motion: no-preference) {
  .sp-logo:not(.still) { animation: sp-in 1.1s cubic-bezier(.2,.8,.2,1) both; }
  .sp-glow { animation: sp-glow 1.6s ease-out both; }
  .sp-name { animation: sp-up .8s .45s cubic-bezier(.2,.8,.2,1) both; }
  .sp-tag { animation: sp-up .8s .6s cubic-bezier(.2,.8,.2,1) both; }
  .sp-bar { animation: sp-up .6s .75s ease-out both; }
  .sp-bar i { animation: sp-load 1.3s .8s ease-in-out infinite; }
  .sp-credit { animation: sp-fade 1s 1s ease-out both; }
  .splash.leaving .sp-stage, .splash.leaving .sp-credit { transition: opacity .35s, transform .35s; opacity: 0; transform: scale(.98); }
}
@keyframes sp-in { from { opacity: 0; transform: scale(.82) translateY(14px); filter: blur(6px) drop-shadow(0 22px 40px rgba(0,0,0,.5)); } to { opacity: 1; transform: none; } }
@keyframes sp-glow { from { opacity: 0; transform: translate(-50%, -58%) scale(.6); } to { opacity: 1; transform: translate(-50%, -58%) scale(1); } }
@keyframes sp-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-load { from { inset-inline-start: -40%; } to { inset-inline-start: 100%; } }

/* ---- lost & found ---------------------------------------------------------- */
.lf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.seg-tabs { display: inline-flex; flex-wrap: wrap; gap: .25rem; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 14px; padding: 4px; box-shadow: var(--shadow-1); }
.seg-tabs a { padding: .45rem .9rem; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: var(--t-sm); }
.seg-tabs a b { font: 600 .72rem var(--f-body); background: var(--line-soft); color: var(--ink); border-radius: 999px; padding: 0 .45rem; margin-inline-start: .25rem; }
.seg-tabs a[aria-current="page"] { background: var(--ink); color: #fff; }
.seg-tabs a[aria-current="page"] b { background: var(--gold); }
.lf-new { position: relative; }
.lf-new summary { list-style: none; cursor: pointer; }
.lf-new summary::-webkit-details-marker { display: none; }
.lf-new[open] .lf-form { position: absolute; inset-inline-end: 0; top: calc(100% + .5rem); width: min(34rem, 92vw); z-index: 20; box-shadow: var(--shadow-3); }
.lf-form .form-grid { grid-template-columns: 1fr 1fr; }
.lf-form .checks { display: flex; gap: 1rem; border: 0; padding: 0; max-height: none; }
.lf-filter { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lf-filter .input:first-of-type { flex: 1 1 14rem; }
.lf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
.lf-card { background: #fff; border: 1px solid var(--line-soft); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-2); display: flex; flex-direction: column; }
.lf-photo { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #eef2f7, #e2e9f1); display: grid; place-items: center; font-size: 2.6rem; }
.lf-photo img { width: 100%; height: 100%; object-fit: cover; }
.lf-kind { position: absolute; top: .6rem; inset-inline-start: .6rem; font: 600 .72rem var(--f-body); padding: .2rem .6rem; border-radius: 999px; background: var(--ok); color: #fff; }
.lf-card.lost .lf-kind { background: var(--bad); }
.lf-body { padding: .9rem 1rem 1rem; display: grid; gap: .45rem; align-content: start; flex: 1; }
.lf-body h3 { font-size: 1.05rem; }
.lf-meta, .lf-who { margin: 0; color: var(--muted); font-size: var(--t-xs); }
.lf-desc { margin: 0; font-size: var(--t-sm); }
.lf-body .tag { justify-self: start; }
.tag-lf-open { background: var(--ok-wash); color: var(--ok); }
.tag-lf-claimed { background: var(--late-wash); color: var(--late); }
.tag-lf-returned, .tag-lf-closed { background: var(--line-soft); color: var(--muted); }
.st-returned, .st-closed { opacity: .75; }
.lf-code { background: var(--gold-wash); border: 1px dashed var(--gold); border-radius: 12px; padding: .5rem .8rem; text-align: center; }
.lf-code small { display: block; color: var(--gold-deep); font-size: .72rem; }
.lf-code b { font: 700 1.7rem var(--f-display); letter-spacing: .25em; }
.lf-handover { display: flex; gap: .4rem; }
.lf-handover .input { width: 6.5rem; text-align: center; letter-spacing: .15em; }
.link-btn.dark { color: var(--muted); font-size: var(--t-xs); margin: 0; }
.small { font-size: var(--t-xs); margin: 0; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; color: var(--muted); background: rgba(255,255,255,.6); border: 1px dashed var(--line); border-radius: 18px; }
.empty-state p { font: 600 1.1rem var(--f-display); color: var(--ink); margin-bottom: .3rem; }
@media (max-width: 700px) { .lf-form .form-grid { grid-template-columns: 1fr; } .lf-new[open] .lf-form { position: fixed; inset: auto 0 0 0; width: auto; border-radius: 22px 22px 0 0; max-height: 85vh; overflow: auto; } }

/* ---- teacher: classes, roster, hall passes ------------------------------------ */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; }
.class-card { position: relative; display: grid; gap: .2rem; padding: 1.2rem 1.25rem; border-radius: 18px; background: #fff; border: 1px solid var(--line-soft); box-shadow: var(--shadow-2); text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.class-card b { font-size: 1.9rem; line-height: 1.1; direction: ltr; text-align: end; }
.class-card > span { color: var(--muted); font-size: var(--t-sm); }
.class-card.now { background: linear-gradient(160deg, #1d3a5c, #12263f); color: #fff; border-color: transparent; }
.class-card.now > span { color: #c3d1de; }
.now-chip { position: absolute; top: .8rem; inset-inline-start: .9rem; background: var(--gold); color: var(--ink) !important; font-weight: 600; font-size: .72rem !important; padding: .1rem .55rem; border-radius: 999px; }
.cc-meta { display: flex; gap: .6rem; margin-top: .4rem; font-size: var(--t-xs) !important; }
.cc-out { color: var(--bad); font-weight: 600; }
.class-card.now .cc-out { color: #ffb4ab; }
.h-sub { font-size: 1rem; font-family: var(--f-body); font-weight: 400; }
.roster { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .55rem; }
.roster li { display: grid; grid-template-columns: 1fr auto auto; gap: .8rem; align-items: center; background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; padding: .7rem .9rem; box-shadow: var(--shadow-1); }
.roster li.is-out { border-color: var(--gold); background: linear-gradient(90deg, #fff, var(--gold-wash)); }
.roster li.is-late { border-color: var(--bad); background: linear-gradient(90deg, #fff, var(--bad-wash)); }
.roster li.is-absent { opacity: .6; }
.roster .who-cell b { display: block; font-weight: 600; }
.roster .who-cell small { display: block; color: var(--muted); font-size: var(--t-xs); }
.mini-avatar.lg { width: 42px; height: 42px; font-size: 1.05rem; }
.pass-form { display: flex; gap: .35rem; align-items: center; }
.pass-live { display: inline-flex; align-items: center; gap: .5rem; }
.pass-reason { font-size: var(--t-sm); color: var(--gold-deep); font-weight: 600; }
.pass-timer { font-size: 1.35rem; min-width: 3.2rem; text-align: center; background: var(--gold-wash); border-radius: 10px; padding: .1rem .4rem; }
.pass-live.over .pass-timer { background: var(--bad); color: #fff; }
.late-row { background: var(--bad-wash); border-radius: 12px; padding-inline: .6rem !important; }
@media (max-width: 760px) { .roster li { grid-template-columns: 1fr auto; } .roster .pass-form { grid-column: 1 / -1; } .pass-form .input { flex: 1; } }

/* ---- portal v3 ------------------------------------------------------------- */
.portal { background: radial-gradient(700px 300px at 100% 0%, rgba(217,154,6,.08), transparent 60%), var(--slate); padding-bottom: 6rem; }
.p-top { background: linear-gradient(180deg, #17304f, #12263f); gap: .7rem; box-shadow: 0 10px 30px -20px rgba(0,0,0,.6); }
.p-top img { width: 36px; height: auto; }
.p-top > div { flex: 1; min-width: 0; }
.p-top strong, .p-top span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-bell { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; }
.p-bell svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.p-bell .dot-count { box-shadow: 0 0 0 2px #12263f; }
.p-menu { position: relative; }
.p-menu summary { list-style: none; cursor: pointer; }
.p-menu summary::-webkit-details-marker { display: none; }
.p-menu .who-av { width: 38px; height: 38px; }
.p-menu-box { position: absolute; inset-inline-end: 0; top: calc(100% + .5rem); background: #fff; color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-3); padding: .4rem; min-width: 12rem; display: grid; z-index: 20; }
.p-menu-box a, .p-menu-box button { padding: .55rem .8rem; border-radius: 10px; text-decoration: none; color: var(--ink); text-align: start; font-size: var(--t-sm); }
.p-menu-box a:hover { background: var(--slate); }
.p-card { border-radius: 20px; border-color: var(--line-soft); box-shadow: var(--shadow-2); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.quick a { display: grid; justify-items: center; gap: .35rem; padding: .85rem .4rem; background: #fff; border-radius: 18px; border: 1px solid var(--line-soft); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink); font-size: .8rem; font-weight: 600; text-align: center; }
.quick svg { width: 26px; height: 26px; fill: none; stroke: var(--ink-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.quick a.q-gold { background: linear-gradient(160deg, #1d3a5c, #12263f); color: #fff; border-color: transparent; }
.quick a.q-gold svg { stroke: var(--gold); }
.p-tabs { background: rgba(255,255,255,.94); backdrop-filter: blur(14px); box-shadow: 0 -8px 24px -18px rgba(18,38,63,.4); }
.p-tabs a { font-weight: 500; }
.p-main .credit { padding-top: 1.2rem; }
.p-banner { border-radius: 18px; box-shadow: var(--shadow-2); }

/* ---- logo presentation fixes ----------------------------------------------- */
html:has(body.splash) { overflow: hidden; }
.splash { overflow-x: hidden; }
.sp-glow { max-width: 100vw; max-height: 100vw; }
.sp-medal { position: relative; width: min(15.5rem, 58vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #ffffff 0%, #fbf7ee 70%, #f3ead4 100%);
  box-shadow: 0 0 0 3px rgba(217,154,6,.85), 0 0 0 10px rgba(217,154,6,.14), 0 30px 60px -20px rgba(0,0,0,.65); }
.sp-medal .sp-logo { width: 68%; filter: none; }
.sp-medal.small { width: 9rem; }
@media (prefers-reduced-motion: no-preference) {
  .sp-medal { animation: sp-in 1.1s cubic-bezier(.2,.8,.2,1) both; }
  .sp-medal .sp-logo:not(.still) { animation: sp-logo 1.4s .25s cubic-bezier(.2,.8,.2,1) both; }
}
@keyframes sp-logo { from { opacity: 0; transform: scale(.9) rotate(-4deg); } to { opacity: 1; transform: none; } }
.brand img, .p-top img { background: #fff; border-radius: 12px; padding: 4px; box-shadow: 0 0 0 1px rgba(217,154,6,.55); filter: none; }
.brand img { width: 46px; }
.p-top img { width: 38px; border-radius: 10px; padding: 3px; }
.auth-art img { background: radial-gradient(circle at 50% 35%, #fff, #f3ead4); border-radius: 50%; padding: 2.6rem; box-shadow: 0 0 0 3px rgba(217,154,6,.8), 0 30px 60px -20px rgba(0,0,0,.6); width: min(20rem, 62%); filter: none; }
/* mobile overflow: grid tracks must be allowed to shrink below their content */
@media (max-width: 1100px) { .grid-2, .tt { grid-template-columns: minmax(0, 1fr); } }
.main, .stack, .surface { min-width: 0; }
.lessons li.empty { display: block; }
.sp-medal { background: #fff; box-shadow: inset 0 -18px 40px -24px rgba(217,154,6,.35), 0 0 0 3px rgba(217,154,6,.85), 0 0 0 10px rgba(217,154,6,.14), 0 30px 60px -20px rgba(0,0,0,.65); }
.auth-art img { background: #fff; }
