:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --text: #202124;
  --accent: #2f80ed;
  --muted: #6f7581;
  --shadow-soft: 0 20px 44px rgba(26, 53, 85, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(77, 151, 255, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 181, 119, 0.16), transparent 24%),
    linear-gradient(180deg, #f3f7fb 0%, #eef4fb 100%);
  color: var(--text);
}

.app-container {
  width: min(1320px , 95vw);
  margin: 2rem auto 2.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 225, 232, 0.9);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.auth-page-shell {
  max-width: 1120px;
}

.page-header {
  margin-bottom: 1.25rem;
}

.page-header-compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
}

.page-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4973a4;
}

h1 {
  margin: 0;
  color: #10365a;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
}

.page-subtitle {
  max-width: 52rem;
  margin: 0.85rem 0 0;
  color: #5e6e82;
  font-size: 1.02rem;
  line-height: 1.65;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 1.25rem;
  align-items: start;
}

.sheet-panel,
.speech-panel {
  min-width: 0;
}

.sheet-panel {
  border: 1px solid #dce1e8;
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.panel-header {
  margin-bottom: 0.75rem;
}

.panel-header h2 {
  margin: 0;
  color: #10365a;
}

.auth-panel {
  margin: 0 0 1rem;
  border: 1px solid rgba(206, 220, 238, 0.95);
  border-radius: 24px;
  padding: 1.25rem;
  background:
    radial-gradient(circle at top left, rgba(110, 172, 255, 0.18), transparent 26%),
    linear-gradient(135deg, #f7fbff 0%, #eff6ff 48%, #fff8f2 100%);
  box-shadow: 0 18px 34px rgba(38, 69, 104, 0.08);
}

.auth-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.9fr);
  gap: 1.25rem;
  align-items: stretch;
}

.auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.85rem 0.35rem 0.85rem 0.15rem;
}

.auth-eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5b7da8;
}

.auth-copy h2 {
  margin: 0;
  max-width: 12ch;
  color: #133b61;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1.08;
}

