/* ===== class countdown + live (course-schedule.js) ===== */
.cd-host{margin:2px 0 4px}
.cd{display:grid;gap:10px;padding:14px;border-radius:12px;background:color-mix(in srgb,var(--blue) 8%,var(--surface));border:1px solid color-mix(in srgb,var(--blue) 24%,var(--line))}
.cd-msg{display:flex;align-items:flex-start;gap:8px;margin:0;font-weight:600;line-height:1.45;color:var(--text)}
.cd-msg svg{flex:none;margin-top:2px;color:var(--link)}
.cd-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px}
.cd-lbl{font-size:13px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-3)}
.cd-t{display:flex;gap:8px}
.cd-u{display:grid;justify-items:center;min-width:64px;padding:8px 10px;border-radius:10px;background:var(--surface);border:1px solid var(--line)}
.cd-u b{font-size:26px;line-height:1.1;font-weight:700;font-variant-numeric:tabular-nums;color:var(--text)}
.cd-u small{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.cd-u b.flip{animation:cdFlip .28s cubic-bezier(.23,1,.32,1)}
.cd-sub{display:flex;align-items:center;gap:6px;margin:0;font-size:13.5px;color:var(--text-2)}
.cd-live{background:color-mix(in srgb,#DC2626 8%,var(--surface));border-color:color-mix(in srgb,#DC2626 34%,var(--line))}
.cd-tag{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;background:#DC2626;color:#fff;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.cd-tag i{width:7px;height:7px;border-radius:50%;background:#fff;animation:cdPulse 1.4s ease-in-out infinite}
.cd-join,.cd-go{justify-self:start}
.cd-join[disabled]{opacity:.7;cursor:progress}
/* b31: why Join did not open (class ended, not approved …) */
.cd-err{margin:0;font-size:13px;color:#DC2626;animation:cdIn .24s cubic-bezier(.23,1,.32,1)}
@keyframes cdIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes cdFlip{from{opacity:.2;transform:translateY(-5px)}to{opacity:1;transform:none}}
@keyframes cdPulse{50%{opacity:.3;transform:scale(.7)}}
@media (max-width:560px){ .cd-u{min-width:0;flex:1} .cd-t{width:100%} .cd-join,.cd-go{width:100%;justify-content:center;min-height:44px} }
@media (prefers-reduced-motion:reduce){ .cd-u b.flip,.cd-tag i,.cd-err{animation:none} }

/* home page: "Your course" card = the registration .feature card (index.html), with the countdown inside */
#myClass{padding:20px 0 0}
.mc-f{animation:mcIn .35s cubic-bezier(.23,1,.32,1)}
.mc-f.no-poster{grid-template-columns:1fr}
.mc-f .body{align-items:flex-start}
.mc-f .cd-host{align-self:stretch;margin:2px 0}
.mc-f .cd{max-width:520px}
.mc-f .badge.event{display:inline-flex}
@keyframes mcIn{from{opacity:0;transform:translateY(8px)}}
@media (prefers-reduced-motion:reduce){.mc-f{animation:none}}

/* home page: live class bar (under the header, like the scam-alert bar) */
.live-bar{display:block;background:#DC2626;color:#fff;text-decoration:none;animation:lbIn .35s cubic-bezier(.23,1,.32,1)}
.live-bar[hidden]{display:none}
.live-bar .wrap{display:flex;align-items:center;gap:12px;min-height:48px;padding-top:6px;padding-bottom:6px}
.lb-tag{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;background:#fff;color:#B91C1C;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.lb-tag i{width:7px;height:7px;border-radius:50%;background:#DC2626;animation:cdPulse 1.4s ease-in-out infinite}
.lb-txt{flex:1;min-width:0;font-weight:600;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb-go{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:14px;white-space:nowrap}
.live-bar:hover{background:#B91C1C}
.live-bar:focus-visible{outline:3px solid #fff;outline-offset:-3px}
@keyframes lbIn{from{opacity:0;transform:translateY(-100%)}}
@media (max-width:560px){ .lb-go span,.lb-go{font-size:13px} .lb-txt{font-size:14px} }
@media (prefers-reduced-motion:reduce){ .live-bar,.lb-tag i{animation:none} }


/* Course activities: class schedule = next class + a strip of day cards (flat, same radii as the rest of the site) */
.sc-card{padding:16px;display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.sc-top{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:12px 24px;align-items:center}
.sc-top .cd-host[hidden]{display:none}
.sc-card .cd{padding:0;border:0;background:none;gap:8px}
.sc-card .cd-live{padding:12px;border-radius:10px;border:1px solid color-mix(in srgb,#DC2626 40%,var(--line));background:color-mix(in srgb,#DC2626 7%,var(--surface))}
.sc-card .cd-live .cd-lbl{color:var(--text);font-size:14px;text-transform:none;letter-spacing:0;font-weight:700}
.sc-card .cd-u{min-width:56px;padding:6px 8px;border-radius:8px;background:var(--surface-2);border:1px solid var(--line)}
.sc-card .cd-u b{font-size:22px}
.sc-stats{display:grid;gap:8px}
.sc-stat{padding:10px 12px;border-radius:10px;border:1px solid var(--line)}
.sc-stat-h{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.sc-stat b{font-size:14px}.sc-stat em{font-style:normal;font-size:14px;font-weight:700;font-variant-numeric:tabular-nums}
.sc-stat small{display:block;margin-top:2px;font-size:13px;color:var(--text-2)}
.sc-bar{height:4px;margin-top:8px;border-radius:2px;background:var(--line);overflow:hidden}
.sc-bar i{display:block;width:100%;height:100%;background:var(--blue);transform-origin:left center;transition:transform .5s cubic-bezier(.23,1,.32,1)}
.sc-bar.g i{background:#16A34A}
.sc-wrap{position:relative}
.sc-strip{position:relative;display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x proximity;scroll-padding-inline:2px;scrollbar-width:none;padding:2px}
.sc-strip::-webkit-scrollbar{display:none}
.sc-d{flex:none;scroll-snap-align:start;display:grid;justify-items:center;gap:1px;width:76px;padding:8px 4px;border-radius:8px;background:var(--surface);border:1px solid var(--line)}
.sc-d .w{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.sc-d .n{font-size:22px;line-height:1.15;font-weight:700;font-variant-numeric:tabular-nums}
.sc-d .m{font-size:11.5px;color:var(--text-3)}
.sc-d .tm{margin-top:4px;font-size:12px;font-weight:600;color:var(--text-2);font-variant-numeric:tabular-nums}
.sc-d .st{display:inline-flex;align-items:center;gap:3px;min-height:18px;margin-top:2px;font-size:11.5px;font-weight:600;color:var(--text-2)}
.sc-d.joined{border-color:color-mix(in srgb,#16A34A 50%,var(--line));background:color-mix(in srgb,#16A34A 8%,var(--surface))}
.sc-d.joined .st{color:#15803D}
.sc-d.missed{border-style:dashed;background:transparent}
.sc-d.missed .n,.sc-d.missed .tm{color:var(--text-3)}
.sc-d.today,.sc-d.live{border:2px solid var(--blue);padding:7px 3px}
.sc-d.today .st{color:var(--link)}
.sc-d.live{border-color:#DC2626}.sc-d.live .st{color:#DC2626}
.sc-d.holiday{border-color:color-mix(in srgb,#F59E0B 50%,var(--line));background:color-mix(in srgb,#F59E0B 8%,var(--surface))}
.sc-d.holiday .st{color:#B45309}
[data-theme="dark"] .sc-d.joined .st{color:#4ADE80}[data-theme="dark"] .sc-d.holiday .st{color:#FBBF24}[data-theme="dark"] .sc-d.live .st{color:#F87171}
.sc-ar{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:grid;place-items:center;width:40px;height:40px;padding:0;border-radius:8px;border:1px solid var(--line);background:var(--surface);color:var(--text);cursor:pointer;transition:opacity .2s,background .15s}
.sc-ar:hover{background:var(--surface-2)}
.sc-ar.prev{left:-8px}.sc-ar.next{right:-8px}
.sc-ar:disabled{opacity:0;pointer-events:none}
@media (max-width:760px){ .sc-top{grid-template-columns:1fr} .sc-stats{grid-template-columns:1fr 1fr} .sc-card .cd-u{min-width:0;flex:1} .sc-ar.prev{left:-6px}.sc-ar.next{right:-6px} }
@media (max-width:420px){ .sc-stats{grid-template-columns:1fr} }
@media (prefers-reduced-motion:reduce){ .sc-ar,.sc-bar i{transition:none} }
/* home card digits */
.mc-f .cd-u{min-width:60px;padding:8px;border-radius:8px}.mc-f .cd-u b{font-size:24px}
@media (max-width:560px){ .mc-f .cd-u{min-width:0;flex:1} }

/* ===== Course activities: header (flat) ===== */
.ca-hero{display:grid;grid-template-columns:104px minmax(0,1fr);gap:16px;align-items:center;padding:14px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
.ca-hero.no-poster{grid-template-columns:1fr}
.ca-hero-img{width:104px;height:104px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.ca-hero-b{display:grid;gap:8px;min-width:0}
.ca-hero-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.ca-hero h2{margin:0;font-size:clamp(19px,2.2vw,24px);line-height:1.25;letter-spacing:-.01em;text-wrap:balance}
.ca-hero h2 small{font-size:13px;font-weight:600;color:var(--text-3);letter-spacing:0}
.ca-idchip{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:6px;font-size:12px;font-weight:700;background:color-mix(in srgb,#16A34A 14%,transparent);color:#15803D}
[data-theme="dark"] .ca-idchip{color:#4ADE80}
.ca-facts{display:flex;flex-wrap:wrap;gap:4px 16px;margin:0;padding:0;list-style:none;font-size:14px;color:var(--text-2)}
.ca-facts li{display:inline-flex;align-items:center;gap:6px}
.ca-facts svg{color:var(--text-3);flex:none}
@media (max-width:560px){ .ca-hero{grid-template-columns:72px minmax(0,1fr);gap:12px;padding:12px} .ca-hero-img{width:72px;height:72px} }

/* desktop: the top row is one balanced band (next class / live on the left, attendance + progress on the right, same height),
   and the day strip fills the whole width with even tiles */
@media (min-width:761px){
  .sc-top{align-items:stretch;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:16px}
  .sc-top .cd-host{display:flex}
  .sc-top .cd-host .cd{flex:1;display:flex;flex-direction:column;justify-content:center;padding:16px 18px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2)}
  .sc-top .cd-host .cd-live{flex-direction:row;align-items:center;justify-content:space-between;gap:16px;border-color:color-mix(in srgb,#DC2626 45%,var(--line));background:color-mix(in srgb,#DC2626 7%,var(--surface))}
  .sc-top .cd-host .cd-live .cd-row{flex-direction:column;align-items:flex-start;gap:8px}
  .sc-top .cd-host .cd-live .cd-lbl{font-size:16px}
  .sc-top .cd-host .cd-live .cd-join{width:auto;min-height:46px;padding:0 24px;font-size:15px;flex:none}
  .sc-top .cd-host .cd-next .cd-row,.sc-top .cd-host .cd-before .cd-row{align-items:center}
  .sc-stats{align-content:stretch;grid-template-rows:1fr 1fr}
  .sc-stat{display:flex;flex-direction:column;justify-content:center;padding:12px 16px}
  .sc-strip{gap:8px;padding:4px 2px}
  .sc-d{flex:1 0 78px;padding:12px 4px 10px;gap:2px}
  .sc-d .tm{margin-top:6px}
}

/* phones, inside a course: only what is needed. No breadcrumb and no big page title (the course name is right below),
   a light "All courses" link, a compact course header (poster, state, ID, name) without the date line. Desktop is untouched. */
@media (max-width:720px){
  body:has(#caMain:not([hidden])) main > .ph{display:none}
  body:has(#caMain:not([hidden])) #caMain{padding-top:14px}
  #caHead .ca-backl{min-height:32px;padding:0;border:0;background:none;font-size:13.5px;margin-bottom:8px}
  .ca-hero{grid-template-columns:56px minmax(0,1fr);gap:12px;padding:12px;align-items:center}
  .ca-hero-img{width:56px;height:56px;border-radius:8px}
  .ca-hero h2{font-size:17px;line-height:1.3}
  .ca-hero .ca-facts{display:none}
  .ca-hero-b{gap:6px}
}

/* inside a course: no page title / breadcrumb on any screen (the course name is the title) */
body:has(#caMain:not([hidden])) main > .ph{display:none}
body:has(#caMain:not([hidden])) #caMain{padding-top:20px}

/* inside a course: as much room as possible for the schedule. The header is one plain line (no card), the "Class schedule" heading is kept for screen readers only */
body:has(#caMain:not([hidden])) #caMain{padding-top:24px}
body:has(#caMain:not([hidden])) .ca-hero{padding:0;border:0;background:none;border-radius:0;animation:none}
body:has(#caMain:not([hidden])) .ca-hero-b{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 14px}
body:has(#caMain:not([hidden])) .ca-hero h2{font-size:clamp(17px,2vw,21px)}
body:has(#caMain:not([hidden])) .ca-hero .ca-facts{margin:0}
body:has(#caMain:not([hidden])) #ca-sched{margin-top:12px}
body:has(#caMain:not([hidden])) #ca-sched > h2{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;margin:0}

/* quizzes: one list, grouped by day */
.qz-sum{margin:0 0 14px;color:var(--text-2);font-size:14px}
.qz-day{margin:0 0 18px}
.qz-day > h4{margin:0 0 8px;font-size:12.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.qz-list{border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.qz-row{display:flex;align-items:center;gap:12px;padding:12px 14px;min-height:60px;border-top:1px solid var(--line)}
.qz-row:first-child{border-top:0}
.qz-ic{width:36px;height:36px;border-radius:8px;display:grid;place-items:center;background:var(--surface-2);color:var(--link);flex:none}
.qz-t{flex:1;min-width:0}.qz-t b{display:block;font-size:15px;line-height:1.3}.qz-t small{display:block;margin-top:1px;color:var(--text-2);font-size:13px}
.qz-row.done .qz-ic{color:#16A34A}
.qz-row.missed{opacity:.65}.qz-row.missed .qz-ic{color:var(--text-3)}
.qz-pill{flex:none;padding:4px 10px;border-radius:6px;font-size:12.5px;font-weight:700;background:var(--surface-2);color:var(--text-2)}
.qz-pill.ok{background:color-mix(in srgb,#16A34A 14%,transparent);color:#15803D}
[data-theme="dark"] .qz-pill.ok{color:#4ADE80}
.qz-old{margin-top:4px}
.qz-old > summary{cursor:pointer;padding:10px 2px;font-weight:600;color:var(--text-2);list-style:none}
.qz-old > summary::-webkit-details-marker{display:none}
.qz-old > summary::after{content:"\25BE";margin-left:6px;color:var(--text-3)}
.qz-old[open] > summary::after{content:"\25B4"}
.qz-back{display:inline-flex;align-items:center;gap:6px;min-height:36px;margin:0 0 10px;padding:0;border:0;background:none;color:var(--link);font:600 14px Inter,system-ui,sans-serif;cursor:pointer}
.qz-after{margin-top:16px}

/* a little air under the site header so the course name and the cards are never cut off */
body:has(#caMain:not([hidden])) .ca-hero{margin-bottom:4px}
@media (max-width:720px){ body:has(#caMain:not([hidden])) #caMain{padding-top:18px} }
