/* The shared design system of both frontends: the Mac dashboard (templates/) and sclass (web/templates/).
   Minimal: neutral surfaces, hairline borders, one accent, one typeface. Motion is quiet and purposeful:
   content rises into view as it scrolls in, the nav indicator glides, the theme spreads from its button.
   Page-specific parts live in static/web/site.css (sclass only) and static/ui/mac.css (Mac only). */
:root {
  --bg: #fafaf9; --surface: #ffffff; --surface-2: #f4f4f3; --surface-3: #e9e9e7;
  --line: rgba(12, 12, 14, .08); --line-strong: rgba(12, 12, 14, .15);
  --text: #0c0c0e; --text-2: #3f3f46; --muted: #75757e;
  --accent: #4353ff; --accent-ink: #ffffff; --accent-2: #4353ff;
  --ok: #15a34a; --warn: #d97706; --bad: #dc2626; --info: #2563eb; --idle: #a1a1aa;
  --shadow: 0 1px 2px rgba(12, 12, 14, .04);
  --shadow-lg: 0 0 0 1px var(--line), 0 18px 48px -18px rgba(12, 12, 14, .22);
  --radius: 16px; --radius-sm: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);          /* expo out: fast start, long soft landing */
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.3, 1.25, .5, 1);      /* a hint of overshoot, never a bounce */
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: var(--font);
  --intro-delay: 0s;
  color-scheme: light;
}
html.intro { --intro-delay: .5s; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #111113; --surface-2: #18181b; --surface-3: #232327;
    --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
    --text: #f2f2f3; --text-2: #c7c7cc; --muted: #8b8b93;
    --accent: #8d97ff; --accent-ink: #09090b; --accent-2: #8d97ff;
    --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --info: #60a5fa; --idle: #71717a;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
    --shadow-lg: 0 0 0 1px var(--line), 0 24px 56px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #111113; --surface-2: #18181b; --surface-3: #232327;
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
  --text: #f2f2f3; --text-2: #c7c7cc; --muted: #8b8b93;
  --accent: #8d97ff; --accent-ink: #09090b; --accent-2: #8d97ff;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --info: #60a5fa; --idle: #71717a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --shadow-lg: 0 0 0 1px var(--line), 0 24px 56px -20px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 500 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  font-feature-settings: "ss01", "cv11"; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: -.025em; font-weight: 700; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.display { font-family: var(--display); font-weight: 650; font-size: clamp(38px, 5.4vw, 62px); line-height: 1.02;
  letter-spacing: -.045em; text-wrap: balance; }
.display em { font-style: normal; color: var(--muted); }
.serif { font-family: var(--display); font-weight: 650; letter-spacing: -.03em; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.lg { width: 22px; height: 22px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; view-transition-name: topbar;
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: border-color .4s var(--ease), background .4s var(--ease); }
html.scrolled .topbar { border-bottom-color: var(--line); }
.bar { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); transition: transform .5s var(--spring); }
.brand:hover .logo { transform: rotate(-8deg); }
.brand:active .logo { transform: scale(.92); }
.logo .ico { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.1; }
.brand-text .muted { font-weight: 600; }
.tabs { position: relative; display: flex; gap: 2px; margin-inline: auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .25s var(--ease); }
.tabs a .ico { width: 16px; height: 16px; }
.tabs a:hover, .tabs a.on { color: var(--text); }
.tabs a.on { background: var(--surface-2); }
.tabs.has-ind a.on { background: none; }
.tab-ind { position: absolute; z-index: 0; top: 0; bottom: 0; left: 0; width: 0; border-radius: 999px; pointer-events: none;
  background: var(--surface-2); opacity: 0;
  transition: transform .5s var(--ease), width .5s var(--ease), opacity .3s; }
.tab-ind.ready { opacity: 1; }
.bar-right { display: flex; align-items: center; gap: 4px; }
.sync { display: flex; align-items: center; gap: 8px; font: 600 13px var(--font); color: var(--muted); padding: 0 12px; height: 34px;
  border-radius: 999px; border: 0; background: none; white-space: nowrap; cursor: pointer;
  transition: background .25s, color .25s; }
.sync:hover { background: var(--surface-2); color: var(--text); }
.sync-ico { width: 14px; height: 14px; opacity: 0; margin-left: -4px; transition: opacity .25s, transform .7s var(--ease); }
.sync:hover .sync-ico { opacity: 1; transform: rotate(180deg); }
.sync-spin { display: none; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  border-top-color: var(--text); animation: spin .7s linear infinite; }
.sync.running { cursor: progress; color: var(--text); }
.sync.running .pulse, .sync.running .sync-ico { display: none; }
.sync.running .sync-spin { display: block; }
.sync.error { color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
.sync-alert { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin: 0 0 24px; border-radius: 14px;
  color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line));
  animation: rise .6s var(--ease) both; }
