/* Spanish Coach: warm, friendly, tactile. */
:root {
  --bg: #fbf6ef;
  --surface: #ffffff;
  --surface-2: #f4ece0;
  --surface-3: #ece2d3;
  --text: #2a2019;
  --muted: #7b6b5d;
  --border: #ebdfcf;
  --primary: #d4492b;
  --primary-dark: #a8341b;
  --primary-ink: #ffffff;
  --primary-soft: #fde4da;
  --accent: #e08a00;
  --good: #2e8b3e;
  --good-dark: #1f6a2c;
  --good-soft: #e1f5e0;
  --mid: #b07400;
  --mid-dark: #8a5a00;
  --mid-soft: #fff0cc;
  --bad: #d23b3b;
  --bad-dark: #a32626;
  --bad-soft: #fde3e1;
  --masc: #2563eb;
  --fem: #c0287a;
  /* one color per area of the app */
  --c-words: #d4492b;
  --c-verbs: #6c4fe0;
  --c-practice: #0e8f8f;
  --c-chat: #d98a00;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 6px 20px rgba(60, 40, 20, 0.06);
  --shadow-lg: 0 10px 40px rgba(60, 40, 20, 0.16);
  --radius: 18px;
  --nav-h: 64px;
  --side-w: 236px;
  --font-ui: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-es: "Fraunces", Georgia, "Iowan Old Style", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121d;
    --surface: #211b2b;
    --surface-2: #2b2436;
    --surface-3: #352d42;
    --text: #f4eee8;
    --muted: #ab9fb6;
    --border: #3a3148;
    --primary: #ff7a59;
    --primary-dark: #c9502f;
    --primary-ink: #2a0e05;
    --primary-soft: #43231f;
    --accent: #ffb547;
    --good: #5fd27a;
    --good-dark: #2f9b4a;
    --good-soft: #1b3324;
    --mid: #ffc94d;
    --mid-dark: #c7942a;
    --mid-soft: #3d3218;
    --bad: #ff7272;
    --bad-dark: #c94a4a;
    --bad-soft: #43201f;
    --masc: #8db8ff;
    --fem: #ff9ccf;
    --c-words: #ff7a59;
    --c-verbs: #a48bff;
    --c-practice: #3fd0c9;
    --c-chat: #ffb547;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3 {
  font-weight: 800;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.7rem;
  line-height: 1.15;
  margin: 0.3rem 0 0.4rem;
}
h2 {
  font-size: 1.08rem;
  margin: 0 0 0.6rem;
}
h3 {
  font-size: 0.95rem;
  margin: 1.2rem 0 0.4rem;
}
a {
  color: var(--primary);
}
p {
  margin: 0.4rem 0;
}
code {
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 0.05em 0.35em;
  border-radius: 5px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.86rem;
}
.block {
  display: block;
}
.center {
  text-align: center;
  justify-content: center;
}
.error {
  color: var(--bad);
}
.es {
  font-family: var(--font-es);
  font-optical-sizing: auto;
}
.hidden,
[hidden] {
  display: none !important;
}
.kbd {
  display: none;
  font: 600 0.68rem/1 var(--font-ui);
  padding: 3px 5px;
  border-radius: 5px;
  border: 1px solid currentColor;
  opacity: 0.55;
}
@media (hover: hover) and (pointer: fine) {
  .kbd {
    display: inline-block;
  }
}

