/* School National app — every style in one file (upgrade 53: app.css + premium.css merged; declarations that a later identical
   selector always overrode were removed). Brand colours: brand/BRAND.md (Ink #0A0A0A, Paper #F5F5F2, Signal red #E8261C, Deep red #C8180F). */
:root { --side: 248px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--text); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
a { color: var(--brand-text); text-decoration: none; cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
/* layout */
.shell { display: grid; grid-template-columns: var(--side) 1fr; }
.side { top: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 16px; }
.brand .logo { width: 38px; height: 38px; display: grid; place-items: center; }
.brand .logo svg { width: 21px; height: 21px; stroke-width: 2.6; }
.brand b { display: block; font-size: 15px; line-height: 1.15; }
.brand span { font-size: 11.5px; color: var(--muted); }
.nav-label { font-size: 11px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--muted); font-weight: 550; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav .badge { margin-left: auto; }
.me { margin-top: auto; padding: 10px; background: var(--surface-2); display: flex; align-items: center; gap: 10px; }
.main { min-width: 0; padding: 22px clamp(14px, 3vw, 34px) 90px; width: 100%; animation: fade .2s; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.top h1 { flex: 1; min-width: 180px; }
.top .sub { color: var(--muted); font-size: 13.5px; font-weight: 400; margin-top: 2px; letter-spacing: 0; }
.bottom-nav { display: none; }
/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; white-space: nowrap; transition: transform .06s, background .15s, border-color .15s, box-shadow .15s; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.sm { font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=tel], input[type=search], select, textarea { width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px; }
textarea { min-height: 78px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.invalid input, .invalid select, input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
.f .hint { font-weight: 400; color: var(--faint); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--line); outline: none; padding: 0; min-height: 0; border: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); box-shadow: 0 1px 6px rgba(0,0,0,.3); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 3px solid var(--surface); cursor: pointer; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); overflow: hidden; }
.stepper button { width: 36px; height: 38px; border: 0; background: transparent; font-size: 18px; font-weight: 600; cursor: pointer; color: var(--muted); }
.stepper button:hover { background: var(--surface-2); color: var(--text); }
.stepper output { min-width: 50px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); user-select: none; transition: all .12s; }
.chip:hover { border-color: var(--faint); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .chip.on { color: #0c0e16; }
.seg { display: inline-flex; background: var(--surface-2); gap: 2px; }
.seg button { border: 0; background: transparent; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search svg { position: absolute; left: 12px; top: 12px; color: var(--faint); }
.search input { padding-left: 38px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; color: var(--text); font-size: 14px; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; min-height: 0; border-radius: 99px; background: var(--line); border: 0; position: relative; padding: 0; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked::after { transform: translateX(18px); }
/* surfaces */
.card { border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card > h2 .btn { margin-left: auto; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 18px 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { border: 1px solid var(--line); padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; cursor: default; }
a.kpi { color: inherit; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .val { margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.kpi .foot { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi .dot { display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.kpi.bad .dot { background: var(--bad-soft); color: var(--bad); }
.kpi.ok .dot { background: var(--ok-soft); color: var(--ok); }
.kpi.late .dot { background: var(--late-soft); color: var(--late); }
.kpi.bad .val { color: var(--bad); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.late { background: var(--late-soft); color: var(--late); }
.badge.exc { background: var(--exc-soft); color: var(--exc); }
.badge.brand { background: var(--brand-soft); color: var(--brand-text); }
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; object-fit: cover; background: var(--brand); }
.avatar.lg { width: 96px; height: 96px; font-size: 32px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { margin-bottom: 8px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; }
.tablewrap { overflow-x: auto; }
th { text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.list > * { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.list > *:last-child { border-bottom: 0; }
.list a.item { color: inherit; }
.list a.item:hover { background: var(--surface-2); }
.progress { overflow: hidden; }
.progress i { display: block; height: 100%; }
.progress.bad i { background: var(--bad); }
.progress.late i { background: var(--late); }
.progress.ok i { background: var(--ok); }
.tabs { display: flex; margin-bottom: 16px; overflow-x: auto; }
.tabs button { font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { border-bottom-color: var(--brand); }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 18px; }
.dl div span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.dl div b { font-weight: 550; overflow-wrap: anywhere; }
/* attendance sheet */
.daybar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.daybar input[type=date] { width: auto; }
.tally { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tally .badge { padding: 6px 12px; font-size: 12.5px; }
.att { display: grid; grid-template-columns: minmax(200px, 1.4fr) auto auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background .2s; }
.att:last-child { border-bottom: 0; }
.att.s-present { background: color-mix(in srgb, var(--ok-soft) 45%, transparent); }
.att.s-late { background: color-mix(in srgb, var(--late-soft) 45%, transparent); }
.att.s-absent { background: color-mix(in srgb, var(--bad-soft) 45%, transparent); }
.att.s-excused { background: color-mix(in srgb, var(--exc-soft) 45%, transparent); }
.att .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.att .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.cdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.marks { display: flex; gap: 6px; }
.mark { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 9px 13px; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); transition: all .12s; min-height: 42px; }
.mark:active { transform: scale(.95); }
.mark.present:hover, .mark.present.on { border-color: var(--ok); color: var(--ok); }
.mark.present.on { background: var(--ok); color: #fff; }
.mark.late:hover, .mark.late.on { border-color: var(--late); color: var(--late); }
.mark.late.on { background: var(--late); color: #fff; }
.mark.absent:hover, .mark.absent.on { border-color: var(--bad); color: var(--bad); }
.mark.absent.on { background: var(--bad); color: #fff; }
.mark.excused:hover, .mark.excused.on { border-color: var(--exc); color: var(--exc); }
.mark.excused.on { background: var(--exc); color: #fff; }
.mark.cancelled:hover, .mark.cancelled.on { border-color: var(--muted); color: var(--text); }
.mark.cancelled.on { background: var(--muted); color: #fff; }
.att.s-noshow { background: color-mix(in srgb, var(--bad-soft) 60%, transparent); }
.heat i.noshow { background: #9f1239; }
.tstat.noshow { background: #9f1239; }
.att.s-cancelled { background: var(--surface-2); }
.att.s-cancelled .who { opacity: .6; }
:root[data-theme="dark"] .mark.on { color: #0c0e16; }
.hoursbox { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hoursbox .small { color: var(--faint); }
/* timetable */
.tt { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tt .day { background: var(--surface); border: 1px solid var(--line); padding: 10px; min-height: 140px; }
.tt .day h3 { font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; color: var(--muted); }
.slot { padding: 8px 9px; margin-bottom: 6px; font-size: 12.5px; border-left: 4px solid var(--brand); background: var(--surface-2); cursor: pointer; }
.slot:hover { filter: brightness(.97); }
.slot b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.off { opacity: .45; }
/* charts */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .bar { transition: opacity .15s; }
.chart .bar:hover { opacity: .75; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.legend i { width: 10px; height: 10px; display: inline-block; margin-right: 6px; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); }
.heat i.cancelled { background: var(--faint); }
.heat i.present { background: var(--ok); }
.heat i.late { background: var(--late); }
.heat i.absent { background: var(--bad); }
.heat i.excused { background: var(--exc); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap svg { width: 132px; height: 132px; flex: none; }
.donut-wrap text.big { font-size: 22px; fill: var(--text); }
/* profile */
.hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero .photo { position: relative; }
.hero .photo .btn { position: absolute; right: -8px; bottom: -8px; border-radius: 50%; padding: 7px; box-shadow: var(--shadow); }
.hero h1 { font-size: 26px; }
.doc { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; }
.doc .thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; cursor: pointer; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.inst { display: grid; grid-template-columns: 28px 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.inst span { color: var(--faint); font-weight: 650; font-size: 12.5px; }
.summary { background: var(--surface-2); border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
.summary div { display: flex; justify-content: space-between; gap: 10px; }
.summary .total { font-size: 18px; font-weight: 700; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.issue { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.issue:hover { background: var(--surface-2); }
.issue:last-child { border-bottom: 0; }
.issue .sev { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.issue.error .sev { background: var(--bad-soft); color: var(--bad); }
.issue.warn .sev { background: var(--late-soft); color: var(--late); }
.issue.info .sev { background: var(--exc-soft); color: var(--exc); }
.qr { background: #fff; padding: 8px; width: 176px; flex: none; }
.qr svg { width: 100%; height: auto; display: block; }
.report { display: flex; flex-direction: column; gap: 10px; }
.report p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
/* modal, toast, auth */
.overlay { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; overflow-y: auto; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); width: 100%; max-width: 620px; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 440px; }
.modal header { display: flex; align-items: center; padding: 18px 20px 0; gap: 10px; }
.modal header h2 { flex: 1; font-size: 19px; }
.modal .body { padding: 16px 20px; }
.modal footer { padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.formerr { background: var(--bad-soft); color: var(--bad); border-radius: 11px; padding: 10px 12px; font-weight: 550; margin-bottom: 12px; display: flex; gap: 8px; }
.warnbox { background: var(--late-soft); color: var(--late); border-radius: 11px; padding: 10px 12px; font-weight: 550; display: flex; gap: 8px; margin-bottom: 8px; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { box-shadow: var(--shadow-lg); font-weight: 550; animation: pop .18s; display: flex; gap: 8px; align-items: center; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }
.toast.ok svg { color: #6ee7b7; }
.auth { display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 430px; padding: 28px; }
.auth .brand { padding: 0 0 18px; }
.auth h1 { margin-bottom: 4px; }
.auth p { color: var(--muted); margin: 0 0 18px; }
.crop { width: 300px; height: 300px; max-width: 100%; border-radius: 22px; background: #000; touch-action: none; cursor: grab; display: block; margin: 0 auto 14px; }
.results { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); margin-top: 6px; z-index: 20; max-height: 340px; overflow-y: auto; padding: 6px; }
.results a { display: flex; gap: 10px; align-items: center; padding: 8px; color: inherit; }
.results a:hover { background: var(--surface-2); }
/* phone number with country code, logo, family contract rows */
.phone { display: flex; gap: 6px; align-items: center; }
.phone select { width: 118px; flex: none; padding-left: 8px; padding-right: 4px; }
.phone input[type=tel] { flex: 1; min-width: 0; }
.phone [data-wa]:not([href]) { opacity: .3; pointer-events: none; }
.logo-img { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; flex: none; border: 1px solid var(--line); }
.auth .logo-img { width: 56px; height: 56px; }
.memrow { display: grid; grid-template-columns: 1.3fr auto 1fr 1.3fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
/* instructor timetable */
.tgrid-wrap { overflow-x: auto; border: 1px solid var(--line); }
.tgrid { display: grid; min-width: max-content; background: var(--surface); }
.thead { height: 46px; padding: 6px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; position: sticky; top: 0; background: var(--surface); z-index: 3; }
.thead b { font-size: 13px; }
.thead span { font-size: 11px; color: var(--muted); }
.ttimes span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ttimes span:first-child { transform: none; }
.tcol { border-left: 1px solid var(--line); min-width: 150px; }
.tcol.today .thead { background: var(--brand-soft); }
.tcol.today .thead b { color: var(--brand-text); }
.tcol.over .tbody { background-color: var(--brand-soft); }
.tbody { position: relative; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); }
.tbox { position: absolute; left: 4px; right: 4px; padding: 5px 8px 5px 10px; font-size: 11.5px; line-height: 1.32; overflow: hidden; user-select: none; -webkit-user-select: none; background: color-mix(in srgb, var(--c) 17%, var(--surface)); border-left: 4px solid var(--c); display: flex; flex-direction: column; transition: box-shadow .15s; z-index: 1; }
.tbox:hover { box-shadow: 0 4px 14px rgba(16,24,40,.16); z-index: 2; }
.tbox > b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; padding-right: 16px; }
.tbox > b svg { width: 13px; height: 13px; }
.tbox > span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbox .grip { position: absolute; top: 3px; right: 2px; color: var(--faint); touch-action: none; cursor: grab; padding: 2px; }
.tbox .grip svg { width: 14px; height: 14px; stroke-width: 3; }
.tbox.dragging { opacity: .35; }
.tdetails { display: none; }
.tbox.open { height: auto !important; min-height: 60px; z-index: 6; overflow: visible; box-shadow: var(--shadow-lg); background: var(--surface); outline: 2px solid var(--c); cursor: default; min-width: 250px; }
.tbox.open > span, .tbox.open > b { white-space: normal; }
.tbox.open .tdetails { display: grid; gap: 9px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.tmarks { display: flex; gap: 4px; flex-wrap: wrap; }
.tmarks .mark { min-height: 34px; padding: 5px 10px; font-size: 12px; border-radius: 9px; }
.tmarks .mark[disabled] { opacity: .45; pointer-events: none; }
.tmember { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 5px 0; border-top: 1px solid var(--line); }
.tghost { position: absolute; left: 4px; right: 4px; border: 2px dashed var(--brand); border-radius: 9px; z-index: 5; font-size: 12px; font-weight: 700; color: var(--brand-text); padding: 4px 8px; pointer-events: none; }
.tstat { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.tstat.present, .tstat.late { background: var(--ok); }
.tstat.absent { background: var(--bad); }
.tstat.excused { background: var(--exc); }
.planrow { display: grid; grid-template-columns: 1.3fr 1fr 1.4fr auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mbar { display: flex; height: 10px; overflow: hidden; margin: 6px 0; min-width: 120px; }
.mbar i { display: block; height: 100%; }
@media (max-width: 1000px) {
  .cols, .cols.even { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; inset: 0; z-index: 40; width: 100%; }
  .bottom-nav { display: flex; border-top: 1px solid var(--line); z-index: 45; }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; color: var(--muted); }
  .bottom-nav svg { width: 21px; height: 21px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .att { grid-template-columns: 1fr; gap: 10px; }
  .marks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .mark { justify-content: center; padding: 10px 2px; font-size: 11.5px; }
  .planrow, .memrow { grid-template-columns: 1fr 1fr !important; }
  .mark svg { display: none; }
  .hoursbox { flex-direction: row; justify-content: space-between; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .modal { overflow-y: auto; max-width: none !important; }
  td, th { padding: 10px; }
  .hide-m { display: none !important; }
}
@media print {
  .side, .bottom-nav, .btn, #toasts { display: none !important; }
  .shell { display: block; }
}
/* contract form: hours stepper, child cards, finishing-soon box, frozen lessons */
.hstep { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--surface); max-width: 220px; }
.hstep button { width: 44px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 600; cursor: pointer; color: var(--text); flex: none; }
.hstep button:active { background: var(--line); }
.hstep input { border: 0 !important; border-radius: 0; text-align: center; font-weight: 700; box-shadow: none !important; min-width: 0; }
.memcard { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; display: grid; gap: 10px; background: var(--surface); }
.memgrid { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 10px; align-items: end; }
.finishbox { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--late-soft); }
.finishbox .list > * { border-color: color-mix(in srgb, var(--late) 25%, transparent); }
.tbox.frozen { background-image: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--exc) 22%, transparent) 7px 14px); opacity: .8; }
html, body { overflow-x: hidden; }
/* phones: keep everything inside the visible screen and give each control room */
@media (max-width: 820px) {
  .main { padding: calc(14px + env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom)); }
  .auth { padding-top: calc(20px + env(safe-area-inset-top)); align-items: start; }
  .side.open { padding-top: calc(18px + env(safe-area-inset-top)); }
  .overlay { padding: 0; align-items: flex-end; height: 100dvh; }
  .modal { max-height: calc(100dvh - env(safe-area-inset-top) - 10px); display: flex; flex-direction: column; overflow: hidden; }
  .modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
  .modal header { flex: none; padding: 14px 16px 8px; position: relative; z-index: 2; background: var(--surface); }
  .modal .body { overflow-y: auto; flex: 1; min-height: 0; padding: 10px 16px 14px; -webkit-overflow-scrolling: touch; }
  .modal footer { flex: none; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); }
  .top { gap: 8px; margin-bottom: 14px; }
  .top h1 { flex: 1 1 100%; min-width: 0; }
  .top > .btn, .top > a.btn, .top > .row { flex: 1 1 auto; }
  .top .search { flex: 1 1 100%; max-width: none !important; }
  .card { padding: 14px; }
  .card > h2 { flex-wrap: wrap; row-gap: 8px; font-size: 16px; }
  .card > h2 .btn, .card > h2 > .row, .card > h2 > .seg { margin-left: 0 !important; }
  .card.flush > h2 { padding: 14px 14px 0; }
  .hero { gap: 12px; }
  .hero > .grow { flex: 1 1 60%; min-width: 0; }
  .hero h1 { font-size: 20px; overflow-wrap: anywhere; }
  .avatar.lg { width: 72px; height: 72px; border-radius: 20px; font-size: 26px; }
  .hero > .row.wrap { flex: 1 1 100%; }
  .hero > .row.wrap > .btn { flex: 1 1 calc(50% - 6px); }
  .hero > .row.wrap > .btn.icon { flex: 0 0 auto; }
  .tabs { margin: 0 -12px 14px; padding: 0 12px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { font-size: 13.5px; }
  .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg button { flex: none; }
  .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .daybar > .btn.primary { flex: 1 1 100%; }
  .daybar .grow { display: none; }
  .memgrid { grid-template-columns: 1fr; }
  .hstep { max-width: none; }
  .inst { grid-template-columns: 22px 1fr 1fr; }
  .inst > span:last-child { display: none; }
  .docs { grid-template-columns: 1fr; }
  .doc .row { flex-wrap: wrap; }
  .list > * { flex-wrap: wrap; }
  .issue { padding: 12px; }
  .kpi { padding: 12px; }
  .kpi .lbl { font-size: 11.5px; }
  .kpi .dot { width: 26px; height: 26px; }
  .report .row { flex-wrap: wrap; }
  .report .btn { flex: 1; }
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .phone select { width: 92px; font-size: 13px; }
  .qr { width: 150px; }
  .tgrid-wrap { margin: 0 -4px; }
  .bottom-nav { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=tel], input[type=search], input[type=month], select, textarea { font-size: 16px; }
}
/* grouped subject chips, flags, cover */
.chips.grouped .chipgroup { flex: 0 0 100%; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 6px; }
.chips.grouped { max-height: 260px; overflow-y: auto; padding: 2px; }
.card.flags { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad-soft) 35%, var(--surface)); }
a.flagcard { color: inherit; box-shadow: none; padding: 12px; }
a.flagcard:hover { border-color: var(--bad); }
.badge svg.ic { width: 12px; height: 12px; }
.tbox.covered { opacity: .5; filter: grayscale(.6); }
.tbody { cursor: copy; }
.tbox { cursor: grab; }
/* iPhone home-screen app: the page must reach the real bottom of the screen (no dead strip under the bottom bar) */
/* delete confirmation, calendar, filters */
ul.purge { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
ul.purge li { line-height: 1.4; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calhead { text-align: center; font-size: 11px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.calcell { min-height: 64px; border: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); min-width: 0; }
.calcell.out { border: 0; background: transparent; }
.caln { font-size: 11.5px; font-weight: 650; color: var(--muted); }
.calpill { font-size: 10.5px; font-weight: 650; color: #fff; background: var(--faint); overflow: hidden; }
.calpill.present { background: var(--ok); }
.calpill.late { background: var(--late); }
.calpill.absent { background: var(--bad); }
.calpill.noshow { background: #9f1239; }
.calpill.excused { background: var(--exc); }
.calpill.booked { background: transparent; color: var(--brand-text); border: 1.5px dashed var(--brand); }
.calpill.unmarked { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select { width: auto; flex: 0 1 190px; min-height: 38px; padding: 7px 10px; }
/* instructor timetable, fit-to-screen view: the whole week without scrolling sideways */
.tgrid-wrap.fit { overflow: visible; }
.tgrid.fit { min-width: 0; }
.tgrid.fit .tcol { min-width: 0; }
.tgrid.fit .thead { height: 38px; padding: 3px 2px; align-items: center; text-align: center; }
.tgrid.fit .thead b { font-size: 11.5px; }
.tgrid.fit .thead span { font-size: 9.5px; white-space: nowrap; }
.tgrid.fit .ttimes span { font-size: 9.5px; right: 3px; }
.tgrid.fit .tbox { left: 1px; right: 1px; padding: 2px 3px 2px 4px; font-size: 9.5px; line-height: 1.25; border-left-width: 3px; border-radius: 6px; }
.tgrid.fit .tbox > b { font-size: 10.5px; padding-right: 0; gap: 3px; }
.tgrid.fit .tbox .grip { display: none; }
.tgrid.fit .tbox.open { width: 264px; right: auto; left: 1px; font-size: 12px; padding: 8px 10px; }
.tgrid.fit .tcol.r .tbox.open { left: auto; right: 1px; }
.tgrid.fit .tbox.open > b { font-size: 13.5px; }
@media (max-width: 820px) {
  .calcell { min-height: 50px; padding: 2px; border-radius: 7px; }
  .calpill { font-size: 9px; }
  .caln { font-size: 10.5px; }
  .filters select { flex: 1 1 44%; }
  .tgrid.fit .tbox > span { display: none; }
  .tgrid.fit .tbox.open > span { display: block; }
}
@media (max-width: 820px) {
  /* on a phone an opened timetable box becomes a card in the middle of the screen, so nothing is cut off */
  .tgrid.fit .tbox.open, .tgrid.fit .tcol.r .tbox.open { position: fixed; left: 12px; right: 12px; width: auto; top: 14vh !important; max-height: 70vh; overflow-y: auto; z-index: 44; }
}
/* ---- app-like shell: the page itself never moves; only the content area scrolls ---- */
html { height: calc(100% + env(safe-area-inset-top)); min-height: 0; overflow: hidden; overscroll-behavior: none; }
body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
#app { height: 100%; }
.shell { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); overflow: hidden; position: relative; }
.side { position: static; height: 100%; }
.main { height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; max-width: none; margin: 0; padding-left: max(clamp(14px, 3vw, 34px), calc((100% - 1380px) / 2)); padding-right: max(clamp(14px, 3vw, 34px), calc((100% - 1380px) / 2)); }
.auth { height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.btn, .nav a, .bottom-nav a, .chip, .mark, .tabs button, .seg button, .tbox { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (max-width: 820px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .bottom-nav { position: absolute; }
  .side.open { position: absolute; height: 100%; }
}
@media print {
  html, body, #app, .shell, .main { height: auto !important; overflow: visible !important; }
}
/* ---- motion: plays once when a page opens ---- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes donutIn { from { opacity: 0; transform: rotate(-70deg) scale(.86); } to { opacity: 1; transform: none; } }
.nav-anim > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.nav-anim > *:nth-child(2) { animation-delay: .04s; }
.nav-anim > *:nth-child(3) { animation-delay: .08s; }
.nav-anim > *:nth-child(4) { animation-delay: .12s; }
.nav-anim > *:nth-child(n+5) { animation-delay: .16s; }
.nav-anim .chart rect.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: growY .7s cubic-bezier(.2, .8, .2, 1) both; }
.nav-anim .chart polyline.draw { stroke-dasharray: 1; animation: drawLine 1.1s cubic-bezier(.4, 0, .2, 1) both; }
.nav-anim .chart .fadein { animation: fade .9s .25s both; }
.nav-anim .donut-wrap svg { transform-origin: 50% 50%; animation: donutIn .8s cubic-bezier(.2, .8, .2, 1) both; }
.nav-anim .progress i { transform-origin: 0 50%; animation: growX .8s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.btn, .mark, .chip, .kpi, .card { transition: transform .12s cubic-bezier(.2, .8, .2, 1), box-shadow .15s, background .15s, border-color .15s, color .15s; }
.mark:active, .chip:active, .bottom-nav a:active { transform: scale(.94); }
.tbox.lift { transform: scale(1.07); box-shadow: 0 14px 34px rgba(16, 24, 40, .35); z-index: 9; opacity: .92 !important; transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s; }
.tghost { transition: top .08s linear; }
@media (prefers-reduced-motion: reduce) {
  .nav-anim > *, .nav-anim .chart rect.grow, .nav-anim .chart polyline.draw, .nav-anim .donut-wrap svg, .nav-anim .progress i { animation: none !important; }
}
/* import page */
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
label.drop { display: block; }
/* ======== formerly premium.css (the School National look, upgrades 9-52) ======== */
/* Premium look (upgrade 9). Loaded after app.css: it only restyles — layout rules and behaviour stay in app.css.
   To go back to the old look, remove the premium.css line from index.html. */
:root { --ok-soft: #dcf5e4; --late-soft: #fbeed2; --bad-soft: #fde3e1; --exc: #6d5bd0; --exc-soft: #ebe7fb; --r: 22px; --r-sm: 14px; }
:root[data-theme="dark"] { --exc: #b6a6ff; }
body { background: radial-gradient(900px 520px at 88% -12%, var(--ambient), transparent 62%), radial-gradient(700px 420px at -8% 108%, var(--ambient), transparent 60%), var(--bg); font-feature-settings: "ss01", "cv11"; }
::selection { background: var(--hi); color: var(--hi-ink); }
h1, h2, h3, h4 { font-weight: 620; letter-spacing: -.022em; }
h1 { font-size: 26px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
/* side menu */
.side { background: color-mix(in srgb, var(--surface) 70%, var(--bg)); }
.brand .logo { background: var(--hi); color: var(--hi-ink); border-radius: 14px; box-shadow: 0 8px 22px color-mix(in srgb, var(--hi) 30%, transparent); }
.nav a { border-radius: 999px; padding: 9px 14px; }
.nav a.on { background: var(--hi); color: var(--hi-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--hi) 22%, transparent); }
.nav a svg.ic { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.nav a:hover svg.ic { transform: scale(1.12); }
.me { border-radius: 20px; border: 1px solid var(--line); }
/* buttons and controls */
.btn { border-radius: 999px; padding: 9px 16px; }
.btn.sm { border-radius: 999px; padding: 6px 12px; }
.btn.icon { padding: 9px; aspect-ratio: 1; }
.btn.sm.icon { padding: 7px; }
:root[data-theme="dark"] .btn:not(.primary):not(.ghost) { background: var(--surface-2); }
.btn:hover { border-color: var(--faint); transform: translateY(-1px); }
.btn:active { transform: scale(.96); }
.btn.primary { transition: background-position .7s cubic-bezier(.2, .8, .2, 1), transform .12s, box-shadow .15s; }
.btn.primary:hover { box-shadow: 0 10px 28px color-mix(in srgb, var(--hi) 38%, transparent); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=tel], input[type=search], input[type=month], select, textarea { border-radius: 14px; }
:root[data-theme="dark"] input:focus, :root[data-theme="dark"] select:focus, :root[data-theme="dark"] textarea:focus { border-color: var(--hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hi) 20%, transparent); }
.stepper, .hstep { border-radius: 999px; }
.stepper button { border-radius: 50%; }
.seg { border-radius: 999px; padding: 4px; border: 1px solid var(--line); }
.seg button { border-radius: 999px; padding: 6px 14px; transition: background .2s, color .2s; }
.seg button.on { background: var(--hi); color: var(--hi-ink); box-shadow: none; }
.switch input:checked { background: var(--hi); }
.switch input:checked::after { background: var(--hi-ink); }
.search input { border-radius: 999px; }
.tabs { border-bottom: 0; gap: 6px; padding-bottom: 2px; }
.tabs button { border: 1px solid var(--line); border-radius: 999px; margin-bottom: 0; padding: 8px 15px; background: var(--surface); transition: background .2s, color .2s, border-color .2s; }
.tabs button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge { letter-spacing: .01em; }
/* cards */
.card { background: var(--card-bg); border-radius: var(--r); }
.card > h2 > svg.ic:first-child { width: 34px; height: 34px; padding: 8px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.card:has(> .hero) { background: radial-gradient(520px 260px at 100% 0%, color-mix(in srgb, var(--hi) 13%, transparent), transparent 70%), var(--card-bg); }
.kpi { background: var(--card-bg); border-radius: var(--r); }
.kpi::after { content: ""; position: absolute; right: 0; top: 0; width: 120px; height: 86px; pointer-events: none; background-image: radial-gradient(currentColor 1px, transparent 1.7px); background-size: 9px 9px; color: var(--faint); opacity: .55; -webkit-mask-image: radial-gradient(120px 86px at 100% 0, #000, transparent 72%); mask-image: radial-gradient(120px 86px at 100% 0, #000, transparent 72%); }
.kpi .dot { border-radius: 50%; width: 32px; height: 32px; }
.kpi .val { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
a.kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.22); border-color: var(--faint); }
.kpis > .kpi:first-child:not(.bad):not(.late) { background: var(--hi); border-color: transparent; color: var(--hi-ink); }
.kpis > .kpi:first-child:not(.bad):not(.late) .dot { background: var(--hi-ink); color: var(--hi); }
.kpis > .kpi:first-child:not(.bad):not(.late)::after { color: var(--hi-ink); opacity: .32; }
.avatar { border-radius: 50%; }
.avatar.sm { border-radius: 50%; }
.avatar.lg { border-radius: 50%; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--hi), 0 14px 34px color-mix(in srgb, var(--hi) 22%, transparent); }
.list a.item { border-radius: 14px; transition: background .15s, transform .15s; }
.list a.item:hover { transform: translateX(2px); }
th { background: transparent; }
.summary, .doc, .memcard, .drop, .finishbox { border-radius: 18px; }
.issue .sev { border-radius: 50%; }
.empty { position: relative; isolation: isolate; }
.empty::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--faint) 1px, transparent 1.7px); background-size: 12px 12px; opacity: .4; -webkit-mask-image: radial-gradient(closest-side, #000 10%, transparent); mask-image: radial-gradient(closest-side, #000 10%, transparent); }
.empty svg { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
/* hatched tracks: the part still to go */
.progress { height: 10px; border-radius: 99px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, color-mix(in srgb, var(--faint) 38%, var(--surface-2)) 4px 6px); }
.progress i { border-radius: 99px; background: linear-gradient(90deg, var(--hi2), var(--hi)); }
.mbar { border-radius: 99px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 4px, color-mix(in srgb, var(--faint) 38%, var(--surface-2)) 4px 6px); }
.calcell.shut { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, color-mix(in srgb, var(--faint) 16%, var(--surface-2)) 6px 8px); }
.calcell { border-radius: 12px; }
.calcell.today { border-color: var(--hi); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hi) 28%, transparent); }
/* timetable */
.tgrid-wrap { border-radius: 20px; }
.tbox { border-radius: 12px; }
.slot { border-radius: 12px; }
.tt .day { border-radius: 18px; }
.tt .day.today { border-color: var(--hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hi) 20%, transparent); }
.tghost { border-color: var(--hi); background: color-mix(in srgb, var(--hi) 16%, transparent); }
/* charts */
.chart .track { fill: var(--surface-2); opacity: .55; }
.chart .gridline { stroke-dasharray: 2 6; }
.chart .glow { stroke-opacity: .26; filter: blur(7px); }
.chart .pt circle { opacity: 0; transition: opacity .15s; }
.chart .pt:hover circle, .chart .pt.on circle { opacity: 1; }
.chart .bar.pt:hover { opacity: 1; }
.chart .guide { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 4; }
.legend i { border-radius: 50%; }
.dtrack { stroke: var(--surface-2); }
.donut-wrap text.big { font-weight: 650; letter-spacing: -.03em; }
.gauge { width: 100%; max-width: 236px; display: block; overflow: visible; }
.gauge .gtrack { stroke: var(--hero-chip); }
.gauge .ghatch { stroke: var(--hero-soft); opacity: .5; }
.gauge text.big { font-size: 30px; font-weight: 680; letter-spacing: -.03em; fill: var(--hero-text); }
.gauge .gsub { font-size: 11px; font-weight: 600; fill: var(--hero-soft); }
@keyframes sweep { from { stroke-dasharray: 0 200; } }
.nav-anim .chart g.grow { transform-box: fill-box; transform-origin: 50% 100%; animation: growY .85s cubic-bezier(.2, .8, .2, 1) both; }
.nav-anim .chart path.draw { stroke-dasharray: 1; animation: drawLine 1.25s cubic-bezier(.4, 0, .2, 1) both; }
.nav-anim .chart .peak { animation: pop .4s .75s both; }
.nav-anim .donut-wrap circle.seg { animation: fade .55s both; }
.nav-anim .gauge .sweep { animation: sweep 1.15s .1s cubic-bezier(.2, .8, .2, 1) both; }
/* dashboard: today panel */
.thero { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 22px; margin-bottom: 16px; border-radius: 28px; background: var(--hero-bg); color: var(--hero-text); box-shadow: 0 18px 44px color-mix(in srgb, var(--hi) 14%, rgba(0,0,0,.25)); }
.thero::after { content: ""; position: absolute; right: 0; top: 0; width: 260px; height: 150px; pointer-events: none; background-image: radial-gradient(currentColor 1px, transparent 1.7px); background-size: 10px 10px; opacity: .3; -webkit-mask-image: radial-gradient(260px 150px at 100% 0, #000, transparent 72%); mask-image: radial-gradient(260px 150px at 100% 0, #000, transparent 72%); }
.thero > * { position: relative; z-index: 1; }
.thero-main { flex: 1 1 160px; min-width: 0; }
.thero-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--hero-chip); font-size: 12px; font-weight: 650; letter-spacing: .03em; }
.thero-tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.thero-num { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thero-num b { font-size: 54px; line-height: 1; font-weight: 680; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.thero-num span { font-size: 15px; font-weight: 600; color: var(--hero-soft); }
.thero-sub { margin-top: 6px; font-size: 13.5px; color: var(--hero-soft); font-weight: 550; }
.thero-acts { display: flex; gap: 8px; flex-wrap: wrap; flex: 1 1 100%; }
.thero-acts .btn { background: var(--hero-btn); color: var(--hero-btn-text); border-color: transparent; box-shadow: none; }
.thero-acts .btn.primary { box-shadow: 0 8px 22px rgba(0,0,0,.25); }
.thero-acts .btn:hover { filter: brightness(1.12); }
.thero-side { flex: 0 1 236px; min-width: 0; text-align: center; }
/* overlays */
.overlay { backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
.modal { border-radius: 28px; border: 1px solid var(--line); }
.formerr, .warnbox { border-radius: 14px; }
.toast { color: #fff; border-radius: 999px; padding: 11px 18px; border: 1px solid rgba(255,255,255,.12); }
.results { border-radius: 18px; }
.results a { border-radius: 12px; }
.auth { position: relative; }
.auth::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(var(--faint) 1px, transparent 1.7px); background-size: 14px 14px; opacity: .35; -webkit-mask-image: linear-gradient(160deg, #000, transparent 55%); mask-image: linear-gradient(160deg, #000, transparent 55%); }
.auth .card { border-radius: 30px; position: relative; box-shadow: var(--shadow-lg); }
.qr { border-radius: 20px; }
/* phones: floating bar */
@media (max-width: 820px) {
  .main { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .bottom-nav { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 28px; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 16px 40px rgba(0,0,0,.38); }
  .bottom-nav a { border-radius: 22px; transition: background .25s cubic-bezier(.2, .8, .2, 1), color .2s, transform .12s; }
  .bottom-nav a.on { background: var(--hi); color: var(--hi-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--hi) 30%, transparent); }
  .bottom-nav a.on svg { animation: navpop .35s cubic-bezier(.2, 1.4, .4, 1); }
  #toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .card { border-radius: 20px; }
  .kpi { border-radius: 20px; }
  .kpi .val { font-size: 23px; }
  .modal { border-radius: 28px 28px 0 0; border-bottom: 0; animation: sheet .28s cubic-bezier(.2, .8, .2, 1); }
  .modal header { border-radius: 28px 28px 0 0; }
  .tabs button { padding: 8px 13px; }
  .thero { padding: 18px; border-radius: 24px; }
  .thero-num b { font-size: 46px; }
  .thero-acts .btn { flex: 1 1 auto; }
  .thero-side { flex: 0 0 136px; }
  .thero { gap: 14px 10px; }
  h1 { font-size: 22px; }
}
@keyframes navpop { from { transform: scale(.6); } to { transform: none; } }
@keyframes sheet { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .thero-tag i, .bottom-nav a.on svg, .modal, .nav-anim .chart g.grow, .nav-anim .chart path.draw, .nav-anim .gauge .sweep, .nav-anim .chart .peak { animation: none !important; }
  .btn.primary { transition: none; }
}
@media print {
  body { background: #fff !important; }
  .thero { display: none; }
}
:root[data-theme="dark"] { color-scheme: dark; }
:root:not([data-theme="dark"]) { color-scheme: light; }
/* ---- upgrade 10: layout fixes, available hours, tutorial, role label ---- */
/* a finished page-open animation must leave nothing behind: on iPhone it trapped pop-up boxes inside their card */
.nav-anim > * { animation-fill-mode: backwards; }
/* phones: an opened timetable box is a card in the middle of the screen, above everything, with room around the text */
@media (max-width: 820px) {
  .tbox.open, .tgrid.fit .tbox.open, .tgrid.fit .tcol.r .tbox.open { position: fixed; left: 12px; right: 12px; width: auto; min-width: 0; top: calc(env(safe-area-inset-top) + 8vh) !important; max-height: calc(100dvh - 8vh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; z-index: 46; padding: 16px 16px 14px; border-radius: 20px; font-size: 13px; line-height: 1.4; box-shadow: 0 0 0 100vmax rgba(4, 5, 4, .55), var(--shadow-lg); }
  .tbox.open > b, .tgrid.fit .tbox.open > b { font-size: 16px; padding-right: 0; }
  .tbox.open .grip { display: none; }
  .tbox.open .tdetails { gap: 11px; margin-top: 10px; padding-top: 10px; }
  .tbox.open .tmarks { gap: 6px; }
  .tbox.open .tmarks .mark { min-height: 40px; padding: 8px 12px; }
  /* More menu: the last block (name, dark mode, sign out) must scroll clear of the floating bar */
  .side.open { padding-bottom: 0; }
  .side.open::after { content: ""; flex: none; height: calc(118px + env(safe-area-inset-bottom)); }
  .side.open .me { margin-top: 18px; }
}
/* computer and sideways phone: never let a row run off the right edge */
.marks { flex-wrap: wrap; }
@media (min-width: 821px) and (max-width: 1280px) {
  .att { grid-template-columns: minmax(0, 1fr) auto; }
  .att .marks { grid-column: 1 / -1; }
}
@media (min-width: 821px) {
  .shell { grid-template-columns: calc(var(--side) + env(safe-area-inset-left)) minmax(0, 1fr); }
  .side { padding-left: calc(12px + env(safe-area-inset-left)); }
  .main { padding-top: max(22px, env(safe-area-inset-top)); padding-right: max(clamp(14px, 3vw, 34px), calc((100% - 1380px) / 2), env(safe-area-inset-right)); }
}
/* narrow computer windows and phones held sideways: the side menu shrinks to icons so the page keeps its room */
@media (min-width: 821px) and (max-width: 1100px) {
  :root { --side: 74px; }
  .side { padding: 14px 8px 14px calc(8px + env(safe-area-inset-left)); }
  .side .brand { padding: 2px 0 12px; justify-content: center; }
  .side .brand > div:last-child { display: none; }
  .nav-label { height: 1px; padding: 0; margin: 8px 12px; background: var(--line); overflow: hidden; font-size: 0; }
  .nav a { justify-content: center; padding: 11px 0; position: relative; }
  .nav a > span:not(.badge) { display: none; }
  .nav .badge { position: absolute; top: 1px; right: 4px; margin: 0; padding: 1px 5px; font-size: 10px; }
  .me { flex-direction: column; padding: 8px 4px; gap: 6px; }
  .me .grow { display: none; }
  .top h1 { min-width: 140px; }
}
@media (min-width: 821px) and (max-height: 520px) {
  .main { padding-top: max(12px, env(safe-area-inset-top)); }
  .thero { padding: 16px 20px; }
  .thero-num b { font-size: 40px; }
}
/* instructor available hours */
.availrow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.availrow .btn { margin-left: auto; }
.tna, .tav { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0; }
.tna { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bg) 62%, transparent) 0 6px, color-mix(in srgb, var(--faint) 30%, transparent) 6px 8px); -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.tav { background: color-mix(in srgb, var(--hi) 12%, transparent); box-shadow: inset 3px 0 0 var(--hi), inset 0 1px 0 color-mix(in srgb, var(--hi) 55%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--hi) 55%, transparent); }
.tcol.navail .thead b, .tcol.navail .thead span { opacity: .38; filter: blur(.6px); }
.tgrid.fit .tav { box-shadow: inset 2px 0 0 var(--hi); }
.avlist { display: grid; gap: 8px; }
.avrow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; transition: border-color .2s, background .2s; }
.avrow.on { border-color: color-mix(in srgb, var(--hi) 55%, var(--line)); background: color-mix(in srgb, var(--hi) 6%, transparent); }
.avrow:not(.on) .avtimes { opacity: .3; pointer-events: none; filter: blur(.6px); }
.avtimes { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.avpair { display: flex; gap: 6px; align-items: center; }
.avpair input { width: 122px; min-height: 38px; padding: 6px 10px; }
.avpair span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 820px) {
  .avrow { grid-template-columns: 1fr; }
  .avpair { flex: 1 1 100%; }
  .avpair input { flex: 1; width: auto; }
  .availrow .btn { margin-left: 0; flex: 1 1 100%; }
}
/* role next to the name */
.rolefx { display: inline-flex; vertical-align: middle; margin-left: 8px; padding: 4px 11px; border-radius: 999px; background: var(--hi); color: var(--hi-ink); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; white-space: pre; position: relative; top: -2px; }
.rolefx i { font-style: normal; display: inline-block; }
.rolefx.play { animation: roleglow 1.6s ease-out both; }
.rolefx.play i { animation: rolein .62s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rolein { 0% { opacity: 0; transform: translateY(-.5em) scale(3.2); filter: blur(7px); } 55% { opacity: 1; transform: translateY(0) scale(.82); filter: blur(0); } 78% { transform: scale(1.12); } 100% { opacity: 1; transform: none; filter: none; } }
@keyframes roleglow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hi) 70%, transparent); background: transparent; color: var(--hi); } 45% { background: transparent; color: var(--hi); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; background: var(--hi); color: var(--hi-ink); } }
:root:not([data-theme="dark"]) .rolefx.play { animation: none; }
.rolepill { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
/* tutorial */
#tour-root { position: fixed; inset: 0; z-index: 95; }
.tour-dim { position: absolute; inset: 0; transition: background .25s; }
.tour-dim.clear { background: transparent; }
.tour-ring { position: absolute; border-radius: 18px; border: 2px solid var(--hi); pointer-events: none; transition: left .3s cubic-bezier(.2, .8, .2, 1), top .3s cubic-bezier(.2, .8, .2, 1), width .3s, height .3s; animation: fade .3s; }
.tour-card { position: absolute; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 24px)); padding: 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .25s; color: var(--text); }
.tour-card.top { bottom: auto; top: calc(18px + env(safe-area-inset-top)); }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-step { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.tour-bar { height: 5px; border-radius: 9px; background: var(--surface-2); margin: 10px 0 14px; overflow: hidden; }
.tour-bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--hi2), var(--hi)); transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.tour-card h3 { font-size: 18px; margin-bottom: 6px; }
.tour-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tour-card p b { color: var(--text); }
.tour-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.tour-acts .btn.primary { flex: 1; }
@media (max-width: 820px) {
  .tour-card { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-height: 520px) {
  .tour-card { padding: 14px; right: 12px; bottom: 12px; width: min(360px, 60vw); max-height: calc(100dvh - 24px); overflow-y: auto; }
  .tour-card.top { top: 12px; }
  .tour-card p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .rolefx.play, .rolefx.play i, .tour-ring, .tour-card { animation: none !important; }
}
/* ---- upgrade 11 ---- */
/* the page header (search box and its drop-down) always sits above the panels below it */
.top { position: relative; z-index: 30; }
/* student calendar: each class shows its time, what it is and who teaches it */
.calpill { display: flex; flex-direction: column; align-items: stretch; text-align: left; white-space: normal; padding: 3px 5px; line-height: 1.22; border-radius: 8px; }
.calpill b { font-size: 10.5px; font-weight: 750; }
.calpill em { font-style: normal; font-weight: 600; font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calpill em.who { font-weight: 500; opacity: .85; }
.calpill.booked { padding: 2px 4px; }
.calpill.booked em, .calpill.unmarked em { color: var(--text); }
.calpill.booked em.who, .calpill.unmarked em.who { color: var(--muted); opacity: 1; }
.callist { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); display: grid; gap: 8px; }
.calrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.calrow .cdot { width: 11px; height: 11px; margin-top: 5px; }
@media (max-width: 820px) {
  .calpill { padding: 2px 3px; text-align: center; }
  .calpill b { font-size: 9px; }
  .calpill em { font-size: 7.5px; }
  .calpill em.who { display: none; }
}
/* ---- upgrade 12: per-day class times, past attendance, contract pickers ---- */
.wholink { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.wholink svg.ic { width: 14px; height: 14px; color: var(--faint); transition: transform .15s, color .15s; }
.wholink:hover b { text-decoration: underline; }
.wholink:hover svg.ic { transform: translateX(3px); color: var(--brand-text); }
.wholink .avatar { transition: transform .15s; }
.wholink:hover .avatar { transform: scale(1.06); }
.kidcard { transition: border-color .15s, transform .15s; }
.kidcard:hover { border-color: var(--faint); }
.slotlist { display: grid; gap: 8px; }
.slotrow { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 90px auto; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.slotrow input { min-height: 38px; padding: 6px 10px; }
.pastrow { display: grid; grid-template-columns: 150px 78px minmax(0, 1.2fr) 80px minmax(0, 1.2fr) auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.pastrow input, .pastrow select { min-height: 38px; padding: 6px 10px; }
details.mpick { border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; background: var(--surface); }
details.mpick summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); list-style: none; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
details.mpick summary::-webkit-details-marker { display: none; }
details.mpick summary::after { content: "▾"; margin-left: auto; color: var(--faint); transition: transform .2s; }
details.mpick[open] summary::after { transform: rotate(180deg); }
details.mpick summary b { color: var(--text); font-weight: 650; }
details.mpick .chips { margin-top: 10px; }
.paybtn { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 650; }
@media (max-width: 820px) {
  .slotrow { grid-template-columns: 1fr 1fr auto; }
  .slotrow b { grid-column: 1 / -1; }
  .slotrow span:last-child { display: none; }
  .pastrow > span { display: none; }
}
/* ---- upgrade 14: my list (side panel) and the drop-a-file veil ---- */
.todo-fab { position: fixed; right: 0; top: 46%; z-index: 44; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 9px 12px 11px; border: 1px solid var(--line); border-right: 0; border-radius: 16px 0 0 16px; background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s, padding .2s; }
.todo-fab:hover { padding-right: 15px; background: var(--hi); color: var(--hi-ink); border-color: transparent; }
.todo-fab b { font-size: 12px; font-weight: 800; min-width: 20px; padding: 2px 5px; border-radius: 99px; background: var(--hi); color: var(--hi-ink); text-align: center; }
.todo-fab:hover b { background: var(--hi-ink); color: var(--hi); }
.todo-fab.urgent b { background: var(--bad); color: #fff; animation: pulse 1.8s ease-in-out infinite; }
.todo-shade { position: fixed; inset: 0; z-index: 47; opacity: 0; pointer-events: none; transition: opacity .25s; }
.todo-shade.open { opacity: 1; pointer-events: auto; }
.todo-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 48; width: min(400px, 100vw); display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .32s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
.todo-panel.open { transform: none; visibility: visible; }
.todo-panel header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.todo-panel form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); margin-bottom: 12px; }
.todo-panel form input[type=text] { border: 0; background: transparent; padding: 6px 4px; min-height: 36px; font-size: 15.5px; box-shadow: none !important; }
.todo-panel form input[type=date] { width: auto; min-height: 34px; padding: 4px 10px; font-size: 13px; }
.todo-panel .seg { align-self: flex-start; margin-bottom: 10px; }
.todo-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.todo { display: flex; gap: 10px; align-items: flex-start; padding: 11px 8px 11px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-bg); animation: rise .28s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .3s, transform .3s; }
.todo .tick { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--faint); background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 1px; transition: all .2s cubic-bezier(.2, 1.4, .4, 1); }
.todo .tick svg { width: 15px; height: 15px; stroke-width: 3; }
.todo .tick:hover { border-color: var(--hi); transform: scale(1.1); }
.todo.done .tick, .todo.going .tick { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); transform: scale(1.12); }
.todo.done .ttext, .todo.going .ttext { text-decoration: line-through; color: var(--muted); }
.todo.going, .todo.coming { opacity: 0; transform: translateX(26px); }
.todo .ttext { display: block; outline: none; font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; border-radius: 6px; cursor: text; }
.todo .ttext:focus { background: var(--surface-2); box-shadow: 0 0 0 4px var(--surface-2); }
.todo .notedot { width: 8px; height: 8px; border-radius: 50%; background: var(--hi); flex: none; margin: 8px 9px 0; }
.todo.note { border-style: dashed; }
.todo .btn.icon { opacity: .35; }
.todo:hover .btn.icon, .todo .btn.icon:focus { opacity: 1; }
@media (max-width: 820px) {
  .todo-fab { top: auto; bottom: calc(104px + env(safe-area-inset-bottom)); }
  .todo-panel { width: 100vw; border-left: 0; }
}
@media print {
  #todo-root { display: none; }
}
#dropveil { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); animation: fade .15s; }
#dropveil * { pointer-events: none; }
#dropveil .dropkind { pointer-events: auto; }
#dropveil .dropkind * { pointer-events: none; }
.dropbox { width: min(720px, 100%); text-align: center; padding: 34px 26px; border-radius: 34px; border: 2.5px dashed var(--hi); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); box-shadow: 0 0 60px color-mix(in srgb, var(--hi) 22%, transparent); animation: pop .2s; }
.dropbox.no { border-color: var(--faint); box-shadow: none; }
.dropbox > svg.ic { width: 54px; height: 54px; padding: 13px; border-radius: 50%; background: var(--hi); color: var(--hi-ink); margin-bottom: 12px; animation: dropbob 1.2s ease-in-out infinite; }
.dropbox.no > svg.ic { background: var(--surface-2); color: var(--muted); animation: none; }
.dropbox h2 { font-size: 23px; margin-bottom: 6px; }
.dropbox p { margin: 0; color: var(--muted); }
.dropkinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.dropkind { padding: 22px 8px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--surface-2); display: grid; gap: 8px; justify-items: center; transition: transform .15s cubic-bezier(.2, .8, .2, 1), background .15s, border-color .15s, color .15s; }
.dropkind svg.ic { width: 26px; height: 26px; }
.dropkind b { font-size: 13.5px; }
.dropkind.over { background: var(--hi); border-color: var(--hi); color: var(--hi-ink); transform: scale(1.07); box-shadow: 0 14px 34px color-mix(in srgb, var(--hi) 30%, transparent); }
@keyframes dropbob { 50% { transform: translateY(-7px); } }
@media (max-width: 700px) {
  .dropkinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* ---- upgrade 15 ---- */
.aphead { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.aphead svg.ic { width: 16px; height: 16px; }
.aphead:first-of-type { margin-top: 2px; }
.pastfill { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 10px; align-items: end; margin-top: 4px; }
.pastfill input { min-height: 40px; }
.pasthead, .pastrow { display: grid; grid-template-columns: 146px 34px 112px minmax(0, 1.2fr) 74px minmax(0, 1.2fr) 34px; gap: 8px; align-items: center; }
.pasthead { font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.pastrow { padding: 7px 0; }
@media (max-width: 820px) {
  .pastfill { grid-template-columns: 1fr 1fr; }
  .pastfill .btn { grid-column: 1 / -1; }
  .pasthead { display: none; }
  .pastrow { grid-template-columns: 1fr 1fr; padding: 12px 0; }
  .pastrow > span[data-wd] { display: none; }
  .pastrow .btn { justify-self: end; grid-column: 2; }
}
/* ---- upgrade 16 ---- */
.avatar.gfig { padding: 0; overflow: hidden; display: block; }
.avatar.gfig svg { width: 100%; height: 100%; display: block; }
.avatar.gfig.male { background: #4f8ef7; }
.avatar.gfig.female { background: #ec6aa6; }
.hero .photo.canpick { cursor: pointer; }
.hero .photo.canpick .avatar { transition: transform .2s cubic-bezier(.2, .8, .2, 1), filter .2s; }
.hero .photo.canpick:hover .avatar { transform: scale(1.04); filter: brightness(1.08); }
.seg.mini { padding: 2px; }
.seg.mini button { padding: 3px 9px; font-size: 11.5px; }
/* ---- upgrade 17 ---- */
.payline { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--late-soft) 55%, transparent); }
.payline input { max-width: 220px; }
/* ---- upgrade 19 ---- */
details.more { position: relative; display: inline-block; }
details.more > summary { list-style: none; cursor: pointer; }
details.more > summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; display: grid; gap: 2px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .15s; }
.more-menu .btn { justify-content: flex-start; width: 100%; border-radius: 12px; }
.more-head { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 2px; }
.more-head span { text-transform: none; font-weight: 500; letter-spacing: 0; }
.hero .photo.canpick::after { content: "Change"; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); padding: 2px 9px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: 10.5px; font-weight: 700; opacity: 0; transition: opacity .15s; pointer-events: none; }
.hero .photo.canpick:hover::after { opacity: 1; }
@media (max-width: 820px) {
  .hero > .row.wrap > details.more { flex: 1 1 calc(50% - 6px); }
  .hero > .row.wrap > details.more > summary { width: 100%; }
  .more-menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 46; max-height: 60vh; overflow-y: auto; }
}
/* ---- upgrade 21: working without a connection ---- */
#offline-pill { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; box-shadow: var(--shadow-lg); animation: pop .2s; }
#offline-pill svg.ic { width: 16px; height: 16px; }
#offline-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#offline-pill.off { background: var(--late-soft); color: var(--late); border-color: transparent; }
#offline-pill.wait { background: var(--hi); color: var(--hi-ink); border-color: transparent; }
#offline-pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
@media print {
  #offline-pill { display: none; }
}
/* ---- upgrade 22 ---- */
/* the magnifier rule of the search box must not reach the little figures in its results (it made one fill the screen) */
.search .avatar svg, .results .avatar svg { position: static; left: auto; top: auto; width: 100%; height: 100%; color: inherit; }
/* ---- upgrade 24 ---- */
.seg.mini.fill { display: flex; width: 100%; }
.seg.mini.fill button { flex: 1 1 0; min-width: 0; padding: 4px 2px; text-align: center; }
/* ---- upgrade 27: navy blue and yellow (these values replace the earlier green-black and lime ones) ---- */
.btn.primary:hover { background-position: 0 0; }
.thero-acts .btn.primary { background: #ffffff; color: #0a1128; }
.toast { background: #0a1128; }
.overlay { background: rgba(3,7,20,.62); }
.todo-shade { background: rgba(3,7,20,.5); }
#dropveil { background: rgba(3,7,20,.55); }
.tour-dim { background: rgba(3,7,20,.64); }
.tour-ring { box-shadow: 0 0 0 200vmax rgba(3,7,20,.64), 0 0 26px color-mix(in srgb, var(--hi) 55%, transparent); }
.hero > .grow { flex: 1 1 240px; }
/* the name keeps its room: the buttons drop to the next line instead of squeezing it */
/* ---- upgrade 28 ---- */
.pilldel { border-radius: 999px; padding: 4px 12px; min-height: 0 !important; height: auto; width: auto; font-size: 12.5px; color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); align-self: center; justify-self: start; }
.pilldel svg.ic { width: 13px; height: 13px; }
.classlink { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; color: inherit; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); transition: border-color .15s, background .15s; }
.classlink:hover, .classlink:active { border-color: var(--hi); }
.classlink svg.ic { width: 13px; height: 13px; color: var(--brand-text); flex: none; }
.tbox.spot { outline: 3px solid var(--hi); outline-offset: 2px; z-index: 6; animation: spotpulse 1.1s ease-in-out 3; }
@keyframes spotpulse { 50% { outline-offset: 6px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--hi) 28%, transparent); } }
.optbtn { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .1s; }
.optbtn:hover { border-color: var(--hi); }
.optbtn:active { transform: scale(.985); }
.optbtn > svg.ic { width: 18px; height: 18px; margin-top: 2px; color: var(--brand-text); flex: none; }
.optbtn b { display: block; margin-bottom: 2px; }
.kidblock { border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin: 10px 0; background: var(--surface-2); }
.kidblock > .row b { display: inline-flex; align-items: center; gap: 6px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.steps span { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--line); color: var(--faint); }
.steps span.on { border-style: solid; background: var(--brand-soft); color: var(--brand-text); }
@media (max-width: 820px) {
  .planrow .pilldel { grid-column: 1 / -1; justify-self: end; }
  .kidblock .grid { grid-template-columns: 1fr; }
  .kidblock .span2 { grid-column: auto; }
}
/* ---- upgrade 32: Arabic interface (right-to-left) ---- */
#langpill { position: fixed; top: calc(12px + env(safe-area-inset-top)); inset-inline-end: 14px; z-index: 60; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
body:has(.shell) #langpill { display: none; }
.langbtn { font-weight: 800; font-size: 13px; min-width: 34px; }
[dir="rtl"] body { font-family: "Segoe UI", "SF Arabic", "Noto Sans Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif; letter-spacing: 0; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] th, [dir="rtl"] .nav-label, [dir="rtl"] .badge, [dir="rtl"] .thero-tag, [dir="rtl"] .rolepill { letter-spacing: 0; }
[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] th, [dir="rtl"] .optbtn, [dir="rtl"] .tbox { text-align: right; }
[dir="rtl"] .right { text-align: left; }
[dir="rtl"] [style*="margin-left:auto"] { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] [style*="text-align:left"] { text-align: right !important; }
[dir="rtl"] .search svg { left: auto; right: 12px; }
[dir="rtl"] .search input { padding-left: 14px; padding-right: 38px; }
[dir="rtl"] .num, [dir="rtl"] input[type="number"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="time"], [dir="rtl"] .phone, [dir="rtl"] .stepper, [dir="rtl"] svg.chart, [dir="rtl"] .gauge, [dir="rtl"] .qr { direction: ltr; }
[dir="rtl"] .num { unicode-bidi: isolate; }
[dir="rtl"] td.num, [dir="rtl"] th.right, [dir="rtl"] td.right { text-align: left; }
[dir="rtl"] .tgrid-wrap { direction: ltr; }
[dir="rtl"] .tbox, [dir="rtl"] .tdetails, [dir="rtl"] .thead { direction: rtl; }
[dir="rtl"] .wholink svg.ic, [dir="rtl"] .btn svg.ic-back, [dir="rtl"] [data-act="attDay"] svg, [dir="rtl"] [data-act="insWeek"] svg { transform: scaleX(-1); }
[dir="rtl"] ul, [dir="rtl"] ol { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .toast, [dir="rtl"] .warnbox, [dir="rtl"] .formerr { text-align: right; }
[dir="rtl"] .rolefx { direction: ltr; margin-left: 0; margin-right: 8px; }
[dir="rtl"] .todo-fab { right: auto; left: 0; transform: scaleX(-1); }
[dir="rtl"] .todo-fab > * { transform: scaleX(-1); }
.me { flex-wrap: wrap; row-gap: 6px; }
.me .grow { flex: 1 1 96px; }
/* ---- upgrade 35 ---- */
.bottom-nav a.navplus { flex: 0 0 54px; width: 54px; height: 54px; align-self: center; margin: -6px 4px; padding: 0; border-radius: 50%; justify-content: center; background: var(--hi); color: var(--hi-ink); box-shadow: 0 10px 26px color-mix(in srgb, var(--hi) 45%, transparent), 0 0 0 4px color-mix(in srgb, var(--hi) 22%, transparent); }
.bottom-nav a.navplus svg { width: 28px; height: 28px; stroke-width: 2.6; }
.bottom-nav a.navplus:active { transform: scale(.9); }
.dayclasses { display: grid; gap: 8px; }
.dayclasses .chip { display: block; width: 100%; text-align: start; border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 13.5px; line-height: 1.5; }
.dayclasses .chip .badge { margin-inline-start: 6px; }
/* ---- upgrade 36 ---- */
.only-m { display: none; }
.only-m svg.ic { width: 11px; height: 11px; vertical-align: -1px; }
.pausebar { margin-bottom: 16px; padding: 12px 16px; display: grid; gap: 10px; }
.pausebar.on { border-color: color-mix(in srgb, var(--late) 55%, var(--line)); background: color-mix(in srgb, var(--late) 9%, var(--surface)); }
@media (max-width: 820px) {
  .only-m { display: inline; }
  .bottom-nav a { padding: 7px 0; min-width: 0; }
  .bottom-nav a svg { width: 20px; height: 20px; }
  /* the student list as cards: name on one line, hours and balance at the side, nothing cut off */
  .stlist thead { display: none; }
  .stlist, .stlist tbody { display: block; width: 100%; }
  .stlist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .stlist td { padding: 0; border: 0; }
  .stlist td:first-child { grid-row: 1 / span 2; min-width: 0; }
  .stlist td:first-child .row > div { min-width: 0; }
  .stlist td:first-child b { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
  .stlist td:nth-child(4), .stlist td:nth-child(6) { justify-self: end; text-align: end; font-size: 12.5px; }
  .pausebar .row > .grow { flex: 1 1 100%; order: 2; }
  .pausebar .row > .btn { order: 3; margin-inline-start: auto; }
  .flags .list > div { flex-wrap: wrap; }
  .flags .list > div > .grow { flex: 1 1 62%; min-width: 0; }
  .flags .list > div > .btn { margin-inline-start: auto; }
}
/* ---- upgrade 37 ---- */
.fmenu { position: relative; display: inline-block; max-width: 100%; }
.fmenu > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 650; font-size: 13.5px; cursor: pointer; max-width: 100%; }
.fmenu > summary::-webkit-details-marker { display: none; }
.fmenu > summary svg.ic { width: 15px; height: 15px; color: var(--muted); flex: none; }
.fmenu > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmenu[open] > summary { border-color: var(--hi); }
.fmenu > summary i { font-style: normal; color: var(--muted); }
.fmenu-list { position: absolute; z-index: 30; top: calc(100% + 6px); inset-inline-start: 0; width: max-content; max-width: min(92vw, 420px); max-height: 60vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); }
.fmenu-list .chips { margin: 0 !important; }
.sectabs { margin: 0 0 14px; flex-wrap: wrap; }
.cols.tabbed { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 16px; align-items: start; }
.cols.tabbed > .stack { display: contents; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.fact { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--card-bg, var(--surface)); min-width: 0; }
.fact span { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.fact b { font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.fact small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.fact.warn b { color: var(--late); }
.fact.bad b { color: var(--bad); }
.eod { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; text-decoration: none; color: inherit; }
/* nothing squeezes its neighbour: rows of a list wrap, long words break, headers wrap */
.list > div, .list > a.item { flex-wrap: wrap; row-gap: 8px; }
.list > div > .grow, .list > a.item > .grow { flex: 1 1 58%; min-width: min(100%, 210px); overflow-wrap: anywhere; }
.top { flex-wrap: wrap; row-gap: 10px; }
.top > h1 { min-width: 0; overflow-wrap: anywhere; }
.card h2 { flex-wrap: wrap; row-gap: 6px; }
.summary > div { flex-wrap: wrap; gap: 4px 12px; }
.summary > div > b { overflow-wrap: anywhere; }
.btn { max-width: 100%; }
td, th { overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .bottom-nav a { white-space: nowrap; letter-spacing: -.02em; font-size: 9px; overflow: visible; }
  .bottom-nav a.on { flex: 1.5 1 0; padding-inline: 4px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact b { font-size: 17px; }
  .hero > .row.wrap:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .hero > .row.wrap:last-child > .btn { width: 100%; justify-content: center; }
  .hero > .row.wrap:last-child > .btn.primary, .hero > .row.wrap:last-child > .btn:only-child { grid-column: 1 / -1; }
  .hero > .row.wrap:last-child > .btn.icon { width: 100%; }
  .hero > .row.wrap:last-child > * { min-width: 0; width: 100%; }
  .hero > .row.wrap:last-child .btn { white-space: normal; text-align: center; width: 100%; justify-content: center; }
  .hero .more-menu .btn { justify-content: flex-start; text-align: start; }
  .modal footer { flex-wrap: wrap; }
  .modal footer .btn { flex: 1 1 auto; }
  .eod { flex-wrap: wrap; }
}
/* ---- upgrade 38 ---- */
.btn.delpill { color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-radius: 999px; padding: 8px 16px; gap: 8px; aspect-ratio: auto; height: auto; width: auto; font-weight: 700; }
.btn.delpill svg.ic { width: 16px; height: 16px; }
.atlist { position: absolute; z-index: 5; left: 8px; right: 8px; top: calc(100% - 4px); max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 6px; }
.atlist button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.atlist button:hover, .atlist button:active { background: var(--surface-2); }
.taghelp > summary { cursor: pointer; font-size: 13.5px; }
.taghelp b { color: var(--brand-text); }
@media (max-width: 820px) {
  .hero > .row.wrap:last-child > .btn.delpill { grid-column: 1 / -1; width: auto; justify-self: center; min-width: 140px; }
  .hero > .row.wrap:last-child > .btn.icon { aspect-ratio: auto; height: auto; min-height: 44px; }
}
/* ---- upgrade 39 ---- */
.wkrow { display: grid; grid-template-columns: minmax(210px, 1.6fr) 112px 84px minmax(120px, 1fr) minmax(110px, 1fr) auto; gap: 10px; align-items: end; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wkrow.fixed { display: flex; align-items: center; flex-wrap: wrap; }
.wkrow .f { margin: 0; min-width: 0; }
.wkrow .f span { font-size: 11.5px; }
.wkrow input, .wkrow select { width: 100%; min-width: 0; }
.wkdays { display: flex; flex-wrap: wrap; gap: 4px; align-self: center; }
.wkdays button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.wkdays button.on { background: var(--hi); color: var(--hi-ink); border-color: transparent; }
.wkacts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.payrow { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.payrow:first-of-type { border-top: 0; padding-top: 0; }
.paybar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 55%, var(--surface-2)); overflow: hidden; }
.paybar i { display: block; height: 100%; background: var(--late); }
.stepbar { position: sticky; top: -1px; z-index: 4; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0 10px; margin: -4px 0 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.stepbar button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.stepbar button.on { background: var(--hi); color: var(--hi-ink); border-color: transparent; }
@media (max-width: 900px) {
  .wkrow { grid-template-columns: 1fr 1fr; }
  .wkrow .wkdays, .wkrow .wkacts { grid-column: 1 / -1; }
  .wkrow .wkacts { justify-content: space-between; }
}
/* ---- upgrade 40 ---- */
.teacher { max-width: 760px; margin: 0 auto; padding: calc(18px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); height: 100%; overflow-y: auto; }
.teacher header { gap: 8px; align-items: center; }
/* ---------- upgrade 41: staff accounts as rows that fit a phone, roles that open on tap, instructor access window */
.stafflist { padding: 4px 0; }
.staffrow { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.staffrow:last-child { border-bottom: 0; }
.staffrow > .row { flex-wrap: wrap; gap: 8px 10px; }
.staffrow .grow { min-width: 120px; display: grid; }
.staffrow .grow b, .staffrow .grow span { overflow-wrap: anywhere; }
.staffbtns { gap: 8px; }
.roleinfo { border-top: 1px solid var(--line); padding: 10px 0; }
.roleinfo summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; list-style: none; }
.roleinfo summary::-webkit-details-marker { display: none; }
.roleinfo summary::after { content: '+'; margin-inline-start: auto; color: var(--muted); font-weight: 700; }
.roleinfo[open] summary::after { content: '–'; }
.roleinfo ul { margin: 8px 0 2px; padding-inline-start: 20px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.accbox { display: grid; gap: 12px; }
.accbox p { margin: 0; }
.acclink { overflow-wrap: anywhere; font-size: 13px; min-width: 0; }
.okbox { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35); }
.okbox svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.howto { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; }
.howto li b { display: block; }
.howto li span { display: block; color: var(--muted); font-size: 13.5px; }
/* ---------- upgrade 42: the instructor's own app, and the office's files-to-print list */
.mine { display: grid; gap: 4px; }
body:has(.teacher) #langpill { display: none; }
.minetabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 2px; position: sticky; top: 0; z-index: 5; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.minetabs button { display: grid; justify-items: center; gap: 3px; padding: 8px 2px; border: 0; border-radius: 13px; background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 650; cursor: pointer; min-width: 0; }
.minetabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minetabs button svg { width: 19px; height: 19px; }
.minetabs button.on { background: var(--brand); color: #0a1128; }
.mine .daybar { flex-wrap: wrap; }
.mine .daybar b { display: block; min-width: 0; font-size: 14.5px; }
.minemore { gap: 8px; padding: 0 16px 12px; }
.minenote { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 11px; background: var(--surface-2); font-size: 13.5px; overflow-wrap: anywhere; }
.minenote svg { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--muted); }
.minegrid { overflow: hidden; }
.mg-head, .mg-body { display: grid; grid-template-columns: 44px repeat(var(--cols), minmax(0, 1fr)); }
.mg-head > * { padding: 8px 2px; text-align: center; border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); display: grid; min-width: 0; }
.mg-head > span { border-inline-start: 0; }
.mg-head b { font-size: 13px; }
.mg-head span { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.mg-head .now { background: var(--surface-2); }
.mg-head .now b { color: var(--brand); }
.mg-body { position: relative; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--h); }
.mg-time { display: grid; grid-auto-rows: var(--h); }
.mg-time span { font-size: 10.5px; color: var(--muted); padding: 2px 4px; }
.mg-col { position: relative; border-inline-start: 1px solid var(--line); min-width: 0; }
.mg-col.now { background: rgba(245, 197, 24, .05); }
.mg-box { position: absolute; inset-inline: 2px; display: grid; align-content: start; gap: 1px; padding: 4px 5px; border: 0; border-inline-start: 3px solid #7c6cf0; border-radius: 8px; background: rgba(124, 108, 240, .22); color: var(--text); font: inherit; text-align: start; cursor: pointer; overflow: hidden; }
.mg-box b { font-size: 11.5px; line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mg-box span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.mg-box.done { border-color: #22c55e; background: rgba(34, 197, 94, .2); }
.mg-box.off { border-color: var(--muted); background: repeating-linear-gradient(135deg, rgba(148, 163, 184, .22) 0 6px, rgba(148, 163, 184, .08) 6px 12px); }
.mg-box.away { border-color: var(--bad); background: rgba(239, 68, 68, .16); }
.minekey { gap: 6px 14px; margin: 10px 2px; }
.minekey span { display: inline-flex; align-items: center; gap: 6px; }
.minekey .k { width: 12px; height: 12px; border-radius: 4px; background: rgba(124, 108, 240, .5); display: inline-block; }
.minekey .k.done { background: #22c55e; }
.minekey .k.off { background: #94a3b8; }
.minekey .k.away { background: var(--bad); }
.minestreak { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.minestreak.hot { background: linear-gradient(135deg, rgba(245, 197, 24, .22), rgba(239, 68, 68, .12)); border-color: rgba(245, 197, 24, .45); }
.minestreak .flame { font-size: 40px; line-height: 1; }
.minestreak .grow { display: grid; min-width: 0; }
.minestreak .grow b { font-size: 34px; line-height: 1; }
.minestreak .grow span { font-weight: 650; }
.minestreak small { color: var(--muted); margin-top: 4px; }
.minestreak .best { display: grid; justify-items: center; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
.minestreak .best b { font-size: 22px; }
.minestreak .best span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.minetiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
@media (min-width: 720px) {
  .minetiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.minetile { display: grid; gap: 2px; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.minetile b { font-size: 24px; }
.minetile span { font-weight: 600; font-size: 13px; }
.minetile small { color: var(--muted); font-size: 11.5px; }
.minebars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.minebars > div { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; height: 100%; gap: 3px; min-width: 0; }
.minebars i { align-self: end; width: 70%; min-height: 3px; border-radius: 7px 7px 3px 3px; background: var(--brand); }
.minebars b { font-size: 12px; }
.minebars span { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.minerules { margin: 0 0 8px; padding-inline-start: 20px; display: grid; gap: 6px; color: var(--muted); font-size: 13.5px; }
.minepick { justify-self: start; cursor: pointer; }
.mine .card + .card { margin-top: 12px; }
.printrow { flex-wrap: wrap; gap: 8px 10px; }
.printrow .grow { min-width: 160px; overflow-wrap: anywhere; }
.printrow.done { opacity: .6; }
.printbox { margin-bottom: 16px; }
.printdot { margin-inline-start: 6px; min-width: 18px; text-align: center; }
.bottom-nav .printdot { position: absolute; top: 4px; inset-inline-end: 8px; margin: 0; font-size: 10px; padding: 1px 5px; }
.bottom-nav a { position: relative; }
/* ---------- upgrade 43: instructors' comments in the office */
.insnote { display: flex; gap: 7px; align-items: flex-start; margin-top: 6px; padding: 7px 10px; border-radius: 11px; background: var(--surface-2); font-size: 13px; overflow-wrap: anywhere; width: 100%; }
.insnote svg { flex: none; width: 14px; height: 14px; margin-top: 3px; color: var(--muted); }
.notebox { margin-bottom: 16px; }
.notebox summary { cursor: pointer; list-style: none; }
.notebox summary::-webkit-details-marker { display: none; }
.notebox summary h2 { margin: 0; }
.notebox[open] summary h2 { margin-bottom: 10px; }
.notebox summary h2::after { content: '+'; margin-inline-start: auto; color: var(--muted); }
.notebox[open] summary h2::after { content: '–'; }
.noterow { flex-wrap: wrap; gap: 8px 10px; align-items: flex-start; }
.noterow .grow { min-width: 180px; }
.noterow.new b { color: var(--brand); }
/* ---------- upgrade 44: instructors' access on the Staff page */
.teamrow { flex-wrap: wrap; gap: 8px 10px; }
.teamrow .grow { min-width: 140px; overflow-wrap: anywhere; }
/* ---- upgrade 46: the School National look (clay and night). These values replace the navy and yellow of upgrade 27. ---- */
.btn.primary { background-position: 100% 0; }
:root:not([data-theme="dark"]) .btn.primary { border-color: transparent; }
.brand .logo.snmark svg { width: 100%; height: 100%; stroke-width: 0; }
.auth .brand .logo.snmark { width: 52px; height: 52px; }
/* ---- upgrade 47: School National v2 — black, off-white, one signal red; system fonts. Replaces the clay look of upgrade 46. ---- */
:root { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Noto Sans Arabic", sans-serif; }
:root { --hi: #C8180F; --hi2: #E8261C; --hi-ink: #ffffff; --bg: #F5F5F2; --surface: #ffffff; --surface-2: #F0F0EC; --line: #E3E3DE; --text: #0A0A0A; --muted: #6E6E69; --faint: #A3A39D; --brand: #0A0A0A; --brand-2: #2A2A28; --brand-soft: #F0F0EC; --brand-text: #0A0A0A; --ok: #1D7A46; --late: #8A5A00; --bad: #C8180F; --shadow: 0 1px 2px rgba(10,10,10,.04), 0 6px 20px rgba(10,10,10,.05); --shadow-lg: 0 24px 60px rgba(10,10,10,.22); --ambient: transparent; --card-bg: var(--surface); --hero-bg: #0A0A0A radial-gradient(#262624 1px, transparent 1.2px) 0 0 / 18px 18px; --hero-text: #F5F5F2; --hero-soft: rgba(245,245,242,.7); --hero-chip: rgba(255,255,255,.1); --hero-btn: rgba(255,255,255,.12); --hero-btn-text: #ffffff; --gauge-a: #E8261C; --gauge-b: #F5F5F2; }
:root[data-theme="dark"] { --hi: #E8261C; --hi2: #FF4A3D; --hi-ink: #ffffff; --bg: #0A0A0A; --surface: #161615; --surface-2: #1E1E1C; --line: #2A2A28; --text: #F5F5F2; --muted: #A3A39D; --faint: #6E6E69; --brand: #F5F5F2; --brand-2: #D8D8D2; --brand-soft: #1E1E1C; --brand-text: #F5F5F2; --ok: #4CC488; --late: #E7B04A; --bad: #FF5A4E; --ok-soft: #10301f; --late-soft: #33280f; --bad-soft: #3a1513; --exc-soft: #1d2433; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.45); --shadow-lg: 0 30px 70px rgba(0,0,0,.75); --card-bg: var(--surface); --ambient: transparent; --hero-bg: #161615 radial-gradient(#2a2a28 1px, transparent 1.2px) 0 0 / 18px 18px; --hero-text: #F5F5F2; --hero-soft: rgba(245,245,242,.7); --hero-chip: rgba(255,255,255,.1); --hero-btn: #0A0A0A; --hero-btn-text: #ffffff; --gauge-a: #E8261C; --gauge-b: #F5F5F2; }
.btn.primary { background: var(--hi); background-size: auto; color: var(--hi-ink); box-shadow: none; border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--hi) 86%, #000); }
:root:not([data-theme="dark"]) .btn.primary { box-shadow: none; }
.auth { background: radial-gradient(#dcdcd6 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg); }
:root[data-theme="dark"] .auth { background: radial-gradient(#222220 1px, transparent 1.2px) 0 0 / 22px 22px, var(--bg); }
:root[data-theme="dark"] .calpill.present, :root[data-theme="dark"] .calpill.late, :root[data-theme="dark"] .calpill.absent, :root[data-theme="dark"] .calpill.excused { color: #0A0A0A; }
/* upgrade 55: was white text on the near-white dark-look chips and status buttons */
:root[data-theme="dark"] .chip.on { color: #0A0A0A; } :root[data-theme="dark"] .mark.on { color: #0A0A0A; }
:root:not([data-theme="dark"]) .rolefx { background: #0A0A0A; color: #ffffff; }
.kpis > .kpi:first-child:not(.bad):not(.late) { box-shadow: none; }
/* ---- upgrade 48: Notebook logo, a calmer phone bar, nothing spills out of its box, aligned phone spacing ---- */
.brand .logo.snmark { background: none; box-shadow: none; padding: 0; overflow: visible; border-radius: 0; }
.snmark svg { display: block; width: 100%; height: 100%; }
.snmark .t { fill: #0A0A0A; }
.snmark .l { fill: #F5F5F2; fill-rule: evenodd; }
:root[data-theme="dark"] .snmark .t { fill: #F5F5F2; }
:root[data-theme="dark"] .snmark .l { fill: #0A0A0A; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; white-space: nowrap; }
.seg.mini.fill { overflow: hidden; }
.seg.mini.fill button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge, .chip, .tabs button, .rolepill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge, .tabs button, .rolepill { white-space: nowrap; }
@media (max-width: 820px) {
  .bottom-nav { gap: 0; padding: 5px 6px; }
  .bottom-nav a:not(.navplus) { flex: 1 1 0; min-width: 0; gap: 3px; padding: 5px 2px; font-size: 11px; letter-spacing: 0; white-space: nowrap; overflow: hidden; background: none; box-shadow: none; color: var(--muted); }
  .bottom-nav a:not(.navplus) > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .bottom-nav a:not(.navplus) svg { width: 22px; height: 22px; padding: 4px 14px; box-sizing: content-box; border-radius: 999px; transition: background .2s, color .2s; }
  .bottom-nav a.on:not(.navplus) { flex: 1 1 0; padding-inline: 2px; background: none; box-shadow: none; color: var(--text); font-weight: 700; }
  .bottom-nav a.on:not(.navplus) svg { background: color-mix(in srgb, var(--hi) 18%, transparent); color: var(--hi); }
  .bottom-nav a.navplus { flex: 0 0 52px; width: 52px; height: 52px; margin: -8px 6px; }
  [dir="rtl"] .bottom-nav a:not(.navplus) { font-size: 11.5px; }
}
@media (max-width: 360px) {
  .bottom-nav a:not(.navplus) svg { padding: 4px 10px; }
  .bottom-nav a:not(.navplus) { font-size: 10.5px; }
}
.kpis > .kpi:first-child:not(.bad):not(.late) .lbl, .kpis > .kpi:first-child:not(.bad):not(.late) .foot, .kpis > .kpi:first-child:not(.bad):not(.late) .val small { color: color-mix(in srgb, var(--hi-ink) 80%, transparent); }
/* summary cards: whole rows, no half-empty last row (7 cards = one wide + six; 5 = five across) */
@media (min-width: 1001px) {
  .kpis:has(> :nth-child(4):last-child), .kpis:has(> :nth-child(7):last-child), .kpis:has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis:has(> :nth-child(3):last-child), .kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpis > :first-child:nth-last-child(7) { grid-column: span 2; }
}
@media (max-width: 820px) {
  .kpis > :first-child:nth-last-child(odd):not(:only-child) { grid-column: 1 / -1; }
  .todo-fab { padding: 9px 5px 9px 7px; }
  .todo-fab svg { width: 16px; height: 16px; }
}
/* ---- upgrade 50: opening screen (static/splash.js) ---- */
#splash { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; transition: opacity .35s ease; }
#splash.dark { background: #0A0A0A; }
#splash.light { background: #F5F5F2; }
#splash.out { opacity: 0; pointer-events: none; }
#splash svg { width: 112px; height: 112px; overflow: visible; }
#splash.dark .pt { fill: #F5F5F2; }
#splash.dark .pl { fill: #0A0A0A; }
#splash.light .pt { fill: #0A0A0A; }
#splash.light .pl { fill: #F5F5F2; }
#splash:not(.dark):not(.light) { display: none; }

/* ---- upgrade 57: movable "My list" tab, team-account look ---- */
.todo-fab { touch-action: none; }
.todo-fab.dragging { transition: none; opacity: .85; cursor: grabbing; }
.todo-fab.other { right: auto; left: 0; border-right: 1px solid var(--line); border-left: 0; transform: scaleX(-1); }
.todo-fab.other > * { transform: scaleX(-1); }
[dir="rtl"] .todo-fab.other { left: auto; right: 0; transform: none; }
[dir="rtl"] .todo-fab.other > * { transform: none; }
.teamav { position: relative; display: inline-block; flex: none; }
.teamav.on { margin-inline-start: 16px; }
.teamav > .avatar { position: relative; z-index: 3; box-shadow: 0 0 0 2px var(--surface); }
.teamav .tm { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 800;
  color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.teamav .tm:nth-child(1) { inset-inline-start: -11px; z-index: 2; }
.teamav .tm:nth-child(2) { inset-inline-start: -19px; z-index: 1; opacity: .85; }
.teamav .tm:nth-child(3) { inset-inline-start: -26px; z-index: 0; opacity: .65; }
.teampill { display: inline-block; margin-inline-start: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); vertical-align: 1px; }

/* ---- upgrade 59: team circles stacked behind your picture (a thin edge shows, nothing sticks out); the student's week ---- */
.teamav.on { margin-inline-start: 0; margin-inline-end: 6px; }
.teamav .tm { top: 0; width: 100%; height: 100%; font-size: 0; box-shadow: 0 0 0 2px var(--surface); }
.teamav .tm:nth-child(1) { inset-inline-start: 4px; top: -2px; z-index: 2; opacity: .9; }
.teamav .tm:nth-child(2) { inset-inline-start: 7px; top: -4px; z-index: 1; opacity: .7; }
.teamav .tm:nth-child(3) { display: none; }
.tgrid.stu .tbox > b { white-space: normal; line-height: 1.2; }
.teampill { display: table; margin: 3px 0 0; }

/* ---- upgrade 60: labels never squeezed or cut; the student's week as a list, the timetable on request ---- */
.tabs button, .sectabs button { flex: none; }
.row > .logo, .row > .logo-img { width: 56px; height: 56px; flex: none; }
.wkagenda { display: grid; gap: 2px; margin-bottom: 12px; }
.wkday { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.wkday:first-child { border-top: 0; }
.wkday.today .wkdate { color: var(--hi); }
.wkdate { flex: none; width: 74px; font-size: 13.5px; padding-top: 2px; }
.wkitem { display: flex; gap: 10px; align-items: center; padding: 3px 0; }
.wkitem .grow { display: grid; min-width: 0; line-height: 1.3; }
.wktime { flex: none; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 88px; }
.wkgrid > summary { list-style: none; display: inline-flex; cursor: pointer; }
.wkgrid > summary::-webkit-details-marker { display: none; }
.wkgrid[open] > summary { margin-bottom: 4px; }
.tgrid.stu .tbox > b, .tgrid.stu .tbox > span { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 820px) { .wkdate { width: 62px; } .wktime { min-width: 78px; font-size: 13px; } }

/* ---- upgrade 67: Sirplix brand — splash, logo, sign-in screen (always black, square, wide capitals) ---- */
#splash { flex-direction: column; gap: 18px; }
#splash.dark { background: #000; }
#splash.dark .pt { fill: #fff; }
#splash.light .pt { fill: #0A0A0A; }
#splash svg { width: 104px; height: 104px; }
#splash .sp-w { font: 900 15px/1 "Arial Black", "Segoe UI Black", system-ui, sans-serif; letter-spacing: .34em; padding-left: .34em; opacity: 0; }
#splash.dark .sp-w { color: #fff; }
#splash.light .sp-w { color: #0A0A0A; }
.snmark { color: #0A0A0A; }
:root[data-theme="dark"] .snmark { color: #F5F5F2; }
.auth, :root[data-theme="dark"] .auth { background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.auth::before { display: none; }
.auth .card { background: #000; color: #fff; border: 1px solid #2a2a2a; border-radius: 0; box-shadow: none; max-width: 440px; padding: 34px 32px 30px; }
.auth .sx-k { margin: 0 0 22px; font: 900 12px/1 "Arial Black", "Segoe UI Black", system-ui, sans-serif; letter-spacing: .34em; color: #fff; }
.auth .brand b { color: #fff; }
.auth .brand span, .auth p, .auth .faint, .auth label, .auth .hint { color: #9a9a95; }
.auth .brand .logo.snmark { color: #fff; width: 46px; height: 46px; }
.auth h1 { font: 900 30px/1.05 "Arial Black", "Segoe UI Black", system-ui, sans-serif; letter-spacing: -.01em; text-transform: uppercase; color: #fff; margin-top: 6px; }
.auth input, .auth select { background: #000; color: #fff; border: 1px solid #333; border-radius: 0; }
.auth input:focus, .auth select:focus { border-color: #fff; box-shadow: none; outline: none; }
.auth .btn { border-radius: 0; }
.auth .btn.primary { background: #fff; color: #000; border: 1px solid #fff; font: 900 13px/1 "Arial Black", "Segoe UI Black", system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.auth .btn.primary:hover { background: #F5F5F2; }
.auth .btn.ghost { color: #fff; border: 1px solid #444; background: transparent; }
.auth a { color: #fff; }
.auth .sx-foot { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #6E6E69; }
.auth .sx-foot a { color: #bdbdb8; text-decoration: none; border-bottom: 1px solid #444; }
[dir="rtl"] .auth h1, [dir="rtl"] .auth .btn.primary, [dir="rtl"] .auth .sx-foot { letter-spacing: 0; }

