@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-500.ttf') format('truetype');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/space-grotesk-600.ttf') format('truetype');
}

:root {
  --ion-font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ion-color-primary: #4b5dff;
  --ion-color-primary-contrast: #ffffff;
  --ion-color-primary-shade: #4353e0;
  --ion-color-primary-tint: #5e6dff;
  --ion-color-secondary: #6c5ce7;
  --ion-color-tertiary: #ff9f43;
  --app-bg: #f4f6fb;
  --app-surface: #ffffff;
  --app-surface-2: #eef1fd;
  --app-border: rgba(15, 27, 45, 0.08);
  --app-text: #0f1b2d;
  --app-muted: #5b6474;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
ion-app {
  background: radial-gradient(circle at 20% 20%, rgba(91, 112, 255, 0.12), transparent 30%), radial-gradient(circle at 80% 0%, rgba(108, 92, 231, 0.08), transparent 28%), var(--app-bg);
  color: var(--app-text);
  font-family: var(--ion-font-family);
}

html,
body,
ion-app,
ion-router,
ion-router-outlet {
  height: 100%;
}

page-onboarding,
tabs-page,
page-home,
page-free-ride,
page-listas,
page-speak,
page-profile,
page-premium {
  display: block;
  height: 100%;
}

ion-content {
  --background: transparent;
  color: var(--app-text);
}

ion-toolbar {
  --background: rgba(255, 255, 255, 0.92);
  --color: var(--app-text);
  backdrop-filter: blur(12px);
  border-color: var(--app-border);
}

ion-header {
  backdrop-filter: blur(12px);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  padding: 18px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.muted {
  color: var(--app-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(15, 27, 45, 0.05);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  color: var(--app-text);
  font-size: 0.85rem;
}

.brand-pill {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.card {
  background: linear-gradient(160deg, rgba(91, 112, 255, 0.12), rgba(255, 255, 255, 0.95));
  border: 1px solid var(--app-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(15, 27, 45, 0.08);
}

.card h2,
.card h3,
.card h4 {
  margin: 6px 0;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--app-muted);
}

page-login .login-inputs {
  display: grid;
  gap: 10px;
}

page-login .login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

page-login .login-label {
  font-size: 0.75rem;
  color: var(--app-muted);
}

page-login .login-text-input {
  width: 100%;
}

page-login .login-text-input:focus {
  outline: none;
  border-color: rgba(75, 93, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(75, 93, 255, 0.12);
}

page-login .login-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

page-login .login-social-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

page-login .login-email-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

page-login .login-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

page-login .login-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ion-color-primary, #4b5dff);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

page-login .login-create-email-btn {
  width: 100%;
  border: 1px solid rgba(75, 93, 255, 0.22);
  border-radius: 12px;
  background: rgba(75, 93, 255, 0.06);
  padding: 11px 14px;
  text-align: center;
}

page-login .login-links-bottom {
  align-items: center;
}

page-login .login-terms-item {
  --background: transparent;
  --border-color: transparent;
  --border-width: 0;
  --inner-border-width: 0;
  --padding-start: 0;
  --padding-end: 0;
  --inner-padding-start: 0;
  --inner-padding-end: 0;
  --min-height: auto;
}

page-login .login-terms-item ion-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--app-muted);
}

page-login .login-social-btn {
  --padding-start: 16px;
  --padding-end: 16px;
  --min-height: 44px;
  text-transform: none;
}

page-login .login-social-icon {
  width: 28px;
  height: 28px;
  margin-right: 8px;
  object-fit: contain;
  border-radius: 4px;
}

page-login .login-social-icon-apple {
  width: 32px;
  height: 32px;
  margin-right: 4px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(91, 112, 255, 0.14), rgba(108, 92, 231, 0.1));
}

.hero-card::after,
.hero-card::before {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.7;
}

.hero-card::after {
  width: 140px;
  height: 140px;
  background: rgba(91, 112, 255, 0.35);
  right: -40px;
  top: -60px;
}

.hero-card::before {
  width: 160px;
  height: 160px;
  background: rgba(108, 92, 231, 0.25);
  left: -60px;
  bottom: -60px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--app-border);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 1.25rem;
  margin: 12px 0 6px;
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.mini-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 12px;
}

.mini-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(91, 112, 255, 0.12);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: #4b5dff;
}

.surface-list {
  margin: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface);
  overflow: hidden;
}

.surface-list ion-item {
  --background: transparent;
  --color: var(--app-text);
  --padding-start: 14px;
  --padding-end: 14px;
  --border-color: var(--app-border);
}

.surface-list ion-label h3 {
  margin: 0;
  font-weight: 600;
}

.surface-list ion-label p {
  margin: 4px 0 0;
  color: var(--app-muted);
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px 8px;
}

.chip {
  padding: 8px 12px;
  background: rgba(15, 27, 45, 0.05);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  color: var(--app-text);
  font-size: 0.9rem;
}

.speak-card {
  text-align: center;
  background: linear-gradient(180deg, rgba(91, 112, 255, 0.08), rgba(255, 255, 255, 0.95));
}

.mic-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 12px auto 0;
  background: radial-gradient(circle at 30% 30%, rgba(91, 112, 255, 0.2), rgba(91, 112, 255, 0.06));
  border: 1px solid rgba(91, 112, 255, 0.3);
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.15);
  color: var(--ion-color-primary);
}

.placeholder-card {
  background: var(--app-surface);
}

.placeholder-card p {
  margin-top: 10px;
}

#profile-login-btn {
  margin-top: 14px;
}

.profile-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 12px;
}

#profile-links-login {
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 12px;
}

.profile-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ion-color-primary, #4b5dff);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.profile-links--footer {
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-top: 6px;
  padding-bottom: 6px;
}

.profile-app-meta {
  text-align: center;
  font-size: 0.75rem;
  color: var(--app-muted);
  margin: 3px 0 8px;
}

ion-modal.login-modal ion-content {
  --padding-bottom: 0px;
}

ion-modal.login-modal page-login .page-shell {
  padding-bottom: 16px;
}

.profile-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile-avatar-wrap {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--app-border);
  box-shadow: 0 10px 20px rgba(15, 27, 45, 0.12);
}

.profile-avatar-large {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.profile-form {
  display: grid;
  gap: 12px;
}

.profile-form-row {
  display: grid;
  gap: 12px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-label {
  font-size: 0.75rem;
  color: var(--app-muted);
}

.profile-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: #ffffff;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--app-text);
  font-family: inherit;
}

.profile-input:focus {
  outline: none;
  border-color: rgba(75, 93, 255, 0.6);
  box-shadow: 0 0 0 2px rgba(75, 93, 255, 0.12);
}

.profile-input[readonly] {
  background: #f8fafc;
  color: var(--app-muted);
}

.profile-save-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-save-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--app-muted);
}

.profile-save-note.error {
  color: #dc2626;
}

@media (min-width: 640px) {
  .profile-form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-overview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-progress-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
}

.profile-progress-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-progress-head {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
}

.profile-progress-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid #cbd5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #334155;
  background: #f8fafc;
}

.profile-progress-circle.good {
  border-color: #22c55e;
  color: #0f9d58;
}

.profile-progress-circle.okay {
  border-color: #f59e0b;
  color: #d97706;
}

.profile-progress-circle.bad {
  border-color: #ef4444;
  color: #dc2626;
}

.profile-locale-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 12px rgba(15, 27, 45, 0.08);
  white-space: nowrap;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.profile-locale-indicator:focus-visible {
  outline: 2px solid rgba(75, 93, 255, 0.5);
  outline-offset: 2px;
}

.profile-locale-indicator:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(15, 27, 45, 0.12);
  background: rgba(255, 255, 255, 1);
}

.profile-locale-flag {
  width: 24px;
  height: 16px;
  border-radius: 2px;
  object-fit: cover;
}

.profile-locale-name {
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 700;
  color: #334155;
}

.profile-progress-label {
  font-size: 0.85rem;
  color: var(--app-muted);
  text-align: center;
}

.profile-tabs {
  display: flex;
  gap: 12px;
}

.profile-tab-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  background: #e5e7eb;
  color: #334155;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.profile-tab-btn.active {
  background: #dbeafe;
  color: #1e3a8a;
}