.auth-lead {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: #5e6e82;
  font-size: 1rem;
  line-height: 1.75;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.auth-highlight {
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(174, 198, 226, 0.9);
  background: rgba(255, 255, 255, 0.62);
  color: #244767;
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-card {
  padding: 1.15rem;
  border: 1px solid rgba(204, 218, 236, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 32px rgba(35, 65, 95, 0.09);
}

.auth-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.auth-card-header h3 {
  margin: 0;
  color: #133b61;
  font-size: 1.15rem;
}

.auth-status {
  font-weight: 600;
  color: #23415f;
  text-align: right;
  max-width: 16rem;
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.auth-form-signup {
  margin-top: 0.85rem;
}

.auth-switch {
  margin: 0.9rem 0 0;
  color: #5e6e82;
  line-height: 1.5;
}

.auth-text-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #1c6fd5;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.auth-text-button:hover {
  color: #0f4f96;
}

.auth-form input {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border: 1px solid #d3dce8;
  border-radius: 12px;
  font: inherit;
  background: rgba(249, 251, 255, 0.95);
}

.auth-form input:focus {
  outline: 2px solid rgba(47, 128, 237, 0.22);
  outline-offset: 1px;
  border-color: #8bb8f1;
}

.auth-form button,
.auth-logout-button,
.auth-google-button {
  appearance: none;
  border: 1px solid #bfd0e6;
  border-radius: 12px;
  padding: 0.82rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #23415f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.auth-form button:hover,
.auth-logout-button:hover,
.auth-google-button:hover {
  border-color: #8fb4df;
  box-shadow: 0 10px 20px rgba(47, 128, 237, 0.1);
  transform: translateY(-1px);
}

.auth-form button {
  grid-column: span 2;
  background: linear-gradient(180deg, #1f7ff2 0%, #1668cf 100%);
  border-color: #206fca;
  color: #fff;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.auth-google-button {
  flex: 1 1 220px;
  border-color: #e0cabd;
  background: linear-gradient(180deg, #fff8f5 0%, #fff0e8 100%);
}

.auth-continue-button {
  flex: 1 1 220px;
}

.auth-logout-button {
  flex: 1 1 180px;
}

.auth-message {
  min-height: 1.25rem;
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.exercise-drawer {
  margin: 0 0 1rem;
  border: 1px solid #dce1e8;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(246, 250, 255, 0.94) 100%);
  overflow: hidden;
}

.exercise-drawer-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  color: #10365a;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.exercise-drawer-toggle:hover {
  background: rgba(232, 242, 255, 0.45);
}

.exercise-drawer-copy {
  display: grid;
  gap: 0.2rem;
}

.exercise-drawer-summary {
  color: #5c6d7f;
  font-size: 0.95rem;
}

.exercise-drawer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #bfd0e6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #0f4f96;
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform 180ms ease, background 140ms ease;
}

.exercise-drawer-toggle[aria-expanded="true"] .exercise-drawer-icon {
  transform: rotate(45deg);
}

.exercise-drawer-panel {
  border-top: 1px solid rgba(220, 225, 232, 0.95);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
  opacity: 1;
  max-height: 1200px;
  transition: max-height 240ms ease, opacity 180ms ease, padding-top 180ms ease, padding-bottom 180ms ease;
  will-change: max-height, opacity;
}

.exercise-drawer-panel.is-collapsed {
  opacity: 0;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .exercise-drawer-icon,
  .exercise-drawer-panel {
    transition: none;
  }
}

.clef-selector {
  margin: 0 0 1rem;
  border: 1px solid #dce1e8;
  border-radius: 18px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.74);
}

.exercise-selector {
  margin: 0 0 1rem;
  border: 1px solid #dce1e8;
  border-radius: 18px;
  padding: 0.9rem 1rem 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(246, 250, 255, 0.9) 100%);
}

.exercise-selector-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
}

.exercise-setting-group {
  display: grid;
  gap: 0.75rem;
}

.exercise-setting-group.is-disabled {
  opacity: 0.52;
}

.exercise-setting-group.is-disabled .setting-button,
.exercise-setting-group.is-disabled .level-radio-option span {
  cursor: not-allowed;
  transform: none;
}

.exercise-setting-group h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #10365a;
}

.setting-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.setting-button {
  appearance: none;
  border: 1px solid #bfd0e6;
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #23415f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.setting-button:hover {
  border-color: #8fb4df;
  transform: translateY(-1px);
}

.setting-button.is-active {
  border-color: #2f80ed;
  background: linear-gradient(180deg, #e9f3ff 0%, #d8ebff 100%);
  color: #0f4f96;
}

.level-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.level-radio-option {
  position: relative;
  display: inline-flex;
}

.level-radio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.level-radio-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  min-height: 2.7rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid #bfd0e6;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #23415f;
  font-weight: 700;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.level-radio-option:hover span {
  border-color: #8fb4df;
  transform: translateY(-1px);
}

.level-radio-option input:checked + span {
  border-color: #2f80ed;
  background: linear-gradient(180deg, #e9f3ff 0%, #d8ebff 100%);
  color: #0f4f96;
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: min(100%, 420px);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(206, 220, 238, 0.95);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(245, 250, 255, 0.92) 100%);
}

.account-strip-copy {
  min-width: 0;
}

.account-strip-status {
  display: block;
  color: #133b61;
}

.account-strip-message {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.account-strip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.account-strip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.82rem 1rem;
  border: 1px solid #bfd0e6;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #23415f;
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.account-strip-link:hover {
  border-color: #8fb4df;
  box-shadow: 0 10px 20px rgba(47, 128, 237, 0.1);
  transform: translateY(-1px);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.3fr);
  gap: 1.25rem;
}

.admin-panel {
  border: 1px solid #dce1e8;
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
}

.admin-toolbar {
  margin-bottom: 0.9rem;
}

.admin-toolbar input {
  width: 100%;
  padding: 0.82rem 0.9rem;
  border: 1px solid #d3dce8;
  border-radius: 12px;
  font: inherit;
  background: rgba(249, 251, 255, 0.95);
}

.admin-user-list,
.admin-score-list {
  display: grid;
  gap: 0.75rem;
}

.admin-user-card {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  padding: 0.9rem;
  border: 1px solid #dce1e8;
  border-radius: 14px;
  background: #fff;
  color: #23415f;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.admin-user-card:hover,
.admin-user-card.is-active {
  border-color: #8fb4df;
  box-shadow: 0 10px 20px rgba(47, 128, 237, 0.08);
  transform: translateY(-1px);
}

.admin-user-card strong {
  color: #10365a;
}

.admin-detail {
  display: grid;
  gap: 1rem;
}

.admin-detail-card {
  padding: 1rem;
  border: 1px solid #dce1e8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.admin-detail-card h3 {
  margin: 0 0 0.75rem;
  color: #10365a;
}

.admin-detail-card p {
  margin: 0.35rem 0;
  color: #425466;
}

.admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-action-button {
  appearance: none;
  border: 1px solid #bfd0e6;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #23415f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.admin-action-danger {
  border-color: #f0b8b8;
  background: linear-gradient(180deg, #fff5f5 0%, #ffecec 100%);
  color: #9f2430;
}

.admin-detail-empty {
  color: var(--muted);
}

.clef-selector h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #10365a;
}

.exercise-selector h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: #10365a;
}

.clef-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.clef-button {
  appearance: none;
  border: 1px solid #bfd0e6;
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  color: #23415f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.clef-button:hover {
  border-color: #8fb4df;
  transform: translateY(-1px);
}

.clef-button.is-active {
  border-color: #2f80ed;
  background: linear-gradient(180deg, #e9f3ff 0%, #d8ebff 100%);
  color: #0f4f96;
}

.music-sheet {
  width: 100%;
  min-height: 200px;
  overflow-x: hidden;
}

.music-sheet svg {
  display: block;
  max-width: 100%;
}

.note-info {
  margin-top: 0.85rem;
  font-size: 1rem;
  color: var(--accent);
}

.speech-panel {
  border: 1px solid #d7e5f6;
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.speech-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.speech-panel h2,
.speech-output-card h3 {
  margin: 0;
}

.speech-panel-copy {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.speech-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.speech-metrics {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.speech-metric-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dce7f8;
  border-radius: 8px;
}

.speech-metric-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.speech-metric-value {
  color: #10365a;
  font-size: 1.2rem;
}

.score-panel {
  --score-border: #cfe3c5;
  --score-start: #f8fff5;
  --score-end: #eef9e8;
  --score-accent: #1d5f2c;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--score-border);
  background: linear-gradient(180deg, var(--score-start) 0%, var(--score-end) 100%);
}

.score-panel-hidden {
  display: none;
}

.score-panel h3 {
  margin: 0;
  color: var(--score-accent);
}

.score-value {
  margin: 0.5rem 0 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--score-accent);
}

.score-summary {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

.history-panel {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #dce7f8;
  background: rgba(255, 255, 255, 0.82);
}

.history-panel h3 {
  margin: 0 0 0.75rem;
  color: #10365a;
}

.history-list {
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
}

.history-top-block {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #bfd8ba;
  border-radius: 8px;
  background: #f5fff2;
}

.history-top-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.history-top-header h4 {
  margin: 0;
  color: #1d5f2c;
  font-size: 1rem;
}

.history-top-header span {
  color: #3f6f49;
  font-size: 0.88rem;
  font-weight: 700;
}

.history-top-list {
  display: grid;
  gap: 0.5rem;
}

.history-top-item {
  display: grid;
  grid-template-columns: auto minmax(6rem, auto) minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #d8eace;
  border-radius: 8px;
  background: #fff;
}

.history-rank {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: #1d5f2c;
  color: #fff;
  font-weight: 800;
}

.history-top-item strong {
  display: block;
  color: #10365a;
}

.history-top-item span {
  color: #1d5f2c;
  font-weight: 700;
}

.history-top-item .history-rank {
  color: #fff;
  font-weight: 800;
}

.history-top-item small {
  color: var(--muted);
}

.history-top-empty {
  color: var(--muted);
}

.history-empty {
  padding: 0.75rem;
}

.history-item {
  padding: 0.75rem;
  border: 1px solid #dce1e8;
  border-radius: 8px;
  background: #fff;
}

.speech-actions button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.speech-actions button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
}

.status-idle {
  background: #edf2f7;
  color: #4a5568;
}

.status-connecting {
  background: #fff4db;
  color: #8a5b00;
}

.status-listening {
  background: #def7e8;
  color: #166534;
}

.status-error {
  background: #fde8e8;
  color: #b42318;
}

.speech-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.speech-output-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #dce7f8;
  border-radius: 8px;
  padding: 0.85rem;
}

.speech-output {
  margin: 0.75rem 0 0;
  min-height: 6rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid #dce1e8;
  border-radius: 6px;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.recognized-note {
  display: inline-block;
  margin: 0 0.1rem 0.25rem 0;
  color: #4a5568;
  font-weight: 700;
}

.recognized-note-correct {
  color: #2f855a;
}

.recognized-note-misnamed,
.recognized-note-extra {
  color: #c53030;
}

.recognized-note-skipped {
  color: #d69e2e;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.18rem;
}

.recognized-note-pending {
  color: #4a5568;
}

code {
  display: block;
  white-space: pre-wrap;
  background: #eef2ff;
  border: 1px solid #b0c3ff;
  border-radius: 5px;
  padding: 0.8rem;
}

@media (max-width: 700px) {
  .app-container {
    width: min(100%, 96vw);
    padding: 1rem;
    border-radius: 18px;
  }

  .page-header-compact {
    flex-direction: column;
  }

  .exercise-drawer-toggle {
    align-items: flex-start;
  }

  .auth-hero {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    padding-right: 0;
  }

  .account-strip {
    min-width: 0;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .account-strip-actions {
    justify-content: stretch;
  }

  .account-strip-link,
  .account-strip .auth-logout-button {
    width: 100%;
  }

  .exercise-selector-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .speech-panel-header,
  .speech-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .auth-form button {
    grid-column: auto;
  }

  .auth-card-header {
    flex-direction: column;
  }

  .auth-status {
    text-align: left;
    max-width: none;
  }

  .speech-metrics {
    grid-template-columns: 1fr;
  }

  .speech-output-grid {
    grid-template-columns: 1fr;
  }

  .history-top-header {
    flex-direction: column;
    gap: 0.25rem;
  }

  .history-top-item {
    grid-template-columns: auto 1fr;
  }

  .history-top-item small {
    grid-column: 2;
  }
}
