:root {
  --ink: #1d2433; --muted: #5f6b7a; --paper: #f7f5ef; --card: #fff; --line: #e4e0d6;
  --green: #0b5d40; --green2: #0b7a53; --mint: #e7f4ee; --sun: #f4c542; --sunbg: #fff7dc;
  --red: #b42318; --redbg: #fdecea; --orange: #c2410c; --blue: #1d4ed8;
  --r: 14px; --shadow: 0 1px 2px rgba(29,36,51,.06), 0 4px 14px rgba(29,36,51,.05);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Noto Sans", sans-serif; color: var(--ink); background: var(--paper); }
a { color: var(--green2); }
h1, h2, h3, h4, h5 { line-height: 1.25; margin: .2em 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; } h4 { font-size: 1.05rem; margin-top: 1.2em; } h5 { font-size: .95rem; margin: 1em 0 .4em; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
code, pre, textarea.work { font-family: var(--mono); }
code { background: #f1efe8; padding: .05em .3em; border-radius: 5px; font-size: .92em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px max(16px, env(safe-area-inset-left)); background: rgba(247,245,239,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand svg { width: 32px; height: 32px; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a.on, .nav a:hover { background: var(--mint); color: var(--green); }
.who { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--ink); white-space: nowrap; }
@media (max-width: 640px) { .top { flex-wrap: wrap; gap: 6px; } .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; } .who { margin-left: auto; } .nav a { padding: 6px 10px; } }

main { max-width: 900px; margin: 0 auto; padding: 18px 16px 40px; outline: none; }
.foot { max-width: 900px; margin: 0 auto; padding: 18px 16px 40px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

/* blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin: 14px 0; box-shadow: var(--shadow); }
.hero { padding: 18px 4px 6px; } .hero.small { padding-bottom: 0; }
.hero p { max-width: 62ch; }
.eyebrow { color: var(--green2); font-weight: 700; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grid { display: grid; gap: 12px; }
.topics { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.people { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stats { grid-template-columns: repeat(3, 1fr); }
.strand h2 { margin-top: 1.4em; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #cfc9bb; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green2); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.file { position: relative; }
.linkbtn { background: none; border: 0; color: var(--green2); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.seg { display: inline-flex; background: #ece8dd; border-radius: 12px; padding: 4px; gap: 2px; border: 0; margin: 0; }
.seg legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.seg button, .seg a { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font: inherit; font-weight: 650; color: var(--muted); cursor: pointer; text-decoration: none; }
.seg .on { background: #fff; color: var(--green); box-shadow: var(--shadow); }
.tabs.wide { display: flex; } .tabs.wide a { flex: 1; text-align: center; }
fieldset.seg { display: flex; flex-wrap: wrap; gap: 8px; background: none; padding: 0; }
fieldset.seg label { display: flex; align-items: center; gap: 6px; background: #f1efe8; padding: 8px 14px; border-radius: 10px; flex-direction: row; font-weight: 600; }

.topic { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); margin: 0; transition: transform .12s, border-color .12s; }
.topic:hover { transform: translateY(-2px); border-color: #b9d8c8; }
.topic b { font-size: 1.08rem; }
.sub { display: inline-block; font-weight: 800; color: var(--green2); font-size: .85rem; }
.sub.big { font-size: 1rem; background: var(--mint); padding: 3px 10px; border-radius: 999px; }
.meta { font-size: .85rem; color: var(--muted); }
.bar { height: 6px; background: #efece4; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green2), var(--sun)); }
.person { text-align: left; cursor: pointer; display: flex; flex-direction: column; font: inherit; margin: 0; }
.person.cur { border-color: var(--green2); box-shadow: 0 0 0 2px var(--mint); }
.person span { color: var(--muted); font-size: .9rem; }
.stat { text-align: center; margin: 0; } .stat b { display: block; font-size: 1.8rem; color: var(--green); }
.stat span { color: var(--muted); font-size: .9rem; }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 520px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
input[type=text], input:not([type]), select, .form input { font: inherit; padding: 10px 12px; border: 1px solid #cfc9bb; border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }

.crumbs { color: var(--muted); font-size: .9rem; margin: 4px 0 2px; } .crumbs a { color: var(--muted); }
.thead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .thead h1 { margin: 0; }

/* lesson */
.lesson { font-size: 1.02rem; }
.lesson .ex { background: #f6faf8; border-left: 4px solid var(--green2); padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.lesson pre { margin: 6px 0 0; white-space: pre-wrap; font-size: .98rem; }
.lesson .big, .big { font-size: 1.15rem; font-weight: 700; text-align: center; background: var(--sunbg); padding: 10px; border-radius: 10px; }
.tip { background: var(--sunbg); border-radius: 10px; padding: 10px 14px; }
.cap { text-align: center; color: var(--muted); margin-top: 0; font-size: .9rem; }
table.pv { border-collapse: collapse; margin: 10px 0; width: 100%; font-size: .95rem; }
table.pv th, table.pv td { border: 1px solid var(--line); padding: 6px 8px; text-align: center; }
table.pv th { background: #f6f4ee; font-weight: 650; }
table.pv.sm { width: auto; min-width: 260px; }
.fig { display: block; max-width: 300px; width: 100%; margin: 10px auto; color: var(--ink); }
svg.nl { width: 100%; max-width: 360px; display: block; color: var(--ink); }
svg.chart, svg.grid { display: block; width: 100%; max-width: 380px; margin: 10px auto; color: var(--ink); }
svg.grid { max-width: 300px; }
.data { display: block; padding: 8px; line-height: 1.9; word-spacing: 2px; }
.pict { letter-spacing: 3px; color: var(--green2); font-size: 1.15rem; }

/* fractions */
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .86em; line-height: 1.05; margin: 0 .1em; }
.fr > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .15em; }
.fr > span { padding: 0 .1em; }

/* questions */
.qcard { padding: 18px 18px 20px; }
.qtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pill { background: var(--mint); color: var(--green); font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px; }
.pill.r { background: var(--redbg); color: var(--red); }
.qtext { font-size: 1.12rem; margin: 4px 0 14px; }
.workwrap { background: #fbfaf6; border: 1px dashed #d6d0c1; border-radius: 12px; padding: 12px; margin: 8px 0 14px; }
.wlabel { font-weight: 700; display: block; margin-bottom: 6px; } .wlabel small { font-weight: 400; color: var(--muted); }
textarea.work { width: 100%; font-size: 1rem; line-height: 1.7; padding: 10px 12px; border: 1px solid #cfc9bb; border-radius: 10px; background: #fff repeating-linear-gradient(transparent, transparent 1.65em, #f1efe8 1.65em, #f1efe8 calc(1.65em + 1px)); resize: vertical; color: var(--ink); }
.keys { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.k { min-width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font: 600 1rem var(--mono); cursor: pointer; color: var(--ink); }
.k:active { background: var(--mint); }
.ansrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 700; }
.ansrow input { flex: 1; min-width: 160px; max-width: 320px; font-size: 1.1rem; }
.ansrow em { font-style: normal; color: var(--muted); font-weight: 600; }
.pair { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 700; } .pair label { display: flex; align-items: center; gap: 6px; } .pair input { width: 120px; font-size: 1.1rem; }
.mcq { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.opt:has(input:checked) { border-color: var(--green2); background: var(--mint); }
.opt input { width: 20px; height: 20px; accent-color: var(--green2); flex: none; }
.opt svg { max-width: 300px; }
.skd { margin-top: 8px; } .skd summary { cursor: pointer; font-weight: 600; color: var(--green2); }
.sketch { margin-top: 8px; }
.sketch canvas { width: 100%; aspect-ratio: 900 / 420; border: 1px solid #cfc9bb; border-radius: 10px; background: #fff; touch-action: none; display: block; }
.sk-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.sk-tools button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .88rem; cursor: pointer; }
.sk-tools button.on { border-color: var(--ink); }
.sk-tools i { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; }
.sk-img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; }

.note { border-radius: 10px; padding: 10px 14px; margin: 12px 0; background: #f1efe8; }
.note.good { background: var(--mint); color: #064e35; } .note.bad { background: var(--redbg); color: #7a1a12; } .note.warn { background: var(--sunbg); color: #6b4e00; }
.wcheck ol { list-style: none; padding: 0; margin: 6px 0; }
.wcheck li { display: grid; grid-template-columns: 26px 1fr; gap: 2px 8px; align-items: start; padding: 6px 8px; border-radius: 8px; margin: 3px 0; }
.wcheck li i { font-style: normal; font-weight: 800; text-align: center; grid-row: span 2; }
.wcheck li small { grid-column: 2; }
.wcheck li code { background: none; padding: 0; font-size: 1rem; white-space: pre-wrap; }
.w-ok { background: #eff8f3; } .w-ok i { color: var(--green2); }
.w-bad { background: var(--redbg); } .w-bad i, .w-bad small { color: var(--red); }
.w-warn { background: var(--sunbg); } .w-warn i { color: #8a6400; }
.w-skip i { color: #a3a9b3; }
.wsum b { margin-right: 8px; } .wsum .g { color: var(--green2); } .wsum .r { color: var(--red); } .wsum .y { color: #8a6400; }
.model { background: #f6faf8; border: 1px solid #cfe6da; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
.model ol { margin: 4px 0; padding-left: 1.3em; } .model li { margin: 3px 0; }
.model .final { margin: 8px 0 0; }

.dots { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.dot { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.dot.half { border-color: var(--sun); color: var(--ink); } .dot.done { background: var(--mint); border-color: var(--green2); color: var(--green); }
.dot.cur { outline: 3px solid var(--sun); outline-offset: 1px; }

.ticks { padding-left: 1.2em; } .ticks li { margin: 4px 0; }
.list { list-style: none; padding: 0; } .list li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 8px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 650; }
@media (max-width: 640px) { .k { min-width: 34px; height: 34px; font-size: .92rem; } .keys { gap: 4px; } .tbl { display: block; overflow-x: auto; white-space: nowrap; } .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; } .stat b { font-size: 1.4rem; } }

.scorecard { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.scorecard h1 { margin: 0; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--green2) calc(var(--p) * 1%), #ece8dd 0); display: grid; place-items: center; flex: none; }
.ring b { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 1.5rem; }
.rq.ok { border-left: 5px solid var(--green2); } .rq.no { border-left: 5px solid var(--red); }
.rq details summary { cursor: pointer; font-weight: 600; color: var(--green2); margin-top: 8px; }
.tmark { display: flex; gap: 14px; flex-wrap: wrap; background: var(--sunbg); padding: 10px; border-radius: 10px; margin-top: 10px; }
.tmark label { display: flex; align-items: center; gap: 6px; font-weight: 600; flex-wrap: wrap; } .tmark input { min-width: 0; width: min(320px, 100%); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; transition: .25s; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: min(92vw, 520px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { transform: translate(-50%, 0); opacity: 1; } .toast.bad { background: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(29,36,51,.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.mbox { background: #fff; border-radius: 14px; padding: 20px; max-width: 440px; width: 100%; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.mbox p { margin-top: 0; font-size: 1.05rem; }

/* accounts, retries, teacher */
.sect { margin-top: 1.6em; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row.nomargin { margin-top: 0; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .88rem; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.form label.check input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; flex: none; accent-color: var(--green2); }
.form textarea { font: inherit; padding: 10px 12px; border: 1px solid #cfc9bb; border-radius: 10px; }
.tries { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tries > div { background: #f6f4ee; border-radius: 10px; padding: 10px 12px; }
.tries span { display: block; color: var(--muted); font-size: .85rem; }
.tries b { font-size: 1.3rem; color: var(--green); }
.card.tries { margin-top: 0; }
.code { font-family: var(--mono); letter-spacing: .08em; }
.classhead { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.classhead h1 { margin: 0; } .classhead p { margin: 4px 0 0; }
.bigcode { background: var(--sunbg); border-radius: 12px; padding: 10px 18px; text-align: center; }
.bigcode span { display: block; font-size: .8rem; color: #6b4e00; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.bigcode b { font: 800 2rem var(--mono); letter-spacing: .14em; color: var(--ink); }
.filter { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 8px 0; flex-wrap: wrap; }
.qr { display: block; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.qr.big { margin: 8px 0 14px; }
.slipsheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.slip { border: 2px dashed #cfc9bb; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: .95rem; }
.slip b { font-size: 1.05rem; }
.tbl td a + a { margin-left: 6px; }

/* clips */
.cliphost { padding: 0; overflow: hidden; }
.clipstart { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border: 0; background: linear-gradient(120deg, var(--green), #0f7a55); color: #fff; font: inherit; text-align: left; cursor: pointer; }
.clipstart b { display: block; font-size: 1.05rem; } .clipstart small { display: block; opacity: .85; }
.cplay { width: 48px; height: 48px; border-radius: 50%; background: var(--sun); color: var(--ink); display: grid; place-items: center; font-size: 1.2rem; flex: none; padding-left: 3px; }
.clip { background: #0d3b2b; color: #f3f1ea; border-radius: var(--r); overflow: hidden; }
.cliphost .clip { border-radius: 0; }
.clip-bar { display: flex; gap: 4px; padding: 10px 12px 0; }
.clip-bar i { flex: 1; height: 4px; background: rgba(255,255,255,.18); border-radius: 4px; overflow: hidden; }
.clip-bar b { display: block; height: 100%; width: 0; background: var(--sun); transition: width .4s; }
.clip-stage { min-height: 250px; max-height: 420px; overflow-y: auto; padding: 18px 20px 6px; }
.cs h3 { font-size: clamp(1.5rem, 5vw, 2.1rem); margin: .2em 0; color: #fff; }
.cs h4 { margin: 0 0 10px; color: var(--sun); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.cs.title, .cs.end { text-align: center; padding-top: 30px; }
.cs-sub { color: var(--sun); font-weight: 700; }
.cs-steps { display: flex; justify-content: center; gap: 6px; margin-top: 18px; align-items: flex-end; }
.cs-steps i { width: 26px; background: var(--sun); border-radius: 4px 4px 0 0; animation: rise 1.2s ease-out both; }
.cs-steps i:nth-child(1) { height: 14px; } .cs-steps i:nth-child(2) { height: 28px; animation-delay: .2s; } .cs-steps i:nth-child(3) { height: 42px; animation-delay: .4s; }
@keyframes rise { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
.cs ul { list-style: none; padding: 0; margin: 0; }
.cs ul li { padding: 8px 12px; margin: 6px 0; background: rgba(255,255,255,.07); border-radius: 8px; }
.cs ul li::before { content: '✓ '; color: var(--sun); font-weight: 800; }
.cs-idea { font-size: 1.12rem; line-height: 1.6; animation: fadein .6s both; }
.cs-idea b { color: var(--sun); }
.cs-q { background: rgba(255,255,255,.08); border-radius: 10px; padding: 10px 14px; font-size: 1.05rem; animation: fadein .5s both; }
.cs-q svg { background: #fff; border-radius: 8px; color: var(--ink); max-width: 300px; }
.cs-work { font-family: var(--mono); padding-left: 1.4em; margin: 12px 0 6px; font-size: 1.02rem; }
.cs-work li { margin: 6px 0; padding: 3px 6px; border-radius: 6px; }
.cs-ans { font-size: 1.1rem; background: var(--sun); color: var(--ink); display: inline-block; padding: 6px 14px; border-radius: 10px; }
.beat { opacity: 0; transform: translateY(8px); transition: opacity .45s, transform .45s, background .3s; }
.beat.on { opacity: 1; transform: none; }
.beat.now { background: rgba(244,197,66,.22); }
.cs ul li.beat.now { background: rgba(244,197,66,.28); }
.cs-ans.beat.now { background: var(--sun); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.clip.still .beat, .clip.still .cs-steps i, .clip.still .cs-idea, .clip.still .cs-q { transition: none; animation: none; transform: none; }
.clip-cap { margin: 0; padding: 8px 20px; min-height: 2.6em; font-size: .95rem; color: #dfe9e3; background: rgba(0,0,0,.18); }
.clip-ctl { display: flex; gap: 6px; padding: 10px 12px 12px; flex-wrap: wrap; align-items: center; }
.cb { min-width: 44px; height: 40px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 10px; font: inherit; cursor: pointer; padding: 0 10px; }
.cb.main { background: var(--sun); color: var(--ink); border-color: var(--sun); font-weight: 800; min-width: 56px; }
.cb.voice { margin-left: auto; font-size: .88rem; }
.model .row h5 { margin: 0; }

@media print {
  .top, .foot, .noprint, .keys, .skd, .row .btn { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card { box-shadow: none; break-inside: avoid; }
  .rq details { display: block; } .rq details > * { display: block; }
  main { max-width: none; padding: 0; }
 .clip, .playsteps, .cliphost { display: none !important; }
 body.printslips main > *, body.printslips #slips > :not(.slipsheet) { display: none !important; }
 body.printslips main > .lcard, body.printslips #slips { display: block !important; }
 body.printslips main > .lcard > :not(#slips) { display: none !important; }
 .slip { break-inside: avoid; }
}

/* ---- subjects (v3) ---- */
.seg.subj { margin: .6rem 0 .2rem; flex-wrap: wrap; }
.hazrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; margin: .6rem 0 1rem; }
.hazrow figure { margin: 0; text-align: center; font-size: .9rem; }
.hazrow figcaption { margin-top: .3rem; text-align: left; }
svg.haz { width: 72px; height: 72px; }
.hazq svg.haz { width: 96px; height: 96px; display: block; margin: .2rem 0 .6rem; }
blockquote.expl { margin: .3rem 0; padding: .5rem .8rem; border-left: 3px solid #0b7a53; background: rgba(11, 122, 83, .06); border-radius: 4px; white-space: normal; }

/* ---- study plan (v4) ---- */
.today { border-left: 5px solid var(--green2); }
.today h2 { margin: 0; font-size: 1.15rem; }
.progs { grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 4px; }
.prog { background: #f6f4ee; border-radius: 10px; padding: 10px 12px; }
.prog span:first-child { color: var(--muted); font-size: .9rem; }
.prog b { font-size: 1.15rem; }
.prog.done { background: var(--mint); } .prog.done b { color: var(--green); }
.slotnow { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 12px; border: 1px dashed var(--green2); border-radius: 10px; }
.slotnow .when { font-size: .85rem; font-weight: 700; color: var(--green2); text-transform: uppercase; letter-spacing: .04em; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.linkbtn { text-decoration: none; }
.pill.y { background: var(--sunbg); color: #6b4e00; } .pill.b { background: #e8eefc; color: var(--blue); }
.pill.n, .pill.n0, .pill.t { background: #efece4; color: var(--muted); }
.g { color: var(--green2); } .r { color: var(--red); }
td.g { background: var(--mint); } td.y { background: var(--sunbg); } td.r { background: var(--redbg); }
.ttwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; }
table.tt { border-collapse: separate; border-spacing: 3px; width: 100%; min-width: 460px; font-size: .86rem; }
.tt th { font-weight: 700; color: var(--muted); text-align: center; padding: 4px; }
.tt tbody th { text-align: right; white-space: nowrap; font-weight: 600; font-size: .8rem; color: var(--ink); }
.tt tbody th small { display: block; color: var(--muted); font-weight: 400; }
.tt td { background: #f6f4ee; border-radius: 7px; padding: 6px 4px; text-align: center; vertical-align: middle; line-height: 1.2; }
.tt td a { display: block; font-size: .78rem; margin-top: 2px; font-weight: 700; }
.tt tr.pa td { background: #fff7dc; color: #6b4e00; font-size: .78rem; }
.tt tr.lunch td { background: none; color: var(--muted); font-style: italic; padding: 2px; }
.tt td.weak { background: #e7f4ee; color: var(--green); font-weight: 700; }
.tt td.book { color: var(--muted); }
.tt .tday { box-shadow: inset 0 0 0 2px var(--green2); }
.tt th.tday { color: var(--green); box-shadow: none; text-decoration: underline; }
.tt td.now { background: var(--green); color: #fff; } .tt td.now a { color: #fff; }
.legend { color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.legend .k { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: middle; background: #f6f4ee; }
.legend .k.weak { background: #e7f4ee; box-shadow: inset 0 0 0 1px var(--green2); } .legend .k.book { background: #f6f4ee; box-shadow: inset 0 0 0 1px var(--line); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 460px; }
.cal .ch { text-align: center; font-size: .78rem; color: var(--muted); font-weight: 700; }
.cd { aspect-ratio: 1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f6f4ee; font-size: .85rem; }
.cd small { font-size: .68rem; opacity: .85; }
.cd.g, .k.g, .sq.g { background: #2f9e6a; color: #fff; }
.cd.y, .k.y, .sq.y { background: #f4c542; color: #3d2e00; }
.cd.r, .k.r, .sq.r { background: #d64535; color: #fff; }
.cd.b, .k.b, .sq.b { background: #6b8fe8; color: #fff; }
.cd.n, .k.n, .sq.n { background: #e4e0d6; }
.cd.t, .sq.t { background: #fff; box-shadow: inset 0 0 0 2px var(--green2); }
.cd.n0, .sq.n0 { background: #f6f4ee; color: #b5ae9f; }
.cd.fut { background: transparent; color: #c9c3b6; }
.strip { display: inline-flex; gap: 2px; }
.sq { display: inline-block; width: 11px; height: 18px; border-radius: 3px; }
.tbl.daily td { vertical-align: middle; }
.weaksub { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.weaksub h3 { margin: 0 0 2px; }
.wkbars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; max-width: 420px; margin: 8px 0; }
.wkbars > div { display: flex; flex-direction: column; align-items: center; font-size: .78rem; }
.wkbars .bwrap { width: 100%; height: 70px; background: #f6f4ee; border-radius: 6px; display: flex; align-items: flex-end; overflow: hidden; }
.wkbars i { display: block; width: 100%; background: linear-gradient(0deg, var(--green2), #5cc493); }
.wkbars small { color: var(--muted); }
fieldset.sess, fieldset.weakset, fieldset.days { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 0; }
fieldset.sess legend, fieldset.days legend, fieldset.weakset legend { font-weight: 700; padding: 0 4px; }
fieldset.sess select { min-height: 44px; }
.grid.chks { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
fieldset.days { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.form.rules input[type=number] { max-width: 120px; }
@media (max-width: 640px) { .progs { grid-template-columns: 1fr 1fr; gap: 8px; } .tt { font-size: .8rem; } }
@media print {
  body.printtt main > :not(.ttcard) { display: none !important; }
  body.printtt .ttcard .row { display: none !important; }
  .tt td.now { background: #f6f4ee; color: inherit; }
}
.tt th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); padding-right: 6px; }
.tbl.daily { display: table; white-space: normal; width: 100%; }
.tbl.daily td, .tbl.daily th { padding: 8px 6px; }
.tbl.daily .strip { margin: 4px 0 2px; }
