/* ============================================================
   Final Grade Calculator — design system
   Register: product (tool-first). One family (Inter), restrained
   palette, pure white / near-black surfaces, rose brand accent.
   ============================================================ */

:root {
  /* Brand — anchored at oklch hue 354 (rose), pure-white surface */
  --brand:        oklch(0.585 0.215 354);
  --brand-strong: oklch(0.52 0.215 354);
  --brand-soft:   oklch(0.96 0.02 354);
  --brand-ink:    oklch(0.42 0.15 354);

  /* Neutrals — chroma ~0, faint tint toward brand hue */
  --bg:        oklch(1 0 0);
  --surface:   oklch(0.982 0.003 354);
  --surface-2: oklch(0.958 0.005 354);
  --ink:       oklch(0.22 0.008 354);
  --ink-2:     oklch(0.42 0.01 354);
  --muted:     oklch(0.5 0.012 354);
  --line:      oklch(0.91 0.005 354);
  --line-2:    oklch(0.85 0.006 354);

  /* Semantic */
  --ok:      oklch(0.62 0.17 155);
  --ok-soft: oklch(0.95 0.04 155);
  --warn:    oklch(0.66 0.16 70);
  --err:     oklch(0.585 0.215 354);

  /* Type scale — fixed rem, ratio ~1.2 (product register) */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.375rem;
  --fs-hero: 3rem;

  /* Spacing — 4pt base */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --sp-24: 96px;

  /* Motion */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --dur-instant: 120ms;
  --dur-fast:    200ms;
  --dur-med:     320ms;
  --dur-slow:    560ms;

  /* Elevation */
  --shadow-sm: 0 1px 2px oklch(0.2 0.01 354 / 0.05);
  --shadow-md: 0 4px 14px -4px oklch(0.2 0.01 354 / 0.09), 0 1px 3px oklch(0.2 0.01 354 / 0.05);
  --shadow-lg: 0 16px 40px -12px oklch(0.2 0.01 354 / 0.14), 0 2px 6px oklch(0.2 0.01 354 / 0.05);
  --shadow-brand: 0 8px 24px -8px oklch(0.585 0.215 354 / 0.4);

  /* z-index scale */
  --z-sticky: 40;
  --z-tooltip: 60;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  color-scheme: light;
}

[data-theme="dark"] {
  --brand:        oklch(0.72 0.17 354);
  --brand-strong: oklch(0.78 0.15 354);
  --brand-soft:   oklch(0.24 0.04 354);
  --brand-ink:    oklch(0.82 0.1 354);

  --bg:        oklch(0.09 0 0);
  --surface:   oklch(0.135 0.006 354);
  --surface-2: oklch(0.18 0.008 354);
  --ink:       oklch(0.96 0.004 354);
  --ink-2:     oklch(0.82 0.008 354);
  --muted:     oklch(0.66 0.01 354);
  --line:      oklch(0.24 0.008 354);
  --line-2:    oklch(0.32 0.01 354);

  --ok:      oklch(0.72 0.15 155);
  --ok-soft: oklch(0.24 0.05 155);

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-md: 0 4px 14px -4px oklch(0 0 0 / 0.5);
  --shadow-lg: 0 16px 40px -12px oklch(0 0 0 / 0.6);
  --shadow-brand: 0 8px 24px -8px oklch(0.72 0.17 354 / 0.35);

  color-scheme: dark;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  transition: background-color var(--dur-fast) var(--ease-out-quart),
              color var(--dur-fast) var(--ease-out-quart);
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; text-wrap: balance; font-weight: 700; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--ink); }

::selection { background: oklch(0.585 0.215 354 / 0.22); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { width: min(1120px, 100% - 2 * var(--sp-6)); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2 * var(--sp-6)); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out-quart),
              background-color var(--dur-fast) var(--ease-out-quart);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
  display: flex; align-items: center; gap: var(--sp-6);
  height: 60px;
}
.brand {
  display: flex; align-items: center; gap: var(--sp-2);
  font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
  font-size: var(--fs-lg);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 800;
  transition: transform var(--dur-fast) var(--ease-out-quint);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.06); }
.site-nav { display: flex; gap: var(--sp-1); margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: color var(--dur-instant) var(--ease-out-quart),
              background-color var(--dur-instant) var(--ease-out-quart);
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--brand-ink); background: var(--brand-soft); }

