/* =============================================================
   pages.css: page-specific layout for dashboard, create, deck,
   account, recap and shared-deck pages. Components live in app.css.
   ============================================================= */

.ui-btn.disabled { opacity: 0.5; pointer-events: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.back-link:hover { color: var(--brand-strong); }
.search-box {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; min-width: 220px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink-muted);
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.search-box input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 0.92rem; color: var(--ink); width: 100%; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 18px 0 12px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 28px; height: 28px; border-radius: 50%; background: var(--deck); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--deck); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }

/* ================= Dashboard ================= */
.onboard { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(20px, 4vw, 48px); padding: clamp(24px, 4vw, 48px); align-items: center; overflow: hidden; position: relative; }
.onboard::after { content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, var(--brand-tint), transparent 70%); pointer-events: none; }
.onboard h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -0.025em; margin: 8px 0 12px; }
.onboard-copy p { color: var(--ink-soft); max-width: 58ch; }
.onboard-steps { list-style: none; display: flex; flex-direction: column; gap: 14px; position: relative; z-index: 1; }
.onboard-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.onboard-steps li > span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--btn-bg); color: var(--btn-ink); font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
.onboard-steps strong { display: block; font-size: 0.95rem; }
.onboard-steps p { font-size: 0.85rem; color: var(--ink-muted); }

