:root {
  --bg: #ffffff;
  --bg-strong: #fafafa;
  --panel: rgba(255, 255, 255, 0.98);
  --panel-strong: #ffffff;
  --ink: #2b1820;
  --ink-soft: #4f4045;
  --muted: #7b7074;
  --line: rgba(17, 17, 17, 0.08);
  --primary: #f40d30;
  --primary-strong: #d70b2a;
  --primary-soft: #f4f4f4;
  --shadow: 0 24px 72px rgba(17, 17, 17, 0.08);
  --shadow-soft: 0 12px 28px rgba(17, 17, 17, 0.06);
  --success: #f40d30;
  --warning: #f40d30;
  --danger: #d70b2a;
  --accent: #f40d30;
  --accent-soft: #f4f4f4;
  --warm: #f40d30;
  --radius-xl: 2rem;
  --radius-lg: 1.5rem;
  --body-font: "Plus Jakarta Sans", "Segoe UI", "Aptos", "Trebuchet MS", sans-serif;
  --display-font: "Plus Jakarta Sans", "Segoe UI", "Aptos", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body-font);
  background: var(--bg);
}

body::before {
  content: none;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(1760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

body.auth-modal-open {
  overflow: hidden;
}

.app-shell.is-auth-modal-open > :not(.auth-overlay) {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.auth-panel {
  position: relative;
  width: min(100%, 760px);
  margin: auto 0;
  padding: 32px;
  border-radius: 2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.auth-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.auth-panel-copy h2 {
  margin: 10px 0 0;
  font-family: var(--display-font);
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.auth-intro-text {
  margin-top: 18px;
  max-width: none;
}

.auth-mode-toggle,
.auth-request-row,
.session-summary {
  display: flex;
  align-items: center;
}

.auth-mode-toggle {
  gap: 12px;
  margin-top: 24px;
}

.auth-mode-button {
  min-height: 46px;
}

.auth-mode-button.is-active {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-request-row {
  gap: 14px;
  align-items: end;
}

.auth-inline-button {
  min-width: 170px;
}

.auth-field {
  display: grid;
  gap: 10px;
}

.auth-field span,
.usage-window-title,
.usage-metric span,
.session-summary-copy span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-input:focus {
  outline: none;
  border-color: rgba(244, 13, 48, 0.35);
  box-shadow: 0 0 0 4px rgba(244, 13, 48, 0.12);
}

.auth-code-field {
  flex: 1 1 0;
}

.auth-submit {
  justify-self: start;
  min-width: 190px;
}

.auth-helper,
.auth-status,
.usage-user-meta,
.usage-window-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.auth-helper {
  margin-top: -2px;
  font-size: 0.9rem;
}

.auth-status {
  margin-top: 18px;
  min-height: 1.6rem;
  font-weight: 700;
}

.auth-status.is-danger {
  color: var(--danger);
}

.auth-status.is-success {
  color: var(--primary-strong);
}

.hero-section {
  display: block;
  margin-bottom: 34px;
}

.hero-copy {
  max-width: none;
  padding: 8px 0 0;
  animation: rise-in 0.72s ease;
}

.brand-row,
.brand,
.hero-nav,
.hero-actions,
.hero-stat-grid,
.panel-header,
.header-meta,
.sentence-focus,
.workspace-card-head,
.control-row {
  display: flex;
  align-items: center;
}

.brand-row {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.brand-actions {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.header-login-button {
  min-height: 42px;
  padding: 0 18px;
}

.brand {
  gap: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  background: var(--primary);
  color: #fff;
  font-family: var(--display-font);
  font-size: 1.36rem;
  font-weight: 800;
  box-shadow: 0 18px 36px rgba(244, 13, 48, 0.2);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 1.24rem;
  font-weight: 800;
}

.brand-text span {
  color: var(--muted);
  font-size: 1rem;
}

.hero-nav {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.session-summary {
  gap: 14px;
  padding: 12px 14px;
  border-radius: 1.4rem;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.session-summary-copy {
  display: grid;
  gap: 2px;
}

.session-summary-copy strong {
  font-size: 0.96rem;
  line-height: 1.2;
}

.session-logout-button {
  min-height: 42px;
  padding: 0 16px;
}

.session-admin-button {
  min-height: 42px;
  padding: 0 16px;
}

.hero-nav-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(244, 13, 48, 0.06);
}

.hero-nav-pill:last-child {
  background: var(--primary-soft);
}

.meta-pill {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.hero-body h1,
.panel-header h2 {
  margin: 0;
  font-family: var(--display-font);
  letter-spacing: -0.04em;
}

.eyebrow,
.section-kicker,
.card-kicker,
.sentence-label,
.score-label,
.status-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--warm);
}

.hero-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 2.8vw, 44px);
  align-items: start;
}

.hero-main,
.hero-side {
  min-width: 0;
}

.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 10px;
  min-height: 100%;
}

.hero-side {
  display: grid;
  gap: 16px;
  grid-auto-rows: min-content;
  align-content: start;
}

.hero-body h1 {
  max-width: none;
  font-size: clamp(1.6rem, 2.9vw, 3.1rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
  margin-top: 14px;
}

.hero-text {
  max-width: 42rem;
  margin: 24px 0 0;
  font-size: 1.04rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.hero-actions {
  gap: 18px;
  margin-top: 30px;
}

.hero-button {
  min-width: 170px;
}

.hero-cartoon {
  position: relative;
  width: min(100%, 600px);
  min-height: 280px;
  margin-top: auto;
  padding: 22px 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.hero-cartoon-glow {
  position: absolute;
  right: 52px;
  bottom: 36px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: rgba(244, 13, 48, 0.08);
  filter: blur(6px);
}

.hero-cartoon-stage {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 30px;
  height: 16px;
  border-radius: 999px;
  background: rgba(244, 13, 48, 0.1);
}

.hero-cartoon-bubble {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 56px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(244, 13, 48, 0.1);
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 22px rgba(244, 13, 48, 0.08);
  animation: float-bubble 4.2s ease-in-out infinite;
}

.hero-cartoon-bubble--one {
  top: 34px;
  left: 52px;
  animation-delay: 0s;
}

.hero-cartoon-bubble--two {
  top: 20px;
  right: 136px;
  animation-delay: 0.9s;
}

.hero-cartoon-bubble--three {
  right: 42px;
  bottom: 96px;
  animation-delay: 1.8s;
}

.hero-cartoon-character {
  position: absolute;
  left: 58px;
  bottom: 42px;
  width: 168px;
  height: 186px;
  animation: mascot-bob 3.8s ease-in-out infinite;
}

.hero-cartoon-head {
  position: absolute;
  top: 0;
  left: 28px;
  width: 104px;
  height: 100px;
  border-radius: 40px 40px 36px 36px;
  background: #ffe2d7;
  box-shadow: inset 0 -10px 0 rgba(255, 255, 255, 0.22);
}

.hero-cartoon-face {
  position: absolute;
  inset: 0;
}

.hero-cartoon-fringe {
  position: absolute;
  top: -4px;
  left: 0;
  width: 104px;
  height: 42px;
  border-radius: 40px 40px 18px 18px;
  background: #37242b;
}

.hero-cartoon-face::before,
.hero-cartoon-face::after {
  content: "";
  position: absolute;
  top: 28px;
  width: 18px;
  height: 28px;
  border-radius: 18px;
  background: #37242b;
}

.hero-cartoon-face::before {
  left: -6px;
}

.hero-cartoon-face::after {
  right: -6px;
}

.hero-cartoon-eye {
  position: absolute;
  top: 46px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #37242b;
  transform-origin: center;
  animation: blink-eye 5s infinite;
}

.hero-cartoon-eye--left {
  left: 30px;
}

.hero-cartoon-eye--right {
  right: 30px;
}

.hero-cartoon-mouth {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 26px;
  height: 12px;
  border-bottom: 4px solid var(--primary);
  border-radius: 0 0 18px 18px;
  transform: translateX(-50%);
}

.hero-cartoon-neck {
  position: absolute;
  top: 88px;
  left: 73px;
  width: 16px;
  height: 18px;
  border-radius: 0 0 8px 8px;
  background: #ffd7c9;
}

.hero-cartoon-body {
  position: absolute;
  left: 28px;
  bottom: 20px;
  width: 112px;
  height: 96px;
  border-radius: 36px 36px 28px 28px;
  background: var(--primary);
}

.hero-cartoon-body::before,
.hero-cartoon-body::after {
  content: "";
  position: absolute;
  top: 18px;
  width: 24px;
  height: 66px;
  border-radius: 20px;
  background: var(--primary);
}

.hero-cartoon-body::before {
  left: -10px;
  transform: rotate(24deg);
}

.hero-cartoon-body::after {
  right: -14px;
  transform: rotate(-34deg);
  transform-origin: top center;
  animation: wave-hand 2.6s ease-in-out infinite;
}

.hero-cartoon-book {
  position: absolute;
  right: -2px;
  bottom: 26px;
  width: 58px;
  height: 48px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(244, 13, 48, 0.14);
  box-shadow: 0 10px 20px rgba(244, 13, 48, 0.08);
  transform: rotate(-12deg);
}

.hero-cartoon-book::before,
.hero-cartoon-book::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 13, 48, 0.2);
}

.hero-cartoon-book::before {
  top: 14px;
}

.hero-cartoon-book::after {
  top: 24px;
}

.hero-cartoon-card {
  position: absolute;
  right: 56px;
  bottom: 52px;
  width: 192px;
  padding: 22px 18px 18px;
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(244, 13, 48, 0.14);
  box-shadow: 0 20px 34px rgba(244, 13, 48, 0.1);
  animation: float-card 4.6s ease-in-out infinite;
}

.hero-cartoon-card-badge {
  display: block;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: rgba(244, 13, 48, 0.12);
}

.hero-cartoon-card-line {
  display: block;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(244, 13, 48, 0.12);
}

.hero-cartoon-card-line--strong {
  width: 78%;
  margin-top: 0;
  background: rgba(244, 13, 48, 0.18);
}

.hero-cartoon-card-line--short {
  width: 54%;
}

.hero-note {
  max-width: none;
  margin: 0;
  min-height: 0;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-soft);
  line-height: 1.66;
  box-shadow: var(--shadow-soft);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 0;
}

.hero-stat {
  min-height: 152px;
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-stat:last-child {
  grid-column: 1 / -1;
}

.hero-stat:nth-child(1) {
  background: var(--panel);
}

.hero-stat:nth-child(2) {
  background: var(--bg-strong);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-stat:nth-child(2) .hero-stat-value,
.hero-stat:nth-child(2) .hero-stat-label {
  color: inherit;
}

.hero-stat:nth-child(3) {
  background: var(--panel);
}

.hero-stat:nth-child(1) .hero-stat-value {
  color: #f40d30;
}

.hero-stat:nth-child(2) .hero-stat-value {
  color: #f40d30;
}

.hero-stat:nth-child(3) .hero-stat-value {
  color: #f40d30;
}

.hero-stat-value {
  margin: 0;
  font-family: var(--display-font);
  font-size: 2.08rem;
  font-weight: 800;
}

.hero-stat-label,
.card-body-text,
.result-text,
.status-text,
.footnote,
.sentence-subtext,
.typed-label,
.meta-note {
  color: var(--muted);
  line-height: 1.7;
}

.hero-stat-label {
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.panel,
.workspace-card,
.score-card,
.status-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.panel::before,
.workspace-card::before,
.score-card::before,
.status-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: none;
}

.workspace-card-head p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ink);
}

.workspace-card-head,
.panel-header {
  justify-content: space-between;
  gap: 12px;
}

.workspace-card-head {
  flex-direction: column;
  align-items: flex-start;
}

.workspace-card-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.workspace {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 22px;
  align-items: start;
  margin-top: 24px;
  padding: 24px;
  border-radius: 2.8rem;
  background: var(--bg-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.workspace::before {
  content: none;
}

.panel {
  padding: 26px;
  background: var(--panel);
  animation: rise-in 0.76s ease;
}

.studio-panel {
  min-width: 0;
}

.panel-header {
  justify-content: space-between;
  gap: 18px;
}

.panel-header h2 {
  margin-top: 10px;
  font-size: clamp(2.1rem, 3vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.header-meta {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.header-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.top-language-picker {
  display: grid;
  gap: 8px;
}

.top-language-picker span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
}

.top-language-select {
  min-width: 128px;
  width: 128px;
  min-height: 48px;
  border-radius: 20px;
}

.meta-note {
  font-size: 0.9rem;
}

.sentence-focus {
  position: relative;
  overflow: hidden;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  border: 2px solid rgba(244, 13, 48, 0.16);
  box-shadow:
    0 18px 42px rgba(244, 13, 48, 0.08),
    0 0 0 8px rgba(244, 13, 48, 0.03);
}

.sentence-focus::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  right: 26px;
  height: 5px;
  border-radius: 0 0 999px 999px;
  background: var(--primary);
}

.sentence-focus-copy {
  min-width: 0;
  max-width: min(100%, 880px);
}

.sentence-focus .sentence-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(244, 13, 48, 0.08);
  border: 1px solid rgba(244, 13, 48, 0.14);
}

.sentence-text {
  margin: 14px 0 10px;
  font-family: var(--display-font);
  font-size: clamp(2.6rem, 4.2vw, 4.9rem);
  line-height: 1.02;
  color: var(--ink);
  text-shadow:
    0 0 1px rgba(244, 13, 48, 0.18),
    0 0 12px rgba(244, 13, 48, 0.12),
    0 0 28px rgba(244, 13, 48, 0.08);
}

.sentence-subtext {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.play-button {
  align-self: flex-start;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid rgba(244, 13, 48, 0.18);
  box-shadow: 0 10px 24px rgba(244, 13, 48, 0.08);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 16px;
  margin-top: 18px;
}

.workspace-card,
.score-card,
.status-box {
  padding: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.action-card {
  background: var(--panel-strong);
}

.voice-card {
  background: var(--panel-strong);
}

.typed-card {
  background: var(--panel-strong);
}

.voice-card,
.typed-card {
  min-width: 0;
}

.card-body-text {
  margin: 14px 0 0;
}

.difficulty-field {
  display: block;
  margin-top: 0;
}

.difficulty-field span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.difficulty-select {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.difficulty-select:focus {
  outline: none;
  border-color: rgba(244, 13, 48, 0.35);
  box-shadow: 0 0 0 4px rgba(244, 13, 48, 0.12);
}

.difficulty-select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.typed-label {
  display: block;
  margin-top: 14px;
  font-size: 0.9rem;
}

.typed-answer {
  width: 100%;
  min-height: 148px;
  margin-top: 10px;
  padding: 16px 18px;
  resize: vertical;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg-strong);
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.typed-answer:focus {
  outline: none;
  border-color: rgba(244, 13, 48, 0.35);
  box-shadow: 0 0 0 4px rgba(244, 13, 48, 0.12);
}

.control-row {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.button.primary {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 16px 34px rgba(244, 13, 48, 0.2);
}

.button.secondary {
  color: var(--ink);
  background: var(--primary-soft);
}

.button.ghost,
.button.subtle {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
}

.record-button {
  margin-top: 16px;
  width: 100%;
}

.record-button.is-recording {
  background: var(--primary);
  position: relative;
}

.record-button.is-recording::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 2px solid rgba(244, 13, 48, 0.18);
  animation: pulse-ring 1.5s ease-out infinite;
}

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

.usage-card {
  display: grid;
  gap: 16px;
}

.usage-user-meta {
  margin-top: -4px;
}

.usage-metric-grid,
.usage-window-grid {
  display: grid;
  gap: 12px;
}

.usage-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.usage-metric,
.usage-window {
  padding: 16px;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
  background: var(--bg-strong);
}

.usage-metric {
  display: grid;
  gap: 8px;
}

.usage-metric strong,
.usage-window-value {
  margin: 0;
  font-family: var(--display-font);
  font-size: 1.55rem;
  line-height: 1;
}

.usage-window-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.usage-window {
  display: grid;
  gap: 10px;
}

.usage-window-title {
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.usage-window-value {
  font-size: 1.18rem;
  color: var(--ink);
}

.usage-user-list {
  display: grid;
  gap: 10px;
}

.usage-list-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.usage-leaderboard {
  display: grid;
  gap: 10px;
}

.usage-leaderboard-empty {
  margin: 0;
  color: var(--muted);
}

.usage-leaderboard-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 1.2rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.usage-leaderboard-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

.usage-leaderboard-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.usage-leaderboard-copy strong {
  font-size: 0.94rem;
}

.usage-leaderboard-copy span,
.usage-leaderboard-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.usage-leaderboard-summary {
  text-align: right;
}

.admin-page .app-shell {
  padding-bottom: 72px;
}

.admin-header {
  margin-bottom: 18px;
}

.admin-header-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-access-card,
.admin-dashboard {
  display: grid;
  gap: 18px;
}

.admin-intro-card {
  display: grid;
  gap: 16px;
}

.admin-generated-at {
  text-align: right;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
}

.admin-users-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: var(--panel);
}

.admin-users-table th,
.admin-users-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-users-table th {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-strong);
}

.admin-users-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-user-cell {
  display: grid;
  gap: 4px;
}

.admin-user-cell strong {
  font-size: 0.95rem;
}

.admin-user-cell span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.score-card {
  min-width: 0;
}

.score-card.highlight {
  background: var(--bg-strong);
}

.score-card:nth-child(1) {
  background: var(--panel-strong);
}

.score-card:nth-child(2) {
  background: var(--panel-strong);
}

.score-value {
  margin: 10px 0 0;
  font-family: var(--display-font);
  font-size: 2rem;
  line-height: 1;
}

.score-verdict {
  font-size: 1.2rem;
  line-height: 1.35;
}

.status-box.is-success {
  background: var(--panel);
  border-color: rgba(244, 13, 48, 0.18);
}

.status-box.is-warning {
  background: var(--panel);
  border-color: rgba(244, 13, 48, 0.18);
}

.status-box.is-danger {
  background: var(--panel);
  border-color: rgba(244, 13, 48, 0.22);
}

.status-text {
  margin: 12px 0 0;
}

.result-card {
  min-width: 0;
}

.coach-panel .result-card:nth-of-type(1) {
  background: var(--panel-strong);
}

.coach-panel .result-card:nth-of-type(2) {
  background: var(--panel-strong);
}

.result-text {
  margin: 14px 0 0;
}

.result-text.is-concealed {
  color: var(--muted);
}

.ideal-card {
  background: var(--bg-strong);
}

.reveal-answer-button {
  min-height: 42px;
  padding: 0 18px;
  margin-top: 4px;
}

.footnote {
  margin: 2px 6px 0;
  font-size: 0.93rem;
}

/* Speaking page redesign */
.practice-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 0;
  align-items: stretch;
  margin-top: 24px;
  padding: 0;
  overflow: hidden;
  border-radius: 2rem;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.practice-main,
.practice-side {
  min-width: 0;
}

.practice-main {
  padding: 36px 40px;
  border-right: 1px solid var(--line);
  background: var(--panel-strong);
}

.practice-side {
  padding: 28px 24px;
  background: var(--panel-strong);
}

.practice-hero-tag,
.practice-section-label,
.practice-card-title,
.source-label,
.ctrl-label,
.sc-label,
.insights-title,
.period-label,
.status-head,
.info-head {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.68rem;
  font-weight: 500;
}

.practice-hero-tag {
  color: var(--primary);
}

.practice-hero-title {
  margin: 12px 0 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2.1rem, 3.1vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #0d0d0d;
}

.practice-hero-title em {
  font-style: italic;
  color: var(--primary);
}

.practice-hero-sub {
  max-width: 28rem;
  margin: 14px 0 0;
  font-family: "DM Sans", var(--body-font);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--muted);
}

.practice-stats-row {
  display: flex;
  gap: 32px;
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.practice-stat-item {
  display: grid;
  gap: 4px;
}

.practice-stat-num {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--primary);
}

.practice-stat-lbl {
  max-width: 110px;
  font-size: 0.7rem;
  line-height: 1.35;
  color: var(--muted);
}

.practice-section-label,
.insights-title {
  margin-bottom: 16px;
  color: var(--muted);
}

.practice-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
}

.practice-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.practice-card-title {
  color: var(--muted);
}

.practice-card-meta {
  font-size: 0.7rem;
  color: #b1a7aa;
}

.practice-card-body {
  padding: 28px 24px 24px;
}

.prompt-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.prompt-left {
  min-width: 0;
  flex: 1;
}

.practice-prompt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
}

.practice-prompt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 2s infinite;
}

.practice-sentence {
  margin: 0 0 8px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2.45rem, 4vw, 4rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: #0d0d0d;
}

.practice-context {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.prompt-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.source-picker {
  display: grid;
  gap: 6px;
}

.source-label {
  color: var(--muted);
}

.ctrl-select,
.ctrl-select-full {
  width: 140px;
  padding: 7px 32px 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: var(--panel-strong);
  color: #0d0d0d;
  font-family: "DM Sans", var(--body-font);
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.ctrl-select-full {
  width: 100%;
  margin-bottom: 8px;
}

.ctrl-select:focus,
.ctrl-select-full:focus,
.type-area:focus {
  border-color: rgba(200, 16, 46, 0.28);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.08);
}

.ctrl-select:disabled,
.ctrl-select-full:disabled,
.type-area:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.sentence-count {
  font-size: 0.7rem;
  color: var(--muted);
}

.hear-btn,
.record-btn,
.submit-btn,
.ctrl-btn,
.reveal-btn {
  font-family: "DM Sans", var(--body-font);
}

.hear-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  color: var(--ink-soft);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.hear-btn:hover {
  background: #f0f0f0;
  border-color: rgba(17, 17, 17, 0.2);
}

.controls-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ctrl-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.ctrl-card-voice {
  display: flex;
  flex-direction: column;
}

.ctrl-label {
  margin-bottom: 10px;
  color: var(--muted);
}

.ctrl-sublabel {
  margin-bottom: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}

.ctrl-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-btn {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ctrl-btn:hover {
  background: #f0f0f0;
  border-color: rgba(17, 17, 17, 0.2);
}

.ctrl-desc {
  margin: 0 0 12px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}

.ctrl-desc-tight {
  margin-bottom: 8px;
}

.record-btn {
  width: 100%;
  margin-top: auto;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.record-btn:hover,
.submit-btn:hover,
.reveal-btn:hover {
  opacity: 0.9;
}

.record-btn.is-recording {
  background: var(--primary-strong);
}

.type-area {
  width: 100%;
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: #0d0d0d;
  font-family: "DM Sans", var(--body-font);
  font-size: 0.82rem;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.type-area::placeholder {
  color: #bbb;
}

.submit-btn,
.reveal-btn {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.submit-btn:hover,
.reveal-btn:hover {
  background: #fafafa;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.practice-side .score-card {
  padding: 14px 16px;
  border-radius: 8px;
  border: 0;
  background: #fafafa;
  box-shadow: none;
}

.practice-side .score-card.verdict {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sc-label,
.period-label,
.status-head,
.info-head {
  color: var(--muted);
}

.sc-num,
.time-val {
  font-family: "DM Serif Display", Georgia, serif;
  line-height: 1;
  color: #0d0d0d;
}

.sc-num {
  margin-top: 6px;
  font-size: 1.75rem;
}

.sc-verdict {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.verdict-badge {
  white-space: nowrap;
  padding: 5px 12px;
  border: 1px solid #fcdde1;
  border-radius: 20px;
  background: #fff0f2;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 500;
}

.user-meta {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fafafa;
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.m-card,
.time-card,
.period-card {
  border-radius: 8px;
  background: #fafafa;
}

.m-card {
  padding: 12px;
  text-align: center;
}

.m-val {
  margin-bottom: 3px;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 1.35rem;
  line-height: 1;
  color: #0d0d0d;
}

.m-lbl,
.time-lbl {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.time-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 16px;
}

.time-val {
  font-size: 1.25rem;
}

.period-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.period-card {
  padding: 14px;
}

.period-attempts {
  margin-bottom: 3px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0d0d0d;
}

.period-sub {
  font-size: 0.68rem;
  line-height: 1.45;
  color: #bbb;
}

.status-box.status-block {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #fcdde1;
  border-radius: 8px;
  background: #fff0f2;
  box-shadow: none;
}

.practice-workspace .status-box.is-success,
.practice-workspace .status-box.is-warning,
.practice-workspace .status-box.is-danger {
  background: #fff0f2;
  border-color: #fcdde1;
}

.practice-workspace .status-box::before {
  content: none;
}

.status-text {
  margin-top: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.info-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.info-block.last {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.info-meta {
  margin-top: 6px;
  font-size: 0.7rem;
  color: #bbb;
}

.info-text {
  margin-top: 8px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.info-text.is-concealed {
  color: var(--muted);
}

.practice-voice-note {
  margin: 16px 0 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: var(--muted);
}

.practice-workspace button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-card {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes float-bubble {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes mascot-bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes blink-eye {
  0%,
  44%,
  100% {
    transform: scaleY(1);
  }

  46%,
  48% {
    transform: scaleY(0.14);
  }
}

@keyframes wave-hand {
  0%,
  100% {
    transform: rotate(-34deg);
  }

  50% {
    transform: rotate(-14deg);
  }
}

@keyframes pulse-ring {
  from {
    opacity: 0.85;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.05);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    width: min(100% - 24px, 1760px);
    padding-top: 22px;
  }

  .hero-body,
  .hero-stat-grid,
  .workspace,
  .score-grid,
  .studio-grid,
  .usage-metric-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .sentence-focus {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-meta {
    justify-items: start;
  }

  .header-meta-row {
    justify-content: flex-start;
  }

  .workspace {
    padding: 20px;
  }

  .hero-cartoon {
    width: 100%;
    min-height: 240px;
    margin-top: 26px;
  }

  .hero-cartoon-card {
    right: 28px;
    width: 168px;
  }

}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 20px, 1760px);
    padding-bottom: 32px;
  }

  .brand-row,
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-actions,
  .session-summary,
  .auth-request-row,
  .admin-header-actions {
    width: 100%;
  }

  .brand-actions {
    justify-items: stretch;
  }

  .top-language-select {
    width: 100%;
  }

  .auth-panel {
    padding: 24px 20px;
  }

  .auth-close-button {
    top: 14px;
    right: 14px;
  }

  .auth-inline-grid,
  .usage-window-grid {
    grid-template-columns: 1fr;
  }

  .auth-request-row,
  .session-summary,
  .admin-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-submit,
  .auth-inline-button,
  .session-logout-button,
  .session-admin-button {
    width: 100%;
  }

  .usage-leaderboard-item {
    grid-template-columns: auto 1fr;
  }

  .usage-leaderboard-summary {
    grid-column: 1 / -1;
    text-align: left;
  }

  .hero-body h1 {
    max-width: none;
    font-size: clamp(1.25rem, 5.5vw, 2rem);
  }

  .hero-cartoon {
    min-height: 210px;
    padding: 18px;
  }

  .hero-cartoon-bubble--two,
  .hero-cartoon-bubble--three {
    display: none;
  }

  .hero-cartoon-character {
    left: 20px;
    bottom: 30px;
    scale: 0.86;
    transform-origin: left bottom;
  }

  .hero-cartoon-card {
    right: 16px;
    bottom: 40px;
    width: 140px;
    padding: 18px 14px 14px;
  }

  .panel,
  .workspace-card,
  .score-card,
  .status-box {
    border-radius: 1.5rem;
  }

  .control-row {
    flex-direction: column;
  }

  .control-row .button,
  .button.hero-button,
  .play-button {
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .practice-workspace {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .practice-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .practice-side {
    padding-top: 24px;
  }
}

@media (max-width: 900px) {
  .practice-workspace {
    padding: 0;
  }

  .practice-main {
    padding: 28px 24px;
  }

  .practice-side {
    padding: 24px 20px;
  }

  .practice-stats-row,
  .prompt-top,
  .controls-row,
  .metrics-grid,
  .period-grid {
    grid-template-columns: 1fr;
  }

  .practice-stats-row {
    display: grid;
    gap: 16px;
  }

  .prompt-right {
    width: 100%;
    align-items: flex-start;
  }

  .ctrl-select,
  .ctrl-select-full {
    width: 100%;
  }
}
