/* ============================================================
   Spanish in Real Life — design system
   Spanish-flag palette, kept adult and restrained: deep wine-red
   primary, brighter crimson accent, warm tan secondary, gold used
   sparingly as a highlight rather than a fill.
   ============================================================ */

:root {
  /* palette */
  --ink: #2a1815;
  --ink-soft: #6e5c50;
  --ivory: #f9f0e0;
  --ivory-deep: #f1e2c4;
  --card: #fffaf2;
  --border: #ecd9b8;
  --border-soft: #f3e6cd;

  /* primary — deep wine-red (darkest of the flag reds, replaces rust) */
  --blue: #b50a24;
  --blue-deep: #8c0d1c;
  --blue-tint: #f7e2e2;

  /* accent — brighter flag crimson, with the deep red doing double duty as its deep shade */
  --terracotta: #b20525;
  --terracotta-deep: #8c0d1c;
  --terracotta-tint: #f6dfdc;

  /* secondary — warm tan/wheat, standing in for the old olive/sage role */
  --olive: #8a6a3c;
  --olive-deep: #6b4f2a;
  --sage: #dfb87a;
  --olive-tint: #f7ecd9;

  /* highlight — flag gold, used sparingly (small accents, not fills) */
  --gold: #97730f;
  --gold-mid: #f5c029;
  --gold-tint: #fbeecb;

  /* soft extra tint — light tan, for accent borders */
  --peach: #dfb87a;

  --shadow-sm: 0 1px 2px rgba(42, 24, 21, 0.07);
  --shadow-md: 0 6px 20px rgba(140, 13, 28, 0.10);
  --shadow-lg: 0 16px 40px rgba(140, 13, 28, 0.16);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font-display: "Fraunces", Georgia, "Iowan Old Style", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }

p { margin: 0; }

button { font-family: inherit; }

.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ---------- App shell ---------- */

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ivory);
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 84px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, var(--ivory) 78%, rgba(249, 240, 224, 0));
  backdrop-filter: blur(6px);
}

.topbar__back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}
.topbar__back:active { transform: scale(0.94); }

.topbar__titles { min-width: 0; flex: 1; }
.topbar__eyebrow {
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--olive-deep);
  font-weight: 600;
  margin-bottom: 2px;
}
.topbar__title {
  font-size: 20px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen { padding: 4px 16px 28px; animation: fadeIn 0.22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }

/* ---------- Bottom nav ---------- */

.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: calc(100% - 32px);
  max-width: 528px;
  background: var(--blue-deep);
  border-radius: 999px;
  display: flex;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 30;
}
.bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 6px 8px;
  border-radius: 999px;
  color: rgba(249, 240, 224, 0.62);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.bottomnav__item.is-active {
  color: var(--ivory);
  background: rgba(249, 240, 224, 0.14);
}
.bottomnav__item .icon { width: 20px; height: 20px; }

/* ---------- Home ---------- */

.home-hero {
  padding: 10px 2px 22px;
}
.home-hero h1 {
  font-size: 28px;
  line-height: 1.22;
  color: var(--blue-deep);
  max-width: 20ch;
}
.home-hero__sub {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 34ch;
}

.going-now {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  background: linear-gradient(120deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--ivory);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
}
.going-now__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(249, 240, 224, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.going-now__icon .icon { width: 22px; height: 22px; }
.going-now__text { flex: 1; }
.going-now__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-tint); opacity: 0.9; font-weight: 600; }
.going-now__title { font-family: var(--font-display); font-size: 17px; margin-top: 2px; }
.going-now .icon.chev { color: rgba(249,240,224,0.7); }

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--olive-deep);
  margin: 4px 2px 12px;
}

.situation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.situation-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 16px 14px 14px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.situation-card.is-active {
  background: linear-gradient(150deg, var(--terracotta-tint) 0%, var(--card) 65%);
  border-color: var(--peach);
}
.situation-card.is-disabled {
  opacity: 0.62;
  cursor: default;
}
.situation-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  background: var(--blue-tint);
  margin-bottom: 14px;
}
.situation-card.is-active .situation-card__icon {
  color: var(--terracotta-deep);
  background: #fff;
}
.situation-card__title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}
.situation-card__tag {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.situation-card.is-active .situation-card__tag { color: var(--terracotta-deep); font-weight: 600; }

.badge-soon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--ivory-deep);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 3px 8px;
}