.streak-inline { color: #d0661f; font-weight: 600; white-space: nowrap; }

/* Greeting banner over the desk-lamp photo; first-run steps over the library photo. */
.photo-head {
  position: relative; isolation: isolate; overflow: hidden; align-items: center;
  padding: clamp(22px, 3.4vw, 36px) clamp(20px, 3.4vw, 36px); border-radius: var(--r-lg, 14px);
  border: 1px solid rgba(18, 48, 43, 0.35); box-shadow: 0 10px 30px -18px rgba(7, 21, 18, 0.6);
  background: #12302b; color: #f6efd6;
}
.photo-head-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.photo-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7, 21, 18, 0.9) 0%, rgba(7, 21, 18, 0.72) 48%, rgba(7, 21, 18, 0.3) 100%);
}
.photo-head h1 { color: #fdf9ec; }
.photo-head p { color: #e2dcc2; }
.photo-head p strong { color: #fdf9ec; }
.photo-head .streak-inline { color: #f2b067; }
.onboard-side { position: relative; z-index: 1; padding: clamp(14px, 2vw, 22px); border-radius: var(--r-lg, 14px); overflow: hidden; isolation: isolate; }
.onboard-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 30% center; }
.onboard-side::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(7, 21, 18, 0.35), rgba(7, 21, 18, 0.55)); }
.onboard-side .onboard-steps li { background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.5); }
.streak-inline ion-icon { vertical-align: -2px; }
.today-grid { display: grid; grid-template-columns: 1.6fr 1fr 0.8fr; gap: 16px; }
.today-card { display: flex; align-items: center; gap: 24px; padding: 22px 24px; }
.today-card h2 { font-size: 1.3rem; margin: 2px 0 4px; }
.review-card, .streak-card { padding: 20px; display: flex; flex-direction: column; }
.review-card.has-due { background: linear-gradient(160deg, var(--surface), var(--warn-tint)); }
.review-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.review-num { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.review-num span { font-size: 0.9rem; font-weight: 500; color: var(--ink-muted); letter-spacing: 0; }
.review-card .ui-btn { margin-top: auto; }
.streak-card { align-items: flex-start; justify-content: center; }
.streak-flame { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--surface-3); color: var(--ink-muted); margin-bottom: 8px; }
.streak-flame.lit { background: linear-gradient(150deg, #ffcf7a, #e8732c); color: #fff; box-shadow: 0 6px 16px rgba(232, 115, 44, 0.35); }
.row-link { color: inherit; text-decoration: none; transition: background var(--dur) var(--ease); }
.row-link:hover { background: var(--surface-2); }
.activity-grid .heatmap { justify-content: start; }
.activity-grid > * { min-width: 0; } /* lets the heatmap scroll inside its panel on phones */

/* ================= Create ================= */
.create-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.create-options { position: sticky; top: calc(var(--header-h) + 16px); }
.step-num { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.8rem; background: var(--btn-bg); color: var(--btn-ink); }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.notes-area { min-height: 260px; line-height: 1.6; }
.narrow-form { max-width: 760px; }
.file-btn { position: relative; cursor: pointer; }

.gen-overlay { position: fixed; inset: 0; z-index: 100000001; display: grid; place-items: center; padding: 16px; background: rgba(8, 20, 16, 0.55); }
.gen-overlay[hidden] { display: none; }
.gen-card { width: min(440px, 100%); padding: 32px 28px 24px; border-radius: var(--r-xl); background: var(--surface); color: var(--ink); text-align: center; box-shadow: var(--shadow-xl); }
.gen-card h2 { font-size: 1.25rem; margin-top: 16px; }
.gen-orb { width: 72px; height: 72px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; color: #fff;
  background: conic-gradient(from 0deg, #2f6559, #3d8a7a, #3d6e5f, #6a4c93, #2f6559); animation: spin 3s linear infinite; box-shadow: 0 10px 30px rgba(61, 138, 122, 0.35); }
.gen-orb ion-icon { animation: spin 3s linear infinite reverse; }
.gen-steps { list-style: none; text-align: left; margin: 20px auto 0; display: flex; flex-direction: column; gap: 8px; max-width: 320px; font-size: 0.9rem; color: var(--ink-muted); }
.gen-steps li { display: flex; align-items: center; gap: 10px; transition: color 0.3s; }
.gen-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); flex-shrink: 0; position: relative; }
.gen-steps li.active { color: var(--ink); font-weight: 600; }
.gen-steps li.active .gen-dot { border-color: var(--brand); border-right-color: transparent; animation: spin 0.9s linear infinite; }
.gen-steps li.done { color: var(--ink-soft); }
.gen-steps li.done .gen-dot { background: var(--brand); border-color: var(--brand); }
.gen-steps li.done .gen-dot::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.review-head .title-input { font-size: clamp(1.4rem, 2.6vw, 1.9rem); padding-left: 4px; margin-left: -6px; }
.summary-box { padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.summary-box .label { margin-bottom: 6px; display: block; }
.summary-box .bullets { font-size: 0.92rem; color: var(--ink-soft); }
.review-body { padding: 18px 0 110px; }
.edit-list { display: flex; flex-direction: column; gap: 10px; }
.edit-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.edit-num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-muted); font-size: 0.78rem; font-weight: 700; flex-shrink: 0; margin-top: 6px; }
.edit-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; min-width: 0; }
.textarea.auto { min-height: 44px; resize: none; overflow: hidden; }
.textarea.front { font-weight: 600; }
.sm-input { padding: 8px 10px; font-size: 0.9rem; }
.muted-input { color: var(--ink-soft); }
.choice-edit { display: flex; align-items: center; gap: 10px; padding: 2px 4px 2px 10px; border-radius: var(--r-md); border: 1.5px solid transparent; }
.choice-edit.correct { border-color: var(--ok); background: var(--ok-tint); }
.choice-edit input[type="radio"] { accent-color: var(--ok); width: 18px; height: 18px; flex-shrink: 0; }
.choice-input { display: flex; align-items: center; gap: 8px; }
.choice-input ion-icon { font-size: 1.2rem; color: var(--bad); flex-shrink: 0; }
.choice-input.correct ion-icon { color: var(--ok); }
.cloze-preview { font-size: 0.95rem; line-height: 2; color: var(--ink-soft); padding: 4px 2px; }
.cloze-chip { display: inline-block; padding: 0 10px; margin: 0 2px; border-radius: 6px; background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; line-height: 1.6; border-bottom: 2px solid var(--brand); }
.save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; padding: 12px 0; background: var(--header-bg); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(22, 30, 20, 0.08); }
body:not(.app) .save-bar { background: rgba(255, 255, 255, 0.95); }

/* ================= Deck ================= */
.deck-hero { position: relative; display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; padding: 26px 26px 22px; margin-top: 14px; overflow: hidden; }
.deck-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--deck); }
.deck-hero-main { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.deck-hero .deck-subject { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--deck); }
.deck-title { font-size: clamp(1.5rem, 3vw, 2.1rem) !important; letter-spacing: -0.02em; margin-left: -8px; }
.deck-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.deck-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; color: var(--ink-soft); }
.deck-stat ion-icon { color: var(--ink-muted); font-size: 1.05rem; }
.deck-stat.warn { color: var(--warn); font-weight: 600; }
.deck-stat.warn ion-icon { color: var(--warn); }
.mastery { max-width: 420px; }
.mastery .bar > span { background: var(--deck); }
.deck-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.save-state { font-size: 0.78rem; color: var(--ink-muted); margin-left: auto; }
.save-state.saving { color: var(--info); }
.save-state.saved { color: var(--ok); }
.save-state.saved::before { content: "✓ "; }
.save-state.error { color: var(--bad); }
.deck-body { padding-bottom: 40px; }

