/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --text: #182524;
  --text-muted: #5c6e6b;
  --text-faint: #8a9a97;
  --border: #dde8e4;
  --border-strong: #c7d6d1;

  --primary: #2f7d6b;
  --primary-dark: #235f52;
  --primary-light: #e4f0ec;
  --accent: #3b6ea5;
  --accent-light: #e6eef7;

  --pass: #2f9e6b;
  --pass-bg: #e5f5ec;
  --warn: #c98a1f;
  --warn-bg: #fbf1de;
  --fail: #cf4635;
  --fail-bg: #fbe9e6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 3px rgba(24, 37, 36, 0.06), 0 1px 2px rgba(24, 37, 36, 0.05);
  --shadow: 0 8px 24px rgba(24, 37, 36, 0.08), 0 2px 6px rgba(24, 37, 36, 0.05);
  --shadow-lg: 0 20px 45px rgba(24, 37, 36, 0.12), 0 6px 12px rgba(24, 37, 36, 0.06);

  --sans: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1715;
    --surface: #16211f;
    --surface-2: #1c2926;
    --text: #eaf2f0;
    --text-muted: #a3b6b2;
    --text-faint: #6d8480;
    --border: #263733;
    --border-strong: #33473f;

    --primary: #4fae97;
    --primary-dark: #6bc4ac;
    --primary-light: #1c3833;
    --accent: #7aa8dc;
    --accent-light: #1d2c3d;

    --pass: #52c58a;
    --pass-bg: #16302322;
    --warn: #e0ab4f;
    --warn-bg: #2f2312;
    --fail: #e46a5a;
    --fail-bg: #34211d;

    color-scheme: dark;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; font-weight: 700; }
::selection { background: var(--primary); color: #fff; }
input, select { font: inherit; color: inherit; }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 1.1rem;
}
.container--narrow { max-width: 760px; }

.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;
}

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-head { text-align: center; max-width: 620px; margin-inline: auto; margin-bottom: clamp(1.8rem, 4vw, 2.6rem); }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary); margin-bottom: .5rem;
}
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .6rem; }
.section-head p { color: var(--text-muted); font-size: 1.02rem; }

/* =============================================================
   4. Typography
   ============================================================= */
.hero-title { font-size: clamp(1.9rem, 5vw, 3rem); max-width: 16ch; margin-inline: auto; }
.hero-subtitle { color: var(--text-muted); font-size: clamp(1rem, 2vw, 1.15rem); max-width: 46ch; margin: .9rem auto 0; }

/* =============================================================
   5. Components
   ============================================================= */

/* --- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.3rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out), color .18s var(--ease-out);
  white-space: nowrap; min-height: 44px;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }
.btn-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: .5rem .9rem; font-size: .84rem; min-height: 36px; }
.btn-icon { padding: .55rem; border-radius: 10px; min-height: 40px; min-width: 40px; }
.btn-icon:hover { background: var(--surface-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* --- card --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* --- header --- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-block: .8rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.brand-mark svg { width: 19px; height: 19px; }
.header-actions { display: flex; align-items: center; gap: .5rem; }

/* --- system switcher (segmented control) --- */
.system-switch {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.system-switch button {
  padding: .45rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--text-muted); transition: background .2s var(--ease-out), color .2s var(--ease-out), box-shadow .2s var(--ease-out);
  min-height: 36px;
}
.system-switch button.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.system-switch button:hover:not(.is-active) { color: var(--text); }

