/* Study Room: a learning community. White top bar with icon tabs (bottom tab bar on phones),
   cards on a cool paper grey, saffron for actions, teal for progress and links.
   The one bold element is the generated cover art each course gets (.art). */
:root {
  --paper: #f4f5f9;
  --surface: #ffffff;
  --ink: #1e2a5a;
  --text: #283048;
  --muted: #687089;
  --line: #e3e6ef;
  --saffron: #f2a93b;
  --saffron-ink: #3a2400;
  --saffron-soft: #fdf1dc;
  --teal: #127c8a;
  --teal-soft: #e2f3f4;
  --rose: #d9485f;
  --good: #23855a;
  --bad: #c0392b;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(30, 42, 90, .06), 0 4px 16px rgba(30, 42, 90, .06);
  --shadow-up: 0 2px 6px rgba(30, 42, 90, .08), 0 12px 28px rgba(30, 42, 90, .1);
  --bar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10131c; --surface: #191d2a; --ink: #e8ebf7; --text: #d8dcea; --muted: #99a0b8; --line: #2a3043;
    --saffron-soft: #3a2c14; --teal: #4fc0cc; --teal-soft: #15343a; --rose: #f07185; --good: #5cc98f; --bad: #f08a7e;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-up: 0 8px 24px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #10131c; --surface: #191d2a; --ink: #e8ebf7; --text: #d8dcea; --muted: #99a0b8; --line: #2a3043;
  --saffron-soft: #3a2c14; --teal: #4fc0cc; --teal-soft: #15343a; --rose: #f07185; --good: #5cc98f; --bad: #f08a7e;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-up: 0 8px 24px rgba(0,0,0,.45); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.6; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; text-wrap: balance; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; height: var(--bar-h); padding: 0 max(16px, env(safe-area-inset-left)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); justify-self: start; }
.brand b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; }
.tabs { display: flex; height: 100%; }
.tabs[hidden] { display: none; }
.tabs button { display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 104px; padding: 0 14px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); cursor: pointer; font-size: .78rem; font-weight: 600; }
.tabs svg { width: 22px; height: 22px; fill: currentColor; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current="page"] { color: var(--ink); border-bottom-color: var(--saffron); }
.tabs button[aria-current="page"] svg { fill: var(--saffron); }
.top-right { display: flex; align-items: center; gap: 8px; justify-self: end; min-width: 0; }
.admin-menu { position: relative; }
.admin-menu[hidden] { display: none; }
.admin-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.admin-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-up); padding: 6px; display: grid; z-index: 40; }
.admin-menu .menu button { background: none; border: 0; text-align: left; padding: 9px 12px; border-radius: 8px; font-weight: 600; color: var(--ink); cursor: pointer; }
.admin-menu .menu button:hover { background: var(--paper); }
.who { font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip-btn:hover { border-color: var(--ink); }
.chip-btn.ghost { color: var(--muted); }
@media (max-width: 1080px) { .who { display: none; } }
@media (max-width: 900px) {
  .topbar-in { grid-template-columns: auto 1fr; height: 56px; }
  /* Tabs become an app-style bottom bar on phones and tablets. */
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; height: auto; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 30; }
  .tabs button { flex: 1; min-width: 0; padding: 8px 4px 6px; border-bottom: 0; border-top: 3px solid transparent; }
  .tabs button[aria-current="page"] { border-top-color: var(--saffron); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) { .brand b { font-size: 1rem; } }

/* ---------- page frame ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
main.wrap { padding-block: 24px 64px; display: grid; gap: 22px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.9rem; font-weight: 800; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.layout3 { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.layout3 > .rail { position: sticky; top: calc(var(--bar-h) + 20px); display: grid; gap: 16px; }
@media (max-width: 1180px) { .layout3 { grid-template-columns: minmax(0, 1fr) 300px; } .layout3 > .rail-left { display: none; } }
@media (max-width: 900px) { .cols, .layout3 { grid-template-columns: minmax(0, 1fr); } .layout3 > .rail { position: static; } }
.stack { display: grid; gap: 18px; min-width: 0; align-content: start; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* ---------- surfaces ---------- */
.panel, .side-card, .post, aside.feed, .lessons { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel { padding: 20px; display: grid; gap: 14px; }
.side-card { padding: 18px; display: grid; gap: 12px; align-content: start; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.side-head h2, .side-head h3 { font-size: 1.05rem; }
.empty { border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 32px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; background: var(--surface); }
.empty b { color: var(--ink); }
.eyebrow { font-size: .85rem; color: var(--muted); font-weight: 600; }
.meta { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.note { font-size: .86rem; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); white-space: nowrap; }
.tag.saffron { background: var(--saffron-soft); color: #9a5b00; }
.tag.live { background: var(--rose); color: #fff; }
.msg { font-size: .9rem; padding: 10px 14px; border-radius: var(--r-md); background: var(--teal-soft); color: var(--ink); }
.msg.err { background: #fde8e6; color: var(--bad); }

/* ---------- buttons and forms ---------- */
.btn { font-weight: 700; border-radius: 10px; padding: 9px 18px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--saffron); border-color: var(--saffron); color: var(--saffron-ink); }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.block { width: 100%; }
.btn.small { padding: 5px 12px; font-size: .82rem; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
a.btn { display: inline-flex; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 700; cursor: pointer; justify-self: start; font-size: .88rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .88rem; color: var(--ink); }
input[type=text], input[type=tel], input[type=url], input[type=number], input[type=datetime-local], input[type=search], textarea, select {
  font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--text); width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 0; background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
input[type=date] { font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--text); width: 100%; min-width: 0; cursor: pointer; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .8; }

/* Time picker: hour and minute steppers with AM/PM. */
.tp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-col { display: grid; justify-items: center; gap: 2px; }
.tp-val:focus-visible { outline: 2px solid var(--teal); }
.tp-arrow { width: 52px; height: 34px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; cursor: pointer; font-size: .7rem; line-height: 1; }
.tp-arrow:hover { border-color: var(--teal); color: var(--teal); }
.tp-val { width: 52px; text-align: center; font-size: 1.4rem; font-weight: 800; color: var(--ink); background: var(--paper); border-radius: 8px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.tp-colon { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.tp-ampm { display: inline-flex; background: var(--paper); padding: 4px; border-radius: 10px; gap: 4px; margin-left: 4px; }
.tp-ap { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tp-ap[aria-pressed="true"] { background: var(--saffron); color: var(--saffron-ink); }

/* ---------- generated course art (the signature element) ---------- */
.art { --h: 220; position: relative; overflow: hidden; aspect-ratio: 16/9; border-radius: var(--r-md); color: #fff; display: grid; align-content: end; padding: 14px 16px;
  background:
    radial-gradient(120% 90% at 100% 0%, hsl(calc(var(--h) + 40) 80% 62% / .9), transparent 60%),
    linear-gradient(135deg, hsl(var(--h) 62% 30%), hsl(calc(var(--h) + 25) 70% 42%)); }
.art::before { content: ""; position: absolute; inset: 0; opacity: .14;
  background-image: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 14px); }
.art .art-mono { position: absolute; right: 12px; top: 2px; font-size: 4.6rem; font-weight: 800; letter-spacing: -.05em; opacity: .28; line-height: 1; }
.art .art-title { position: relative; font-weight: 800; font-size: 1.05rem; line-height: 1.25; text-shadow: 0 1px 2px rgba(0,0,0,.25); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art.mini { aspect-ratio: 16/10; padding: 6px 8px; border-radius: 10px; }
.art.mini .art-mono { font-size: 2rem; right: 6px; top: 0; opacity: .5; }
.art.mini .art-title { display: none; }
.art.photo { padding: 0; background: var(--paper); }
.art.photo::before { display: none; }
.art.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-btn { position: absolute; top: 10px; left: 10px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.cover-edit { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; margin-left: 18px; }
.cover-edit .art { aspect-ratio: 16/9; padding: 6px 8px; border-radius: 8px; }
.cover-edit .art .art-mono { font-size: 2rem; } .cover-edit .art .art-title { display: none; }
.thumb { aspect-ratio: 16/9; max-width: 100%; border-radius: var(--r-md); background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; padding: 12px; text-align: center; overflow: hidden; }

/* ---------- progress ---------- */
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }

/* ---------- community: profile rail ---------- */
.profile { display: grid; gap: 14px; justify-items: start; }
.profile .who-row { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .95rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; background: linear-gradient(135deg, var(--ink), var(--teal)); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.stat { background: var(--paper); border-radius: var(--r-md); padding: 10px 12px; }
.stat b { display: block; font-size: 1.25rem; color: var(--ink); font-weight: 800; line-height: 1.2; }
.stat span { font-size: .78rem; color: var(--muted); }
.rail-links { display: grid; gap: 4px; width: 100%; }
.rail-links button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 10px; padding: 9px 10px; color: var(--text); font-weight: 600; cursor: pointer; text-align: left; }
.rail-links button:hover { background: var(--paper); color: var(--ink); }
.rail-links .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--saffron); }

/* ---------- workshops: today, upcoming strip, list ---------- */
.today { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.today .ribbon { background: var(--teal); color: #fff; writing-mode: vertical-rl; transform: rotate(180deg); display: grid; place-items: center; font-weight: 800; font-size: .8rem; letter-spacing: .12em; }
.today .ribbon.live { background: var(--rose); }
.today .body { padding: 14px 16px; display: grid; gap: 4px; min-width: 0; }
.today .body b { color: var(--ink); font-size: 1.02rem; }
.today .side { padding: 14px 16px; display: grid; gap: 6px; justify-items: end; align-content: center; }
.countdown { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.countdown b { color: var(--rose); }
@media (max-width: 560px) { .today { grid-template-columns: 36px minmax(0, 1fr); } .today .side { grid-column: 2; justify-items: start; padding-top: 0; } }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }
.ws-list { display: grid; gap: 12px; }
.ws { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.ws-date { display: grid; justify-items: center; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); line-height: 1.1; }
.ws-date span { width: 100%; text-align: center; background: var(--teal); color: #fff; font-size: .68rem; font-weight: 800; padding: 3px 0; }
.ws-date b { font-size: 1.35rem; color: var(--ink); padding: 4px 0 2px; }
.ws-date em { font-style: normal; font-size: .68rem; color: var(--muted); padding-bottom: 4px; }
.ws-actions { display: grid; gap: 8px; justify-items: end; }
@media (max-width: 560px) { .ws { grid-template-columns: 56px minmax(0, 1fr); } .ws-actions { grid-column: 1 / -1; justify-items: start; } }
.seg { display: inline-flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: none; padding: 7px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- community: feed ---------- */
.feed-head { display: flex; justify-content: space-between; align-items: center; }
.feed-head h2 { font-size: 1.35rem; }
.feed-list { display: grid; gap: 16px; }
.post { padding: 18px; display: grid; gap: 12px; min-width: 0; }
.post-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.post-head b { color: var(--ink); }
.post-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.post h3 { font-size: 1.08rem; }
.post-video { border-radius: var(--r-md); overflow: hidden; }
.play { position: relative; width: 100%; border: 0; padding: 0; cursor: pointer; display: block; color: #fff; }
.play .art { border-radius: 0; aspect-ratio: 16/8; }
.play .play-icon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--ink); display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s; }
.play .play-icon svg { width: 26px; height: 26px; margin-left: 4px; fill: currentColor; }
.play:hover .play-icon { transform: translate(-50%, -50%) scale(1.07); }
.play .dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.feed-more { text-align: center; padding: 10px; }
.composer { display: flex; gap: 12px; align-items: center; }
.composer button { flex: 1; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; color: var(--muted); cursor: pointer; }

/* ---------- right rail ---------- */
.mini-course { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; align-items: center; background: none; border: 0; border-top: 1px solid var(--line); padding: 12px 0 0; color: inherit; text-align: left; cursor: pointer; }
.mini-course b { color: var(--ink); font-size: .92rem; }
.mini-course:hover b { color: var(--teal); }
.continue-mini { display: grid; grid-template-columns: minmax(0, 1fr) 100px; gap: 12px; align-items: center; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.continue-mini b { color: var(--ink); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.leaders { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.leaders li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md); }
.rank { width: 26px; height: 26px; border-radius: 50%; background: var(--paper); color: var(--ink); font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.rank.r1 { background: #f6c64b; color: #4a3200; } .rank.r2 { background: #cfd5df; } .rank.r3 { background: #e3a979; color: #3d1f06; }
.leaders .pts { font-size: .78rem; font-weight: 700; color: var(--teal); background: var(--teal-soft); padding: 2px 8px; border-radius: 999px; }

/* ---------- courses ---------- */
.toolbar { display: grid; gap: 12px; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: var(--muted); }
.search input { padding-left: 42px; background: var(--surface); height: 46px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .85rem; color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.course { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 12px; align-content: start; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.course:hover { box-shadow: var(--shadow-up); transform: translateY(-2px); }
.course h3 { font-size: 1.08rem; padding: 0 4px; }
.course .meta, .course .bar-row { padding: 0 4px; }
.course .bar-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.course .desc { padding: 0 4px; font-size: .88rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .course, .play .play-icon { transition: none; } .course:hover { transform: none; } }

/* ---------- course page and player ---------- */
.hero { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow); }
.hero h1 { font-size: 1.7rem; font-weight: 800; }
@media (max-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.player { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 960px) { .player { grid-template-columns: minmax(0, 1fr); } }
iframe.vid { width: 100%; max-width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r-lg); background: #000; display: block; }
.lessons { overflow: hidden; }
.lessons h3 { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.section-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); font-weight: 700; font-size: .88rem; color: var(--ink); }
.lesson { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); width: 100%; background: none; color: inherit; text-align: left; cursor: pointer; }
.lesson:last-child { border-bottom: 0; }
.lesson:hover { background: var(--paper); }
.lesson.on { background: var(--teal-soft); font-weight: 700; color: var(--ink); }
/* Progress ring: fills clockwise with the share of the video watched (--p, 0–100). */
.tick { --p: 0; position: relative; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff;
  background: conic-gradient(var(--teal) calc(var(--p) * 1%), var(--line) 0); }
.tick::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.lesson:hover .tick::after { background: var(--paper); }
.lesson.on .tick::after { background: var(--teal-soft); }
.tick.done { background: var(--good); }
.tick.done::after { display: none; }
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.crumbs button { background: none; border: 0; color: var(--teal); cursor: pointer; padding: 0; font-weight: 700; }
aside.feed { padding: 16px; display: grid; gap: 12px; }
.feed ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feed li { font-size: .9rem; display: grid; gap: 2px; }
.feed time { font-size: .78rem; color: var(--muted); }

/* ---------- Description / Resources / QnA tabs under the video ---------- */
.ltabs-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.ltabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.ltabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 14px 12px 11px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ltabs button:hover { color: var(--ink); }
.ltabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.ltab-count { font-size: .72rem; background: var(--paper); color: var(--muted); border-radius: 999px; padding: 1px 8px; }
.ltab-body { padding: 18px; display: grid; gap: 14px; }
.ltab-body a:not(.btn) { color: var(--teal); overflow-wrap: anywhere; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.res-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.res-icon { font-size: 1.3rem; text-align: center; }
.res-form { display: grid; gap: 10px; padding: 14px; border: 1.5px dashed var(--line); border-radius: var(--r-md); }
.qna-ask { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.qna { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.qna-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.qna-answers { display: grid; gap: 10px; margin-left: 54px; padding-left: 12px; border-left: 2px solid var(--line); }
.qna-answers .avatar { width: 34px; height: 34px; font-size: .8rem; }
.qna-answers .qna-item { grid-template-columns: 34px minmax(0, 1fr) auto; }
.avatar.admin { background: var(--saffron); color: var(--saffron-ink); }
.qna-reply { display: flex; gap: 8px; margin-left: 54px; }
@media (max-width: 560px) {
  .qna-ask { grid-template-columns: minmax(0, 1fr); } .qna-ask .avatar { display: none; }
  .qna-answers, .qna-reply { margin-left: 0; }
  .res-list li { grid-template-columns: 28px minmax(0, 1fr); } .res-list li > .row { grid-column: 1 / -1; }
}

/* ---------- admin lists ---------- */
.manage-list { display: grid; gap: 8px; }
.manage-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.manage-item .row { justify-content: flex-end; }
@media (max-width: 560px) { .manage-item { grid-template-columns: minmax(0, 1fr); } .manage-item .row { justify-content: flex-start; flex-wrap: wrap; } }
details.batch { display: grid; gap: 6px; }
details.batch[open] > :not(summary) { margin-top: 6px; }
details.batch > summary { cursor: pointer; list-style: none; }
details.batch > summary::-webkit-details-marker { display: none; }
details.batch > summary b::before { content: "▸ "; color: var(--muted); }
details.batch[open] > summary b::before { content: "▾ "; }

/* ---------- sign in ---------- */
.auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 980px; width: 100%; margin: 24px auto; background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-up); border: 1px solid var(--line); }
.auth-side { position: relative; padding: 40px; color: #fff; display: grid; gap: 18px; align-content: center; background: radial-gradient(90% 70% at 100% 0%, rgba(242,169,59,.55), transparent 60%), linear-gradient(150deg, #1e2a5a, #127c8a); overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: 0; opacity: .1; background-image: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 16px); }
.auth-side > * { position: relative; }
.auth-side h2 { color: #fff; font-size: 2rem; font-weight: 800; line-height: 1.15; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.auth-side li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .95rem; }
.auth-side li i { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-style: normal; }
.auth { padding: 40px; display: grid; gap: 16px; align-content: center; }
.auth h1 { font-size: 1.6rem; font-weight: 800; }
@media (max-width: 760px) { .auth-wrap { grid-template-columns: minmax(0, 1fr); margin: 0; } .auth-side { padding: 28px 24px; } .auth-side h2 { font-size: 1.5rem; } .auth-side ul { display: none; } .auth { padding: 24px; } }
