/* ==========================================================================
   MEC211 · Strength of Materials — Course Companion
   Aesthetic: "Engineering Dossier" — drafting-sheet paper, ruled grids,
   Instrument Serif display over IBM Plex Sans / Mono data type.
   ========================================================================== */

/* ---------- 1 · Tokens -------------------------------------------------- */
:root {
  --f-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --paper:   #f2efe9;
  --paper-2: #e9e5dc;
  --sheet:   #fbfaf7;
  --sheet-2: #f6f4ef;
  --ink:     #171a1e;
  --ink-2:   #4a4f55;
  --ink-3:   #83888f;
  --line:    rgba(23, 26, 30, .16);
  --line-soft: rgba(23, 26, 30, .075);
  --accent:  #c2521a;
  --accent-2:#2f5d73;
  --accent-soft: rgba(194, 82, 26, .10);
  --accent-2-soft: rgba(47, 93, 115, .10);
  --shadow: 0 1px 2px rgba(23,26,30,.05), 0 8px 24px -12px rgba(23,26,30,.18);
  --shadow-lg: 0 2px 4px rgba(23,26,30,.06), 0 24px 48px -20px rgba(23,26,30,.28);

  --ch1: #c2521a;  --ch2: #2f6e80;  --ch3: #5f7a2a;
  --ch4: #8a3f6b;  --ch5: #3a57a0;  --ch6: #9a7410;

  --r-s: 6px; --r-m: 10px; --r-l: 16px;
  --rail-w: 264px;
  --bar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

html[data-theme="dark"] {
  --paper:   #101317;
  --paper-2: #0b0e11;
  --sheet:   #171b21;
  --sheet-2: #1c2129;
  --ink:     #e9e6df;
  --ink-2:   #a9aeb5;
  --ink-3:   #757b83;
  --line:    rgba(233, 230, 223, .17);
  --line-soft: rgba(233, 230, 223, .075);
  --accent:  #f08a3c;
  --accent-2:#7fb2c9;
  --accent-soft: rgba(240, 138, 60, .13);
  --accent-2-soft: rgba(127, 178, 201, .12);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.45), 0 28px 56px -22px rgba(0,0,0,.75);

  --ch1: #f08a3c;  --ch2: #6fb6cc;  --ch3: #a9c56b;
  --ch4: #d08bb4;  --ch5: #8fa8e8;  --ch6: #e0b44a;
  color-scheme: dark;
}

/* ---------- 2 · Reset ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.mono { font-family: var(--f-mono); }

/* ---------- 3 · Atmosphere: drafting sheet + grain ---------------------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 32px 100%,
    radial-gradient(120% 80% at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(90% 70% at -10% 110%, var(--accent-2-soft), transparent 60%),
    var(--paper);
}
.sheet-bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--line-soft) 1.5px, transparent 1.5px) 0 0 / 100% 160px,
    linear-gradient(90deg, var(--line-soft) 1.5px, transparent 1.5px) 0 0 / 160px 100%;
  opacity: .9;
}
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .35; }


/* ---------- 4 · App bar -------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--sheet); color: var(--accent);
  box-shadow: var(--shadow);
}
.brand-mark svg { width: 26px; height: 26px; }
.bm-beam { opacity: .35; }
.bm-defl { color: var(--accent-2); }
.bm-sup { color: var(--accent); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-txt strong {
  font-family: var(--f-mono); font-weight: 600; font-size: 15px;
  letter-spacing: .14em; color: var(--ink);
}
.brand-txt em {
  font-family: var(--f-display); font-style: italic; font-size: 15px;
  color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.week-pill {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--sheet); color: var(--ink-2);
}
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--sheet); color: var(--ink-2);
  transition: color .2s, border-color .2s, transform .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
html[data-theme="light"] .ic-sun { display: none; }
html[data-theme="dark"]  .ic-moon { display: none; }

/* ---------- 5 · Shell / rail / tab bar ---------------------------------- */
.shell { display: block; }
.rail { display: none; }

.view {
  max-width: 880px;
  margin: 0 auto;
  padding: 22px 18px calc(96px + var(--safe-b));
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-b));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 2px 5px; border-radius: var(--r-m);
  text-decoration: none; color: var(--ink-3);
  transition: color .2s;
  position: relative;
}
.tab-ic { width: 22px; height: 22px; }
.tab-ic svg { width: 100%; height: 100%; }
.tab-lb { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.tab.is-active { color: var(--accent); }
.tab.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2.5px; border-radius: 2px; background: var(--accent);
}
.tab:active .tab-ic { transform: scale(.92); }

