/* ============ PORTAL ============ */
body.portal { background: var(--sand-100); min-height: 100vh; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sidebar ---------- */
.side {
  position: fixed; inset-block: 0; right: 0; width: 264px; z-index: 50; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px;
  background: var(--forest-900); color: var(--pearl);
  background-image: radial-gradient(400px 300px at 100% 0%, rgba(79,174,149,.18), transparent 70%), radial-gradient(300px 300px at 0% 100%, rgba(196,154,90,.12), transparent 70%);
}
.side-logo { padding: 4px 10px 10px; font-size: 1.45rem; }
.side-nav { display: grid; gap: 3px; overflow-y: auto; }
.side-nav .grp { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; opacity: .45; padding: 16px 12px 6px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: .95rem;
  color: rgba(251,248,243,.72); transition: background .25s, color .25s;
}
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item:hover { background: rgba(255,255,255,.06); color: var(--pearl); }
.nav-item.active { background: rgba(255,255,255,.1); color: var(--pearl); }
.nav-item.active::before { content: ""; position: absolute; right: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px 0 0 3px; background: var(--gold-400); }
.nav-item .badge { margin-inline-start: auto; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--gold-400); color: var(--forest-950); font-weight: 600; }
.nav-item .badge--live { background: #e04a2a; color: #fff; }
.side-card { margin-top: auto; padding: 18px; border-radius: var(--r-md); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); display: grid; gap: 6px; justify-items: start; }
.side-card b { font-family: var(--f-display); font-weight: 400; font-size: 1.1rem; }
.side-card small { opacity: .6; margin-bottom: 8px; }
body:not(.is-admin) .admin-only { display: none !important; }

/* ---------- shell ---------- */
.shell { margin-right: 264px; min-height: 100vh; display: flex; flex-direction: column; min-width: 0; overflow-x: clip; }
.top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 32px;
  background: rgba(246, 240, 230, .82); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; min-width: 0; max-width: 460px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); transition: box-shadow .3s, border-color .3s; }
