/* Ilimi: mobile-first, light on data. The institution's colour comes from settings (--brand). */
:root { --brand: #0b6e4f; --brand-ink: #fff; --bg: #f6f7f5; --panel: #fff; --ink: #1c211f; --muted: #5d6763; --line: #dfe3e0; --soft: #eef1ef;
  --ok: #1e7b45; --warn: #a15c00; --bad: #b3261e; --focus: color-mix(in srgb, var(--brand) 35%, transparent); --r: 12px; }
@media (prefers-color-scheme: dark) { :root { --bg: #121614; --panel: #1b201e; --ink: #e8ece9; --muted: #a2aca7; --line: #2e3531; --soft: #232a27; --ok: #5cc98a; --warn: #f0a646; --bad: #ff8a80; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
a { color: var(--brand); } @media (prefers-color-scheme: dark) { a { color: color-mix(in srgb, var(--brand) 55%, #fff); } }
h1 { font-size: 22px; line-height: 1.25; margin: 4px 0 6px; } h2 { font-size: 17px; margin: 22px 0 8px; } h3 { font-size: 15.5px; margin: 14px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .pad { padding: 16px; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--brand); color: var(--brand-ink); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; flex: 1; }
.brand b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .brand small { display: block; font-size: 11.5px; opacity: .85; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.18) center/cover no-repeat; flex: none; display: grid; place-items: center; font-weight: 700; }
.net { font-size: 12px; background: rgba(0,0,0,.25); padding: 3px 9px; border-radius: 99px; }
.ob { font-size: 12px; background: #fff; color: var(--brand); padding: 3px 9px; border-radius: 99px; font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; outline: none; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11.5px; color: var(--muted); text-decoration: none; min-height: 54px; }
.bottom svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom a.on { color: var(--brand); font-weight: 650; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 8px 0; }
a.card { display: block; color: inherit; text-decoration: none; } a.card:hover { border-color: var(--brand); }
.card .code { font-size: 12px; font-weight: 700; color: var(--brand); letter-spacing: .03em; }
.row { display: flex; align-items: center; gap: 10px; } .row > .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.list { list-style: none; margin: 0; padding: 0; } .list > li { border-top: 1px solid var(--line); padding: 10px 0; } .list > li:first-child { border-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand); } .btn.pri { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; } .btn.ghost { border-color: transparent; background: none; color: var(--brand); } .btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
label.f { display: block; margin: 12px 0 4px; font-size: 13.5px; font-weight: 600; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
textarea { min-height: 110px; resize: vertical; } input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 10px -16px 6px; padding: 0 16px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 12px; white-space: nowrap; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; font-size: 14.5px; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; font-weight: 600; }
.pill.ok { color: var(--ok); border-color: currentColor; } .pill.warn { color: var(--warn); border-color: currentColor; } .pill.bad { color: var(--bad); border-color: currentColor; }
.kind { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); flex: none; font-size: 11px; font-weight: 700; color: var(--muted); }
.week { margin: 14px 0 4px; } .week > h3 { margin: 0 0 4px; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.note.warn { background: color-mix(in srgb, var(--warn) 14%, var(--panel)); }
.md p { margin: 0 0 10px; } .md ul, .md ol { margin: 0 0 10px; padding-left: 22px; } .md h2, .md h3 { margin-top: 14px; } .md code { background: var(--soft); padding: 1px 4px; border-radius: 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; } .t th, .t td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t th { font-size: 12.5px; color: var(--muted); font-weight: 650; } .scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; } .stat b { display: block; font-size: 24px; } .stat span { font-size: 12.5px; color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; } .bars i { flex: 1; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 10px 0; }
.q .opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 4px; border-top: 1px solid var(--line); cursor: pointer; } .q .opt:first-of-type { border-top: 0; }
.q.right { border-color: var(--ok); } .q.wrong { border-color: var(--bad); }
.timer { position: sticky; top: 58px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-weight: 700; display: inline-block; }
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); } dialog form { padding: 16px; } dialog .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; position: sticky; bottom: 0; background: var(--panel); padding-top: 8px; }
#toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #222; color: #fff; padding: 9px 16px; border-radius: 99px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px); text-align: center; }
#toast.on { opacity: 1; }
.auth { max-width: 420px; margin: 24px auto; }
.codes td:last-child { font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .06em; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; } .thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
@media print { .top, .bottom, .noprint { display: none !important; } body { padding: 0; background: #fff; } main { max-width: none; } }

.summary th { width: 92px; } .summary tr.past { opacity: .6; } .summary .list > li { padding: 6px 0; } tr.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 60% { background: color-mix(in srgb, var(--brand) 18%, transparent); } }
.setup summary { cursor: pointer; } .setup .pill { min-width: 26px; text-align: center; }
.note.preview { position: sticky; top: 56px; z-index: 6; margin-bottom: 8px; border: 1px solid var(--brand); }
.attcode { text-align: center; padding: 30px 0; } .attcode .big { font: 700 clamp(56px, 18vw, 140px)/1.1 ui-monospace, Menlo, monospace; letter-spacing: .04em; margin: 16px 0; color: var(--brand); }
.attcode .bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; max-width: 420px; margin: 0 auto 16px; } .attcode .bar i { display: block; height: 100%; background: var(--brand); width: 100%; }