@media (min-width: 1024px) {
  .tabbar { display: none; }
  .shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .rail {
    display: flex; flex-direction: column; gap: 26px;
    position: sticky; top: calc(59px + var(--safe-t));
    align-self: start;
    height: calc(100vh - 59px - var(--safe-t));
    padding: 30px 22px 22px 26px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .view { padding: 40px 48px 90px; max-width: 940px; }
}

.rail-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.rail-ref { font-size: 11px; letter-spacing: .12em; color: var(--ink-3); margin-top: 4px; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-link {
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-m);
  text-decoration: none; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  border: 1px solid transparent;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.rail-link .idx { font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em; }
.rail-link:hover { background: var(--sheet); color: var(--ink); transform: translateX(2px); }
.rail-link.is-active {
  background: var(--sheet); color: var(--ink); border-color: var(--line);
  box-shadow: var(--shadow);
}
.rail-link.is-active .idx { color: var(--accent); }
.rail-progress { margin-top: auto; }
.rail-progress-top {
  display: flex; justify-content: space-between;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 8px;
}
.rail-progress-note { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.45; }
.rail-foot { border-top: 1px solid var(--line); padding-top: 14px; }
.pdf-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
}
.pdf-link svg { width: 15px; height: 15px; }
.pdf-link:hover { text-decoration: underline; }

/* progress bar */
.bar {
  height: 6px; border-radius: 999px; background: var(--line-soft);
  border: 1px solid var(--line-soft); overflow: hidden;
}
.bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.22, 1, .36, 1);
}


/* ---------- 6 · Type primitives ----------------------------------------- */
.kicker {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.sec { margin: 46px 0 18px; }
.sec-head {
  display: flex; align-items: baseline; gap: 12px;
  border-bottom: 1.5px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px;
}
.sec-head .no {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em;
  color: var(--accent);
}
.sec-head h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(24px, 6vw, 32px); letter-spacing: .005em; line-height: 1.1;
}
.sec-head .tail {
  margin-left: auto; font-family: var(--f-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase;
}
.lede { font-size: 15.5px; color: var(--ink-2); max-width: 62ch; }
.note {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.55;
  border-left: 2px solid var(--accent-2); padding-left: 10px; margin-top: 12px;
}

/* ---------- 7 · Cards / sheets ------------------------------------------ */
.sheet-card {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  padding: 18px;
}
.sheet-card::before {
  content: ""; position: absolute; inset: 6px; pointer-events: none;
  border: 1px dashed var(--line-soft); border-radius: calc(var(--r-l) - 5px);
}
.sheet-card > * { position: relative; }
.card-title {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- 8 · Hero ----------------------------------------------------- */
.hero { padding-top: 6px; }
.hero-ref {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px;
  background: var(--sheet); padding: 5px 12px; margin-bottom: 18px;
}
.hero-ref i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(42px, 11.5vw, 76px); line-height: .98; letter-spacing: -.01em;
}
.hero h1 .code {
  display: block; font-family: var(--f-mono); font-weight: 600;
  font-size: clamp(13px, 3.4vw, 17px); letter-spacing: .34em;
  color: var(--accent); margin-bottom: 14px;
}
.hero h1 em { font-style: italic; color: var(--accent-2); }
.hero-sub {
  margin-top: 16px; font-size: 15px; color: var(--ink-2); max-width: 56ch;
}
.hero-fig { margin: 26px 0 4px; }
.hero-fig svg { width: 100%; height: auto; }
.hero-fig .ax { stroke: var(--line); stroke-width: 1; }
.hero-fig .curve { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-linecap: round; }
.hero-fig .curve2 { stroke: var(--accent-2); stroke-width: 1.5; fill: none; stroke-dasharray: 4 4; }
.hero-fig text { font-family: var(--f-mono); font-size: 9px; fill: var(--ink-3); letter-spacing: .08em; }
.hero-fig .dot { fill: var(--accent); }

/* fact grid */
.facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-l); overflow: hidden; margin-top: 22px;
}
.fact { background: var(--sheet); padding: 13px 14px; }
.fact dt {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px;
}
.fact dd { margin: 0; font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.fact dd.big { font-family: var(--f-display); font-size: 21px; font-weight: 400; }
@media (min-width: 640px) { .facts { grid-template-columns: repeat(4, 1fr); } }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--sheet); padding: 14px 15px; position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -14px; bottom: -14px; width: 52px; height: 52px;
  border: 1px solid var(--line-soft); border-radius: 50%;
}
.stat b {
  display: block; font-family: var(--f-display); font-weight: 400;
  font-size: 34px; line-height: 1; color: var(--ink);
}
.stat b sup { font-size: 14px; color: var(--accent); }
.stat span {
  display: block; margin-top: 6px; font-family: var(--f-mono); font-size: 9.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- 9 · Chips / badges / pills ---------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--sheet-2); color: var(--ink-2);
  white-space: nowrap;
}
.chip.solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.acc { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); background: var(--accent-soft); }
.chip.acc2 { border-color: color-mix(in srgb, var(--accent-2) 55%, transparent); color: var(--accent-2); background: var(--accent-2-soft); }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