/* ---------- layout ---------- */
#app {
  min-height: 100vh;
  min-height: 100dvh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
}
.brand-name {
  white-space: nowrap;
}
@media (max-width: 420px) {
  .topbar .brand-name {
    display: none;
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.logo {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font: 700 22px/1 var(--font-es);
  box-shadow: 0 3px 0 var(--primary-dark);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
}
.pill.big {
  padding: 6px 12px;
  font-size: 0.92rem;
}
.pill.fire {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.grey {
  filter: grayscale(1);
  opacity: 0.5;
}
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 4px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
  outline: none;
}
main:has(.sheet) {
  padding-bottom: 260px;
}

.mainnav {
  position: fixed;
  z-index: 6;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.mainnav a {
  flex: 1;
  max-width: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 8px;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  text-decoration: none;
  position: relative;
}
.mainnav a .icon {
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
}
.mainnav a.on {
  color: var(--primary);
}
.mainnav a.on .icon {
  transform: translateY(-1px) scale(1.08);
}
.mainnav a.on::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}
.side-brand,
.side-only {
  display: none !important;
}

/* Focus mode: no bottom nav during a study session on phones. */
@media (max-width: 959px) {
  body:has(.session-head) .mainnav {
    display: none;
  }
  body:has(.session-head) main {
    padding-bottom: calc(110px + env(safe-area-inset-bottom));
  }
  body:has(.session-head) .topbar {
    display: none;
  }
}

/* Desktop: sidebar navigation. */
@media (min-width: 960px) {
  .mainnav {
    top: 0;
    right: auto;
    width: var(--side-w);
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 20px 14px;
    border-top: 0;
    border-right: 1px solid var(--border);
    background: var(--surface);
  }
  .side-brand {
    display: flex !important;
    padding: 4px 10px 22px !important;
    color: var(--text) !important;
    font-size: 1.1rem !important;
  }
  .side-brand::before {
    display: none;
  }
  .side-only {
    display: flex !important;
    margin-top: auto;
  }
  .mainnav a {
    flex: none;
    max-width: none;
    flex-direction: row;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 0.98rem;
  }
  .mainnav a:hover {
    background: var(--surface-2);
  }
  .mainnav a.on {
    background: var(--primary-soft);
  }
  .mainnav a.on::before {
    display: none;
  }
  .topbar,
  main {
    margin-left: calc(var(--side-w) + max(0px, (100vw - var(--side-w) - 720px) / 2));
    max-width: 720px;
  }
  .topbar .brand,
  .topbar [data-nav="settings"] {
    visibility: hidden;
  }
  main {
    padding-bottom: 60px;
  }
}

.card,
.flash {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.top {
  align-items: flex-start;
}
.row.wrap {
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row.between h2 {
  margin: 0;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grow {
  flex: 1;
  min-width: 0;
}

/* ---------- controls ---------- */
.btn {
  --btn-shadow: var(--surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 4px 0 var(--btn-shadow);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  user-select: none;
}
.btn:hover {
  filter: brightness(1.04);
}
.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--btn-shadow);
}
.btn.primary {
  --btn-shadow: var(--primary-dark);
  background: var(--primary);
  color: var(--primary-ink);
}
.btn.good-solid {
  --btn-shadow: var(--good-dark);
  background: var(--good);
  color: #fff;
}
.btn.warn-solid {
  --btn-shadow: var(--mid-dark);
  background: var(--mid);
  color: #fff;
}
.btn.danger-solid {
  --btn-shadow: var(--bad-dark);
  background: var(--bad);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.good-solid,
  :root:not([data-theme="light"]) .btn.warn-solid,
  :root:not([data-theme="light"]) .btn.danger-solid {
    color: #14100c;
  }
}
.btn.ghost {
  --btn-shadow: var(--border);
  background: var(--surface);
  border-color: var(--border);
}
.btn.danger {
  color: var(--bad);
}
.btn.small {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.88rem;
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.btn.wide {
  width: 100%;
}
.btn.big-btn {
  min-height: 58px;
  font-size: 1.08rem;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn .kbd {
  margin-left: 4px;
}
.btn:focus-visible,
.icon-btn:focus-visible,
.option:focus-visible,
.grade:focus-visible,
.mode:focus-visible,
.scenario:focus-visible,
.topic:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 50%, transparent);
  outline-offset: 2px;
}
.link {
  background: none;
  border: 0;
  padding: 4px 0;
  font: inherit;
  font-weight: 800;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.icon {
  width: 22px;
  height: 22px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s, background 0.15s;
}
.icon-btn:active {
  transform: scale(0.92);
}
.icon-btn.plain {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.icon-btn.playing {
  background: var(--primary-soft);
  border-color: var(--primary);
  animation: playing 0.9s ease-in-out infinite;
}
@keyframes playing {
  50% {
    transform: scale(1.07);
  }
}
.icon-btn.mic {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 3px 0 var(--primary-dark);
}
.icon-btn.mic[data-state="rec"] {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
  box-shadow: none;
  animation: pulse 1.2s infinite;
}
.icon-btn.mic.huge {
  width: 96px;
  height: 96px;
  margin: 14px auto;
  box-shadow: 0 6px 0 var(--primary-dark);
}
.icon-btn.mic.huge .icon {
  width: 42px;
  height: 42px;
}
.icon-btn.send {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.icon-btn:disabled {
  opacity: 0.5;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent);
  }
  50% {
    box-shadow: 0 0 0 14px transparent;
  }
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.close-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 800 1.2rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}
.close-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.text-input,
.select {
  width: 100%;
  min-height: 50px;
  padding: 10px 14px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.text-input:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}
.text-input.big-input {
  min-height: 58px;
  font: 500 1.3rem var(--font-es);
  text-align: center;
}
.select {
  font-size: 0.95rem;
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-row .icon-btn.mic {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}
.accent-bar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 8px 0 12px;
}
.accent-bar button {
  min-width: 38px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: 600 1.05rem var(--font-es);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border);
}
.accent-bar button:active {
  transform: translateY(2px);
  box-shadow: none;
}
.answer-form {
  margin-top: 18px;
}
.person-input {
  display: flex;
  align-items: center;
  gap: 10px;
}
.person-input > .es {
  font-size: 1.3rem;
  color: var(--c-verbs);
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--muted);
  border: 0;
  font-family: var(--font-ui);
}
.chip.new {
  background: var(--mid-soft);
  color: var(--mid);
}
.chip.prod {
  background: color-mix(in srgb, var(--c-practice) 15%, transparent);
  color: var(--c-practice);
}
.chip.m {
  color: var(--masc);
  background: color-mix(in srgb, var(--masc) 12%, transparent);
}
.chip.f {
  color: var(--fem);
  background: color-mix(in srgb, var(--fem) 12%, transparent);
}
.chip.filter {
  cursor: pointer;
  padding: 7px 13px;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  background: var(--surface);
}
.chip.filter.on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.badge.good {
  background: var(--good-soft);
  color: var(--good);
}
.badge.mid {
  background: var(--mid-soft);
  color: var(--mid);
}
.badge.new {
  background: var(--primary-soft);
  color: var(--primary);
}
.badge.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.notice {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--mid-soft);
  color: var(--text);
}
.notice.error {
  background: var(--bad-soft);
}
.progress {
  display: block;
  flex: 1;
  height: 14px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress > * {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 70%, #fff));
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.3, 1.4, 0.6, 1);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.progress.slim {
  height: 8px;
}
.progress.slim > * {
  background: var(--primary);
  box-shadow: none;
}

/* ---------- page intros ---------- */
.page-intro {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 6px 0 14px;
}
.page-intro h1 {
  margin: 0;
}
.page-intro p {
  margin: 2px 0 0;
}
.page-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  font-size: 30px;
  background: var(--area-soft);
  box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--area) 25%, transparent);
}
.area-words {
  --area: var(--c-words);
}
.area-verbs {
  --area: var(--c-verbs);
}
.area-practice {
  --area: var(--c-practice);
}
.area-chat {
  --area: var(--c-chat);
}
[class*="area-"] {
  --area-soft: color-mix(in srgb, var(--area) 15%, var(--surface));
}
.page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  margin-left: -8px;
}
.page-head h1 {
  margin: 0;
}

