/* =========================================================
   Learner panel extras (prefix: l-). Tokens only — works in light + dark.
   ========================================================= */

/* ---------- utilities ---------- */
.l-small { font-size: 12.5px; }
.l-block { display: block; }
.l-mt { margin-top: 14px; }
.l-wrap { flex-wrap: wrap; }
.l-ok { color: var(--ok); font-weight: 700; }
.l-h { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.l-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.l-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.glass-pill .l-dot { box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.glass-pill .l-dot.tone-ok { background: #3DD29A; } .glass-pill .l-dot.tone-warn { background: #F2B550; }
.glass-pill .l-dot.tone-bad { background: #FF7489; } .glass-pill .l-dot.tone-info { background: #7EA8FF; } .glass-pill .l-dot.tone-neutral { background: #C3C8DA; }
.l-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l-countdown { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.l-alert { align-items: center; flex-wrap: wrap; }
.l-alert > .ic { margin-top: 0; }
.l-alert .grow { min-width: 200px; }
.l-alert .grow > div { font-size: 13px; color: var(--text-2); }
.l-danger-ghost { color: var(--bad); }
.l-danger-ghost:hover { background: var(--bad-bg); color: var(--bad); }
.btn.l-on { color: var(--ok); }
.l-inline { height: 22px; font-size: 11.5px; margin-inline-start: 6px; vertical-align: middle; }
.l-narrow { max-width: 760px; width: 100%; }
.l-form-end { display: flex; justify-content: flex-end; }

/* kanj thumbnail: cover photo or initials on the kanj's hue */
.l-thumb { width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; overflow: hidden; border-radius: calc(var(--s) * .28); font-size: calc(var(--s) * .32); font-weight: 800; line-height: 1; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 42% 40%), hsl(calc(var(--h) + 48) 46% 26%)); }
.l-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* "⋯" overflow menu */
.l-menu { position: relative; flex: none; }
.l-menu-btn { width: 40px; height: 40px; color: var(--muted); }
.l-menu-pop { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 30; min-width: 184px; padding: 6px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); }
.l-menu-pop[hidden] { display: none; }
.l-menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); text-align: start; cursor: pointer; }
.l-menu-pop button:hover, .l-menu-pop button:focus-visible { background: var(--surface-3); outline: none; }
.l-menu-pop button .ic { color: var(--muted); }
.l-menu-pop .is-danger, .l-menu-pop .is-danger .ic { color: var(--bad); }

