/* No Tools Construction members area. Brand color lives in --accent (dark) and --accent (light) below. */
:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --on-accent: #141414;
  --ok: #22c55e;
  --danger: #ef4444;
}
html[data-theme="dark"] {
  --accent: #fec102; --accent-text: #fec102; --accent-soft: rgba(254, 193, 2, .12);
  --bg: #0d0d0e; --side: #111113; --card: #161619; --card-2: #1c1c20; --hover: #222227;
  --line: #25252a; --line-2: #33333a; --text: #f3f3f4; --muted: #a3a3ab; --dim: #6f6f78;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px rgba(0, 0, 0, .28);
  color-scheme: dark;
}
html[data-theme="light"] {
  --accent: #f5b400; --accent-text: #946400; --accent-soft: rgba(245, 180, 0, .14);
  --bg: #f5f4f1; --side: #ffffff; --card: #ffffff; --card-2: #f8f7f4; --hover: #f0eee9;
  --line: #e6e3dd; --line-2: #d8d4cc; --text: #161616; --muted: #5c5c64; --dim: #8b8b93;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 28px rgba(0, 0, 0, .05);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; }
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px; overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--line); }
.brand { display: block; padding: 2px 8px 8px; }
.brand img { display: block; height: 34px; width: auto; }
html[data-theme="dark"] .logo-light, html[data-theme="light"] .logo-dark { display: none !important; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.me-card b { display: block; font-size: 14px; line-height: 1.2; }
.me-card small { display: block; font-size: 12px; color: var(--accent-text); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 550; font-size: 14.5px; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.nav a .ext { margin-left: auto; width: 14px; height: 14px; opacity: .6; }
.nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); padding: 14px 12px 6px; font-weight: 700; }
.side-foot { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 13px; }
.side-foot .row { margin-bottom: 8px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 22px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.crumb { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--text); }
.grow { flex: 1; }
.menu-btn { display: none !important; }
.prof { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.prof b { display: block; font-size: 13px; line-height: 1.1; text-align: left; }
.prof small { display: block; font-size: 11px; color: var(--accent-text); text-align: left; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; padding: 6px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); z-index: 30; }
.menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head b { display: block; font-size: 14px; }
.menu-head small { display: block; font-size: 12px; color: var(--muted); word-break: break-all; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-size: 14px; text-align: left; }
.menu button:hover { background: var(--hover); }
.page { width: 100%; max-width: 1140px; margin: 0 auto; padding: 30px 26px 90px; }
.scrim { display: none; }