/* Nav dropdown group */
.nav-group { position: relative; }
.nav-group-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  padding: 6px 10px; border-radius: var(--radius-sm);
  border: none; background: transparent;
  transition: color var(--dur-instant) var(--ease-out-quart),
              background-color var(--dur-instant) var(--ease-out-quart);
}
.nav-group-toggle::after {
  content: ""; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: 0.7;
  transition: transform var(--dur-fast) var(--ease-out-quart);
}
.nav-group-toggle:hover { color: var(--ink); background: var(--surface-2); }
.nav-group.open .nav-group-toggle { color: var(--brand-ink); background: var(--brand-soft); }
.nav-group.open .nav-group-toggle::after { transform: rotate(180deg); }
.nav-group-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 184px; padding: var(--sp-1);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: grid; gap: 2px;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out-quart),
              transform var(--dur-fast) var(--ease-out-quart);
  z-index: var(--z-tooltip);
}
.nav-group.open .nav-group-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.nav-group-menu a {
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.nav-group-menu a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--muted);
  transition: color var(--dur-instant), border-color var(--dur-instant),
              transform var(--dur-fast) var(--ease-out-quint);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); transform: rotate(15deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-moon, [data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Mobile nav */
.nav-burger { display: none; }
@media (max-width: 720px) {
  .nav-burger {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  }
  .site-nav {
    position: fixed; inset: 60px 0 auto 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: var(--sp-3) var(--sp-6) var(--sp-6);
    gap: var(--sp-1);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform var(--dur-fast) var(--ease-out-quart),
                opacity var(--dur-fast) var(--ease-out-quart);
    box-shadow: var(--shadow-lg);
  }
  .site-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav a { padding: 10px 12px; font-size: var(--fs-base); }
  .header-inner .theme-toggle { margin-left: auto; }
  .site-nav { margin-left: 0; }
  .nav-group { position: static; }
  .nav-group-toggle { width: 100%; justify-content: space-between; font-size: var(--fs-base); padding: 10px 12px; }
  .nav-group-menu {
    position: static; opacity: 1; transform: none; pointer-events: auto;
    box-shadow: none; border: none; border-left: 2px solid var(--line);
    margin: 2px 0 2px 12px; padding: 2px 0 2px 8px; min-width: 0;
  }
  .nav-group-menu a { padding: 8px 10px; }
  .nav-group.open .nav-group-menu { display: grid; }
  .nav-group:not(.open) .nav-group-menu { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--sp-16) 0 var(--sp-12); text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, var(--fs-hero)); letter-spacing: -0.03em; }
.hero .lede {
  margin: var(--sp-4) auto 0; max-width: 62ch;
  color: var(--muted); font-size: var(--fs-lg);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 600; color: var(--brand-ink);
  background: var(--brand-soft); border: 1px solid color-mix(in oklch, var(--brand) 25%, transparent);
  padding: 5px 12px; border-radius: 999px; margin-bottom: var(--sp-6);
}

/* Entrance choreography — one rehearsed moment: hero only */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}
.hero > * { animation: hero-rise var(--dur-slow) var(--ease-out-expo) both; }
.hero > *:nth-child(2) { animation-delay: 70ms; }
.hero > *:nth-child(3) { animation-delay: 140ms; }

/* ---------- Tool card ---------- */
.tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tool-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--line);
}
.tool-head h2 { font-size: var(--fs-xl); }
.tool-head .hint { font-size: var(--fs-xs); color: var(--muted); }
.tool-body { padding: var(--sp-6); }

.field-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }

.field label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  margin-bottom: 6px; color: var(--ink-2);
}
.field label .sub { font-weight: 400; color: var(--muted); }
.input-wrap { position: relative; }
.input-wrap .suffix {
  position: absolute; right: 12px; top: 50%; translate: 0 -50%;
  color: var(--muted); font-size: var(--fs-sm); pointer-events: none;
}
.input-wrap input {
  width: 100%; padding: 11px 36px 11px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color var(--dur-instant) var(--ease-out-quart),
              box-shadow var(--dur-instant) var(--ease-out-quart);
}
.input-wrap input:hover { border-color: var(--muted); }
.input-wrap input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand) 18%, transparent);
}
.field .error-msg {
  display: none; font-size: var(--fs-xs); color: var(--err); margin-top: 6px;
}
.field.invalid input { border-color: var(--err); }
.field.invalid .error-msg { display: block; animation: shake 320ms var(--ease-out-quart); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); } 50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-weight: 600; font-size: var(--fs-base);
  padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform var(--dur-instant) var(--ease-out-quint),
              box-shadow var(--dur-fast) var(--ease-out-quart),
              background-color var(--dur-instant) var(--ease-out-quart),
              border-color var(--dur-instant);
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost {
  background: transparent; color: var(--ink-2);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--muted); background: var(--surface-2); }
.btn-row { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; }