/* --- summary bar --- */
.summary {
  display: grid; gap: 1rem;
  grid-template-columns: auto 1fr;
  align-items: center;
  padding: 1.3rem 1.4rem;
}
.summary-ring-wrap { display: flex; align-items: center; gap: 1rem; }
.summary-text .summary-label { font-size: .82rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.summary-text .summary-value { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; }
.summary-stats { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; justify-content: flex-end; }
.summary-stat { text-align: right; }
.summary-stat .n { font-size: 1.3rem; font-weight: 800; display: block; }
.summary-stat .l { font-size: .76rem; color: var(--text-muted); }
.summary-empty { color: var(--text-muted); font-size: .95rem; text-align: center; padding-block: .3rem; }

/* --- progress ring --- */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .ring-track { stroke: var(--surface-2); }
.ring .ring-value {
  stroke: var(--pass);
  transition: stroke-dashoffset .7s var(--ease-soft), stroke .35s var(--ease-out);
}
.ring.is-fail .ring-value { stroke: var(--fail); }
.ring.is-warn .ring-value { stroke: var(--warn); }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.ring-center .val { font-weight: 800; line-height: 1; }
.ring-center .max { font-size: .68em; color: var(--text-muted); font-weight: 600; }
.ring.pulse .ring-value, .ring.pulse .ring-center { animation: ringPulse .5s var(--ease-out); }
@keyframes ringPulse { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* --- subject cards grid --- */
.subjects-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
}
.subject-card {
  padding: 1.3rem 1.3rem 1.5rem;
  border-top: 4px solid var(--subject-color, var(--primary));
  animation: cardIn .35s var(--ease-out);
  position: relative;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

.subject-head { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; }
.subject-name-input {
  font-size: 1.15rem; font-weight: 800; background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: .3rem .4rem; flex: 1; min-width: 0;
  transition: background .15s var(--ease-out), border-color .15s var(--ease-out);
}
.subject-name-input:hover, .subject-name-input:focus { background: var(--surface-2); border-color: var(--border); }

.color-dots { display: flex; gap: .35rem; flex-wrap: wrap; }
.color-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent;
  transition: transform .15s var(--ease-bounce), border-color .15s var(--ease-out);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot.is-active { border-color: var(--text); }

.subject-body { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.subject-main { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.subject-metrics { display: flex; flex-direction: column; gap: .45rem; flex: 1; min-width: 160px; }

.weight-meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.weight-meter-fill { height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s var(--ease-soft), background .3s var(--ease-out); }
.weight-meter-label { font-size: .82rem; color: var(--text-muted); }
.weight-meter-label strong { color: var(--text); }

.weight-warn {
  font-size: .82rem; padding: .5rem .7rem; border-radius: var(--radius-sm);
  background: var(--warn-bg); color: var(--warn); display: none; align-items: center; gap: .4rem;
  animation: fadeIn .25s var(--ease-out);
}
.weight-warn.is-visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- grade rows --- */
.grades-list { display: flex; flex-direction: column; gap: .55rem; }
.grade-row {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .6rem .7rem; border-radius: var(--radius-sm); background: var(--surface-2);
  animation: rowIn .3s var(--ease-out);
}
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.grade-row.is-pending { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.grade-row-controls { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

.grade-name-input {
  background: transparent; border: 1px solid transparent; border-radius: 6px;
  padding: .4rem .5rem; font-weight: 600; font-size: .92rem; min-width: 0; width: 100%;
}
.grade-name-input:hover, .grade-name-input:focus { background: var(--surface); border-color: var(--border); }

.grade-field { display: flex; align-items: center; gap: .3rem; }
.row-actions { margin-left: auto; }
.grade-field label { font-size: .72rem; color: var(--text-faint); }
.num-input {
  width: 4.2rem; padding: .45rem .5rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); text-align: center; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s;
}
.num-input:focus { border-color: var(--primary); }
.num-input:disabled { opacity: .45; }
.weight-input { width: 3.6rem; }
.letter-select {
  padding: .45rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-weight: 700;
}
.letter-select:disabled { opacity: .45; }

.pending-toggle {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-muted);
  padding: .4rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  min-height: 34px; white-space: nowrap;
}
.pending-toggle input { accent-color: var(--primary); width: 15px; height: 15px; }
.pending-toggle.is-on { background: var(--accent-light); color: var(--accent); border-color: transparent; }

.row-actions { display: flex; gap: .2rem; }
.row-delete { color: var(--text-faint); }
.row-delete:hover { color: var(--fail); }

.subject-foot { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; margin-top: .3rem; }
.subject-foot-left { display: flex; gap: .5rem; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700;
  padding: .3rem .65rem; border-radius: 999px;
}
.badge-pass { background: var(--pass-bg); color: var(--pass); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-fail { background: var(--fail-bg); color: var(--fail); }

/* --- goal (objetivo) panel --- */
.goal-panel {
  margin-top: 1rem; padding: 1.1rem; border-radius: var(--radius); background: var(--surface-2);
  border: 1px dashed var(--border-strong); display: none;
}
.goal-panel.is-open { display: block; animation: fadeIn .25s var(--ease-out); }
.goal-shortcuts { display: flex; flex-wrap: wrap; gap: .45rem; margin: .7rem 0; }
.goal-chip {
  padding: .45rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
  min-height: 36px;
}
.goal-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.goal-custom { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; }
.goal-custom .num-input { width: 5rem; }

.goal-result {
  margin-top: 1rem; padding: 1rem; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border);
}
.goal-result-headline { font-size: 1.02rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.goal-result.state-ok .goal-result-headline { color: var(--pass); }
.goal-result.state-impossible .goal-result-headline { color: var(--fail); }
.goal-result.state-guaranteed .goal-result-headline { color: var(--pass); }
.goal-result-detail { color: var(--text-muted); font-size: .9rem; margin-top: .35rem; }
.goal-result.unlocked { animation: unlockPop .5s var(--ease-bounce); }
@keyframes unlockPop { 0% { transform: scale(.96); opacity: .5; } 100% { transform: scale(1); opacity: 1; } }

.sim-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .8rem; }
.sim-item { display: flex; flex-direction: column; gap: .35rem; }
.sim-item-head { display: flex; justify-content: space-between; font-size: .86rem; font-weight: 600; }
.sim-item-head .sim-value { color: var(--primary); font-variant-numeric: tabular-nums; }
.slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--pct, 50%), var(--border) var(--pct, 50%), var(--border) 100%);
  outline: none; touch-action: pan-y;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--primary); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease-out);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--primary); cursor: pointer; box-shadow: var(--shadow-sm);
}
.sim-final { margin-top: .3rem; font-size: .88rem; color: var(--text-muted); }
.sim-final strong { color: var(--text); }