/* ---------- home ---------- */
.l-hello { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.l-hello > div { flex: 1; min-width: 200px; }
.l-hello span { font-size: 13px; color: var(--muted); }
.l-hello h2 { font-size: 26px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.l-go-list { display: grid; gap: 12px; }
.l-go-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.l-go-head h2 { font-size: 16px; font-weight: 800; }
.l-go-head .link { display: inline-flex; align-items: center; gap: 4px; }
/* 1–3 cards share the row evenly (a lone card takes half, not a stretched full row) */
.l-go-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.l-go-grid > :only-child { max-width: calc(50% - 6px); }
@media (max-width: 640px) { .l-go-grid { grid-template-columns: 1fr; } .l-go-grid > :only-child { max-width: none; } }
.l-go { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .2s, box-shadow .2s; }
.l-go:hover { color: var(--text); border-color: var(--brand-300); box-shadow: var(--sh-sm); }
.l-go-media { position: relative; flex: none; display: block; }
.l-go-media .l-thumb { border-radius: 14px; }
.l-go-play { position: absolute; inset: 0; margin: auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #10302B; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.l-go-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.l-go-name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-go-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-go-prog { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.l-go-prog .progress { flex: 1; height: 6px; }
.l-go-prog em { font-style: normal; font-size: 12px; color: var(--text-2); min-width: 30px; }
/* home: classes + suggestions on the main side, the latest notifications beside them; cards keep their own height */
.l-home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 20px; align-items: start; }
.l-home-main { display: grid; gap: 24px; min-width: 0; }
.l-home-side { min-width: 0; }
.l-up .date-box.is-live { background: var(--bad-bg); color: var(--bad); }
.l-live-dot { display: inline-block; width: 7px; height: 7px; margin-inline-end: 6px; border-radius: 50%; background: var(--bad); vertical-align: 1px; animation: lLive 1.4s ease-in-out infinite; }
@keyframes lLive { 50% { opacity: .35; } }
div.l-up .btn { flex: none; }
.l-home-card .card-head h3 { font-size: 16px; }
.l-home-empty { padding: 4px 22px 22px; }
.l-up { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid var(--line); color: var(--text); min-height: 64px; }
.l-up:last-child { border-bottom: 0; }
.l-up:hover { background: var(--surface-2); color: var(--text); }
.l-up .date-box { width: 48px; height: 52px; border-radius: 12px; }
.l-up .date-box b { font-size: 18px; }
.l-up .grow { min-width: 0; display: grid; line-height: 1.5; }
.l-up .grow b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-up .grow span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-up em { font-style: normal; font-size: 12.5px; color: var(--brand-ink); white-space: nowrap; }
.l-up em.is-live { color: var(--bad); font-weight: 700; }
.l-sugg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.l-sugg { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 0; transition: border-color .2s; }
.l-sugg:hover { border-color: var(--brand-300); color: var(--text); }
.l-sugg-txt { min-width: 0; display: grid; line-height: 1.5; }
.l-sugg-txt b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-sugg-txt span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-sugg-txt em { font-style: normal; font-size: 13px; color: var(--text-2); }

/* ---------- events ---------- */
.l-event { flex-wrap: wrap; align-items: center; }
.l-event .grow { min-width: 180px; }
.l-event .grow > span { margin-top: 1px; }
.l-event-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.l-event-meta .badge { height: 24px; font-size: 11.5px; }
.l-event-act { display: flex; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.l-event-act:empty { display: none; }
.l-event.is-past .date-box { background: var(--surface-3); color: var(--muted); }
.l-next-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- notifications (each row is a real link or button) ---------- */
a.l-notif, button.l-notif { width: 100%; align-items: flex-start; text-align: start; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--text); cursor: pointer; transition: background .15s; }
a.l-notif:last-child, button.l-notif:last-child { border-bottom: 0; }
.l-notif:hover { background: var(--surface-2); color: var(--text); }
.l-notif:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.l-notif .grow { display: block; min-width: 0; }
.l-ntext { display: block; font-size: 13.5px; color: var(--text-2); margin-top: 1px; }
.l-notif-go { align-self: center; flex: none; color: var(--muted); }
.l-notif-group { font-size: 12px; font-weight: 700; color: var(--muted); padding: 14px 22px 6px; background: var(--surface-2); border-bottom: 1px solid var(--line); letter-spacing: .02em; }
.l-tabs-pad { padding: 4px 14px 0; }
.l-scroll-tabs { flex-wrap: nowrap; }
.l-scroll-tabs .tab { flex: none; white-space: nowrap; }

/* ---------- my communities ---------- */
.l-mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.l-mc { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); min-width: 0; }
.l-mc:hover { transform: translateY(-4px); box-shadow: var(--sh); }
.l-mc-cover { position: relative; }
.l-mc .cover { height: 128px; }
.l-mc.is-expired .cover { filter: grayscale(.85) brightness(.85); }
.l-mc-body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.l-mc h3 { font-size: 17.5px; font-weight: 700; }
.l-mc p { font-size: 13.5px; color: var(--muted); line-height: 1.9; }
.l-mc-prog { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.l-mc-prog b { color: var(--text); font-size: 13px; }
.l-mc-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; color: var(--muted); }
.l-mc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.l-mc-act { display: grid; gap: 6px; margin-top: auto; padding-top: 6px; }
.l-mc-act .btn { width: 100%; }
.l-mc-new { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft, rgba(33,160,140,.12)); }