/* chapter colour hooks */
.hue-1 { --hue: var(--ch1); } .hue-2 { --hue: var(--ch2); } .hue-3 { --hue: var(--ch3); }
.hue-4 { --hue: var(--ch4); } .hue-5 { --hue: var(--ch5); } .hue-6 { --hue: var(--ch6); }
.hue-chip {
  border-color: color-mix(in srgb, var(--hue) 50%, transparent);
  color: var(--hue);
  background: color-mix(in srgb, var(--hue) 10%, transparent);
}


/* ---------- 10 · Chapter strip ------------------------------------------ */
.chapters { display: grid; gap: 10px; }
@media (min-width: 640px) { .chapters { grid-template-columns: repeat(2, 1fr); } }
.ch-card {
  display: flex; gap: 13px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--sheet); padding: 14px 15px;
  border-left: 4px solid var(--hue);
  transition: transform .2s, box-shadow .2s;
}
.ch-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ch-card .no {
  font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .1em;
  color: var(--hue); padding-top: 2px;
}
.ch-card h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.ch-card .meta {
  margin-top: 6px; font-family: var(--f-mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}

/* ---------- 11 · Weekly timeline ---------------------------------------- */
.tl-controls {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px;
  position: sticky; top: calc(59px + var(--safe-t)); z-index: 20;
  padding: 10px 0;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.search {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--sheet); padding: 9px 14px;
}
.search svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
.search input {
  border: 0; outline: none; background: none; width: 100%;
  font: inherit; font-size: 14px; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }
.filters { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fbtn {
  flex: none; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--sheet); color: var(--ink-2);
  transition: all .18s;
}
.fbtn:hover { border-color: var(--accent); color: var(--accent); }
.fbtn.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tl { position: relative; padding-left: 34px; }
.tl::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px;
  width: 1.5px; background: var(--line);
}
.wk { position: relative; margin-bottom: 14px; }
.wk::before {
  content: ""; position: absolute; left: -29px; top: 20px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--hue, var(--ink-3));
  z-index: 1;
}
.wk.is-now::before {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70%, 100% { box-shadow: 0 0 0 12px transparent; }
}
.wk-card {
  width: 100%; text-align: left; display: block;
  border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--sheet); box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.wk-card:hover { border-color: color-mix(in srgb, var(--hue, var(--accent)) 55%, var(--line)); }
.wk.is-now .wk-card { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.wk-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; }
.wk-no {
  flex: none; width: 42px; height: 42px; border-radius: var(--r-m);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-weight: 600; font-size: 15px;
  color: var(--hue, var(--ink-2));
  background: color-mix(in srgb, var(--hue, var(--ink-3)) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue, var(--ink-3)) 35%, transparent);
}
.wk-main { flex: 1; min-width: 0; }
.wk-date {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.wk-title { font-size: 14.5px; font-weight: 600; line-height: 1.35; margin-top: 3px; }
.wk-chev { flex: none; color: var(--ink-3); transition: transform .3s; }
.wk-chev svg { width: 18px; height: 18px; }
.wk.is-open .wk-chev { transform: rotate(180deg); }
.wk-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s cubic-bezier(.22,1,.36,1); }
.wk-body > div { overflow: hidden; }
.wk.is-open .wk-body { grid-template-rows: 1fr; }
.wk-inner { padding: 12px 16px 16px; border-top: 1px dashed var(--line-soft); }


.topic {
  display: flex; gap: 11px; align-items: baseline; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.topic:last-child { border-bottom: 0; }
.topic .t-code {
  flex: none; font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  color: var(--hue, var(--accent)); min-width: 30px;
}
.topic .t-title { font-size: 13.5px; color: var(--ink-2); flex: 1; }
.topic .t-hrs {
  flex: none; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 2px 8px;
}
.ev-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ev {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; padding: 5px 10px; border-radius: var(--r-s);
}
.ev::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: currentColor; }
.ev-test { background: color-mix(in srgb, var(--ch4) 14%, transparent); color: var(--ch4); }
.ev-assignment { background: color-mix(in srgb, var(--ch1) 14%, transparent); color: var(--ch1); }
.ev-survey { background: color-mix(in srgb, var(--ch2) 14%, transparent); color: var(--ch2); }
.ev-break { background: color-mix(in srgb, var(--ch6) 16%, transparent); color: var(--ch6); }
.ev-final { background: color-mix(in srgb, var(--ch5) 14%, transparent); color: var(--ch5); }
.ev-info { background: color-mix(in srgb, var(--accent-2) 12%, transparent); color: var(--accent-2); }
.ev-revision { background: color-mix(in srgb, var(--ch3) 14%, transparent); color: var(--ch3); }
.wk-empty { padding: 26px 0; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ---------- 12 · Tables -------------------------------------------------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--sheet); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.tbl th, .tbl td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl thead th {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3); background: var(--sheet-2); border-bottom: 1px solid var(--line);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tbl .num { font-family: var(--f-mono); font-size: 12px; white-space: nowrap; }
.tbl tfoot td {
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 600;
  border-top: 1.5px solid var(--ink); background: var(--sheet-2);
}

