/* ClassCaudex — warm, calm, readable. Tokens first, components after. */
/* ClassCaudex: ink-violet on cool paper. Bricolage Grotesque (display), Figtree (text), JetBrains Mono (code). */
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/figtree-latin-wght-normal.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f0eef8;
  --surface-3: #e7e4f3;
  --border: #e3e0ef;
  --border-strong: #cbc7de;
  --text: #16142b;
  --text-2: #403d5c;
  --text-3: #75728f;
  --accent: #5b3df5;
  --accent-hover: #4a2ee0;
  --accent-soft: #ebe7ff;
  --accent-text: #ffffff;
  --green: #12805c; --green-soft: #dff5ec;
  --amber: #a85f00; --amber-soft: #fdf0d0;
  --red: #cf3150; --red-soft: #fde4e9;
  --blue: #2563d8; --blue-soft: #e0eaff;
  --shadow-sm: 0 1px 2px rgba(22,20,43,.06);
  --shadow: 0 4px 16px rgba(22,20,43,.08), 0 1px 3px rgba(22,20,43,.06);
  --shadow-lg: 0 18px 50px rgba(22,20,43,.20);
  --radius: 14px;
  --radius-sm: 8px;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --code-bg: #faf9fe;
  --nav-h: 62px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f0e1a;
  --surface: #181727;
  --surface-2: #1f1e32;
  --surface-3: #29273f;
  --border: #2d2b45;
  --border-strong: #46436a;
  --text: #f1efff;
  --text-2: #cfcbe8;
  --text-3: #9591b8;
  --accent: #8b78ff;
  --accent-hover: #a091ff;
  --accent-soft: #2a2456;
  --accent-text: #0f0e1a;
  --green: #5fd3a1; --green-soft: #14352a;
  --amber: #f0b43f; --amber-soft: #3a2f12;
  --red: #ff7a93; --red-soft: #42202b;
  --blue: #7aa5ff; --blue-soft: #1f2d52;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
  --code-bg: #141324;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e1a; --surface: #181727; --surface-2: #1f1e32; --surface-3: #29273f;
    --border: #2d2b45; --border-strong: #46436a;
    --text: #f1efff; --text-2: #cfcbe8; --text-3: #9591b8;
    --accent: #8b78ff; --accent-hover: #a091ff; --accent-soft: #2a2456; --accent-text: #0f0e1a;
    --green: #5fd3a1; --green-soft: #14352a; --amber: #f0b43f; --amber-soft: #3a2f12;
    --red: #ff7a93; --red-soft: #42202b; --blue: #7aa5ff; --blue-soft: #1f2d52;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35); --shadow: 0 4px 16px rgba(0,0,0,.4); --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
    --code-bg: #141324;
    color-scheme: dark;
  }
}