.likert legend { padding: 0 0 6px; } .lk { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lk label { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: center; }
.lk input { position: absolute; opacity: 0; pointer-events: none; } .lk span { font-weight: 700; font-size: 17px; } .lk small { font-size: 10.5px; color: var(--muted); line-height: 1.2; }
.lk label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, var(--panel)); } .lk label:has(input:focus-visible) { outline: 3px solid var(--focus); }
.mbar { position: relative; display: inline-block; width: 90px; height: 8px; background: var(--soft); border-radius: 4px; vertical-align: middle; }
.mbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); border-radius: 4px; } .mbar em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.evalb { border-color: var(--brand); }

/* v0.4 look: course covers, icons, Post button, sheets, progress, empty states */
html.big { font-size: 112%; } html.big body { font-size: 18px; }
.card { box-shadow: 0 1px 2px rgba(0,0,0,.04); border-radius: 14px; }
.cgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 8px; }
.ccard { display: block; border-radius: 16px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); color: inherit; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.ccard:hover { border-color: var(--brand); } .ccard .cbody { padding: 10px 14px 12px; } .ccard .cbody b { font-size: 16px; }
.cover { height: 74px; display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 12px; color: #fff; }
.cover > span { font-weight: 800; letter-spacing: .04em; font-size: 18px; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.chead { margin: -14px -16px 10px; padding: 14px 16px 12px; color: #fff; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; }
.chead a { color: #fff; text-decoration: none; font-size: 14px; opacity: .9; } .chead .code { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: .04em; }
.ring { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; background: rgba(0,0,0,.25); border-radius: 50%; }
.ring svg { position: absolute; inset: 0; width: 42px; height: 42px; transform: rotate(-90deg); } .ring circle { fill: none; stroke-width: 3.5; } .ring .bg { stroke: rgba(255,255,255,.3); } .ring .fg { stroke: #fff; stroke-linecap: round; }
.ring b { font-size: 10.5px; color: #fff; position: relative; }
.kind svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kind { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--panel)); }
.k-assignment { color: #b45309; background: color-mix(in srgb, #f59e0b 14%, var(--panel)); } .k-quiz { color: #7c3aed; background: color-mix(in srgb, #8b5cf6 13%, var(--panel)); }
.k-audio { color: #0e7490; background: color-mix(in srgb, #06b6d4 13%, var(--panel)); } .k-link, .k-page { color: var(--muted); background: var(--soft); }
.btn svg, .tile svg, .fab svg, .empty svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg { width: 18px; height: 18px; }
.fab { position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 15; display: inline-flex; align-items: center; gap: 6px; height: 56px; padding: 0 22px 0 18px;
  border: 0; border-radius: 28px; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 700; font-size: 16px; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
.fab svg { width: 24px; height: 24px; }
dialog.sheet { margin-bottom: 0; } @media (max-width: 600px) { dialog.sheet { width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; margin: auto 0 0; } }
.tiles { display: grid; gap: 8px; margin: 8px 0; }
.tile { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.tile:hover, .tile:focus-visible { border-color: var(--brand); } .tile svg { grid-row: 1 / 3; width: 32px; height: 32px; color: var(--brand); } .tile b { font-size: 16.5px; } .tile small { color: var(--muted); }
details.more summary { cursor: pointer; color: var(--brand); font-weight: 600; margin: 8px 0; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); } .empty svg { width: 48px; height: 48px; color: color-mix(in srgb, var(--brand) 55%, var(--muted)); } .empty p { max-width: 380px; margin: 8px auto; }
.week.now { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.saved { background: color-mix(in srgb, var(--ok) 10%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.rec { margin-top: 10px; } .rec audio, .play audio { width: 100%; max-width: 360px; height: 40px; } .play { margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .chip { border: 1px solid var(--line); background: var(--soft); color: var(--ink); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13.5px; cursor: pointer; }
.skel i { display: block; height: 14px; margin: 12px 0; border-radius: 6px; background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
main { padding-bottom: 90px; }
/* discussions, sections */
.k-chat { color: #0e7490; background: color-mix(in srgb, #06b6d4 13%, var(--panel)); }
.chip.on { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--panel)); font-weight: 600; }
.post { border-top: 1px solid var(--line); padding: 10px 0 6px; } .post .who { margin-bottom: 2px; } .post .md p { margin: 4px 0; }
.post.sub { margin-left: 18px; padding-left: 12px; border-top: 0; border-left: 3px solid var(--line); }
.post.new { background: color-mix(in srgb, var(--ok) 7%, transparent); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.post .btn.sm.ghost { padding-left: 6px; padding-right: 6px; }
.tabs a .pill { font-size: 10.5px; padding: 0 6px; vertical-align: 1px; }
/* how-to guide */
.guideb { display: block; border-left: 4px solid var(--brand); text-decoration: none; color: inherit; }
.guideb.row { display: flex; align-items: center; gap: 8px; }
.guideb a { text-decoration: none; color: inherit; }
ol.guide { list-style: none; counter-reset: g; padding: 0; margin: 0; }
ol.guide li { counter-increment: g; position: relative; padding: 2px 0 14px 48px; }
ol.guide li::before { content: counter(g); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; }
ol.guide li p { margin: 4px 0 0; }