/* ---------- home ---------- */
.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0 4px;
}
.hero-text {
  min-width: 0;
}
.hero-text h1 {
  font-size: 1.9rem;
}
.hero-name {
  color: var(--primary);
}
.hero-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.goal {
  position: relative;
  flex: none;
  width: 116px;
  height: 116px;
}
.ring-track {
  stroke: var(--surface-3);
}
.ring-fill {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.8s cubic-bezier(0.3, 1.2, 0.6, 1);
}
.goal.met .ring-fill {
  stroke: var(--good);
}
.goal-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.goal-label strong {
  font-size: 1.7rem;
  font-weight: 900;
}
.goal-label span {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 700;
}
.goal.met .goal-label strong::after {
  content: " ✓";
  color: var(--good);
  font-size: 1rem;
}

.cta:not([class*="area-"]) {
  --area: var(--c-words);
}
.cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--area), color-mix(in srgb, var(--area) 70%, var(--accent)));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--area) 65%, #000), var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.cta:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--area) 65%, #000);
}
.cta strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
}
.cta small {
  display: block;
  opacity: 0.9;
  font-weight: 600;
}
.cta small:first-child {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 800;
  opacity: 0.8;
}
.cta-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 28px;
}
.cta-icon .icon {
  width: 28px;
  height: 28px;
}
.cta-go {
  flex: none;
  padding: 10px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--area);
  font-weight: 900;
}
:root .cta-go {
  color: color-mix(in srgb, var(--area) 85%, #000);
}
.cta.all-done {
  --area: var(--good);
  box-shadow: 0 6px 0 var(--good-dark), var(--shadow);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cta {
    color: #1a0f08;
  }
  :root:not([data-theme="light"]) .cta-icon {
    background: rgba(0, 0, 0, 0.12);
  }
}

.plan {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  border: 2px solid transparent;
  transition: background 0.15s;
}
.plan a:hover {
  background: var(--surface-2);
}
.plan li.next a {
  border-color: color-mix(in srgb, var(--area) 45%, transparent);
  background: var(--area-soft);
}
.plan small {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
}
.plan-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--area-soft);
  color: var(--area);
  font-weight: 900;
}
.plan li.done .plan-icon {
  background: var(--good);
  color: #fff;
}
.plan li.done strong {
  color: var(--muted);
}
.chev {
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.day .dot {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 18px;
}
.day.on .dot {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface));
}
.day.today .dot {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}
.day.today .small {
  color: var(--text);
  font-weight: 800;
}