.sync-alert[hidden] { display: none; }
.sync-alert > div { flex: 1; font-size: 14px; }
.sync-alert strong { color: var(--bad); }
.sa-ico { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--bad);
  background: color-mix(in srgb, var(--bad) 10%, transparent); }
.sa-ico .ico { width: 16px; height: 16px; }
.sync-alert .icon-btn { width: 30px; height: 30px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--pc, var(--ok)); animation: pulse 2.8s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pc, var(--ok)) 50%, transparent); }
                   80%, 100% { box-shadow: 0 0 0 7px transparent; } }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 999px; cursor: pointer;
  border: 0; background: none; color: var(--text-2); transition: background .25s, color .25s, transform .3s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.lang { position: relative; }
.lang-btn { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 0; background: none; color: var(--text-2); font: 700 12px var(--font); letter-spacing: .06em;
  transition: background .25s, color .25s; }
.lang-btn:hover, .lang.open .lang-btn { background: var(--surface-2); color: var(--text); }
.lang-btn .ico { width: 16px; height: 16px; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 5px; border-radius: 14px; z-index: 40;
  background: var(--surface); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right; pointer-events: none;
  transition: opacity .2s var(--ease), transform .45s var(--ease); }
.lang.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 14px;
  color: var(--text-2); transition: background .2s, color .2s; }
.lang-menu a:hover { background: var(--surface-2); color: var(--text); }
.lang-menu a b { width: 24px; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.lang-menu a.on { color: var(--text); }
.lang-menu a .ico { margin-left: auto; width: 15px; height: 15px; color: var(--text); }
@media (max-width: 760px) {
  .tabs a span, .hide-sm, .lang-btn span { display: none; }
  .tabs a { padding: 8px 11px; }
  .bar { gap: 8px; padding: 10px 14px; }
  .bar-right { gap: 2px; }
}
@media (max-width: 420px) { .brand-text { display: none; } }

/* ---------- search button and palette (Cmd+K) ---------- */
.search-btn { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 11px; margin-right: 4px; border-radius: 999px;
  cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 13px var(--font);
  transition: border-color .25s, color .25s; }
.search-btn:hover { border-color: var(--line-strong); color: var(--text); }
.search-btn .ico { width: 15px; height: 15px; }
.search-btn kbd, .pal-input kbd { font: 600 11px var(--font); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); }
.palette { position: fixed; inset: 0; z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 13vh 16px 16px;
  background: color-mix(in srgb, var(--bg) 50%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s var(--ease); }
.palette[hidden] { display: none; }
.palette.open { opacity: 1; }
.pal-box { width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-lg); transform: translateY(-8px) scale(.98); transition: transform .5s var(--ease); }
.palette.open .pal-box { transform: none; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.pal-input .ico { width: 18px; height: 18px; color: var(--muted); }
.pal-input input { flex: 1; border: 0; outline: none; background: none; color: var(--text); font: 500 16.5px var(--font); }
.pal-input input::placeholder { color: var(--muted); }
.pal-input input::-webkit-search-cancel-button { display: none; }
.pal-results { overflow-y: auto; padding: 6px; }
.pal-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 11px;
  animation: rise .45s var(--ease) both; }
.pal-item.on { background: var(--surface-2); }
.pal-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--c);
  border: 1px solid var(--line); background: var(--surface); }