/* class colour themes (index stored on the class) */
.c0 { --c: #5b3df5; } .c1 { --c: #0f8a6d; } .c2 { --c: #2563d8; } .c3 { --c: #c4308a; }
.c4 { --c: #b8620f; } .c5 { --c: #0b8aa6; } .c6 { --c: #d03b4f; } .c7 { --c: #4a5470; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--sans); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--text-3); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: .6rem; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 1rem; }
.spacer { flex: 1; }

.boot { display: grid; place-items: center; height: 60vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- buttons / inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1.05rem; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer; font-weight: 550; font-size: .95rem;
  transition: background .12s, border-color .12s, transform .05s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { color: var(--red); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.sm { padding: .3rem .65rem; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: .8rem 1.4rem; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg, .icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn { width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 0; background: transparent; cursor: pointer; display: inline-grid; place-items: center; color: var(--text-2); }
.iconbtn:hover { background: var(--surface-3); }

label.field { display: block; margin-bottom: 1rem; font-weight: 550; font-size: .9rem; }
label.field > span { display: block; margin-bottom: .3rem; }
label.field small { font-weight: 400; color: var(--text-3); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: .62rem .8rem; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 5rem; line-height: 1.5; }
.err { color: var(--red); background: var(--red-soft); padding: .6rem .8rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; }
.note { background: var(--blue-soft); color: var(--text-2); padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; }
.ok { background: var(--green-soft); color: var(--text-2); padding: .7rem .9rem; border-radius: 10px; font-size: .9rem; margin-bottom: 1rem; }

/* ---- layout ---- */
.nav {
  position: sticky; top: 0; z-index: 30; height: var(--nav-h); display: flex; align-items: center; gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem); background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-size: 1.35rem; color: var(--text); text-decoration: none !important; letter-spacing: -.03em; }
.wordmark span { font-weight: 400; } .wordmark b { font-weight: 800; color: var(--accent); }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.logo .logo-svg { width: 100%; height: 100%; display: block; }
.navlinks { display: flex; gap: .25rem; }
.navlinks a { padding: .4rem .8rem; border-radius: 8px; color: var(--text-2); font-weight: 550; font-size: .95rem; }
.navlinks a:hover { background: var(--surface-3); text-decoration: none; }
.navlinks a.active { background: var(--surface-3); color: var(--text); }
.page { max-width: 1080px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem) 5rem; }
.page.narrow { max-width: 720px; }
.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card + .card { margin-top: 1rem; }
.section-title { font-family: var(--display); font-size: 1.25rem; margin: 2rem 0 .8rem; display: flex; align-items: center; gap: .6rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--text-3); }
.empty h3 { color: var(--text); }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 650; font-size: .8rem; flex: none; overflow: hidden; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; font-size: .65rem; }
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem; z-index: 60; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 0; background: none; border-radius: 8px; text-align: left; cursor: pointer; color: var(--text); font-size: .93rem; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-3); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.menu .who { padding: .5rem .7rem; }

/* ---- landing / auth ---- */
.hero { text-align: center; padding: clamp(3rem, 9vw, 6.5rem) 1rem 3rem; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--accent); background: linear-gradient(transparent 64%, var(--accent-soft) 0); padding: 0 .1em; }
.hero p.lead { font-size: 1.2rem; color: var(--text-2); max-width: 600px; margin: 0 auto 2rem; }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); max-width: 1000px; margin: 1rem auto 4rem; padding: 0 1rem; }
.feature { padding: 1.3rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature h3 { margin-bottom: .3rem; }
.feature p { margin: 0; color: var(--text-2); font-size: .95rem; }
.feature .fi { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: .8rem; }
.preview-code { max-width: 640px; margin: 2.5rem auto 0; text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.preview-code pre { margin: 0; padding: 1rem 1.2rem; font: .92rem/1.6 var(--mono); background: var(--code-bg); }
.preview-code .out { white-space: pre-wrap; padding: .8rem 1.2rem; border-top: 1px solid var(--border); font: .92rem var(--mono); color: var(--text-2); }
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.8rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-3); margin-bottom: 1.5rem; }
.oauth { display: grid; gap: .6rem; margin-bottom: 1.2rem; }
.oauth .btn { justify-content: center; gap: .7rem; }
.oauth svg { width: 18px; height: 18px; stroke: none; fill: currentColor; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--text-3); font-size: .85rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; background: var(--surface-3); padding: .25rem; border-radius: 12px; margin-bottom: 1rem; }
.seg button { border: 0; background: transparent; padding: .55rem; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--text-3); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.tiny-link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 550; }