.topics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) {
  .topics {
    grid-template-columns: repeat(3, 1fr);
  }
}
.topic {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "e n" "e n" "b b" "c c";
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s, background 0.15s;
}
.topic:hover {
  transform: translateY(-2px);
  background: var(--surface-3);
}
.topic-emoji {
  grid-area: e;
  font-size: 26px;
}
.topic-name {
  grid-area: n;
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.2;
}
.topic .progress {
  grid-area: b;
  margin-top: 6px;
}
.topic .small {
  grid-area: c;
}

.weak,
.wordlist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.weak li,
.wordlist li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.wordlist li .es,
.weak li .es {
  font-size: 1.08rem;
}
.wordlist li:has(.del) {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto auto;
}
.weak li:not(:has(.say)) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}
.weak li:last-child,
.wordlist li:last-child {
  border: 0;
}
.weak .icon-btn,
.wordlist .icon-btn {
  width: 36px;
  height: 36px;
}
.weak .icon,
.wordlist .icon {
  width: 18px;
  height: 18px;
}
.wordlist .muted,
.weak .muted {
  font-size: 0.88rem;
}
.icon-btn.del {
  color: var(--muted);
  font-size: 0.9rem;
}
.list-tools {
  position: sticky;
  top: 60px;
  z-index: 3;
  background: var(--bg);
  padding: 4px 0 8px;
}
@media (max-width: 959px) {
  .list-tools {
    top: calc(env(safe-area-inset-top) + 58px);
  }
}
.topic-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 2px 2px;
  scrollbar-width: none;
}
.topic-chips::-webkit-scrollbar {
  display: none;
}
.add-word summary {
  cursor: pointer;
  list-style: none;
}
.add-word summary strong {
  color: var(--primary);
}
.add-word form {
  margin-top: 12px;
}