/* ---------- community space: header + tabs, feed + one side column ---------- */
.l-sp { display: grid; gap: 22px; min-width: 0; }
.l-sp-head { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px 24px 0; min-width: 0; }
.l-sp-id { display: flex; align-items: center; gap: 16px; }
.l-sp-id .grow { min-width: 0; }
.l-sp-id h2 { font-size: 24px; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.l-sp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.l-sp-meta > span:not(:first-child)::before { content: "·"; margin-inline-end: 10px; color: var(--muted); }
.l-sp-meta .badge { height: 24px; font-size: 11.5px; }
.l-sp-intro { flex: none; }
.l-sp-tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.l-sp-tabs::-webkit-scrollbar { display: none; }
.l-sp-tabs a { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 10px 14px; font-size: 14.5px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; }
.l-sp-tabs a:hover { color: var(--text); }
.l-sp-tabs a.on { color: var(--text); font-weight: 700; border-bottom-color: var(--brand); }
.l-sp-tabs em { font-style: normal; font-size: 11px; font-weight: 700; line-height: 20px; padding: 0 7px; border-radius: 99px; background: var(--brand); color: #fff; }
.l-tab-short { display: none; }
/* desktop: community column | feed | widgets (narrower screens fall back to the header + tabs below) */
.l-sp-body { display: grid; grid-template-columns: 200px minmax(0, 720px) 250px; gap: 16px; align-items: start; }
.l-sp-head { display: none; }
.l-sp-nav { position: sticky; top: 84px; display: grid; gap: 14px; min-width: 0; }
.l-sp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.l-sp-cover { height: 92px; display: grid; place-items: center; overflow: hidden; font-size: 28px; font-weight: 800; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 42% 40%), hsl(calc(var(--h) + 48) 46% 26%)); }
.l-sp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.l-sp-card-body { padding: 12px 14px 14px; display: grid; gap: 4px; justify-items: start; }
.l-sp-card-body h2 { font-size: 15.5px; font-weight: 800; line-height: 1.5; }
.l-sp-card-body p { font-size: 12.5px; color: var(--muted); }
.l-chan a { min-height: 44px; }
.l-chan a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-intro { justify-content: flex-start; color: var(--muted); }
.l-chan-head { display: flex; align-items: center; gap: 14px; padding: 2px; }
.l-chan-head .grow { min-width: 0; }
.l-chan-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.l-chan-head p { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.l-chan-head .ic-box { width: 46px; height: 46px; border-radius: 14px; flex: none; }
.l-chan-head .pill { flex: none; }
.l-sp-bar .l-sp-line, .l-sp-bar .l-count, .l-sp-bar > .btn { display: none; }
.l-sp-bar:not(:has(.l-chips, .l-find)) { display: none; }
.l-composer .row .input { flex: 1; min-width: 0; }
.l-composer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.l-composer-bar .composer-attach { margin-bottom: 0; }
.l-composer-bar > .btn { margin-inline-start: auto; }
@media (min-width: 1400px) {
  .l-sp-body { grid-template-columns: 260px minmax(0, 720px) 300px; gap: 24px; }
}
.l-sp-main { min-width: 0; align-content: start; }
.l-sp-side { display: grid; gap: 16px; position: sticky; top: 84px; }
.l-next-row { display: none; }

.l-side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 12px; min-width: 0; }
.l-side-h { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 700; color: var(--text); }
.l-side-h .ic { color: var(--muted); flex: none; }
.l-kv { font-size: 13.5px; gap: 8px 16px; }
.l-days { display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.l-side-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.l-pct { font-size: 13px; color: var(--brand-ink); }
.l-side-card .event-card .grow { min-width: 0; }
.l-side-card .event-card b { font-size: 15px; }
.l-next-lesson { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-size: 13.5px; line-height: 1.45; min-height: 48px; }
.l-next-lesson:hover { color: var(--text); background: var(--surface-3); }
.l-next-lesson .grow { min-width: 0; }
.l-next-lesson small { display: block; font-size: 12px; color: var(--muted); }
.l-next-lesson > .ic { color: var(--muted); flex: none; }
.l-next-lesson > .ic:first-child { color: var(--brand-ink); }
.l-teacher-row { display: flex; align-items: center; gap: 10px; }
.l-teacher-row .grow { min-width: 0; }
.l-teacher-row b { display: block; font-size: 14px; }
.l-teacher-row span { display: block; font-size: 12px; color: var(--muted); }
.l-members { display: flex; align-items: center; gap: 10px; }
.l-side-rows { padding: 4px 6px; gap: 0; }
.l-side-link, .l-side-rules > summary { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 10px; font-size: 13.5px; color: var(--text); cursor: pointer; list-style: none; border-radius: 12px; }
.l-side-link:hover, .l-side-rules > summary:hover { color: var(--text); background: var(--surface-2); }
.l-side-rules > summary::-webkit-details-marker { display: none; }
.l-side-link + .l-side-rules { border-top: 1px solid var(--line); border-radius: 0; }
.l-side-link > .ic, .l-side-rules > summary .ic { color: var(--muted); flex: none; }
.l-side-link .grow { min-width: 0; }
.l-side-link em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--c, var(--muted)); }
.l-side-rules[open] > summary .ic:last-child { transform: rotate(180deg); }
.l-rules { margin: 0 10px 12px; }
.l-rules li { font-size: 13.5px; line-height: 1.8; }