.search:focus-within { border-color: var(--teal-400); box-shadow: 0 0 0 4px rgba(79,174,149,.15); }
.search svg { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.search input { flex: 1; width: 100%; border: 0; outline: 0; background: none; min-width: 0; }
.search kbd { font: inherit; font-size: .72rem; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--ink-3); }
.search-results { position: absolute; top: calc(100% + 8px); inset-inline: 0; background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 8px; max-height: 60vh; overflow: auto; }
.sr-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; }
.sr-item:hover, .sr-item.on { background: var(--sage-100); }
.sr-item mark { background: var(--gold-200); color: inherit; border-radius: 3px; padding: 0 2px; }
.sr-item small { display: block; color: var(--ink-3); font-size: .8rem; }
.sr-thumb { width: 44px; height: 44px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-family: var(--f-display); font-size: 1.2rem; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.role-switch { display: flex; padding: 3px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); }
.role-switch button { padding: 6px 14px; border-radius: 999px; font-size: .85rem; color: var(--ink-2); transition: background .25s, color .25s; }
.role-switch button.on { background: var(--forest-900); color: var(--pearl); }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--white); border: 1px solid var(--line); transition: background .2s; }
.icon-btn:hover { background: var(--sage-100); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: 9px; left: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--clay-500); box-shadow: 0 0 0 2px var(--white); }
.pop-wrap { position: relative; }
.pop { position: absolute; top: calc(100% + 10px); left: 0; width: 340px; background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 8px; z-index: 60; }
.pop h4 { font-family: var(--f-body); font-size: .8rem; font-weight: 600; color: var(--ink-3); padding: 8px 10px; }
.pop a { display: block; padding: 10px; border-radius: 10px; font-size: .92rem; }
.pop a:hover { background: var(--sage-100); }
.pop a small { display: block; color: var(--ink-3); font-size: .78rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 600; font-size: .95rem; color: #fff; background: hsl(var(--ah, 158) 38% 42%); }
.avatar--me { background: linear-gradient(135deg, var(--gold-400), var(--clay-500)); }
.avatar--sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar--doc { background: var(--forest-900); color: var(--gold-400); box-shadow: 0 0 0 2px var(--gold-400); }

.view { flex: 1; padding: 32px; outline: none; max-width: 1400px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); font-weight: 400; }
.page-head p { color: var(--ink-2); margin-top: 6px; font-weight: 300; }
.crumb { font-size: .85rem; color: var(--ink-3); display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.crumb a:hover { color: var(--teal-500); }

.card { background: var(--white); border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 24px; }
.card h3 { font-size: 1.35rem; font-weight: 400; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head a { font-size: .88rem; color: var(--teal-500); font-weight: 500; }
.muted { color: var(--ink-3); }
.grid { display: grid; gap: 20px; }
.grid > *, .home-grid > *, .rec-list > *, .result-grid > *, .live-layout > *, .lesson-layout > *, .charts > *, .builder > * { min-width: 0; }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.hello { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.hello h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 300; }
.hello h1 em { font-style: italic; color: var(--teal-500); }
.hello p { color: var(--ink-2); font-weight: 300; margin-top: 4px; }
.streak { display: flex; gap: 10px; }
.streak-pill { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: .9rem; }
.streak-pill b { font-family: var(--f-display); font-size: 1.3rem; font-weight: 500; }
.continue {
  position: relative; overflow: hidden; border-radius: var(--r-xl); color: var(--pearl); min-height: 340px; display: grid; grid-template-columns: 1.2fr 1fr; isolation: isolate;
  background: var(--forest-900);
}
.continue-art { position: relative; overflow: hidden; }
.continue-info { padding: 34px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.continue-info small { color: var(--sage-300); letter-spacing: .1em; font-size: .78rem; }
.continue-info h2 { font-size: clamp(1.8rem, 2.6vw, 2.4rem); font-weight: 300; }
.continue-info p { color: rgba(251,248,243,.65); font-weight: 300; }
.pbar { height: 5px; border-radius: 5px; background: rgba(14,34,36,.1); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(270deg, var(--teal-400), var(--gold-400)); transition: width 1s var(--ease-out); }
.continue .pbar { background: rgba(255,255,255,.14); margin: 8px 0 14px; }
.mesh { position: absolute; inset: 0; background:
  radial-gradient(circle at 25% 30%, hsl(var(--h, 158) 45% 52% / .85), transparent 50%),
  radial-gradient(circle at 75% 70%, hsl(calc(var(--h, 158) + 50) 50% 60% / .7), transparent 55%),
  radial-gradient(circle at 60% 20%, rgba(217,183,126,.55), transparent 45%),
  var(--forest-800);
  background-size: 180% 180%; animation: mesh 14s ease-in-out infinite alternate; }
@keyframes mesh { 0% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }
.mesh-play { position: absolute; inset: 0; display: grid; place-items: center; }
.mesh-play span { width: 82px; height: 82px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(10px); transition: transform .5s var(--ease-out); }
.mesh-play svg { width: 28px; height: 28px; margin-left: -4px; color: #fff; }
.continue:hover .mesh-play span { transform: scale(1.1); }
.mesh-num { position: absolute; bottom: 10px; inset-inline-start: 22px; font-family: var(--f-display); font-size: 7rem; line-height: 1; color: rgba(255,255,255,.22); font-weight: 300; }

.ring-card { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.ring-card svg { width: 116px; height: 116px; }
.ring-card .ring-track { stroke: var(--sage-100); stroke-width: 10; }
.ring-card .ring-val { stroke: url(#ringGrad); stroke-width: 10; transition: stroke-dashoffset 1.4s var(--ease-out); }
.ring-txt { font-family: var(--f-display); font-size: 26px; fill: var(--ink); stroke: none; }
.stats-list { display: grid; gap: 8px; font-size: .92rem; color: var(--ink-2); }
.stats-list b { color: var(--ink); font-weight: 600; }

.think { background: linear-gradient(150deg, var(--gold-200), var(--sand-200)); border: 0; }
.think h3 { font-size: 1.15rem; color: #7a5a24; font-family: var(--f-body); font-weight: 600; font-size: .85rem; letter-spacing: .08em; }
.think p { font-family: var(--f-display); font-size: 1.4rem; line-height: 1.35; margin-top: 10px; }

.feed { display: grid; gap: 14px; }
.feed-item { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; }
.feed-item b { font-weight: 600; }
.feed-item p { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-item small { color: var(--ink-3); font-size: .78rem; }

.pl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pl-card { border-radius: var(--r-lg); overflow: hidden; background: var(--white); border: 1px solid var(--line); transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); display: block; }
.pl-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.pl-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.pl-cover .mesh { animation-duration: 20s; }
.pl-count { position: absolute; bottom: 10px; left: 10px; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(7,23,26,.55); color: #fff; font-size: .78rem; backdrop-filter: blur(6px); }
.pl-count svg { width: 14px; height: 14px; }
.pl-body { padding: 14px 16px 18px; }
.pl-body h4 { font-family: var(--f-display); font-size: 1.25rem; font-weight: 400; }
.pl-body p { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }
.intake-cta { display: flex; align-items: center; gap: 20px; background: var(--forest-900); color: var(--pearl); border: 0; }
.intake-cta h3 { color: var(--pearl); }
.intake-cta p { color: rgba(251,248,243,.7); font-weight: 300; font-size: .95rem; margin: 4px 0 14px; }
.intake-cta svg.big { width: 74px; height: 74px; color: var(--gold-400); flex: none; stroke-width: 1.2; }

/* ---------- course ---------- */
.course-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 40px; color: var(--pearl); background: var(--forest-900); margin-bottom: 28px; isolation: isolate; }
.course-hero .mesh { z-index: -1; opacity: .7; }
.course-hero small { color: var(--sage-200); letter-spacing: .12em; }
.course-hero h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 300; margin: 8px 0 12px; }
.course-hero p { max-width: 560px; color: rgba(251,248,243,.78); font-weight: 300; }
.course-hero .pbar { max-width: 380px; margin-top: 20px; background: rgba(255,255,255,.18); }
.chapter { margin-bottom: 18px; }
.chapter-head { display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer; }
.chapter-num { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-family: var(--f-display); font-size: 1.5rem; background: var(--sage-100); color: var(--teal-600); flex: none; }
.chapter.locked .chapter-num { background: var(--sand-200); color: var(--ink-3); }
.chapter-head h3 { font-size: 1.4rem; font-weight: 400; }
.chapter-head small { color: var(--ink-3); }
.chapter-head .chev { margin-inline-start: auto; width: 22px; height: 22px; transition: transform .4s var(--ease-out); color: var(--ink-3); }
.chapter.open .chev { transform: rotate(180deg); }
.chapter-body { display: none; padding: 0 16px 16px; }
.chapter.open .chapter-body { display: block; }
.lesson-row { min-width: 0; display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: 14px; transition: background .2s; }
.lesson-row:hover { background: var(--sand-100); }
.lr-thumb { position: relative; width: 112px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; flex: none; }
.lr-thumb .mesh { animation: none; }
.lr-thumb b { position: absolute; bottom: 4px; inset-inline-start: 8px; color: rgba(255,255,255,.85); font-family: var(--f-display); font-size: 1.6rem; font-weight: 300; }
.lr-main { flex: 1; min-width: 0; }
.lr-main h4 { font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; }
.lr-main p { font-size: .88rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-main .pbar { height: 3px; margin-top: 8px; max-width: 220px; }
.lr-state { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); flex: none; color: var(--ink-3); }
.lr-state svg { width: 16px; height: 16px; }
.lr-state.done { background: var(--teal-500); border-color: var(--teal-500); color: #fff; }
.lr-dur { font-size: .82rem; color: var(--ink-3); font-variant-numeric: tabular-nums; direction: ltr; }
.extra-row .lr-thumb { display: grid; place-items: center; background: var(--gold-200); color: #7a5a24; }
.extra-row .lr-thumb svg { width: 30px; height: 30px; }
.locked-list { list-style: none; margin: 0; padding: 0 12px 6px; display: grid; gap: 6px; }
.locked-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--sand-100); color: var(--ink-2); font-size: .93rem; }
.locked-list svg { width: 16px; height: 16px; color: var(--ink-3); }

/* ---------- lesson / player ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.player { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #071315; color: #fff; aspect-ratio: 16 / 9; box-shadow: var(--shadow-lg); isolation: isolate; user-select: none; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; }
.player .mesh { z-index: -2; animation-play-state: paused; }
.player.playing .mesh { animation-play-state: running; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: -1; }
.stage-particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.stage-badge { position: absolute; top: 16px; inset-inline-start: 16px; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(7,23,26,.45); backdrop-filter: blur(10px); font-size: .85rem; }
.stage-badge .avatar { width: 30px; height: 30px; font-size: .75rem; }
.wave { display: flex; gap: 3px; align-items: center; height: 16px; }
.wave i { width: 3px; height: 30%; border-radius: 3px; background: var(--gold-400); }
.player.playing .wave i { animation: wave .9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .15s !important; } .wave i:nth-child(3) { animation-delay: .3s !important; } .wave i:nth-child(4) { animation-delay: .45s !important; }
@keyframes wave { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.stage-preview { position: absolute; top: 16px; left: 16px; font-size: .72rem; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.12); backdrop-filter: blur(8px); opacity: .8; }
.stage-title { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 10%; gap: 10px; transition: opacity .6s; }
.stage-title small { letter-spacing: .2em; color: var(--sage-200); font-size: .8rem; }
.stage-title h2 { font-size: clamp(1.8rem, 4vw, 3.4rem); font-weight: 300; }
.player.started .stage-title { opacity: 0; pointer-events: none; }
.caption { position: absolute; inset-inline: 8%; bottom: 92px; text-align: center; font-family: var(--f-display); font-size: clamp(1.1rem, 2.6vw, 2.1rem); line-height: 1.35; font-weight: 400; text-shadow: 0 2px 24px rgba(0,0,0,.55); }
.caption .cw { display: inline-block; opacity: 0; transform: translateY(12px); filter: blur(6px); transition: opacity .5s, transform .6s var(--ease-out), filter .5s; }
.caption .cw.in { opacity: 1; transform: none; filter: none; }
.player.cc-off .caption { display: none; }
.player.has-video .caption { bottom: 80px; font-size: clamp(.95rem, 2vw, 1.4rem); background: none; }
.big-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); backdrop-filter: blur(12px); transition: transform .4s var(--ease-out), opacity .3s; z-index: 2; }
.big-play svg { width: 32px; height: 32px; margin-left: -4px; }
.big-play:hover { transform: scale(1.08); }
.player.playing .big-play { opacity: 0; pointer-events: none; transform: scale(1.3); }
.player.started:not(.playing) .stage-title { opacity: 0; }
.controls { position: absolute; inset-inline: 0; bottom: 0; padding: 40px 18px 14px; background: linear-gradient(transparent, rgba(4,12,13,.75)); display: grid; gap: 10px; transition: opacity .4s, transform .4s; z-index: 3; }
.player.playing.idle .controls { opacity: 0; transform: translateY(10px); }
.player.playing.idle { cursor: none; }
.scrub { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; direction: ltr; touch-action: none; }
.scrub-track { position: relative; height: 4px; width: 100%; border-radius: 4px; background: rgba(255,255,255,.22); transition: height .2s; }
.scrub:hover .scrub-track { height: 6px; }
.scrub-buf { position: absolute; inset-block: 0; left: 0; border-radius: inherit; background: rgba(255,255,255,.25); }
.scrub-fill { position: absolute; inset-block: 0; left: 0; border-radius: inherit; background: var(--gold-400); }
.scrub-knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(217,183,126,.4); transform: scale(0); transition: transform .2s; }
.scrub:hover .scrub-knob, .scrub.drag .scrub-knob { transform: scale(1); }
.scrub-mark { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1.5px; background: rgba(7,19,21,.9); border-radius: 2px; }
.scrub-tip { position: absolute; bottom: 22px; translate: -50% 0; padding: 4px 10px; border-radius: 8px; background: rgba(7,19,21,.9); font-size: .75rem; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .2s; direction: rtl; }
.scrub:hover .scrub-tip { opacity: 1; }
.ctrl-row { display: flex; align-items: center; gap: 6px; direction: ltr; }
.ctrl { height: 38px; min-width: 38px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; color: #fff; transition: background .2s; font-size: .85rem; font-weight: 500; }
.ctrl:hover { background: rgba(255,255,255,.14); }
.ctrl svg { width: 20px; height: 20px; }
.ctrl.on { color: var(--gold-400); }
.ctrl-time { font-size: .85rem; font-variant-numeric: tabular-nums; opacity: .85; margin: 0 8px; }
.ctrl-chapter { font-size: .85rem; opacity: .75; direction: rtl; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-next { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 14px; background: rgba(4,12,13,.78); backdrop-filter: blur(6px); z-index: 4; }
.up-next h3 { font-size: 1.8rem; font-weight: 300; }
.up-next .count { width: 84px; height: 84px; margin: 0 auto; position: relative; display: grid; place-items: center; font-size: 1.6rem; font-family: var(--f-display); }
.up-next .count svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.up-next .row { display: flex; gap: 10px; justify-content: center; }

.lesson-meta { margin-top: 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.lesson-meta h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 400; }
.lesson-meta p { color: var(--ink-2); margin-top: 6px; font-weight: 300; }
.lesson-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn--line { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--line:hover { background: var(--sage-100); }
.btn--line svg, .btn svg { width: 18px; height: 18px; }
.btn--line.on { background: var(--sage-100); color: var(--teal-600); box-shadow: inset 0 0 0 1px var(--teal-400); }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--sand-200); margin-bottom: 14px; }
.tabs button { flex: 1; white-space: nowrap; padding: 9px 6px; border-radius: 10px; font-size: .9rem; color: var(--ink-2); transition: background .25s, color .25s; }
.tabs button.on { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }
.side-panel { position: sticky; top: 90px; padding: 16px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.panel-body { overflow-y: auto; flex: 1; min-height: 0; margin: 0 -6px; padding: 0 6px; }
.tline { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 10px; border-radius: 12px; cursor: pointer; transition: background .25s; font-size: .93rem; color: var(--ink-2); }
.tline:hover { background: var(--sand-100); }
.tline.on { background: var(--sage-100); color: var(--ink); }
.tline time { font-size: .78rem; color: var(--teal-500); font-variant-numeric: tabular-nums; padding-top: 2px; direction: ltr; text-align: right; }
.tline.mark-start { margin-top: 10px; }
.tline-chapter { font-size: .72rem; letter-spacing: .12em; color: var(--ink-3); padding: 12px 10px 2px; font-weight: 600; }
.up-list { display: grid; gap: 6px; }
.up-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; transition: background .2s; }
.up-item:hover { background: var(--sand-100); }
.up-item.on { background: var(--sage-100); }
.up-item .lr-thumb { width: 84px; }
.up-item h5 { margin: 0; font-family: var(--f-display); font-size: 1rem; font-weight: 400; }
.up-item small { color: var(--ink-3); font-size: .78rem; }
.notes-form { display: grid; gap: 8px; margin-bottom: 14px; }
.notes-form textarea, .field textarea, .field input[type=text], .field select, .input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--pearl); resize: vertical; outline: none; transition: border-color .2s, box-shadow .2s; }
.notes-form textarea:focus, .field textarea:focus, .field input:focus, .input:focus { border-color: var(--teal-400); box-shadow: 0 0 0 4px rgba(79,174,149,.15); }
.note { padding: 12px 14px; border-radius: 12px; background: var(--gold-200); margin-bottom: 8px; font-size: .92rem; }
.note button { font-size: .78rem; color: #7a5a24; font-weight: 600; direction: ltr; }
.res-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; font-size: .93rem; transition: background .2s; width: 100%; text-align: start; }
.res-item:hover { background: var(--sand-100); }
.res-item svg { width: 20px; height: 20px; color: var(--teal-500); }

/* ---------- extras: reflect, quiz, task ---------- */
.reflect { position: relative; overflow: hidden; border-radius: var(--r-xl); min-height: 70vh; display: grid; place-content: center; text-align: center; padding: 60px 8%; color: var(--pearl); background: var(--forest-900); isolation: isolate; }
.reflect .mesh { z-index: -1; opacity: .6; }
.reflect p { font-family: var(--f-display); font-size: clamp(1.3rem, 2.6vw, 2.1rem); font-weight: 300; line-height: 1.4; opacity: 0; }
.reflect .q { margin-top: 30px; font-size: clamp(1.6rem, 3.2vw, 2.8rem); color: var(--gold-400); }
.breath { width: 120px; height: 120px; margin: 0 auto 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center; font-size: .85rem; position: relative; }
.breath::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(217,183,126,.5), transparent 70%); animation: breath 10s ease-in-out infinite; }
@keyframes breath { 0%, 100% { transform: scale(.6); } 40% { transform: scale(1.25); } }
.quiz-wrap { max-width: 720px; margin: 0 auto; }
.quiz-q { font-family: var(--f-display); font-size: 1.8rem; font-weight: 400; margin: 10px 0 22px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--white); text-align: start; font-size: 1rem; transition: border-color .2s, background .2s, transform .3s var(--ease-out); display: flex; align-items: center; gap: 12px; }
.quiz-opt:hover:not(:disabled) { border-color: var(--teal-400); transform: translateX(-4px); }
.quiz-opt .k { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--sand-100); font-weight: 600; font-size: .85rem; flex: none; }
.quiz-opt.right { border-color: var(--teal-500); background: var(--sage-100); }
.quiz-opt.right .k { background: var(--teal-500); color: #fff; }
.quiz-opt.wrong { border-color: var(--clay-500); background: #fbeae4; }
.quiz-steps { display: flex; gap: 6px; }
.quiz-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--sand-200); }
.quiz-steps i.on { background: var(--teal-500); }
.task-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; }
.field label small { display: block; font-weight: 400; color: var(--ink-3); font-size: .88rem; }
.saved-hint { font-size: .82rem; color: var(--teal-500); opacity: 0; transition: opacity .3s; }
.saved-hint.on { opacity: 1; }

/* ---------- playlists page ---------- */
.pl-hero { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: end; margin-bottom: 28px; }
.pl-hero .pl-cover { border-radius: var(--r-lg); box-shadow: var(--shadow-lg); aspect-ratio: 1; }
.pl-hero h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 300; }
.pl-hero p { color: var(--ink-2); margin: 8px 0 18px; }
.pl-list .lesson-row { cursor: pointer; }
.pl-idx { width: 24px; text-align: center; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- community ---------- */
.chat-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 240px; height: calc(100vh - 72px - 64px); min-height: 520px; border-radius: var(--r-lg); overflow: hidden; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.ch-list { background: var(--sand-100); border-left: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.ch-list h4 { font-family: var(--f-body); font-size: .72rem; letter-spacing: .14em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; }
.ch-btn { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; font-size: .95rem; color: var(--ink-2); text-align: start; transition: background .2s; }
.ch-btn:hover { background: rgba(14,34,36,.05); }
.ch-btn.on { background: var(--white); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.ch-btn .hash { color: var(--ink-3); }
.ch-btn .unread { margin-inline-start: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--clay-500); color: #fff; font-size: .7rem; display: grid; place-items: center; font-weight: 600; }
.conn { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-3); padding: 10px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.conn.ok i { background: #2fb36b; box-shadow: 0 0 0 3px rgba(47,179,107,.2); }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.chat-head h3 { font-family: var(--f-body); font-size: 1.1rem; font-weight: 600; }
.chat-head p { font-size: .85rem; color: var(--ink-3); }
.pinned { display: flex; gap: 10px; align-items: center; margin: 12px 18px 0; padding: 10px 14px; border-radius: 12px; background: var(--gold-200); font-size: .88rem; }
.pinned svg { width: 16px; height: 16px; flex: none; color: #7a5a24; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.day-sep { text-align: center; font-size: .75rem; color: var(--ink-3); margin: 12px 0; display: flex; align-items: center; gap: 12px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 6px 10px; border-radius: 12px; transition: background .2s; }
.msg:hover { background: var(--sand-100); }
.msg.cont { padding-top: 0; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head b { font-weight: 600; font-size: .95rem; }
.msg-head small { color: var(--ink-3); font-size: .75rem; }
.msg.cont .msg-head { display: none; }
.role-tag { font-size: .68rem; padding: 1px 7px; border-radius: 6px; background: var(--forest-900); color: var(--gold-400); font-weight: 600; }
.msg-text { font-size: .97rem; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.doc .msg-text { color: var(--forest-800); }
.msg.mine .msg-head b { color: var(--teal-600); }
.msg.new { animation: msgIn .5s var(--ease-out); }
@keyframes msgIn { from { opacity: 0; transform: translateY(12px); } }
.reacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.react { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: .82rem; transition: transform .2s, border-color .2s; }
.react.me { border-color: var(--teal-400); background: var(--sage-100); }
.react:hover { transform: scale(1.06); }
.msg-tools { position: absolute; top: -12px; left: 14px; display: none; gap: 2px; padding: 3px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.msg:hover .msg-tools { display: flex; }
.msg-tools button { width: 30px; height: 28px; border-radius: 7px; font-size: .95rem; }
.msg-tools button:hover { background: var(--sand-100); }
.typing { height: 26px; padding: 0 24px; font-size: .82rem; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); animation: typing 1.2s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s; } .typing .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-3px); opacity: 1; } }
.composer { margin: 0 18px 18px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--pearl); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--teal-400); box-shadow: 0 0 0 4px rgba(79,174,149,.12); }
.composer textarea { width: 100%; border: 0; outline: 0; background: none; padding: 14px 16px 4px; resize: none; max-height: 140px; }
.composer-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px 8px; }
.composer-bar .ctrl { color: var(--ink-3); width: 36px; height: 34px; }
.composer-bar .ctrl:hover { background: var(--sand-200); color: var(--ink); }
.send { margin-inline-start: auto; width: 40px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--forest-900); color: var(--pearl); transition: transform .3s var(--ease-out), opacity .2s; }
.send:disabled { opacity: .35; }
.send svg { width: 18px; height: 18px; transform: scaleX(-1); }
.send:not(:disabled):hover { transform: translateX(-3px); }
.emoji-pop { position: absolute; bottom: 100%; margin-bottom: 6px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 6px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.emoji-pop button { width: 36px; height: 36px; border-radius: 8px; font-size: 1.2rem; }
.emoji-pop button:hover { background: var(--sand-100); }
.name-gate { display: flex; gap: 8px; align-items: center; margin: 0 18px 10px; padding: 10px 12px; border-radius: 12px; background: var(--sage-100); font-size: .88rem; flex-wrap: wrap; }
.name-gate input { flex: 1; min-width: 120px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; outline: none; }
.members { border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; background: var(--pearl); }
.members h4 { font-family: var(--f-body); font-size: .72rem; letter-spacing: .14em; color: var(--ink-3); font-weight: 600; padding: 8px 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 10px; font-size: .9rem; }
.member .avatar { position: relative; overflow: visible; }
.member .avatar::after { content: ""; position: absolute; bottom: -1px; left: -1px; width: 10px; height: 10px; border-radius: 50%; background: #2fb36b; border: 2px solid var(--pearl); }
.member.away .avatar::after { background: #e0b23b; }
.member small { display: block; color: var(--ink-3); font-size: .75rem; }

/* ---------- live ---------- */
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.live-stage { position: relative; aspect-ratio: 16/9; border-radius: var(--r-lg); overflow: hidden; color: #fff; background: #071315; isolation: isolate; box-shadow: var(--shadow-lg); }
.live-stage .mesh { z-index: -1; --h: 170; }
.live-host { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; }
.live-host .avatar { width: 120px; height: 120px; font-size: 2.6rem; font-family: var(--f-display); box-shadow: 0 0 0 6px rgba(217,183,126,.25), 0 0 0 14px rgba(217,183,126,.1); }
.live-host .speaking { animation: speak 1.4s ease-in-out infinite; }
@keyframes speak { 50% { box-shadow: 0 0 0 10px rgba(217,183,126,.35), 0 0 0 24px rgba(217,183,126,.12); } }
.live-top { position: absolute; top: 16px; inset-inline: 16px; display: flex; justify-content: space-between; align-items: center; }
.viewers { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(7,23,26,.5); backdrop-filter: blur(8px); font-size: .85rem; }
.viewers svg { width: 16px; height: 16px; }
.live-caption { position: absolute; bottom: 70px; inset-inline: 10%; text-align: center; font-family: var(--f-display); font-size: clamp(1rem, 2vw, 1.6rem); text-shadow: 0 2px 20px rgba(0,0,0,.6); }
.react-bar { position: absolute; bottom: 16px; left: 50%; translate: -50% 0; display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(7,23,26,.5); backdrop-filter: blur(10px); z-index: 2; }
.react-bar button { width: 42px; height: 42px; border-radius: 50%; font-size: 1.3rem; transition: transform .2s var(--ease-out), background .2s; }
.react-bar button:hover { transform: scale(1.18); background: rgba(255,255,255,.14); }
.float-r { position: absolute; bottom: 70px; font-size: 1.8rem; pointer-events: none; z-index: 1; }
.live-side { display: flex; flex-direction: column; min-height: 0; height: 100%; max-height: 640px; padding: 16px; }
.live-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; min-height: 240px; }
.lf { font-size: .9rem; animation: msgIn .4s var(--ease-out); }
.lf b { color: var(--teal-600); margin-inline-end: 6px; font-weight: 600; }
.qa { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); font-size: .92rem; }
.qa .up { display: grid; justify-items: center; padding: 4px 8px; border-radius: 10px; border: 1px solid var(--line); font-size: .8rem; min-width: 44px; transition: background .2s; }
.qa .up.on { background: var(--sage-100); border-color: var(--teal-400); color: var(--teal-600); }
.qa .up svg { width: 14px; height: 14px; }
.recordings { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.countdown { display: flex; gap: 10px; direction: ltr; justify-content: flex-end; }
.countdown div { display: grid; justify-items: center; min-width: 64px; padding: 10px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); }
.countdown b { font-family: var(--f-display); font-size: 1.8rem; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown small { font-size: .72rem; color: var(--ink-3); }

/* ---------- intake ---------- */
.intake { max-width: 860px; margin: 0 auto; }
.intake-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.steps-bar { display: flex; gap: 6px; flex: 1; }
.steps-bar i { flex: 1; height: 5px; border-radius: 5px; background: var(--sand-200); transition: background .4s; }
.steps-bar i.on { background: linear-gradient(270deg, var(--teal-400), var(--teal-500)); }
.intake-card { padding: 40px; min-height: 460px; display: flex; flex-direction: column; }
.intake-card .eyebrow { margin-bottom: 10px; }
.intake-card h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 400; }
.intake-card .lead { color: var(--ink-2); margin: 10px 0 26px; font-weight: 300; max-width: 600px; }
.q-block { margin-bottom: 26px; }
.q-block > label, .q-block > .q-label { display: block; font-weight: 500; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--white); font-size: .93rem; transition: all .2s; }
.chip-btn:hover { border-color: var(--teal-400); }
.chip-btn.on { background: var(--forest-900); color: var(--pearl); border-color: var(--forest-900); }
.range { display: grid; gap: 6px; }
.range input { width: 100%; accent-color: var(--teal-500); height: 28px; }
.range-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-3); }
.range-val { font-family: var(--f-display); font-size: 1.4rem; color: var(--teal-600); }
.intake-nav { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; padding-top: 24px; }
.intake-intro { display: grid; grid-template-columns: 1fr 220px; gap: 30px; align-items: center; }
.privacy { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--sage-100); font-size: .9rem; color: var(--ink-2); margin-top: 8px; }
.privacy svg { width: 20px; height: 20px; flex: none; color: var(--teal-600); margin-top: 2px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.radar { width: 100%; max-width: 380px; margin: 0 auto; overflow: visible; direction: ltr; }
.radar .grid-l { stroke: var(--line-strong); stroke-width: 1; }
.radar .axis-l { fill: var(--ink-2); stroke: none; font-size: 12px; font-family: var(--f-body); }
.radar .shape { fill: rgba(44, 138, 117, .18); stroke: var(--teal-500); stroke-width: 2; }
.radar .pt { fill: var(--teal-500); stroke: var(--white); stroke-width: 2; cursor: pointer; }
.radar .pt-hit { fill: transparent; stroke: none; cursor: pointer; }
.score-list { display: grid; gap: 10px; }
.score { display: grid; grid-template-columns: 90px 1fr 40px; gap: 10px; align-items: center; font-size: .92rem; }
.score .pbar { height: 8px; background: var(--sand-200); }
.score .pbar i { background: var(--teal-500); }
.score b { font-variant-numeric: tabular-nums; text-align: left; font-weight: 600; }
.rec-list { display: grid; gap: 8px; margin-top: 14px; }
.tooltip { position: fixed; z-index: 200; padding: 8px 12px; border-radius: 10px; background: var(--forest-950); color: var(--pearl); font-size: .82rem; pointer-events: none; box-shadow: var(--shadow-md); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.tooltip b { color: var(--gold-400); font-weight: 600; }

/* ---------- studio ---------- */
.studio-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.studio-tabs button { padding: 12px 18px; font-size: .95rem; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.studio-tabs button.on { color: var(--ink); border-color: var(--teal-500); font-weight: 500; }
.drop { display: block; position: relative; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); padding: 44px 24px; text-align: center; background: var(--white); transition: border-color .3s, background .3s, transform .3s var(--ease-out); cursor: pointer; }
.drop.over { border-color: var(--teal-400); background: var(--sage-100); transform: scale(1.01); }
.drop svg.big { width: 56px; height: 56px; margin: 0 auto 12px; color: var(--teal-500); stroke-width: 1.3; }
.drop h3 { font-size: 1.5rem; font-weight: 400; }
.drop p { color: var(--ink-3); margin: 6px 0 16px; font-size: .92rem; }
.drop input { display: none; }
.uploads { display: grid; gap: 12px; margin-top: 18px; }
.up-card { display: grid; grid-template-columns: 150px 1fr auto; gap: 18px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line); animation: msgIn .5s var(--ease-out); }
.up-thumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--forest-800); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-thumb .mesh { animation-duration: 6s; }
.up-info { min-width: 0; display: grid; gap: 6px; }
.up-info input { font-family: var(--f-display); font-size: 1.15rem; border: 0; border-bottom: 1px dashed transparent; background: none; outline: none; padding: 2px 0; width: 100%; }
.up-info input:hover, .up-info input:focus { border-bottom-color: var(--line-strong); }
.up-info small { color: var(--ink-3); font-size: .8rem; }
.up-stage { font-size: .82rem; color: var(--teal-600); font-weight: 500; display: flex; gap: 8px; align-items: center; }
.up-stage .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--sage-200); border-top-color: var(--teal-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.up-card .pbar { height: 6px; }
.up-actions { display: flex; gap: 8px; align-items: center; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: start; font-weight: 500; color: var(--ink-3); font-size: .8rem; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--sand-100); }
.table .pbar { width: 120px; height: 6px; display: inline-block; vertical-align: middle; margin-inline-end: 8px; background: var(--sand-200); }
.table .pbar i { background: var(--teal-500); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--teal-600); } .status.draft { color: var(--ink-3); }
.builder { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dnd-list { display: grid; gap: 8px; min-height: 280px; padding: 10px; border-radius: var(--r-md); background: var(--sand-100); border: 2px dashed transparent; transition: border-color .2s, background .2s; align-content: start; }
.dnd-list.over { border-color: var(--teal-400); background: var(--sage-100); }
.dnd-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); cursor: grab; transition: box-shadow .2s, opacity .2s, transform .2s; font-size: .93rem; }
.dnd-item:active { cursor: grabbing; }
.dnd-item.dragging { opacity: .4; }
.dnd-item .grip { color: var(--ink-3); width: 16px; height: 16px; flex: none; }
.dnd-item .mini { width: 46px; height: 30px; border-radius: 6px; overflow: hidden; position: relative; flex: none; }
.dnd-item .mini .mesh { animation: none; }
.dnd-item .rm { margin-inline-start: auto; color: var(--ink-3); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.dnd-item .rm:hover { background: #fbeae4; color: var(--clay-500); }
.dnd-item .add { margin-inline-start: auto; color: var(--teal-500); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.dnd-item .add:hover { background: var(--sage-100); }
.dnd-item svg { width: 16px; height: 16px; }
.empty-hint { text-align: center; color: var(--ink-3); font-size: .9rem; padding: 40px 10px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { padding: 20px; }
.tile small { color: var(--ink-3); font-size: .85rem; }
.tile b { display: block; font-family: var(--f-display); font-size: 2.3rem; font-weight: 400; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.delta { font-size: .8rem; color: var(--teal-600); font-weight: 500; }
.charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.chart { width: 100%; height: auto; overflow: visible; direction: ltr; }
.chart rect, .chart .bar, .chart text { stroke: none; }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink-3); stroke: none; font-size: 11px; font-family: var(--f-body); }
.chart .area { fill: url(#areaGrad); stroke: none; }
.chart .ln { stroke: var(--teal-500); stroke-width: 2; fill: none; }
.chart .bar { fill: var(--teal-500); transition: opacity .2s; }
.chart .bar.dim { opacity: .45; }
.chart .xh { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dotm { fill: var(--teal-500); stroke: var(--white); stroke-width: 2; }
.chart .val { fill: var(--ink-2); stroke: none; font-size: 11px; font-family: var(--f-body); font-weight: 600; }

/* ---------- toasts & misc ---------- */
.toasts { position: fixed; bottom: 24px; left: 24px; z-index: 300; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--forest-950); color: var(--pearl); box-shadow: var(--shadow-lg); font-size: .93rem; max-width: 360px; animation: toastIn .5s var(--ease-out); }
.toast svg { width: 20px; height: 20px; color: var(--gold-400); flex: none; }
.toast.out { animation: toastOut .4s var(--ease-io) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-30px); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 250; }
.view-enter { animation: viewIn .55s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } }
.stagger > * { animation: viewIn .6s var(--ease-out) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; } .stagger > *:nth-child(3) { animation-delay: .12s; } .stagger > *:nth-child(4) { animation-delay: .18s; } .stagger > *:nth-child(5) { animation-delay: .24s; } .stagger > *:nth-child(6) { animation-delay: .3s; } .stagger > *:nth-child(n+7) { animation-delay: .36s; }

/* ---------- tabbar (mobile) ---------- */
.tabbar { display: none; }

@media (max-width: 1200px) {
  .chat-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .members { display: none; }
  .lesson-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; max-height: 560px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .side { display: none; }
  .shell { margin-right: 0; }
  .view { padding: 20px 16px 110px; }
  .top { padding: 10px 16px; gap: 10px; }
  .top-actions { gap: 8px; }
  .role-switch button { padding: 6px 10px; }
  .search kbd { display: none; }
  .home-grid, .charts, .builder, .result-grid, .live-layout, .intake-intro { grid-template-columns: 1fr; }
  .continue { grid-template-columns: 1fr; }
  .continue-art { min-height: 200px; }
  .pl-hero { grid-template-columns: 1fr; }
  .pl-hero .pl-cover { max-width: 240px; }
  .tabbar {
    display: flex; position: fixed; bottom: 12px; inset-inline: 12px; z-index: 80; padding: 6px; border-radius: 22px; justify-content: space-between;
    background: rgba(11, 34, 38, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-lg); padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 16px; color: rgba(251,248,243,.6); font-size: .68rem; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--gold-400); background: rgba(255,255,255,.08); }
  .chat-layout { grid-template-columns: 1fr; height: calc(100svh - 64px - 130px); }
  .ch-list { flex-direction: row; overflow-x: auto; padding: 8px; border-left: 0; border-bottom: 1px solid var(--line); gap: 6px; }
  .ch-list h4, .conn { display: none; }
  .ch-btn { white-space: nowrap; }
  .chat-layout { grid-template-rows: auto minmax(0, 1fr); }
  .task-grid { grid-template-columns: 1fr; }
  .up-card { grid-template-columns: 100px 1fr; }
  .up-actions { grid-column: 1 / -1; }
  .intake-card { padding: 24px; }
  .pop { width: min(340px, calc(100vw - 32px)); left: -60px; }
  .toasts { left: 16px; right: 16px; bottom: 96px; }
}
@media (max-width: 560px) {
  .search { height: 40px; }
  .top-actions .avatar { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile b { font-size: 1.8rem; }
  .ctrl-chapter, .stage-preview { display: none; }
  .caption { bottom: 74px; }
  .table .hide-sm { display: none; }
  .lr-thumb { width: 84px; }
  .lr-dur { display: none; }
}