/* ---------- 13 · Assessment visuals ------------------------------------- */
.donut-row { display: grid; gap: 16px; align-items: center; }
@media (min-width: 640px) { .donut-row { grid-template-columns: 190px 1fr; } }
.donut { position: relative; width: 190px; margin: 0 auto; }
.donut svg { width: 100%; height: auto; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; }
.donut .track { stroke: var(--line-soft); }
.donut .seg { transition: stroke-dasharray 1.2s cubic-bezier(.22,1,.36,1); }
.donut-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-mid b { font-family: var(--f-display); font-size: 34px; font-weight: 400; line-height: 1; }
.donut-mid span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.legend { display: grid; gap: 8px; }
.lg-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.lg-row i { width: 12px; height: 12px; border-radius: 3px; background: var(--hue); }
.lg-row .nm { font-size: 13.5px; }
.lg-row .wt { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--hue); }

.wbar { margin-top: 10px; }
.wbar-row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 10px; align-items: center; padding: 6px 0; }
.wbar-row .lb { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-2); }
.wbar-row .tr { height: 10px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.wbar-row .tr i { display: block; height: 100%; width: 0; background: var(--hue); border-radius: 999px; transition: width 1s cubic-bezier(.22,1,.36,1); }
.wbar-row .vl { font-family: var(--f-mono); font-size: 11.5px; text-align: right; color: var(--ink-2); }


/* ---------- 14 · People / texts / adab ---------------------------------- */
.people { display: grid; gap: 10px; }
@media (min-width: 640px) { .people { grid-template-columns: repeat(2, 1fr); } }
.person {
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-l);
  background: var(--sheet); padding: 13px 15px;
}
.person .av {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 13px; font-weight: 600;
  color: var(--paper); background: var(--accent-2);
}
.person.co .av { background: var(--accent); }
.person .nm { font-size: 14px; font-weight: 600; line-height: 1.3; }
.person .rl { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.texts { display: grid; gap: 10px; }
.text-item {
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--sheet);
  padding: 14px 16px; display: flex; gap: 13px;
}
.text-item .tk {
  flex: none; font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft); border-radius: var(--r-s);
  padding: 4px 8px; height: fit-content; white-space: nowrap;
}
.text-item h4 { font-size: 14px; font-weight: 600; line-height: 1.4; }
.text-item p { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.adab { display: grid; gap: 8px; }
.adab li {
  display: flex; gap: 11px; font-size: 13.5px; color: var(--ink-2);
  padding: 10px 13px; border: 1px solid var(--line-soft); border-radius: var(--r-m);
  background: var(--sheet-2);
}
.adab li b { font-family: var(--f-mono); font-size: 11px; color: var(--accent); flex: none; padding-top: 2px; }

/* ---------- 15 · Buttons / misc ----------------------------------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  transition: transform .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn.ghost { background: none; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 15px; height: 15px; }

/* ---------- 16 · Reveal motion ------------------------------------------ */
.rv { opacity: 0; transform: translateY(14px); }
.rv.in { opacity: 1; transform: none; transition: opacity .6s ease, transform .6s cubic-bezier(.22,1,.36,1); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 17 · Noscript / print --------------------------------------- */
.noscript {
  max-width: 640px; margin: 40px auto; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--r-l); background: var(--sheet);
}
.noscript h2 { font-family: var(--f-display); font-size: 26px; margin-bottom: 10px; }
.noscript a { color: var(--accent); }

@media print {
  .tabbar, .appbar, .grain, .sheet-bg, .tl-controls, .btn-row { display: none !important; }
  .rail { display: none !important; }
  body { background: #fff; color: #000; }
  .view { padding: 0; max-width: none; }
  .wk-body { grid-template-rows: 1fr !important; }
  .sheet-card, .ch-card, .wk-card { box-shadow: none; break-inside: avoid; }
}

