:root {
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #71717a;
  --bg: #ffffff;
  --bg-subtle: #f7f7f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #b03a5b;
  --accent-hover: #942f4c;
  --accent-soft: #fbeff2;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --text-4: #a1a1aa;
  --track: #ececec;
  --row-hover: #fcfcfb;
  --accent-border: #f0d4dc;
  --accent-faint: #fffafb;
  --success-border: #bbf7d0;
  --danger-border: #fecaca;
  --warn-border: #fde68a;
  --info-border: #bfdbfe;
  --hero-a: #fbf1f4;
  --hero-b: #f3dde4;
  --glass: rgba(255, 255, 255, .7);
  --glass-edge: rgba(255, 255, 255, .9);
  color-scheme: light;
  --radius: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; font-weight: 650; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.container { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.container.narrow { width: min(880px, calc(100% - 48px)); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.link { color: var(--accent); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 80;
  background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-wrap { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 26px; width: auto; display: block; }
.brand-tag { font-size: 13px; color: var(--text-3); padding-left: 10px; border-left: 1px solid var(--border); }
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav-links > a:not(.btn) { color: var(--text-2); text-decoration: none; padding: 4px 0; }
.nav-links > a:not(.btn):hover { color: var(--text); }
.nav-links > a.is-current { color: var(--text); font-weight: 600; }
.nav-logout { margin: 0; }
.menu-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 12px; font-size: 14px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 9px 18px;
  border: 1px solid transparent; border-radius: var(--radius);
  font-size: 15px; font-weight: 500; text-decoration: none; text-align: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-subtle); }
.btn-danger { background: var(--bg); color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn-wide { width: 100%; }

/* Home */
.hero { padding: 72px 0 80px; border-bottom: 1px solid var(--border); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.kicker { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 16px; }
.hero h1 { font-size: clamp(38px, 5vw, 58px); line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 20px; }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.hero h1 .w > span { display: inline-block; animation: word-up .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 45ms + 80ms); }
.hero-in { animation: rise-in .7s cubic-bezier(.2, .7, .2, 1) both; animation-delay: var(--d, 0ms); }
.lead { font-size: 18px; color: var(--text-2); max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist li::before {
  content: ""; flex: none; width: 5px; height: 9px; margin: -3px 2px 0;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }

.hero-visual { position: relative; padding: 0 0 36px 44px; }
.hero-frame {
  position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
  background: linear-gradient(165deg, var(--hero-a) 0%, var(--hero-b) 100%);
  animation: frame-in .9s cubic-bezier(.2, .7, .2, 1) .15s both;
}
.hero-frame img {
  position: absolute; right: 0; bottom: 0; width: 100%; height: 100%; display: block;
  animation: photo-in 1s cubic-bezier(.2, .7, .2, 1) .35s both;
}
.hero-card {
  position: absolute; left: 0; bottom: 0; width: 280px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 6px;
  box-shadow: 0 16px 40px rgba(24, 24, 27, .10), 0 2px 6px rgba(24, 24, 27, .04);
  animation: card-in .8s cubic-bezier(.2, .7, .2, 1) .85s both;
}
.hc-head { display: flex; justify-content: space-between; align-items: baseline; }
.hc-head span { font-size: 13px; color: var(--text-3); }
.hc-head strong { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hc-bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; margin: 8px 0 10px; }
.hc-bar span { display: block; width: 45%; height: 100%; background: var(--accent); transform-origin: left; animation: grow-x 1.3s cubic-bezier(.2, .7, .2, 1) 1.1s both; }
.hc-list { list-style: none; margin: 0; padding: 0; }
.hc-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 14px; border-top: 1px solid var(--border); }
.hc-list small { margin-left: auto; font-size: 12px; color: var(--text-3); }
.hc-list .is-done { color: var(--text-3); }
.hc-list .is-next small { color: var(--accent); }
.hc-list i { width: 16px; height: 16px; flex: none; border-radius: 4px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; }
.hc-list .is-done i { background: var(--accent); border-color: var(--accent); animation: check-pop .4s ease 1.7s both; }
.hc-list .is-done i::after { content: ""; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

@keyframes word-up { from { transform: translateY(110%); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes frame-in { from { opacity: 0; transform: scale(.97); } }
@keyframes photo-in { from { opacity: 0; transform: translateY(28px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(24px); } }

.section { padding: 72px 0; }
.section-muted { background: var(--bg-subtle); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 36px; max-width: 620px; }
.section-head h2 { font-size: 30px; margin-bottom: 8px; }
.section-head p { color: var(--text-2); margin: 0; }
.cta { display: flex; justify-content: space-between; align-items: center; gap: 24px; border: 1px solid var(--border); border-radius: 12px; padding: 32px 36px; }
.cta h2 { font-size: 24px; margin-bottom: 4px; }
.cta p { margin: 0; color: var(--text-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 28px; background: var(--bg-subtle); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 40px; padding-bottom: 36px; }
.footer-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 14px; }
.footer-logo img { height: 28px; width: auto; display: block; }
.footer-brand p { color: var(--text-2); margin: 0 0 16px; max-width: 360px; line-height: 1.65; }
.footer-org {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text-2); text-decoration: none; font-size: 13px; transition: border-color .2s ease, color .2s ease;
}
.footer-org:hover { border-color: var(--accent); color: var(--accent); }
.footer-col h2 { font-size: 13px; font-weight: 600; color: var(--text); margin: 6px 0 14px; letter-spacing: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; transition: color .15s ease, transform .2s ease; }
.footer-col a:hover { color: var(--accent); transform: translateX(2px); }
.footer-col a .icon { opacity: .55; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.footer-copy { margin: 0; color: var(--text); font-weight: 500; }
.footer-note { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.footer-top { display: inline-flex; align-items: center; gap: 8px; flex: none; color: var(--text-2); text-decoration: none; font-size: 13px; transition: color .15s ease; }
.footer-top:hover { color: var(--accent); }
.footer-top-arrow { width: 7px; height: 7px; margin-top: 3px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(-45deg); transition: transform .2s ease; }
.footer-top:hover .footer-top-arrow { transform: translateY(-2px) rotate(-45deg); }

/* Forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.field input {
  width: 100%; height: 42px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg);
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-4); }
.hint { font-size: 13px; color: var(--text-3); margin: 6px 0 0; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.show-password {
  position: absolute; right: 6px; top: 6px; height: 30px; padding: 0 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px;
}
.show-password:hover { background: var(--bg-subtle); }
.auth-switch { text-align: center; color: var(--text-2); font-size: 14px; margin: 20px 0 0; }
.auth-switch a { color: var(--accent); font-weight: 500; }
.alert { padding: 10px 14px; margin-bottom: 18px; border-radius: var(--radius); font-size: 14px; border: 1px solid; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }

/* Dashboard */
.page { padding: 40px 0 72px; background: var(--bg-subtle); min-height: calc(100vh - 170px); }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 28px; margin-bottom: 4px; }
.page-head p { color: var(--text-2); margin: 0; }

.dash-main, .dash-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 17px; margin: 0; }
.panel-head .muted { font-size: 14px; }
.next-actions { display: flex; gap: 10px; flex-shrink: 0; }
.next-actions form { margin: 0; }

.chapter-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); }
.chapter { display: flex; align-items: center; gap: 12px; padding: 10px 14px; scroll-margin-top: 90px; }
.chapter + .chapter { border-top: 1px solid var(--border); }
.chapter form { margin: 0; display: flex; }
.check {
  width: 20px; height: 20px; padding: 0; flex: none;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--bg);
  display: grid; place-items: center;
}
.check:hover { border-color: var(--accent); }
.check[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.check[aria-pressed="true"]::after {
  content: ""; width: 5px; height: 10px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.chapter-num { width: 20px; font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chapter-title { flex: 1; font-size: 15px; text-decoration: none; min-width: 0; }
.chapter-title:hover { color: var(--accent); text-decoration: underline; }
.chapter.is-done .chapter-title { color: var(--text-3); }
.chapter-meta { font-size: 13px; color: var(--text-3); white-space: nowrap; }

.tag { white-space: nowrap; font-size: 12px; color: var(--success); background: var(--success-soft); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.dash-side .small { margin: 0; }

/* Settings */
.settings-block { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 28px; margin-bottom: 20px; }
.settings-intro h2 { font-size: 17px; margin-bottom: 6px; }
.settings-intro p { font-size: 14px; margin: 0; }
.settings-block form { max-width: 420px; }
.settings-block.danger { border-color: var(--danger-border); }
.settings-block.danger h2 { color: var(--danger); }

/* How it works walkthrough */
.walkthrough { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: stretch; }
.wt-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wt-step {
  position: relative; display: block; width: 100%; text-align: left;
  background: none; border: 0; border-left: 2px solid var(--border);
  padding: 14px 0 14px 22px; border-radius: 0;
  transition: background-color .2s ease;
}
.wt-step:hover { background: var(--bg-subtle); }
.wt-num { display: block; font-size: 13px; color: var(--text-3); }
.wt-title { display: block; font-size: 18px; font-weight: 650; color: var(--text-3); transition: color .2s ease; }
.wt-step:hover .wt-title, .wt-step.is-active .wt-title { color: var(--text); }
.wt-desc {
  display: block; max-height: 0; opacity: 0; overflow: hidden;
  font-size: 15px; color: var(--text-2);
  transition: max-height .35s ease, opacity .25s ease, margin .35s ease;
}
.wt-step.is-active .wt-desc { max-height: 120px; opacity: 1; margin-top: 6px; }
.wt-timer {
  position: absolute; left: -2px; top: 0; width: 2px; height: 100%;
  background: var(--accent); transform: scaleY(0); transform-origin: top;
  transition: transform .05s linear;
}
.wt-step.is-active .wt-timer { transform: scaleY(var(--progress, 1)); }

.wt-stage {
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; min-height: 420px; display: flex; flex-direction: column; justify-content: center;
}
.wt-panel[hidden] { display: none; }
.wt-panel.is-active { animation: fade-up .45s ease both; }
.wt-points { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin: 22px 0 0; padding: 0; font-size: 14px; color: var(--text-2); }
.wt-points li { display: flex; align-items: center; gap: 8px; }
.wt-points li::before {
  content: ""; width: 5px; height: 9px; margin-top: -3px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.wt-panel.is-active .wt-points li { animation: fade-up .4s ease both; }
.wt-panel.is-active .wt-points li:nth-child(1) { animation-delay: .5s; }
.wt-panel.is-active .wt-points li:nth-child(2) { animation-delay: .6s; }
.wt-panel.is-active .wt-points li:nth-child(3) { animation-delay: .7s; }

/* Mock UI previews */
.mock { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 440px; margin: 0 auto; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.mock-title { font-size: 17px; font-weight: 650; margin-bottom: 12px; }
.mock-form { padding: 22px 24px; max-width: 360px; }
.mock-label { font-size: 12px; font-weight: 500; margin: 10px 0 4px; }
.mock-input { height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 10px; display: flex; align-items: center; font-size: 14px; }
.type { white-space: nowrap; overflow: hidden; }
.wt-panel.is-active .type { animation: type-in .9s steps(18, end) both; }
.wt-panel.is-active .type-1 { animation-delay: .3s; }
.wt-panel.is-active .type-2 { animation-delay: 1.3s; }
.wt-panel.is-active .type-3 { animation-delay: 2.3s; animation-duration: .6s; }
.mock-button { margin-top: 16px; height: 36px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; display: grid; place-items: center; }
.wt-panel.is-active .mock-button { animation: press .3s ease 3.1s both; }
.mock-success { margin-top: 12px; font-size: 13px; color: var(--success); background: var(--success-soft); border: 1px solid var(--success-border); border-radius: 6px; padding: 7px 10px; }
.wt-panel.is-active .mock-success { animation: fade-up .4s ease 3.4s both; }

.mock-url { font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--border); padding: 9px 14px; background: var(--bg-subtle); border-radius: var(--radius) var(--radius) 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-body { padding: 18px 20px; }
.mock-crumb { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.mock-code {
  margin: 0; padding: 14px 16px; background: #18181b; color: #e4e4e7; border-radius: 6px;
  font: 12.5px/1.7 Consolas, 'Courier New', monospace; overflow: hidden;
}
.mock-code span { display: block; white-space: pre; }
.mock-code b { color: #f9a8c0; font-weight: 400; }
.wt-panel.is-active .mock-code span { animation: slide-in .35s ease both; }
.wt-panel.is-active .mock-code span:nth-child(1) { animation-delay: .3s; }
.wt-panel.is-active .mock-code span:nth-child(2) { animation-delay: .45s; }
.wt-panel.is-active .mock-code span:nth-child(3) { animation-delay: .8s; }
.wt-panel.is-active .mock-code span:nth-child(4) { animation-delay: 1.2s; }
.wt-panel.is-active .mock-code span:nth-child(5) { animation-delay: 1.6s; }
.wt-panel.is-active .mock-code span:nth-child(6) { animation-delay: 2s; }

.mock-dash { padding: 20px 22px; }
.mock-dash-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); }
.mock-dash-head strong { color: var(--text); font-weight: 600; }
.mock-bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; margin: 8px 0 14px; }
.mock-bar span { display: block; height: 100%; width: 20%; background: var(--accent); transform-origin: left; }
.wt-panel.is-active .mock-bar span { animation: grow-x 1.6s cubic-bezier(.2, .7, .2, 1) .3s both; }
.mock-checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 6px; }
.mock-checks li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; }
.mock-checks li + li { border-top: 1px solid var(--border); }
.mock-checks i {
  width: 16px; height: 16px; flex: none; border-radius: 4px;
  background: var(--accent); border: 1.5px solid var(--accent); display: grid; place-items: center;
}
.mock-checks i::after { content: ""; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.mock-checks li.is-next i { background: var(--bg); border-color: var(--border-strong); }
.mock-checks li.is-next i::after { display: none; }
.mock-checks em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--accent); }
.mock-checks li:not(.is-next) { color: var(--text-3); }
.wt-panel.is-active .mock-checks li:not(.is-next) i { animation: check-pop .35s ease both; }
.wt-panel.is-active .mock-checks li:nth-child(1) i { animation-delay: .4s; }
.wt-panel.is-active .mock-checks li:nth-child(2) i { animation-delay: .7s; }
.wt-panel.is-active .mock-checks li:nth-child(3) i { animation-delay: 1s; }
.wt-panel.is-active .mock-checks li:nth-child(4) i { animation-delay: 1.3s; }
.wt-panel.is-active .mock-checks em { animation: fade-up .4s ease 1.7s both; }

.mock-terminal { background: #18181b; border-color: #18181b; color: #d4d4d8; padding: 16px 18px; font: 12.5px/1.75 Consolas, 'Courier New', monospace; }
.term-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-prompt { color: #f9a8c0; }
.term-dim { color: #a1a1aa; }
.term-ok { color: #86efac; }
.wt-panel.is-active .term-line { animation: slide-in .3s ease both; }
.wt-panel.is-active .term-line:nth-child(1) { animation-delay: .2s; }
.wt-panel.is-active .term-line:nth-child(2) { animation-delay: .7s; }
.wt-panel.is-active .term-line:nth-child(3) { animation-delay: 1.3s; }
.wt-panel.is-active .term-line:nth-child(4) { animation-delay: 1.7s; }
.wt-panel.is-active .term-line:nth-child(5) { animation-delay: 2.2s; }
.mock-site { margin-top: 14px; max-width: 360px; }
.wt-panel.is-active .mock-site { animation: fade-up .5s ease 2.7s both; }
.mock-site-title { font-size: 18px; font-weight: 700; padding-bottom: 10px; border-bottom: 2px solid var(--accent); margin-bottom: 10px; }
.mock-post small { display: block; color: var(--text-3); font-size: 12px; }
.mock-post strong { font-size: 15px; }

/* Motion */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--reveal-delay, 0ms); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.site-header { transition: box-shadow .2s ease; }
.site-header.scrolled { box-shadow: 0 1px 8px rgba(0, 0, 0, .06); }
/* Reading progress: a line under the navbar that fills left to right as the page scrolls. */
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; transform: scaleX(var(--scroll, 0)); transform-origin: left;
  background: linear-gradient(90deg, #d97a96 0%, var(--accent) 60%, #8f2b49 100%);
  border-radius: 0 2px 2px 0; box-shadow: 0 0 8px rgba(176, 58, 91, .35);
  transition: transform .12s linear;
}
.btn { transition: background-color .15s ease, border-color .15s ease, transform .1s ease; }
.btn:active { transform: scale(.98); }
.chapter:target { animation: highlight 2s ease both; }
.chapter:target .check { animation: check-pop .35s ease both; }
.check { transition: border-color .15s ease, background-color .15s ease; }

@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6px); } }
@keyframes type-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes press { 50% { transform: scale(.96); background: var(--accent-hover); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes check-pop { 0% { transform: scale(0); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } }
@keyframes highlight { from { background: var(--accent-soft); } to { background: transparent; } }

/* What you will learn: scroll-driven timeline */
.learn-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 72px; align-items: start; }
.learn-sticky { position: sticky; top: 104px; }
.learn-side h2 { font-size: 32px; margin-bottom: 10px; }
.learn-intro { color: var(--text-2); margin-bottom: 28px; }
.stage-nav { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.stage-link {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 10px;
  padding: 14px 16px; border: 1px solid transparent; border-radius: 10px;
  text-decoration: none; color: var(--text-3);
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.stage-link:hover { color: var(--text); }
.stage-link.is-active { background: var(--bg); border-color: var(--border); color: var(--text); box-shadow: 0 4px 14px rgba(24, 24, 27, .05); }
.stage-index { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 2px; transition: color .3s ease; }
.stage-link.is-active .stage-index { color: var(--accent); }
.stage-text strong { display: block; font-size: 15px; font-weight: 600; }
.stage-text small { display: block; font-size: 13px; color: var(--text-3); }
.stage-meter { grid-column: 2; height: 3px; background: var(--track); border-radius: 2px; overflow: hidden; }
.stage-meter span { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform .4s cubic-bezier(.2, .7, .2, 1); }

.timeline { position: relative; }
.timeline-rail { position: absolute; left: 11px; top: 12px; bottom: 30px; width: 2px; background: var(--border); border-radius: 1px; }
.timeline-fill { position: absolute; inset: 0; background: var(--accent); border-radius: 1px; transform: scaleY(0); transform-origin: top; transition: transform .2s ease-out; }
.tl-stage { scroll-margin-top: 96px; }
.tl-stage + .tl-stage { margin-top: 36px; }
.tl-stage-head { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.tl-stage-dot {
  position: relative; z-index: 1; width: 24px; height: 24px; flex: none; border-radius: 50%;
  background: var(--bg-subtle); border: 2px solid var(--border-strong);
  transition: background-color .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.tl-stage.is-reached .tl-stage-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-stage-label { display: block; font-size: 13px; color: var(--text-3); }
.tl-stage-head h3 { font-size: 20px; margin: 0; }
.tl-list { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; padding-left: 42px; }
.tl-item + .tl-item { margin-top: 10px; }
.tl-node {
  position: absolute; left: 6px; top: 50%; z-index: 1; width: 12px; height: 12px; margin-top: -6px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--border-strong);
  transition: background-color .3s ease, border-color .3s ease, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}
.tl-item.is-passed .tl-node { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.tl-card {
  position: relative; display: block; padding: 16px 52px 16px 20px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; text-decoration: none;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s cubic-bezier(.2, .7, .2, 1);
}
.tl-card:hover { border-color: var(--border-strong); box-shadow: 0 8px 22px rgba(24, 24, 27, .06); transform: translateX(4px); }
.tl-num { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.tl-title { display: block; font-size: 16px; font-weight: 600; transition: color .2s ease; }
.tl-card:hover .tl-title { color: var(--accent); }
.tl-summary { display: block; font-size: 14px; color: var(--text-2); margin-top: 2px; }
.tl-open {
  position: absolute; right: 22px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border: solid var(--text-3); border-width: 2px 2px 0 0; transform: rotate(45deg);
  opacity: .5; transition: transform .25s ease, opacity .25s ease, border-color .25s ease;
}
.tl-card:hover .tl-open { opacity: 1; border-color: var(--accent); transform: translateX(3px) rotate(45deg); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 72px; align-items: start; }
.faq-intro h2 { font-size: 32px; margin-bottom: 10px; }
.faq-intro p { color: var(--text-2); margin: 0; }
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-size: 17px; font-weight: 600; transition: color .2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }
.faq-icon { position: relative; width: 14px; height: 14px; flex: none; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 1px;
  background: var(--text-2); transition: transform .3s cubic-bezier(.2, .7, .2, 1), background-color .2s ease;
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-icon::after { transform: rotate(0deg); }
.faq-item[open] .faq-icon::before, .faq-item[open] .faq-icon::after { background: var(--accent); }
.faq-answer p { margin: 0 0 22px; color: var(--text-2); max-width: 640px; }
.faq-item[open] .faq-answer p { animation: rise-in .4s ease .05s both; }

/* Auth pages: form on the left, product preview on the right */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - 65px); }
.auth-pane { display: flex; justify-content: center; align-items: center; padding: 56px 24px 64px; }
.auth-form-wrap { width: 100%; max-width: 420px; }
.auth-form-wrap h1 { font-size: 30px; letter-spacing: -0.025em; margin-bottom: 6px; }
.auth-sub { color: var(--text-2); margin-bottom: 28px; }
.auth-aside {
  display: flex; align-items: center; justify-content: center; padding: 56px 48px; overflow: hidden;
  background: linear-gradient(165deg, var(--hero-a) 0%, var(--hero-b) 100%); border-left: 1px solid var(--border);
}
.auth-aside-inner { width: 100%; max-width: 460px; }
.auth-aside h2 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 16px; }
.auth-points { display: flex; flex-direction: column; gap: 8px; margin: 0 0 36px; font-size: 15px; color: var(--text-2); }
.auth-visual .hero-frame { background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); }

.field label { transition: color .2s ease; }
.field:focus-within > label { color: var(--accent); }
.field input { transition: border-color .2s ease, box-shadow .2s ease; }
.field input[aria-invalid="true"] { border-color: #f87171; }
.field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.field.is-valid input:not(:focus) { border-color: #86c9a0; }
.field-error { margin: 6px 0 0; font-size: 13px; color: var(--danger); animation: rise-in .25s ease both; }
.field-error[hidden] { display: none; }

/* Profile photo picker */
.avatar-field {
  display: flex; align-items: center; gap: 18px; padding: 16px; margin-bottom: 20px;
  border: 1px dashed var(--border-strong); border-radius: 12px;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.avatar-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.avatar-field.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.avatar-field.has-photo { border-style: solid; }
.avatar-field + .field-error { margin: -12px 0 18px; }
.avatar-drop { position: relative; flex: none; cursor: pointer; border-radius: 50%; }
.avatar-preview {
  position: relative; width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--bg-subtle); border: 1px solid var(--border);
  transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.avatar-drop:hover .avatar-preview, .avatar-field.is-dragging .avatar-preview { transform: scale(1.05); }
.avatar-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: avatar-in .4s cubic-bezier(.2, .7, .2, 1) both; }
.avatar-initials-live { font-size: 24px; font-weight: 650; color: var(--accent); animation: avatar-in .3s ease both; }
.avatar-initials-live:empty { display: none; }
.avatar-initials-live:not(:empty) + .avatar-placeholder { display: none; }
.avatar-placeholder { position: relative; width: 30px; height: 30px; }
.avatar-placeholder::before, .avatar-placeholder::after { content: ""; position: absolute; background: var(--text-4); }
.avatar-placeholder::before { left: 9px; top: 1px; width: 12px; height: 12px; border-radius: 50%; }
.avatar-placeholder::after { left: 2px; top: 16px; width: 26px; height: 14px; border-radius: 13px 13px 3px 3px; }
.avatar-badge {
  position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); transition: transform .25s ease;
}
.avatar-badge::before, .avatar-badge::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: #fff; border-radius: 1px; }
.avatar-badge::after { transform: rotate(90deg); }
.avatar-drop:hover .avatar-badge { transform: rotate(90deg); }
.avatar-title { font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.optional { margin-left: 6px; padding: 1px 6px; font-size: 12px; font-weight: 400; color: var(--text-3); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 4px; white-space: nowrap; }
.avatar-copy { min-width: 0; }
.avatar-copy .hint { margin: 0; overflow-wrap: anywhere; }
.avatar-copy .link { cursor: pointer; }
.text-btn { margin-top: 4px; padding: 0; background: none; border: 0; font-size: 13px; color: var(--danger); }
.text-btn:hover { text-decoration: underline; }
.text-btn[hidden] { display: none; }

/* Password strength */
.strength { margin-top: 8px; }
.strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bars span { position: relative; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.strength-bars span::after {
  content: ""; position: absolute; inset: 0; background: var(--strength-color, var(--accent));
  transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.2, .7, .2, 1), background-color .3s ease;
}
.strength-bars span:nth-child(2)::after { transition-delay: .04s; }
.strength-bars span:nth-child(3)::after { transition-delay: .08s; }
.strength-bars span:nth-child(4)::after { transition-delay: .12s; }
.strength[data-strength="1"] { --strength-color: #dc2626; }
.strength[data-strength="2"] { --strength-color: #d97706; }
.strength[data-strength="3"] { --strength-color: #65a30d; }
.strength[data-strength="4"] { --strength-color: #15803d; }
.strength[data-strength="1"] span:nth-child(-n+1)::after,
.strength[data-strength="2"] span:nth-child(-n+2)::after,
.strength[data-strength="3"] span:nth-child(-n+3)::after,
.strength[data-strength="4"] span::after { transform: scaleX(1); }
.strength .hint { margin-top: 6px; transition: color .2s ease; }
.strength:not([data-strength="0"]) .hint { color: var(--strength-color); }
.match-status { margin: 6px 0 0; }
.match-status:empty { display: none; }
.match-status.is-ok { color: var(--success); }
.field:has(.field-error) .match-status { display: none; }

/* Submit button with loading state */
.btn-submit { min-height: 46px; margin-top: 6px; }
.spinner { display: none; width: 16px; height: 16px; margin-right: 10px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-submit.is-loading { pointer-events: none; opacity: .9; }
.btn-submit.is-loading .spinner { display: inline-block; }
.fine-print { margin: 14px 0 0; font-size: 13px; color: var(--text-3); text-align: center; }

/* Avatars elsewhere */
.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent); font-size: 15px; font-weight: 650; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 19px; }
.nav-avatar { display: flex; border-radius: 50%; transition: box-shadow .2s ease; }
.nav-avatar:hover { box-shadow: 0 0 0 3px var(--accent-soft); }

@keyframes avatar-in { from { opacity: 0; transform: scale(.85); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Returning users: account chooser, selected account, keep-me-signed-in */
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.account-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.account-row { position: relative; }
.account-pick {
  display: flex; align-items: center; gap: 14px; padding: 14px 52px 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; text-decoration: none;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s cubic-bezier(.2, .7, .2, 1);
}
.account-pick:hover { border-color: var(--border-strong); box-shadow: 0 8px 22px rgba(24, 24, 27, .07); transform: translateY(-2px); }
.account-pick:active { transform: translateY(0); }
.account-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-info strong { font-size: 15px; font-weight: 600; }
.account-info span { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.account-chevron {
  width: 8px; height: 8px; flex: none; border: solid var(--text-3); border-width: 2px 2px 0 0; transform: rotate(45deg);
  opacity: .6; transition: transform .25s ease, opacity .25s ease, border-color .25s ease;
}
.account-pick:hover .account-chevron { opacity: 1; border-color: var(--accent); transform: translateX(3px) rotate(45deg); }
.account-forget { position: absolute; right: 10px; top: 50%; margin: -15px 0 0; }
.icon-btn {
  position: relative; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent;
  opacity: 0; transition: opacity .2s ease, background-color .2s ease;
}
.account-row:hover .icon-btn, .icon-btn:focus-visible { opacity: 1; }
.icon-btn:hover { background: var(--danger-soft); }
.icon-btn::before, .icon-btn::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -.75px 0 0 -6px;
  background: var(--text-2); border-radius: 1px; transform: rotate(45deg);
}
.icon-btn::after { transform: rotate(-45deg); }
.icon-btn:hover::before, .icon-btn:hover::after { background: var(--danger); }
.account-row:hover .account-meta { visibility: hidden; }
@media (hover: none) { .icon-btn { opacity: 1; } .account-meta { display: none; } }

.account-other {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: 12px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.account-other:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.account-other-icon { position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--bg-subtle); border: 1px solid var(--border); transition: transform .3s ease; }
.account-other:hover .account-other-icon { transform: rotate(90deg); }
.account-other-icon::before, .account-other-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; margin: -1px 0 0 -7px; background: currentColor; border-radius: 1px; }
.account-other-icon::after { transform: rotate(90deg); }

.account-chip {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; margin-bottom: 22px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-subtle);
}
.account-chip .link { font-size: 14px; }

.check-row { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 18px; cursor: pointer; }
.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  position: relative; width: 20px; height: 20px; flex: none; margin-top: 1px;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--bg);
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.check-box::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}
.check-row input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check-row input:checked + .check-box::after { transform: rotate(45deg) scale(1); }
.check-row input:focus-visible + .check-box { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.check-row:hover .check-box { border-color: var(--accent); }
.check-label { display: block; font-size: 14px; font-weight: 500; }
.check-hint { display: block; font-size: 13px; color: var(--text-3); }

/* ===== Account menu in the header ===== */
.icon { display: block; flex: none; }
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.user-trigger:hover, .user-trigger[aria-expanded="true"] { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(24, 24, 27, .06); }
.user-trigger-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.user-trigger-name { font-size: 14px; font-weight: 600; }
.user-trigger-email { font-size: 12px; color: var(--text-3); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { width: 7px; height: 7px; margin: -3px 2px 0 2px; border: solid var(--text-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .25s ease; }
.user-trigger[aria-expanded="true"] .caret { transform: translateY(3px) rotate(225deg); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 280px; padding: 6px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(24, 24, 27, .14), 0 2px 8px rgba(24, 24, 27, .05);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .22s;
}
.user-menu.is-open .user-dropdown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.ud-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.ud-id { display: flex; flex-direction: column; min-width: 0; }
.ud-id strong { font-size: 15px; }
.ud-id span { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ud-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--text-2); font-size: 14px; text-align: left; text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.ud-item:hover, .ud-item:focus-visible { background: var(--bg-subtle); color: var(--text); outline: none; }
.ud-item .icon { color: var(--text-3); }
.ud-signout { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--border); }
.ud-signout .ud-item:hover { background: var(--danger-soft); color: var(--danger); }
.ud-signout .ud-item:hover .icon { color: var(--danger); }

/* ===== Dashboard ===== */
.dash { padding: 32px 0 80px; background: var(--bg-subtle); min-height: calc(100vh - 170px); }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head h2 { font-size: 17px; margin: 0; }
.card-head p { margin: 2px 0 0; font-size: 14px; }
.card-kicker { font-size: 13px; color: var(--accent); font-weight: 500; margin: 0 0 4px; }
.btn .icon { margin-left: 8px; }
.btn .icon:first-child { margin: 0 8px 0 0; }

/* Profile header */
.dash-hero {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 28px 32px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  background: linear-gradient(120deg, var(--bg) 0%, var(--bg) 45%, var(--hero-a) 100%);
}
.dash-hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(176, 58, 91, .10), transparent 65%); pointer-events: none;
}
.dh-greet { margin: 0 0 2px; font-size: 14px; font-weight: 500; color: var(--accent); }
.dash-hero h1 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.025em; margin: 0 0 8px; }
.dh-sub { color: var(--text-2); margin: 0 0 14px; max-width: 560px; }
.dh-sub strong { color: var(--text); font-weight: 600; }
.dh-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.dh-meta li {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 13px; color: var(--text-2);
  background: var(--glass); border: 1px solid var(--border); border-radius: 999px;
}
.dh-meta .icon { color: var(--text-3); }
.dh-actions { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }

/* Avatar editor (dashboard ring + settings row) */
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }
.photo-editor { margin: 0; }
.pe-target { position: relative; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.pe-ring .pe-target { width: 124px; height: 124px; }
.pe-ring .avatar-xl { position: absolute; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-track { stroke: var(--track); }
.ring-value {
  stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 339.3;
  stroke-dashoffset: calc(339.3 * (1 - var(--p, 0)));
  transition: stroke-dashoffset 1s cubic-bezier(.2, .7, .2, 1);
  animation: ring-in 1.4s cubic-bezier(.2, .7, .2, 1) .3s both;
}
@keyframes ring-in { from { stroke-dashoffset: 339.3; } }
.pe-overlay, .pe-uploading {
  position: absolute; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 2px;
  color: #fff; font-size: 12px; font-weight: 500; background: rgba(24, 24, 27, .55);
  opacity: 0; transition: opacity .2s ease;
}
.pe-target:hover .pe-overlay, .photo-editor:focus-within .pe-overlay { opacity: 1; }
.photo-editor.is-uploading .pe-overlay { opacity: 0; }
.photo-editor.is-uploading .pe-uploading { opacity: 1; }
.pe-uploading .spinner { display: inline-block; margin: 0; }
.photo-editor .avatar { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.pe-target:hover .avatar { transform: scale(1.03); }
.avatar.is-fresh { animation: avatar-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.pe-row { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.pe-row .pe-target { width: 96px; height: 96px; }
.pe-buttons { display: flex; align-items: center; gap: 14px; }
.pe-actions .hint { margin: 8px 0 0; }
.pe-actions .hint.is-error { color: var(--danger); }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-tile { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.stat-tile:hover { border-color: var(--border-strong); box-shadow: 0 10px 26px rgba(24, 24, 27, .06); transform: translateY(-2px); }
.st-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.st-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.st-value { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 8px; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.st-value small { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.st-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.st-bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transform-origin: left; animation: grow-x 1.1s cubic-bezier(.2, .7, .2, 1) .4s both; }
.st-bar.is-complete span { background: var(--success); }
.st-meta { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }
.st-dots { display: flex; gap: 5px; height: 6px; }
.st-dots span { flex: 1; border-radius: 3px; background: var(--track); }
.st-dots span.on { background: var(--accent); animation: grow-x .5s ease .5s both; transform-origin: left; }

.goal-edit { margin-left: auto; position: relative; }
.goal-edit summary { list-style: none; cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 500; }
.goal-edit summary::-webkit-details-marker { display: none; }
.goal-edit summary:hover { text-decoration: underline; }
.goal-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 200px; padding: 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 14px 36px rgba(24, 24, 27, .12);
  animation: rise-in .2s ease both;
}
.goal-pop label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.goal-row { display: flex; gap: 8px; }
.goal-row select { flex: 1; height: 36px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); font: inherit; }

/* Columns */
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Continue learning */
.next-card { display: flex; align-items: center; gap: 22px; }
.next-num {
  flex: none; display: grid; place-items: center; align-content: center; width: 76px; height: 76px; border-radius: 16px;
  background: linear-gradient(150deg, var(--accent) 0%, #8f2b49 100%); color: #fff;
}
.next-num span { font-size: 11px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.next-num strong { font-size: 28px; line-height: 1; }
.next-num.is-done { background: linear-gradient(150deg, var(--success) 0%, #0f5f2e 100%); }
.next-body { flex: 1; min-width: 0; }
.next-body h2 { font-size: 20px; margin: 0 0 4px; }
.next-body p.muted { margin: 0; font-size: 14px; }
.next-actions { display: flex; gap: 10px; flex-shrink: 0; }
.next-actions form { margin: 0; }

/* Activity heatmap (sequential: one hue, light to dark) */
.activity { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.heatmap-wrap { --cell: 18px; --gap: 4px; }
.heat-months { display: grid; grid-template-columns: repeat(12, var(--cell)); gap: var(--gap); margin: 0 0 6px 34px; font-size: 11px; color: var(--text-3); height: 14px; }
.heat-months span { white-space: nowrap; }
.heat-body { display: flex; gap: 8px; }
.heat-days { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: var(--gap); width: 26px; font-size: 11px; color: var(--text-3); line-height: var(--cell); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); grid-auto-columns: var(--cell); gap: var(--gap); }
.hc { display: block; width: var(--cell); height: var(--cell); border-radius: 4px; background: var(--track); }
.heatmap .hc { animation: cell-in .4s ease both; animation-delay: calc(var(--i) * 35ms + 200ms); transition: transform .15s ease, box-shadow .15s ease; }
.heatmap .hc[data-tip]:hover { transform: scale(1.25); box-shadow: 0 0 0 2px var(--bg), 0 2px 8px rgba(0, 0, 0, .15); position: relative; z-index: 1; }
.hc.l1 { background: #f2cdd8; }
.hc.l2 { background: #e29db2; }
.hc.l3 { background: #c8607f; }
.hc.l4 { background: #9b2d4e; }
.hc.future { background: transparent; box-shadow: inset 0 0 0 1px var(--track); }
.hc.today { box-shadow: 0 0 0 1.5px var(--text-2); }
.heat-legend { display: flex; align-items: center; gap: 4px; margin: 12px 0 0 34px; font-size: 11px; color: var(--text-3); }
.heat-legend .hc { width: 12px; height: 12px; border-radius: 3px; }
.activity-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 28px; margin: 22px 0 0; align-self: center; }
.activity-stats div { display: flex; flex-direction: column-reverse; }
.activity-stats dt { font-size: 13px; color: var(--text-3); }
.activity-stats dd { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@keyframes cell-in { from { opacity: 0; transform: scale(.4); } }
.viz-tip {
  position: fixed; z-index: 90; padding: 6px 10px; border-radius: 6px; pointer-events: none;
  background: #18181b; color: #fff; font-size: 12px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18); transform: translate(-50%, calc(-100% - 10px));
}

/* Chapters */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; flex: none; }
.segmented button {
  padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.segmented button span { margin-left: 4px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.segmented button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(24, 24, 27, .1); }
.stage-group + .stage-group { margin-top: 10px; }
.stage-toggle {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 14px; text-align: left;
  background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px; transition: border-color .2s ease, border-radius .2s ease;
}
.stage-toggle:hover { border-color: var(--border-strong); }
.stage-group:not(.is-collapsed) .stage-toggle { border-radius: 10px 10px 0 0; }
.stage-name { flex: 1; display: flex; flex-direction: column; font-weight: 600; font-size: 15px; }
.stage-name .muted { font-size: 12px; font-weight: 400; }
.stage-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mini-bar { display: block; width: 80px; height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.stage-caret { width: 8px; height: 8px; border: solid var(--text-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); margin-top: -4px; transition: transform .3s ease; }
.stage-group.is-collapsed .stage-caret { transform: rotate(-45deg); margin-top: 0; }
.stage-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .35s cubic-bezier(.2, .7, .2, 1); }
.stage-group.is-collapsed .stage-body { grid-template-rows: 0fr; }
.stage-inner { overflow: hidden; min-height: 0; }
.stage-body .chapter-list { border-top: 0; border-radius: 0 0 10px 10px; }
.chapter { padding: 12px 14px; transition: background-color .2s ease; }
.chapter:hover { background: var(--row-hover); }
.chapter.is-next { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.chapter-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chapter-title { flex: none; font-weight: 500; }
.chapter-summary { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter.is-done .chapter-title { color: var(--text-3); text-decoration: line-through; text-decoration-color: rgba(113, 113, 122, .5); }
.chapter.is-next .chapter-meta { color: var(--accent); font-weight: 500; }
.chapter.is-filtered { display: none; }
.stage-group.is-empty { display: none; }
.empty-filter { margin: 8px 0 0; text-align: center; padding: 24px; }
.check { width: 22px; height: 22px; border-radius: 6px; transition: border-color .15s ease, background-color .2s ease, transform .2s ease; }
.check:active { transform: scale(.88); }
.check.just-toggled { animation: check-pop .4s ease both; }
.chapter.is-saving { opacity: .7; }

/* Path */
.path { list-style: none; margin: 0; padding: 0; position: relative; }
.path-step { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.path-step:last-child { padding-bottom: 0; }
.path-step:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border); }
.path-step.is-done:not(:last-child)::before { background: var(--accent); }
.path-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  font-size: 13px; font-weight: 600; color: var(--text-3); background: var(--bg); border: 2px solid var(--border-strong);
}
.path-step.is-current .path-dot { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.path-step.is-done .path-dot { color: #fff; background: var(--accent); border-color: var(--accent); }
.path-body { flex: 1; min-width: 0; padding-top: 3px; }
.path-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.path-row .muted { font-size: 13px; font-variant-numeric: tabular-nums; }
.path .mini-bar { width: 100%; }

/* Achievements */
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 6px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-subtle); color: var(--text-3);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.badge:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(24, 24, 27, .07); }
.badge-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--track); color: var(--text-4); margin-bottom: 4px; }
.badge strong { font-size: 12px; line-height: 1.3; color: var(--text-2); }
.badge-desc { font-size: 11px; font-variant-numeric: tabular-nums; }
.badge.is-unlocked { background: var(--bg); border-color: var(--accent-border); }
.badge.is-unlocked .badge-icon { background: linear-gradient(150deg, var(--accent) 0%, #8f2b49 100%); color: #fff; box-shadow: 0 6px 14px rgba(176, 58, 91, .3); }
.badge.is-unlocked strong { color: var(--text); }
.badge.is-unlocked .badge-desc { color: var(--accent); }
.badge.just-unlocked { animation: badge-unlock .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes badge-unlock { 0% { transform: scale(.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Notes */
#notes textarea {
  width: 100%; min-height: 140px; padding: 12px 14px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.55;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg);
  transition: border-color .2s ease, box-shadow .2s ease;
}
#notes textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.notes-foot { display: flex; justify-content: flex-end; margin-top: 6px; font-size: 12px; }
.notes-status { font-size: 12px; transition: color .2s ease; }
.notes-status.is-saving { color: var(--text-2); }
.notes-status.is-saved { color: var(--success); }
.notes-status.is-error { color: var(--danger); }
#notes .card-head label { cursor: text; }

/* Sign-ins */
.signins { list-style: none; margin: 0 0 14px; padding: 0; }
.signins li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.signins li:first-child { border-top: 0; padding-top: 0; }
.signin-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--bg-subtle); color: var(--text-2); }
.signin-body { flex: 1; min-width: 0; }
.signin-body strong { font-weight: 500; }
.signin-body .muted { display: block; font-size: 12px; }
.signins time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.dash-side .small { margin: 0; }

/* Live updates and toasts */
[data-sync].synced { animation: sync-flash .6s ease; }
@keyframes sync-flash { from { opacity: .35; } }
.toast-region { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border-radius: 12px; pointer-events: auto;
  background: #18181b; color: #fafafa; font-size: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .25);
  animation: toast-in .35s cubic-bezier(.2, .7, .2, 1) both;
}
.toast.is-leaving { animation: toast-out .25s ease both; }
.toast.is-error { background: #7f1d1d; }
.toast .icon { color: #86efac; }
.toast.is-error .icon { color: var(--danger-border); }
.toast button { padding: 4px 10px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 13px; font-weight: 500; }
.toast button:hover { background: rgba(255, 255, 255, .22); }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* Responsive */
@media (max-width: 960px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-hero { grid-template-columns: auto minmax(0, 1fr); }
  .dh-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .user-trigger-email { display: none; }
  .learn-grid, .faq-grid { grid-template-columns: 1fr; gap: 32px; }
  .learn-sticky { position: static; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .stage-nav { display: none; }
  .hero-grid { gap: 36px; }
}
@media (max-width: 760px) {
  .dash { padding-top: 20px; }
  .dash-hero { grid-template-columns: 1fr; justify-items: start; padding: 22px; gap: 18px; }
  .next-card { flex-direction: column; align-items: stretch; }
  .next-num { width: 56px; height: 56px; }
  .card-head { flex-direction: column; }
  .chapter-summary { white-space: normal; }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .user-menu { width: 100%; }
  .user-trigger { display: none; }
  .user-dropdown { position: static; width: 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 8px 0 0; border-top: 1px solid var(--border); border-radius: 0; }
  .ud-head { padding: 8px 0 12px; }
  .pe-row { flex-direction: column; align-items: flex-start; }
  .container, .container.narrow { width: calc(100% - 32px); }
  .menu-toggle { display: block; }
  .brand-tag { display: none; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 16px 16px; flex-direction: column; align-items: stretch; gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links > a:not(.btn) { padding: 10px 0; }
  .nav-links .btn { width: 100%; margin-top: 8px; }
  .hero { padding: 40px 0; }
  .hero-grid, .walkthrough { grid-template-columns: 1fr; }
  .hero-visual { padding: 0 0 40px 0; max-width: 460px; }
  .hero-card { left: 16px; width: 260px; }
  .section { padding: 52px 0; }
  .wt-stage { min-height: 0; padding: 20px; }
  .wt-points { flex-direction: column; gap: 8px; }
  .cta { flex-direction: column; align-items: flex-start; padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .auth-pane { padding: 40px 16px 48px; align-items: flex-start; }
  .next-actions { flex-direction: column; }
  .next-actions .btn { width: 100%; }
  .chapter-meta { display: none; }
  .settings-block { grid-template-columns: 1fr; gap: 16px; padding: 22px; }
}
@media (max-width: 420px) {
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* =========================================================================
   Final project: community platform
   ========================================================================= */
:root { --warn: #b45309; --warn-soft: #fffbeb; --info: #1d4ed8; --info-soft: #eff6ff; }

/* Navigation additions */
.nav-links { gap: 20px; }
.nav-admin { display: inline-flex; align-items: center; gap: 6px; }
.nav-links > a.nav-admin { color: var(--accent); font-weight: 500; }
.nav-bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--text-2); border: 1px solid transparent; transition: background-color .15s ease, border-color .15s ease; }
.nav-links > a.nav-bell { padding: 0; }
.nav-bell:hover, .nav-bell.is-current { background: var(--bg-subtle); border-color: var(--border); color: var(--text); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.nav-bell-label { display: none; }
@media (max-width: 1240px) { .user-trigger-email { display: none; } }

/* Page scaffolding */
.page-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-head .kicker { margin-bottom: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { background: var(--bg-subtle); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #116632; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.inline-form { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.back-link::before { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 0 1.5px 1.5px; transform: rotate(45deg); }
.back-link:hover { color: var(--accent); }

/* Tabs (links) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--text-3); }
.tabs a.is-active .count { border-color: var(--accent-border); color: var(--accent); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.search-box { position: relative; flex: 1 1 260px; }
.search-box .icon { position: absolute; left: 12px; top: 12px; color: var(--text-3); }
.search-box input { width: 100%; height: 42px; padding: 8px 12px 8px 38px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.filters select, .select { height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; font: inherit; font-size: 14px; color: var(--text); }
.search-box input:focus, .filters select:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-note { font-size: 14px; color: var(--text-3); margin: -8px 0 16px; }

/* Form controls beyond inputs */
.field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); font: inherit; font-size: 15px; transition: border-color .2s ease, box-shadow .2s ease; }
.field select { height: 42px; padding-top: 0; padding-bottom: 0; appearance: none; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type="file"] { height: auto; padding: 8px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field .hint { margin-top: 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-subtle); margin-bottom: 18px; cursor: pointer; }
.toggle-row input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }

/* Interest chips */
.chip-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-option { position: relative; cursor: pointer; }
.chip-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-option span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 14px; color: var(--text-2); background: var(--bg); transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.chip-option span::before { content: ""; width: 0; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -3px; opacity: 0; transition: width .15s ease, opacity .15s ease; }
.chip-option:hover span { border-color: var(--accent); color: var(--text); }
.chip-option input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-option input:checked + span::before { width: 5px; opacity: 1; }
.chip-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); text-decoration: none; }
a.chip:hover { border-color: var(--accent); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--bg-subtle); color: var(--text-2); border: 1px solid var(--border); }
.pill-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.pill-success { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.pill-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); }
.pill-info { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.pill .icon { width: 12px; height: 12px; }

/* Card grids */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card-grid.two { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.card.lift { transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.card.lift:hover { border-color: var(--border-strong); box-shadow: 0 10px 26px rgba(24, 24, 27, .06); transform: translateY(-2px); }
.empty { text-align: center; padding: 48px 24px; color: var(--text-3); border: 1px dashed var(--border-strong); border-radius: 14px; background: var(--bg); }
.empty .icon { margin: 0 auto 10px; color: var(--text-3); }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 4px; }
.empty p { margin: 0 0 14px; }
.empty p:last-child { margin: 0; }

/* Events */
.date-block { display: grid; justify-items: center; align-content: center; width: 64px; height: 70px; flex: none; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); overflow: hidden; }
.date-block span { width: 100%; text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--accent); padding: 2px 0; }
.date-block strong { font-size: 24px; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.date-block small { font-size: 11px; color: var(--text-3); line-height: 1; }
.is-past .date-block span { background: var(--text-4); }
.event-card { display: flex; flex-direction: column; gap: 14px; }
.event-top { display: flex; gap: 16px; align-items: flex-start; }
.event-top h3 { font-size: 17px; margin: 4px 0 4px; }
.event-top h3 a { text-decoration: none; }
.event-top h3 a:hover { color: var(--accent); }
.event-summary { font-size: 14px; color: var(--text-2); margin: 0; }
.meta-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.meta-list li { display: inline-flex; align-items: center; gap: 6px; }
.meta-list .icon { color: var(--text-3); }
.event-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: auto; }
.seats { flex: 1; min-width: 0; font-size: 13px; color: var(--text-3); }
.seats .mini-bar { display: block; width: 100%; max-width: 180px; margin-top: 6px; }
.mini-bar { display: inline-block; height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; vertical-align: middle; }
.mini-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mini-bar.is-full > span { background: var(--warn); }
.event-hero { display: flex; gap: 22px; align-items: flex-start; }
.event-hero .date-block { width: 84px; height: 92px; }
.event-hero .date-block strong { font-size: 32px; }
.event-hero h1 { font-size: clamp(24px, 3vw, 32px); margin: 6px 0 8px; }
.prose { color: var(--text-2); }
.prose p { margin: 0 0 14px; }
.prose p:last-child { margin-bottom: 0; }
.prose.mono { margin: 0; overflow-x: auto; line-height: 1.7; font-family: Consolas, 'Courier New', monospace; font-size: 14px; background: #18181b; color: #e4e4e7; padding: 18px 20px; border-radius: 10px; white-space: pre-wrap; }
.prose.mono p { margin-bottom: 18px; }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.facts li:first-child { border-top: 0; padding-top: 0; }
.facts .icon { color: var(--accent); margin-top: 2px; }
.facts strong { display: block; font-weight: 600; }
.facts span { color: var(--text-2); }
.attendees { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.attendees a { display: block; border-radius: 50%; }
.attendees .avatar { box-shadow: 0 0 0 2px var(--bg); }
.checkin { display: flex; gap: 8px; }
.checkin input { flex: 1; height: 42px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); text-transform: uppercase; letter-spacing: .15em; font-weight: 600; min-width: 0; }
.participation { list-style: none; margin: 0; padding: 0; }
.participation li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.participation li:first-child { border-top: 0; padding-top: 0; }
.participation .date-block { width: 52px; height: 58px; }
.participation .date-block strong { font-size: 19px; }
.participation-body { flex: 1; min-width: 0; }
.participation-body a { font-weight: 600; text-decoration: none; }
.participation-body a:hover { color: var(--accent); }
.participation-body p { margin: 0; font-size: 13px; color: var(--text-3); }

/* Resources */
.res-card { display: flex; flex-direction: column; gap: 10px; }
.res-head { display: flex; gap: 14px; align-items: flex-start; }
.res-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.res-head h3 { font-size: 16px; margin: 0 0 4px; }
.res-head h3 a { text-decoration: none; }
.res-head h3 a:hover { color: var(--accent); }
.res-card p { font-size: 14px; color: var(--text-2); margin: 0; }
.res-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.res-actions form { margin: 0; }
.res-actions .spacer { flex: 1; }
.icon-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13px; color: var(--text-2); transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.icon-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.icon-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.icon-toggle.done[aria-pressed="true"] { color: var(--success); border-color: var(--success-border); background: var(--success-soft); }
.icon-toggle[aria-pressed="true"] .icon path { fill: currentColor; fill-opacity: .15; }
.res-card.is-complete { border-color: var(--success-border); }

/* Forum */
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; color: var(--text-2); }
.cat-list a:hover { background: var(--bg-subtle); color: var(--text); }
.cat-list a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.cat-list .muted { font-size: 12px; }
.threads { list-style: none; margin: 0; padding: 0; }
.thread-row { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--border); }
.thread-row:first-child { border-top: 0; padding-top: 0; }
.thread-main { flex: 1; min-width: 0; }
.thread-title { display: inline; font-size: 16px; font-weight: 600; text-decoration: none; }
.thread-title:hover { color: var(--accent); }
.thread-main .pill { margin-left: 6px; vertical-align: 2px; }
.thread-meta { margin: 4px 0 0; font-size: 13px; color: var(--text-3); }
.thread-meta a { color: inherit; }
.thread-stats { display: flex; gap: 16px; flex: none; font-size: 13px; color: var(--text-3); text-align: center; }
.thread-stats strong { display: block; font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.post { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 22px 0; border-top: 1px solid var(--border); }
.post:first-of-type { border-top: 0; padding-top: 4px; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; font-size: 14px; }
.post-head a { font-weight: 600; text-decoration: none; }
.post-head a:hover { color: var(--accent); }
.post-head time { color: var(--text-3); font-size: 13px; }
.post-body { color: var(--text); }
.post-body p { margin: 0 0 12px; }
.post-body p:last-child { margin: 0; }
.post-tools { display: flex; gap: 12px; margin-top: 10px; }
.post-tools button, .post-tools a { padding: 0; border: 0; background: none; font-size: 13px; color: var(--text-3); text-decoration: none; }
.post-tools button:hover, .post-tools a:hover { color: var(--danger); text-decoration: underline; }
.post.is-op .post-body { font-size: 16px; }
.mod-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--bg-subtle); margin-bottom: 16px; font-size: 13px; align-items: center; }
.mod-bar form { margin: 0; }
.locked-note { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 10px; background: var(--bg-subtle); color: var(--text-2); font-size: 14px; }

/* Members, profiles, mentorship */
.member-card { display: flex; flex-direction: column; gap: 12px; }
.member-top { display: flex; gap: 14px; align-items: center; }
.member-top h3 { font-size: 16px; margin: 0; }
.member-top h3 a { text-decoration: none; }
.member-top h3 a:hover { color: var(--accent); }
.member-top p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.member-card .bio { font-size: 14px; color: var(--text-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.member-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
.profile-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 28px 32px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(120deg, #ffffff 0%, #ffffff 50%, #fbf0f3 100%); }
.profile-hero h1 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 6px; }
.profile-hero .bio { margin: 10px 0 0; color: var(--text-2); max-width: 620px; }
.profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.activity-feed { list-style: none; margin: 0; padding: 0; }
.activity-feed li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.activity-feed li:first-child { border-top: 0; padding-top: 0; }
.feed-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: var(--bg-subtle); color: var(--text-2); }
.activity-feed a { font-weight: 500; text-decoration: none; }
.activity-feed a:hover { color: var(--accent); }
.activity-feed time { display: block; font-size: 12px; color: var(--text-3); }
.mentor-row { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--border); }
.mentor-row:first-child { border-top: 0; padding-top: 0; }
.mentor-row-body { flex: 1; min-width: 0; }
.mentor-row-body h3 { font-size: 16px; margin: 0 0 2px; }
.mentor-row-body h3 a { text-decoration: none; }
.mentor-row-body blockquote { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent-border); background: var(--bg-subtle); border-radius: 0 8px 8px 0; font-size: 14px; color: var(--text-2); }
.mentor-row-actions { display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.mentor-row-actions form { margin: 0; }
.request-box { margin-top: 12px; }
.request-box summary { list-style: none; }
.request-box summary::-webkit-details-marker { display: none; }
.request-box[open] summary { display: none; }
.request-box form { margin-top: 4px; }
.contact-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 14px; }

/* Notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--border); }
.notif:first-child { border-top: 0; }
.notif-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--bg-subtle); color: var(--text-2); }
.notif.is-unread .notif-icon { background: var(--accent-soft); color: var(--accent); }
.notif-body { flex: 1; min-width: 0; }
.notif-body a { text-decoration: none; }
.notif.is-unread .notif-body a { font-weight: 600; }
.notif-body a:hover { color: var(--accent); }
.notif-body time { display: block; font-size: 12px; color: var(--text-3); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

/* Dashboard additions */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-list .date-block { width: 46px; height: 52px; border-radius: 10px; }
.mini-list .date-block span { font-size: 10px; }
.mini-list .date-block strong { font-size: 17px; }
.mini-list .date-block small { display: none; }
.mini-body { flex: 1; min-width: 0; }
.mini-body a { display: block; font-size: 14px; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-body a:hover { color: var(--accent); }
.mini-body span { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-link { font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap; }
.card-link:hover { text-decoration: underline; }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rec { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.rec:hover { border-color: var(--border-strong); box-shadow: 0 8px 20px rgba(24, 24, 27, .06); transform: translateY(-2px); }
.rec .res-icon { width: 36px; height: 36px; }
.rec strong { display: block; font-size: 14px; line-height: 1.35; }
.rec small { display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.rec-why { display: block; font-size: 12px; color: var(--accent); margin-top: 4px; }
.interest-prompt { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); border: 1px solid var(--accent-border); }
.interest-prompt p { margin: 0; flex: 1; font-size: 14px; color: var(--text-2); }
.training-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.training-stats div { padding: 12px 14px; border-radius: 10px; background: var(--bg-subtle); }
.training-stats dt { font-size: 12px; color: var(--text-3); }
.training-stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; }
.admin-nav p { margin: 4px 10px 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.admin-nav a:hover { background: var(--bg-subtle); color: var(--text); }
.admin-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.admin-nav a .icon { color: currentColor; opacity: .8; }
.admin-nav .count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-grid .stat-tile { padding: 16px 18px; }
.kpi-grid .st-value { font-size: 26px; margin: 10px 0 4px; }
.delta { font-size: 12px; font-weight: 500; color: var(--success); }
.delta.is-down { color: var(--danger); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr:first-child td { border-top: 0; }
.table tbody tr:hover { background: var(--row-hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table .who strong { display: block; font-weight: 600; }
.table .who div > span { display: block; font-size: 12px; color: var(--text-3); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.table .actions form { margin: 0; }
.btn-xs { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.table select.select { height: 32px; font-size: 13px; padding-right: 28px; background-position: right 8px center; }
.chart-card .card-head { margin-bottom: 10px; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 13px; }
.bars .bar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar-track { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.bars .bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--accent); transform-origin: left; animation: grow-x .9s cubic-bezier(.2, .7, .2, 1) both; }
.bars .bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.colchart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 18px; border-bottom: 1px solid var(--border); }
.colchart .col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.colchart .col span { display: block; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 2px; transform-origin: bottom; animation: grow-y .8s cubic-bezier(.2, .7, .2, 1) both; transition: background-color .15s ease; }
.colchart .col.is-zero span { background: var(--track); }
.colchart .col:hover span { background: var(--accent-hover); }
.colchart .col b { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.col-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 6px; font-size: 11px; color: var(--text-3); text-align: center; }
@keyframes grow-y { from { transform: scaleY(0); } }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stack-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--track); gap: 2px; }
.stack-bar span { display: block; height: 100%; }
.admin-form { max-width: 760px; }
.code-badge { font-family: Consolas, 'Courier New', monospace; font-weight: 600; letter-spacing: .12em; padding: 2px 8px; border-radius: 6px; background: var(--bg-subtle); border: 1px solid var(--border); }
.attendance-form { display: flex; gap: 4px; }
.attendance-form button { height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); font-size: 12px; color: var(--text-2); }
.attendance-form button[aria-pressed="true"].att-yes { background: var(--success-soft); color: var(--success); border-color: var(--success-border); font-weight: 600; }
.attendance-form button[aria-pressed="true"].att-no { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-border); font-weight: 600; }

/* Pager */
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; font-size: 14px; }
.pager a, .pager span.is-disabled { padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; background: var(--bg); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .is-disabled { color: var(--text-3); opacity: .6; }
.pager-pos { color: var(--text-3); }

/* Responsive: collapse the signed-in navigation earlier, it has more links */
@media (max-width: 1100px) {
  .menu-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: 0 12px 24px rgba(24, 24, 27, .06);
    padding: 12px 24px 16px; flex-direction: column; align-items: stretch; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links > a:not(.btn) { padding: 10px 0; }
  .nav-links .btn { width: 100%; margin-top: 8px; }
  .nav-bell { width: auto; height: auto; justify-content: start; display: flex; gap: 10px; border-radius: 0; border: 0; }
  .nav-bell:hover, .nav-bell.is-current { background: none; border: 0; }
  .nav-bell-label { display: inline; }
  .bell-count { position: static; box-shadow: none; }
  .user-menu { width: 100%; }
  .user-trigger { display: none; }
  .user-dropdown { position: static; width: 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 8px 0 0; border-top: 1px solid var(--border); border-radius: 0; }
  .ud-head { padding: 8px 0 12px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-nav p { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .profile-hero { grid-template-columns: 1fr; padding: 22px; }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid, .card-grid.two { grid-template-columns: 1fr; }
  .rec-grid, .training-stats { grid-template-columns: 1fr; }
  .field-row, .field-row.three { grid-template-columns: 1fr; }
  .thread-stats { display: none; }
  .event-hero { flex-direction: column; }
  .mentor-row { flex-wrap: wrap; }
  .bars li { grid-template-columns: 90px minmax(0, 1fr) 36px; }
  .page-head.row { align-items: flex-start; }
}
.interests-field { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.interests-field legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 2px; }
.interests-field .hint { margin: 0 0 10px; }
.icon-toggle.just-toggled { animation: toggle-pop .3s ease both; }
@keyframes toggle-pop { 50% { transform: scale(.94); } }
.icon-toggle:disabled { opacity: .6; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); text-align: left; cursor: pointer; }
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.notif.is-unread .link-btn { font-weight: 600; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 22px; transition: border-color .2s ease, box-shadow .25s ease, transform .25s ease; }
.feature:hover { border-color: var(--border-strong); box-shadow: 0 10px 26px rgba(24, 24, 27, .06); transform: translateY(-2px); }
.feature h3 { font-size: 17px; margin: 14px 0 6px; }
.feature p { margin: 0; color: var(--text-2); font-size: 15px; }
.section-head.row-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; max-width: none; flex-wrap: wrap; }
.section-head.row-head p { max-width: 560px; }
@media (max-width: 960px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.btn[aria-label] > .icon:only-child { margin: 0; }
@media print {
  .site-header, .site-footer, .admin-nav, .no-print, .page-actions, .toast-region, .skip-link { display: none !important; }
  .page { padding: 0; background: #fff; }
  .admin-layout { display: block; }
  .card, .stat-tile, .table-wrap { break-inside: avoid; box-shadow: none; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .bars .bar-fill, .st-bar span, .mini-bar > span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.mini-body .code-badge { display: inline; font-size: 11px; padding: 0 5px; }
.col-labels span { white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.table .actions .btn { white-space: nowrap; }
.table .who { min-width: 230px; }
.table .who > div { min-width: 0; }
.table .who div > span { overflow-wrap: anywhere; }
.table td .pill { margin-top: 2px; }
.card-head .btn { white-space: nowrap; flex: none; }
.split > *, .stack > *, .card-grid > * { min-width: 0; }
.post-body, .prose, .thread-title, .mini-body a { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr !important; } }
@media (max-width: 760px) {
  .mentor-row-body { flex: 1 1 calc(100% - 72px); }
  .mentor-row-actions { width: 100%; padding-left: 72px; }
}
.join-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.join-field legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 8px; }
.join-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.join-option { position: relative; cursor: pointer; }
.join-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.join-option > span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--bg); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.join-option strong { font-size: 15px; }
.join-option small { font-size: 13px; color: var(--text-2); line-height: 1.45; }
.join-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg-subtle); color: var(--text-2); margin-bottom: 6px; }
.join-option:hover > span { border-color: var(--accent); }
.join-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.join-option input:checked + span .join-icon { background: var(--accent); color: #fff; }
.join-option input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.mentor-extra { padding: 16px 16px 2px; margin-bottom: 18px; border: 1px dashed var(--accent-border); border-radius: 12px; background: var(--accent-faint); }
@media (max-width: 420px) { .join-options { grid-template-columns: 1fr; } }
/* Video lessons */
.video-thumb { position: relative; display: block; margin: -22px -24px 4px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px 14px 0 0; background: #18181b; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease, opacity .2s ease; }
.video-thumb:hover img { transform: scale(1.04); opacity: .92; }
.play-badge { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(176, 58, 91, .92); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); transition: transform .2s ease; }
.play-badge svg { margin-left: 3px; }
.video-thumb:hover .play-badge { transform: scale(1.08); }
.video-length { position: absolute; right: 10px; bottom: 10px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; font-weight: 500; }
.video-frame { position: relative; aspect-ratio: 16 / 9; margin-bottom: 12px; border-radius: 12px; overflow: hidden; background: #18181b; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 18px; font-size: 13px; color: var(--text-3); }
.video-note .icon { flex: none; margin-top: 2px; }
.btn.btn-trail .icon { margin: 0 0 0 8px; }
.res-actions .muted, .icon-toggle { white-space: nowrap; }
.res-card.has-video .res-time { display: none; }
/* Email confirmation */
.verify-card { max-width: 560px; margin: 0 auto; padding: 40px 36px; text-align: center; }
.verify-card h1 { font-size: clamp(24px, 3vw, 30px); margin: 18px 0 10px; }
.verify-icon { display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.verify-icon.is-warn { background: var(--warn-soft); color: var(--warn); }
.lead-sm { font-size: 17px; color: var(--text-2); margin: 0 0 12px; }
.lead-sm strong { color: var(--text); overflow-wrap: anywhere; }
.verify-card .muted { max-width: 440px; margin-left: auto; margin-right: auto; }
.dev-box { margin: 22px 0 6px; padding: 18px; border: 1px dashed var(--warn-border); border-radius: 12px; background: var(--warn-soft); text-align: left; }
.dev-box p { margin: 0 0 12px; font-size: 14px; color: var(--text-2); }
.dev-box .hint { margin: 12px 0 0; font-size: 12px; }
.verify-tips { margin: 24px 0 20px; padding: 16px 18px; border-radius: 12px; background: var(--bg-subtle); text-align: left; }
.verify-tips ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.verify-tips li { margin: 3px 0; }
.btn[disabled] { pointer-events: none; }
/* Event reminders and countdowns */
.soon-bar { background: var(--accent); color: #fff; position: relative; z-index: 5; }
.soon-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.soon-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.soon-inner p { flex: 1; min-width: 0; margin: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-sep { opacity: .7; margin: 0 2px; }
.soon-time { font-weight: 600; }
.soon-btn { background: #fff; color: var(--accent); border-color: #fff; flex: none; }
.soon-btn:hover { background: #fbe9ee; color: var(--accent-hover); }
.soon-close { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: transparent; color: #fff; opacity: .8; }
.soon-close:hover { opacity: 1; background: rgba(255, 255, 255, .15); }
.countdown-pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.facts .countdown-pill { margin-top: 6px; }
.countdown-pill.is-soon { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.countdown-pill.is-live, .countdown-inline.is-live { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.countdown-pill.is-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: live-pulse 1.6s ease-in-out infinite; }
.countdown-inline { color: var(--accent); font-weight: 500; }
.countdown-inline.is-live { background: none; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .countdown-pill.is-live::before { animation: none; } }
.reminder-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; color: var(--text-2); }
.reminder-note .icon { flex: none; margin-top: 2px; color: var(--accent); }
@media (max-width: 600px) { .soon-sep, .soon-inner p strong + .soon-sep { display: none; } .soon-inner p { white-space: normal; } .soon-inner p strong { display: block; } }
/* Mentor test */
.quiz-timer { position: sticky; top: 72px; z-index: 4; display: flex; align-items: center; gap: 8px; width: fit-content; margin: 0 0 16px auto; padding: 8px 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(24, 24, 27, .08); font-size: 14px; }
.quiz-timer strong { font-variant-numeric: tabular-nums; font-size: 16px; }
.quiz-timer.is-low { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }
.quiz-form { display: flex; flex-direction: column; gap: 14px; }
.quiz-q { border: 1px solid var(--border); margin: 0; min-width: 0; }
.quiz-q legend { display: flex; align-items: center; gap: 8px; padding: 0; float: left; width: 100%; margin-bottom: 8px; }
.quiz-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; }
.quiz-text { clear: both; margin: 0 0 12px; font-size: 16px; font-weight: 500; }
.quiz-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.quiz-opt:hover { border-color: var(--accent); }
.quiz-opt input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.quiz-opt span { font-family: Consolas, 'Courier New', monospace; font-size: 14px; }
.quiz-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.review-note { margin: 0 auto 14px; max-width: 440px; padding: 12px 16px; border-left: 3px solid var(--accent-border); background: var(--bg-subtle); border-radius: 0 8px 8px 0; text-align: left; color: var(--text-2); font-size: 14px; }
.answer-list { list-style: none; margin: 0; padding: 0; }
.answer-list li { padding: 12px 0; border-top: 1px solid var(--border); font-size: 14px; }
.answer-list li:first-child { border-top: 0; padding-top: 0; }
.answer-list .q { font-weight: 500; margin: 0 0 4px; }
.answer-list .a { display: flex; gap: 8px; align-items: center; margin: 0; font-family: Consolas, 'Courier New', monospace; font-size: 13px; }
.answer-list .a.ok { color: var(--success); }
.answer-list .a.no { color: var(--danger); }
.answer-list .right { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }
.admin-nav .nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; }


/* ==========================================================================
   Dark theme. The switch in the header sets data-theme on <html>; the first
   visit follows the device setting. Same layout, darker colours.
   ========================================================================== */
:root[data-theme="dark"] {
  --text: #f4f4f5;
  --text-2: #c9c9d1;
  --text-3: #a1a1aa;
  --text-4: #71717a;
  --bg: #1b1b1f;
  --bg-subtle: #121215;
  --border: #2c2c32;
  --border-strong: #3f3f46;
  --accent: #d0557a;
  --accent-hover: #df6d8f;
  --accent-soft: #3a1f29;
  --accent-border: #5b2d3d;
  --accent-faint: #22191d;
  --success: #4ade80;
  --success-soft: #11251a;
  --success-border: #1f4d30;
  --danger: #f87171;
  --danger-soft: #2a1617;
  --danger-border: #5f2a2a;
  --warn: #fbbf24;
  --warn-soft: #29210f;
  --warn-border: #5c4919;
  --info: #60a5fa;
  --info-soft: #131f36;
  --info-border: #22406e;
  --track: #2b2b31;
  --row-hover: #222227;
  --hero-a: #241a1f;
  --hero-b: #33202a;
  --glass: rgba(27, 27, 31, .7);
  --glass-edge: rgba(255, 255, 255, .06);
  color-scheme: dark;
}
:root[data-theme="dark"] .btn-success { background: #15803d; }
:root[data-theme="dark"] .btn-success:hover { background: #166534; }
:root[data-theme="dark"] .hc.l1 { background: #4a2433; }
:root[data-theme="dark"] .hc.l2 { background: #7a3651; }
:root[data-theme="dark"] .hc.l3 { background: #b24a6d; }
:root[data-theme="dark"] .hc.l4 { background: #e47c9a; }
:root[data-theme="dark"] .prose.mono,
:root[data-theme="dark"] .mock-code,
:root[data-theme="dark"] .mock-terminal { background: #0e0e10; border: 1px solid var(--border); }
:root[data-theme="dark"] .viz-tip { background: #2c2c32; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .toast { background: #2c2c32; border: 1px solid var(--border-strong); }
:root[data-theme="dark"] .toast.is-error { background: #7f1d1d; border-color: #991b1b; }
:root[data-theme="dark"] .soon-bar { background: #a83d5e; }
:root[data-theme="dark"] .site-header.scrolled,
:root[data-theme="dark"] .user-dropdown { box-shadow: 0 18px 48px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .hero-frame img { filter: brightness(.92); }
textarea, select { color: inherit; }
select option { background: var(--bg); color: var(--text); }

/* Logo: drawn inline so the dark part follows the theme */
.wordmark { display: block; height: 26px; width: auto; }
.wordmark text { fill: var(--text); }
.wordmark tspan { fill: var(--accent); }
.footer-logo .wordmark { height: 28px; }

/* Light / dark switch */
.brand { margin-right: auto; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: var(--bg); color: var(--text-2);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon { transition: transform .35s ease; }
.theme-toggle:hover .icon { transform: rotate(20deg); }
.theme-toggle .t-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .t-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .t-moon { display: none; }
html.theme-switching, html.theme-switching * { transition: background-color .25s ease, border-color .25s ease, color .25s ease !important; }
.nav-wrap > .brand { order: 0; }
.nav-wrap > .nav-links { order: 1; }
.nav-wrap > .theme-toggle { order: 2; }
.nav-wrap > .menu-toggle { order: 3; }
@media (max-width: 1100px) { .theme-toggle { width: 36px; height: 36px; } }