/* ---------- study screens ---------- */
.session-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 0 10px;
  background: var(--bg);
}
@media (min-width: 960px) {
  .session-head {
    top: 58px;
  }
}
.session-head .count {
  min-width: 42px;
  text-align: right;
  font-weight: 800;
}
.combo {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--accent);
  font-weight: 900;
  animation: bump 0.35s ease-out;
}
@keyframes bump {
  40% {
    transform: scale(1.25);
  }
}
.flash {
  padding: 24px 18px;
  text-align: center;
  border-width: 2px;
  border-bottom-width: 5px;
}
.flash .tags {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.big {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.word-in {
  animation: word-in 0.35s cubic-bezier(0.2, 1.3, 0.5, 1);
}
@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}
.reveal-in {
  animation: reveal 0.4s ease-out;
}
@keyframes reveal {
  from {
    opacity: 0;
    transform: rotateX(-40deg);
  }
}
.flip {
  perspective: 800px;
}
.hint {
  margin-top: 14px;
}
.say-pair {
  display: inline-flex;
  gap: 8px;
  margin: 6px 0;
}
.flash > .say-pair {
  display: flex;
  justify-content: center;
}
.answer {
  margin: 16px 0 6px;
  padding-top: 16px;
  border-top: 2px dashed var(--border);
}
.meaning {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.example {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  margin: 14px auto 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  max-width: 480px;
}
.example .es {
  font-size: 1.05rem;
}
.dock {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 10px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
@media (max-width: 959px) {
  .dock {
    position: fixed;
    left: 0;
    right: 0;
    padding: 24px 16px calc(14px + env(safe-area-inset-bottom));
  }
  .dock > * {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  main:has(.dock) {
    padding-bottom: 170px;
  }
}
.dock-label {
  margin: 0 0 8px;
}
.grades {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.grade {
  --g: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 4px 9px;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--g) 35%, var(--border));
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--g) 35%, var(--border));
  transition: transform 0.08s, box-shadow 0.08s;
}
.grade:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--g) 35%, var(--border));
}
.grade strong {
  color: var(--g);
  font-weight: 900;
}
.grade small {
  color: var(--muted);
  font-size: 0.75rem;
}
.grade .kbd {
  margin-top: 3px;
}
.grade.again {
  --g: var(--bad);
}
.grade.hard {
  --g: var(--mid);
}
.grade.good {
  --g: var(--good);
}
.grade.easy {
  --g: var(--c-practice);
}
.result {
  margin: 16px 0 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--bad-soft);
}
.result.exact {
  background: var(--good-soft);
}
.result.accent,
.result.article {
  background: var(--mid-soft);
}
.flash .row.center {
  justify-content: center;
  flex-wrap: wrap;
}
.leech {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px dashed var(--accent);
  text-align: left;
}
.tip p {
  margin: 8px 0;
}
.explain {
  text-align: left;
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.verb-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.prompt-person {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  font: 600 1.3rem var(--font-es);
  color: var(--c-verbs);
  background: color-mix(in srgb, var(--c-verbs) 13%, transparent);
}

/* answer sheet */
.sheet {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-top: 3px solid var(--tone);
  background: var(--tone-soft);
  animation: sheet-up 0.28s cubic-bezier(0.2, 1.2, 0.5, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.08);
}
@media (min-width: 960px) {
  .sheet {
    left: var(--side-w);
  }
}
.sheet.good {
  --tone: var(--good);
  --tone-soft: var(--good-soft);
}
.sheet.mid {
  --tone: var(--mid);
  --tone-soft: var(--mid-soft);
}
.sheet.bad {
  --tone: var(--bad);
  --tone-soft: var(--bad-soft);
}
.sheet-inner {
  max-width: 640px;
  margin: 0 auto;
}
.sheet-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  color: var(--tone);
}
.sheet-title strong {
  font-weight: 900;
}
.sheet-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tone);
  color: #fff;
  font-weight: 900;
  font-size: 1.05rem;
}
.sheet-body {
  margin: 6px 0 2px 44px;
  color: var(--text);
}
.sheet-body .es {
  font-size: 1.15rem;
}
.sheet .btn {
  margin-top: 14px;
}
.xp-pop {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  animation: xp-pop 0.6s cubic-bezier(0.2, 1.6, 0.5, 1);
}
@keyframes xp-pop {
  from {
    transform: translateY(10px) scale(0.6);
    opacity: 0;
  }
}
@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
}

/* session summary */
.summary {
  text-align: center;
  padding: 28px 4px 10px;
}
.summary-emoji {
  font-size: 72px;
  line-height: 1;
  animation: bounce-in 0.7s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes bounce-in {
  from {
    transform: scale(0.2) rotate(-20deg);
    opacity: 0;
  }
}
.summary h1 {
  font-size: 2rem;
  margin-top: 12px;
}
.summary-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.sstat {
  min-width: 96px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: var(--surface);
  animation: word-in 0.4s both;
}
.sstat:nth-child(2) {
  animation-delay: 0.08s;
}
.sstat:nth-child(3) {
  animation-delay: 0.16s;
}
.sstat:nth-child(4) {
  animation-delay: 0.24s;
}
.sstat strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 900;
}
.sstat span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sstat.xp {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
.sstat.xp strong {
  color: var(--accent);
}
.level-line {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto 18px;
}
.level-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 900;
  font-size: 0.82rem;
  white-space: nowrap;
}
.learned {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 0 0 18px;
}
.word-chip {
  cursor: pointer;
  background: var(--primary-soft);
  color: var(--text);
  font: 600 1rem var(--font-es);
  padding: 6px 12px;
}
.word-chip small {
  font: 600 0.78rem var(--font-ui);
  color: var(--muted);
}
.summary-actions {
  max-width: 420px;
  margin: 0 auto;
}

