/*
 * Learn: Courses, Livestreams, Zoom Sessions, Start Here (phase 4).
 * Built to the mockups Carson approved on 15 October 2026
 * (mockup-2026-10-15-learn/learn-mock.js, its `lm-` styles are these `ln-`
 * ones), in the site's own colours and type, light and dark.
 */
.tool-view[data-tool="learn"] { --tool-w: 1060px; }

.ln { min-width: 0; }
.ln-page { display: flex; flex-direction: column; gap: 18px; max-width: 1060px; margin: 0 auto; padding-bottom: 24px; }
.ln-head { display: flex; flex-direction: column; }
.ln-h { margin: 2px 0 0; font-family: var(--display); font-weight: var(--display-weight); font-size: 26px; letter-spacing: -0.01em; line-height: 1.2; }
.ln-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 70ch; }
.ln-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(var(--accent-rgb), 0.85); font-weight: 600; margin: 0; }
.ln-fine { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.ln-none { padding: 6px 0; }
.ln-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ln-grow { flex: 1; }

.ln-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); align-self: flex-start; }
.ln-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 14.5px; font-weight: 500; color: var(--muted); text-decoration: none; cursor: pointer; }
.ln-tab:hover { color: var(--ink); }
.ln-tab.is-on { background: var(--accent-fill); color: var(--accent-ink); font-weight: 600; }
.ln-tab.is-on:hover { color: var(--accent-ink); }

.ln-back, .ln-start-link { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 14px; color: var(--muted); text-decoration: none; }
.ln-back:hover, .ln-start-link:hover { color: var(--accent); }
.ln-start-link { color: var(--accent); font-weight: 600; margin-top: -6px; }