/* ---------- type and building blocks ---------- */
h1 { font-size: 32px; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 6px; font-weight: 850; }
h2 { font-size: 18px; letter-spacing: -.01em; margin: 0; font-weight: 750; }
h3 { font-size: 16px; margin: 0; font-weight: 700; }
.sub { color: var(--muted); margin: 0 0 24px; }
.eyebrow { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card-2); cursor: pointer; font-weight: 650; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .i { width: 16px; height: 16px; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill .i { width: 13px; height: 13px; }
.pill.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.pill.ok { background: rgba(34, 197, 94, .12); border-color: transparent; color: var(--ok); }
.pill.bad { background: rgba(239, 68, 68, .12); border-color: transparent; color: var(--danger); }
.av { display: inline-grid; place-items: center; flex: none; border-radius: 50%; object-fit: cover; font-weight: 750; color: var(--on-accent);
  background: linear-gradient(135deg, #ffd34d, #e9a800); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .i { display: block; width: 30px; height: 30px; color: var(--dim); margin: 0 auto 8px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.error-box { padding: 12px 14px; border-radius: 10px; background: rgba(239, 68, 68, .1); color: var(--danger); font-size: 14px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.link { color: var(--accent-text); font-weight: 650; text-decoration: none; }
.link:hover { text-decoration: underline; }
.prose { white-space: normal; overflow-wrap: anywhere; }
.prose a { color: var(--accent-text); }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); outline: none; }
textarea.input { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-bottom: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(60% 50% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 410px; padding: 30px; }
.auth-card .brand { padding: 0 0 22px; }
.auth-card .brand img { height: 40px; }
.auth-card h1 { font-size: 26px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }

/* ---------- home ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.tile:hover { border-color: var(--line-2); background: var(--card-2); }
.tile .i { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.tile small { display: block; font-size: 12px; color: var(--muted); }
.tile b { display: block; font-size: 14px; line-height: 1.25; }
.tile.hot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tile.hot small { color: rgba(0, 0, 0, .6); }
.tile.hot .i { background: rgba(0, 0, 0, .12); color: var(--on-accent); }
.mod-progress { display: grid; gap: 12px; }
.mod-progress a { text-decoration: none; display: block; }
.mod-progress .row { font-size: 13px; margin-bottom: 6px; }
.mod-progress .row b { font-weight: 600; }
.announce + .announce { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.announce h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .01em; }
.announce p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.event-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); }
.event-row + .event-row { margin-top: 8px; }
.event-row .when { font-size: 12px; color: var(--muted); }
.event-row b { display: block; font-size: 14px; }
.event-row .date-chip { width: 46px; flex: none; text-align: center; border-radius: 10px; padding: 5px 0; background: var(--accent-soft); color: var(--accent-text); line-height: 1.1; }
.event-row .date-chip small { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.event-row .date-chip b { font-size: 18px; }
.live { background: var(--danger); color: #fff; }

/* ---------- classroom ---------- */
.progress-card { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: 18px 22px; margin-bottom: 22px; }
.progress-card .big { font-size: 30px; font-weight: 850; letter-spacing: -.02em; line-height: 1; }
.progress-card small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.progress-card .bar { height: 8px; margin-bottom: 8px; }
.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.module { display: flex; flex-direction: column; text-decoration: none; overflow: hidden; transition: transform .15s, border-color .15s; }
.module:hover { transform: translateY(-2px); border-color: var(--line-2); }
.module .meta { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.module .meta h3 { margin-bottom: 6px; }
.module .meta p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; flex: 1; }
.module .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.cover { position: relative; aspect-ratio: 16 / 8.4; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 16px 18px;
  background: radial-gradient(110% 90% at 92% 0%, rgba(254, 193, 2, .34), transparent 55%), linear-gradient(160deg, #1d1d22, #0a0a0b 70%); color: #fff; }
.cover::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
  background-size: 24px 24px; -webkit-mask-image: linear-gradient(to top, transparent, #000 80%); mask-image: linear-gradient(to top, transparent, #000 80%); }
.cover .mk { position: absolute; right: -10px; top: -14px; width: 46%; max-width: 150px; opacity: .16; transform: rotate(8deg); }
.cover .num { position: relative; font-size: 11px; font-weight: 850; letter-spacing: .18em; color: #fec102; }
.cover .ttl { position: relative; font-size: clamp(20px, 2.3vw, 30px); line-height: .98; font-weight: 900; letter-spacing: -.01em; text-transform: uppercase; max-width: 88%;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .5); overflow-wrap: anywhere; }
.cover .done-badge { position: absolute; top: 12px; right: 12px; z-index: 2; }
.module.locked .cover::after { content: ""; position: absolute; inset: 0; background: rgba(8, 8, 9, .62); }
.lockbox { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.lockbox .i { width: 26px; height: 26px; color: #fff; }
.lockbox b { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.lockbox small { font-size: 12px; color: #d4d4d8; }
.done-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 800; }
.done-badge .i { width: 13px; height: 13px; }

/* ---------- module / lesson ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 16px; }
.back:hover { color: var(--text); }
.lesson-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.lesson-list { position: sticky; top: 76px; padding: 16px 12px 12px; max-height: calc(100vh - 96px); overflow-y: auto; }
.lesson-list .head { padding: 0 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.lesson-list .head small { color: var(--accent-text); font-weight: 750; font-size: 12px; }
.lesson-list .head h2 { margin: 2px 0 10px; }
.lesson-list .head .bar { margin-bottom: 6px; }
.lesson-list .head span { font-size: 12px; color: var(--muted); }
.l-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 8px; border-radius: 10px; text-decoration: none; }
.l-item:hover { background: var(--hover); }
.l-item.on { background: var(--accent-soft); }
.l-item .dot { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-2); font-size: 11px; font-weight: 750; color: var(--muted); margin-top: 1px; }
.l-item .dot .i { width: 14px; height: 14px; }
.l-item.done .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.l-item .t { font-size: 14px; line-height: 1.3; font-weight: 550; }
.l-item .d { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.l-item.locked { opacity: .55; pointer-events: none; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #0a0a0b; border: 1px solid var(--line); container-type: inline-size; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.soon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 2cqw, 12px); text-align: center; padding: 4cqw; color: #fff;
  background: radial-gradient(60% 55% at 50% 42%, rgba(254, 193, 2, .16), transparent 70%), linear-gradient(180deg, #151518, #09090a); }
.soon::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 28px 28px; }
.soon > * { position: relative; }
.soon .play { flex: none; width: clamp(40px, 11cqw, 70px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fec102; color: #fec102; background: rgba(254, 193, 2, .08); }
.soon .play .i { width: 40%; height: 40%; margin-left: 6%; }
.soon .tag { font-size: clamp(10px, 1.9cqw, 12px); font-weight: 850; letter-spacing: .2em; color: #fec102; }
.soon .t { font-size: clamp(15px, 4.6cqw, 34px); line-height: 1.02; font-weight: 900; text-transform: uppercase; max-width: 85%; }
.soon .s { color: #a3a3ab; font-size: clamp(11px, 2cqw, 13px); }
.soon .watch { margin-top: 4px; }
.lesson-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 18px 0 10px; }
.lesson-meta small { color: var(--muted); font-size: 13px; }
.lesson-meta h1 { font-size: 26px; margin-top: 2px; }
.btn.is-done { background: var(--card-2); border-color: var(--line-2); color: var(--ok); }
.lesson-body { color: var(--muted); font-size: 15px; margin: 0 0 22px; }
.pager { display: flex; justify-content: space-between; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.locked-panel { text-align: center; padding: 40px 24px; }
.locked-panel .i { width: 34px; height: 34px; color: var(--accent-text); }

/* ---------- community ---------- */
.composer { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; margin-bottom: 14px; color: var(--muted); }
.composer:hover { border-color: var(--line-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.post { padding: 16px 18px; }
.post + .post { margin-top: 12px; }
.post header { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.post header b { font-size: 14px; }
.post header small { display: block; font-size: 12px; color: var(--muted); }
.post header .pin { margin-left: auto; }
.post .post-body { display: block; text-decoration: none; }
.post .post-body h3 { font-size: 17px; margin-bottom: 4px; }
.post .post-body p { margin: 0; color: var(--muted); font-size: 14.5px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post footer { display: flex; gap: 6px; margin-top: 12px; }
.react { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: none;
  cursor: pointer; font-size: 13px; font-weight: 650; color: var(--muted); text-decoration: none; }
.react:hover { color: var(--text); background: var(--hover); }
.react .i { width: 16px; height: 16px; }
.react.on { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.react.on .i { fill: currentColor; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; vertical-align: 1px;
  background: var(--accent); color: var(--on-accent); }
.badge.lvl { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.post-full .post-body h1 { font-size: 24px; margin: 4px 0 10px; }
.post-full .prose { font-size: 15.5px; }
.comments { margin-top: 18px; }
.comment { display: flex; gap: 11px; padding: 12px 0; }
.comment + .comment { border-top: 1px solid var(--line); }
.comment .bubble { flex: 1; min-width: 0; }
.comment .bubble b { font-size: 13.5px; }
.comment .bubble small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.comment .bubble p { margin: 3px 0 0; font-size: 14.5px; }
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.comment-form textarea { min-height: 46px; height: 46px; }

/* ---------- calendar ---------- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 11px; font-weight: 750; color: var(--dim); padding: 6px 0; }
.cal-day { aspect-ratio: 1 / .86; border-radius: 10px; padding: 6px 7px; font-size: 13px; font-weight: 600; color: var(--muted); position: relative; border: 1px solid transparent; }
.cal-day.today { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.cal-day.has::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 4px; border-radius: 99px; background: var(--accent); }
.cal-day.blank { visibility: hidden; }

/* ---------- members ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.person { display: flex; align-items: center; gap: 12px; padding: 14px; }
.person b { display: block; font-size: 14px; }
.person small { display: block; font-size: 12px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--hover); }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who b { display: block; }
.table .who small { display: block; color: var(--muted); font-size: 12px; }
.table .mini-bar { width: 110px; }
.table-wrap { overflow-x: auto; }

/* ---------- editor ---------- */
.ed-module { overflow: hidden; }
.ed-module + .ed-module { margin-top: 14px; }
.ed-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card-2); border-bottom: 1px solid var(--line); }
.ed-head .num { font-size: 11px; font-weight: 850; letter-spacing: .14em; color: var(--accent-text); }
.ed-head h3 { font-size: 16px; }
.ed-head .tools, .ed-lesson .tools { margin-left: auto; display: flex; gap: 4px; flex: none; }
.ed-lesson { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ed-lesson:last-of-type { border-bottom: 0; }
.ed-lesson .n { width: 22px; color: var(--dim); font-size: 12px; font-weight: 700; flex: none; }
.ed-lesson .t { min-width: 0; }
.ed-add { padding: 10px 16px 14px; }

/* ---------- modal and toast ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, .6); overflow-y: auto; }
.modal { width: 100%; max-width: 520px; padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .sub { margin-bottom: 18px; font-size: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.cred { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; padding: 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 200; transform: translateX(-50%); padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35); max-width: calc(100vw - 32px); }

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-layout { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; z-index: 60; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0, 0, 0, .4); }
  .shell.open .side { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .55); }
  .menu-btn { display: inline-flex !important; }
  .top { padding: 0 12px; }
  .page { padding: 20px 16px 80px; }
  h1 { font-size: 25px; }
  .grid-2, .cal-wrap, .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .lesson-list { position: static; max-height: none; order: 2; }
  .lesson-main { order: 1; }
  .hide-sm { display: none !important; }
  .prof { padding: 3px; }
  .table .mini-bar { width: 70px; }
  .table .hide-md { display: none; }
}
@media (max-width: 620px) {
  .modules { grid-template-columns: minmax(0, 1fr); }
  .progress-card { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .lesson-meta { flex-direction: column; }
  .lesson-meta h1 { font-size: 22px; }
  .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tile { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ed-lesson { flex-wrap: wrap; row-gap: 4px; }
  .table .hide-xs { display: none; }
  .table .who small { word-break: break-all; }
  .ed-lesson .t { flex: 1 1 calc(100% - 40px) !important; }
  .ed-lesson .pill { margin-left: 34px; }
  .ed-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* page title row with a button on the right */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 16px; }
.page-head > div:first-child { flex: 1 1 340px; min-width: 0; }
.page-head > .btn { margin: 4px 0 18px; }
.event-row { flex-wrap: wrap; }
.event-row .ev-text { flex: 1 1 150px; min-width: 0; }
.event-row .ev-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.cal-wrap { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