/* --- add subject / add grade --- */
.add-grade-row { display: flex; justify-content: flex-start; margin-top: .3rem; }
.add-subject-card {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .6rem;
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); min-height: 180px;
  color: var(--text-muted); font-weight: 700; transition: border-color .2s, color .2s, background .2s;
}
.add-subject-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* --- export bar --- */
.export-bar { display: flex; justify-content: center; gap: .7rem; margin-top: 1.6rem; flex-wrap: wrap; }
.export-menu { position: relative; display: inline-block; }
.export-dropdown {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(-6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: .4rem; display: none; flex-direction: column; gap: .2rem;
  min-width: 220px; z-index: 30; opacity: 0; transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
}
.export-dropdown.is-open { display: flex; opacity: 1; transform: translateX(-50%) translateY(0); }
.export-dropdown button {
  padding: .6rem .7rem; border-radius: 8px; text-align: left; font-size: .9rem; font-weight: 600;
  display: flex; align-items: center; gap: .5rem;
}
.export-dropdown button:hover { background: var(--surface-2); }
.export-dropdown .hint { font-size: .74rem; color: var(--text-faint); font-weight: 400; display: block; }

/* --- privacy / limits note --- */
.privacy-note {
  display: flex; align-items: center; gap: .5rem; justify-content: center; margin-top: 1.2rem;
  color: var(--text-muted); font-size: .86rem; text-align: center; flex-wrap: wrap;
}
.privacy-note svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--primary); }

/* --- ad slots --- */
.ad-slot {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; color: var(--text-faint);
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface-2);
}
.ad-slot span { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.ad-slot small { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .7rem; }
.ad-banner { min-height: 100px; margin-block: 2rem; }
.ad-incontent { min-height: 250px; max-width: 600px; margin: 2.4rem auto; }
.ad-inline { min-height: 90px; }
.ad-corner {
  position: fixed; bottom: 14px; right: 14px; width: 260px; min-height: 90px; z-index: 45;
  box-shadow: var(--shadow-lg); background: var(--surface); opacity: 0; transform: translateY(16px);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out); pointer-events: none;
}
.ad-corner.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.ad-corner-close {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); font-size: .8rem; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; z-index: 2;
}

/* --- how it works --- */
.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 2rem; }
.step { padding: 1.2rem; }
.step-num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: .7rem;
}
.step h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.step p { color: var(--text-muted); font-size: .92rem; }

.example-box { padding: 1.3rem; }
.example-box h3 { font-size: 1rem; margin-bottom: .8rem; }
.example-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.example-table th, .example-table td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--border); }
.example-table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.example-table tfoot td { font-weight: 800; border-bottom: none; padding-top: .8rem; }
.example-note { margin-top: .8rem; color: var(--text-muted); font-size: .88rem; background: var(--primary-light); padding: .7rem .9rem; border-radius: var(--radius-sm); }

/* --- faq --- */
.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item summary {
  padding: 1.05rem 1.2rem; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .98rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { transition: transform .25s var(--ease-out); flex-shrink: 0; color: var(--text-muted); }
.faq-item[open] summary .chev { transform: rotate(180deg); }
.faq-item .faq-a { padding: 0 1.2rem 1.15rem; color: var(--text-muted); font-size: .92rem; line-height: 1.65; }

/* --- footer --- */
.site-footer { border-top: 1px solid var(--border); padding-block: 2.2rem; margin-top: 1rem; color: var(--text-muted); font-size: .88rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.2rem; align-items: center; }
.footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-links a:hover { color: var(--primary); }

/* --- toast --- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: .7rem 1.2rem; border-radius: 999px;
  font-size: .88rem; font-weight: 600; opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =============================================================
   6. Sections
   ============================================================= */
.hero { padding-block: clamp(2rem, 5vw, 3.2rem) 1rem; text-align: center; }

.tool-section { padding-block: 1rem 0; }
.summary-card { margin-bottom: 1.4rem; }
.system-row { display: flex; justify-content: center; margin-bottom: 1.6rem; }

/* =============================================================
   7. Responsive (mobile-first)
   ============================================================= */
@media (min-width: 540px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 720px) {
  .subjects-grid { grid-template-columns: repeat(2, 1fr); }
  .subject-main { flex-wrap: nowrap; }
}

@media (min-width: 960px) {
  .summary { grid-template-columns: auto 1fr; padding: 1.6rem 1.8rem; }
}

@media (min-width: 1280px) {
  .subjects-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================================
   8. Reduced-motion (only intrusive effects)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .ad-corner { transition: none; }
  .subject-card { animation: none; }
  .grade-row { animation: none; }
}