.ln-card { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
a.ln-card { text-decoration: none; }
a.ln-card:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.ln-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.ln-cover { position: relative; aspect-ratio: 16 / 9; background: #14110d; overflow: hidden; }
/* The artwork whole, over a soft blurred copy of itself (LEARN-24). */
.ln-cover::before { content: ''; position: absolute; inset: -28px; background: var(--cover, none) center / cover no-repeat; filter: blur(20px) brightness(0.62) saturate(1.1); }
.ln-cover-img { position: absolute; inset: 0; background: var(--cover) center / contain no-repeat; }
.ln-cover--none { background: radial-gradient(120% 95% at 50% 38%, #2b2419 0%, #17140f 58%, #100e0b 100%); }
.ln-cover--none::before { inset: 0; filter: none; background: url('/logo-mark.png') center / auto 42% no-repeat; opacity: 0.92; }
.ln-cover--locked::after { content: ''; position: absolute; inset: 0; background: rgba(10, 9, 8, 0.55); }
.ln-cover--wide { border-radius: 8px; }
.ln-lock { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; font-weight: 600; font-size: 14px; }
.ln-dur { position: absolute; right: 10px; bottom: 10px; z-index: 1; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 4px; }

.ln-course { overflow: hidden; display: flex; flex-direction: column; }
/* Course artwork is 3:2: shown at its own shape, nothing cut (LEARN-24). */
.ln-course .ln-cover, .ln-hero .ln-cover { aspect-ratio: 3 / 2; }
.ln-course-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.ln-course-link:hover .ln-ctitle { color: var(--accent); }
.ln-cbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ln-course .ln-cbody { padding-bottom: 4px; }
.ln-ctitle { font-family: var(--display); font-weight: var(--display-weight); font-size: 18px; line-height: 1.25; color: var(--ink); margin: 0; }
.ln-ctitle--big { font-size: 24px; }
a.ln-ctitle { text-decoration: none; }
a.ln-ctitle:hover { color: var(--accent); }
.ln-cby { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0; }
.ln-prog { margin-top: auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.ln-prog--hero { padding: 4px 0 0; max-width: 360px; margin-top: 0; }
.ln-bar { height: 6px; border-radius: 3px; background: rgba(var(--ink-rgb), 0.1); overflow: hidden; }
.ln-bar > span { display: block; height: 100%; background: var(--accent-fill); border-radius: 3px; }
.ln-done { color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

.ln-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent-fill); color: var(--accent-ink); }
.ln-cover .ln-badge { position: absolute; left: 10px; top: 10px; z-index: 1; }
.ln-badge--red { background: #d8463b; color: #fff; }

.ln-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 6px; font: inherit; font-weight: 600; font-size: 15px; background: var(--accent-fill); color: var(--accent-ink); border: 1px solid var(--accent-fill); white-space: nowrap; cursor: pointer; text-decoration: none; }
.ln-btn:hover { background: var(--accent-fill-hover, var(--accent-fill)); color: var(--accent-ink); }
.ln-btn[disabled] { opacity: 0.6; cursor: default; }
.ln-btn--line { background: transparent; border-color: rgba(var(--accent-rgb), 0.55); color: var(--accent); }
.ln-btn--line:hover { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.ln-btn--quiet { background: rgba(var(--ink-rgb), 0.06); border-color: transparent; color: var(--ink); }
.ln-btn--quiet:hover { background: rgba(var(--ink-rgb), 0.11); color: var(--ink); }
.ln-btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }

.ln-buy-wrap { display: flex; flex-direction: column; gap: 8px; }
.ln-buy { display: flex; gap: 8px; flex-wrap: wrap; }
.ln-buy .ln-btn { flex: 0 0 auto; }
.ln-buy-note { color: var(--ink); }
.ln-buy-note a { color: var(--accent); }
/* The price, only in a course's own buy area (Carson: price after value). */
.ln-buy-price { color: var(--muted); }
/* A locked event's line (tickets, 24 Nov 2026): even lines, never a word or two alone on the last. */
.ln-fine.ln-ticketline { text-wrap: balance; }

/* Continue Where You Left Off, and a course's own header. */
.ln-cont { display: grid; grid-template-columns: 240px 1fr; overflow: hidden; }
.ln-cont .ln-cover { aspect-ratio: auto; min-height: 140px; }
.ln-cont .ln-cbody { justify-content: center; gap: 8px; padding: 18px 22px; }
.ln-hero { grid-template-columns: 300px 1fr; }

/* Lessons */
.ln-split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ln-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ln-video { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #0a0908; }
.ln-video iframe, .ln-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.ln-video-none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; color: #cfc8ba; font-size: 14px; }
.ln-lessons { overflow: hidden; }
.ln-lessons h4 { margin: 0; padding: 14px 16px 6px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.ln-lesson { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 14.5px; color: var(--ink); text-decoration: none; }
/* The tick sits on the title's first line, however many lines it runs to (LEARN-15). */
.ln-lesson > .ln-tick { margin-top: -3px; }
.ln-lesson > .ln-row, .ln-lesson > .ln-btn { align-self: center; }
.ln-lessons > .ln-lesson:first-child { border-top: 0; }
a.ln-lesson:hover { background: rgba(var(--accent-rgb), 0.06); }
.ln-tick { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(var(--ink-rgb), 0.22); display: flex; align-items: center; justify-content: center; color: transparent; }
.ln-lesson.is-done .ln-tick { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); }
.ln-lesson.is-now { background: rgba(var(--accent-rgb), 0.1); font-weight: 600; }
.ln-lesson.is-now .ln-tick { border-color: var(--accent-fill); }
.ln-lesson.is-locked { color: var(--muted); }
.ln-lesson.is-locked .ln-tick { color: var(--muted); }
.ln-tick--play { border-color: rgba(var(--accent-rgb), 0.6); color: var(--accent); }
.ln-tick--live { border-color: var(--accent-fill); color: var(--accent); }
.ln-tick--zoom { border-color: #4678be; color: #4678be; }
.ln-lesson .ln-row { flex-wrap: nowrap; }
.ln-ltext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.ln-ltext .ln-fine { font-size: 12.5px; font-weight: 400; }
a.ln-ltext--link { color: inherit; text-decoration: none; }
a.ln-ltext--link:hover { color: var(--accent); }
.ln-attach { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 14.5px; }
.ln-attach > .ln-pdf { margin-top: -3px; }
.ln-attach > .ln-btn, .ln-attach > .ln-fine { align-self: center; }
.ln-pdf { flex: none; width: 26px; height: 26px; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.ln-complete { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 14px 16px; container-type: inline-size; }
.ln-moves { display: flex; gap: 10px; margin-left: auto; }
.ln-complete-note { flex-basis: 100%; }
.ln-complete-note[hidden] { display: none; }
.ln-points { color: var(--accent); font-weight: 600; }
/* Too narrow for one row (a phone, or the 1024 screen with the menu open):
   Mark Complete across the top, Previous and Next an even pair under it (LEARN-18). */
@container (max-width: 520px) {
  .ln-complete .ln-mark { flex: 1 1 100%; }
  .ln-complete .ln-moves { flex: 1 1 100%; margin-left: 0; }
  .ln-complete .ln-moves .ln-btn { flex: 1 1 0; min-height: 44px; }
}
.ln-text { font-size: 15.5px; line-height: 1.65; max-width: 68ch; color: var(--ink); overflow-wrap: anywhere; }
.ln-text h4, .ln-text h5 { font-family: var(--display); font-weight: var(--display-weight); font-size: 19px; margin: 14px 0 4px; }
.ln-text h5 { font-size: 17px; }
.ln-text p { margin: 0 0 10px; }
.ln-text ul, .ln-text ol { margin: 0 0 10px; padding-left: 22px; }
.ln-text li { margin: 2px 0; }
.ln-text a { color: var(--accent); }
.ln-text img { max-width: 100%; height: auto; border-radius: 6px; }
.ln-text blockquote { margin: 0 0 10px; padding-left: 14px; border-left: 3px solid rgba(var(--accent-rgb), 0.5); color: var(--muted); }

/* Events */
.ln-event { display: grid; grid-template-columns: 300px 1fr; overflow: hidden; }
.ln-event .ln-cover { aspect-ratio: auto; min-height: 170px; }
.ln-event .ln-cbody { padding: 18px 22px; gap: 8px; }
.ln-ctitle--event { font-size: 22px; }
.ln-when { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; margin: 0; }
.ln-when svg { color: var(--accent); flex: none; }
.ln-going { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ln-faces { display: inline-flex; }
.ln-face { width: 28px; height: 28px; border-radius: 50%; margin-left: -4px; box-shadow: 0 0 0 2px var(--bg-raised); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; letter-spacing: -0.02em; font-weight: 700; color: #1a1510; background: linear-gradient(135deg, #8a6a24, #e2c98f); }
.ln-face:first-child { margin-left: 0; }
.ln-past { overflow: hidden; display: flex; flex-direction: column; }
.ln-past .ln-cbody { padding: 12px 14px 14px; gap: 4px; }
.ln-past .ln-ctitle { font-size: 16.5px; }
.ln-joinbox { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* The Live page: Duke's stream with our chat beside it. */
.ln-livehead { display: flex; flex-direction: column; gap: 4px; }
.ln-live { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.ln-stage { position: relative; min-width: 0; }
.ln-stage .ln-video { width: 100%; }
.ln-fsbar { display: none; }
.ln-chat { display: flex; flex-direction: column; overflow: hidden; min-height: 0; height: 100%; max-height: 560px; }
.ln-live:not(.is-full) .ln-chat { height: 420px; }
.ln-chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.ln-chat-head .ln-members-only { flex: 1; }
.ln-chat .ln-hide { display: none; }
.ln-chat-list { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.ln-chat-empty { margin: auto 0; text-align: center; }
.ln-msg { display: flex; gap: 10px; font-size: 14px; line-height: 1.45; position: relative; }
.ln-msg-text { min-width: 0; overflow-wrap: anywhere; flex: 1; }
.ln-msg b { font-weight: 600; }
.ln-host { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); background: var(--accent-fill); border-radius: 3px; padding: 1px 5px; margin-left: 5px; vertical-align: 1px; }
.ln-msg-x { position: relative; flex: none; align-self: flex-start; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; }
/* A 40px tap around the small x (LEARN-21). */
.ln-msg-x::after { content: ''; position: absolute; inset: -9px; }
.ln-msg:hover .ln-msg-x, .ln-msg-x:focus-visible { opacity: 1; }
@media (hover: none) { .ln-msg-x { opacity: 0.6; } }
.ln-chat-note { padding: 0 14px 6px; color: #d8463b; }
.ln-chat-box { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.ln-chat-input { flex: 1; box-sizing: border-box; height: 42px; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-input); color: var(--ink); font: inherit; font-size: 15px; line-height: 20px; resize: none; overflow-y: auto; }
.ln-chat-input:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.6); }
.ln-send { width: 42px; height: 42px; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex: none; border: 0; cursor: pointer; }
.ln-send[disabled] { opacity: 0.5; cursor: default; }
.ln-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: #fff; font: inherit; font-weight: 600; font-size: 14px; border: 1px solid rgba(255, 255, 255, 0.22); cursor: pointer; }
.ln-chip--gold { background: #c4a663; color: #17140e; border-color: #c4a663; }
.ln-chip--quiet { padding: 5px 10px; font-size: 12.5px; background: transparent; color: var(--ink); border-color: var(--line); }
.ln-count { background: #17140e; color: #c4a663; border-radius: 9px; padding: 0 6px; font-size: 11.5px; }

/* Our Full Screen: the player and the chat together, chat on the right. */
.ln-live.is-full { position: fixed; inset: 0; z-index: 200; gap: 0; background: #000; grid-template-columns: minmax(0, 1fr) 360px; }
.ln-live.is-full.is-chat-hidden { grid-template-columns: minmax(0, 1fr) 0; }
.ln-live.is-full.is-chat-hidden .ln-chat { display: none; }
.ln-live.is-full .ln-stage { display: flex; align-items: center; justify-content: center; background: #000; height: 100vh; }
.ln-live.is-full .ln-stage .ln-video { width: 100%; height: auto; max-height: 100vh; border-radius: 0; }
.ln-live.is-full .ln-fsbar { display: flex; position: absolute; left: 16px; right: 16px; top: 14px; z-index: 2; align-items: center; gap: 10px; color: #fff; pointer-events: none; }
.ln-live.is-full .ln-fsbar > * { pointer-events: auto; }
.ln-live.is-full .ln-fsbar b { font-family: var(--display); font-weight: 500; font-size: 20px; flex: 1; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.ln-live.is-full .ln-chat { border-radius: 0; border-width: 0 0 0 1px; height: 100vh; max-height: none; }
.ln-live.is-full .ln-chat .ln-hide { display: inline-flex; }

/* The Schedule's Events calendar (opens first; Racing Calendar one tap away). */
.tool-view[data-tool="schedule"]:has(.ln-cal) { --tool-w: 1060px; }
.ln-calrow { justify-content: space-between; align-items: flex-end; }
.sc-modes { margin-bottom: 10px; }
.ln-cal { overflow: hidden; }
.ln-calhead { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; gap: 10px; flex-wrap: wrap; }
.ln-calhead .ln-btn--sm { min-height: 34px; padding: 0 12px; }
.ln-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.ln-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.ln-key--live { background: var(--accent-fill); }
.ln-key--zoom { background: #4678be; }
.ln-calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.ln-dow { padding: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.ln-day { min-height: 96px; padding: 6px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; min-width: 0; }
.ln-day:nth-child(7n) { border-right: 0; }
.ln-dn { font-weight: 600; color: var(--muted); font-size: 12.5px; }
.ln-day.is-out .ln-dn { opacity: 0.4; }
.ln-day.is-today .ln-dn { background: var(--accent-fill); color: var(--accent-ink); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.ln-ev { display: block; border-radius: 4px; padding: 3px 6px; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ln-ev--live { background: rgba(var(--accent-rgb), 0.2); border-left: 3px solid var(--accent-fill); }
.ln-ev--zoom { background: rgba(70, 120, 190, 0.18); border-left: 3px solid #4678be; }
.ln-ev:hover { filter: brightness(1.1); }
.ln-menu .tool-link.is-off { opacity: 0.45; }

/* Add an Event (admins) */
/* On the page's own left edge, under its title, not floating in the middle (LEARN-32). */
.ln-form { max-width: 620px; width: 100%; margin: 0; overflow: hidden; }
.ln-form-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ln-form-head b { font-family: var(--display); font-weight: var(--display-weight); font-size: 19px; text-align: center; }
.ln-form-head .ln-btn { justify-self: end; }
.ln-form-cancel { justify-self: start; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; padding: 6px 2px; }
.ln-form-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.ln-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ln-kind { border: 1px solid var(--line); border-radius: 8px; padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font: inherit; font-size: 13px; color: var(--muted); background: transparent; cursor: pointer; }
.ln-kind b { color: var(--ink); font-size: 14.5px; }
.ln-kind svg { color: var(--accent); }
.ln-kind.is-on { border-color: var(--accent-fill); background: rgba(var(--accent-rgb), 0.12); box-shadow: inset 0 0 0 1px var(--accent-fill); }
.ln-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; min-width: 0; }
.ln-field[hidden] { display: none; }
.ln-in { min-height: 44px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-input); color: var(--ink); font: inherit; font-size: 15px; font-weight: 400; width: 100%; box-sizing: border-box; }
.ln-in:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.6); }
.ln-in--tall { min-height: 76px; padding: 10px 12px; resize: vertical; }
select.ln-in { appearance: auto; }
.ln-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ln-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ln-pill { padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line); font: inherit; font-size: 13.5px; color: var(--ink); background: transparent; cursor: pointer; }
.ln-pill.is-on { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--accent-ink); font-weight: 600; }
.ln-cover-btn { display: flex; align-items: center; gap: 10px; color: var(--muted); text-align: left; cursor: pointer; }
.ln-cover-btn img { width: 72px; height: 40px; object-fit: cover; border-radius: 4px; }
.ln-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--ink); cursor: pointer; }
.ln-switch { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: rgba(var(--ink-rgb), 0.2); position: relative; flex: none; cursor: pointer; margin: 0; transition: background 0.15s; }
.ln-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.ln-switch:checked { background: var(--accent-fill); }
.ln-switch:checked::after { left: 21px; }
.ln-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ln-form-note { color: #d8463b; min-height: 1em; }
.ln-form-note:empty { display: none; }

/* Duke is live now: over every page while an event runs (the 13 Oct mockup). */
.ln-livebar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 14px; background: #17150f; color: #f5f0e6; text-decoration: none; border-bottom: 1px solid rgba(196, 166, 99, 0.35); }
.ln-livebar:hover { color: #f5f0e6; background: #1d1a13; }
.ln-pulse { width: 10px; height: 10px; border-radius: 50%; background: #e0483c; box-shadow: 0 0 0 4px rgba(224, 72, 60, 0.25); flex: none; animation: ln-pulse 1.6s ease-in-out infinite; }
@keyframes ln-pulse { 50% { box-shadow: 0 0 0 7px rgba(224, 72, 60, 0.08); } }
@media (prefers-reduced-motion: reduce) { .ln-pulse { animation: none; } }
.ln-livebar-t { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.3; font-weight: 600; }
.ln-livebar-t small { display: block; color: #cfc8ba; font-size: 12.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-livebar-join { padding: 9px 16px; border-radius: 6px; background: #c4a663; color: #17140e; font-weight: 700; font-size: 14px; flex: none; }

/* The Live Room (LiveKit), the approved "room" mockup. */
.ln-room { background: #0b0a08; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; color: #f5f0e6; }
.ln-room-top { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ln-room-top b { font-family: var(--display); font-weight: 500; font-size: 18px; flex: 1; min-width: 0; }
.ln-room-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ln-room.is-chat .ln-room-body { grid-template-columns: minmax(0, 1fr) 320px; }
.ln-room-chat .ln-chat { height: 100%; max-height: 640px; min-height: 380px; }
.ln-stage-room { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ln-room-main .ln-tile { aspect-ratio: 16 / 9; }
.ln-room-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ln-tile { position: relative; border-radius: 8px; background: #1c1914; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; }
.ln-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ln-tile video[hidden], .ln-tile .ln-big[hidden] { display: none; }
.ln-big { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; color: #1a1510; background: linear-gradient(135deg, #8a6a24, #e2c98f); }
.ln-tile.is-lead .ln-big { width: 96px; height: 96px; font-size: 30px; }
.ln-tile.is-speaking { box-shadow: inset 0 0 0 3px #c4a663; }
.ln-tile.is-hand { box-shadow: inset 0 0 0 2px rgba(196, 166, 99, 0.6); }
.ln-name { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.6); padding: 3px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; max-width: calc(100% - 16px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #f5f0e6; }
.ln-tile-acts { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.ln-tile-act { padding: 4px 10px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.55); color: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ln-tile--screen { background: #000; }
.ln-tile--screen video { object-fit: contain; }
.ln-tile--more { color: #cfc8ba; font-size: 13px; font-weight: 600; }
.ln-ctrls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ln-ctrl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; padding: 8px 10px; border-radius: 8px; background: #23201a; color: #f5f0e6; border: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ln-ctrl.is-on { background: #c4a663; color: #17140e; }
.ln-ctrl--leave { background: #d8463b; color: #fff; }
.ln-ctrl.is-rec { background: #f5f0e6; color: #b8392f; }
.ln-rec { color: #ff6b5e; font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ln-room-note { color: #cfc8ba; text-align: center; min-height: 1em; }

/* Settings: Learn, Courses (admins). */
.ln-mg-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.ln-mg-acts { display: flex; gap: 10px; align-items: center; }
.ln-mg-arrow { font-size: 11px; padding: 2px 4px; }
.ln-mg-arrow:disabled { opacity: 0.3; cursor: default; }
.ln-mg-inside { margin: 0 0 10px 14px; padding-left: 14px; border-left: 2px solid rgba(var(--accent-rgb), 0.35); }
.ln-mg-section { margin: 12px 0 2px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ln-mg-lesson .s-ann-words strong { font-weight: 500; }
.ln-mg-add { display: block; margin: 6px 0 4px; }
.ln-mg-check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); grid-column: 1 / -1; }
@media (max-width: 860px) {
  .ln-mg-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ln-mg-row .ln-mg-acts { grid-column: 1 / -1; }
  .ln-mg-inside { margin-left: 4px; padding-left: 10px; }
}

/* Start Here */
.ln-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ln-steps--4 { grid-template-columns: repeat(2, 1fr); }
.ln-more { padding: 16px; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.ln-more p { margin: 0; flex: 1 1 260px; color: var(--muted); font-size: 14px; line-height: 1.5; text-wrap: pretty; }
.ln-step { padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ln-step b { font-family: var(--display); font-weight: var(--display-weight); font-size: 18px; }
.ln-step p { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.ln-num { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-fill); color: var(--accent-ink); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Loading */
.ln-loading { display: flex; flex-direction: column; gap: 14px; max-width: 1060px; margin: 0 auto; }
.ln-shimmer { display: block; height: 120px; border-radius: 8px; background: linear-gradient(90deg, rgba(var(--ink-rgb), 0.05), rgba(var(--accent-rgb), 0.1), rgba(var(--ink-rgb), 0.05)); background-size: 200% 100%; animation: ln-sheen 1.4s ease-in-out infinite; }
.ln-shimmer:first-child { height: 46px; width: 60%; }
@keyframes ln-sheen { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .ln-shimmer { animation: none; } }

@media (max-width: 860px) {
  .ln-page { gap: 16px; }
  .ln-h { font-size: 24px; }
  .ln-tabs { align-self: stretch; }
  .ln-tab { flex: 1; justify-content: center; padding: 9px 6px; font-size: 13.5px; gap: 5px; }
  .ln-tab svg { display: none; }
  .ln-grid { grid-template-columns: 1fr; }
  .ln-event { grid-template-columns: 1fr; }
  .ln-event .ln-cover { aspect-ratio: 16 / 9; min-height: 0; }
  .ln-cont { grid-template-columns: 104px 1fr; }
  .ln-cont .ln-cover { min-height: 100%; }
  .ln-cont .ln-cbody { padding: 12px 14px; gap: 6px; }
  .ln-cont .ln-ctitle { font-size: 17px; }
  .ln-cont .ln-cont-at { display: none; }
  .ln-hero { grid-template-columns: 1fr; }
  .ln-hero .ln-cover { aspect-ratio: 16 / 9; min-height: 0; }
  .ln-split, .ln-live { grid-template-columns: 1fr; }
  .ln-steps { grid-template-columns: 1fr; }
  .ln-chat { max-height: 70vh; }
  .ln-live:not(.is-full) .ln-chat { height: 380px; }
  .ln-fsrow { display: none; }
  .ln-calrow { flex-direction: column; align-items: stretch; }
  .ln-room.is-chat .ln-room-body { grid-template-columns: 1fr; }
  .ln-room-strip { grid-template-columns: repeat(3, 1fr); }
  .ln-tile .ln-big { width: 34px; height: 34px; font-size: 12.5px; margin-bottom: 14px; }
  .ln-tile.is-lead .ln-big { width: 72px; height: 72px; font-size: 24px; margin-bottom: 0; }
  .ln-name { font-size: 11px; padding: 2px 6px; left: 5px; bottom: 5px; }
  .ln-ctrl { min-width: 0; flex: 1; padding: 8px 4px; }
  .ln-calrow .ln-tabs { align-self: stretch; }
  /* Phone: a dot for each event on its day, the list under the grid. */
  .ln-day { min-height: 48px; padding: 4px; }
  .ln-day .ln-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .ln-ev--live { background: var(--accent-fill); }
  .ln-ev--zoom { background: #4678be; }
  .ln-2, .ln-kinds { grid-template-columns: 1fr; }
  .ln-kinds { grid-template-columns: repeat(3, 1fr); }
  .ln-kind { padding: 10px 6px; font-size: 12px; }
  .ln-legend { gap: 10px; font-size: 12px; }
  .ln-lessons .ln-lesson { flex-wrap: wrap; }
  .ln-lessons .ln-lesson > .ln-row { margin-left: 38px; }
}

/* Design pass, 16 Nov 2026 (Carson: "some buttons are oversized or photos cut off").
   Phones: every tab control is one compact height and never stretches to its row;
   the Continue card shows its artwork whole, on top, instead of a cropped strip. */
@media (max-width: 860px) {
  .ln-tabs { flex: none; }
  .ln-tab { height: 40px; padding-top: 0; padding-bottom: 0; }
  .ln-cont { grid-template-columns: 1fr; }
  .ln-cont .ln-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .ln-cont .ln-cbody { padding: 14px 16px 16px; }
}

/* ==========================================================================
   SCHEDULE, ONE PAGE (Carson, review board, 17 Nov 2026): "Events and racing
   calendar shouldn't look much different ... default to calendar view on
   both. And have the list below the calendar." Events and the Racing
   Calendar draw the same top, tabs, filter row and month grid
   (client/tools/schedule-month.ts); the day picked lists under the grid on a
   phone and beside it on a wide screen. Every control is 40px or more.
   ========================================================================== */
.sc-page { container-type: inline-size; gap: 14px; width: 100%; }
.sc-top { justify-content: space-between; align-items: flex-end; gap: 12px; }
.sc-modes { margin: 0; flex: none; }
.sc-modes .ln-tab { white-space: nowrap; min-height: 40px; height: auto; padding: 0 16px; font-size: 14px; justify-content: center; }
.sc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.sc-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm, 6px); overflow: hidden; background: var(--bg-raised); }
.sc-seg-btn { font: inherit; font-size: 13px; min-height: 40px; padding: 0 12px; background: transparent; border: 0; color: var(--muted); cursor: pointer; white-space: nowrap; }
.sc-seg-btn + .sc-seg-btn { border-left: 1px solid var(--line); }
.sc-seg-btn:hover { color: var(--ink); }
.sc-seg-btn.is-on { background: rgba(var(--accent-rgb), 0.16); color: var(--accent); font-weight: 600; }
.sc-seg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.sc-split { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sc-split > * { min-width: 0; }
@container (min-width: 880px) {
  .sc-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); align-items: start; gap: 18px; }
}

/* The month, shared. */
.sc-month .ln-calhead { padding: 12px 14px; }
.sc-month .ln-calhead .ln-btn--sm { min-height: 40px; min-width: 40px; padding: 0 12px; font-size: 14px; }
.sc-month .ln-calhead .sc-nav { gap: 6px; flex-wrap: nowrap; }
.sc-month .ln-legend { flex-wrap: wrap; row-gap: 4px; column-gap: 12px; }
.ln-legend-item { white-space: nowrap; display: inline-flex; align-items: center; }
.ln-key--text { width: auto; height: auto; border-radius: 0; background: none; font-style: normal; font-weight: 700; font-size: 12px; color: var(--ink); margin-right: 5px; vertical-align: 0; }
.sc-key-star { color: var(--accent); }
.ln-key--big { background: var(--accent-fill); }
.ln-key--carry { background: #3f9a8a; }
.ln-key--open { background: rgba(var(--ink-rgb), 0.45); }
.ln-key--off { background: #e5484d; }

.sc-cell { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sc-cell:hover { background: rgba(var(--ink-rgb), 0.04); }
.sc-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sc-cell.is-picked { background: rgba(var(--accent-rgb), 0.1); box-shadow: inset 0 0 0 2px var(--accent); }
.sc-cell.is-closed { cursor: default; }
.sc-cell.is-closed:hover { background: none; }
.sc-cell.is-closed .ln-dn { opacity: 0.4; }
.sc-cell.is-dim > :not(.ln-dn) { opacity: 0.35; }
.sc-cell.is-dim .ln-dn { opacity: 0.55; }
.sc-dstar { position: absolute; top: 6px; right: 7px; font-size: 12px; line-height: 1; color: var(--accent); }
.sc-dcount { font-size: 12px; color: var(--muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-dcount b { color: var(--ink); font-weight: 600; }
span.ln-ev { cursor: inherit; }
.sc-cell span.ln-ev { font-size: 11px; padding: 2px 5px; overflow-wrap: anywhere; }
.ln-ev--big { background: rgba(var(--accent-rgb), 0.2); border-left: 3px solid var(--accent-fill); }
.ln-ev--carry { background: rgba(63, 154, 138, 0.18); border-left: 3px solid #3f9a8a; }
.ln-ev--open { background: rgba(var(--ink-rgb), 0.07); border-left: 3px solid rgba(var(--ink-rgb), 0.45); }
.ln-ev--off { background: rgba(229, 72, 77, 0.14); border-left: 3px solid #e5484d; }

/* The day picked. */
.sc-list { display: flex; flex-direction: column; gap: 10px; }
.sc-list-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; scroll-margin-bottom: 24px; }
.sc-list-title { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.25; margin: 0; color: var(--ink); }
.sc-list-head .sc-count { margin-left: auto; }
.sc-list-sub { margin-top: 6px; }
.sc-day--list { padding-top: 2px; }
.sc-day--list > .sc-track:first-child { border-top: 0; }
.sc-list .sc-ahead { margin-top: 4px; }
.sc-page .sc-track .star-btn { min-width: 40px; min-height: 40px; margin: -10px -8px -10px -12px; font-size: 17px; }
.sc-page .sc-fine { margin: 0; }
.sc-page .ln-btn--sm { min-height: 40px; }

@media (max-width: 860px) {
  .sc-top { gap: 10px; align-items: stretch; }
  .sc-modes { display: flex; align-self: stretch; }
  .sc-modes .ln-tab { flex: 1 1 0; height: auto; min-height: 40px; padding: 0 8px; }
  .sc-filters { gap: 6px; }
  .sc-seg-btn { padding: 0 10px; }
  .sc-month .ln-calhead { padding: 10px 12px; gap: 8px; }
  .sc-month .ln-legend { font-size: 12px; column-gap: 10px; }
  .sc-cell { min-height: 54px; padding: 4px 3px; gap: 3px; }
  .sc-cell .ln-ev, .sc-cell span.ln-ev { pointer-events: none; font-size: 0; padding: 0; }
  .ln-ev--big { background: var(--accent-fill); }
  .ln-ev--carry { background: #3f9a8a; }
  .ln-ev--open { background: rgba(var(--ink-rgb), 0.45); }
  .ln-ev--off { background: #e5484d; }
  .sc-dstar { top: 4px; right: 4px; font-size: 10px; }
  .sc-dcount { font-size: 11.5px; line-height: 1.1; }
  .sc-dcount-w { display: none; }
  .sc-list-title { font-size: 17px; }
}
/* ======================== end SCHEDULE, ONE PAGE ======================== */

/* Racing polish (23 Nov 2026). RACE-27: today, picked, is its gold circle and
   the soft fill; the gold box is for a day picked that is not today, so the
   two never stack. The menu's line icons (RACE-26) sit like the rail's. */
.sc-cell.is-today.is-picked { box-shadow: none; }
.door-sub .tool-link > .door-icon svg { display: block; margin: 0 auto; }

/* ==========================================================================
   LEARN polish (23 Nov 2026, LEARN-01 to LEARN-37)
   ========================================================================== */
/* Lines that end on one word, headings in even lines (LEARN-13). */
.ln-sub, .ln-fine, .ln-ltext, .ln-step p, .ln-text p, .ln-text li { text-wrap: pretty; }
.ln-h, .ln-ctitle, .ln-step b { text-wrap: balance; }
.ln-nw { white-space: nowrap; }

/* The when line: breaks only between "day", "time Pacific" and "time Eastern",
   and a dot never starts or ends a line: each dot sits in the gap before its
   piece, and the first piece on a line has its dot clipped off (LEARN-11). */
.ln-when-t { display: block; flex: 1; min-width: 0; overflow: hidden; }
.ln-when-row { display: flex; flex-wrap: wrap; margin-left: -16px; }
.ln-when-row > span { position: relative; white-space: nowrap; margin-left: 16px; }
.ln-when-row > span + span::before { content: '\00b7'; position: absolute; left: -16px; width: 16px; text-align: center; }
.ln-livewhen { margin: 6px 0 0; }
.ln-when { align-items: flex-start; }
.ln-when svg { margin-top: 1px; }

/* The back link: one line with an ellipsis, and a 40px tap (LEARN-16, LEARN-21). */
.ln-back, .ln-start-link { position: relative; max-width: 100%; min-width: 0; }
.ln-back::after, .ln-start-link::after { content: ''; position: absolute; inset: -10px -8px; }
.ln-back svg, .ln-start-link svg { flex: none; }
.ln-back-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Locked: one quiet line (LEARN-25). */
.ln-vipline { color: var(--muted); }
.ln-prog .ln-vipline { padding: 2px 0 0; }

/* Lesson rows: Continue under the title on a phone (LEARN-14). */
@media (max-width: 860px) {
  .ln-lessons .ln-lesson.has-go .ln-ltext { flex: 1 1 calc(100% - 38px); }
  .ln-lessons .ln-lesson.has-go > .ln-lesson-go { margin-left: 38px; align-self: flex-start; }
  .ln-steps--4 { grid-template-columns: 1fr; }
}

/* Chat: the time on each line, links that read short and open (LEARN-29). */
.ln-msg-time { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.ln-msg-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.ln-msg-text { overflow-wrap: break-word; }

/* Learn's menu: "Live" in place of a count while one is on (LEARN-23). */
.ch-new--live { background: #d8463b; color: #fff; }

/* Settings, Learn (admins) on a phone: the arrows and text buttons answer a 40px tap (LEARN-21). */
@media (max-width: 860px) {
  .ln-mg-acts .linkish, .ln-mg-arrow, .ln-mg-add { position: relative; }
  .ln-mg-acts .linkish::after, .ln-mg-add::after { content: ''; position: absolute; inset: -12px -6px; }
  .ln-mg-arrow { min-width: 28px; }
  .ln-mg-arrow::after { content: ''; position: absolute; inset: -12px -6px; }
  .ln-mg-acts { gap: 14px; }
}

/* Settings, Learn: the cover beside its button, and a PDF's own name (LEARN-32). */
.ln-mg-coverpick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ln-mg-cover { width: 96px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #14110d; }
.ln-mg-cover[hidden] { display: none; }
.ln-mg-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
/* The padlock on a locked cover sits in its own dark disc, clear of the artwork's words. */
.ln-lock > svg { box-sizing: content-box; padding: 13px; border-radius: 50%; background: rgba(10, 9, 8, 0.62); border: 1px solid rgba(255, 255, 255, 0.22); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* FINAL-15: a link in the live chat breaks after a slash (the <wbr>s
   chatBody puts there) and nowhere else. */
.ln-msg-text .ln-msg-link { overflow-wrap: normal; word-break: normal; }