.pal-ico .ico { width: 16px; height: 16px; }
.pal-main { min-width: 0; display: grid; gap: 2px; }
.pal-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-snip { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pal-item mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.pal-meta { display: grid; justify-items: end; gap: 4px; }
.pal-meta .chip { font-size: 11.5px; padding: 1px 8px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.pal-kind { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pal-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.pal-foot { padding: 9px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .palette { padding-top: 8vh; } .pal-meta { display: none; } .pal-item { grid-template-columns: 32px 1fr; } }

main { max-width: 1120px; margin: 0 auto; padding: 36px 24px 96px; }

/* ---------- surfaces ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card-title h2 .ico { width: 16px; height: 16px; color: var(--muted); }
.card-title > a, .card-title > span { font-size: 13px; }
.lift { transition: border-color .35s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease); }
.lift:hover { border-color: var(--line-strong); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 56px 0 16px; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: color .25s, gap .4s var(--ease); }
.back .ico { width: 16px; height: 16px; }
.back:hover { color: var(--text); gap: 10px; }

/* ---------- small parts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; white-space: nowrap; color: var(--bc); background: color-mix(in srgb, var(--bc) 9%, transparent); }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-overdue { --bc: var(--bad); } .b-soon { --bc: var(--warn); } .b-upcoming { --bc: var(--info); }
.b-done { --bc: var(--ok); } .b-nodate { --bc: var(--idle); }
.chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: none; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c); }
.study-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; color: var(--text); white-space: nowrap; background: var(--surface-2); border: 1px solid var(--line);
  transition: background .25s, border-color .25s, color .25s; }
.study-chip .ico { width: 13px; height: 13px; color: var(--accent); }
.study-chip:hover { border-color: var(--text); }
.studied-btn { cursor: pointer; font-family: var(--font); transition: background .25s, color .25s, border-color .25s; }
.studied-btn .ico { width: 13px; height: 13px; stroke-width: 2.4; }
.studied-btn:hover { border-color: var(--ok); color: var(--ok); }
.studied-btn.on { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.studied-btn.on .ico { animation: pop .5s var(--spring); }
.ext { font: 700 10px/1 var(--font); letter-spacing: .05em; padding: 7px 0; width: 42px; text-align: center; border-radius: 8px;
  flex: none; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px var(--font);
  padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .25s, border-color .25s, transform .3s var(--ease), opacity .2s; }
.btn .ico { width: 16px; height: 16px; transition: transform .45s var(--ease); }
.btn:hover { background: var(--surface-2); }
.btn:hover > .ico:last-child:not(:first-child) { transform: translateX(3px); }
.btn:active { transform: scale(.97); }
.btn.primary, .btn.accent { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.primary:hover, .btn.accent:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.bar-track { height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-track > span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--c, var(--text));
  transform-origin: left; animation: grow 1.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms + .2s + var(--intro-delay)); }
.list { list-style: none; margin: 0; padding: 0; }
.empty-state { display: grid; place-items: center; text-align: center; gap: 8px; padding: 28px 10px; color: var(--muted); font-size: 14px; }
.empty-state .ico { width: 26px; height: 26px; color: var(--ok); }
kbd { font: 600 11px var(--font); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--muted); }

/* ---------- motion ---------- */
/* Content rises into place once, as it enters the viewport (static/ui/ui.js adds .in). html.motion is set in
   <head> only when motion is allowed, so without JavaScript or with reduced motion everything is simply there. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
html.motion .reveal { opacity: 0; }
html.motion .reveal.in { opacity: 1; animation: rise .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + var(--intro-delay)); }
html:not(.motion) .reveal { animation: none; }
html.motion:not(.ui-ready) .reveal { animation: show 0s 2.5s forwards; }  /* ui.js never ran: show it anyway */
@keyframes show { to { opacity: 1; } }
html.motion .reveal:not(.in) .bar-track > span, html.motion .reveal:not(.in) .ring-val,
html.motion .reveal:not(.in) .big-ring .val { animation-play-state: paused; }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@property --vt-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
html.theme-vt::view-transition-group(topbar) { animation: none; }
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-old(topbar) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-new(root), html.theme-vt::view-transition-new(topbar) {
  mix-blend-mode: normal; animation: theme-wave .85s var(--ease-io) both;
  -webkit-mask: radial-gradient(circle at var(--tx, 50%) var(--ty, 0), #000 var(--vt-r), transparent calc(var(--vt-r) + 1px));
  mask: radial-gradient(circle at var(--tx, 50%) var(--ty, 0), #000 var(--vt-r), transparent calc(var(--vt-r) + 1px)); }
@keyframes theme-wave { from { --vt-r: 0px; } to { --vt-r: 160vmax; } }
/* sun <-> moon morphing toggle */
.tt { width: 18px; height: 18px; overflow: visible; color: var(--text); transition: transform .8s var(--ease); }
.tt-core { transform-box: fill-box; transform-origin: center; transform: scale(.5); transition: transform .7s var(--ease); }
.tt-cut { transform: translate(9px, -9px); transition: transform .7s var(--ease); }
.tt-rays { transform-box: view-box; transform-origin: 12px 12px; transition: transform .7s var(--ease), opacity .35s; }
:root[data-theme="dark"] .tt { transform: rotate(-30deg); }
:root[data-theme="dark"] .tt-core { transform: scale(1); }
:root[data-theme="dark"] .tt-cut { transform: none; }
:root[data-theme="dark"] .tt-rays { transform: rotate(-90deg) scale(.2); opacity: 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tt { transform: rotate(-30deg); }
  :root:not([data-theme="light"]) .tt-core { transform: scale(1); }
  :root:not([data-theme="light"]) .tt-cut { transform: none; }
  :root:not([data-theme="light"]) .tt-rays { transform: rotate(-90deg) scale(.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
/* ---------- intro: the mark draws itself, the name settles, the page fades up underneath (~1 s) ---------- */
.intro-screen { display: none; }
html.intro .intro-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center;
  gap: 16px; pointer-events: none; background: var(--bg); animation: intro-out .5s var(--ease-io) .55s forwards; }
.intro-mark { display: grid; place-items: center; animation: mark-out .55s var(--ease-io) .55s forwards; }
.intro-logo { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: var(--bg);
  background: var(--text); animation: logo-in .6s var(--ease) both; }
.intro-logo .ico { width: 26px; height: 26px; stroke: currentColor; stroke-width: 2; }
.intro-logo path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .6s var(--ease) both; }
.intro-logo path + path { animation-delay: .12s; }
.intro-word { display: flex; font: 700 17px var(--font); letter-spacing: -.02em; animation: mark-out .5s var(--ease-io) .5s forwards; }
.intro-word span { display: inline-block; white-space: pre; animation: letter-in .6s var(--ease) both;
  animation-delay: calc(var(--k) * 16ms + .1s); }
.intro-word .dim { color: var(--muted); }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
@keyframes logo-in { from { transform: scale(.85); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes letter-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes mark-out { to { transform: scale(.96); opacity: 0; } }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; margin: 12px 0 32px; }
.hero-text .display { margin: 12px 0 16px; }
.lead { font-size: 16.5px; color: var(--muted); max-width: 46ch; line-height: 1.55; }
.lead b { color: var(--text); font-weight: 650; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }

.next { display: flex; gap: 24px; align-items: center; padding: 24px; overflow: hidden; }
.ring-wrap { position: relative; width: 128px; height: 128px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: var(--surface-3); }
.ring-val { stroke: var(--rc); stroke-linecap: round; stroke-dasharray: 376.99; stroke-dashoffset: var(--off);
  animation: ring-fill 1.8s var(--ease) both calc(.25s + var(--intro-delay)); }
@keyframes ring-fill { from { stroke-dashoffset: 376.99; } }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; gap: 4px; }
.ring-num { font-size: 40px; font-weight: 650; letter-spacing: -.04em; }
.next-body { display: grid; gap: 8px; min-width: 0; }
.next-body .eyebrow { display: flex; align-items: center; gap: 6px; color: var(--rc); }
.next-body .eyebrow .ico { width: 14px; height: 14px; }
.next-body h2 { font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; }
.countdown { display: flex; align-items: baseline; gap: 2px; font-size: 22px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.countdown b { font-weight: 650; letter-spacing: -.02em; }
.countdown i { font-style: normal; color: var(--muted); font-size: 14px; margin-right: 6px; }
.countdown i:not(:first-of-type) { margin: 0 1px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; padding: 18px 20px; }
.stat-ico { position: absolute; top: 18px; right: 18px; width: 18px; height: 18px; display: grid; place-items: center; color: var(--muted); }
.stat-ico .ico { width: 18px; height: 18px; }
.stat-num { font-size: 32px; font-weight: 650; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 6px; }

.grid-3 { display: grid; gap: 16px; grid-template-columns: 1.15fr 1fr 1fr; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 2px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 14px; width: 1px; background: var(--line-strong);
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.timeline li { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; padding: 9px 0; align-items: start; }
.t-dot { width: 9px; height: 9px; border-radius: 50%; margin: 7px 0 0 2px; background: var(--tc);
  box-shadow: 0 0 0 3px var(--surface); }
.t-soon .t-dot, .t-overdue .t-dot { animation: pulse 2.4s var(--ease) infinite; --pc: var(--tc); }
.timeline a { font-weight: 600; transition: color .2s; }
.timeline a:hover { color: var(--accent); }
.meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.timeline .meta, .grade .meta { display: block; }
.timeline .meta .dot, .grade .meta .dot { display: inline-block; margin-right: 6px; vertical-align: 1px; }

.grade { padding: 11px 0; }
.grade + .grade { border-top: 1px solid var(--line); }
.grade-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.grade-top b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.grade-name { font-weight: 600; line-height: 1.3; }
.grade .meta { margin-top: 6px; }

.mat { display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.mat + .mat { border-top: 1px solid var(--line); }
.mat-body { min-width: 0; flex: 1; }
.mat-body a { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.mat-body a:hover { color: var(--accent); }

.courses { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.course-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; overflow: hidden; }
.course-card .stripe { position: absolute; inset: 0 0 auto; height: 2px; background: var(--c); transform: scaleX(0); transform-origin: left;
  transition: transform .7s var(--ease); }
.course-card:hover .stripe { transform: none; }
.cc-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px;
  color: var(--c); border: 1px solid var(--line); background: var(--surface); }
.cc-icon .ico { width: 17px; height: 17px; }
.course-card h3 { font-size: 16px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.cc-stats { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: 10px 0 8px; }
.cc-stats b { color: var(--text); font-weight: 650; }
.cc-go { position: absolute; right: 18px; top: 24px; width: 16px; height: 16px; color: var(--muted);
  transition: transform .5s var(--ease), color .25s; }
.course-card:hover .cc-go { transform: translateX(3px); color: var(--text); }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
  .next { flex-direction: column; align-items: flex-start; }
  .ring-wrap { width: 108px; height: 108px; }
  .ring-num { font-size: 34px; }
  .stat { padding: 16px; gap: 14px; }
  .stat-ico { top: 16px; right: 16px; }
  .stat-num { font-size: 26px; }
}

/* ---------- grades ---------- */
.g-hero { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; padding: 28px; margin: 4px 0 20px; overflow: hidden; }
.big-ring { position: relative; width: 140px; height: 140px; }
.big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.big-ring circle { fill: none; stroke-width: 6; }
.big-ring .bg { stroke: var(--surface-3); }
.big-ring .val { stroke: var(--text); stroke-linecap: round; stroke-dasharray: 376.99; stroke-dashoffset: var(--off);
  animation: ring-fill 1.8s var(--ease) both calc(.25s + var(--intro-delay)); }
.big-ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big-ring .center b { font-family: var(--display); font-weight: 650; font-size: 38px; line-height: 1; letter-spacing: -.04em; }
.g-hero .display { font-size: clamp(32px, 4.6vw, 50px); margin: 8px 0 16px; }
.g-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.g-stats div { display: grid; }
.g-stats b { font-size: 24px; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.g-stats span { font-size: 13px; color: var(--muted); font-weight: 500; }

.course-block { padding: 0; overflow: hidden; margin-bottom: 12px; }
.cb-head { position: relative; display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.cb-stripe { position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; border-radius: 2px; background: var(--c); }
.cb-name { flex: 1; min-width: 0; }
.cb-name h2 { font-size: 16.5px; font-weight: 650; }
.cb-score { display: grid; justify-items: end; text-align: right; }
.cb-score b { font-size: 24px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cb-score small { font-size: 14px; color: var(--muted); font-weight: 600; }
.cb-list { padding: 6px 10px; }
.cb-list .row { grid-template-columns: 1.4fr 1fr; }
.cb-ungraded { display: grid; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.ug { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; }
.ug a { font-weight: 600; }
.ug a:hover { color: var(--accent); }
.rows { padding: 6px; }
.row { display: grid; grid-template-columns: 1.1fr 1.5fr .9fr auto 1.1fr; gap: 16px; align-items: center; padding: 13px 14px;
  border-radius: 10px; transition: background .25s; }
.row:hover { background: var(--surface-2); }
.row + .row { border-top: 1px solid var(--line); }
.row.head { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-block: 10px; }
.row.head:hover { background: none; }
.course-cell { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 14px; }
.task a { font-weight: 650; }
.task a:hover { color: var(--accent); }
.task small { display: block; color: var(--muted); font-size: 12.5px; }
.grade-cell { display: grid; gap: 7px; }
.grade-cell .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.grade-cell b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cb-head { flex-wrap: wrap; }
  .cb-score { justify-items: start; text-align: left; }
  .cb-list .row { grid-template-columns: 1fr; }
  .ug { grid-template-columns: 1fr auto; }
  .ug .num { grid-row: 2; }
}
@media (max-width: 860px) {
  .g-hero { grid-template-columns: 1fr; justify-items: start; gap: 18px; }
  .row { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .row.head { display: none; }
  .row .course-cell { grid-column: 1 / -1; }
  .row .due { grid-column: 1; }
  .row .grade-cell { grid-column: 1 / -1; }
}

/* ---------- course ---------- */
.course-hero, .book-hero { padding: 8px 0 4px; margin: 4px 0 28px; background: none; border: 0; box-shadow: none; overflow: visible; }
.course-hero .display, .book-hero .display { font-size: clamp(36px, 5.2vw, 58px); margin: 14px 0 6px; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.hero-meta .chip b { color: var(--text); }

.week-nav { position: sticky; top: 58px; z-index: 10; display: flex; gap: 4px; overflow-x: auto; padding: 8px 0 14px; margin-bottom: 4px;
  scrollbar-width: none; background: linear-gradient(var(--bg) 70%, transparent); }
.week-nav::-webkit-scrollbar { display: none; }
.week-nav a { flex: none; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); transition: border-color .25s, color .25s, background .25s; }
.week-nav a:hover { border-color: var(--line-strong); color: var(--text); }
.week-nav a.now { background: var(--text); border-color: var(--text); color: var(--bg); }

.weeks { display: grid; gap: 12px; }
.week { padding: 0; overflow: hidden; scroll-margin-top: 120px; }
.week.current { border-color: var(--line-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 14%, transparent); }
.week-head { display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.wk-num { font-family: var(--display); font-size: 20px; font-weight: 650; line-height: 1; letter-spacing: -.03em;
  color: var(--muted); font-variant-numeric: tabular-nums; }
.now-badge { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--bg);
  background: var(--text); }
html.motion .now-badge { animation: pop .7s var(--spring) both calc(.4s + var(--intro-delay)); }
.acts { list-style: none; margin: 0; padding: 6px 10px; }
.act { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 12px 10px; border-radius: 10px; transition: background .25s; }
.act:hover { background: var(--surface-2); }
.act + .act { border-top: 1px solid var(--line); }
.act-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: var(--tc); border: 1px solid var(--line); background: var(--surface); transition: border-color .25s; }
.act-ico .ico { width: 17px; height: 17px; }
.act:hover .act-ico { border-color: var(--line-strong); }
.act-name { font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
a.act-name:hover { color: var(--accent); }
.act-name .ico { width: 13px; height: 13px; color: var(--muted); }
.act-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.kind { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.act .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.file { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .25s; }
.file:hover { border-color: var(--line-strong); }
.file a.fname { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .ext { width: 38px; padding: 6px 0; }
@media (max-width: 640px) {
  .act { grid-template-columns: 32px 1fr; gap: 10px; }
  .act-ico { width: 32px; height: 32px; }
  .file .size { display: none; }
  .week-nav { top: 54px; }
}

/* ---------- Shahzod AI ---------- */
.ask { max-width: 780px; margin: 0 auto; }
.ask-head { text-align: center; margin: 10px 0 20px; }
.ask-head .display { margin: 12px 0 8px; }
.scope { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--font); padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .3s var(--ease); }
.pill:hover { border-color: var(--line-strong); color: var(--text); }
.pill:active { transform: scale(.96); }
.pill.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.pill.all.on { color: var(--bg); }
.pill.on .dot { background: var(--c); box-shadow: 0 0 0 2px var(--text); }

.chat { display: grid; gap: 22px; min-height: 42vh; padding-bottom: 24px; align-content: start; }
.welcome { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 28px 0 8px; }
.orb { position: relative; width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); }
.orb::before, .orb::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--line-strong);
  animation: breathe 3.2s var(--ease) infinite; }
.orb::after { animation-delay: 1.6s; }
.orb .ico { position: relative; width: 24px; height: 24px; color: var(--bg); }
@keyframes breathe { from { transform: scale(1); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 660px; }
.sugg { font: 500 14px var(--font); padding: 9px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); cursor: pointer; animation: rise .7s var(--ease) both;
  transition: border-color .25s, color .25s, transform .3s var(--ease); }
.sugg:hover { border-color: var(--line-strong); color: var(--text); }
.sugg:active { transform: scale(.97); }

.msg { display: flex; align-items: flex-start; gap: 14px; animation: msg-in .6s var(--ease) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--surface-2); color: var(--text); border-radius: 18px 18px 4px 18px; padding: 10px 16px;
  max-width: 78%; font-weight: 500; overflow-wrap: anywhere; border: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; color: var(--bg);
  background: var(--text); margin-top: 2px; }
.avatar .ico { width: 16px; height: 16px; stroke-width: 2; }
.msg.bot .bubble { flex: 1; min-width: 0; background: none; border: 0; border-radius: 0; padding: 4px 0; }
.bot-name { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.answer p { margin: 0 0 12px; line-height: 1.75; color: var(--text-2); animation: fade .6s var(--ease) both; }
.answer p:last-child { margin-bottom: 0; }
.answer strong { color: var(--text); }
.answer .katex { font-size: 1.06em; }
.answer .katex-display { margin: 10px 0; overflow-x: auto; overflow-y: hidden; }
.answer.not-found p { color: var(--muted); }
.cite { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin: 0 2px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; vertical-align: 2px; color: var(--text); background: var(--surface-3); cursor: pointer;
  transition: background .2s, color .2s; }
.cite:hover { background: var(--accent); color: var(--accent-ink); text-decoration: none; }
.typing { display: inline-flex; gap: 5px; padding: 8px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.4s var(--ease-io) infinite; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; transform: none; } 35% { opacity: 1; transform: translateY(-3px); } }
.status { font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.query { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.query .ico { width: 14px; height: 14px; }
.sources { display: grid; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.src { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .3s, box-shadow .3s; }
.src.flash { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.src summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.src summary::-webkit-details-marker { display: none; }
.src-n { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 6px; font-weight: 700; font-size: 11.5px;
  color: var(--text); background: var(--surface-3); }
.src-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-page { font-weight: 600; color: var(--muted); white-space: nowrap; }
.src .chev { width: 15px; height: 15px; transition: transform .4s var(--ease); color: var(--muted); }
.src[open] .chev { transform: rotate(90deg); }
.src-body { padding: 0 12px 12px 44px; }
.snippet { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 10px; }
.src-body .btn { padding: 6px 11px; font-size: 13px; }
.error { display: grid; gap: 10px; justify-items: start; }
.error p { color: var(--bad); font-weight: 600; margin: 0; }
.error .btn { padding: 7px 13px; font-size: 13px; }

.composer { position: sticky; bottom: 18px; display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 18px;
  border-radius: 18px; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: border-color .3s, box-shadow .3s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.composer textarea { flex: 1; resize: none; border: 0; outline: none; background: none; color: var(--text); font: 500 16px/1.5 var(--font);
  padding: 9px 0; max-height: 180px; }
.composer textarea::placeholder { color: var(--muted); }
.send { width: 38px; height: 38px; flex: none; border: 0; border-radius: 11px; display: grid; place-items: center; cursor: pointer;
  color: var(--bg); background: var(--text); transition: transform .3s var(--ease), opacity .25s; }
.send:hover:not(:disabled) .ico { transform: translateX(2px); }
.send:active:not(:disabled) { transform: scale(.92); }
.send:disabled { opacity: .25; cursor: default; }
.send .ico { width: 17px; height: 17px; stroke-width: 2.2; transition: transform .4s var(--ease); }
.keys { text-align: center; font-size: 12px; color: var(--muted); margin-top: 26px; }
@media (max-width: 600px) { .msg.user .bubble { max-width: 90%; } .avatar { display: none; } .src-body { padding-left: 12px; } }

/* ---------- study pack ---------- */
.study-hero { margin: 4px 0 28px; }
.study-hero .display { font-size: clamp(34px, 5vw, 54px); margin: 14px 0 12px; }

.seg-wrap { display: flex; justify-content: center; margin-bottom: 26px; position: sticky; top: 66px; z-index: 10; }
.segs { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 1px var(--line);
  transition: transform .55s var(--ease), width .55s var(--ease); }
.seg { position: relative; z-index: 1; border: 0; background: none; cursor: pointer; padding: 8px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: color .3s; }
.seg:hover, .seg.on { color: var(--text); }
.seg .ico { width: 15px; height: 15px; }
.cnt { font-size: 11px; padding: 0 6px; border-radius: 999px; color: var(--muted); background: var(--surface-3); }
.panel { display: none; }
.panel.on { display: block; animation: rise .7s var(--ease) both; }

.two { display: grid; gap: 16px; grid-template-columns: 1.4fr 1fr; align-items: start; }
.summary { padding: 30px; }
.summary p { font-size: 16.5px; line-height: 1.8; color: var(--text-2); margin: 0 0 14px; max-width: 68ch; }
.concepts { display: grid; gap: 8px; }
.concept { padding: 14px 16px; }
.concept b { display: flex; align-items: center; gap: 9px; font-size: 14.5px; font-weight: 650; }
.concept b::before { content: ""; width: 5px; height: 5px; border-radius: 50%; flex: none; background: var(--text); }
.concept p { color: var(--muted); font-size: 14px; margin-top: 5px; line-height: 1.55; }

.deck { max-width: 620px; margin: 0 auto; outline: none; }
.deck-stage { position: relative; height: 320px; perspective: 1600px; touch-action: pan-y; }
.deck-stage::before, .deck-stage::after { content: ""; position: absolute; inset: 0; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); }
.deck-stage::before { transform: translateY(20px) scale(.92); opacity: .4; }
.deck-stage::after { transform: translateY(10px) scale(.96); opacity: .7; }
.fcard { position: absolute; inset: 0; z-index: 2; display: none; border: 0; padding: 0; margin: 0; background: none;
  color: inherit; font: inherit; text-align: center; cursor: pointer; }
.fcard.active { display: block; animation: card-in .65s var(--ease) both; }
.fcard.from-left.active { animation-name: card-in-left; }
@keyframes card-in { from { opacity: 0; transform: translateX(48px) scale(.97); } }
@keyframes card-in-left { from { opacity: 0; transform: translateX(-48px) scale(.97); } }
.fcard-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.3, .7, .2, 1); }
.fcard.flipped .fcard-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 34px; border-radius: 22px; border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg);
  -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face-front { background: var(--surface); }
.face-back { transform: rotateY(180deg); background: var(--surface-2); }
.fc-text { font-size: 21px; font-weight: 650; line-height: 1.4; max-width: 32ch; letter-spacing: -.015em; }
.face-back .fc-text { font-size: 18px; font-weight: 500; }
.hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.hint .ico { width: 14px; height: 14px; }
.deck-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 32px; }
.deck-count { font-size: 15px; color: var(--muted); min-width: 60px; text-align: center; font-variant-numeric: tabular-nums; }
.deck-count b { color: var(--text); font-size: 18px; font-weight: 650; }
.progress { height: 3px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 18px; }
.progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--text); transition: width .6s var(--ease); }
.deck .keys { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }

.quiz { max-width: 700px; margin: 0 auto; padding: 30px; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; }
.qcard { display: none; margin-top: 22px; }
.qcard.active { display: block; animation: card-in .6s var(--ease) both; }
.q-text { font-size: 20px; font-weight: 650; line-height: 1.4; margin-bottom: 18px; letter-spacing: -.015em; }
.options { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 500;
  transition: border-color .25s, background .25s, transform .3s var(--ease), opacity .3s; }
.opt:hover:not(:disabled) { border-color: var(--text); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt:disabled { cursor: default; }
.key { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; font-weight: 700; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--line); transition: background .25s, color .25s; }
.opt-text { flex: 1; }
.mark { opacity: 0; width: 20px; height: 20px; stroke-width: 2.4; }
.opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.opt.right .key { background: var(--ok); color: #fff; border-color: transparent; }
.opt.right .mark { opacity: 1; color: var(--ok); animation: pop .5s var(--spring) both; }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--surface)); animation: shake .4s var(--ease); }
.opt.wrong .key { background: var(--bad); color: #fff; border-color: transparent; }
.opt.wrong .mark { opacity: 1; color: var(--bad); }
.opt.dim { opacity: .45; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.explain { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease), margin .55s var(--ease); }
.explain > div { overflow: hidden; }
.explain .inner { display: flex; gap: 10px; padding: 13px 15px; border-radius: 12px; color: var(--text-2); font-size: 14.5px;
  background: var(--surface-2); border: 1px solid var(--line); }
.explain .inner .ico { color: var(--text); margin-top: 2px; }
.qcard.answered .explain { grid-template-rows: 1fr; margin-top: 14px; }
.q-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.qresult { display: none; text-align: center; padding: 10px 0; }
.qresult.on { display: grid; justify-items: center; gap: 10px; animation: rise .8s var(--ease) both; }
.score-ring { position: relative; width: 140px; height: 140px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 6; }
.score-ring .bg { stroke: var(--surface-3); }
.score-ring .val { stroke: var(--text); stroke-linecap: round; stroke-dasharray: 339.29; stroke-dashoffset: 339.29;
  transition: stroke-dashoffset 1.6s var(--ease); }
.score-num { position: absolute; inset: 0; display: grid; place-content: center; font-family: var(--display); font-size: 42px;
  font-weight: 650; letter-spacing: -.04em; line-height: 1; }
.score-num small { font-size: 18px; color: var(--muted); }
.result-msg { font-size: 19px; font-weight: 650; }
.confetti { position: fixed; top: 42vh; width: 7px; height: 12px; border-radius: 2px; z-index: 100; pointer-events: none; }

@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .seg { padding: 8px 12px; }
  .deck-stage { height: 360px; }
  .fc-text { font-size: 18px; }
  .quiz, .summary { padding: 20px; }
  main { padding: 24px 16px 64px; overflow-x: clip; }
}