.add-card { padding: 14px; margin-bottom: 14px; }
details.add-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--brand-strong); }
details.add-card > summary::-webkit-details-marker { display: none; }
.card-list { overflow: hidden; }
.card-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card-row:last-child { border-bottom: 0; }
.card-row:hover { background: var(--surface-2); }
.card-side { flex: 1 1 0; min-width: 0; font-size: 0.93rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-side.front { font-weight: 600; }
.card-side.back { color: var(--ink-soft); }
.card-extra { margin-top: 4px; font-size: 0.8rem; color: var(--ink-muted); font-style: italic; }
.card-meta { flex-shrink: 0; padding-top: 1px; }
.card-actions { display: flex; gap: 2px; flex-shrink: 0; opacity: 0.55; transition: opacity var(--dur); }
.card-row:hover .card-actions, .card-actions:focus-within { opacity: 1; }
.quiz-q { font-weight: 600; font-size: 0.95rem; }
.quiz-choices { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.quiz-choice { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 8px; background: var(--surface-3); font-size: 0.84rem; color: var(--ink-soft); }
.quiz-choice.correct { background: var(--ok-tint); color: var(--ok); font-weight: 600; }
.pick-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line); cursor: pointer; font-size: 0.9rem; color: var(--ink); }
.pick-row:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.pick-row input { margin-top: 4px; accent-color: var(--brand); }
.notes-grid { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); align-items: start; margin-top: 18px; }
.share-link { min-height: 40px; }

/* ================= Account ================= */
.account-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.account-nav { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.92rem; }
.account-nav a:hover { background: var(--surface-3); color: var(--ink); }
.account-section { scroll-margin-top: calc(var(--header-h) + 16px); }
.account-section + .account-section { margin-top: 20px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }

/* ================= Recap ================= */
.recap-hero { text-align: center; padding: clamp(28px, 5vw, 48px) 24px; position: relative; overflow: hidden; }
.recap-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; margin: 12px 0 6px; }
.recap-badge { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 2.2rem; color: #fff; background: linear-gradient(150deg, #4d8273, #12302b); box-shadow: 0 12px 30px rgba(60, 52, 28, 0.35); }
.recap-badge.partial { background: linear-gradient(150deg, #e6b65a, #b7791f); }
.recap-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.recap-stats .stat { background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--line); text-align: left; }
.method-breakdown { display: flex; flex-direction: column; gap: 10px; }
.method-line { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.method-line .list-icon { width: 34px; height: 34px; font-size: 1rem; }
.stars { display: inline-flex; gap: 4px; }
.stars button { background: none; border: 0; font-size: 1.8rem; color: var(--line-strong); cursor: pointer; padding: 2px; line-height: 1; transition: transform 0.12s, color 0.12s; }
.stars button.on { color: #e3a325; }
.stars button:hover { transform: scale(1.15); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100000003; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0.6; } }

/* ================= Shared deck (public) ================= */
.shared-hero { padding: clamp(24px, 4vw, 40px); }
.shared-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mini-card { padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); font-size: 0.9rem; }
.mini-card strong { display: block; margin-bottom: 4px; }
.mini-card span { color: var(--ink-soft); }

/* ================= Responsive ================= */
@media (max-width: 1080px) {
  .today-grid { grid-template-columns: 1fr 1fr; }
  .today-card { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .create-grid { grid-template-columns: 1fr; }
  .create-options { position: static; }
  .onboard { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-nav { position: static; flex-direction: row; overflow-x: auto; }
  .recap-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .today-grid { grid-template-columns: 1fr; }
  .today-card { flex-direction: column; text-align: center; }
  .today-card .row { justify-content: center; }
  .edit-pair { grid-template-columns: 1fr; }
  .card-row { flex-wrap: wrap; }
  .card-side { flex-basis: 100%; }
  .card-actions { opacity: 1; margin-left: auto; }
  .deck-hero-actions { width: 100%; }
  .deck-hero-actions .ui-btn.lg { flex: 1; }
  .search-box { min-width: 0; width: 100%; }
  .save-bar .container { flex-direction: column; align-items: stretch; }
}

/* ================= Science ================= */
.science-tldr .tldr-list { padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.science-tldr .tldr-list li::marker { color: var(--brand); font-weight: 700; }
.science-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.science-toc a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; font-size: 0.84rem; font-weight: 500; }
.science-toc a:hover { border-color: var(--brand); color: var(--brand-strong); }
.science-toc ion-icon { color: var(--brand); }
.science-item { margin-top: 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.science-item h2 { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; line-height: 1.3; }
.science-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-strong); flex-shrink: 0; font-size: 1.25rem; }
.science-summary { margin: 10px 0 14px; font-size: 1rem; }
.science-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.science-grid > div { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.science-grid .label { display: block; margin-bottom: 4px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
.science-grid p { font-size: 0.9rem; color: var(--ink-soft); }
.science-sources { margin-top: 12px; font-size: 0.86rem; }
.science-sources summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; }
.science-sources ul { margin: 8px 0 0 1.2em; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) { .science-grid { grid-template-columns: 1fr; } }

/* Recap: goal check + calibration */
.goal-check .goal-text { font-size: 1.05rem; font-weight: 600; margin-top: 4px; }
.goal-check .eyebrow ion-icon { vertical-align: -2px; }
.calib-bars { display: flex; flex-direction: column; gap: 10px; }
.calib-row { display: grid; grid-template-columns: 80px 1fr 150px; gap: 12px; align-items: center; }
.calib-label { font-size: 0.86rem; font-weight: 600; }
.why-link { color: var(--brand-strong); font-weight: 600; text-decoration: none; }
.why-link:hover { text-decoration: underline; }
@media (max-width: 560px) { .calib-row { grid-template-columns: 70px 1fr; } .calib-row > span:last-child { grid-column: 2; } }

/* ================= Exams ================= */
.exam-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 24px; }
.exam-hero h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; }
.exam-count { width: 112px; height: 112px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #12302b, #7d7650); color: #fff; box-shadow: 0 10px 26px rgba(47, 111, 105, 0.3); flex-shrink: 0; text-align: center; }
.exam-days { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.exam-days-label { font-size: 0.72rem; opacity: 0.9; margin-top: 4px; }
.exam-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: start; }
.weak-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.weak-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 0.86rem; }
.plan-days { list-style: none; padding: 12px 20px 20px; display: flex; flex-direction: column; }
.plan-day { display: flex; gap: 14px; position: relative; padding: 10px 0 14px; }
.plan-day::before { content: ""; position: absolute; left: 10px; top: 32px; bottom: -4px; width: 2px; background: var(--line); }
.plan-day:last-child::before { display: none; }
.plan-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); flex-shrink: 0; margin-top: 2px; display: grid; place-items: center; color: #fff; font-size: 0.8rem; position: relative; z-index: 1; }
.plan-day.today .plan-dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.plan-day.done .plan-dot { background: var(--ok); border-color: var(--ok); }
.plan-day.phase-final .plan-dot { border-color: var(--warn); }
.plan-day.done strong { color: var(--ink-muted); }
.exam-decks { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.exam-decks .pick-row { align-items: center; }
.if-then { padding: 14px; border-radius: var(--r-md); background: var(--brand-tint); }
.if-then .label { display: flex; align-items: center; gap: 6px; }
.if-then-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-weight: 500; color: var(--ink); }
.if-then-sentence .input, .if-then-sentence .select { width: auto; min-width: 120px; flex: 0 1 auto; padding: 7px 10px; }

/* Dashboard: exams + insights */
.exam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.exam-card { display: flex; gap: 14px; padding: 16px; align-items: center; text-decoration: none; color: inherit; transition: transform var(--dur), box-shadow var(--dur); }
.exam-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.exam-mini-count { width: 58px; height: 58px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--brand-tint); color: var(--brand-strong); font-weight: 700; font-size: 1.4rem; line-height: 1; }
.exam-mini-count span { font-size: 0.62rem; font-weight: 600; margin-top: 3px; }
.exam-mini-count.soon { background: var(--warn-tint); color: var(--warn); }
.insights-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.insight { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.insight .stat-label { font-size: 0.8rem; color: var(--ink-muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.insight .stat-label ion-icon { color: var(--brand); font-size: 1.05rem; }
.insight .big { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.forecast { display: flex; align-items: flex-end; gap: 4px; height: 52px; margin-top: 4px; }
.forecast .fc-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.forecast .fc-bar i { display: block; width: 100%; min-height: 3px; border-radius: 4px 4px 2px 2px; background: var(--brand); opacity: 0.85; }
.forecast .fc-bar span { font-size: 0.62rem; color: var(--ink-muted); }
.struggle-list { list-style: none; display: flex; flex-direction: column; }
.struggle-list li { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.struggle-list li:last-child { border-bottom: 0; }
@media (max-width: 1080px) { .insights-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .exam-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .insights-grid { grid-template-columns: 1fr; } }
.retention-field input[type="range"] { width: 100%; accent-color: var(--brand); }

/* ---------------- Recap: research-based tools ---------------- */
.mock-score { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.mock-score strong { font-size: 2rem; letter-spacing: -0.02em; }
.tool-line { display: flex; gap: 10px; align-items: flex-start; }
.tool-line .list-icon { flex-shrink: 0; }