.profile-section-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.review-words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.review-phrases {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-word {
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  appearance: none;
}

.review-word.okay {
  background: #fef3c7;
  color: #b45309;
}

.review-phrase {
  width: 100%;
  text-align: left;
  line-height: 1.2;
  padding: 10px 12px;
  border-radius: 14px;
}

.review-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.review-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
}

.review-filter-btn.active {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #1e3a8a;
}

.review-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.review-dot.bad {
  background: #ef4444;
}

.review-dot.okay {
  background: #f59e0b;
}

.review-empty {
  color: var(--app-muted);
  font-size: 0.9rem;
}

.profile-placeholder {
  background: #ffffff;
  border: 1px solid #e4e7ef;
  border-radius: 16px;
  padding: 14px;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.notify-shell {
  padding-top: 10px;
}

.notify-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notify-title {
  font-weight: 700;
  color: #0f172a;
}

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

.notify-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.notify-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 1.1rem;
}

.notify-icon.good {
  background: rgba(34, 197, 94, 0.16);
  color: #16a34a;
}

.notify-icon.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #d97706;
}

.notify-text {
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.notify-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notify-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.notify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.notify-action-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ion-color-primary, #4b5dff);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.notify-action-btn.danger {
  color: #ef4444;
}

.notify-item.is-read {
  opacity: 0.75;
}

.notify-empty {
  font-size: 0.9rem;
  color: var(--app-muted);
}

.diag-notify-list {
  margin-top: 8px;
}

.diag-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
}

.diag-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--app-border);
  font-size: 0.95rem;
}

.diag-list li:last-child {
  border-bottom: none;
}

.diag-avatar-wrap {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.diag-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: #f2f4f8;
  border: 1px solid var(--app-border);
  box-shadow: 0 8px 16px rgba(15, 27, 45, 0.12);
}

.diag-debug-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.diag-debug-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.diag-debug-toggle ion-toggle {
  flex: 0 0 auto;
  align-self: center;
}

.diag-debug-title {
  font-weight: 600;
}

.diag-debug-sub {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.diag-json {
  margin: 8px 0 0;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
}

.diag-speak-block {
  margin-top: 12px;
}

.diag-audio-mode-wrap {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.diag-audio-mode-wrap ion-segment {
  width: 100%;
}

.diag-usage-status {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--app-muted);
}

.diag-usage-limit-actions {
  margin-top: 8px;
  align-items: center;
}

.diag-usage-limit-input {
  max-width: 180px;
  min-width: 140px;
}

.diag-usage-limit-status {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--app-muted);
}

.diag-usage-totals {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cfd8ff;
  background: #f3f5ff;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f2a44;
}

.diag-usage-list {
  margin-top: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.diag-usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.78rem;
}

.diag-usage-row:last-child {
  border-bottom: none;
}

.diag-usage-day {
  font-weight: 600;
  color: #1f2a44;
}

.diag-usage-meta {
  color: var(--app-muted);
  text-align: right;
}

.diag-usage-empty {
  padding: 10px;
  font-size: 0.8rem;
  color: var(--app-muted);
}

.diag-tts-input {
  margin-top: 8px;
  width: 100%;
  resize: vertical;
}

.diag-tts-actions {
  margin-top: 8px;
}

.diag-tts-status {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--app-muted);
}

.app-tab-bar {
  --background: rgba(255, 255, 255, 0.94);
  --color: var(--app-muted);
  --color-selected: var(--ion-color-primary);
  border-top: 1px solid var(--app-border);
  backdrop-filter: blur(12px);
}

.app-tab-bar ion-tab-button {
  --ripple-color: rgba(99, 115, 255, 0.3);
  position: relative;
  padding-bottom: 6px;
}

.app-tab-bar ion-tab-button::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: var(--ion-color-primary);
  opacity: 0;
  transform: scaleX(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-tab-bar ion-tab-button.tab-selected::after {
  opacity: 1;
  transform: scaleX(1);
}

.app-tab-bar ion-icon {
  font-size: 22px;
}

.app-tab-bar ion-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.app-tab-bar ion-tab-button.tab-selected ion-icon {
  transform: translateY(-1px) scale(1.08);
}

.app-tab-bar ion-tab-button.tab-selected ion-label {
  font-weight: 700;
}

.app-tab-bar .tab-mascot-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  margin: 2px auto 4px;
  opacity: 0.7;
  transform: translateY(-1px);
}

.app-tab-bar ion-tab-button.tab-selected .tab-mascot-icon {
  opacity: 1;
  transform: translateY(-2px) scale(1.08);
}

.list-badge {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(91, 112, 255, 0.12);
  color: #20308f;
  font-weight: 600;
  font-size: 0.85rem;
}

.soft-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 14px;
  padding: 14px;
}

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

.onboarding-page ion-content {
  --background: radial-gradient(circle at 20% 15%, rgba(91, 112, 255, 0.14), transparent 26%), radial-gradient(circle at 85% 0%, rgba(108, 92, 231, 0.12), transparent 25%), var(--app-bg);
}

.onboarding-page.is-hero-step ion-content {
  --background: #ececec;
}

.onboarding-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 20px 32px;
}

.onboarding-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ghost-btn {
  background: none;
  border: none;
  color: var(--app-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.onboarding-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 38px rgba(15, 27, 45, 0.08);
}

.onboarding-heading {
  text-align: center;
}

.onboarding-heading h1 {
  margin: 4px 0;
  font-size: 1.4rem;
}

.onboarding-heading h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--app-muted);
}

.onboarding-subtitle {
  text-align: center;
  margin: 8px 0 0;
  color: var(--app-muted);
}

.cta-row {
  display: flex;
  gap: 10px;
}

.cta-row ion-button {
  flex: 1;
}

.level-options,
.topic-grid {
  display: grid;
  gap: 10px;
}

.level-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-2);
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.level-option[data-selected="true"] {
  border-color: var(--ion-color-primary);
  box-shadow: 0 0 0 3px rgba(91, 112, 255, 0.12);
}

.level-option .badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(91, 112, 255, 0.08);
  color: var(--ion-color-primary);
  font-weight: 700;
}

.topic-grid {
  grid-template-columns: repeat(3, 1fr);
}

.topic-card {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 12px 10px;
  background: var(--app-surface-2);
  text-align: center;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.topic-card ion-icon {
  font-size: 26px;
  color: var(--ion-color-primary);
  margin-bottom: 8px;
}

.topic-card[data-selected="true"] {
  border-color: var(--ion-color-primary);
  box-shadow: 0 0 0 3px rgba(91, 112, 255, 0.12);
  transform: translateY(-2px);
}

.profile-bubbles {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.profile-bubble {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  display: grid;
  place-items: center;
  color: var(--app-muted);
  text-align: center;
  padding: 12px;
}

.onboarding-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 27, 45, 0.12);
  transition: width 0.2s ease, background 0.2s ease;
}

.dot.active {
  width: 22px;
  background: var(--ion-color-primary);
}

.onboarding-actions {
  margin-top: 6px;
}

.onboarding-shell[data-hero-step="true"] {
  gap: 18px;
  padding: calc(14px + env(safe-area-inset-top)) 12px max(30px, env(safe-area-inset-bottom));
}

.onboarding-shell[data-hero-step="true"] .onboarding-top,
.onboarding-shell[data-hero-step="true"] .onboarding-progress {
  display: none;
}

.onboarding-shell[data-hero-step="true"] .onboarding-body {
  flex: 1;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  gap: 22px;
  justify-content: space-between;
}

.onboarding-shell[data-hero-step="true"] .onboarding-actions {
  margin-top: 10px;
  padding: 0 14px 16px;
}

.onboarding-shell[data-hero-step="true"] ion-button[data-action="next"] {
  --background: #5e8ced;
  --background-activated: #5079d3;
  --background-focused: #5079d3;
  --box-shadow: 0 4px 0 rgba(64, 100, 172, 0.35);
  --border-radius: 18px;
  --padding-top: 16px;
  --padding-bottom: 16px;
  --padding-start: 12px;
  --padding-end: 12px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.1px;
}