/* ---------- Result panel ---------- */
.result {
  margin-top: var(--sp-6);
  border-top: 1px dashed var(--line-2);
  padding-top: var(--sp-6);
  display: none;
}
.result.show { display: block; }
.result-grid {
  display: flex; align-items: center; gap: var(--sp-8); flex-wrap: wrap;
}
.ring-wrap { position: relative; width: 148px; height: 148px; flex: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--surface-2); }
.ring-bar {
  stroke: var(--brand);
  stroke-linecap: round;
  transition: stroke-dashoffset 900ms var(--ease-out-expo), stroke 300ms;
}
.ring-center {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
}
.ring-center .num { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ring-center .cap { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.result-copy { flex: 1; min-width: 240px; }
.result-copy .verdict { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; }
.result-copy p { color: var(--muted); margin-top: var(--sp-2); max-width: 55ch; }
.result.state-ok .ring-bar { stroke: var(--ok); }
.result.state-ok .verdict { color: var(--ok); }
.result.state-hard .ring-bar { stroke: var(--warn); }
.result.state-hard .verdict { color: var(--warn); }
.result.state-out .ring-bar { stroke: var(--err); }
.result.state-out .verdict { color: var(--err); }

/* ---------- Rows (weighted / GPA) ---------- */
.rows { display: flex; flex-direction: column; gap: var(--sp-3); }
.rows-head, .row {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: var(--sp-3);
  align-items: center;
}
.rows-head { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: 0 2px; }
.row {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--sp-2);
  animation: row-in var(--dur-med) var(--ease-out-quart) both;
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.row.removing { transition: opacity var(--dur-fast), transform var(--dur-fast); opacity: 0; transform: scale(0.98); }
.row input, .row select {
  width: 100%; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  transition: border-color var(--dur-instant), box-shadow var(--dur-instant);
}
.row input:focus, .row select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand) 18%, transparent);
}
.row .remove {
  width: 32px; height: 32px; border-radius: 6px; border: none;
  background: transparent; color: var(--muted);
  display: grid; place-items: center;
  transition: color var(--dur-instant), background-color var(--dur-instant);
}
.row .remove:hover { color: var(--err); background: var(--brand-soft); }
@media (max-width: 640px) {
  .rows-head { display: none; }
  .row { grid-template-columns: 1fr 1fr; }
  .row > :first-child { grid-column: 1 / -1; }
}

/* Big numeric answer (weighted / GPA) */
.big-answer { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.big-answer .num {
  font-size: var(--fs-4xl); font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1;
}
.big-answer .unit { color: var(--muted); font-weight: 600; }

/* ---------- Sections / prose ---------- */
.section { padding: var(--sp-16) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-title { font-size: var(--fs-3xl); margin-bottom: var(--sp-4); }
.prose { max-width: 68ch; color: var(--ink-2); }
.prose h2 { font-size: var(--fs-2xl); margin: var(--sp-8) 0 var(--sp-3); }
.prose h3 { font-size: var(--fs-xl); margin: var(--sp-6) 0 var(--sp-2); }
.prose p { margin-bottom: var(--sp-4); }
.prose ul, .prose ol { color: var(--ink-2); padding-left: var(--sp-6); margin-bottom: var(--sp-4); }
.prose li { margin-bottom: var(--sp-2); }
.prose li::marker { color: var(--brand); }

/* Tools cross-links — not a card grid: bordered list rows */
.tool-links { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: var(--sp-6); }
.tool-links a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-2); border-bottom: 1px solid var(--line);
  color: var(--ink); font-weight: 600;
  transition: background-color var(--dur-instant), padding-left var(--dur-fast) var(--ease-out-quart);
}
.tool-links a:hover { background: var(--surface); text-decoration: none; padding-left: var(--sp-4); }
.tool-links a .desc { font-weight: 400; color: var(--muted); font-size: var(--fs-sm); margin-right: auto; }
.tool-links a .arrow { color: var(--muted); transition: transform var(--dur-fast) var(--ease-out-quint), color var(--dur-instant); }
.tool-links a:hover .arrow { transform: translateX(4px); color: var(--brand); }
@media (max-width: 640px) { .tool-links a .desc { display: none; } }

