/* Kips Learning — a live sky, and a look that grows with the child. Purple comes from the logo. */
:root {
  --primary: #5a55b0;
  --primary-dark: #3f3a8f;
  --primary-soft: #eeedfb;
  --sun: #ffc94a;
  --sun-soft: #fff3cf;
  --coral: #ff7a6b;
  --mint: #3ccb9a;
  --mint-soft: #d9f7ea;
  --sky: #4cb8f5;
  --sky-soft: #dcf1ff;
  --bg: #f7f5ff;
  --card: #fff;
  --text: #2a2550;
  --muted: #625e86;
  --line: #e6e3f5;
  --heading-font: ui-rounded, "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --ok: #15803d;
  --ok-soft: #e3f6ea;
  --warn: #b45309;
  --warn-soft: #fff4de;
  --bad: #b91c1c;
  --bad-soft: #fde8e8;
  --radius: 20px;
  --shadow: 0 2px 4px rgba(63, 58, 143, .05), 0 8px 22px rgba(63, 58, 143, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(135deg, #d6e8ff 0%, #e6e2fb 35%, #f6e2f6 68%, #ffdfeb 100%); } /* stays still while the page scrolls */
html[data-band="staff"] body::before { display: none; }
@media print { body::before { display: none; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
h1, h2, h3 { font-family: var(--heading-font); }
h1 { font-size: 1.75rem; margin: 0 0 .25rem; line-height: 1.25; color: var(--primary-dark); }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; color: var(--primary-dark); }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
a { color: var(--primary); }
code { background: #eef1f8; padding: .1rem .35rem; border-radius: 6px; font-size: .92em; }
.muted { color: var(--muted); }
.small-print { font-size: .85rem; }
.error { color: var(--bad); font-weight: 600; margin: .5rem 0; }
.ok-text { color: var(--ok); font-weight: 600; }
.warn-text { color: var(--warn); font-weight: 600; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.big { font-size: 1.6rem; font-weight: 700; margin: .25rem 0; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; background: #fff; padding: .5rem 1rem; z-index: 100; border-radius: 8px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #b3aff0; outline-offset: 2px; }

/* ----- top bar ----- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem; background: #fff; border-bottom: 4px solid; border-image: linear-gradient(90deg, var(--primary), var(--sky), var(--mint), var(--sun), var(--coral)) 1; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--heading-font); font-weight: 800; color: var(--primary-dark); text-decoration: none; font-size: 1.05rem; }
.logo { display: block; width: 38px; height: 38px; transition: transform .25s; }
.brand:hover .logo { transform: rotate(-10deg) scale(1.08); }
.nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { display: inline-flex; gap: .35rem; padding: .45rem .8rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.nav a.on { background: var(--primary); color: #fff; }
.who { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.whoname { display: flex; flex-direction: column; text-decoration: none; color: var(--text); font-weight: 600; line-height: 1.15; text-align: right; }
.whoname small { color: var(--muted); font-weight: 400; }

/* ----- layout ----- */
main { outline: none; }
.page { max-width: 1000px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
.page.wide { max-width: 1250px; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.page-head h1 { margin-bottom: .35rem; }
.head-side { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.head-side.row, .row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.back { display: inline-block; margin-bottom: .5rem; text-decoration: none; font-weight: 600; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; margin: 1rem 0; box-shadow: var(--shadow); }
.card h2:first-child { margin-top: 0; }
.danger-card { border-color: #f4b4b4; background: #fff8f8; }
.ok-card { border-color: #a7dcb9; background: #f4fcf7; }
blockquote { margin: .5rem 0; padding: .6rem .9rem; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 8px 8px 0; }
.facts { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0 0 .75rem; }
.facts dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; align-items: end; }

/* ----- buttons & forms ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1.1rem; border: 2px solid var(--line); background: #fff; color: var(--text); border-radius: 14px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; min-height: 42px; transition: transform .1s, box-shadow .1s, background .15s; }
.btn:hover { background: var(--primary-soft); }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 0 var(--primary-dark); }
.btn.primary:hover { background: #6660c2; }
.btn.primary:active:not(:disabled) { box-shadow: 0 2px 0 var(--primary-dark); }
.btn.big-btn { min-height: 52px; font-size: 1.1rem; border-radius: 16px; }
.btn.danger { color: var(--bad); border-color: #efb9b9; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: .25rem .65rem; min-height: 32px; font-size: .875rem; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); padding: .1rem .45rem; border-radius: 8px; }
.icon-btn:hover { background: #eef1f8; color: var(--text); }
.linkbtn { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; font-weight: 700; text-decoration: underline dotted; }
.form { display: grid; gap: .9rem; }
.field { display: grid; gap: .25rem; }
.field .label, .label { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); }
input, select, textarea { font: inherit; padding: .55rem .8rem; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); width: 100%; min-height: 44px; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }
.check { display: flex; align-items: center; gap: .5rem; padding-bottom: .5rem; }
input:disabled { background: #f0f2f8; }
.actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.left-auto { margin-right: auto; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; }
.filters select { width: auto; min-width: 150px; }
.filters input[type=search] { width: auto; min-width: 220px; flex: 1; max-width: 340px; }
.segs { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: .15rem; padding: .2rem; border: 2px solid var(--line); border-radius: 24px; background: #fff; }
.seg { border: 0; background: none; padding: .35rem .9rem; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 36px; border-radius: 999px; }
.seg:hover:not(.on) { background: var(--primary-soft); }
.seg.on { background: var(--primary); color: #fff; }

/* ----- chips, badges, tiles ----- */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 12%, white); color: color-mix(in srgb, var(--c) 80%, black); font-size: .82rem; font-weight: 600; border: 1px solid color-mix(in srgb, var(--c) 30%, white); }
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.badge-wrap { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #eef1f8; color: var(--muted); white-space: nowrap; }
.st-pending { background: var(--primary-soft); color: var(--primary); }
.st-overdue { background: var(--bad-soft); color: var(--bad); }
.st-submitted { background: var(--ok-soft); color: var(--ok); }
.st-reviewed { background: #ece6fb; color: #5b21b6; }
.st-late { background: var(--warn-soft); color: var(--warn); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin: 1rem 0; }
.tiles.four { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: .1rem; padding: 1rem 1.1rem; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); text-align: left; font: inherit; transition: transform .15s, border-color .15s; }
a.tile:hover, button.tile:hover { border-color: var(--primary); transform: translateY(-3px) rotate(-.6deg); }
.tile b { font-family: var(--heading-font); font-size: 1.9rem; line-height: 1.1; }
.tile .tile-emoji { font-size: 1.6rem; line-height: 1; margin-bottom: .25rem; }
.art { display: inline-block; flex: none; width: 1.3em; height: 1.3em; margin-right: .35em; overflow: visible; vertical-align: -.28em; }
.art path { stroke: #2a2550; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.art .white { stroke: #fff; stroke-width: 3.8; }
.art .thick { stroke-width: 8; }
.art .thick-colour { stroke-width: 4.2; }
.art .band-edge { stroke-width: 7.4; }
.art .band { stroke-width: 4.2; }
.art .dot { stroke: none; }
.art .smile { stroke-width: 1.7; }
.art .smile.light { stroke: #fff; }
.tile-emoji .art, .keep-emoji .art, .trophy-emoji .art, .subject-emoji .art, .stop-mark .art, .rd-book-mark .art, .palette-icon .art, .nav a > span .art, .search-btn .art, .note-head .art { margin: 0; }
.tile-emoji .art { width: 1.45em; height: 1.45em; }
.trophy-emoji .art { width: 1.5em; height: 1.5em; }
.stop.done .stop-mark .art path { stroke: #fff; }
.stop.done .stop-mark .art path:first-child { fill: transparent; stroke: transparent; }
.login-card .btn .art { margin: 0 0 0 .4em; }
.timer { display: inline-flex; align-items: center; }
.timer .art { width: 1.2em; height: 1.2em; margin-right: .3em; }
.rd-actions .timer { flex: none; }
.tile.t-sky { background: var(--sky-soft); border-color: #bfe5fb; }
.tile.t-mint { background: var(--mint-soft); border-color: #b3edd5; }
.tile.t-sun { background: var(--sun-soft); border-color: #ffe39f; }
.tile.t-sky > span, .tile.t-mint > span, .tile.t-sun > span, .tile.warn > span { color: #4d4970; }
.tile b.small { font-size: 1.15rem; }
.tile b.second { font-size: 1.4rem; margin-top: .4rem; }
.tile > span { color: var(--muted); font-size: .9rem; }
.tile .tile-label { font-weight: 700; color: var(--text); margin-bottom: .2rem; }
.tile.warn { background: var(--bad-soft); border-color: #f1b4b4; }
.tile.warn b { color: var(--bad); }
.btn-tile { cursor: pointer; }
.btn-tile.on { border: 2px solid var(--primary); background: var(--primary-soft); }
.tiles.classes .tile { border-top: 4px solid var(--c); }
.tile .link { margin-top: .5rem; font-weight: 600; }
.classrow { display: flex; gap: .6rem; flex-wrap: wrap; }
.classpill { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); background: #fafbff; }
.classpill b { font-size: 1.3rem; }
.classpill span { color: var(--muted); font-size: .85rem; }
.classpill:hover { border-color: var(--primary); }
.pbar { height: 10px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; min-width: 90px; }
.pbar > div { height: 100%; background: linear-gradient(90deg, var(--mint), var(--sky)); border-radius: 99px; }
.timer { font-variant-numeric: tabular-nums; background: var(--primary-soft); color: var(--primary); padding: .25rem .7rem; border-radius: 99px; font-weight: 700; font-size: .9rem; }
.timer.paused { background: #eceff6; color: var(--muted); }

/* ----- lists ----- */
.alist { display: grid; gap: .5rem; }
.arow { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 1.1rem; background: #fff; border: 2px solid var(--line); border-left: 8px solid var(--c, var(--primary)); border-radius: 16px; text-decoration: none; color: var(--text); flex-wrap: wrap; transition: transform .15s, box-shadow .15s; }
.arow:hover { border-color: var(--primary); border-left-color: var(--c, var(--primary)); box-shadow: var(--shadow); transform: translateY(-2px); }
.arow-main { min-width: 0; flex: 1 1 260px; }
.arow-main strong { display: block; overflow-wrap: anywhere; }
.arow-sub { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; font-size: .9rem; margin-top: .15rem; }
.arow-side { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; font-size: .88rem; text-align: right; }
.arow.submitted, .arow.reviewed, .arow.closed { background: #fbfcfe; }
.arow.overdue { border-color: #f1c0c0; border-left-color: var(--bad); }
.submitted-meter { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; font-weight: 600; }
.loading { display: flex; align-items: center; gap: .6rem; padding: 2rem 1rem; color: var(--muted); justify-content: center; }
.spin { width: 18px; height: 18px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; border: 3px dashed #d6d2f0; border-radius: var(--radius); background: #fff; font-weight: 600; }
.empty > .art { display: block; width: 3.2rem; height: 3.2rem; margin: 0 auto .3rem; }
.files { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .35rem; }
.files:empty { display: none; }
.files li { position: relative; display: flex; align-items: center; gap: .6rem; padding: .4rem .7rem; background: #f6f8fd; border-radius: 8px; overflow: hidden; }
.ftype { display: grid; place-items: center; flex: none; min-width: 42px; padding: .15rem .3rem; border-radius: 6px; background: #5a6078; color: #fff; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.ftype.pdf { background: #c23d32; }
.ftype.word { background: #1f64b8; }
.ftype.slides { background: #c2570e; }
.ftype.sheet { background: #0b7f60; }
.ftype.image { background: #7a4bb5; }
.file-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.file-progress i { display: block; height: 100%; background: var(--primary); transition: width .15s; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .1rem; width: 100%; padding: 1.3rem 1rem; border: 2px dashed #c9c6e6; border-radius: 16px; background: #faf9ff; color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover:not(:disabled), .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone:disabled { opacity: .55; cursor: not-allowed; }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: .25rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.drop-icon .icon { width: 22px; height: 22px; }
.drop-or { color: var(--muted); font-size: .9rem; }
.drop-or u { color: var(--primary); font-weight: 600; }
.dropzone small { margin-top: .3rem; color: var(--muted); }

/* ----- setting an assignment ----- */
.assign-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; margin-top: .6rem; }
.assign-form { gap: .8rem; }
.step { display: grid; gap: .8rem; margin: 0; }
.step-head { display: flex; align-items: flex-start; gap: .65rem; }
.step-head h2 { margin: .15rem 0 0; }
.step-head p { margin: .1rem 0 0; font-size: .88rem; }
.step-num { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; font-weight: 700; }
.assign-side { position: sticky; top: 1rem; }
.assign-side h2 { margin-bottom: .5rem; }
.preview-card { display: grid; justify-items: start; gap: .4rem; padding: 1rem; border: 1px solid var(--line); border-top: 3px solid var(--primary); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.preview-title { overflow-wrap: anywhere; font-size: 1.05rem; }
.preview-text { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.preview-card p { margin: 0; }
.preview-facts { display: grid; gap: .3rem; width: 100%; margin: .3rem 0 0; padding-top: .5rem; border-top: 1px solid var(--line); font-size: .86rem; }
.preview-facts div { display: flex; justify-content: space-between; gap: .8rem; }
.preview-facts dt { color: var(--muted); }
.preview-facts dd { margin: 0; font-weight: 600; text-align: right; }
.assign-side .small-print { margin-top: .6rem; }
@media (max-width: 1050px) {
  .assign-layout { grid-template-columns: minmax(0, 1fr); }
  .assign-side { position: static; order: 2; }
}
.files .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filepicker { margin: .75rem 0; }

/* ----- tables ----- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbff; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.off td { opacity: .55; }
.table tr.open td { background: var(--primary-soft); }
.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.detail-row > td { background: #f7f9ff; }
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.2rem; padding: .5rem 0; }
.answer { background: #fff; border: 1px solid var(--line); padding: .7rem; border-radius: 8px; max-height: 320px; overflow: auto; }
.markbox { display: grid; gap: .5rem; align-content: start; }
.bar-cell { display: flex; align-items: center; gap: .5rem; }
.bar-cell .bar { height: 10px; border-radius: 99px; min-width: 2px; max-width: 160px; }
.coverage th, .coverage td { text-align: center; padding: .35rem .4rem; }
.coverage td.have .cov { background: var(--ok-soft); color: var(--ok); }
.coverage td.miss .cov { background: var(--bad-soft); color: var(--bad); }
.cov { border: 0; border-radius: 8px; min-width: 38px; height: 32px; font-weight: 700; cursor: pointer; font: inherit; }
.matrix th, .matrix td { text-align: center; padding: .35rem .45rem; }
.matrix th:first-child { text-align: left; }
.tchips { display: flex; gap: .3rem; flex-wrap: wrap; }
.creds td, .creds th { font-size: 1rem; }

/* ----- dialog / toast ----- */
.overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: grid; place-items: center; z-index: 50; padding: 1rem; overflow-y: auto; }
.dialog { background: #fff; border-radius: 22px; width: min(520px, 100%); max-height: calc(100vh - 2rem); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.dialog.wide { width: min(900px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.2rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.dialog-head h2 { margin: 0; }
.dialog-body { padding: 1.1rem 1.2rem 1.3rem; }
.toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 80; width: min(92vw, 420px); }
.toast { padding: .75rem 1.1rem; border-radius: 16px; background: #14532d; color: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); font-weight: 700; animation: pop .18s ease-out; }
.toast.error { background: #991b1b; }

/* ----- login ----- */
.login-wrap { position: relative; overflow: hidden; min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(150deg, #e9e6ff, #fff6dc 55%, #dff4ff); }
.login-wrap .sky-scene { right: 0; height: 100%; width: 46vw; }
.login-card { position: relative; z-index: 1; width: min(380px, 100%); background: #fff; padding: 2.2rem 2rem 1.6rem; border-radius: 30px; box-shadow: 0 18px 50px rgba(63, 58, 143, .16); display: grid; gap: 1rem; }
.login-card h1 { text-align: center; font-size: 1.4rem; letter-spacing: .02em; margin: 0; }
.login-logo { display: block; width: 84px; height: 84px; margin: 0 auto -.3rem; animation: bob 4s ease-in-out infinite; }
.login-hello { text-align: center; color: var(--muted); font-weight: 600; margin: -.7rem 0 .4rem; }
.login-card .small-print { text-align: center; margin: 0; }
.login-card .error { margin: 0; text-align: center; }
@keyframes bob { 50% { translate: 0 -12px; } }

/* ----- the live sky ----- */
.sky { position: relative; overflow: hidden; }
.sky-dawn { background: linear-gradient(105deg, #352f86 0%, #a8487f 60%, #f4a259 100%); }
.sky-day { background: linear-gradient(105deg, #2b4fb3 0%, #2f86d6 55%, #7cd0f7 100%); }
.sky-dusk { background: linear-gradient(105deg, #2d2a78 0%, #8e3f86 55%, #f0834d 100%); }
.sky-night { background: linear-gradient(105deg, #0e1136 0%, #1d1f5a 60%, #3a2f7d 100%); }
.sky-scene { position: absolute; right: 0; bottom: 0; height: 100%; width: min(460px, 58%); overflow: visible; pointer-events: none; }
.sky-veil { position: absolute; inset: 0; opacity: 0; transition: opacity 3s ease-in-out; }
.sky-veil.in { opacity: 1; }
.sky-scene { transition: opacity 3s ease-in-out; }
.sky-scene.sky-fading { opacity: 0; }
.sky-title { transition: opacity .5s ease, transform .5s ease; }
.sky-title.changing { opacity: 0; transform: translateY(-6px); }
.hill { fill: rgba(16, 12, 60, .38); }
.sky-night .hill { fill: rgba(0, 0, 20, .55); }
.flyer { fill: #fff; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; opacity: .9; }
.cloud ellipse { fill: #fff; opacity: .55; }
.sky-night .cloud ellipse { opacity: .1; }
.cloud.c1 { animation: drift 16s ease-in-out infinite alternate; }
.cloud.c2 { animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { translate: 26px 0; } }
.star { fill: #fff; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .3; } }
.kite { transition: transform .9s cubic-bezier(.3, 1.3, .6, 1); }
.kite-sway { animation: sway 3.6s ease-in-out infinite; transform-origin: 0 34px; }
@keyframes sway { 0%, 100% { rotate: -5deg; } 50% { rotate: 6deg; } }
.kite-string { fill: none; stroke: rgba(255, 255, 255, .75); stroke-width: 1.3; }
.kite-tail { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 2; }
.kite-spar { stroke: rgba(255, 255, 255, .65); stroke-width: 1.6; fill: none; }
.kite.soaring polygon { filter: drop-shadow(0 0 7px #ffe9a0); }

.hero { min-height: 250px; display: flex; align-items: center; padding: 1.5rem 1.7rem; border-radius: 26px; color: #fff; box-shadow: var(--shadow); }
.sky-text { position: relative; z-index: 1; width: min(560px, 62%); }
.hero h1 { color: #fff; font-size: 2rem; }
.hero-class { margin: 0; opacity: .92; font-size: .92rem; }
.tip { display: flex; align-items: center; gap: .5rem; margin-top: .7rem; padding: .55rem .6rem .55rem .8rem; border-radius: 18px 18px 18px 4px; background: #fff; color: var(--text); box-shadow: 0 6px 18px rgba(16, 12, 60, .22); }
.tip-kite { flex: none; width: 15px; height: 15px; margin: 0 .2rem; border-radius: 2px; transform: rotate(45deg); background: conic-gradient(var(--sun) 0 25%, var(--primary) 0 75%, var(--coral) 0); }
.tip-text { flex: 1; min-width: 0; font-weight: 700; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
a.tip-text:hover { color: var(--primary); text-decoration: underline; }
.tip-next { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font: inherit; font-weight: 800; cursor: pointer; }
.tip-next:hover { background: #dedbf7; }

.hero-btn { display: inline-block; max-width: 100%; margin-top: .8rem; padding: .55rem 1.1rem; border-radius: 14px; background: #fff; color: var(--primary-dark); font-weight: 800; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 4px 0 rgba(0, 0, 0, .18); transition: transform .1s; }
.hero-btn:hover { transform: translateY(-2px); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; margin: 1rem 0; }
.dash-grid .card { margin: 0; min-width: 0; }

/* ----- today's flight plan: stops threaded on the kite string ----- */
.flight { position: relative; list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .6rem; margin: 0; padding: 0; }
.flight::before { content: ""; position: absolute; left: 8%; right: 8%; top: 23px; border-top: 3px dashed #d6d2f0; }
.stop { position: relative; min-width: 0; }
.stop a { display: flex; flex-direction: column; align-items: center; gap: .1rem; height: 100%; padding: 0 .3rem .3rem; border-radius: 16px; text-align: center; text-decoration: none; color: var(--text); transition: transform .15s; }
.stop a:hover { transform: translateY(-3px); }
.stop-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: .25rem; border-radius: 50%; background: #fff; border: 3px solid var(--c); font-size: 1.3rem; }
.stop strong { font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.stop small { color: var(--muted); font-weight: 600; }
.stop.now .stop-mark { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, white); animation: bob 2.4s ease-in-out infinite; }
.stop.now small { color: var(--primary-dark); font-weight: 800; }
.stop.done .stop-mark { background: var(--mint); border-color: var(--mint); color: #fff; font-weight: 800; }
.stop.done strong { color: var(--muted); text-decoration: line-through; }

/* ----- teacher: class pulse ----- */
.pulse { display: flex; align-items: flex-end; gap: .5rem; margin-top: .45rem; }
.tile .pulse > span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.pulse-bars { display: flex; align-items: flex-end; gap: 3px; height: 30px; flex: none; }
.pulse-bars i { display: block; width: 8px; border-radius: 3px 3px 0 0; background: var(--mint); }
.pulse-bars i.low { background: var(--coral); }
.tile .pulse-none { margin-top: .45rem; font-size: .82rem; }

/* ----- teacher: how busy is the class? ----- */
.load { display: grid; gap: .35rem; }
.load:empty { display: none; }
.load-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: .25rem; }
.lday { display: flex; flex-direction: column; align-items: center; min-height: 58px; padding: .2rem 0; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.lday small { font-size: .68rem; color: var(--muted); }
.lday b { line-height: 1.2; }
.lday-dots { line-height: .6; font-size: 1.2rem; color: var(--primary); min-height: .7rem; }
.lday.n2 { background: var(--sun-soft); border-color: #ffe39f; }
.lday.n3 { background: var(--bad-soft); border-color: #f4b4b4; }
.lday.n3 .lday-dots { color: var(--bad); }
.lday.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.load-warn { margin: .15rem 0 0; padding: .5rem .7rem; border-radius: 12px; background: var(--sun-soft); font-weight: 600; font-size: .92rem; }

/* ----- Ctrl+K ----- */
.search-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border: 2px solid var(--line); border-radius: 12px; background: #faf9ff; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.search-btn:hover { border-color: var(--primary); }
.search-btn kbd { padding: 0 .3rem; border-radius: 5px; background: var(--primary-soft); font: inherit; font-size: .72rem; }
.palette-wrap { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; background: rgba(16, 12, 60, .45); }
.palette { width: min(560px, 100%); max-height: 72vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); animation: pop .15s ease-out; }
.palette-input { border: 0; border-bottom: 2px solid var(--line); border-radius: 0; min-height: 56px; padding: 0 1.1rem; font-size: 1.1rem; }
.palette-input:focus { box-shadow: none; }
.palette-list { flex: 1; overflow-y: auto; padding: .4rem; }
.palette-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .5rem .7rem; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.palette-item.on { background: var(--primary-soft); }
.palette-title { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item small { color: var(--muted); white-space: nowrap; }
.palette-none { margin: 0; padding: 1rem; text-align: center; color: var(--muted); }
.palette-hint { margin: 0; padding: .4rem 1rem; border-top: 2px solid var(--line); font-size: .78rem; color: var(--muted); }

/* ----- subjects ----- */
.subject-group { margin-top: 1.1rem; }
.subject-group h2 { margin-bottom: .55rem; font-size: 1.05rem; }
.subject-group.urgent h2 { color: var(--bad); }
.subject-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: .8rem; }
.subject-card { display: flex; flex-direction: column; gap: .65rem; padding: 1rem 1.1rem; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
.subject-card:hover { transform: translateY(-3px); border-color: var(--c); }
.sc-head { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.sc-head small { display: block; color: var(--muted); }
.sc-name { min-width: 0; }
.sc-name strong { display: block; overflow-wrap: anywhere; line-height: 1.25; }
.sc-icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--c) 13%, white); font-size: 1.5rem; }
.sc-icon.big { width: 62px; height: 62px; border-radius: 18px; background: #fff; font-size: 2rem; }
.sc-body { display: grid; gap: .05rem; min-width: 0; }
.sc-next { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sc-next.done { color: var(--ok); }
.sc-when { color: var(--muted); font-size: .86rem; }
.sc-when.late { color: var(--bad); font-weight: 800; }
.sc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .84rem; }
.sc-score { display: inline-flex; align-items: center; gap: .4rem; }
.sc-track { width: 54px; height: 7px; border-radius: 99px; background: var(--primary-soft); overflow: hidden; }
.sc-track i { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.sc-trend { font-weight: 700; color: var(--muted); white-space: nowrap; }
.sc-trend.up { color: var(--ok); }
.sc-trend.down { color: var(--bad); }
.sc-quiz { margin-left: auto; padding: .05rem .55rem; border-radius: 999px; background: var(--sun-soft); font-weight: 700; white-space: nowrap; }
.sc-right { grid-column: 2; grid-row: 1; }

.subject-hero { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .9rem 1.5rem; margin-bottom: 1rem; padding: 1.1rem 1.3rem; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 12%, white); border: 2px solid color-mix(in srgb, var(--c) 24%, white); }
.subject-hero h1 { margin: 0; }
.subject-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; }
.subject-fact { display: grid; }
.subject-fact b { font-family: var(--heading-font); font-size: 1.25rem; line-height: 1.2; }
.subject-fact span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.subject-fact.late b, .subject-fact.late span { color: var(--bad); }
.subject-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.subject-main, .subject-side { display: grid; gap: 1rem; min-width: 0; }
.subject-main .card, .subject-side .card { margin: 0; }
@media (max-width: 900px) {
  .subject-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ----- my work ----- */
.work-tabs { display: flex; gap: .2rem; margin: .4rem 0 .8rem; border-bottom: 2px solid var(--line); }
.work-tabs a { padding: .45rem .9rem; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; }
.work-tabs a:hover { color: var(--primary-dark); }
.work-tabs a.on { color: var(--primary-dark); border-bottom-color: var(--primary); }
.group-head { margin: .7rem 0 .1rem; font-size: 1rem; }
.group-head:first-child { margin-top: 0; }
.group-head.late { color: var(--bad); }

/* ----- how my subjects are going ----- */
.focus { margin-bottom: 1rem; padding: .7rem .9rem; border-radius: 14px; background: var(--sun-soft); }
.focus h3 { margin: 0 0 .25rem; }
.focus-item { display: block; padding: .15rem 0; color: var(--text); font-weight: 600; }
.score-rows { display: grid; gap: .5rem; }
.score-row { display: grid; grid-template-columns: minmax(90px, 26%) minmax(0, 1fr) 3rem 6.5rem; align-items: center; gap: .6rem; font-size: .9rem; color: var(--text); text-decoration: none; }
.score-row:hover .subj-name { color: var(--primary); }
.score-track { height: 12px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; }
.score-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.score-sub { margin: 1.1rem 0 .5rem; }

/* ----- the bell ----- */
.bell-wrap { position: relative; }
.search-btn.bell { position: relative; }
.bell-count { position: absolute; top: -7px; right: -7px; min-width: 19px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; line-height: 19px; text-align: center; }
.bell-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: flex; flex-direction: column; width: 380px; max-height: min(70vh, 560px); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 16px 44px rgba(16, 12, 60, .22); font-size: 16px; }
.bell-panel[hidden] { display: none; }
.bell-top { flex: none; display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.bell-top h2 { margin: 0; font-size: 1.05rem; }
.bell-read { font-size: .84rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.bell-read:hover { text-decoration: underline; }
.bell-body { overflow-y: auto; }
.bell-empty { margin: 0; padding: 2rem 1rem; text-align: center; color: var(--muted); }
.note-group { padding: .5rem 0 .4rem; }
.note-group + .note-group { border-top: 1px solid var(--line); }
.note-head { display: flex; align-items: center; gap: .4rem; padding: .1rem 1rem .25rem; font-size: .9rem; }
.note-head h3 { margin: 0; font-size: .86rem; color: var(--text); }
.note-new { padding: 0 .4rem; border-radius: 99px; background: var(--primary-soft); color: var(--primary-dark); font-size: .72rem; font-weight: 700; }
.note-all { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.note-all:hover { text-decoration: underline; }
.note { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .6rem; padding: .35rem 1rem .35rem 1.65rem; color: var(--text); text-decoration: none; }
.note:hover { background: var(--primary-soft); }
.note-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.note-sub { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--muted); }
.note-time { grid-column: 2; grid-row: 1; font-size: .74rem; color: var(--muted); }
.note.fresh .note-title { font-weight: 700; }
.note.fresh::before { content: ""; position: absolute; left: .85rem; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }

/* ----- login details ----- */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3.6rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); padding: .2rem .5rem; border: 0; border-radius: 8px; background: none; color: var(--primary-dark); font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.pw-toggle:hover { background: var(--primary-soft); }

/* ----- study time ----- */
.insights ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .25rem; font-weight: 600; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chart-head h2 { margin: 0; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .6rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.seg-read { background: #5a55b0; }
.seg-assign { background: #d9822b; }
.sbars-wrap { position: relative; height: 200px; }
.sbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; height: 100%; }
.sbar { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; height: 100%; border-bottom: 1px solid var(--line); cursor: pointer; }
.sbar:hover { background: rgba(90, 85, 176, .06); }
.sbar i { display: block; flex: none; width: min(76%, 36px); min-height: 2px; }
.sbar i:first-child { border-radius: 4px 4px 0 0; }
.sbar.today { border-bottom: 2px solid var(--primary); }
.sbar-labels { height: auto; margin-top: .25rem; font-size: .72rem; color: var(--muted); text-align: center; }
.goal-line { position: absolute; z-index: 2; left: 0; right: 0; border-top: 1.5px dashed #a09ccc; pointer-events: none; }
.goal-line span { position: absolute; right: 0; bottom: 2px; padding: 0 .3rem; border-radius: 4px; background: rgba(255, 255, 255, .85); font-size: .72rem; font-weight: 700; color: var(--muted); }
.chart-tip { position: absolute; top: 0; z-index: 3; display: grid; width: 150px; padding: .4rem .6rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(16, 12, 60, .16); font-size: .8rem; pointer-events: none; }
.chart-switch { margin-top: .6rem; font-size: .85rem; font-weight: 600; color: var(--primary-dark); }
.subj-bars { display: grid; gap: .55rem; }
.subj-bar { display: grid; grid-template-columns: minmax(90px, 38%) minmax(0, 1fr) auto; align-items: center; gap: .6rem; font-size: .9rem; }
.subj-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.subj-track i { display: block; height: 12px; border-radius: 0 4px 4px 0; }
.subj-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.study-map { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(7, auto); gap: 3px; max-width: 340px; }
.map-cell { aspect-ratio: 1; border-radius: 3px; background: #eeedf5; }
.map-cell.l1 { background: #cfcdec; }
.map-cell.l2 { background: #a3a0dc; }
.map-cell.l3 { background: #7874c6; }
.map-cell.l4 { background: #4a459e; }
.map-cell.today { outline: 2px solid var(--text); outline-offset: 1px; }
.map-key { display: flex; align-items: center; gap: 3px; margin-top: .6rem; font-size: .78rem; }
.map-key .map-cell { width: 13px; }
.map-key span:first-child { margin-right: .2rem; }
.map-key span:last-child { margin-left: .2rem; }

/* ----- quizzes ----- */
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; }
.quiz-card { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; padding: .85rem 1rem; border-radius: 16px; border: 2px solid var(--line); border-top: 5px solid var(--c); background: #fff; text-decoration: none; color: var(--text); transition: transform .15s; }
.quiz-card:hover { transform: translateY(-3px); border-color: var(--c); }
.quiz-new { padding: .05rem .6rem; border-radius: 999px; background: var(--sun-soft); font-weight: 800; font-size: .82rem; }
.quiz-progress { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.quiz-q h2 { font-size: 1.3rem; }
.quiz-options { display: grid; gap: .5rem; margin-top: .8rem; }
.quiz-option { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .7rem .8rem; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.quiz-option:hover { border-color: var(--primary); }
.quiz-option.on { border-color: var(--primary); background: var(--primary-soft); }
.quiz-letter { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 800; }
.quiz-option.on .quiz-letter { background: var(--primary); color: #fff; }
.quiz-score { text-align: center; }
.quiz-score p { margin: .2rem 0; }
.score-big { font-family: var(--heading-font); font-size: 3.4rem; font-weight: 800; line-height: 1.1; color: var(--primary-dark); }
.quiz-score .btn { margin-top: .7rem; }
.quiz-review { margin: 0; padding-left: 1.3rem; display: grid; gap: .7rem; }
.quiz-review p { margin: .15rem 0; }
.quiz-review li.wrong > p:first-of-type { color: var(--bad); font-weight: 600; }
.q-list { display: grid; gap: .8rem; }
.q-block { display: grid; gap: .5rem; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; min-width: 0; }
.q-head { display: flex; justify-content: space-between; align-items: center; }
.q-num { font-weight: 700; }
.q-head .linkbtn { font-weight: 500; font-size: .85rem; color: var(--muted); }
.q-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem .6rem; }
.q-option { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.q-option input[type=radio] { flex: none; width: 18px; height: 18px; min-height: 0; accent-color: var(--ok); }
.q-analysis { margin: 0; padding-left: 1.3rem; display: grid; gap: .6rem; }
.qa-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }

/* ----- reports ----- */
.name-link { color: var(--text); font-weight: 600; text-decoration: none; }
.name-link:hover { color: var(--primary); text-decoration: underline; }
.cell-low { color: var(--bad); font-weight: 700; }
.missing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.missing-list li { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }

/* ----- teachers and the principal get a calm workspace, not the children's playground ----- */
html[data-band="staff"] { --primary: #3f3a8f; --primary-dark: #2e2a70; --primary-soft: #eeeef7; --bg: #f4f5f8; --text: #1c2033; --muted: #5a5f75; --line: #e1e3ec; --radius: 8px; --shadow: 0 1px 2px rgba(20, 22, 40, .05); --heading-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
html[data-band="staff"] body { background-image: none; font-size: 15px; }
html[data-band="staff"] h1 { color: var(--text); font-size: 1.45rem; font-weight: 650; }
html[data-band="staff"] h2 { color: var(--text); font-size: 1rem; font-weight: 650; }
html[data-band="staff"] .topbar { border-bottom: 1px solid var(--line); border-image: none; }
html[data-band="staff"] .brand { font-weight: 650; font-size: .95rem; color: var(--text); }
html[data-band="staff"] .brand:hover .logo { transform: none; }
html[data-band="staff"] .nav a { gap: .55rem; align-items: center; padding: .45rem .7rem; border-radius: 6px; font-weight: 500; }
html[data-band="staff"] .nav a.on { background: var(--primary-soft); color: var(--primary); }
.icon { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-band="staff"] .card, html[data-band="staff"] .tile, html[data-band="staff"] .q-block { border-width: 1px; }
html[data-band="staff"] .card { padding: 1rem 1.1rem; }
html[data-band="staff"] .tile { padding: .85rem 1rem; }
html[data-band="staff"] .tile b { font-size: 1.6rem; font-weight: 650; }
html[data-band="staff"] .tile b.small { font-size: 1rem; }
html[data-band="staff"] a.tile:hover, html[data-band="staff"] button.tile:hover, html[data-band="staff"] .subject-tile:hover, html[data-band="staff"] .arow:hover, html[data-band="staff"] .book:hover { transform: none; }
html[data-band="staff"] .tile.warn { background: #fff; border-color: var(--line); }
html[data-band="staff"] .tile.warn b { color: var(--bad); }
html[data-band="staff"] .tiles.classes .tile { border-top-width: 3px; }
html[data-band="staff"] .btn { border-width: 1px; border-radius: 6px; font-weight: 600; min-height: 38px; padding: .45rem .9rem; }
html[data-band="staff"] .btn.small { min-height: 30px; padding: .2rem .6rem; }
html[data-band="staff"] .btn.primary { box-shadow: none; }
html[data-band="staff"] .btn.primary:hover { background: var(--primary-dark); }
html[data-band="staff"] .btn:active:not(:disabled) { transform: none; }
html[data-band="staff"] input, html[data-band="staff"] select, html[data-band="staff"] textarea { border-width: 1px; border-color: #cdd0dc; border-radius: 6px; min-height: 38px; }
html[data-band="staff"] input[type=checkbox], html[data-band="staff"] input[type=radio] { min-height: 0; }
html[data-band="staff"] .segs { border-width: 1px; border-radius: 6px; padding: 2px; }
html[data-band="staff"] .seg { border-radius: 4px; font-weight: 600; }
html[data-band="staff"] .qrow { background: #fff; border-width: 1px; border-radius: 6px; }
html[data-band="staff"] .score { background: var(--primary-soft); color: var(--primary-dark); font-weight: 650; border-radius: 6px; }
html[data-band="staff"] .score.warn { background: var(--bad-soft); color: var(--bad); }
html[data-band="staff"] .arow { border-width: 1px; border-left-width: 4px; border-radius: 6px; }
html[data-band="staff"] .notice { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 6px; }
html[data-band="staff"] .notice p { font-weight: 500; }
html[data-band="staff"] .empty { border: 1px dashed #cdd0dc; border-radius: 8px; font-weight: 400; }
html[data-band="staff"] .empty > .art, html[data-band="staff"] .subject-emoji, html[data-band="staff"] .palette-icon:empty { display: none; }
html[data-band="staff"] .subject-tile, html[data-band="staff"] .book { background: #fff; border-width: 1px; border-radius: 8px; }
html[data-band="staff"] .cover { display: none; }
html[data-band="staff"] .table-wrap { border-radius: 8px; }
html[data-band="staff"] .quick-chip { border-width: 1px; border-radius: 6px; font-weight: 500; }
html[data-band="staff"] .detail-chat { border-top: 1px solid var(--line); }
html[data-band="staff"] .dialog { border-radius: 10px; animation: none; }
html[data-band="staff"] .toast { border-radius: 8px; animation: none; }
html[data-band="staff"] .lday { border-width: 1px; border-radius: 6px; }
html[data-band="staff"] .search-btn { border-width: 1px; border-radius: 6px; }
html[data-band="staff"] .classpill { border-radius: 6px; }

/* a fixed sidebar on anything wider than a tablet */
@media (min-width: 901px) {
  html[data-band="staff"] #app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
  html[data-band="staff"] .topbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .25rem; height: 100vh; padding: .9rem .7rem; background: #1b1e38; border: 0; }
  html[data-band="staff"] .brand { padding: 0 .35rem .8rem; color: #fff; font-size: .9rem; }
  html[data-band="staff"] .logo { width: 30px; height: 30px; padding: 2px; border-radius: 50%; background: #fff; }
  html[data-band="staff"] .nav { order: 0; flex: 1 1 auto; flex-direction: column; gap: 2px; overflow-y: auto; padding: 0; }
  html[data-band="staff"] .nav a { color: #c3c6da; }
  html[data-band="staff"] .nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  html[data-band="staff"] .nav a.on { background: rgba(255, 255, 255, .15); color: #fff; }
  html[data-band="staff"] .who { flex-direction: column; align-items: stretch; gap: .5rem; margin: 0; padding-top: .7rem; border-top: 1px solid rgba(255, 255, 255, .12); }
  html[data-band="staff"] .whoname { order: 1; padding: 0 .35rem; color: #fff; text-align: left; font-size: .9rem; }
  html[data-band="staff"] .whoname small { color: #a4a8c0; }
  html[data-band="staff"] .search-btn { order: 0; justify-content: flex-start; background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: #d6d8e6; }
  html[data-band="staff"] .search-btn kbd { margin-left: auto; background: rgba(255, 255, 255, .12); }
  html[data-band="staff"] .who .btn { order: 2; background: transparent; border-color: rgba(255, 255, 255, .22); color: #fff; }
  html[data-band="staff"] .who .btn:hover { background: rgba(255, 255, 255, .1); }
  html[data-band="staff"] .page { padding-top: 1.5rem; }
}

/* ----- the name: bold first word, joined script set a little lower ----- */
.wordmark { display: inline-flex; align-items: flex-start; gap: .28em; line-height: 1; white-space: nowrap; }
.wm-first { font-family: var(--heading-font); font-weight: 800; letter-spacing: .01em; }
/* stored with the site so the name looks the same on every device (licence: docs/FONT-LICENSE.txt) */
@font-face { font-family: "Dancing Script"; src: url("/fonts/dancing-script-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
.wm-rest { margin-top: .32em; font-family: "Dancing Script", "Snell Roundhand", "Segoe Script", cursive; font-size: 1.3em; font-weight: 700; line-height: .95; color: var(--primary); }
.topbar .wordmark { font-size: 1.1rem; padding-bottom: .3em; }
.login-card h1 .wordmark { font-size: 1.5rem; padding-bottom: .25em; }

/* ----- staff workspace: character without the playground ----- */
.who-text { display: flex; flex-direction: column; }
.tone-indigo { --t: #3f3a8f; --ts: #eeeef7; }
.tone-sky { --t: #0b6fb0; --ts: #e1f2fc; }
.tone-mint { --t: #0b7f60; --ts: #dff6ee; }
.tone-amber { --t: #a8650a; --ts: #fdf0d5; }
.tone-coral { --t: #c23d32; --ts: #fde8e5; }

.work-banner { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem 2rem; padding: 1.4rem 1.6rem; border-radius: 14px; background: linear-gradient(115deg, #232158, #3f3a8f 62%, #5a55b0); color: #fff; box-shadow: 0 8px 24px rgba(40, 36, 110, .22); }
.work-banner::before, .work-banner::after { content: ""; position: absolute; transform: rotate(45deg); background: conic-gradient(#ffc94a 0 25%, transparent 0 75%, #ff7a6b 0); opacity: .16; pointer-events: none; }
.work-banner::before { width: 190px; height: 190px; right: 26%; top: -96px; }
.work-banner::after { width: 110px; height: 110px; right: 8%; bottom: -44px; opacity: .12; }
.banner-text, .banner-actions { position: relative; z-index: 1; }
.banner-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.banner-eyebrow { margin: 0 0 .15rem; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #ffd98a; }
html[data-band="staff"] .work-banner h1 { margin: 0; color: #fff; font-size: 1.6rem; font-weight: 700; }
.banner-summary { margin: .25rem 0 0; color: #dcdcf2; }
html[data-band="staff"] .btn.accent { background: #ffc94a; border-color: #ffc94a; color: #2a2550; }
html[data-band="staff"] .btn.accent:hover { background: #ffd770; }
html[data-band="staff"] .btn.on-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .35); color: #fff; }
html[data-band="staff"] .btn.on-dark:hover { background: rgba(255, 255, 255, .2); }

html[data-band="staff"] .tile.stat { flex-direction: row; align-items: center; gap: .8rem; transition: border-color .15s, box-shadow .15s; }
html[data-band="staff"] a.tile.stat:hover { border-color: var(--t); box-shadow: 0 4px 14px rgba(20, 22, 40, .08); }
.stat-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 10px; background: var(--ts); color: var(--t); }
.tile .stat-icon { color: var(--t); }
.tile > .stat-body { color: var(--muted); }
.stat-icon .icon { width: 21px; height: 21px; }
.stat-icon.small { width: 32px; height: 32px; border-radius: 8px; }
.stat-icon.small .icon { width: 17px; height: 17px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; color: var(--muted); font-size: .88rem; }
.stat-body b { color: var(--text); line-height: 1.15; }

.attn-list { display: grid; gap: .4rem; }
.attn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .7rem; padding: .45rem .7rem .45rem .5rem; border-radius: 8px; background: var(--ts); color: var(--text); text-decoration: none; }
.attn-text { overflow-wrap: anywhere; }
.attn .stat-icon { background: #fff; }
.attn-go { display: flex; color: var(--t); transition: transform .15s; }
a.attn:hover .attn-go { transform: translateX(3px); }

.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.qrow.has-avatar { grid-template-columns: auto minmax(0, 1fr) auto; }
.qrow.has-avatar .avatar { grid-column: 1; grid-row: 1 / span 3; }
.qrow.has-avatar > strong, .qrow.has-avatar .qrow-text, .qrow.has-avatar .qrow-sub { grid-column: 2; }
.qrow.has-avatar .score { grid-column: 3; }
.person { display: inline-flex; align-items: center; gap: .55rem; }
.person .avatar { width: 28px; height: 28px; font-size: .66rem; }
.report-who { display: flex; align-items: center; gap: .8rem; }
.report-who .avatar { width: 52px; height: 52px; font-size: 1.05rem; }
.report-who h1 { margin: 0; }
.report-who p { margin: 0; }

.ring-sm { --p: 0; --r: #0b7f60; display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 50%; background: conic-gradient(var(--r) calc(var(--p) * 1%), #e9eaf2 0); }
.ring-sm.low { --r: #c23d32; }
.ring-sm span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; font-size: .74rem; font-weight: 700; color: var(--text); }
.tile .pulse { align-items: center; gap: .6rem; }
.pulse-side { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pulse-side small { color: var(--muted); font-size: .74rem; }
html[data-band="staff"] .tiles.classes .tile { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, white), #fff 70px); }

.meter { display: inline-flex; align-items: center; gap: .45rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.meter-track { width: 62px; height: 7px; border-radius: 99px; background: #e9eaf2; overflow: hidden; }
.meter-track i { display: block; height: 100%; border-radius: 99px; background: #0b7f60; }
.meter.low { color: var(--bad); }
.meter.low .meter-track i { background: #c23d32; }

html[data-band="staff"] .table th { background: #f1f1f9; color: var(--primary-dark); }
html[data-band="staff"] .table tbody tr:hover td { background: #fafaff; }
html[data-band="staff"] h2 { font-size: 1.04rem; }
html[data-band="staff"] .card { box-shadow: 0 1px 3px rgba(20, 22, 40, .06); }

@media (min-width: 901px) {
  html[data-band="staff"] .topbar { background: linear-gradient(180deg, #24225c, #17183a); }
  html[data-band="staff"] .wm-rest { color: #ffd98a; }
  html[data-band="staff"] .nav a.on { background: rgba(255, 255, 255, .13); box-shadow: inset 3px 0 0 #ffc94a; }
  html[data-band="staff"] .nav a.on .icon { color: #ffc94a; }
  html[data-band="staff"] .whoname { flex-direction: row; align-items: center; gap: .55rem; }
  html[data-band="staff"] .who .avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
}
@media (max-width: 900px) {
  html[data-band="staff"] .whoname { flex-direction: row; align-items: center; gap: .4rem; }
  html[data-band="staff"] .who .avatar { width: 28px; height: 28px; font-size: .66rem; }
}
@media (max-width: 720px) {
  .work-banner { padding: 1.1rem 1.2rem; }
  html[data-band="staff"] .work-banner h1 { font-size: 1.3rem; }
  .work-banner::before { right: -30px; }
  .work-banner::after { display: none; }
}
@media print {
  .work-banner { background: none; color: inherit; box-shadow: none; }
  .stat-icon { display: none; }
  .report-who .avatar { display: none; }
}

/* ----- the portal grows with the child ----- */
html[data-band="junior"] { font-size: 112.5%; }
html[data-band="junior"] .btn { min-height: 46px; }
html[data-band="junior"] .stop-mark { width: 56px; height: 56px; font-size: 1.6rem; }
html[data-band="junior"] .flight::before { top: 27px; }
html[data-band="junior"] .goal-explain { display: none; }
html[data-band="senior"] { --radius: 12px; --heading-font: system-ui, "Segoe UI", Roboto, sans-serif; --bg: #f5f5f9; }
html[data-band="senior"] .art .face, html[data-band="staff"] .art .face { display: none; }
html[data-band="senior"] .nav a { border-radius: 10px; }
html[data-band="senior"] .hero { min-height: 200px; border-radius: 16px; }
html[data-band="senior"] .btn, html[data-band="senior"] input, html[data-band="senior"] select, html[data-band="senior"] textarea { border-radius: 10px; }
html[data-band="senior"] .btn.primary { box-shadow: none; }
html[data-band="senior"] a.tile:hover, html[data-band="senior"] button.tile:hover, html[data-band="senior"] .subject-tile:hover { transform: none; }
html[data-band="senior"] .kite-sway, html[data-band="senior"] .stop.now .stop-mark { animation: none; }
html[data-band="senior"] .tile b { font-size: 1.6rem; }

/* ----- daily goal + streak ----- */
.goal-row { display: flex; align-items: center; gap: 1.1rem; }
.ring { --p: 0; flex: none; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--mint) calc(var(--p) * 1%), var(--primary-soft) 0); }
.ring-num { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; background: #fff; font-family: var(--heading-font); font-weight: 800; font-size: 1.1rem; color: var(--primary-dark); }
.goal-side { min-width: 0; }
.goal-note { margin: 0 0 .5rem; font-weight: 700; }
.goal-adjust { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; }
.streak { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; margin-top: 1rem; padding-top: .9rem; border-top: 2px dashed var(--line); }
.week-dots { display: flex; gap: .35rem; width: 100%; margin-top: .55rem; }
.dot { flex: 1; max-width: 42px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--muted); font-size: .8rem; font-weight: 700; }
.dot.on { background: linear-gradient(160deg, var(--sun), var(--coral)); color: #4a2600; }
.dot.today { outline: 3px solid var(--primary); outline-offset: 1px; }

/* ----- noticeboard ----- */
.notices { display: grid; gap: .6rem; }
.notice { padding: .7rem .9rem; border-radius: 14px; background: var(--sun-soft); border: 2px solid #ffe39f; }
.notice p { margin: 0 0 .25rem; font-weight: 600; overflow-wrap: anywhere; }
.notice-foot { display: flex; justify-content: space-between; gap: .6rem; font-size: .8rem; flex-wrap: wrap; }
.notice-remove { font-weight: 600; color: var(--muted); }
.notice-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem; margin-bottom: .8rem; }
.notice-form select { width: auto; }

/* ----- quick lists ----- */
.qlist { display: grid; gap: .45rem; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 .75rem; align-items: center; padding: .55rem .8rem; border-radius: 14px; background: #faf9ff; border: 2px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .15s; }
a.qrow:hover { border-color: var(--primary); }
.qrow > strong, .qrow-text, .qrow-sub { grid-column: 1; overflow-wrap: anywhere; }
.qrow-sub { font-size: .85rem; }
.score { grid-column: 2; grid-row: 1 / span 3; padding: .15rem .65rem; border-radius: 999px; background: var(--mint-soft); color: var(--ok); font-weight: 800; white-space: nowrap; }
.score.warn { background: var(--bad-soft); color: var(--bad); }
.keep-reading { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; padding: .8rem 1.1rem; border-radius: var(--radius); background: var(--sky-soft); border: 2px solid #bfe5fb; text-decoration: none; color: var(--text); transition: transform .15s; }
.keep-reading:hover { transform: translateY(-2px); }
.keep-reading small { display: block; color: #4d4970; }
.keep-emoji { font-size: 1.8rem; }
.keep-go { margin-left: auto; font-size: 1.3rem; color: var(--primary-dark); font-weight: 800; }

/* ----- badges ----- */
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: .7rem; }
.trophy { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .8rem .6rem; text-align: center; border-radius: 18px; background: var(--sun-soft); border: 2px solid #ffe39f; }
.trophy-emoji { font-size: 2.2rem; line-height: 1.2; }
.trophy small { color: #4d4970; line-height: 1.25; }
.trophy.locked { background: #f6f5fb; border-color: var(--line); }
.trophy.locked .trophy-emoji { filter: grayscale(1); opacity: .45; }
.trophy-count { font-weight: 700; margin-top: .15rem; }

/* ----- ask the teacher ----- */
.ask summary { font-family: var(--heading-font); font-weight: 700; font-size: 1.1rem; color: var(--primary-dark); cursor: pointer; }
.ask > p { margin: .5rem 0; }
.chat-list { display: flex; flex-direction: column; gap: .45rem; max-height: 300px; overflow-y: auto; margin-bottom: .6rem; }
.bubble { align-self: flex-start; max-width: 85%; padding: .45rem .8rem; border-radius: 16px 16px 16px 4px; background: var(--primary-soft); overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--primary); color: #fff; }
.bubble-who { display: block; font-weight: 700; color: var(--primary-dark); }
.bubble-time { display: block; font-size: .72rem; opacity: .75; }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.detail-chat { grid-column: 1 / -1; margin-top: .9rem; padding-top: .8rem; border-top: 2px dashed var(--line); }
.new-msg { color: var(--primary); font-weight: 800; font-size: .85rem; white-space: nowrap; }

/* ----- quick feedback when marking ----- */
.quick-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.quick-chip { border: 2px solid var(--line); background: #fff; color: var(--primary-dark); border-radius: 999px; padding: .15rem .6rem; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.quick-chip:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ----- confetti on submit ----- */
.confetti { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 90; }
.confetti i { position: absolute; top: -14px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .8; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ----- subjects & books ----- */
.subject-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin: 1rem 0; }
.subject-tile { display: flex; flex-direction: column; padding: .85rem 1rem; background: color-mix(in srgb, var(--c) 8%, white); border: 2px solid color-mix(in srgb, var(--c) 28%, white); border-radius: 18px; text-decoration: none; color: var(--text); transition: transform .15s; }
.subject-tile span { color: var(--muted); font-size: .88rem; }
.subject-tile .subject-emoji { font-size: 1.9rem; line-height: 1.25; }
.subject-tile:hover, .subject-tile.on { box-shadow: var(--shadow); border-color: var(--c); transform: translateY(-3px) rotate(-.6deg); }
.booklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.book { display: flex; gap: .8rem; align-items: center; padding: .7rem; border: 2px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--text); background: #fff; transition: transform .15s; }
.book:hover { border-color: var(--c); box-shadow: var(--shadow); transform: translateY(-2px); }
.cover { width: 50px; height: 66px; border-radius: 6px 12px 12px 6px; background: color-mix(in srgb, var(--c) 18%, white); border-left: 6px solid var(--c); font-size: 1.5rem; display: grid; place-items: center; flex: none; }
/* ---------- the book reader: an open book on a desk, not a document viewer ---------- */
body.reading { overflow: hidden; }
.rd { --desk: color-mix(in srgb, var(--c) 10%, #f5f2fb); --glow: color-mix(in srgb, var(--c) 26%, transparent); --bar: rgba(255, 255, 255, .86); --ink: #2a2550; --soft: #6d6890; --edge: rgba(42, 37, 80, .12); --paper: #fff; position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow: hidden; color: var(--ink); background: radial-gradient(900px 480px at 50% -8%, var(--glow), transparent 72%), var(--desk); font-family: inherit; transition: background-color .3s; }
.rd[data-theme="warm"] { --desk: #eadfc7; --glow: rgba(255, 214, 140, .5); --bar: rgba(255, 249, 235, .88); --ink: #40321f; --soft: #7b6a50; --edge: rgba(64, 50, 31, .16); --paper: #fbf3e0; }
.rd[data-theme="night"] { --desk: #12101d; --glow: color-mix(in srgb, var(--c) 30%, transparent); --bar: rgba(29, 26, 45, .9); --ink: #eeeafc; --soft: #aaa4c7; --edge: rgba(255, 255, 255, .13); --paper: #1b1828; }
.rd .icon { width: 19px; height: 19px; }

.rd-top { flex: none; display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; background: var(--bar); border-bottom: 1px solid var(--edge); backdrop-filter: blur(10px); }
.rd-back { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: var(--ink); }
.rd-back:hover { background: var(--edge); }
.rd-title { display: flex; align-items: center; gap: .6rem; min-width: 0; margin-right: auto; }
.rd-book-mark { display: grid; place-items: center; flex: none; width: 38px; height: 44px; border-radius: 4px 9px 9px 4px; background: var(--c); box-shadow: inset 5px 0 0 rgba(0, 0, 0, .18); font-size: 1.1rem; }
.rd-title h1 { margin: 0; overflow: hidden; color: var(--ink); font-size: 1.02rem; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.rd-title small { color: var(--soft); font-size: .78rem; }
.rd-title > div { min-width: 0; }
.rd-actions { display: flex; align-items: center; gap: .35rem; flex: none; }
.rd-head-btn { display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .75rem; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.rd-head-btn:hover { background: var(--edge); }
.rd-head-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--ink); }
.rd-head-btn[aria-pressed="true"] .icon { fill: var(--c); stroke: var(--c); }
.rd-head-btn:disabled { opacity: .4; cursor: default; }
.rd-themes { display: flex; gap: .3rem; margin: 0 .3rem; }
.rd-themes button { width: 26px; height: 26px; padding: 0; border: 2px solid var(--edge); border-radius: 50%; cursor: pointer; }
.rd-themes button[aria-pressed="true"] { outline: 2px solid var(--c); outline-offset: 2px; }
.rd-theme-day { background: #fff; }
.rd-theme-warm { background: #f3e3bd; }
.rd-theme-night { background: #1b1828; }
.rd-tool { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.rd-tool:hover:not(:disabled) { background: var(--edge); }
.rd-tool:disabled { opacity: .3; cursor: default; }
.rd-tool.primary { background: var(--c); color: #fff; }
.rd-tool.primary:hover:not(:disabled) { background: var(--c); filter: brightness(1.1); }

.rd-body { position: relative; flex: 1; display: flex; min-height: 0; }
.rd-stage { flex: 1; display: flex; min-width: 0; padding: 20px; overflow: auto; outline: 0; }
.rd-stage > .loading { margin: auto; color: var(--soft); }
.rd-stage > .reader { flex: 1; height: auto; border: 0; border-radius: 10px; background: #fff; }
.rd-spread { display: flex; margin: auto; }
.rtl-book .rd-spread { flex-direction: row-reverse; }
.rd-spread.turn-next { animation: rd-next .28s ease-out; }
.rd-spread.turn-prev { animation: rd-prev .28s ease-out; }
@keyframes rd-next { from { opacity: .35; transform: translateX(26px); } }
@keyframes rd-prev { from { opacity: .35; transform: translateX(-26px); } }

/* page edges stacked behind the page, so it reads as a real book */
.rd-page { position: relative; flex: none; isolation: isolate; background: var(--paper); border-radius: 3px 8px 8px 3px; box-shadow: 1px 0 0 var(--paper), 2px 1px 0 var(--edge), 3px 1px 0 var(--paper), 4px 2px 0 var(--edge), 0 18px 44px rgba(20, 14, 60, .24); }
.rd-page:first-child:not(:last-child) { border-radius: 8px 3px 3px 8px; box-shadow: -1px 0 0 var(--paper), -2px 1px 0 var(--edge), -3px 1px 0 var(--paper), -4px 2px 0 var(--edge), 0 18px 44px rgba(20, 14, 60, .24); }
.rd-page:first-child:not(:last-child)::after, .rd-page:last-child:not(:first-child)::after { content: ""; position: absolute; top: 0; bottom: 0; z-index: 2; width: 46px; pointer-events: none; }
.rd-page:first-child:not(:last-child)::after { right: 0; background: linear-gradient(to left, rgba(30, 20, 60, .2), transparent); }
.rd-page:last-child:not(:first-child)::after { left: 0; background: linear-gradient(to right, rgba(30, 20, 60, .2), transparent); }
.rd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
.rd[data-theme="warm"] .rd-canvas { filter: sepia(.28) brightness(.98); }
.rd[data-theme="night"] .rd-canvas { filter: invert(.9) hue-rotate(180deg); }

.rd-marks { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; mix-blend-mode: multiply; }
.rd[data-theme="night"] .rd-marks { mix-blend-mode: normal; opacity: .42; }
.rd-marks i { position: absolute; border-radius: 3px; }
.mark-yellow { background: #ffe83b; }
.mark-green { background: #7fee64; }
.mark-pink { background: #ff8ccf; }
.mark-blue { background: #6fd2ff; }

.rd-page .textLayer { --scale-round-x: 1px; --scale-round-y: 1px; position: absolute; inset: 0; z-index: 3; overflow: clip; line-height: 1; text-align: initial; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.rd-page .textLayer :is(span, br) { position: absolute; color: transparent; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; }
.rd-page .textLayer > :not(.markedContent), .rd-page .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; --scale-x: 1; --rotate: 0deg; font-size: calc(var(--text-scale-factor) * var(--font-height)); transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.rd-page .textLayer .markedContent { display: contents; }
.rd-page .textLayer ::selection { background: color-mix(in srgb, var(--c) 34%, transparent); color: transparent; }
.rd-page .textLayer br::selection { background: transparent; }
.rd-page .textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }
.rd-page .textLayer.selecting .endOfContent { top: 0; }

.rd-ribbon { position: absolute; top: -4px; right: 26px; z-index: 4; width: 30px; height: 54px; padding: 0; border: 0; background: var(--c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); opacity: 0; cursor: pointer; transition: opacity .15s, height .15s; }
.rd-page:hover .rd-ribbon { opacity: .28; }
.rd-ribbon:focus-visible { opacity: .6; }
.rd-ribbon.on, .rd-page:hover .rd-ribbon.on { height: 66px; opacity: 1; }

.rd-pens { position: fixed; z-index: 70; display: flex; align-items: center; gap: .4rem; padding: .4rem .5rem; border-radius: 99px; background: #241f3f; box-shadow: 0 10px 30px rgba(10, 6, 40, .4); animation: pop .12s ease-out; }
.rd-pens .rd-tool { width: 34px; height: 34px; color: #fff; }
.rd-pen { width: 34px; height: 34px; padding: 0; border: 3px solid transparent; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.rd-pen:hover { transform: scale(1.14); }
.rd-pen.on { border-color: #fff; }

.rd-hint { position: absolute; bottom: 92px; left: 50%; z-index: 5; margin: 0; padding: .35rem .8rem; border-radius: 99px; background: var(--bar); color: var(--soft); font-size: .8rem; transform: translateX(-50%); white-space: nowrap; }
.rd-dock { flex: none; display: flex; align-items: center; gap: .6rem; width: min(760px, calc(100% - 1.6rem)); margin: 0 auto .7rem; padding: .35rem .5rem; border: 1px solid var(--edge); border-radius: 99px; background: var(--bar); box-shadow: 0 10px 30px rgba(20, 14, 60, .16); backdrop-filter: blur(10px); }
.rd-track { position: relative; flex: 1; min-width: 60px; }
.rd-slider { display: block; width: 100%; min-height: 28px; padding: 0; border: 0; border-radius: 0; background: transparent; accent-color: var(--c); cursor: pointer; }
.rd-ticks { position: absolute; top: -1px; left: 8px; right: 8px; height: 0; pointer-events: none; }
.rd-ticks i { position: absolute; width: 6px; height: 9px; margin-left: -3px; background: var(--c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.rd-count { display: inline-flex; align-items: center; gap: .25rem; flex: none; margin: 0; color: var(--soft); font-size: .86rem; font-weight: 600; white-space: nowrap; }
.rd-page-input { width: 3.3rem; min-height: 32px; padding: .1rem .2rem; border: 1px solid var(--edge); border-radius: 8px; background: transparent; color: var(--ink); text-align: center; -moz-appearance: textfield; appearance: textfield; }
.rd-page-input::-webkit-inner-spin-button { display: none; }
.rd-zoom { display: inline-flex; align-items: center; flex: none; }
.rd-zoom .rd-tool { width: 32px; height: 32px; }
.rd-zoom-label { width: 2.6rem; color: var(--soft); font-size: .78rem; font-weight: 600; text-align: center; }

.rd-panel { flex: none; display: flex; flex-direction: column; width: 300px; background: var(--bar); border-right: 1px solid var(--edge); animation: rd-panel .18s ease-out; }
.rd-panel[hidden] { display: none; }
@keyframes rd-panel { from { opacity: 0; transform: translateX(-14px); } }
.rd-tabs { flex: none; display: flex; align-items: center; gap: .1rem; padding: .4rem .4rem 0; border-bottom: 1px solid var(--edge); }
.rd-tabs [role="tab"] { display: inline-flex; align-items: center; gap: .25rem; padding: .5rem .45rem; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--soft); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.rd-tabs [aria-selected="true"] { border-bottom-color: var(--c); color: var(--ink); }
.rd-tabs b { padding: 0 .35rem; border-radius: 99px; background: var(--edge); font-size: .72rem; }
.rd-tabs .rd-tool { width: 32px; height: 32px; margin-left: auto; }
.rd-panel-body { flex: 1; min-height: 0; padding: .7rem; overflow: auto; }
.rd-panel .empty { padding: 1.3rem .8rem; border: 2px dashed var(--edge); background: transparent; color: var(--soft); }
.rd-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.rd-thumb { position: relative; display: grid; gap: .2rem; padding: 0; border: 0; background: transparent; color: var(--soft); font: inherit; font-size: .76rem; cursor: pointer; }
.rd-thumb canvas { width: 100%; aspect-ratio: 3 / 4; height: auto; border-radius: 4px; background: #fff; box-shadow: 0 2px 8px rgba(20, 14, 60, .2); }
.rd-thumb canvas[height] { aspect-ratio: auto; }
.rd-thumb.on canvas { outline: 3px solid var(--c); outline-offset: 1px; }
.rd-thumb.saved::after { content: ""; position: absolute; top: -2px; right: 10px; width: 12px; height: 20px; background: var(--c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.rd-list { display: grid; gap: .25rem; }
.rd-row { display: flex; align-items: flex-start; gap: .2rem; border-radius: 10px; }
.rd-row:hover { background: var(--edge); }
.rd-row .rd-tool { width: 36px; height: 36px; color: var(--soft); }
.rd-row-main { flex: 1; display: flex; align-items: flex-start; gap: .55rem; min-width: 0; padding: .55rem; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: .88rem; text-align: left; cursor: pointer; }
.rd-row-main q { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.rd-row-main small { display: block; margin-top: .15rem; color: var(--soft); }
.rd-row-main .icon { fill: var(--c); stroke: var(--c); }
.rd-dot { flex: none; width: 14px; height: 14px; margin-top: .2rem; border-radius: 50%; }

html[data-band="staff"] .rd-tool, html[data-band="staff"] .rd-pen { border-radius: 8px; }
html[data-band="staff"] .rd-dock { border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .rd-spread.turn-next, .rd-spread.turn-prev, .rd-panel, .rd-pens { animation: none; } }
@media (max-width: 760px) {
  .rd-top { gap: .35rem; padding: .35rem .4rem; }
  .rd-book-mark, .rd-themes, .rd-head-btn span, .rd-actions > .rd-tool, .rd-track { display: none; }
  .rd-dock { justify-content: space-between; }
  .rd-title small { display: none; }
  .rd-title h1 { font-size: .92rem; }
  .rd-head-btn { padding: 0 .55rem; }
  .rd-timer, .rd-actions .timer { padding: .2rem .45rem; font-size: .76rem; }
  .rd-stage { padding: 10px; }
  .rd-panel { position: absolute; inset: auto 0 0; z-index: 8; width: 100%; height: 72%; border-top: 1px solid var(--edge); border-right: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 34px rgba(20, 14, 60, .28); background: var(--paper); }
  .rd-thumbs { grid-template-columns: repeat(3, 1fr); }
  .rd-hint { bottom: 72px; max-width: 90%; white-space: normal; text-align: center; }
  .rd-dock { width: calc(100% - .8rem); margin-bottom: max(.4rem, env(safe-area-inset-bottom)); gap: .3rem; }
  .rd-ribbon { opacity: .28; }
}
.reader { width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* ----- progress chart ----- */
.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: .35rem; align-items: end; height: 190px; padding-top: 1.4rem; }
.chart .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.chart .barv { width: 100%; max-width: 34px; background: linear-gradient(180deg, #b3aff0, #d9d6f7); border-radius: 10px 10px 0 0; min-height: 1px; }
.chart .col.today .barv { background: linear-gradient(180deg, var(--sun), var(--coral)); }
.chart .val { font-size: .68rem; color: var(--muted); position: absolute; top: -1.2rem; white-space: nowrap; }
.chart .lab { font-size: .75rem; color: var(--muted); margin-top: .25rem; }

/* ----- calendar ----- */
.cal-toolbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: .75rem 0; }
.cal-nav { display: flex; gap: .35rem; }
.cal-title { margin: 0; font-size: 1.2rem; min-width: 11rem; flex: 1; }
.cal-controls { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-left: auto; }
.cal-filter select { width: auto; min-width: 140px; }
.cal-grid.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: #fafbff; text-align: center; font-size: .8rem; font-weight: 700; color: var(--muted); padding: .4rem 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-cell { background: #fff; min-height: 112px; padding: .3rem; display: flex; flex-direction: column; gap: .2rem; cursor: pointer; min-width: 0; }
.cal-cell.other { background: #f6f7fb; color: #98a0b8; }
.cal-cell.today { background: #fffbe8; outline: 2px solid #f5c542; outline-offset: -2px; }
.cal-daynum { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: .85rem; }
.cal-count { background: var(--primary); color: #fff; border-radius: 99px; font-size: .7rem; padding: 0 .4rem; display: none; }
.cal-item { display: flex; gap: .3rem; align-items: baseline; padding: .12rem .35rem; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 10%, white); border-radius: 4px; font-size: .78rem; text-decoration: none; color: var(--text); min-width: 0; overflow: hidden; }
.cal-item:hover { background: color-mix(in srgb, var(--c) 22%, white); }
.cal-item .ci-time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.cal-item .ci-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal-item .ci-sub { display: none; }
.cal-item.submitted, .cal-item.reviewed, .cal-item.closed { opacity: .6; }
.cal-item.submitted .ci-title, .cal-item.reviewed .ci-title { text-decoration: line-through; }
.cal-item.overdue { background: var(--bad-soft); }
.cal-more { border: 0; background: none; color: var(--primary); font-weight: 700; font-size: .78rem; text-align: left; cursor: pointer; padding: 0 .3rem; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.cal-list { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; display: grid; gap: .4rem; align-content: start; min-height: 120px; }
.cal-list.today { outline: 2px solid #f5c542; background: #fffbe8; }
.cal-list-head { margin: 0; font-size: .9rem; }
.cal-none { font-size: .85rem; margin: 0; }
.cal-row { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; padding: .5rem .6rem; border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 8px; text-decoration: none; color: var(--text); background: #fff; flex-wrap: wrap; }
.cal-row:hover { box-shadow: var(--shadow); }
.cal-row.overdue { background: var(--bad-soft); }
.cal-row.submitted, .cal-row.reviewed, .cal-row.closed { opacity: .75; }
.cr-main { min-width: 0; flex: 1 1 140px; overflow-wrap: anywhere; }
.cr-sub { font-size: .8rem; margin-top: .2rem; }
.cal-dayview { max-width: 760px; }
.cal-dayview .cal-list { min-height: 0; }

/* ----- responsive ----- */
@media (max-width: 1320px) {
  .topbar { gap: .4rem .8rem; }
  .nav { order: 3; flex: 1 1 100%; padding-bottom: .2rem; }
}
@media (max-width: 900px) {
  .cal-week { grid-template-columns: 1fr; }
  .cal-cell { min-height: 74px; }
  .cal-item .ci-time, .cal-item .ci-title { display: none; }
  .cal-item { height: 8px; padding: 0; border-radius: 99px; border-left-width: 0; background: var(--c); }
  .cal-count { display: inline-block; }
  .cal-more { display: none; }
}
@media (max-width: 720px) {
  .tiles, .tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .notice-form { grid-template-columns: minmax(0, 1fr) auto; }
  .notice-form input { grid-column: 1 / -1; }
  .notice-form select { width: 100%; }
  .hero { padding: 150px 1.1rem 1.1rem; }
  .hero h1 { font-size: 1.6rem; }
  .sky-text { width: 100%; }
  .hero .sky-scene { top: 0; bottom: auto; width: 100%; height: 160px; }
  .flight { grid-auto-flow: row; gap: .3rem; }
  .flight::before { left: 23px; right: auto; top: 12px; bottom: 12px; border-top: 0; border-left: 3px dashed #d6d2f0; }
  .stop a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .7rem; padding: .15rem 0; text-align: left; justify-items: start; align-items: center; }
  .stop-mark { grid-row: 1 / span 2; margin: 0; }
  .search-label, .search-btn kbd { display: none; }
  .load-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .palette-wrap { padding-top: 4vh; }
  .hide-sm { display: none; }
  .bar-cell .bar { max-width: 60px; }
  .table th, .table td { padding: .5rem .55rem; }
  .detail { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .arow-side { align-items: flex-start; text-align: left; }
  .submitted-meter { align-items: flex-start; }
  .whoname small { display: none; }
  .cal-title { min-width: 100%; order: -1; }
  .cal-controls { margin-left: 0; }
  .page { padding-top: .9rem; }
}

/* phones: the student menu sits under the thumb */
@media (max-width: 720px) {
  html:not([data-band="staff"]) .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: .25rem .2rem calc(.25rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(63, 58, 143, .08); }
  html:not([data-band="staff"]) .nav a { flex-direction: column; align-items: center; gap: 0; padding: .2rem 0; border-radius: 12px; font-size: .68rem; }
  html:not([data-band="staff"]) .nav a > span { font-size: 1.15rem; line-height: 1.25; }
  html:not([data-band="staff"]) .nav a.on { background: var(--primary-soft); color: var(--primary-dark); }
  html:not([data-band="staff"]) main { padding-bottom: 74px; }
  html:not([data-band="staff"]) .toasts { bottom: 78px; }
  .bell-panel { position: fixed; top: 112px; left: .6rem; right: .6rem; width: auto; max-height: calc(100vh - 200px); }
  .score-row { grid-template-columns: minmax(0, 1fr) 3rem 6rem; }
  .score-row .score-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ----- printing logins ----- */
@media print {
  .topbar, main, .toasts, .dialog-head, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  body.print-report main { display: block !important; }
  html[data-band="staff"] body.print-report #app { display: block; }
  body.print-report .tile, body.print-report .card { box-shadow: none; break-inside: avoid; }
  .overlay { position: static; background: none; display: block; padding: 0; }
  .dialog { box-shadow: none; width: 100%; max-height: none; overflow: visible; }
  .dialog-body { padding: 0; }
}