.onboarding-intro-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.onboarding-intro-title {
  margin: 0;
  padding: 0 2px;
  font-size: clamp(1.55rem, 5.8vw, 1.95rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 600;
  color: #0e0e10;
}

.onboarding-intro-card {
  position: relative;
  min-height: 318px;
  border-radius: 18px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: linear-gradient(135deg, #2685ed 0%, #1f76e4 100%);
  overflow: hidden;
}

.onboarding-intro-card::after {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  right: -56px;
  top: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.onboarding-intro-flag-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 2;
}

.onboarding-intro-flag-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
  border-radius: 4px;
}

.onboarding-intro-flag {
  width: 38px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  display: block;
}

.onboarding-intro-cat {
  width: 92px;
  height: auto;
  margin-left: 8px;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.onboarding-hero-mascot-wrap {
  width: 92px;
  height: 112px;
  margin-left: 8px;
  margin-top: 2px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.onboarding-hero-mascot {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

.onboarding-intro-bubble {
  margin: 16px 0 0;
  border-radius: 20px;
  background: #f3f3f3;
  color: #202124;
  padding: 14px 18px;
  font-size: clamp(1.02rem, 3.6vw, 1.2rem);
  line-height: 1.2;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  position: relative;
  z-index: 2;
}

.onboarding-hero-bubble {
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  transition:
    color 180ms ease,
    text-shadow 180ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.onboarding-hero-bubble.is-speaking {
  color: #18212c;
  text-shadow: none;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  border-color: rgba(80, 145, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(11, 67, 171, 0.12),
    0 0 0 2px rgba(80, 145, 255, 0.12);
  animation: onboarding-hero-bubble-speaking-glow 1.65s ease-in-out infinite;
}

.onboarding-hero-bubble.is-speaking strong {
  color: #0f57d7;
}

@keyframes onboarding-hero-bubble-speaking-glow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.9),
      0 8px 16px rgba(11, 67, 171, 0.12),
      0 0 0 2px rgba(80, 145, 255, 0.12);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      0 10px 20px rgba(11, 67, 171, 0.16),
      0 0 0 3px rgba(80, 145, 255, 0.16);
  }
}

.onboarding-intro-bubble strong {
  font-weight: 700;
}

.onboarding-intro-points {
  margin: 30px auto 0;
  padding-left: 22px;
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onboarding-intro-points li {
  color: #0e0e10;
  font-size: clamp(1.45rem, 5.2vw, 1.9rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.onboarding-intro-layout.is-accent .onboarding-intro-points {
  margin-top: 58px;
}

.onboarding-intro-layout.is-accent .onboarding-intro-points li {
  color: #3f86e7;
  text-transform: uppercase;
  font-size: clamp(1.22rem, 4.8vw, 1.55rem);
  letter-spacing: 0.02em;
}

.onboarding-intro-layout.is-locale {
  gap: 16px;
}

.onboarding-intro-layout.is-locale .onboarding-intro-card {
  min-height: 310px;
}

.onboarding-intro-layout.is-locale .onboarding-intro-bubble {
  margin-top: 18px;
  padding: 18px 22px;
}

.onboarding-locale-list {
  margin: 16px 2px 0;
  display: grid;
  gap: 14px;
}

.onboarding-locale-option {
  width: 100%;
  min-height: 64px;
  border: 1px solid #d7dce5;
  border-radius: 18px;
  background: #f3f4f7;
  color: #22252b;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 0 rgba(209, 214, 223, 0.62);
}

.onboarding-locale-option img {
  width: 36px;
  height: 24px;
  object-fit: cover;
  border-radius: 2px;
  flex: 0 0 auto;
}

.onboarding-locale-option span {
  line-height: 1;
}

.onboarding-locale-option[data-selected="true"] {
  border-color: #3f86e7;
  background: #ffffff;
  box-shadow: 0 6px 0 rgba(63, 134, 231, 0.24);
}

.tagline {
  margin: 0;
  color: var(--app-muted);
}

.banner {
  background: #e8e1ff;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(15, 27, 45, 0.08);
}

.banner h4 {
  margin: 0;
  font-size: 0.95rem;
}

.banner p {
  margin: 2px 0 0;
  color: var(--app-muted);
}

.avatar-block {
  display: grid;
  place-items: center;
  margin: 6px 0 10px;
}

.avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fbe4ff 0%, #d4c6ff 60%, #b59cff 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(15, 27, 45, 0.1);
}

.avatar::after {
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.6), transparent 60%);
}

.message-card {
  background: #dfd6ff;
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(15, 27, 45, 0.08);
}

.carousel-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.carousel-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(15, 27, 45, 0.25);
}

.carousel-dots span.active {
  background: var(--ion-color-primary);
  width: 16px;
  border-radius: 999px;
}

.list-filters {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
}

.filter-chip {
  padding: 10px 14px;
  border-radius: 12px;
  background: #eef1fd;
  border: 1px solid var(--app-border);
  font-weight: 600;
  color: var(--app-text);
  cursor: pointer;
}

.filter-chip.active {
  background: var(--ion-color-primary);
  color: #fff;
}

.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  margin: 0 12px 12px;
}

.list-card .thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff7d6;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.list-card h4 {
  margin: 0;
}

.list-card p {
  margin: 2px 0 0;
  color: var(--app-muted);
}

.list-card ion-button {
  margin-left: auto;
}

.word-card {
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 14px;
  background: var(--app-surface-2);
}

.word-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.score-pill {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(108, 92, 231, 0.12);
  color: #3f2cbc;
  font-weight: 700;
}

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

page-premium {
  --premium-keyboard-offset: 0px;
}

page-premium .page-shell {
  flex: 1;
  min-height: 0;
  padding-bottom: 16px;
}

page-premium .premium-chat-card {
  flex: 1;
  min-height: 0;
}

page-premium .chat-panel {
  flex: 1;
  min-height: 0;
  padding-bottom: var(--premium-keyboard-offset, 0px);
  transition: padding-bottom 0.24s ease;
  will-change: padding-bottom;
}

.chat-composer-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.chat-composer-row .chat-text-row {
  width: 100%;
}

.chat-composer-row .chat-controls {
  width: 100%;
}

page-premium.premium-chatbot-one-line .chat-composer-row {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

page-premium.premium-chatbot-one-line .chat-composer-row .chat-text-row {
  flex: 1;
  min-width: 0;
}

page-premium.premium-chatbot-one-line .chat-composer-row .chat-controls {
  width: auto;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

page-premium .chat-thread {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: none;
  scroll-padding-bottom: calc(120px + var(--premium-keyboard-offset, 0px));
}

page-premium.chat-keyboard-open .page-shell {
  padding-bottom: 8px;
}

page-premium.chat-keyboard-open .premium-chat-card {
  gap: 8px;
}

page-premium.chat-keyboard-open .chat-panel {
  gap: 8px;
}

page-premium.chat-keyboard-open .chat-thread {
  min-height: 0;
}

page-premium.chat-keyboard-open .chat-hint {
  display: none;
}

page-premium.chat-keyboard-resized .page-shell {
  padding-bottom: 8px;
}

page-premium.chat-keyboard-resized .premium-chat-card {
  gap: 8px;
}

page-premium.chat-keyboard-resized .chat-panel {
  gap: 8px;
}

page-premium.chat-keyboard-resized .chat-thread {
  min-height: 0;
  scroll-padding-bottom: 120px;
}

page-premium.chat-keyboard-resized .chat-hint {
  display: none;
}

page-premium ion-content::part(scroll) {
  display: flex;
  flex-direction: column;
}

.premium-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.coach-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--app-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.coach-avatar-cat {
  background: rgba(15, 27, 45, 0.04) url('../assets/mascot/mascot-cat.png') center/70% no-repeat;
  color: transparent;
}

.coach-avatar-bot {
  background: #eef2ff url('../assets/mascot/chatbot-icon.png') center/70% no-repeat;
  color: transparent;
}

.chat-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface-2);
  width: fit-content;
}

.chat-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-muted);
  cursor: pointer;
}

.chat-mode-btn.is-active {
  background: #111827;
  color: #ffffff;
}

.chat-text-row {
  width: 100%;
}

.chat-text-row.is-collapsed {
  flex: 0 0 0;
  max-height: 0;
  min-height: 0;
  width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.chat-text-row.is-collapsed .chat-text-input {
  height: 0;
  min-height: 0;
  padding: 0;
  border-width: 0;
}

.chat-text-row.chat-text-row-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-text-row.chat-text-row-inline .chat-text-input {
  flex: 1;
}

.chat-text-row.chat-text-row-inline .chat-btn {
  white-space: nowrap;
}

.chat-text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--app-border);
  background: #ffffff;
  font-size: 0.9rem;
  color: var(--app-text);
}