/* ---------- FAQ accordion ---------- */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: none; border: none; text-align: left;
  padding: var(--sp-4) var(--sp-2); font-weight: 600; font-size: var(--fs-lg);
  color: var(--ink);
  transition: color var(--dur-instant);
}
.faq-q:hover { color: var(--brand-ink); }
.faq-q .chev {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid var(--line);
  transition: transform var(--dur-med) var(--ease-out-quint),
              background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.faq-item.open .faq-q .chev {
  transform: rotate(180deg);
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.faq-a {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-med) var(--ease-out-quart);
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
.faq-a > div { overflow: hidden; }
.faq-a p { padding: 0 var(--sp-2) var(--sp-5); color: var(--muted); max-width: 68ch; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-12) 0 var(--sp-8);
  background: var(--surface);
  margin-top: var(--sp-16);
}
.footer-grid { display: flex; justify-content: space-between; gap: var(--sp-8); flex-wrap: wrap; }
.footer-grid .col h4 { font-size: var(--fs-sm); margin-bottom: var(--sp-3); color: var(--ink); }
.footer-grid .col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.footer-grid .col a { color: var(--muted); font-size: var(--fs-sm); }
.footer-grid .col a:hover { color: var(--ink); }
.footer-base {
  margin-top: var(--sp-8); padding-top: var(--sp-6);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  color: var(--muted); font-size: var(--fs-xs);
}

/* ---------- Static pages ---------- */
.page-head { padding: var(--sp-12) 0 var(--sp-6); }
.page-head h1 { font-size: var(--fs-4xl); }
.page-head .lede { color: var(--muted); margin-top: var(--sp-3); max-width: 62ch; }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.kbd-note { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Blog ---------- */
.blog-article .blog-tag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--brand-soft);
  color: var(--brand-ink);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: var(--sp-3);
}
.blog-article .blog-meta {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-top: var(--sp-2);
}
.blog-article h2 {
  font-size: var(--fs-2xl);
  margin: var(--sp-8) 0 var(--sp-3);
  color: var(--ink);
}
.blog-article h3 {
  font-size: var(--fs-xl);
  margin: var(--sp-6) 0 var(--sp-2);
  color: var(--ink);
}
.blog-article .formula-box {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-4) 0 var(--sp-6);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
  overflow-x: auto;
}
.blog-article .formula-box code {
  font-family: 'SF Mono', ui-monospace, monospace;
}
.mistakes-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-4) 0 var(--sp-6);
  font-size: var(--fs-sm);
}
.mistakes-table th,
.mistakes-table td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  text-align: left;
}
.mistakes-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
}
.mistakes-table tr:nth-child(even) td {
  background: var(--surface);
}

/* ---------- Planner ---------- */
.planner-page h2 {
  font-size: var(--fs-2xl);
  margin: var(--sp-8) 0 var(--sp-3);
}
.planner-section {
  margin-top: var(--sp-8);
}
.planner-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-4) 0;
  font-size: var(--fs-sm);
}
.planner-table th,
.planner-table td {
  border: 1px solid var(--line);
  padding: var(--sp-2) var(--sp-3);
  min-width: 80px;
}
.planner-table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.planner-table td[contenteditable="true"] {
  background: var(--bg);
  min-height: 32px;
  outline: none;
}
.planner-table td[contenteditable="true"]:focus {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--brand);
}
.planner-hint {
  color: var(--muted);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-3);
}
.planner-note {
  color: var(--warn);
  font-weight: 500;
  font-size: var(--fs-sm);
  margin-top: var(--sp-3);
}
.priority-list {
  list-style: decimal;
  padding-left: var(--sp-6);
}
.priority-list li {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-lg);
  font-weight: 600;
}
.priority-list li:last-child { border-bottom: none; }
.priority-list li[contenteditable="true"] { outline: none; }
.priority-list li[contenteditable="true"]:focus { color: var(--brand-ink); }
.study-subject {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-6);
  margin-bottom: var(--sp-4);
}
.study-subject h3 {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-lg);
}
.study-days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 640px) {
  .study-days { grid-template-columns: 1fr; }
}
.study-day {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  font-size: var(--fs-sm);
}
.study-day strong {
  display: block;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
.study-day span[contenteditable="true"] { outline: none; }
.study-day span[contenteditable="true"]:focus { color: var(--brand-ink); }
.checklist {
  list-style: none;
  padding: 0;
  margin: var(--sp-4) 0;
}
.checklist li {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-base);
}
.checklist li:last-child { border-bottom: none; }
.checklist label {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
}
.checklist input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex: none;
}
.planner-closing {
  font-weight: 600;
  color: var(--ink);
  margin: var(--sp-6) 0;
}
blockquote {
  border-left: 4px solid var(--brand);
  margin: var(--sp-6) 0;
  padding: var(--sp-4) var(--sp-6);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: var(--fs-lg);
  color: var(--ink);
}
blockquote p { margin: 0; }

/* ---------- Responsive prose ---------- */
@media (max-width: 640px) {
  .planner-table { font-size: var(--fs-xs); }
  .planner-table th, .planner-table td { padding: var(--sp-1) var(--sp-2); }
  .blog-article .formula-box { font-size: var(--fs-base); padding: var(--sp-3); }
}