/* per-tab toolbar: one short line, chips, count */
.l-sp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.l-sp-line { font-size: 13.5px; color: var(--muted); }
.l-count { font-size: 13px; color: var(--muted); margin-inline-start: auto; white-space: nowrap; }
.l-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; }
.l-chips::-webkit-scrollbar { display: none; }
.l-chip { flex: none; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.l-chip:hover { border-color: var(--brand-300); color: var(--text); }
.l-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.l-pinned { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 48px; border-radius: 14px; font-size: 14px; color: var(--text); background: color-mix(in srgb, var(--warn) 8%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 24%, transparent); }
.l-pinned:hover { color: var(--text); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.l-pinned > .ic { color: var(--warn); flex: none; }
.l-pinned .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-pinned .grow b { font-weight: 700; }
.l-pinned .grow span { color: var(--text-2); }
.l-pinned em { font-style: normal; font-size: 13px; color: var(--warn); white-space: nowrap; }
.l-find { position: relative; flex: 1 1 220px; display: flex; align-items: center; min-width: 0; }
.l-find > .ic { position: absolute; inset-inline-start: 12px; color: var(--muted); pointer-events: none; }
.l-find .input { width: 100%; min-height: 40px; padding-inline-start: 38px; }
.l-qa-list { gap: 16px; }
.l-qa-item[hidden], .l-qa-none[hidden] { display: none; }

/* composers: one line until focused */
.l-compose { padding: 12px 14px; gap: 10px; border-radius: 18px; }
.l-compose-row { display: flex; align-items: center; gap: 8px; }
.l-compose-row .avatar { flex: none; }
.l-compose .l-compose-row .input { flex: 1; min-width: 0; min-height: 42px; border: 0; background: transparent; box-shadow: none; resize: none; padding: 9px 6px; }
.l-compose.open .l-compose-row textarea.input { min-height: 88px; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.l-compose.open .l-compose-row { align-items: flex-start; }
.l-compose .l-compose-row .input:focus { box-shadow: none; }
.l-compose-more { display: none; align-items: center; gap: 8px; flex-wrap: wrap; }
.l-compose.open .l-compose-more { display: flex; }
.l-compose-more .grow, .l-compose-foot .grow { flex: 1; }
.l-compose-more .composer-attach { margin-bottom: 0; }
.l-ask.open .l-ask-more { display: grid; gap: 10px; }
.l-ask-more textarea.input { border: 0; background: var(--surface-2); border-radius: 14px; resize: vertical; }
.l-compose-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* posts */
.l-post { overflow: visible; }
.l-post .post-video, .l-post .post-image, .l-post .post-vid { overflow: hidden; }
.l-post-meta { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.l-post-meta .ic { width: 13px; height: 13px; }
.post-head .grow { min-width: 0; }
.post-head .badge { height: 26px; }
.l-tag-me { background: var(--surface-3); color: var(--text-2); }
.post-attach .grow { min-width: 0; }
.post-attach .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.post-actions button { min-height: 40px; }
.post-actions button[disabled] { cursor: default; opacity: .75; }
.post-actions button.l-saved { color: var(--brand-ink); }
.post-actions button.l-saved .ic { fill: currentColor; }
.post.is-announce { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.comment-bubble .tag-teacher { font-style: normal; }
.comment-bubble p { overflow-wrap: anywhere; }
.comment-form .avatar { flex: none; }
.l-send { background: var(--brand); color: #fff; width: 42px; height: 42px; border-radius: 50%; }
.l-send:hover { background: var(--brand-600); color: #fff; }

/* lessons path, files */
.l-path { padding: 0; overflow: hidden; }
.l-path > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 18px; cursor: pointer; list-style: none; }
.l-path > summary::-webkit-details-marker { display: none; }
.l-path > summary b { font-size: 15px; }
.l-path > summary .ic:first-child { color: var(--brand-ink); }
.l-path > summary .ic:last-child { margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.l-path[open] > summary .ic:last-child { transform: rotate(180deg); }
.l-path .l-curr { display: grid; gap: 8px; padding: 0 18px 18px; }
.l-curr .curr-item.is-done .n { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.l-curr .curr-item.is-cur { border-color: var(--brand-300); background: var(--brand-soft); }
.l-curr .curr-item.is-cur .n { background: var(--brand); color: #fff; border-color: transparent; }
.l-curr .curr-item .grow { min-width: 0; }
.l-file { min-height: 64px; }
.l-file .grow { min-width: 0; }
.l-file bdi { direction: ltr; unicode-bidi: isolate; }
.l-dl { flex: none; }

/* locked (no membership) */
.l-locked { position: relative; min-height: 560px; display: grid; place-items: center; padding: 20px 0; }
.l-locked-bg { position: absolute; inset: 0; display: grid; gap: 16px; align-content: start; filter: blur(3px); opacity: .55; pointer-events: none; mask-image: linear-gradient(180deg, #000 20%, transparent 90%); -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 90%); }
.l-skel { display: flex; gap: 14px; padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.l-skel-av { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); flex: none; }
.l-skel > div { flex: 1; display: grid; gap: 10px; }
.l-skel > div i { height: 10px; border-radius: 6px; background: var(--surface-3); }
.l-skel > div i:nth-child(1) { width: 30%; } .l-skel > div i:nth-child(2) { width: 90%; } .l-skel > div i:nth-child(3) { width: 70%; height: 90px; border-radius: 14px; }
.l-locked-card { position: relative; z-index: 1; width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--sh-lg); overflow: hidden; }
.l-locked-card .cover { height: 120px; }
.l-locked-body { padding: 0 32px 30px; display: grid; gap: 14px; justify-items: start; }
.l-lock-ic { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface); color: var(--brand-ink); box-shadow: var(--sh); margin-top: -32px; position: relative; border: 1px solid var(--line); }
.l-locked-body h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.l-locked-body > p { color: var(--muted); line-height: 1.95; }
.l-locked-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--text-2); }
.l-locked-facts:empty { display: none; }
.l-locked-facts span { display: inline-flex; align-items: center; gap: 6px; }
.l-locked-facts .ic { color: var(--muted); }

/* chat */
.l-chat { overflow: hidden; }
.l-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.l-chat-head .grow { min-width: 0; }
.l-chat-head b { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.l-chat-head .grow > span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.l-chat .chat { height: min(600px, calc(100dvh - 300px)); min-height: 420px; }
.l-chat .chat-log { background: var(--surface-2); }
.l-chat .msg { box-shadow: var(--sh-xs); white-space: pre-line; overflow-wrap: anywhere; }
.l-chat .msg.them { background: var(--surface); border: 1px solid var(--line); }
.l-chat-ro { align-items: center; color: var(--muted); font-size: 13.5px; background: var(--surface); }

/* ---------- subscriptions ---------- */
.l-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--text-2); }
.l-summary i { font-style: normal; color: var(--muted); }
.l-sub { overflow: visible; }
.l-sub.is-expired .l-thumb { filter: grayscale(.85) brightness(.85); }
.l-sub-main { min-width: 0; display: grid; gap: 6px; }
.l-sub-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.l-sub-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.l-sub-meta span { display: inline-flex; align-items: center; gap: 5px; }
.l-sub-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.l-sub-foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 14px 20px 18px; border-top: 1px dashed var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg, 22px) var(--r-lg, 22px); }
.l-sub-days { display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.l-sub-days b { color: var(--text); }
.l-sub-auto { display: grid; gap: 4px; }
.l-sub-auto .switch { font-weight: 700; }
.l-sub-auto small { font-size: 12px; color: var(--muted); line-height: 1.7; }
.l-sub-note { padding: 0 20px 18px; background: var(--surface-2); }
.l-rtable td { vertical-align: middle; }
.l-receipt { display: grid; gap: 16px; }
.l-receipt-amt { display: grid; justify-items: center; gap: 6px; padding: 18px; border-radius: 18px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.l-receipt-amt span { font-size: 12.5px; color: var(--muted); }
.l-receipt-amt b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.l-receipt .kv { font-size: 13.5px; }
.l-receipt .kv dd.mono { font-size: 12.5px; }
#l-print { display: none; }
@media print {
  body.l-printing > *:not(#l-print) { display: none !important; }
  body.l-printing #l-print { display: block; padding: 24px; font-family: inherit; }
  #l-print, #l-print * { color: #000 !important; background: none !important; box-shadow: none !important; border-color: #999 !important; }
  #l-print h1 { font-size: 18px; margin-bottom: 16px; }
}

/* ---------- profile ---------- */
.l-avatar-row { display: flex; gap: 18px; align-items: center; }
.l-avatar-row .grow { display: grid; gap: 4px; }
.l-avatar-row b { font-size: 14.5px; }
.l-avatar-row .grow > span { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.l-avatar-row .row { margin-top: 6px; gap: 8px; }
.l-avatar-row label.btn { cursor: pointer; position: relative; }
.l-avatar-row label.btn:focus-within { box-shadow: var(--ring); }
.field small .badge { height: 22px; font-size: 11.5px; margin-inline-end: 4px; vertical-align: middle; }
.l-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.l-meter i { height: 5px; border-radius: 4px; background: var(--surface-3); transition: background .25s; }
.l-meter[data-score="1"] i:nth-child(-n+1), .l-meter[data-score="2"] i:nth-child(-n+2), .l-meter[data-score="3"] i:nth-child(-n+3), .l-meter[data-score="4"] i { background: var(--c, var(--brand)); }
.l-session .grow b { display: flex; align-items: center; flex-wrap: wrap; white-space: normal; }

/* ---------- referral ---------- */
.rf-more { padding: 0; }
.rf-more > summary { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 14px 22px; cursor: pointer; list-style: none; }
.rf-more > summary::-webkit-details-marker { display: none; }
.rf-more > summary .ic:first-child { color: var(--brand-ink); }
.rf-more > summary .ic:last-child { margin-inline-start: auto; color: var(--muted); transition: transform .2s; }
.rf-more[open] > summary .ic:last-child { transform: rotate(180deg); }
.rf-more .card-body { padding-top: 0; display: grid; gap: 18px; }
.rf-more .rf-rules { font-size: 13.5px; color: var(--text-2); line-height: 1.9; }
.note .grow { min-width: 0; }
.note > .btn { align-self: center; flex: none; }

/* ---------- public kanj page: sticky join bar on phones ---------- */
.l-cta-bar { display: none; }

/* ---- "new" marks (cleared once the channel has been opened) ---- */
.post.is-new { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent), var(--sh-sm); }
.post-head .new-chip, .new-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 9px; border-radius: 999px; border: 0; font: inherit; font-size: 11.5px; font-weight: 800; color: var(--brand-ink); background: var(--brand-soft, rgba(33,160,140,.14)); cursor: default; }
button.new-chip { cursor: pointer; }
.comment.is-new .comment-bubble { box-shadow: inset 3px 0 0 var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface-2, var(--bg))); }
.comm-price.comm-mine { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--brand-ink); }
.pill.pill-ann { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
/* ---- inline video: way out when the phone cannot play it ---- */
.post-vid-alt { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.post-vid-alt:hover { color: var(--brand-ink); }
.post-vid.is-bad { background: var(--surface-2, var(--bg)); }
.post-vid-err { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); }
.post-vid-err > svg { color: var(--warn); flex: none; }
.post-vid-err > div { display: grid; gap: 3px; flex: 1; min-width: 0; font-size: 12.5px; }
.post-vid-err span { color: var(--muted); line-height: 1.7; }
.post-vid.is-bad + .post-vid-alt { display: none; }
.t-drop-warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.8; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1179px) {
  .l-sp-body { grid-template-columns: minmax(0, 1fr); }
  .l-sp-side, .l-sp-nav, .l-chan-head { display: none; }
  .l-sp-head { display: block; }
  .l-sp-bar .l-sp-line { display: block; } .l-sp-bar .l-count { display: inline; } .l-sp-bar > .btn { display: inline-flex; }
  .l-sp-bar:not(:has(.l-chips, .l-find)) { display: flex; }
  .l-next-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
  .l-next-row:hover { color: var(--text); }
  .l-next-row .date-box { width: 44px; height: 48px; border-radius: 12px; }
  .l-next-row .date-box b { font-size: 17px; }
  .l-next-row .grow { min-width: 0; display: grid; line-height: 1.5; }
  .l-next-row small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
  .l-next-row b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .l-next-row em { font-style: normal; font-size: 12px; color: var(--brand-ink); }
  .l-next-row > .ic { color: var(--muted); flex: none; }
}
@media (max-width: 1024px) {
  .l-sugg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .l-home-cols { grid-template-columns: minmax(0, 1fr); }
  .l-sub-foot { grid-template-columns: 1fr; gap: 14px; }
  .l-cta-bar { display: flex; align-items: center; gap: 12px; position: sticky; bottom: 0; z-index: 20; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.12); }
  .l-cta-bar > div { flex: 1; min-width: 0; line-height: 1.45; }
  .l-cta-bar small { display: block; font-size: 12px; color: var(--muted); }
  .l-cta-bar b { font-size: 15px; }
  .l-cta-bar .btn { flex: none; min-height: 46px; }
}
@media (max-width: 760px) {
}
@media (max-width: 640px) {
  .l-hide-xs { display: none !important; }
  .l-hello h2 { font-size: 21px; }
  .l-hello .btn { display: none; }
  .l-up { padding: 12px 16px; }
  .l-home-empty { padding: 4px 16px 18px; }
  .l-sugg-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .l-sugg { padding: 12px 14px; }
  .l-event .grow { min-width: 0; }
  .l-event-act { width: 100%; justify-content: flex-start; padding-inline-start: 66px; }
  .l-notif-group { padding: 12px 16px 6px; }
  .l-mc-grid { grid-template-columns: 1fr; }
  .l-mc .comm-badges > :nth-child(2) { display: inline-flex; }

  /* space on phones: compact header, scrollable tabs with an edge fade */
  .l-sp { gap: 14px; }
  .l-sp-head { padding: 10px 14px 0; border-radius: 18px; }
  .l-sp-id { gap: 10px; }
  .l-sp-id > .l-thumb, .l-sp-id h2 { display: none; }
  .l-sp-meta { margin-top: 0; font-size: 12.5px; }
  .l-sp-intro { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .l-sp-intro span { display: none; }
  .l-sp-tabs { margin: 4px -14px 0; padding: 0 8px; gap: 0; }
  .l-sp-tabs a { font-size: 14px; padding: 10px 10px; }
  .l-tab-full:has(+ .l-tab-short) { display: none; }
  .l-tab-short { display: inline; }
  .l-sp-main { gap: 12px; }
  .l-sp-bar { flex-wrap: nowrap; }
  .l-sp-bar .l-count, .l-sp-line { display: none; }
  .l-sp-bar:not(:has(.l-chips, .l-find, .btn)) { display: none; }
  .l-qa-bar { flex-wrap: wrap; }
  .l-qa-bar .l-find { flex-basis: 100%; }
  .l-chips { margin-inline: -16px; padding-inline: 16px; }
  .l-compose { padding: 10px 12px; }
  .l-compose-row .avatar, .l-composer .row > .avatar { display: none; }

  .post-head { padding: 14px 14px 0; gap: 10px; flex-wrap: wrap; }
  .post-head .grow { flex: 1; }
  .post-body { padding: 10px 14px 4px; }
  .post-actions { padding: 2px 6px; }
  .post-actions button { min-height: 44px; min-width: 44px; padding: 8px 10px; justify-content: center; }
  .comments { padding: 12px 14px; }
  .post-attach { flex-wrap: wrap; }
  .post-attach .btn { width: 100%; }
  .l-file { padding: 10px 14px; gap: 10px; }
  .l-dl { width: 44px; height: 44px; padding: 0; justify-content: center; }

  .l-sp.is-chat .l-sp-id, .l-sp.is-chat .l-next-row { display: none; }
  .l-sp.is-chat .l-sp-head { padding-top: 0; }
  .l-sp.is-chat .l-sp-tabs { margin-top: 0; }
  .l-chat .chat { height: calc(100dvh - 230px); min-height: 300px; }
  .l-chat-head { padding: 10px 14px; }
  .l-chat .tg-form { position: sticky; bottom: 0; }

  .l-locked-body { padding: 0 20px 24px; }
  .l-locked-body h2 { font-size: 19px; }
  .l-locked-body .row .btn { flex: 1; }

  .l-summary { font-size: 13px; }
  .l-sub-title h4 { font-size: 15px; }
  .l-sub-act { justify-content: flex-start; }
  .l-sub-act .btn-primary { flex: 1; }
  .l-sub-foot, .l-sub-note { padding-inline: 16px; }
  .l-rtable td.end .btn { margin-inline-start: auto; }

  .l-avatar-row { align-items: flex-start; }
  .l-avatar-row .avatar { --s: 60px !important; }
}
.plan.plan-cur { border-color: var(--brand); }
@media (max-width: 640px) {
  .l-compare { display: none; }
}

/* ---- first visit: learn or teach, side by side (on phones too) ---- */
.l-start { padding: 20px; }
.l-start-head { text-align: center; margin-bottom: 16px; }
.l-start-head h2 { font-size: 18px; font-weight: 800; }
.l-start-head p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.l-start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.l-start-opt { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.l-start-opt .ic-box { width: 52px; height: 52px; border-radius: 16px; }
.l-start-opt.is-teach .ic-box { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.l-start-opt b { font-size: 15.5px; font-weight: 800; }
.l-start-opt p { font-size: 12.5px; line-height: 1.8; color: var(--muted); flex: 1; }
.l-start-opt .btn { width: 100%; justify-content: center; }
@media (max-width: 640px) {
  .l-start { padding: 14px; }
  .l-start-grid { gap: 8px; }
  .l-start-opt { padding: 14px 8px; border-radius: 14px; }
  .l-start-opt .ic-box { width: 44px; height: 44px; border-radius: 13px; }
  .l-start-opt b { font-size: 14.5px; }
  .l-start-opt p { font-size: 12px; line-height: 1.7; }
  .l-start-opt .btn { padding-inline: 8px; font-size: 13px; gap: 5px; }
}

/* ---- a post's gallery: same look as the kanj page, a bit smaller ---- */
.post-gal { margin-top: 12px; }
.post-gal .c-gal-stage { border-radius: 16px; }
.post-gal .c-gal-stage video.c-gal-media { background: #000; }

/* ---- photo / video viewer ---- */
html.lbx-open { overflow: hidden; }
.lbx { position: fixed; inset: 0; z-index: 99999; background: #060a09; display: flex; flex-direction: column; animation: lbx-in .18s ease; }
@keyframes lbx-in { from { opacity: 0; } to { opacity: 1; } }
.lbx-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: #fff; }
.lbx-count { font-size: 14px; font-weight: 700; opacity: .85; }
.lbx-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.lbx-btn:hover { background: rgba(255,255,255,.22); }
.lbx-btn:disabled { opacity: .25; cursor: default; }
.lbx-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; touch-action: none; padding: 0 8px 16px; }
.lbx-media { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
img.lbx-media { cursor: zoom-in; transform-origin: center center; }
.lbx.is-zoomed img.lbx-media { cursor: grab; }
video.lbx-media { width: 100%; background: #000; border-radius: 10px; }
.lbx-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lbx-prev { right: 14px; }
.lbx-next { left: 14px; }
@media (max-width: 640px) { .lbx-nav { display: none; } } /* phones swipe */
.post-gal .c-gal-stage img.pg-zoomable, .post-image[data-action] { cursor: zoom-in; }
.pg-expand { position: absolute; top: 10px; left: 10px; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }

/* ---- temporary post ---- */
.post-head .temp-chip, .temp-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