/* verbs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 14px;
}
.tab {
  flex: 1;
  border: 0;
  padding: 9px;
  border-radius: 11px;
  font: inherit;
  font-weight: 800;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tab.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}
.check:has(input:checked) {
  border-color: var(--c-verbs);
  background: color-mix(in srgb, var(--c-verbs) 12%, var(--surface));
}
.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--c-verbs);
}
.conj {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  text-align: left;
}
.conj td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.conj td:last-child {
  width: 44px;
}
.conj td.es {
  font-size: 1.2rem;
}
.conj .icon-btn {
  width: 34px;
  height: 34px;
}
.conj .icon {
  width: 17px;
  height: 17px;
}
.conj tr.hl td {
  background: color-mix(in srgb, var(--c-verbs) 13%, transparent);
}
.conj tr.hl td:first-child {
  border-radius: 10px 0 0 10px;
}
.conj tr.hl td:last-child {
  border-radius: 0 10px 10px 0;
}
.end {
  font-weight: 800;
  color: var(--c-practice);
}
.end.stem {
  color: var(--accent);
}
.end.spelling {
  color: var(--mid);
}
.irr {
  font-weight: 800;
  color: var(--fem);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted);
}

/* practice */
.modes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.mode {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  text-align: left;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border);
  transition: transform 0.1s, box-shadow 0.1s;
}
.mode:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--border);
}
.mode:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border);
}
.mode strong {
  font-size: 1.05rem;
}
.mode small {
  display: block;
  color: var(--muted);
}
.mode-emoji {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 26px;
  background: var(--tone-bg);
}
.tone-a {
  --tone-bg: color-mix(in srgb, var(--c-practice) 16%, var(--surface));
}
.tone-b {
  --tone-bg: color-mix(in srgb, var(--c-verbs) 16%, var(--surface));
}
.tone-c {
  --tone-bg: color-mix(in srgb, var(--c-words) 16%, var(--surface));
}
.tone-d {
  --tone-bg: color-mix(in srgb, var(--c-chat) 18%, var(--surface));
}
.mode.dim {
  opacity: 0.55;
  cursor: default;
}
.listen-big .say-pair {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.listen-big .icon-btn {
  width: 84px;
  height: 84px;
  background: var(--c-practice);
  border-color: var(--c-practice);
  color: #fff;
  box-shadow: 0 5px 0 color-mix(in srgb, var(--c-practice) 60%, #000);
}
.listen-big .icon-btn + .icon-btn {
  width: 60px;
  height: 60px;
  align-self: center;
  background: var(--surface);
  color: var(--c-practice);
  box-shadow: 0 4px 0 var(--border);
  border-color: var(--border);
}
.listen-big .icon {
  width: 36px;
  height: 36px;
}
.options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border);
  transition: transform 0.08s, box-shadow 0.08s;
}
.option:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border);
}
.option.right {
  border-color: var(--good);
  background: var(--good-soft);
  box-shadow: 0 4px 0 var(--good);
  animation: bump 0.35s;
}
.option.wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  box-shadow: 0 4px 0 var(--bad);
  animation: shake 0.35s;
}
.option.faded {
  opacity: 0.45;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* chat */
.scenarios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) {
  .scenarios {
    grid-template-columns: repeat(3, 1fr);
  }
}
.scenario {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px;
  text-align: left;
  border-radius: 18px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--border);
  transition: transform 0.1s, box-shadow 0.1s;
}
.scenario:hover {
  transform: translateY(-2px);
}
.scenario:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--border);
}
.scenario-emoji {
  font-size: 30px;
  margin-bottom: 4px;
}
.scenario small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-chat), var(--primary));
  color: #fff;
  font: 700 1.1rem var(--font-es);
}
.page-icon.avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 1.6rem;
  box-shadow: none;
}
.small-avatar {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
  margin-top: 4px;
}
.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0 6px;
}
.msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: word-in 0.3s ease-out;
}
.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}
.msg.bot {
  align-self: flex-start;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}