/* ---- class cards ---- */
.class-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; color: var(--text); text-decoration: none !important; cursor: pointer; }
.class-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.class-card .banner { background: var(--c); color: #fff; padding: 1.1rem 1.2rem 1.6rem; min-height: 96px; position: relative; }
.class-card .banner h3 { color: #fff; margin: 0; font-size: 1.25rem; }
.class-card .banner .sec { opacity: .85; font-size: .9rem; }
.class-card .banner::after { content: ""; position: absolute; right: -20px; bottom: -34px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.14); }
.class-card .body { padding: .9rem 1.2rem 1.1rem; font-size: .9rem; color: var(--text-3); }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

.class-hero { background: var(--c); color: #fff; border-radius: var(--radius); padding: 1.6rem 1.8rem; margin-bottom: 1.2rem; position: relative; overflow: hidden; }
.class-hero h1 { color: #fff; margin: 0; }
.class-hero .sec { opacity: .9; }
.class-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tabs a { padding: .65rem 1rem; color: var(--text-3); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--c, var(--accent)); border-color: var(--c, var(--accent)); }
.code-pill { font: 700 1.1rem var(--mono); letter-spacing: .12em; background: rgba(255,255,255,.2); padding: .15rem .6rem; border-radius: 8px; cursor: pointer; border: 0; color: #fff; }

.two-col { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.post { padding: 1.1rem 1.25rem; }
.post .head { display: flex; gap: .7rem; align-items: center; margin-bottom: .6rem; }
.post .text { white-space: pre-wrap; word-break: break-word; }
.comments { border-top: 1px solid var(--border); margin-top: .9rem; padding-top: .7rem; display: grid; gap: .6rem; }
.comment { display: flex; gap: .6rem; font-size: .92rem; }
.comment .bubble { background: var(--surface-2); padding: .45rem .75rem; border-radius: 12px; min-width: 0; word-break: break-word; }

.list { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.list > .item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.list > .item:last-child { border-bottom: 0; }
.list > a.item:hover, .list > .item.click:hover { background: var(--surface-2); cursor: pointer; }
.list .ico { width: 38px; height: 38px; border-radius: 50%; background: var(--c, var(--accent)); color: #fff; display: grid; place-items: center; flex: none; }
.list .ico.mat { background: var(--surface-3); color: var(--text-2); }
.topic { font-family: var(--display); font-size: 1.4rem; border-bottom: 2px solid var(--c, var(--accent)); color: var(--c, var(--accent)); padding-bottom: .4rem; margin: 2rem 0 .8rem; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.t { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.t th, table.t td { padding: .65rem .9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t th { background: var(--surface-2); font-weight: 650; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: center; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t td a { font-weight: 550; }
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* ---- modal / toast ---- */
.overlay { position: fixed; inset: 0; background: rgba(20,20,19,.45); z-index: 100; display: grid; place-items: center; padding: 1rem; animation: fade .12s; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; padding: 1.6rem; max-height: 92vh; overflow-y: auto; animation: pop .15s; }
.modal.wide { max-width: 760px; }
.modal h2 { margin-bottom: 1rem; }
.modal .actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.4rem; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: .5rem; justify-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: .65rem 1.1rem; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .93rem; animation: pop .15s; pointer-events: auto; max-width: 90vw; }
.toast.error { background: var(--red); color: #fff; }

.md { word-break: break-word; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin-top: 1.2em; }
.md code { font: .88em var(--mono); background: var(--surface-3); padding: .12em .4em; border-radius: 5px; }
.md pre { background: var(--code-bg); border: 1px solid var(--border); padding: .8rem 1rem; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md img { max-width: 100%; border-radius: 8px; }
.md blockquote { margin: 1em 0; padding: .1em 1em; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md table { border-collapse: collapse; } .md th, .md td { border: 1px solid var(--border); padding: .35rem .7rem; }
.md ul, .md ol { padding-left: 1.5rem; }

@media (max-width: 640px) {
  .brand .wordmark { display: none; }
  .nav { gap: .5rem; padding: 0 .75rem; }
  .navlinks a { padding: .4rem .55rem; font-size: .86rem; }
  .page { padding-top: 1.2rem; }
  h1 { font-size: 1.6rem; }
}

/* ---- notebook thumbnails ---- */
.thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 12px; border: 1px solid var(--border); background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); }
.th-page { position: absolute; inset: 12% 11% 0; background: var(--surface); border-radius: 7px 7px 0 0; box-shadow: 0 1px 6px rgba(20,20,19,.12); padding: 9px 10px; display: grid; gap: 5px; align-content: start; font-size: 6.5px; line-height: 1.4; overflow: hidden; }
.th-h { font: 600 10px/1.25 var(--display); color: var(--text); margin-bottom: 1px; }
.th-p { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-code { margin: 0; background: var(--code-bg); border-left: 2px solid var(--accent); border-radius: 2px; padding: 3px 5px; font: 6.5px/1.45 var(--mono); color: var(--text-2); overflow: hidden; white-space: pre; }
.th-empty { color: var(--text-3); font-size: 8px; padding-top: 22%; text-align: center; }

/* ---- page transitions ---- */
.view-enter { animation: view-in .16s ease-out; }
@keyframes view-in { from { opacity: 0; } }
.skel { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- rubrics: one row per learning target, one column per level ---- */
.rb { container-type: inline-size; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.rb-row { display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); border-top: 1px solid var(--border); }
.rb-row:first-child { border-top: 0; }
.rb-target { padding: 18px 20px; background: var(--surface-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.rb-title { font: 500 1.08rem/1.3 var(--display); }
.rb-desc { color: var(--text-3); font-size: .86rem; line-height: 1.45; }
.rb-score { margin-top: auto; padding-top: 10px; color: var(--text-3); font-size: .9rem; }
.rb-score b { font: 500 1.7rem/1 var(--display); color: var(--accent); }
.rb-score.none { font-size: .82rem; font-weight: 600; }
.rb-meter { margin-top: 8px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rb-meter > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rb-body { min-width: 0; display: flex; flex-direction: column; }
.rb-levels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(124px, 1fr); flex: 1; overflow-x: auto; }
.rb-level { position: relative; text-align: left; border: 0; border-left: 1px solid var(--border); background: transparent; padding: 14px 16px 16px; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rb-level:first-child { border-left: 0; }
.rb-lh { display: flex; flex-direction: column-reverse; gap: 2px; }
.rb-ln { font-weight: 650; font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.rb-pts { font: 500 1.5rem/1 var(--display); color: var(--text); }
.rb-pts small { font: 600 .72rem var(--sans); color: var(--text-3); }
.rb-ld { font-size: .85rem; color: var(--text-2); line-height: 1.45; flex: 1; }
.rb-level.hit { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.rb-level.hit .rb-ln, .rb-level.hit .rb-pts { color: var(--accent); }
.rb-tick { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.rb-tick svg { width: 13px; height: 13px; stroke-width: 3; }
button.rb-level { cursor: pointer; transition: background .1s; }
button.rb-level:hover { background: var(--surface-2); }
button.rb-level.hit:hover { background: var(--accent-soft); }
button.rb-level:focus-visible { outline-offset: -3px; }
.rb-note { padding: 8px 18px; font-size: .82rem; color: var(--text-3); border-top: 1px solid var(--border); }
.rb-comment { display: flex; gap: 10px; align-items: flex-start; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: .9rem; color: var(--text-2); }
.rb-comment svg { flex: none; margin-top: 3px; color: var(--text-3); }
.rb-grade .rb-body > input { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: var(--surface-2); padding: .7rem 1.1rem; font-size: .9rem; }
.rb-grade .rb-body > input:focus { background: var(--surface); box-shadow: none; }
.rb-pointsbox { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: .9rem; }
.rb-custom { width: 76px; padding: .4rem .5rem; text-align: center; border-radius: 10px; font-weight: 700; }
.rb-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.rb-total .lbl { color: var(--text-3); font-size: .9rem; font-weight: 600; }
.rb-total b { font: 500 2rem/1 var(--display); color: var(--accent); }
.rb-total .of { color: var(--text-3); }
/* narrow containers (the notebook side panel, phones): target on top, levels as a list */
@container (max-width: 640px) {
  .rb-row { grid-template-columns: 1fr; }
  .rb-target { border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .rb-target .rb-title { flex: 1 1 100%; }
  .rb-score { margin-top: 0; padding-top: 0; }
  .rb-levels { grid-auto-flow: row; grid-template-columns: 1fr; grid-auto-columns: auto; overflow: visible; }
  .rb-level { border-left: 0; border-top: 1px solid var(--border); flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 16px; }
  .rb-level:first-child { border-top: 0; }
  .rb-lh { flex: none; width: 92px; flex-direction: column-reverse; }
  .rb-pts { font-size: 1.2rem; }
  .rb-tick { top: 10px; right: 12px; }
}

/* ---- class page bits ---- */
.skel-hero { min-height: 128px; background: var(--surface-3); }
.hero-foot { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; position: relative; z-index: 1; }
.class-hero { background: var(--c); }
.two-col.side-left { grid-template-columns: 250px minmax(0, 1fr); }
@media (max-width: 760px) { .two-col.side-left { grid-template-columns: 1fr; } }
.big-code { font: 700 1.7rem var(--mono); letter-spacing: .12em; color: var(--c); }
.upcoming { display: grid; gap: 1px; margin-bottom: .7rem; color: var(--text); font-weight: 550; }
.upcoming:hover { text-decoration: none; color: var(--c); }
.composer-inline textarea { border: 0; box-shadow: none !important; background: var(--surface-2); }
.post-asg { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none !important; padding: .6rem; margin: 0 -.6rem; border-radius: 12px; }
.post-asg:hover { background: var(--surface-2); }
.post-asg .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; }
.item-title { font-weight: 600; color: var(--text); }
.progress { display: flex; align-items: center; gap: .6rem; }
.bar { width: 76px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar.wide { width: 100%; height: 8px; margin-top: .4rem; }
.bar > span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 99px; transition: width .3s; }
.att.linkcard { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none !important; }
.att.linkcard:hover { background: var(--surface-2); }
.att .ai { width: 44px; height: 44px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; }
.att .t { font-weight: 650; } .att .m { color: var(--text-3); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .grow { min-width: 0; }

/* notebook cards */
.nb-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; color: inherit; text-decoration: none !important; transition: box-shadow .15s, transform .15s; }
.nb-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.nb-thumb { border: 0; border-radius: 0; border-bottom: 1px solid var(--border); aspect-ratio: 16 / 10; }
.nb-info { padding: .8rem 1rem 1rem; display: grid; gap: 2px; }
.nb-name { font: 500 1.1rem var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* rubrics library */
.rb-card { display: grid; gap: .7rem; align-content: start; }
.rb-card-title { text-align: left; flex: 1; border: 0; background: none; padding: 0; font: 500 1.2rem var(--display); color: var(--text); cursor: pointer; }
.rb-card-title:hover { color: var(--accent); }
.rb-card-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: .9rem; }
.rb-card-list li { display: flex; align-items: center; gap: 10px; padding: .55rem .8rem; border-top: 1px solid var(--border); }
.rb-card-list li:first-child { border-top: 0; }
.rb-card-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-card-list .lv { color: var(--text-3); font-size: .78rem; }
.rb-card-list b { font: 700 .8rem var(--mono); color: var(--accent); min-width: 1.6rem; text-align: right; }
.rb-card-list .more { color: var(--text-3); background: var(--surface-2); font-size: .82rem; }

/* student grades */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.stat .n { font: 500 2rem/1.1 var(--display); color: var(--c, var(--accent)); }
.stat .l { color: var(--text-3); font-size: .84rem; margin-top: 2px; }
.targets { display: grid; gap: 10px; }
.target, .grade-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.target > summary { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; cursor: pointer; list-style: none; }
.target > summary::-webkit-details-marker, .grade-item > summary::-webkit-details-marker { display: none; }
.target .tt { font-weight: 650; }
.target .pct { font: 500 1.4rem var(--display); color: var(--c, var(--accent)); min-width: 3.4rem; text-align: right; }
.target-rows { border-top: 1px solid var(--border); padding: .4rem 1.1rem .8rem; display: grid; gap: .5rem; }
.trow { display: flex; align-items: center; gap: .8rem; padding-top: .5rem; font-size: .92rem; }
.grade-item { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); }
.grade-item:last-child { border-bottom: 0; }
.grade-item > summary.item { list-style: none; cursor: pointer; }
.grade-item > summary.item:hover { background: var(--surface-2); }
.grade-detail { padding: .4rem 1.1rem 1.1rem; }
button.rb-level { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.rb-level .rb-ld { flex: 1; }

/* ---- custom controls (see controls.js) ---- */
.ctl { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 44px; padding: .55rem .9rem; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.ctl:hover { background: var(--surface-3); }
.ctl:focus-visible, .ctl[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; background: var(--surface); }
.ctl .ctl-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl .ctl-label.placeholder { color: var(--text-3); }
.ctl > svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.ctl[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.ctl.sm { min-height: 34px; padding: .3rem .8rem; font-size: .88rem; border-radius: 99px; width: auto; border-color: var(--border-strong); background: var(--surface); }
.ctl.on-surface { background: var(--surface-2); }
.ctl-pop { position: fixed; z-index: 180; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; overflow: auto; animation: ctl-in .12s ease-out; transform-origin: top; }
.ctl-pop.above { transform-origin: bottom; }
@keyframes ctl-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.ctl-list { outline: none; display: grid; gap: 1px; }
.ctl-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: .5rem .7rem; border-radius: 9px; cursor: pointer; font-size: .94rem; white-space: nowrap; }
.ctl-opt.act { background: var(--surface-3); }
.ctl-opt.sel { font-weight: 650; color: var(--accent); }
.ctl-opt svg { width: 15px; height: 15px; stroke-width: 3; }
.ctl-opt-main { display: grid; }
.ctl-opt small { color: var(--text-3); font-weight: 400; white-space: normal; }
.ctl-combo { position: relative; }
.ctl-combo .ctl-input { padding-right: 2.4rem; background: var(--surface-2); border-color: transparent; min-height: 44px; border-radius: 10px; }
.ctl-combo .ctl-input:focus { background: var(--surface); }
.ctl-combo-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; color: var(--text-3); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.ctl-combo-btn:hover { background: var(--surface-3); }
.ctl-combo-btn svg { width: 16px; height: 16px; }
/* calendar */
.cal { width: 288px; padding: 4px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.cal-title { font: 500 1.05rem var(--display); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 650; color: var(--text-3); padding: 4px 0; }
.cal-day { aspect-ratio: 1; border: 0; background: transparent; border-radius: 50%; font: inherit; font-size: .9rem; cursor: pointer; color: var(--text); display: grid; place-items: center; }
.cal-day:hover { background: var(--surface-3); }
.cal-day.out { color: var(--text-3); opacity: .55; }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.sel { background: var(--accent); color: var(--accent-text); font-weight: 700; opacity: 1; }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-foot { display: flex; justify-content: space-between; padding: 8px 2px 2px; border-top: 1px solid var(--border); margin-top: 8px; }
/* tooltips */
.ctl-tip { position: fixed; z-index: 400; max-width: 260px; background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.35; padding: .35rem .6rem; border-radius: 8px; pointer-events: none; box-shadow: var(--shadow); opacity: 0; transition: opacity .1s; }
.ctl-tip.on { opacity: 1; }
/* checkboxes and number inputs: our own look */
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; padding: 0; margin: 0; flex: none; border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; transition: background .1s, border-color .1s; }
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--accent-text); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: none; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }

.flip { transform: rotate(180deg); }

/* =====================================================================================
   Motion. One easing language everywhere; all of it switches off for reduced-motion users.
   ===================================================================================== */
:root { --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1); }

/* page enter: soft rise + fade */
.view-enter { animation: view-in .28s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
.page { animation: view-in .28s var(--ease) both; }
.view-enter .page { animation: none; }

/* staggered reveal for lists, grids and feeds */
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.reveal > * { animation: rise .42s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .04s; } .reveal > *:nth-child(3) { animation-delay: .08s; }
.reveal > *:nth-child(4) { animation-delay: .12s; } .reveal > *:nth-child(5) { animation-delay: .16s; }
.reveal > *:nth-child(6) { animation-delay: .2s; } .reveal > *:nth-child(7) { animation-delay: .24s; }
.reveal > *:nth-child(8) { animation-delay: .28s; } .reveal > *:nth-child(n+9) { animation-delay: .32s; }

/* leaving */
.leaving { pointer-events: none; }
.overlay.leaving, .pk-overlay.leaving { animation: fade-out .16s ease-in forwards; }
.overlay.leaving .modal, .pk-overlay.leaving .pk { animation: pop-out .16s ease-in forwards; }
.composer.leaving { animation: cmp-out .2s ease-in forwards; }
.toast.leaving { animation: toast-out .18s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes cmp-out { to { opacity: 0; transform: translateY(24px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.96); } }
.toast { animation: toast-in .32s var(--spring); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.94); } }
.modal { animation: pop .26s var(--spring); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* menus */
.menu { transform-origin: top right; animation: menu-in .16s var(--ease); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } }

/* sliding indicators (navbar + class tabs) */
.navlinks { position: relative; }
.nav-ind { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: var(--accent-soft); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), width .35s var(--ease), opacity .2s; }
.nav-ind.no-anim, .tab-ind.no-anim { transition: none; }
.navlinks a { position: relative; z-index: 1; transition: color .2s; }
.navlinks a.active { background: transparent; color: var(--accent); }
.navlinks a:hover { background: transparent; color: var(--text); }
.navlinks a.active:hover { color: var(--accent); }
.tabs { position: relative; }
.tabs a { transition: color .2s; border-bottom-color: transparent !important; }
.tab-ind { position: absolute; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--c, var(--accent)); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), width .35s var(--ease), opacity .2s; }

/* press + hover feel */
.btn { transition: background .15s, border-color .15s, color .15s, transform .12s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { box-shadow: var(--shadow-sm); }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn.primary:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 38%, transparent); transform: translateY(-1px); }
.btn.primary:active { transform: scale(.97); }
.iconbtn { transition: background .15s, transform .12s var(--ease); }
.iconbtn:active { transform: scale(.9); }
.card { transition: box-shadow .25s var(--ease), border-color .2s, transform .25s var(--ease); }
.list > a.item, .list > .item.click { transition: background .15s, padding-left .2s var(--ease); }
.list > a.item:hover { padding-left: 1.35rem; }
.chip { transition: background .2s, color .2s; }
.avatar { transition: transform .2s var(--spring); }
a:hover > .avatar, .row:hover > .avatar { transform: scale(1.06); }
.class-card .banner::after { transition: transform .5s var(--ease); }
.class-card:hover .banner::after { transform: scale(1.25) translate(-6px, -6px); }

/* theme switch: cross-fade colours instead of snapping */
html.theming, html.theming *, html.theming *::before, html.theming *::after { transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease, fill .3s ease, stroke .3s ease !important; }

/* landing hero entrance */
.hero > h1 { animation: rise .6s var(--ease) both; }
.hero > p.lead { animation: rise .6s .08s var(--ease) both; }
.hero > .row { animation: rise .6s .16s var(--ease) both; }
.hero > .preview-code { animation: rise .7s .26s var(--ease) both; }
.features .feature { animation: rise .6s var(--ease) both; }
.features .feature:nth-child(2) { animation-delay: .06s; } .features .feature:nth-child(3) { animation-delay: .12s; } .features .feature:nth-child(4) { animation-delay: .18s; }
.feature { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.auth-card { animation: rise .5s var(--ease) both; }

/* progress bars + meters fill smoothly */
.bar > span, .rb-meter > span { transition: width .6s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .reveal > *, .view-enter, .page, .hero > *, .features .feature, .auth-card, .toast, .modal, .menu { animation: none !important; }
  .nav-ind, .tab-ind { transition: none !important; }
}

/* switch */
.ctl-switch { position: relative; width: 44px; height: 26px; flex: none; border: 0; border-radius: 99px; background: var(--border-strong); cursor: pointer; padding: 0; transition: background .2s; }
.ctl-switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); transition: transform .25s var(--spring, cubic-bezier(.34,1.56,.64,1)); }
.ctl-switch[aria-checked="true"] { background: var(--accent); }
.ctl-switch[aria-checked="true"] .knob { transform: translateX(18px); }
.ctl-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* menus now live in the shared popover layer */
.ctl-pop.ctl-menu { padding: 4px; border-radius: 14px; }
.ctl-pop .menu { position: static; min-width: 0; border: 0; box-shadow: none; background: transparent; padding: 0; animation: none; }
.ctl-pop .menu button { white-space: nowrap; }
.ctl-pop .menu button.danger { color: var(--red); }
.ctl-pop .menu button:focus-visible { background: var(--surface-3); outline: none; }

/* ---- schools + admin ---- */
.school-wrap { align-items: start; padding-top: clamp(1.5rem, 6vh, 4rem); }
.school-card.auth-card { max-width: 580px; padding: 2rem; }
.school-card h1 { text-align: left; margin-bottom: .2rem; }
.school-card .sub { text-align: left; margin-bottom: 1.2rem; }
.school-step { display: inline-flex; padding: .25rem .8rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; margin-bottom: .8rem; }
.ss-box { display: flex; align-items: center; gap: .6rem; background: var(--surface-2); border: 1px solid transparent; border-radius: 12px; padding: 0 .9rem; transition: border-color .12s, box-shadow .12s, background .12s; }
.ss-box:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ss-box svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
input.ss-input { border: 0; background: transparent; box-shadow: none !important; outline: none; padding: .85rem 0; font-size: 1.02rem; min-width: 0; flex: 1; }
.ss-label { margin: .9rem 2px .4rem; font: 700 .74rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); min-height: 1em; }
.ss-results { max-height: 340px; overflow-y: auto; display: grid; gap: 2px; border: 1px solid var(--border); border-radius: 14px; padding: 4px; background: var(--surface); }
.ss-row { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .65rem .7rem; border: 0; background: transparent; border-radius: 10px; cursor: pointer; font: inherit; color: inherit; }
.ss-row.act, .ss-row:hover { background: var(--surface-2); }
.ss-row.sel { background: var(--accent-soft); }
.ss-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ss-main { flex: 1; min-width: 0; display: grid; }
.ss-name { font-weight: 650; line-height: 1.3; }
.ss-place { color: var(--text-3); font-size: .86rem; }
.ss-row .ss-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-empty { padding: 1.6rem 1rem; text-align: center; color: var(--text-2); }
.ss-empty p { margin: .2rem 0 .9rem; color: var(--text-3); font-size: .92rem; }
.ss-add { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; margin-top: .9rem; padding: .8rem; border: 2px dashed var(--border-strong); border-radius: 12px; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.ss-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.school-wait { display: flex; gap: .8rem; align-items: flex-start; }
.school-wait > svg { margin-top: 3px; flex: none; }
.school-pick { display: flex; align-items: center; gap: .8rem; padding: .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin: .6rem 0; }
.school-done { width: 60px; height: 60px; border-radius: 18px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 1rem; }
.school-done svg { width: 28px; height: 28px; stroke-width: 3; }
.school-card .school-done + h1 { text-align: center; } .school-card .school-done ~ .sub { text-align: center; }
.seg3 { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; margin-bottom: 1.2rem; }
.seg3 button { border: 0; background: transparent; padding: .5rem 1.1rem; border-radius: 9px; font-weight: 650; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; transition: background .15s, color .15s; }
.seg3 button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.badge { background: var(--amber); color: #fff; border-radius: 99px; font-size: .72rem; min-width: 1.4rem; text-align: center; padding: 0 .4rem; font-weight: 700; }
.req-school { margin-top: 1rem; padding: .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.req-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: .6rem; }
.req-fields input { background: var(--surface); }
.req-note { margin: .8rem 0 0; padding: .5rem .9rem; border-left: 3px solid var(--border-strong); color: var(--text-2); font-style: italic; }
@media (max-width: 720px) { .req-fields { grid-template-columns: 1fr; } }

.setting-row { display: flex; align-items: center; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--border); }
.setting-title { font-weight: 650; }