/* ---------- Padel module home ---------- */

.module-hero {
  padding: 6px 2px 18px;
}
.module-hero__sub { color: var(--ink-soft); font-size: 14px; margin-top: 6px; line-height: 1.5; max-width: 40ch; }

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  background: var(--olive-tint);
  color: var(--olive-deep);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.refresher-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px dashed var(--gold-mid);
  background: var(--gold-tint);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  margin: 16px 0 20px;
  cursor: pointer;
  color: var(--blue-deep);
  text-align: left;
}
.refresher-cta .icon { color: var(--gold); }
.refresher-cta__title { font-weight: 700; font-size: 14px; }
.refresher-cta__sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }

.section-list { display: flex; flex-direction: column; gap: 10px; }

.section-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 14px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.section-row__num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.section-row__body { flex: 1; min-width: 0; }
.section-row__title { font-weight: 600; font-size: 15px; }
.section-row__sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.section-row__meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.section-row__count { font-size: 11.5px; color: var(--olive-deep); font-weight: 600; background: var(--olive-tint); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.section-row .icon.chev { color: var(--border); }

/* ---------- Section detail ---------- */

.section-intro { margin: 4px 2px 16px; }
.section-intro__sub { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

.mode-tabs {
  display: flex;
  gap: 4px;
  margin: 6px 2px 18px;
  background: var(--ivory-deep);
  padding: 4px;
  border-radius: 999px;
}
.mode-tabs__btn {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 4px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mode-tabs__btn.is-active { background: var(--blue-deep); color: var(--ivory); box-shadow: var(--shadow-sm); }

/* ---------- Learn card ---------- */

.card-list { display: flex; flex-direction: column; gap: 12px; }

.learn-card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.learn-card.is-got-it { border-color: var(--sage); background: linear-gradient(160deg, var(--olive-tint) 0%, var(--card) 60%); }

.learn-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.status-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.status-tag--practice { background: var(--terracotta-tint); color: var(--terracotta-deep); }
.status-tag--known { background: var(--olive-tint); color: var(--olive-deep); }
.learn-card__es { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--blue-deep); line-height: 1.35; }
.learn-card__alt { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; font-style: italic; }
.learn-card__en { font-size: 14px; color: var(--ink); margin-top: 6px; }
.learn-card__note { font-size: 12px; color: var(--olive-deep); margin-top: 8px; background: var(--olive-tint); padding: 7px 10px; border-radius: var(--radius-sm); line-height: 1.4; }

.learn-card__example {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2.5px solid var(--terracotta);
  background: var(--terracotta-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.learn-card__example-es { font-size: 13.5px; color: var(--terracotta); font-weight: 600; }
.learn-card__example-en { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.learn-card__actions { display: flex; gap: 8px; margin-top: 14px; }

.pill-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--ivory);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.pill-btn .icon { width: 16px; height: 16px; }
.pill-btn:active { transform: scale(0.96); }
.pill-btn.is-listen { color: var(--blue); }
.pill-btn.is-save.is-on { background: var(--gold-tint); border-color: var(--gold-mid); color: var(--gold); }
.pill-btn.is-gotit { margin-left: auto; }
.pill-btn.is-gotit.is-on { background: var(--olive); border-color: var(--olive); color: #fff; }

/* ---------- vocab chips (positioning, score vocab) ---------- */

.vocab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.vocab-chip {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vocab-chip__text { min-width: 0; }
.vocab-chip__es { font-weight: 700; font-size: 14px; color: var(--blue-deep); }
.vocab-chip__en { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.vocab-chip__btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--ivory); display: flex; align-items: center; justify-content: center; color: var(--blue); flex-shrink: 0; cursor: pointer; }
.vocab-chip__btn .icon { width: 15px; height: 15px; }

/* ---------- Score ladder ---------- */

.scoreboard {
  background: var(--blue-deep);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin: 6px 0 22px;
  box-shadow: var(--shadow-md);
}
.scoreboard__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
}
.scoreboard__row + .scoreboard__row { border-top: 1px solid rgba(249,240,224,0.08); }
.scoreboard__score { color: rgba(249,240,224,0.62); font-size: 12.5px; font-weight: 600; min-width: 108px; }
.scoreboard__es { color: var(--ivory); font-family: var(--font-display); font-size: 16.5px; font-weight: 600; text-align: right; flex: 1; }
.scoreboard__note { display: block; font-size: 10.5px; color: var(--gold-tint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.scoreboard__row.is-deuce { background: rgba(245, 192, 41, 0.18); }

/* ---------- Recall / Listen / Respond drill ---------- */

.practice-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.practice-progress { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }

.flash-wrap { display: flex; flex-direction: column; align-items: center; padding: 10px 0 8px; }

.flashcard {
  width: 100%;
  min-height: 220px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 22px;
}
.flashcard__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--olive-deep); font-weight: 700; margin-bottom: 14px; }

.listen-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(120deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.listen-play-btn .icon { width: 30px; height: 30px; }
.listen-play-btn:active { transform: scale(0.96); }
.flashcard__prompt { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--blue-deep); line-height: 1.3; }
.flashcard__answer { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-soft); width: 100%; font-size: 17px; color: var(--terracotta); font-weight: 600; }
.flashcard__hint { margin-top: 16px; font-size: 12px; color: var(--ink-soft); }

.flash-actions { display: flex; gap: 10px; width: 100%; margin-top: 18px; }
.flash-actions .pill-btn { flex: 1; justify-content: center; padding: 12px; font-size: 13px; }
.flash-actions .is-still { color: var(--terracotta); }
.flash-actions .is-gotit-btn { background: var(--olive); border-color: var(--olive); color: #fff; }

.practice-done { text-align: center; padding: 50px 10px; }
.practice-done .icon { width: 46px; height: 46px; color: var(--olive); margin-bottom: 14px; }
.practice-done h3 { font-size: 20px; color: var(--blue-deep); }
.practice-done p { margin-top: 8px; color: var(--ink-soft); font-size: 14px; }

/* ---------- Quick Practice ---------- */

.refresher-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gold-tint);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 4px 0 20px;
  color: var(--blue-deep);
}
.refresher-timer .icon { color: var(--gold); }
.refresher-timer strong { font-size: 14px; }
.refresher-timer span { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 1px; }

/* ---------- Saved ---------- */

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .icon { width: 40px; height: 40px; color: var(--border); margin-bottom: 14px; }
.empty-state h3 { color: var(--blue-deep); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; line-height: 1.5; }

/* ---------- misc ---------- */

.divider { height: 1px; background: var(--border-soft); margin: 22px 0; }

@media (min-width: 420px) {
  .home-hero h1 { font-size: 30px; }
}

/* ---------- Personalized learning system ---------- */

.kicker {
  color: var(--terracotta-deep);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.source-card {
  min-height: 164px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.source-card--moment { background: linear-gradient(145deg, #fffaf2, #f8dedb); }
.source-card--watch { background: linear-gradient(145deg, #fffaf2, #f9e9bd); }
.source-card__icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--card); color: var(--blue-deep); margin-bottom: auto; box-shadow: var(--shadow-sm); }
.source-card strong { font-family: var(--font-display); font-size: 1.05rem; margin-top: 18px; }
.source-card > span:last-child { color: var(--ink-soft); font-size: .84rem; line-height: 1.35; margin-top: 4px; }

.today-practice { width: 100%; display: flex; align-items: center; gap: 14px; border: 0; border-radius: var(--radius-lg); background: var(--blue-deep); color: var(--ivory); padding: 15px 16px; text-align: left; cursor: pointer; box-shadow: var(--shadow-md); margin: 4px 0 16px; }
.today-practice > div { width: 42px; height: 42px; border-radius: 13px; background: rgba(255,255,255,.12); display: grid; place-items: center; }
.today-practice span { display: flex; flex-direction: column; gap: 2px; }
.today-practice small { color: var(--gold-tint); font-size: .78rem; }
.today-practice strong { font-size: .98rem; }

.dashboard-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 4px 0 24px; }
.dashboard-stats button { border: 1px solid var(--border-soft); background: var(--card); border-radius: var(--radius-md); padding: 11px 7px; cursor: pointer; color: var(--ink); }
.dashboard-stats strong, .dashboard-stats span { display: block; }
.dashboard-stats strong { color: var(--blue-deep); font-family: var(--font-display); font-size: 1.25rem; }
.dashboard-stats span { color: var(--ink-soft); font-size: .72rem; margin-top: 2px; }

.foundation-list { display: flex; flex-direction: column; gap: 10px; }
.foundation-card { width: 100%; display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--card); color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.foundation-card__icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: var(--blue-tint); color: var(--blue-deep); display: grid; place-items: center; }
.foundation-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.foundation-card strong { font-size: .95rem; }
.foundation-card small { color: var(--ink-soft); font-size: .8rem; }
.foundation-card .chev { color: var(--ink-soft); }
.foundation-card.is-muted { cursor: default; opacity: .62; box-shadow: none; }
.foundation-card em { font-size: .72rem; color: var(--ink-soft); font-style: normal; text-transform: uppercase; letter-spacing: .06em; }

.segmented { display: flex; background: var(--ivory-deep); border-radius: 999px; padding: 4px; margin: 2px 0 22px; }
.segmented button { flex: 1; border: 0; border-radius: 999px; padding: 10px 8px; background: transparent; color: var(--ink-soft); font-weight: 700; cursor: pointer; }
.segmented button.is-active { background: var(--card); color: var(--blue-deep); box-shadow: var(--shadow-sm); }
.capture-intro h1, .workflow-intro h1, .library-head h1, .practice-setup h1 { color: var(--blue-deep); font-size: 1.65rem; line-height: 1.2; }
.capture-intro p, .workflow-intro p, .library-head p, .practice-setup > p { color: var(--ink-soft); font-size: .93rem; line-height: 1.5; margin-top: 7px; }
.auto-save-note { display: flex; align-items: center; gap: 5px; color: var(--olive-deep); font-size: .78rem; font-weight: 700; margin: 13px 0; }
.auto-save-note .icon { width: 15px; height: 15px; }

.form-stack, .item-editor { display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: .86rem; font-weight: 700; color: var(--ink); }
.field > span small { color: var(--ink-soft); font-weight: 500; }
.field input, .field textarea, .field select, .code-box { width: 100%; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); padding: 12px 13px; font: inherit; font-size: 1rem; line-height: 1.45; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .code-box:focus { outline: 3px solid rgba(181,10,36,.12); border-color: var(--blue); }
.capture-actions { display: flex; flex-direction: column; gap: 9px; margin: 18px 0; }
.primary-btn, .secondary-btn, .danger-btn, .file-btn, .listen-inline { min-height: 44px; border-radius: 999px; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.primary-btn { border: 1px solid var(--blue-deep); background: var(--blue-deep); color: #fff; }
.primary-btn:disabled { opacity: .45; cursor: default; }
.secondary-btn { border: 1px solid var(--border); background: var(--card); color: var(--blue-deep); }
.danger-btn { border: 1px solid #d9a5a5; background: #fff5f5; color: #9c1f28; margin-top: 10px; }
.listen-inline { align-self: flex-start; border: 1px solid var(--border); background: var(--ivory); color: var(--blue-deep); }
.listen-inline:disabled { opacity: .4; }
.quiet-card { border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: rgba(255,250,242,.65); padding: 15px; margin-top: 18px; }
.quiet-card strong { font-size: .9rem; }
.quiet-card p { color: var(--ink-soft); font-size: .84rem; line-height: 1.5; margin-top: 4px; }
.text-btn { border: 0; background: transparent; color: var(--blue-deep); font-weight: 800; padding: 9px 0 0; cursor: pointer; }

.library-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; border: 0; background: var(--blue-deep); color: #fff; display: grid; place-items: center; cursor: pointer; }
.library-tools { display: flex; gap: 8px; margin: 18px 0 14px; }
.library-tools button { flex: 1; min-height: 42px; border: 1px solid var(--border); background: var(--card); border-radius: 12px; color: var(--blue-deep); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.filter-pills { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 10px; }
.filter-pills button { white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--ink-soft); padding: 8px 12px; font-weight: 700; cursor: pointer; }
.filter-pills button.is-active { background: var(--blue-deep); color: #fff; border-color: var(--blue-deep); }
.library-list { display: flex; flex-direction: column; gap: 9px; }
.library-card { width: 100%; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--card); padding: 13px; text-align: left; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm); }
.source-dot { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; display: grid; place-items: center; color: var(--blue-deep); background: var(--blue-tint); }
.source-dot--watch { background: var(--gold-tint); color: var(--gold); }
.source-dot .icon { width: 17px; height: 17px; }
.library-card__body { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.library-card__body strong, .library-card__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-card__body strong { font-size: .93rem; }
.library-card__body small { color: var(--ink-soft); font-size: .82rem; }
.library-card__body em { color: var(--ink-soft); font-size: .72rem; font-style: normal; margin-top: 3px; }
.status-badge { flex: 0 0 auto; border-radius: 999px; padding: 4px 7px; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status-badge--ready { background: var(--olive-tint); color: var(--olive-deep); }
.status-badge--pending { background: var(--gold-tint); color: var(--gold); }
.status-badge--draft { background: var(--ivory-deep); color: var(--ink-soft); }
.editor-status { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: .76rem; }
.warning-card, .result-banner { border: 1px solid var(--gold-mid); border-radius: var(--radius-md); background: var(--gold-tint); color: var(--ink); padding: 12px; font-size: .84rem; line-height: 1.45; }

.workflow-intro { margin-bottom: 19px; }
.step-card { display: grid; grid-template-columns: 32px 1fr; gap: 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--card); padding: 15px; margin-bottom: 12px; }
.step-card__number { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-deep); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step-card strong { font-size: .95rem; }
.step-card p { color: var(--ink-soft); font-size: .83rem; line-height: 1.45; margin: 4px 0 10px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; background: #fff; }
.button-row { display: flex; gap: 8px; margin-top: 10px; }
.button-row > * { flex: 1; }
.step-card > div > .primary-btn { width: 100%; margin-top: 10px; }
.result-banner { margin-bottom: 12px; }
.result-banner.is-error { border-color: #d99; background: #fff2f2; color: #8c0d1c; }
.import-card { border: 1px dashed var(--gold); border-radius: var(--radius-lg); background: var(--gold-tint); padding: 24px 18px; text-align: center; }
.import-card__icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; background: var(--card); color: var(--blue-deep); display: grid; place-items: center; }
.import-card p { color: var(--ink-soft); font-size: .84rem; line-height: 1.5; margin: 6px 0 16px; }
.file-btn { position: relative; overflow: hidden; background: var(--blue-deep); color: #fff; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.practice-setup .section-label { margin-top: 24px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice-grid--time { grid-template-columns: repeat(5, 1fr); }
.choice-grid button { min-height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font-weight: 700; cursor: pointer; }
.choice-grid button.is-active { border-color: var(--blue-deep); background: var(--blue-tint); color: var(--blue-deep); box-shadow: inset 0 0 0 1px var(--blue-deep); }
.choice-grid button small { display: block; color: inherit; font-size: .62rem; font-weight: 600; }
.primary-btn--large { width: 100%; min-height: 52px; margin-top: 24px; font-size: 1rem; }
.availability-note { color: var(--ink-soft); text-align: center; font-size: .78rem; margin-top: 8px; }

@media (max-width: 370px) {
  .source-grid { grid-template-columns: 1fr; }
  .source-card { min-height: 132px; }
  .choice-grid--time { grid-template-columns: repeat(3,1fr); }
  .dashboard-stats { grid-template-columns: 1fr; }
}
