:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --ink: #16202a;
  --muted: #5a6772;
  --line: #ddd8cc;
  --accent: #2b5d7c;
  --accent-soft: #e3edf3;
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
    --bg: #12171c; --surface: #1b232b; --ink: #e8edf0; --muted: #9aa8b2; --line: #2c3842;
    --accent: #7fb6d6; --accent-soft: #1f3140;
  }
}
:root[data-theme="dark"] {
    --bg: #12171c; --surface: #1b232b; --ink: #e8edf0; --muted: #9aa8b2; --line: #2c3842;
    --accent: #7fb6d6; --accent-soft: #1f3140;
  }
[data-accent="teal"]   { --accent: #1f7a80; --accent-soft: #dcefef; }
[data-accent="amber"]  { --accent: #b3660d; --accent-soft: #f7e8d2; }
[data-accent="indigo"] { --accent: #3f4fb0; --accent-soft: #e4e7f8; }
[data-accent="plum"]   { --accent: #8a2f5b; --accent-soft: #f4e2ec; }
[data-accent="green"]  { --accent: #2a7a47; --accent-soft: #dcefe3; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) [data-accent="teal"] { --accent: #5cc4ca; --accent-soft: #17393b; }
:root:not([data-theme="light"]) [data-accent="amber"] { --accent: #e8a457; --accent-soft: #3b2b15; }
:root:not([data-theme="light"]) [data-accent="indigo"] { --accent: #8f9cf0; --accent-soft: #232946; }
:root:not([data-theme="light"]) [data-accent="plum"] { --accent: #e08ab5; --accent-soft: #3b1f2f; }
:root:not([data-theme="light"]) [data-accent="green"] { --accent: #6fcf93; --accent-soft: #17301f; }
}
:root[data-theme="dark"] [data-accent="teal"] { --accent: #5cc4ca; --accent-soft: #17393b; }
:root[data-theme="dark"] [data-accent="green"] { --accent: #6fcf93; --accent-soft: #17301f; }
:root[data-theme="dark"] [data-accent="amber"] { --accent: #e8a457; --accent-soft: #3b2b15; }
:root[data-theme="dark"] [data-accent="indigo"] { --accent: #8f9cf0; --accent-soft: #232946; }
:root[data-theme="dark"] [data-accent="plum"] { --accent: #e08ab5; --accent-soft: #3b1f2f; }

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: inherit; }
h1, h2 { font-family: var(--serif); line-height: 1.15; margin: 0; text-wrap: balance; }

/* header */
header.site { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { max-width: 1100px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.05rem var(--serif); margin-right: auto; }
.mark { width: 34px; height: 34px; border-radius: 9px; display: block; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a { text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; color: var(--muted); }
nav.main a:hover { color: var(--ink); background: var(--accent-soft); }
nav.main a.on { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.menu { display: none; font: 600 .9rem var(--sans); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
@media (max-width: 760px) {
  .menu { display: block; }
  nav.main { display: none; width: 100%; flex-direction: column; padding-bottom: 6px; }
  nav.main.open { display: flex; }
}

main { max-width: 1100px; margin: 0 auto; padding: 28px 20px 64px; min-height: 70vh; }
footer.site { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .85rem; padding: 18px; }
footer.site p { margin: 0; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { text-decoration: none; color: var(--accent); }
.crumbs a:hover { text-decoration: underline; }
.crumbs i { font-style: normal; opacity: .5; }

/* hero */
.hero { padding: 24px 0 28px; }
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.2rem); letter-spacing: -.02em; max-width: 18ch; }
.hero.small h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); max-width: 30ch; }
.hero .lead { color: var(--muted); font-size: 1.1rem; max-width: 60ch; margin: 12px 0 0; }
.hero.small { padding: 4px 0 22px; }
.kicker { font: 700 .75rem var(--sans); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); margin: 0 0 10px; }
.stat { display: inline-block; margin: 18px 0 0; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; }

/* grids and cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.arts { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid.more { margin-top: 6px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
a.card:focus-visible, nav.main a:focus-visible, .brand:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card .num { font: 700 1.9rem/1 var(--serif); color: var(--accent); }
.card .t { font: 700 1.1rem/1.25 var(--serif); }
.card .sub { color: var(--muted); font-size: .9rem; }
.card .count { margin-top: auto; padding-top: 8px; font-size: .78rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.card .count.zero, .card .go { color: var(--muted); }
.card .go { margin-top: auto; padding-top: 8px; font-weight: 700; font-size: .9rem; color: var(--accent); }
.card .tag { align-self: flex-start; font: 700 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
.card.empty { border-top-color: var(--line); background: transparent; }
.card.empty .num, .card.empty .t { color: var(--muted); }
.card.slim { border-top-width: 1px; border-left: 4px solid var(--accent); }
.card.course { min-height: 190px; }
.card.course .num { font-size: 1.5rem; }

.group { font: 700 .82rem var(--sans); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 26px 0 12px; }
.group:first-of-type { margin-top: 4px; }

.placeholder { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; max-width: 640px; color: var(--muted); }
.placeholder h2 { color: var(--ink); font-size: 1.3rem; margin-bottom: 8px; }
.placeholder p { margin: 0; }
.placeholder ul { margin: 0 0 14px; padding-left: 1.2em; }
.placeholder li { margin-bottom: 6px; }

/* done buttons */
.card .foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .foot .go { margin: 0; padding: 0; }
.card a.t { color: inherit; text-decoration: none; }
.card a.t:hover { text-decoration: underline; }
button.done { font: 700 .8rem var(--sans); padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
button.done.is-done { background: var(--accent); color: var(--surface); }
button.done[hidden] { display: none; }

/* profile */
.auth-card { max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.auth-card h2 { font-size: 1.3rem; margin-bottom: 10px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { font: 600 .88rem var(--sans); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.on { color: var(--ink); background: var(--accent-soft); border-color: var(--accent); }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 12px; }
input[type=email], input[type=password], input:not([type]), input[type=text], textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: 400 1rem var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.btn { font: 700 .95rem var(--sans); padding: 10px 18px; border-radius: 9px; border: 0; background: var(--accent); color: var(--surface); cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.mini { font: 600 .78rem var(--sans); padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.mini.danger { color: #b3372f; }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0; }
.msg { margin: 10px 0 0; font-size: .9rem; font-weight: 600; }
.msg.ok { color: #1f7a4d; } .msg.err { color: #b3372f; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .msg.ok { color: #6ccb9b; }
:root:not([data-theme="light"]) .msg.err, :root:not([data-theme="light"]) .mini.danger { color: #f0857d; }
}
:root[data-theme="dark"] .msg.ok { color: #6ccb9b; }
:root[data-theme="dark"] .msg.err, :root[data-theme="dark"] .mini.danger { color: #f0857d; }

.idcard { padding: 6px 0 20px; }
.idcard h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.idcard .email { color: var(--muted); margin: 4px 0 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { text-decoration: none; font: 700 .85rem var(--sans); padding: 6px 14px; border-radius: 999px; background: var(--accent); color: var(--surface); }
.pill:hover { filter: brightness(1.1); }
.block { border-top-width: 1px; border-top-color: var(--line); margin-bottom: 14px; }
.block[data-accent] { border-top: 4px solid var(--accent); }
.block h3 { font: 700 1.05rem var(--serif); margin: 0; }
.block h3 a { text-decoration: none; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.big { font: 700 2rem/1 var(--serif); color: var(--accent); }
.bar2 { height: 10px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 10px 0 6px; }
.bar2 i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.lnk { color: var(--accent); font-weight: 700; }
.dash { margin-bottom: 0; } .dash .block { height: 100%; }
ul.plain { list-style: none; padding: 0; margin: 8px 0 0; } ul.plain li { padding: 4px 0; }
.mapgroup h4 { font: 700 .75rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.tiles { display: flex; flex-wrap: wrap; gap: 5px; }
.tile { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 7px; font: 700 .75rem var(--sans); text-decoration: none; border: 1.5px solid var(--accent); color: var(--accent); }
.tile.full { background: var(--accent); color: var(--surface); }
.tile.part { background: var(--accent-soft); box-shadow: inset 0 -5px 0 var(--accent); }
.tile.empty { border-color: var(--line); color: var(--muted); border-style: dashed; }
form.inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.inline label { margin: 0; flex: 1 1 180px; }
form.inline .msg { flex-basis: 100%; }
.chks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.chk { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; }
details summary { cursor: pointer; } details summary h3 { display: inline; }
.tablewrap { overflow-x: auto; margin-top: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font: 700 .72rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tbl th, .tbl td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .pill { font-size: .72rem; padding: 3px 9px; }
.tbl .acts { white-space: nowrap; } .tbl .acts .mini { margin-right: 4px; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); max-width: 420px; width: 92%; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
[hidden] { display: none !important; }

.pill.pending { background: transparent; color: var(--accent); border: 1.5px dashed var(--accent); }
.pill .x { background: none; border: 0; color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 0 0 4px; }
.block.attn { border-color: var(--accent); }
.mini.ok { color: #1f7a4d; border-color: #1f7a4d; }
.card .row.row { align-items: center; }
.admintabs { margin: 4px 0 16px; }
.tabpanel[hidden] { display: none; }
details.cls summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; cursor: pointer; }
details.cls[open] summary { margin-bottom: 8px; }
details.cls .tablewrap { margin-top: 4px; }
.clsrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; }
.clsrow b { min-width: 42px; }
.subj h4 { font: 700 .8rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 4px; }

.theme { font: 600 1rem var(--sans); width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.theme:hover { background: var(--accent-soft); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* assessments */
.q .qtext { font-weight: 600; margin: 8px 0 10px; }
.q .opts { display: grid; gap: 6px; }
.opt { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.opt:hover { background: var(--accent-soft); }
.q .ans { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.q.good { border-left: 5px solid #1f7a4d; } .q.part { border-left: 5px solid #b7791f; } .q.bad { border-left: 5px solid #c0392b; }
.q .score { font-weight: 700; } .q.good .score { color: #1f7a4d; } .q.part .score { color: #b7791f; } .q.bad .score { color: #c0392b; }
.q .fb { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--accent-soft); }
.result.pass { border-color: #1f7a4d; } .result.fail { border-color: #b7791f; }
.pill.soft { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--line); }
.attempt summary { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
dialog.wide { max-width: 860px; width: 94%; max-height: 90vh; overflow: auto; }
.lessonrow { padding: 10px 0; border-bottom: 1px solid var(--line); }
.lessonrow .row { gap: 10px; flex-wrap: wrap; }
.ok-txt { color: #1f7a4d; font-weight: 700; } .no-txt { color: var(--muted); }
a.btn { text-decoration: none; display: inline-block; }
.q .score { display: inline-flex; align-items: center; gap: 6px; }
.ico.ok circle { fill: #1f7a4d; } .ico.no circle { fill: #c0392b; } .ico.part circle { fill: #b7791f; }
pre.code { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font: .82rem/1.45 ui-monospace, Menlo, monospace; margin: 0 0 10px; white-space: pre; }
.q .score { flex-direction: column; gap: 2px; }
.q .score small { font: 700 .75rem var(--sans); white-space: nowrap; }
.q .ico { width: 30px; height: 30px; }
nav.main .bell { display: inline-flex; align-items: center; gap: 4px; position: relative; color: var(--muted); text-decoration: none; padding: 6px 8px; }
nav.main .bell b { font: 700 .7rem var(--sans); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #c0392b; color: #fff; display: grid; place-items: center; }
nav.main .bell b:empty { display: none; }
nav.main .bell.has { color: var(--ink); }

/* admin role controls */
.card .adm { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.card .adm .restore { display: none; }
[data-p="del"] .adm .restore { display: inline-block; }
[data-p="del"] .adm .roletog, [data-p="del"] .adm .roledel { display: none; }
details.pwgrp { border-top: 1px solid var(--line); padding: 12px 0; }

/* landing page */
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 22px 0 0; }
.free { display: inline-block; font: 800 .8rem var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 5px 12px; border-radius: 999px; background: #1f7a4d; color: #fff; }
.sec { margin-top: 48px; }
.sec h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); margin-bottom: 8px; }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 18px; }
.card.syl .code { font: 700 .8rem var(--sans); color: var(--muted); letter-spacing: .04em; }
.card.syl h3 { margin: 0; }
.tabsum { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.tabsum li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.tabsum b { font: 700 1rem var(--serif); color: var(--accent); }
.tabsum span { color: var(--muted); font-size: .9rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--surface); display: grid; place-items: center; font: 700 1rem var(--serif); }
.steps p { margin: 2px 0 0; color: var(--muted); }
.free-card { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid #1f7a4d; border-radius: var(--radius); padding: 24px; max-width: 640px; }
.free-card h2 { margin: 12px 0 8px; }
.joinform { display: grid; gap: 12px; }
.joinform label { margin: 0; }
.joinform select { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: 400 1rem var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.joinform fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 2px; margin: 0; }
.joinform legend { font: 700 .88rem var(--sans); padding: 0 6px; }
.joinform .consent { font-weight: 500; font-size: .88rem; align-items: flex-start; }
.joinform .btn { justify-self: start; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.faq summary { font-weight: 700; }
.faq details p { margin: 8px 0 2px; color: var(--muted); }
.mine .hint { margin-top: 12px; }