.bubble {
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
}
.msg.user .bubble {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  border-bottom-right-radius: 6px;
  font-weight: 600;
}
.msg.bot .bubble {
  border-top-left-radius: 6px;
}
.msg.bot .es {
  font-size: 1.15rem;
  padding-top: 8px;
}
.translation {
  margin-top: 4px;
}
.translation summary {
  cursor: pointer;
}
.correction {
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--mid-soft);
  max-width: 100%;
}
.correction.ok {
  background: var(--good-soft);
  color: var(--good);
  font-weight: 700;
}
.correction .icon-btn {
  width: 32px;
  height: 32px;
}
.new-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip.word {
  cursor: pointer;
  color: var(--primary);
  background: var(--primary-soft);
}
.chip.word:disabled {
  opacity: 0.5;
}
.typing {
  display: flex;
  gap: 5px;
  padding: 16px;
}
.typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}
.suggestions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  align-items: center;
  margin: 8px 0;
  scrollbar-width: none;
}
.chip.sugg {
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 7px 13px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: 600 0.95rem var(--font-es);
  cursor: pointer;
  text-align: left;
}
.chip.sugg small {
  color: var(--muted);
  font: 400 0.76rem var(--font-ui);
}
.composer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 6px 0 calc(10px + env(safe-area-inset-bottom));
}
.composer .accent-bar {
  margin: 0 0 6px;
  justify-content: flex-start;
}

/* settings */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.switch-row small {
  display: block;
  color: var(--muted);
  font-size: 0.83rem;
}
.dim {
  opacity: 0.55;
}
.switch {
  appearance: none;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 99px;
  background: var(--surface-3);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.6, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.switch:checked {
  background: var(--good);
}
.switch:checked::after {
  transform: translateX(20px);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}
.field > span {
  font-weight: 800;
}
.seg {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.seg button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 4px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.seg button small {
  color: var(--muted);
  font-size: 0.75rem;
}
.seg button.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* login */
.login {
  max-width: 380px;
  margin: 0 auto;
  padding: 14vh 16px 40px;
  text-align: center;
}
.ms-btn {
  --btn-shadow: var(--border);
  margin: 18px 0 6px;
  min-height: 54px;
  background: var(--surface);
  border-color: var(--border);
  font-size: 1.02rem;
}
.login h1 {
  font-size: 2rem;
}
.dev-login {
  text-align: left;
  margin-bottom: 18px;
}
.dev-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 6px;
  background: #fde68a;
  color: #78350f;
  vertical-align: middle;
}
.big-logo {
  width: 76px;
  height: 76px;
  font-size: 48px;
  border-radius: 24px;
  margin: 0 auto 12px;
  box-shadow: 0 6px 0 var(--primary-dark);
  animation: bounce-in 0.7s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.loading {
  text-align: center;
  padding-top: 30vh;
  color: var(--muted);
}

/* toasts, banners, confetti */
#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 480px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}
.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.out {
  opacity: 0;
  transform: translateY(8px);
}
.flash-banner {
  position: fixed;
  z-index: 60;
  top: calc(env(safe-area-inset-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--good);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow-lg);
  animation: banner-in 0.5s cubic-bezier(0.2, 1.5, 0.5, 1);
  transition: opacity 0.4s, transform 0.4s;
  white-space: nowrap;
}
.flash-banner.out {
  opacity: 0;
  transform: translate(-50%, -20px);
}
@keyframes banner-in {
  from {
    transform: translate(-50%, -40px);
    opacity: 0;
  }
}
.confetti {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 70;
}

@media (min-width: 560px) {
  .options {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 380px) {
  .goal {
    width: 96px;
    height: 96px;
  }
  .goal .ring {
    width: 96px;
    height: 96px;
  }
  .hero-text h1 {
    font-size: 1.6rem;
  }
  .big {
    font-size: 2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