[hidden] {
  display: none !important;
}

.premium-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.app-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-right: 6px;
}

.premium-user-info,
.app-user-info {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 27, 45, 0.05);
}

.premium-user-avatar,
.app-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--app-border);
}

.premium-user-name,
.app-user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.app-notify-btn,
.app-logout-btn {
  --padding-start: 6px;
  --padding-end: 6px;
  --padding-top: 4px;
  --padding-bottom: 4px;
}

.app-notify-btn {
  position: relative;
}

.has-unread-notify .app-notify-btn::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #ffffff;
}

.app-notify-btn + .app-logout-btn {
  margin-left: -4px;
}

.app-logout-btn ion-icon {
  font-size: 20px;
}

.profile-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.profile-title-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-title-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--app-border);
}

.profile-title-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.premium-access {
  border-radius: 16px;
  border: 1px dashed var(--app-border);
  background: rgba(15, 27, 45, 0.04);
  padding: 14px;
}

.premium-access-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.premium-loading-panel {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--app-muted);
  font-size: 0.9rem;
}

.premium-loading-panel ion-spinner {
  width: 18px;
  height: 18px;
}

.premium-access-panel p {
  margin: 0;
}

.premium-login-btn {
  align-self: flex-start;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--app-surface-2);
  border: 1px solid var(--app-border);
  min-height: 220px;
  max-height: 45vh;
  overflow-y: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chat-msg {
  display: flex;
}

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-bot {
  justify-content: flex-start;
}

.chat-msg-typing {
  opacity: 0.85;
}

.chat-bubble {
  max-width: 85%;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 10px 20px rgba(15, 27, 45, 0.06);
}

.chat-bubble-typing {
  padding: 10px 14px;
}

.chat-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 12px;
}

.chat-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(91, 112, 255, 0.6);
  animation: chat-typing-bounce 1.2s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chat-typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing-dots span {
    animation: none;
  }
}

.chat-msg-user .chat-bubble {
  background: linear-gradient(140deg, rgba(91, 112, 255, 0.2), rgba(255, 255, 255, 0.92));
  border-color: rgba(91, 112, 255, 0.35);
}

.chat-text {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.chat-bubble-actions {
  display: flex;
  justify-content: flex-end;
}

.chat-audio-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: rgba(15, 27, 45, 0.04);
  color: var(--app-text);
  font-size: 0.8rem;
  cursor: pointer;
}

.chat-audio-btn ion-icon {
  font-size: 16px;
}

.chat-audio-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.talk-controls {
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.talk-controls .chat-btn span {
  display: none;
}

.talk-controls .talk-record-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  justify-content: center;
}

.talk-recording,
.talk-review {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.talk-review {
  background: var(--app-surface);
}

.talk-wave {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
}

.talk-wave-bar {
  width: 3px;
  border-radius: 999px;
  background: #f87171;
  height: calc(4px + var(--level, 0.2) * 22px);
  transition: height 0.08s linear;
  transform-origin: bottom;
}

.talk-wave-review .talk-wave-bar {
  background: #d1d5db;
}

.talk-timer {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f87171;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: right;
}

.talk-timer-review {
  color: var(--app-text);
  background: rgba(15, 23, 42, 0.06);
  padding: 4px 8px;
  border-radius: 999px;
}

.talk-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface);
  color: var(--app-text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.talk-icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.talk-stop-btn {
  background: #ef4444;
  color: #ffffff;
}

.talk-cancel-btn {
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border);
}

.talk-review .talk-play-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-text);
}

.talk-review .talk-play-btn.is-playing {
  background: #22c55e;
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(34, 197, 94, 0.35);
}

.talk-wave.is-playing .talk-wave-bar {
  animation: talk-wave-pulse 1.1s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.03s);
}

@keyframes talk-wave-pulse {
  0%,
  100% {
    transform: scaleY(0.85);
  }
  50% {
    transform: scaleY(1.15);
  }
}

.talk-review .talk-send-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  justify-content: center;
  background: #22c55e;
  border: none;
  color: #ffffff;
}

.chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-btn ion-icon {
  font-size: 18px;
}

.chat-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
  transform: none;
}

.chat-btn:focus-visible {
  outline: 2px solid rgba(91, 112, 255, 0.4);
  outline-offset: 2px;
}

.chat-btn:not(:disabled):active {
  transform: translateY(1px);
}

.chat-btn-record.is-recording {
  background: rgba(235, 68, 90, 0.12);
  border-color: rgba(235, 68, 90, 0.35);
  color: #b42032;
}

.chat-btn-send {
  background: var(--ion-color-primary);
  border-color: transparent;
  color: #ffffff;
}

.chat-btn-send:disabled {
  opacity: 0.6;
}

.chat-hint {
  font-size: 0.85rem;
  color: var(--app-muted);
}

:root {
  --speak-orange: #ff9d1f;
  --speak-orange-dark: #f28a00;
  --speak-blue: #2f7cf6;
  --speak-blue-dark: #1d5fd0;
  --speak-ink: #172233;
  --speak-muted: #5a6678;
  --speak-card: #ffffff;
  --speak-outline: #e1e5ee;
  --speak-shadow: 0 18px 40px rgba(22, 30, 50, 0.12);
}

.speak-content {
  --background: #f7f8fc;
}

.speak-content::part(scroll) {
  display: flex;
  flex-direction: column;
}

.speak-shell {
  padding: 20px 16px max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 100%;
}

.speak-session-title-wrap {
  margin-bottom: -6px;
}

.speak-session-title {
  margin: 0;
  padding: 0 2px;
  font-size: clamp(1.08rem, 4.2vw, 1.34rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: #0e0e10;
}

.speak-hero-card {
  min-height: 0;
  padding: 14px;
}

.speak-hero-flag-btn {
  top: 14px;
  right: 14px;
}

.speak-hero-debug-btn {
  position: absolute;
  top: 14px;
  right: 60px;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.speak-hero-debug-btn.is-active {
  background: #ffffff;
  color: #1d5fd0;
}

.speak-hero-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 48px;
}

.speak-hero-cat {
  width: 56px;
  margin: 2px 0 0;
}

.speak-hero-step-title {
  margin: 0;
  color: #ffffff;
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 700;
  font-size: clamp(1.02rem, 4.2vw, 1.22rem);
  line-height: 1.15;
  text-align: left;
}

.speak-hero-bubble {
  margin-top: 12px;
  font-size: clamp(0.94rem, 3.7vw, 1.06rem);
  line-height: 1.24;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.speak-sheet {
  background: var(--speak-card);
  border-radius: 20px;
  padding: 20px 14px 24px;
  box-shadow: var(--speak-shadow);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.speak-swipe-stage {
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.speak-swipe-active,
.speak-swipe-ghost {
  will-change: transform;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.speak-swipe-active {
  flex: 1;
}

.speak-swipe-ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.speak-step {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  text-align: center;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

.speak-step-main {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.speak-step-bottom {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 8px;
}

.speak-guide {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.speak-guide-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  max-width: 260px;
}

.speak-step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--speak-blue-dark);
  letter-spacing: 0.04em;
}

.speak-bubble {
  background: #f3f7ff;
  border: 1px solid #b7d2ff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--speak-ink);
}

.speak-avatar {
  width: 100%;
  display: flex;
  justify-content: center;
}

.avatar-wrapper {
  position: relative;
  width: 210px;
  height: 210px;
}

.avatar-head {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.avatar-mouth-container {
  position: absolute;
  inset: 0;
}

.speak-mouth {
  position: absolute;
  width: 54px;
  left: 52%;
  top: 71%;
  transform: translate(-50%, -50%) scale(1);
  object-fit: contain;
  pointer-events: none;
  transform-origin: center center;
}

.speak-mouth.viseme-o,
.speak-mouth.viseme-u {
  transform: translate(-50%, -50%) scale(0.9);
}

.mouth-layer {
  opacity: 0;
  transition: opacity 0.04s linear;
}

.mouth-layer-active {
  opacity: 1;
}

.speak-phonetic {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--speak-ink);
}

.speak-step-sound .speak-phonetic {
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.speak-play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: linear-gradient(180deg, #61a8ff 0%, #2f7cf6 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(47, 124, 246, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.speak-play-btn:active {
  transform: scale(0.96);
}

.speak-play-btn.is-playing {
  background: linear-gradient(180deg, #2dd4bf 0%, #0ea5e9 100%);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.36);
  animation: speak-play-btn-pulse 1.15s ease-in-out infinite;
}

.speak-step-sound .speak-phonetic .speak-play-btn {
  width: 76px;
  height: 76px;
}

.speak-step-sound .speak-phonetic .speak-play-btn ion-icon {
  font-size: 34px;
}

@keyframes speak-play-btn-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.07);
  }
}

.speak-phonetic-text {
  font-size: 1.05rem;
}

.speak-step-sound .speak-phonetic-text {
  text-align: center;
}

.accent {
  color: var(--speak-blue);
  font-weight: 700;
}

.speak-syllable-word {
  display: inline-flex;
  align-items: center;
  margin-right: 3px;
  font-weight: 700;
}

.speak-syllable {
  padding: 0 2px;
  border-radius: 6px;
  transition: background-color 0.08s ease-out, color 0.08s ease-out;
}

.speak-syllable.is-active {
  background: #fde047;
  color: #1e293b;
}

.speak-syllable-sep {
  color: var(--speak-muted);
  padding: 0;
}

.speak-score {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 260px;
  align-items: center;
  font-weight: 600;
  min-height: 2.4rem;
}

.speak-score-label {
  font-size: 0.95rem;
  line-height: 1.2;
}

.speak-score-value {
  font-size: 1.1rem;
}

.speak-score-good {
  color: #0f9d58;
}

.speak-score-okay {
  color: #f59e0b;
}

.speak-score-bad {
  color: #ef4444;
}

.speak-score-hint {
  color: var(--speak-blue-dark);
  justify-content: center;
}

.speak-score-hint .speak-score-value {
  display: none;
}

.speak-voice-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: nowrap;
  flex: 1;
}

.speak-voice-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 390px;
}

.speak-voice-nav-debug {
  min-height: 110px;
}

.speak-step-arrow-btn {
  width: 42px;
  min-width: 42px;
  height: 110px;
  border-radius: 22px;
  border: 1px solid #dbe4f0;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--speak-blue-dark);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(22, 30, 50, 0.1);
}

.speak-step-arrow-btn ion-icon {
  font-size: 28px;
}

.speak-step-arrow-btn:disabled {
  opacity: 0.38;
  box-shadow: none;
  cursor: not-allowed;
}

.speak-circle-btn {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: none;
  background: #f2f4f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  color: var(--speak-muted);
  cursor: pointer;
}

.speak-circle-btn ion-icon {
  font-size: 24px;
}

.record-visual {
  position: relative;
  width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.record-live-wave {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 26px;
  height: 20px;
}

.record-live-wave span {
  width: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  transform-origin: bottom;
  animation: speak-record-wave 0.9s ease-in-out infinite;
}

.record-live-wave span:nth-child(1) {
  height: 8px;
  animation-delay: 0s;
}

.record-live-wave span:nth-child(2) {
  height: 14px;
  animation-delay: 0.12s;
}

.record-live-wave span:nth-child(3) {
  height: 18px;
  animation-delay: 0.24s;
}

.record-live-wave span:nth-child(4) {
  height: 12px;
  animation-delay: 0.36s;
}

.record-live-wave span:nth-child(5) {
  height: 9px;
  animation-delay: 0.48s;
}

.speak-record-btn.is-recording .record-mic-icon {
  display: none;
}

.speak-record-btn.is-recording .record-live-wave {
  display: inline-flex;
}

.speak-record-btn {
  background: linear-gradient(180deg, #3a8cff 0%, #2f7cf6 100%);
  color: #ffffff;
  position: relative;
  z-index: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 10px 22px rgba(47, 124, 246, 0.28);
}

.speak-record-btn.is-recording {
  background: linear-gradient(180deg, #60a5fa 0%, #1d4ed8 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 12px 24px rgba(29, 78, 216, 0.34);
}

.speak-record-btn::before,
.speak-record-btn::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.78);
  opacity: 0;
  transform: scale(0.62);
  animation: speak-record-pulse 4.4s infinite;
  pointer-events: none;
}

.speak-record-btn::after {
  animation-delay: 2.2s;
}

.speak-record-btn.is-recording::before,
.speak-record-btn.is-recording::after {
  border-color: rgba(191, 219, 254, 0.95);
  animation-duration: 1.35s;
}

.speak-record-btn > * {
  position: relative;
  z-index: 1;
}

@keyframes speak-record-wave {
  0%,
  100% {
    transform: scaleY(0.6);
    opacity: 0.75;
  }
  50% {
    transform: scaleY(1.25);
    opacity: 1;
  }
}

@keyframes speak-record-pulse {
  0% {
    opacity: 0.86;
    transform: scale(0.62);
  }
  65% {
    opacity: 0.2;
    transform: scale(1.03);
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .speak-play-btn.is-playing {
    animation: none;
    transform: none;
  }

  .speak-record-btn::before,
  .speak-record-btn::after {
    animation-duration: 2.6s;
  }
}

.speak-circle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.speak-next-btn {
  width: 100%;
  max-width: 320px;
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  background: var(--speak-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 10px 20px rgba(47, 124, 246, 0.35);
}

.speak-word-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.speak-word {
  border: 2px solid #e5e7eb;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-weight: 700;
  color: #1f2937;
  cursor: pointer;
}

.speak-word-tone-good {
  border-color: rgba(15, 157, 88, 0.45);
  background: rgba(15, 157, 88, 0.08);
}

.speak-word-tone-okay {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
}

.speak-word-tone-bad {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.speak-word.is-active {
  border-color: var(--speak-blue);
  box-shadow: 0 10px 18px rgba(47, 124, 246, 0.2);
}

.speak-word-play {
  width: 100%;
  display: flex;
  justify-content: center;
}

.speak-step-spelling .speak-word-play .speak-play-btn {
  width: 76px;
  height: 76px;
}

.speak-step-spelling .speak-word-play .speak-play-btn ion-icon {
  font-size: 34px;
}

.speak-sentence-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

.speak-sentence-row .speak-play-btn {
  width: 76px;
  height: 76px;
}

.speak-sentence-row .speak-play-btn ion-icon {
  font-size: 34px;
}

.speak-sentence-row .speak-sentence {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  text-align: center;
}

.speak-feedback {
  font-weight: 600;
  font-style: italic;
  line-height: 1.3;
  min-height: 2.2rem;
}

.speak-feedback.good {
  color: #0f9d58;
}

.speak-feedback.okay {
  color: #f59e0b;
}

.speak-feedback.bad {
  color: #ef4444;
}

.speak-feedback.hint {
  color: var(--speak-blue-dark);
  text-align: center;
}

.speak-score-line {
  text-align: center;
  font-weight: 700;
  min-height: 2.2rem;
}

.speak-score-line.placeholder {
  visibility: hidden;
}

.speak-score-line.good {
  color: #0f9d58;
}

.speak-score-line.okay {
  color: #f59e0b;
}

.speak-score-line.bad {
  color: #ef4444;
}

.speak-score-line.hint {
  color: var(--speak-blue-dark);
}

.speak-score-line.hint .speak-score-line-value {
  display: none;
}

.speak-debug {
  width: 100%;
  max-width: 520px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: #475569;
  text-align: left;
}

.speak-debug-inline {
  max-width: none;
  min-height: 110px;
  height: 110px;
  margin: 0;
  padding: 8px 10px 34px;
  overflow: auto;
  font-size: 0.76rem;
  border-style: solid;
  position: relative;
}

.speak-debug-inline .speak-debug-row {
  grid-template-columns: 64px 1fr;
  gap: 6px;
}

.speak-debug-inline .speak-debug-label {
  font-size: 0.6rem;
}

.speak-debug-inline .speak-debug-value {
  font-size: 0.72rem;
  line-height: 1.15;
}

.speak-debug-inline .speak-debug-tones {
  gap: 6px;
  flex-wrap: wrap;
}

.speak-debug-inline .speak-debug-tone {
  width: 16px;
  height: 16px;
}

.speak-debug-inline-nav {
  position: absolute;
  right: 8px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.92);
}

.speak-debug-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.speak-debug-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  align-items: start;
}

.speak-debug-tones {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.speak-debug-metrics {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.speak-debug-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.speak-debug-metric b {
  font-weight: 700;
}

.speak-debug-inline .speak-debug-metrics {
  gap: 7px;
}

.speak-debug-inline .speak-debug-metric {
  font-size: 0.66rem;
}

.speak-debug-tone {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  padding: 0;
  appearance: none;
}

.speak-debug-tone.tone-bad {
  background: #ef4444;
}

.speak-debug-tone.tone-okay {
  background: #f59e0b;
}

.speak-debug-tone.tone-good {
  background: #22c55e;
}

.speak-debug-tone.tone-reset {
  background: #3b82f6;
}

.free-ride-debug-audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.free-ride-debug-audio-btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 5px 8px;
  cursor: pointer;
}

.free-ride-debug-audio-btn.is-active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
}

.free-ride-debug-audio-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.free-ride-debug-score-row .speak-debug-label {
  align-self: center;
}

.free-ride-debug-score-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.free-ride-debug-score-value {
  min-width: 36px;
  text-align: right;
  font-weight: 700;
}

.free-ride-debug-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.free-ride-debug-toolbar {
  position: absolute;
  top: 6px;
  right: 8px;
  left: 8px;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.free-ride-debug-actions-top {
  pointer-events: auto;
  flex-wrap: nowrap;
}

.free-ride-debug-mini-btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  min-height: 28px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.free-ride-debug-mini-btn ion-icon {
  font-size: 0.95rem;
  flex: 0 0 auto;
}

.free-ride-debug-mini-btn.is-recording {
  border-color: rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.08);
  color: #b42318;
}

.free-ride-debug-mini-btn.is-playing {
  border-color: rgba(59, 130, 246, 0.34);
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.free-ride-debug-mini-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.free-ride-bottom {
  align-items: stretch;
}

.free-ride-bottom .speak-voice-nav {
  max-width: none;
  justify-content: stretch;
}

.free-ride-bottom .speak-voice-nav-debug {
  min-height: 0;
}

.free-ride-debug-inline {
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: visible;
  padding-top: 40px;
  padding-bottom: 8px;
}

.free-ride-debug-inline .speak-debug-row {
  grid-template-columns: 58px 1fr;
  gap: 6px;
}

.free-ride-debug-inline .speak-debug-label {
  font-size: 0.56rem;
}

.free-ride-debug-inline .speak-debug-value {
  font-size: 0.68rem;
  line-height: 1.12;
}

.free-ride-debug-speed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.free-ride-debug-speed-slider {
  width: 100%;
  margin: 0;
  accent-color: #3b82f6;
}

.free-ride-debug-speed-value {
  min-width: 3.8em;
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.speak-debug-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
}

.speak-debug-value {
  color: #111827;
  word-break: break-word;
}

.speak-score-line-value {
  font-size: 1.4rem;
}

.speak-score-line-text {
  font-size: 0.9rem;
  font-weight: 600;
}

.free-ride-content {
  --background: #f7f8fc;
}

.free-ride-shell {
  height: var(--free-ride-shell-height, auto);
  min-height: 0;
  padding-bottom: 8px;
  gap: 14px;
  overflow: hidden;
}

.free-ride-title-wrap {
  margin-bottom: -6px;
}

.free-ride-screen-title {
  margin: 0;
  padding: 0 2px;
  font-size: clamp(1.08rem, 4.2vw, 1.34rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: #0e0e10;
}

.free-ride-copy-alt {
  display: inline;
  font-size: 0.74em;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0;
  text-transform: none;
}

.free-ride-copy-alt.is-compact {
  font-size: 0.7em;
}

.free-ride-copy-alt.is-mini {
  font-size: 0.66em;
  opacity: 0.78;
}

.free-ride-hero-card {
  margin: 0;
  flex: 0 0 auto;
  min-height: clamp(170px, 32vw, 198px);
  padding: 14px;
}

.free-ride-mascot-wrap {
  width: 54px;
  height: 66px;
  margin-top: 0;
  margin-left: 6px;
}

.free-ride-mascot {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

.free-ride-hero-bubble {
  margin-top: 8px;
  margin-bottom: 0;
  text-transform: none;
  font-size: clamp(0.96rem, 3.8vw, 1.08rem);
  line-height: 1.25;
  font-weight: 600;
}

.free-ride-hero-flag-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.free-ride-hero-flag-wrap .free-ride-flag-btn {
  pointer-events: auto;
}

.free-ride-hero-flag-wrap .free-ride-hero-debug-btn {
  pointer-events: auto;
}

.free-ride-card {
  margin: 0;
  flex: 1 1 auto;
  width: 100%;
  background: var(--speak-card);
  border: 1px solid var(--speak-outline);
  border-radius: 20px;
  box-shadow: var(--speak-shadow);
  padding: 18px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: hidden;
}

.free-ride-card-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.free-ride-flag-btn:focus-visible {
  outline: 2px solid rgba(47, 124, 246, 0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

.free-ride-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.free-ride-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: #64748b;
}

.free-ride-label .free-ride-copy-alt {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.86em;
  font-weight: 600;
}

.speak-score-line-text .free-ride-copy-alt {
  opacity: 0.78;
}

.free-ride-input {
  width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  padding: 10px 12px 11px;
  font-size: 1rem;
  line-height: 1.38;
  resize: none;
  min-height: 86px;
  max-height: 180px;
  background: #ffffff;
  color: #111827;
}

.free-ride-input:focus {
  outline: none;
  border-color: rgba(47, 124, 246, 0.58);
  box-shadow: 0 0 0 3px rgba(47, 124, 246, 0.18);
}

.free-ride-input:disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.free-ride-sentence-row {
  gap: 10px;
  margin-top: 2px;
}

.free-ride-sentence-row .speak-sentence {
  font-size: 1.44rem;
  line-height: 1.3;
  min-height: 2.5em;
}

.free-ride-sentence-row .speak-sentence.is-word-timed {
  white-space: pre-wrap;
}

.free-ride-sentence-row .speak-sentence.is-compare-diff {
  white-space: pre-wrap;
}

.free-ride-diff-token {
  display: inline;
  border-radius: 10px;
  padding: 0 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.free-ride-diff-token.is-ok {
  color: #0b6b3a;
  background: rgba(34, 197, 94, 0.15);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.free-ride-diff-token.is-miss {
  color: #b42318;
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.16);
}

.free-ride-diff-token.is-advanced-selectable {
  cursor: pointer;
}

.free-ride-diff-token.is-advanced-selectable.is-selected {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 0 3px rgba(37, 99, 235, 0.5),
    0 4px 10px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.free-ride-diff-token.is-advanced-selectable.is-ok.is-selected {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.14);
}

.free-ride-diff-token.is-advanced-selectable.is-miss.is-selected {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.16);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 0 3px rgba(249, 115, 22, 0.42),
    0 4px 10px rgba(249, 115, 22, 0.16);
}

.free-ride-local-speaking-pill {
  display: inline;
  color: #0f172a;
  background: rgba(253, 224, 71, 0.52);
  border-radius: 12px;
  padding: 2px 10px;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.34);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.free-ride-tts-token {
  display: inline;
  border-radius: 8px;
  padding: 0 2px;
  transition: background-color 0.09s ease-out, color 0.09s ease-out, box-shadow 0.09s ease-out;
}

.free-ride-tts-token.is-past {
  color: #1d4ed8;
}

.free-ride-tts-token.is-active {
  color: #0f172a;
  background: #fde047;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.38);
}

.free-ride-transcript {
  width: 100%;
  min-height: 1.2rem;
  text-align: center;
  font-size: 0.82rem;
  color: #64748b;
  word-break: break-word;
}

.free-ride-transcript.is-compare-diff {
  white-space: pre-wrap;
}

.free-ride-transcript-token {
  display: inline;
  border-radius: 8px;
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.free-ride-transcript-token.is-ok {
  color: #0b6b3a;
  background: rgba(34, 197, 94, 0.12);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.14);
}

.free-ride-transcript-token.is-miss {
  color: #b42318;
  background: rgba(239, 68, 68, 0.1);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.free-ride-transcript-token.is-extra {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.16);
}

.free-ride-earned-reward {
  margin-top: 4px;
  min-height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: center;
  border-radius: 999px;
  padding: 8px 14px;
  background: #eef5ff;
  border: 1px solid #cfe0ff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}

.free-ride-advanced-summary {
  align-self: center;
  margin-top: -2px;
  min-height: 1rem;
  font-size: 0.74rem;
  line-height: 1.2;
  font-weight: 700;
  color: #64748b;
  text-align: center;
  word-break: break-word;
}

.free-ride-advanced-summary.is-pending {
  color: #1d4ed8;
}

.free-ride-advanced-summary.is-warn {
  color: #b45309;
}

.free-ride-advanced-summary.is-ok {
  color: #0f766e;
}

.free-ride-advanced-word-detail {
  width: 100%;
  min-height: 1.1rem;
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 0.74rem;
  line-height: 1.28;
  color: #475569;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  text-align: center;
  word-break: break-word;
}

.free-ride-advanced-word-detail strong {
  color: #111827;
  font-weight: 800;
}

.free-ride-phoneme-ipa {
  color: #0f172a;
  font-weight: 700;
}

.free-ride-phoneme-inline {
  display: inline-block;
  border-radius: 7px;
  padding: 0 2px;
  transition: background-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.free-ride-phoneme-inline.is-active {
  background: rgba(59, 130, 246, 0.16);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22);
  color: #0f172a;
}

.free-ride-phoneme-inline.is-past {
  background: rgba(15, 23, 42, 0.05);
}

.free-ride-detail-inline-value {
  color: #0f172a;
  font-weight: 600;
}

.free-ride-advanced-word-detail.is-pending {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.09);
  border-color: rgba(59, 130, 246, 0.2);
}

.free-ride-advanced-word-detail.is-warn {
  color: #9a3412;
  background: rgba(249, 115, 22, 0.08);
  border-color: rgba(249, 115, 22, 0.18);
}

.free-ride-advanced-word-detail.is-ok {
  color: #0f766e;
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.18);
}

.free-ride-advanced-word-detail.is-hint {
  color: #64748b;
}

.free-ride-detail-trigger {
  cursor: pointer;
  transition: box-shadow 0.14s ease, background-color 0.14s ease, transform 0.14s ease;
}

.free-ride-detail-trigger:hover {
  transform: translateY(-1px);
}

.free-ride-detail-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
  border-radius: 10px;
}

ion-modal.free-ride-detail-modal::part(content) {
  width: min(880px, calc(100vw - 20px));
  height: min(86vh, 760px);
  border-radius: 18px;
  overflow: hidden;
}

ion-modal.free-ride-detail-modal ion-content {
  --background: #f8fafc;
}

.free-ride-detail-modal-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 14px max(16px, env(safe-area-inset-bottom));
}

.free-ride-detail-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.free-ride-detail-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.1;
}

.free-ride-detail-modal-sub {
  margin-top: 2px;
  font-size: 0.75rem;
  color: #64748b;
}

.free-ride-detail-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.free-ride-detail-close ion-icon {
  font-size: 1.15rem;
}

.free-ride-detail-modal-body {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.free-ride-detail-section {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.free-ride-detail-section h3 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.1;
  color: #0f172a;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.free-ride-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 10px;
}

.free-ride-detail-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 9px;
  background: #f8fafc;
}

.free-ride-detail-card-label {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 4px;
}

.free-ride-detail-card-value {
  font-size: 0.77rem;
  color: #0f172a;
  line-height: 1.22;
  word-break: break-word;
}

.free-ride-detail-selected {
  margin-bottom: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.06);
  color: #1e3a8a;
  font-size: 0.75rem;
  line-height: 1.25;
}

.free-ride-detail-list {
  display: grid;
  gap: 6px;
}

.free-ride-detail-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 7px 8px;
}

.free-ride-detail-row.is-ok {
  border-color: rgba(34, 197, 94, 0.22);
}

.free-ride-detail-row.is-warn {
  border-color: rgba(245, 158, 11, 0.24);
}

.free-ride-detail-row.is-bad {
  border-color: rgba(239, 68, 68, 0.2);
}

.free-ride-detail-row.is-selectable {
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.free-ride-detail-row.is-selectable:hover {
  transform: translateY(-1px);
}

.free-ride-detail-row.is-selectable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.free-ride-detail-row.is-selectable.is-selected {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.08);
}

.free-ride-detail-row-index {
  width: 28px;
  height: 22px;
  border-radius: 8px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.free-ride-detail-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.free-ride-detail-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.free-ride-detail-row-word {
  font-size: 0.76rem;
  color: #0f172a;
  line-height: 1.2;
  word-break: break-word;
}

.free-ride-detail-row-score {
  font-size: 0.72rem;
  font-weight: 800;
  color: #1d4ed8;
}

.free-ride-detail-row-meta {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.2;
  word-break: break-word;
}

.free-ride-detail-badge {
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  white-space: nowrap;
}

.free-ride-detail-badge.is-ok {
  color: #166534;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.12);
}

.free-ride-detail-badge.is-warn {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.12);
}

.free-ride-detail-badge.is-bad {
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.1);
}

.free-ride-detail-empty {
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.76rem;
  padding: 10px;
  text-align: center;
}

.free-ride-detail-raw {
  margin-top: 8px;
}

.free-ride-detail-raw summary {
  cursor: pointer;
  font-size: 0.74rem;
  color: #334155;
  font-weight: 700;
}

.free-ride-detail-raw pre {
  margin: 8px 0 0;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px;
  font-size: 0.68rem;
  line-height: 1.25;
  color: #334155;
  max-height: 240px;
  overflow: auto;
}

.free-ride-earned-reward ion-icon {
  font-size: 1.08rem;
  color: #2563eb;
}

.free-ride-transcript:not(.has-text) {
  visibility: hidden;
}

.free-ride-bottom {
  margin-top: 0;
  padding-top: 10px;
  justify-content: center;
  align-items: stretch;
  min-height: 110px;
  flex: 0 0 auto;
}

page-free-ride.free-ride-keyboard-open .free-ride-bottom {
  display: none;
}

.free-ride-voice-actions {
  width: 100%;
  max-width: 268px;
  flex: 0 0 auto;
  min-height: 110px;
}

.speak-step-summary {
  position: relative;
  padding-top: 24px;
}

.summary-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.summary-confetti span {
  position: absolute;
  width: 10px;
  height: 18px;
  border-radius: 4px;
  background: #f59e0b;
  opacity: 0.8;
}

.summary-confetti span:nth-child(1) { top: 10px; left: 20%; background: #f97316; }
.summary-confetti span:nth-child(2) { top: 20px; left: 40%; background: #22c55e; }
.summary-confetti span:nth-child(3) { top: 35px; left: 60%; background: #3b82f6; }
.summary-confetti span:nth-child(4) { top: 12px; left: 70%; background: #facc15; }
.summary-confetti span:nth-child(5) { top: 28px; left: 80%; background: #fb7185; }
.summary-confetti span:nth-child(6) { top: 58px; left: 18%; background: #a855f7; }
.summary-confetti span:nth-child(7) { top: 70px; left: 38%; background: #0ea5e9; }
.summary-confetti span:nth-child(8) { top: 65px; left: 58%; background: #14b8a6; }
.summary-confetti span:nth-child(9) { top: 40px; left: 85%; background: #f59e0b; }
.summary-confetti span:nth-child(10) { top: 85px; left: 72%; background: #f97316; }

.summary-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--speak-ink);
  margin-bottom: 10px;
}

.summary-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f9d58;
}

.summary-score.good {
  color: #0f9d58;
}

.summary-score.okay {
  color: #f59e0b;
}

.summary-score.bad {
  color: #ef4444;
}

.summary-feedback {
  margin: 8px 0;
  font-weight: 600;
  text-align: center;
}

.summary-feedback.good {
  color: #0f9d58;
}

.summary-feedback.okay {
  color: #f59e0b;
}

.summary-feedback.bad {
  color: #ef4444;
}

.summary-reward {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.summary-reward-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--speak-muted);
}

.summary-reward ion-icon {
  font-size: 36px;
  color: #38bdf8;
}

.mascot-cat {
  width: 60px;
  height: 60px;
  background: url('../assets/mascot/mascot-cat.png') center/contain no-repeat;
  display: inline-block;
}

.mascot-cat.mascot-confetti {
  background: url('../assets/mascot/mascot-cat-2.png') center/contain no-repeat;
}

.mascot-cat.mascot-large {
  width: 90px;
  height: 90px;
}

.mascot-cat.mascot-large.mascot-confetti {
  width: 180px;
  height: 180px;
}

.speak-step-sound .mascot-cat {
  width: 90px;
  height: 90px;
}

.training-content {
  --background: #f7f8fc;
}

.training-shell {
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.training-hero h2 {
  margin: 0;
  font-size: 1.4rem;
}

.training-hero p {
  margin: 4px 0 0;
  color: var(--app-muted);
}

.training-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.journey-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reward-badges {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.training-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #334155;
  font-weight: 600;
}

.training-badge ion-icon {
  color: #38bdf8;
}

.training-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.training-pill {
  border: 1px solid #dbe3f2;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--speak-ink);
}

.training-pill.active {
  border-color: #8ab7ff;
  background: #eef5ff;
  color: #1e3a8a;
}

ion-select.training-pill {
  --padding-start: 12px;
  --padding-end: 12px;
  --padding-top: 6px;
  --padding-bottom: 6px;
  --min-height: 34px;
  --border-width: 1px;
  --border-style: solid;
  --border-color: #dbe3f2;
  --border-radius: 999px;
  --background: #ffffff;
  font-size: 0.85rem;
  color: var(--speak-ink);
}

ion-select.training-pill.active {
  --border-color: #8ab7ff;
  --background: #eef5ff;
  color: #1e3a8a;
}

ion-select.training-pill::part(icon) {
  color: #64748b;
}

ion-select.training-pill.active::part(icon) {
  color: #1e3a8a;
}

.training-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.training-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e4e7ef;
  box-shadow: 0 10px 24px rgba(20, 30, 50, 0.06);
  cursor: pointer;
}

.training-row-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7efff;
  color: var(--speak-blue);
}

.training-row-icon-warn {
  background: #ffe8cc;
  color: #f97316;
}

.training-row-icon-good {
  background: #dcfce7;
  color: #0f9d58;
}

.training-row-icon-bad {
  background: #fee2e2;
  color: #ef4444;
}

.training-row-title {
  font-weight: 600;
}

.training-row-sub {
  font-size: 0.8rem;
  color: var(--app-muted);
}

.training-row-status {
  text-align: right;
  font-weight: 600;
  display: flex;
  flex-direction: column;
}

.training-row-status-good {
  color: #0f9d58;
}

.training-row-status-warn {
  color: #f97316;
}

.training-row-status-neutral {
  color: #64748b;
}

.training-row-status-bad {
  color: #ef4444;
}

.training-row-reward {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--app-muted);
}

.training-row-reward ion-icon {
  font-size: 16px;
  color: #38bdf8;
}

.training-row-arrow {
  font-size: 1.1rem;
  color: #9aa6b2;
}

.home-journey {
  --background: #f7f8fc;
}

.journey-shell {
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.journey-title h2 {
  margin: 0;
  padding: 0 2px;
  font-size: clamp(1.08rem, 4.2vw, 1.34rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.journey-title p {
  margin: 4px 0 0;
  color: var(--app-muted);
}

.journey-plan-card {
  min-height: 0;
  padding: 14px;
}

.journey-title + .journey-plan-card {
  margin-top: -8px;
}

.journey-plan-flag-btn {
  top: 14px;
  right: 14px;
}

.journey-plan-card .onboarding-intro-cat {
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

.journey-plan-mascot-wrap {
  width: 44px;
  height: 54px;
  margin-top: 0;
  margin-left: 6px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
}

.journey-plan-bubble {
  margin-top: 8px;
  font-size: clamp(0.95rem, 3.6vw, 1.08rem);
  line-height: 1.24;
  font-weight: 600;
  text-transform: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
  transition:
    color 180ms ease,
    text-shadow 180ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.journey-plan-bubble.is-speaking {
  color: #18212c;
  text-shadow: none;
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  border-color: rgba(80, 145, 255, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 16px rgba(11, 67, 171, 0.12),
    0 0 0 2px rgba(80, 145, 255, 0.12);
  animation: onboarding-hero-bubble-speaking-glow 1.65s ease-in-out infinite;
}

.journey-plan-bubble.is-speaking strong {
  color: #0f57d7;
}

.journey-plan-card + .journey-start {
  margin-top: -10px;
}

.journey-welcome {
  background: #ffffff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 14px 30px rgba(20, 30, 50, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.journey-mascot {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.journey-bubble {
  background: #fff3f3;
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.journey-start {
  display: flex;
  align-items: center;
  gap: 12px;
}

.journey-start-pill {
  background: #eef2ff;
  color: #1e3a8a;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.journey-start-btn {
  border: none;
  background: #22c55e;
  color: #ffffff;
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
}

.journey-start-btn:disabled,
.journey-start-btn.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.journey-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journey-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.journey-accordion .route-item {
  width: 100%;
  margin: 0;
}

.route-item {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid #e4e7ef;
  box-shadow: 0 14px 30px rgba(20, 30, 50, 0.08);
  overflow: hidden;
}

.route-header {
  width: 100%;
  border: none;
  background: #ffb14a;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.route-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.route-progress {
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 2px 8px;
}

.route-progress.good {
  color: #0f9d58;
}

.route-progress.okay {
  color: #f59e0b;
}

.route-progress.bad {
  color: #ef4444;
}

.route-item.is-open .route-header {
  background: #ff9800;
}

.route-header-static {
  cursor: default;
}

.route-header-static ion-icon {
  transform: none !important;
}

.route-header ion-icon {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.route-item.is-open .route-header ion-icon {
  transform: rotate(180deg);
}

.route-note {
  padding: 6px 16px 0;
  font-size: 0.85rem;
  color: var(--app-muted);
}

.route-item:not(.is-open):not(.has-rewards) .route-note {
  padding-bottom: 10px;
}

.route-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 16px 10px;
}

.route-badges .training-badge {
  padding: 3px 8px;
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #475569;
}

.route-badges .training-badge ion-icon {
  font-size: 14px;
  color: #38bdf8;
}

.route-modules {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.route-item.is-open .route-modules {
  max-height: 9000px;
  padding: 10px 14px 16px;
}

.module-item {
  background: #fff7ed;
  border: 1px solid #ffd7aa;
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
}

.module-item + .module-item {
  margin-top: 10px;
}

.module-item.is-open {
  padding-bottom: 10px;
}

.module-item.is-open .module-header {
  background: rgba(255, 255, 255, 0.5);
}

.module-header {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  border-radius: 12px;
  cursor: pointer;
}

.module-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.module-progress {
  font-size: 0.85rem;
  font-weight: 700;
}

.module-progress.good {
  color: #0f9d58;
}

.module-progress.okay {
  color: #f59e0b;
}

.module-progress.bad {
  color: #ef4444;
}

.module-title {
  font-weight: 700;
  color: #b45309;
}

.module-sub {
  font-size: 0.8rem;
  color: #9a3412;
}

.module-header ion-icon {
  color: #b45309;
}

.module-item-neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.module-item-neutral .module-title {
  color: #475569;
}

.module-item-neutral .module-sub {
  color: #64748b;
}

.module-item-neutral .module-header ion-icon {
  color: #94a3b8;
}

.module-item-locked {
  opacity: 0.6;
}

.module-item-locked .module-header {
  cursor: not-allowed;
}

.module-item-locked .module-header ion-icon {
  color: #94a3b8;
}

.module-item.is-active {
  border-color: #2f7cf6;
  box-shadow: 0 10px 20px rgba(47, 124, 246, 0.18);
}

.module-sessions {
  margin: 8px 8px 0;
}

.journey-card {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  background: #ffcc80;
  color: #ffffff;
  text-align: left;
  box-shadow: 0 12px 24px rgba(255, 153, 51, 0.25);
}

.journey-card.is-active {
  background: #ff9800;
}

.journey-card-title {
  font-weight: 700;
}

.journey-card-sub {
  font-size: 0.85rem;
  opacity: 0.9;
}

.journey-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.journey-section-title {
  font-weight: 700;
}

.journey-section-note {
  font-size: 0.85rem;
  color: var(--app-muted);
}

@media (min-width: 720px) {
  .page-shell {
    max-width: 640px;
    margin: 0 auto;
  }

  .onboarding-shell {
    max-width: 640px;
    margin: 0 auto;
  }

  .speak-shell {
    max-width: 640px;
    margin: 0 auto;
  }

  .speak-step-arrow-btn {
    width: 48px;
    min-width: 48px;
  }

  .training-shell,
  .journey-shell {
    max-width: 640px;
    margin: 0 auto;
  }
}
