:root { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172026; background: #f7f7f4; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; }
.app-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  color: white;
  padding: .5rem clamp(1rem, 2vw, 1.35rem);
  background:
    linear-gradient(135deg, rgba(15, 107, 61, .95), rgba(31, 42, 51, .98) 52%, rgba(40, 90, 123, .96));
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.16);
}
.brand-banner {
  display: flex;
  align-items: center;
  gap: .58rem;
  max-width: none;
  margin: 0;
}
.brand-copy h1 {
  margin: 0;
  font-size: clamp(1.48rem, 2.35vw, 2rem);
  line-height: .95;
  font-weight: 900;
  letter-spacing: 0;
}
.brand-copy p {
  margin: .22rem 0 0;
  color: rgba(255,255,255,.82);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.traditional-logo {
  display: inline-block;
  margin-left: .35rem;
  margin-right: 0;
  align-self: center;
  color: rgba(255,255,255,.9);
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  min-width: 0;
  min-height: 0;
  font-family: inherit;
  font-size: clamp(1.1rem, 1.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  max-width: none;
  margin: 0;
  min-width: 0;
}
.nav-main,
.nav-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.nav-main {
  padding: .25rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: .8rem;
  background: rgba(11, 20, 28, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.nav-secondary {
  justify-content: flex-end;
  gap: .65rem;
}
.account-identity {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: .5rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(255,255,255,.88);
  background: transparent;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  max-width: 100%;
  overflow-wrap: anywhere;
}
#accountUsername {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-admin-badge {
  display: inline-flex;
  align-items: center;
  padding: .12rem .42rem;
  border: 1px solid rgba(201, 246, 219, .34);
  border-radius: 999px;
  color: rgba(232, 252, 240, .96);
  background: rgba(15, 107, 61, .42);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.2;
  text-transform: uppercase;
}
button, input, textarea, select { font: inherit; }
button { padding: .55rem .8rem; border: 0; border-radius: .35rem; background: #31475a; color: white; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button:disabled { cursor: default; opacity: .7; }
button.secondary { background: #667; }
button.danger { background: #a4342f; }
button.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.nav-main button,
.nav-secondary button,
.admin-menu summary {
  min-height: 2.55rem;
  padding: .58rem .95rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: .55rem;
  background: rgba(22, 34, 44, .36);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: background-color .12s ease, border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}

.nav-main button {
  font-weight: 700;
}

.nav-main button:not(#continueNavBtn) {
  min-width: 7rem;
}

.nav-main button:hover,
.nav-secondary button:hover,
.admin-menu summary:hover {
  filter: none;
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
}

.admin-menu {
  position: relative;
}
.admin-menu summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 6.25rem;
  padding-inline: .95rem 1rem;
}
.admin-menu summary::-webkit-details-marker {
  display: none;
}
.admin-menu summary::after {
  content: "";
  width: .6rem;
  height: .6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: .82;
}
.admin-menu[open] summary {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.24);
}
.admin-menu[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}
.nav-main button.is-active,
.nav-secondary button.is-active,
.admin-menu summary.is-active,
.admin-menu-buttons button.is-active {
  background: #165f3b;
  border-color: rgba(201, 246, 219, .38);
  box-shadow: 0 0 0 2px rgba(255,255,255,.35) inset;
}
.nav-main button.is-active:not(#continueNavBtn),
.nav-secondary button.is-active:not(#logoutBtn),
.admin-menu summary.is-active,
.admin-menu-buttons button.is-active {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.28);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}
.nav-main button:focus-visible,
.nav-secondary button:focus-visible,
.admin-menu summary:focus-visible,
.admin-menu-buttons button:focus-visible {
  outline: 3px solid rgba(255,255,255,.9);
  outline-offset: 2px;
}
#continueNavBtn {
  min-width: 8.75rem;
  background: linear-gradient(160deg, #0f6b3d, #17995a 58%, #0c7746);
  border-color: rgba(194, 246, 214, .28);
  box-shadow: 0 .35rem .9rem rgba(12, 73, 43, .18);
  font-weight: 800;
}
#continueNavBtn:hover {
  background: linear-gradient(160deg, #117445, #1aa765 58%, #0d7e4c);
  border-color: rgba(214, 250, 227, .34);
}
#continueNavBtn.is-active {
  background: linear-gradient(160deg, #0d633b, #148654 58%, #0b6d42);
  border-color: rgba(214, 250, 227, .38);
  box-shadow: 0 .35rem .9rem rgba(12, 73, 43, .18), inset 0 0 0 1px rgba(255,255,255,.16);
}
#logoutBtn {
  background: rgba(93, 112, 127, .22);
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.92);
}
#logoutBtn:hover {
  background: rgba(93, 112, 127, .34);
  border-color: rgba(255,255,255,.18);
}
.admin-menu-buttons {
  position: absolute;
  top: calc(100% + .35rem);
  left: 0;
  z-index: 20;
  display: grid;
  gap: .35rem;
  min-width: 11rem;
  padding: .45rem;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: .55rem;
  background: #1f2a33;
  box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.22);
}
.admin-menu-buttons button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.admin-menu-buttons button:hover {
  filter: none;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.16);
}
.button-icon { width: 1rem; height: 1rem; flex: 0 0 auto; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.view { display: block; }
.hidden { display: none !important; }
label { display: block; margin: .75rem 0; }
input, textarea, select { width: 100%; box-sizing: border-box; padding: .55rem; border: 1px solid #ccd0d3; border-radius: .35rem; background: white; }
textarea { resize: vertical; }
.box, .card, .draft-card { background: white; border: 1px solid #ddd; border-radius: .5rem; padding: 1rem; margin: .75rem 0; }
.import-panel h3 { margin-top: 0; }
.import-panel p { line-height: 1.45; }
.import-panel button { margin-top: .25rem; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .85rem;
}
.card-actions button {
  padding: .45rem .7rem;
}
.card-audio-tools {
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid #e3e8eb;
}
.card-audio-player {
  width: min(100%, 22rem);
}
.card-audio-actions {
  margin-top: .55rem;
}
.audio-note {
  margin-bottom: .45rem;
}
.review-audio-note {
  margin-top: .45rem;
}
.record-audio-shell {
  display: grid;
  gap: 1rem;
}
.record-audio-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.record-audio-header h2 {
  margin: .2rem 0 .35rem;
}
.record-audio-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.record-audio-progress {
  margin: 0 0 .85rem;
  font-weight: 700;
  color: #0f6b3d;
}
.record-audio-card {
  display: grid;
  gap: 1rem;
}
.record-audio-target {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid #d6e5db;
  border-radius: .8rem;
  background: linear-gradient(135deg, #f7fbf8, #ffffff);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.2;
  font-weight: 800;
}
.record-audio-english {
  margin: 0;
}
.record-audio-status {
  margin: 0;
  padding: .8rem .9rem;
  border-radius: .65rem;
  background: #f6f8fa;
}
.record-audio-status.is-error {
  background: #fff0ef;
  color: #8b2e2a;
}
.record-audio-status.is-ready {
  background: #eef9f1;
  color: #165f3b;
}
.record-audio-controls,
.record-audio-actions,
.record-audio-players {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.record-audio-players {
  align-items: flex-start;
}
.record-audio-player-box {
  flex: 1 1 18rem;
  min-width: 16rem;
  padding: .85rem;
  border: 1px solid #dde5ea;
  border-radius: .75rem;
  background: #fbfcfd;
}
.record-audio-player-box h3 {
  margin: 0 0 .55rem;
  font-size: 1rem;
}
.record-audio-player-box audio {
  width: 100%;
}
.record-audio-complete {
  text-align: center;
}
.record-audio-complete h3 {
  margin-top: 0;
}
@media (max-width: 720px) {
  .home-beta-direction-grid, .direction-actions { grid-template-columns: 1fr; }
  .record-audio-player-box {
    min-width: 0;
  }
  .record-audio-header-actions,
  .record-audio-controls,
  .record-audio-actions {
    width: 100%;
  }
  .record-audio-header-actions button,
  .record-audio-controls button,
  .record-audio-actions button {
    flex: 1 1 10rem;
  }
}
.card-edit-panel {
  margin-top: .75rem;
  padding: .85rem;
  border: 1px solid #d7dee2;
  border-radius: .5rem;
  background: #f9fbfa;
}
.card-edit-panel label {
  margin-top: 0;
}
.card-edit-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
}
.card-edit-buttons button {
  min-width: 6rem;
}
.imported-deck-banner {
  margin: 0 0 1rem;
}
.imported-deck-banner-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 2px solid #0f6b3d;
  border-radius: .8rem;
  background: linear-gradient(135deg, #ecf7f0, #ffffff);
  box-shadow: 0 .4rem 1rem rgba(15, 107, 61, .08);
}
.imported-deck-banner-box h3 {
  margin: 0 0 .35rem;
  font-size: 1.2rem;
}
.imported-deck-banner-box p {
  margin: 0;
}
.imported-deck-eyebrow {
  margin: 0 0 .35rem;
  color: #0f6b3d;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.imported-deck-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.imported-deck-actions button {
  padding: .8rem 1rem;
  font-weight: 800;
}
.imported-batch-results {
  display: grid;
  gap: 1rem;
  margin: 0 0 1rem;
}
.imported-batch-card-list {
  display: grid;
  gap: .85rem;
}
.imported-batch-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.imported-batch-card h3 {
  margin: 0 0 .25rem;
  font-size: 1.05rem;
}
.imported-batch-card-main {
  min-width: 0;
}
.imported-batch-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.imported-batch-card-actions button {
  font-weight: 700;
}
.csv-import-preview {
  margin-top: .85rem;
  padding: .9rem;
  border: 1px solid #d6ddd7;
  border-radius: .6rem;
  background: linear-gradient(180deg, #f7faf8, #ffffff);
}
.csv-import-preview h4 {
  margin: 0 0 .6rem;
  font-size: 1rem;
}
.csv-import-preview .muted {
  margin-top: .35rem;
}
.csv-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .6rem .75rem;
  margin-top: .75rem;
}
.csv-import-grid label {
  margin: 0;
}
.csv-import-grid .required::after {
  content: " *";
  color: #a00000;
  font-weight: 700;
}
.csv-import-sample {
  margin-top: .9rem;
  overflow-x: auto;
}
.csv-import-sample table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.csv-import-sample th,
.csv-import-sample td {
  padding: .45rem .5rem;
  border: 1px solid #dde4e0;
  vertical-align: top;
  text-align: left;
}
.csv-import-sample th {
  background: #eef4ef;
}
.settings-users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.settings-users-table th,
.settings-users-table td {
  padding: .55rem .5rem;
  border: 1px solid #dde4e0;
  vertical-align: top;
  text-align: left;
}

.settings-users-table th {
  background: #eef4ef;
}

.settings-users-table td:last-child {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.home-beta-audio-prompt-tools {
  display: grid;
  gap: .55rem;
  margin-top: .35rem;
}

.home-beta-audio-prompt-field {
  display: grid;
  gap: .35rem;
  font-weight: 700;
}

.home-beta-audio-prompt-field textarea {
  min-height: 16rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
  line-height: 1.45;
  resize: vertical;
}

@media (max-width: 640px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: .45rem;
  padding: .5rem .75rem .45rem;
  }

  .brand-banner {
    gap: .5rem;
    margin-bottom: 0;
  }

  .traditional-logo {
    margin-right: 0;
    font-size: 1rem;
    opacity: .88;
  }

  nav {
    display: grid;
    gap: .45rem;
  }

  .nav-main,
  .nav-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
  }

  #continueNavBtn {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .nav-main button,
  .nav-secondary button,
  .admin-menu,
  .admin-menu summary {
    width: 100%;
  }

  .admin-menu {
    width: 100%;
  }

  .account-identity {
    min-width: 0;
    justify-content: flex-start;
  }

  .nav-secondary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nav-secondary button,
  .nav-secondary .admin-menu,
  .nav-secondary .admin-menu summary {
    width: auto;
  }

  .admin-menu summary {
    text-align: center;
  }

  .admin-menu-buttons {
    position: static;
    margin-top: .35rem;
  }

  .imported-batch-card-actions {
    width: 100%;
  }

  .imported-batch-card-actions button {
    width: 100%;
  }
}
.add-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; max-width: 48rem; }
.add-choice { min-height: 8rem; padding: 1rem; text-align: left; display: grid; gap: .4rem; align-content: start; }
.add-choice strong { font-size: 1.05rem; }
.add-choice span { color: rgba(255,255,255,.9); line-height: 1.4; }
.add-destination { display: grid; gap: .6rem; max-width: 42rem; margin: 1rem 0; padding: .8rem 1rem 1rem; border: 1px solid #cbd5cf; border-radius: .45rem; }
.add-destination legend { padding: 0 .3rem; font-weight: 700; }
.add-destination > label { display: grid; gap: .3rem; }
.add-destination > label:has(input[type="radio"]) { display: flex; align-items: center; gap: .45rem; }
.draft-duplicate-warning { margin: .55rem 0; padding: .6rem .7rem; border-left: 4px solid #b7791f; background: #fff8e8; }
.draft-duplicate-warning p { margin: .2rem 0; }
.draft-duplicate-warning.is-skipped { opacity: .75; }
.card-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; align-items: end; }
.card-form label:nth-child(2), .card-form label:nth-child(3), .card-form label:nth-child(6) { grid-column: 1 / -1; }
.error { color: #a00000; }
.muted { color: #60707a; }
.review-layout {
  max-width: 52rem;
  margin: 0 auto;
}
.review-heading {
  margin: .2rem 0 .25rem;
  font-size: clamp(1.2rem, 2.7vw, 1.6rem);
  line-height: 1.25;
}
.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}
.review-meta-main {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  min-width: 0;
}
.review-meta-chip,
.review-progress-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .28rem .7rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.2;
}
.review-meta-chip {
  border: 1px solid #d8e0da;
  background: #f5f8f6;
  color: #38504a;
}
.review-progress-pill {
  border: 1px solid #cfe1d8;
  background: #eef7f1;
  color: #0f6b3d;
}
.review-confidence-stats {
  margin-bottom: .65rem;
}
.review-card-shell {
  position: relative;
  padding: .95rem 1rem .78rem;
  border: 1px solid #d9e1e6;
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff, #fbfcfb);
  box-shadow: 0 .25rem .85rem rgba(0,0,0,.035);
  cursor: pointer;
}
.review-card-shell.answer-revealed {
  cursor: default;
}
.review-card-shell:focus-visible {
  outline: 3px solid rgba(15, 107, 61, .28);
  outline-offset: 2px;
}
.review-reveal-hint {
  position: static;
  display: block;
  width: fit-content;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  margin: .55rem auto 0;
  padding: .34rem .78rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 107, 61, .08);
  color: #41535d;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  box-shadow: none;
}
.review-reveal-hint:hover {
  filter: none;
  background: rgba(15, 107, 61, .12);
}
.review-prompt {
  margin: 0;
  padding: .2rem 0 0;
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
  line-height: 1.38;
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
}
.review-card-shell .review-prompt,
.review-card-shell .review-answer-text {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
}
.review-prompt-text {
  margin-bottom: .75rem;
}
.review-prompt-audio,
.review-prompt-audio-only audio {
  width: min(100%, 22rem);
}
.review-prompt-audio-only {
  display: flex;
  justify-content: center;
}
.review-answer-wrap {
  margin-top: 0;
  padding: .75rem 0 0;
}
.production-answer-panel {
  margin-top: 1rem;
  padding: .9rem;
  border: 1px solid #dbe2e7;
  border-radius: .65rem;
  background: #f9fbfa;
}
.production-answer-panel label {
  display: block;
  font-weight: 650;
}
.production-answer-panel input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: .4rem;
}
.production-answer-panel button {
  margin-top: 0;
}
.production-answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .65rem;
}
.review-feedback,
.review-hints {
  margin-top: .65rem;
  padding: .72rem .82rem;
  border: 1px solid #dbe2e7;
  border-radius: .65rem;
  background: #f9fbfa;
  color: #37474f;
  font-size: .95rem;
  line-height: 1.45;
}
.review-feedback p,
.review-hints p {
  margin: 0;
}
.review-feedback p + p,
.review-hints p + p {
  margin-top: .42rem;
}
.review-feedback-result {
  color: #18352d;
}
.review-hint + .review-hint {
  padding-top: .55rem;
  border-top: 1px solid #e4eaed;
}
.review-answer-divider {
  height: 1px;
  background: #dbe2e7;
  margin-bottom: .7rem;
}
.review-answer-text {
  font-size: clamp(1.45rem, 2.7vw, 1.95rem);
  line-height: 1.45;
  font-weight: 700;
  text-align: center;
  color: #18352d;
}
.review-answer-extras {
  margin-top: .8rem;
  padding-top: .7rem;
  border-top: 1px solid #edf1f3;
  color: #52616b;
  font-size: .95rem;
  line-height: 1.45;
}
.review-answer-extras p {
  margin: .35rem 0 0;
}
.review-meta-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: .12rem;
  border-radius: 999px;
  border: 1px solid #d8e0da;
  background: #f6f8f7;
  box-shadow: none;
}
.review-meta-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 1.85rem;
  padding: .22rem .58rem;
  font-size: .8rem;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #44555e;
  box-shadow: none;
  opacity: .9;
}
.review-meta-action svg {
  width: .95rem;
  height: .95rem;
  fill: currentColor;
  display: block;
}
.review-meta-action.danger {
  background: transparent;
  color: #5f6b74;
}
.review-meta-action.danger svg {
  opacity: .84;
}
.review-meta-divider {
  width: 1px;
  align-self: stretch;
  background: #d8e0da;
}
.review-meta-action:hover:not(:disabled) {
  opacity: 1;
  background: rgba(255,255,255,.72);
}

.duplicate { border-left: 4px solid #c56; padding-left: .75rem; }
.meta { font-size: .9rem; color: #52616b; }
pre { white-space: pre-wrap; }
@media (max-width: 640px) { .add-choice-grid { grid-template-columns: 1fr; } nav button { flex: 1 1 auto; } }

@media (max-width: 640px) {
  button {
    min-height: 44px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  main {
    padding: .85rem;
  }

  .box,
  .card,
  .draft-card {
    padding: .85rem;
  }

  .card-form,
  .csv-import-grid,
  .home-deck-head,
  .home-deck-practice-actions,
  .home-deck-actions,
  .card-actions,
  .card-edit-buttons,
  .confidence-stats-row {
    min-width: 0;
  }

  .card-form,
  .csv-import-grid {
    grid-template-columns: 1fr;
  }

  .csv-import-sample {
    margin-top: .75rem;
  }

  .csv-import-sample table {
    font-size: .85rem;
  }

  .review-card-shell {
    padding: .8rem .82rem .7rem;
  }

  .review-reveal-hint {
    margin-top: .5rem;
    font-size: .76rem;
  }

  .review-prompt {
    font-size: 1.26rem;
  }

  .review-answer-wrap {
    padding-top: .62rem;
  }

  .review-answer-text {
    font-size: 1.14rem;
  }

  .review-answer-extras {
    font-size: .9rem;
  }

  .confidence-panel {
    gap: .5rem;
  }

  #nextCardBtn {
    width: 100%;
  }

  .home-deck-head {
    grid-template-columns: 1fr;
  }

  .home-deck-practice-actions {
    justify-content: stretch;
  }

  .home-deck-practice-actions .icon-button {
    width: 100%;
    justify-content: center;
  }

  .grades {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
    margin: .15rem 0 0;
  }

  .grades button {
    min-height: 3.45rem;
    padding: .5rem .25rem;
  }

  .grade-number {
    font-size: 1.08rem;
  }

  .grade-label {
    font-size: .74rem;
  }

  .review-meta {
    align-items: flex-start;
  }

  .review-progress-pill {
    min-height: 1.9rem;
  }

  .review-meta-action {
    flex: 1 1 7rem;
  }

  .brand-banner {
    gap: .7rem;
    margin-bottom: .3rem;
  }

  .brand-copy h1 {
    font-size: clamp(1.55rem, 3vw, 2.2rem);
  }

  .brand-copy p {
    font-size: .76rem;
  }

  .traditional-logo {
    margin-right: 2rem;
    font-size: 1.25rem;
    opacity: .94;
  }
}

.primary-nav, .primary-action { background: #0f6b3d; font-weight: 800; }
.primary-nav { box-shadow: 0 0 0 2px rgba(255,255,255,.35) inset; }
.review-page .app-header {
  grid-template-columns: auto minmax(0, 1fr);
  padding: .35rem .85rem .32rem;
}
.review-page .brand-banner {
  gap: .65rem;
  margin-bottom: 0;
}
.review-page .brand-copy h1 {
  font-size: 1.35rem;
}
.review-page .brand-copy p {
  display: none;
}
.review-page .traditional-logo {
  margin-left: .2rem;
  margin-right: 0;
  font-size: .95rem;
  opacity: .82;
}
.review-page nav {
  gap: .5rem;
}
.review-page .nav-main,
.review-page .nav-secondary {
  gap: .35rem;
}
.review-page .nav-main button,
.review-page .nav-secondary button,
.review-page .admin-menu summary {
  min-height: 2.1rem;
  padding: .4rem .7rem;
  font-size: .92rem;
}
.app-version-footer {
  margin: 2rem auto 1rem;
  padding: .75rem 1rem;
  max-width: 64rem;
  color: #6b7280;
  font-size: .85rem;
  text-align: center;
  border-top: 1px solid #e5e7eb;
}
.home-hero {
  margin-bottom: 1.5rem;
}

.home-hero-text {
  border: 1px solid #d7e2dc;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 .35rem 1rem rgba(0,0,0,.06);
}

.home-hero-text {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f4f7fb, #e7f0ea);
}

.home-hero-text h2 {
  max-width: 46rem;
  margin: 0 0 .65rem;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.12;
}

.home-lead {
  max-width: 48rem;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #33434d;
}

.home-eyebrow,
.home-section-label {
  margin: 0 0 .35rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .78rem;
  font-weight: 800;
  color: #0f6b3d;
}

.home-decks-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: .75rem;
}

.home-decks-header h3 {
  margin: 0;
}

.home-deck-menu {
  display: grid;
  gap: .85rem;
}

.home-folder-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-folder-grid {
  display: grid;
  gap: 1rem;
}

.home-folder-group {
  padding: 1rem;
  border: 1px solid #d9e1e6;
  border-radius: .9rem;
  background: linear-gradient(180deg, #ffffff, #f9fbfa);
  box-shadow: 0 .2rem .8rem rgba(0,0,0,.04);
}

.home-folder-group-uncategorized {
  margin-top: 1rem;
}

.home-folder-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: .85rem;
}

.home-folder-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.home-folder-header h3,
.homeDeckToggle {
  display: inline-flex;
  align-items: center;
}

.homeFolderToggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: #172026;
  font-size: 1.05rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.homeFolderToggle:focus-visible {
  outline: 3px solid #0f6b3d;
  outline-offset: 3px;
}

.home-folder-header .muted {
  margin: .25rem 0 0;
}

.home-folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.home-folder-actions button {
  min-height: 2rem;
}

.homeFolderUtilityBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  background: #ffffff;
  color: #44515a;
  border: 1px solid #cfd8de;
  border-radius: 999px;
  box-shadow: 0 .08rem .18rem rgba(0,0,0,.06);
}

.homeFolderUtilityBtn:hover {
  background: #f4f7f8;
  filter: none;
}

.homeFolderUtilityBtn svg {
  width: .95rem;
  height: .95rem;
  fill: currentColor;
  display: block;
}

.homeFolderDeleteUtilityBtn {
  color: #8a3f38;
  border-color: #e1c4bf;
  background: #fff8f7;
}

.homeFolderDeleteUtilityBtn:hover {
  background: #fceaea;
}

.home-folder-deck-list {
  display: grid;
  gap: .85rem;
  min-height: 4rem;
  padding: .3rem;
  border: 1px dashed transparent;
  border-radius: .8rem;
  transition: border-color .12s ease, background-color .12s ease;
}

.home-folder-deck-list.drag-over {
  border-color: #0f6b3d;
  background: rgba(15, 107, 61, .05);
}

.home-folder-group[draggable="true"] {
  cursor: grab;
}

.home-folder-group.is-dragging-folder {
  opacity: .72;
  cursor: grabbing;
}

.home-folder-group.drag-over-folder {
  border-color: #0f6b3d;
  box-shadow: 0 0 0 3px rgba(15, 107, 61, .12);
}

.home-folder-group.drag-over-deck-target {
  border-color: #0f6b3d;
  background: rgba(15, 107, 61, .05);
  box-shadow: 0 0 0 3px rgba(15, 107, 61, .12);
}

.home-folder-empty {
  margin: .35rem;
}

.home-deck-tile {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid #d9e1e6;
  border-radius: .85rem;
  background: #fff;
  box-shadow: 0 .25rem .9rem rgba(0,0,0,.05);
}

.home-deck-tile[draggable="true"] {
  cursor: grab;
}

.home-deck-tile.is-dragging {
  opacity: .65;
  cursor: grabbing;
}

.home-deck-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

.home-deck-practice-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(8.25rem, 9.5rem));
  gap: .55rem;
  justify-content: end;
  align-items: stretch;
  min-width: 0;
}

.homePracticeDeckBtn[data-direction="recognition"] {
  background: linear-gradient(160deg, #0f6b3d, #17995a 58%, #0c7746);
  color: #fff;
  border: 1px solid rgba(9, 77, 44, .34);
  box-shadow: 0 .45rem 1rem rgba(15,107,61,.2);
}

.homePracticeDeckBtn[data-direction="production"] {
  background: linear-gradient(160deg, #1f5b8f, #2d79b6 58%, #1c4f7d);
  color: #fff;
  border: 1px solid rgba(23, 64, 99, .34);
  box-shadow: 0 .45rem 1rem rgba(31,91,143,.2);
}

.homePracticeDeckBtn[data-direction="recognition"]:hover,
.homePracticeDeckBtn[data-direction="production"]:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.homePracticeDeckBtn {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 4.9rem;
  padding: .75rem .8rem;
  border-radius: 1rem;
  text-align: center;
  line-height: 1.05;
  overflow: hidden;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}

.homePracticeDeckBtn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 45%);
  pointer-events: none;
}

.home-practice-button-top {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .78;
}

.home-practice-button-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  column-gap: .28rem;
  width: 100%;
  margin-top: .42rem;
  font-size: .96rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.home-practice-button-bottom strong {
  font-size: 1rem;
  font-weight: 900;
  min-width: 0;
}

.home-practice-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  min-width: 0;
  white-space: nowrap;
}

.home-practice-flag {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  flex: 0 0 auto;
  line-height: 1;
}

.home-practice-flag-emoji {
  font-size: .9em;
  filter: saturate(.95);
  font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", "Twemoji Mozilla", sans-serif;
}

.home-practice-button-separator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: .9rem;
  height: .9rem;
  opacity: .88;
}

.home-practice-button-separator svg {
  width: .9rem;
  height: .9rem;
  fill: currentColor;
  display: block;
}

.homeEditDeckBtn {
  background: linear-gradient(180deg, #ffffff, #eef3f6);
  color: #44515a;
  border: 1px solid #cfd8de;
  box-shadow: 0 .2rem .55rem rgba(33, 53, 67, .08);
}

.homeEditDeckBtn:hover {
  background: linear-gradient(180deg, #ffffff, #e9f0f3);
  filter: none;
  transform: translateY(-1px);
}

.homeEditDeckBtn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  display: block;
}

.home-deck-title-block {
  min-width: 0;
}

.home-folder-drag-handle,
.home-deck-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: .45rem;
  color: #60707a;
  font-size: .95rem;
  letter-spacing: -.08em;
  cursor: grab;
  user-select: none;
}

.home-folder-title-text {
  min-width: 0;
  word-break: break-word;
}

.homeDeckToggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: #172026;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.homeDeckToggle:focus-visible {
  outline: 3px solid #0f6b3d;
  outline-offset: 3px;
}

.home-deck-title-text {
  min-width: 0;
  word-break: break-word;
}

.home-toggle-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 1.9rem;
  padding: .24rem .62rem .24rem .72rem;
  border: 1px solid #cad5db;
  border-radius: .65rem;
  background: linear-gradient(180deg, #ffffff, #f5f8fa);
  color: #31414c;
  box-shadow: 0 .14rem .34rem rgba(33, 53, 67, .07);
  white-space: nowrap;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.home-toggle-chip-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: .95rem;
  height: .95rem;
  color: currentColor;
  flex: 0 0 auto;
  opacity: .78;
}

.home-toggle-chip-symbol svg {
  width: .78rem;
  height: .78rem;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-toggle-chip-label {
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.homeDeckToggle:hover .home-toggle-chip,
.homeFolderToggle:hover .home-toggle-chip,
.homeBetaFolderToggle:hover .home-toggle-chip,
.homeBetaDeckToggle:hover .home-toggle-chip {
  border-color: #b9c7cf;
  background: linear-gradient(180deg, #ffffff, #eef4f7);
  color: #22313a;
  box-shadow: 0 .2rem .45rem rgba(33, 53, 67, .1);
  transform: translateY(-1px);
}

.home-deck-tile.is-open .home-toggle-chip,
.home-folder-group.is-open .home-toggle-chip,
.home-beta-folder.is-open .home-toggle-chip,
.home-beta-deck-card.is-open .home-toggle-chip {
  border-color: #b8d6c3;
  background: linear-gradient(180deg, #f6fcf7, #ebf7ee);
  color: #0f6b3d;
  box-shadow: 0 .16rem .38rem rgba(15, 107, 61, .1);
}

.home-deck-tile.is-open .homeDeckToggle:hover .home-toggle-chip,
.home-folder-group.is-open .homeFolderToggle:hover .home-toggle-chip,
.home-beta-folder.is-open .homeBetaFolderToggle:hover .home-toggle-chip,
.home-beta-deck-card.is-open .homeBetaDeckToggle:hover .home-toggle-chip {
  border-color: #9fc6af;
  background: linear-gradient(180deg, #f8fdf9, #e3f3e8);
  color: #0b5b33;
}

.home-deck-studied {
  margin-top: .35rem;
  color: #0f6b3d;
  font-weight: 800;
}

.home-deck-created {
  margin-top: .35rem;
  color: #60707a;
  font-size: .84rem;
}

.home-deck-created-inline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
}

.home-deck-icon-btn {
  flex: 0 0 auto;
  min-height: 1.9rem;
  min-width: 1.9rem;
  padding: .28rem;
  border-radius: .55rem;
}

.home-deck-icon-btn svg,
.home-deck-icon-btn .button-icon {
  width: .95rem;
  height: .95rem;
}

.home-deck-expanded {
  border-top: 1px solid #e2e8ed;
  padding-top: .9rem;
}

.home-deck-expanded-body {
  min-width: 0;
}

.home-deck-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: .5rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.home-deck-tile p {
  margin-bottom: .35rem;
}

.home-empty-decks {
  padding: 1rem;
  border-radius: .75rem;
  background: #f6f7f8;
  border: 1px dashed #c7cfd6;
}

.home-beta-shell {
  display: grid;
  gap: 1rem;
}

.home-beta-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(19rem, .8fr);
  gap: 1rem;
  align-items: stretch;
}

.home-beta-hero-copy,
.home-beta-summary,
.home-beta-controls,
.home-beta-folder,
.home-beta-empty-state {
  border: 1px solid #d7e2dc;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 .35rem 1rem rgba(0,0,0,.05);
}

.home-beta-hero-copy {
  padding: 1.5rem;
  background: linear-gradient(135deg, #f4f7fb, #e7f0ea);
}

.home-beta-summary {
  padding: 1rem;
  background: linear-gradient(160deg, #213543, #335d76);
  color: #fff;
}

.home-beta-continue-card {
  display: grid;
  gap: .45rem;
  padding: 1rem;
  border-radius: .8rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}

.home-beta-continue-card span {
  color: rgba(255,255,255,.86);
}

.homeBetaContinueDeckBtn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .5rem;
  width: 100%;
  padding: .85rem .95rem;
  border-radius: .85rem;
  background: rgba(255,255,255,.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  text-align: left;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 .3rem .9rem rgba(0,0,0,.12);
}

.homeBetaContinueDeckBtn:hover {
  background: rgba(255,255,255,.2);
  filter: none;
}

.home-beta-stat-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 800;
  color: rgba(255,255,255,.72);
}

.home-beta-controls {
  padding: 1rem;
}

.home-beta-toolbar {
  display: grid;
  gap: .9rem;
}

.home-beta-filter-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 26rem) minmax(11rem, 13rem);
  gap: .75rem;
  align-items: end;
}

.home-beta-field {
  margin: 0;
  font-weight: 700;
}

.home-beta-search-field {
  max-width: 26rem;
}

.home-beta-field input,
.home-beta-field select {
  margin-top: .35rem;
}

.home-beta-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
}

.home-beta-results {
  display: grid;
  gap: .9rem;
}

.home-beta-folder {
  padding: 1rem;
}

.home-beta-folder-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.home-beta-folder-main {
  min-width: 0;
}

.homeBetaFolderToggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: #172026;
  text-align: left;
  cursor: pointer;
}

.homeBetaFolderToggle:focus-visible,
.homeBetaDeckToggle:focus-visible,
.homeBetaQuickPracticeBtn:focus-visible {
  outline: 3px solid #0f6b3d;
  outline-offset: 3px;
}

.home-beta-folder-title {
  font-size: 1.15rem;
  font-weight: 900;
}

.home-beta-folder-count {
  padding: .2rem .5rem;
  border-radius: 999px;
  background: #ecf2f5;
  color: #48606f;
  font-size: .78rem;
  font-weight: 800;
}

.home-beta-folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.home-beta-folder-body {
  display: grid;
  gap: .8rem;
  margin-top: .85rem;
}

.home-beta-deck-card {
  border: 1px solid #dde5e8;
  border-radius: .9rem;
  background: linear-gradient(180deg, #fff, #fbfcfc);
  padding: .9rem;
}

.home-beta-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.home-beta-deck-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .16rem;
}

.homeBetaDeckToggle { flex: 0 0 auto; min-height: 2.25rem; padding: .45rem .75rem; }

.home-beta-deck-title {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: 1.1rem;
  font-weight: 900;
}

.home-beta-title-flag {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex: 0 0 auto;
  line-height: 1;
}

.home-beta-title-flag-emoji {
  font-size: .92em;
  font-family: "Noto Color Emoji", "Segoe UI Emoji", "Apple Color Emoji", "Twemoji Mozilla", sans-serif;
}

.home-beta-deck-meta {
  color: #30424d;
  font-weight: 700;
}

.home-beta-deck-secondary {
  color: #667781;
  font-size: .87rem;
}

.home-beta-progress-line {
  color: #0f6b3d;
  font-weight: 800;
}

.home-beta-practice-area {
  margin-top: .7rem;
  padding: .75rem;
  border: 1px solid var(--border, #d7e2dc);
  border-radius: .85rem;
}
.home-beta-practice-area > h3 { margin: 0 0 .5rem; font-size: .95rem; }
.home-beta-direction-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.home-beta-direction-panel { display: grid; gap: .35rem; align-content: start; padding: .7rem; border: 1px solid #d7e2dc; border-radius: .75rem; }
.home-beta-direction-panel h4, .home-beta-direction-panel p { margin: 0; }
.home-beta-direction-panel p { color: #667781; font-size: .84rem; }
.direction-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin-top: .2rem; }
.homeBetaQuickPracticeBtn { min-height: 3.15rem; padding: .4rem .5rem; box-shadow: none; border: 1px solid currentColor; background: #fff; color: #0f6b3d; }
.homeBetaQuickPracticeBtn.review-action { background: #0f6b3d; color: #fff; border-color: #0f6b3d; }
.homeBetaQuickPracticeBtn.new-action { background: #eef8f2; color: #0f6b3d; border-color: #75b891; }
.homeBetaQuickPracticeBtn.production-action { color: #1f5b8f; }
.homeBetaQuickPracticeBtn.review-action.production-action { background: #1f5b8f; color: #fff; border-color: #1f5b8f; }
.homeBetaQuickPracticeBtn.new-action.production-action { background: #edf5fc; color: #1f5b8f; border-color: #83afd4; }
.homeBetaQuickPracticeBtn:disabled { background: #f0f2f3; color: #6c777d; border-color: #d4dadd; box-shadow: none; }
.homeBetaQuickPracticeBtn strong, .homeBetaQuickPracticeBtn span { display: block; }
.homeBetaQuickPracticeBtn span { margin-top: .14rem; font-size: .82rem; font-weight: 600; }

.homeBetaQuickPracticeBtn {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 3.2rem;
  padding: .75rem .85rem;
  border-radius: .95rem;
  background: linear-gradient(160deg, #0f6b3d, #17995a 58%, #0c7746);
  border: 1px solid rgba(9, 77, 44, .34);
  box-shadow: 0 .45rem 1rem rgba(15,107,61,.2);
  text-align: center;
  font-weight: 800;
}

.homeBetaQuickPracticeBtnSecondary {
  background: linear-gradient(160deg, #1f5b8f, #2d79b6 58%, #1c4f7d);
  border: 1px solid rgba(23, 64, 99, .34);
  box-shadow: 0 .45rem 1rem rgba(31,91,143,.2);
}

.home-beta-deck-expanded {
  display: grid;
  gap: .9rem;
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid #e2e8ed;
}

.home-beta-overview-panel {
  display: grid;
  gap: .9rem;
  padding: 1rem 1.05rem;
  border: 1px solid #dde5e8;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ffffff, #f5f9f7);
}

.home-beta-overview-copy .meta,
.home-beta-overview-copy p {
  margin: 0;
}

.home-beta-summary-text {
  margin-top: .45rem !important;
  max-width: 68ch;
  color: #25343d;
  line-height: 1.5;
}

.home-beta-overview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.home-beta-overview-badge {
  display: inline-flex;
  flex-direction: column;
  gap: .12rem;
  min-width: 7rem;
  padding: .65rem .78rem;
  border: 1px solid #dbe4e8;
  border-radius: .85rem;
  background: rgba(255,255,255,.9);
  color: #51616b;
  font-size: .82rem;
}

.home-beta-overview-badge strong {
  color: #172026;
  font-size: .98rem;
  line-height: 1.2;
}

.home-beta-overview-badge.is-study {
  border-color: #bdddca;
  background: #edf8f0;
}

.home-beta-overview-badge.is-study strong {
  color: #0f6b3d;
}

.home-beta-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.home-beta-detail-panel {
  min-width: 0;
  padding: .95rem 1rem;
  border: 1px solid #dde5e8;
  border-radius: .95rem;
  background: #fbfcfc;
}

.home-beta-detail-panel h4 {
  margin: 0 0 .7rem;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #5a6972;
}

.home-beta-detail-panel .confidence-stats {
  margin: 0;
}

.home-beta-audio-panel {
  margin: 0;
  display: grid;
  gap: .7rem;
}

.home-beta-audio-summary {
  margin: 0;
  font-weight: 800;
  color: #1b2c35;
}

.home-beta-audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.home-beta-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.home-beta-card-actions button {
  min-width: 8.5rem;
}

.home-beta-utility-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(10rem, 1fr) auto;
  gap: .6rem;
  align-items: end;
  padding-top: .15rem;
}

.home-beta-move-field {
  margin: 0;
  font-weight: 700;
}

.home-beta-move-field select {
  margin-top: .35rem;
}

@media (max-width: 920px) {
  .app-header {
    grid-template-columns: 1fr;
    gap: .55rem;
  }

  .brand-banner,
  nav {
    width: 100%;
  }

  .home-decks-header {
    display: block;
  }

  .home-folder-toolbar,
  .home-folder-header {
    display: block;
  }

  .home-folder-toolbar button,
  .home-folder-actions button {
    width: 100%;
    margin-top: .55rem;
  }

  .home-deck-head {
    grid-template-columns: 1fr;
  }

  .home-deck-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: .5rem;
    margin-top: .85rem;
  }

  .home-beta-hero,
  .home-beta-filter-grid,
  .home-beta-deck-header,
  .home-beta-detail-grid {
    grid-template-columns: 1fr;
  }

  .home-beta-folder-header,
  .home-beta-toolbar-actions {
    display: block;
  }

  .home-beta-folder-actions,
  .home-beta-primary-action {
    margin-top: .65rem;
  }

  .home-beta-card-actions {
    margin-top: .65rem;
  }

  .home-beta-folder-actions button,
  .home-beta-card-actions button,
  .home-beta-toolbar-actions button,
  .homeBetaQuickPracticeBtn,
  .home-beta-utility-bar button {
    width: 100%;
  }

  .home-beta-utility-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .home-beta-overview-badge {
    flex: 1 1 10rem;
  }

}
.confidence-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .7rem;
  margin-top: .75rem;
}

#nextCardBtn {
  width: min(100%, 28rem);
  min-height: 3.15rem;
  font-size: 1.12rem;
  font-weight: 900;
  align-self: center;
}

.review-status {
  margin: 0;
  text-align: center;
}

.grades {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .55rem;
  margin: 0;
}

.grades button {
  min-height: 3.7rem;
  padding: .55rem .35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .18rem;
  border: 1px solid #d5dfdb;
  border-radius: .9rem;
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
  box-shadow: none;
}

.grades button:hover:not(:disabled) {
  box-shadow: 0 .2rem .55rem rgba(0,0,0,.08);
  transform: translateY(-1px);
}

.grades button:focus-visible {
  outline: 3px solid rgba(15, 107, 61, .28);
  outline-offset: 2px;
}

.grades button:disabled {
  cursor: default;
}
.grade-number {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}
.grade-label {
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.1;
}
.practice-summary {
  margin-top: 1rem;
  margin-bottom: 1rem;
  background: #f8fbf9;
  border-color: #cfded5;
}

.practice-summary p {
  margin: .25rem 0;
}

.practice-summary-warning {
  border-color: #b45309;
  background: #fff7ed;
}

.direction-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .65rem;
  margin: 1rem 0;
  padding: .85rem;
  border: 1px solid #d6e0da;
  border-radius: .75rem;
  background: #ffffff;
}

.direction-options legend {
  padding: 0 .35rem;
  font-weight: 800;
  color: #33434d;
}

.direction-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: 0;
  padding: .75rem;
  border: 1px solid #d9e1e6;
  border-radius: .55rem;
  background: #f8fbf9;
  cursor: pointer;
}

.direction-option input {
  width: auto;
  margin: 0;
}

.direction-option span {
  font-weight: 700;
}
.review-progress {
  margin: .25rem 0 .75rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.grades button.selected,
.grades button.grade-selected,
.grades button[aria-pressed="true"] {
  border-color: #0f6b3d;
  box-shadow: 0 0 0 3px rgba(15, 107, 61, .16);
  transform: translateY(-1px);
}

#reviewGradeStatus {
  min-height: 1.2rem;
}
#reviewCard .grades button[data-grade="1"] {
  background: #fae5e2;
  border-color: #efbdb8;
  color: #8a2c22;
}

#reviewCard .grades button[data-grade="2"] {
  background: #fbe9de;
  border-color: #f0c3a3;
  color: #8f471d;
}

#reviewCard .grades button[data-grade="3"] {
  background: #fff4de;
  border-color: #ead39a;
  color: #7b5d1b;
}

#reviewCard .grades button[data-grade="4"] {
  background: #eef7dc;
  border-color: #cee0a5;
  color: #4d6b1d;
}

#reviewCard .grades button[data-grade="5"] {
  background: #e5f5e7;
  border-color: #b8dbbf;
  color: #1f6b3e;
}

#reviewCard .grades button.selected,
#reviewCard .grades button.grade-selected,
#reviewCard .grades button[aria-pressed="true"] {
  border-color: #0f6b3d;
  box-shadow: 0 0 0 3px rgba(15, 107, 61, .17), 0 .25rem .7rem rgba(0,0,0,.08);
}
.confidence-stats {
  margin: .75rem 0;
  padding: .75rem;
  border: 1px solid #d6e0da;
  border-radius: .75rem;
  background: #f8fbf9;
}

.confidence-stats-title {
  margin-bottom: .45rem;
  font-weight: 800;
}

.confidence-direction {
  margin: .35rem 0;
  line-height: 1.45;
}

.confidence-direction strong {
  display: block;
}

.confidence-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.confidence-stat {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .55rem;
  border-radius: .55rem;
  border: 1px solid transparent;
  font-size: .92rem;
  font-weight: 700;
  background: #ffffff;
}

.confidence-stat small {
  color: #52616b;
  font-weight: 600;
}

.confidence-stat.confidence-stat-1 {
  background: #fbe8e7;
  border-color: #efb6b2;
  color: #7b1f19;
}

.confidence-stat.confidence-stat-2 {
  background: #fceadf;
  border-color: #f0c09f;
  color: #8a3f19;
}

.confidence-stat.confidence-stat-3 {
  background: #fff4df;
  border-color: #efd195;
  color: #7f5b12;
}

.confidence-stat.confidence-stat-4 {
  background: #edf6da;
  border-color: #cfe1a0;
  color: #4b6a1a;
}

.confidence-stat.confidence-stat-5 {
  background: #e3f4e6;
  border-color: #b7dcbf;
  color: #1f6b3e;
}

.confidence-stat.confidence-stat-ungraded {
  background: #f4f6f8;
  border-color: #d8dee5;
  color: #3b4650;
}

.review-confidence-stats {
  margin-bottom: .75rem;
}

#reviewConfidenceStats .confidence-stats {
  margin: 0;
  padding: .65rem .8rem;
  border-radius: .85rem;
  background: #f9fbfa;
}

#reviewConfidenceStats .confidence-stats-title {
  margin-bottom: .35rem;
  font-size: .88rem;
}

#reviewConfidenceStats .confidence-direction {
  margin: .24rem 0;
  font-size: .92rem;
}

.home-deck-tile .confidence-stats {
  margin-top: .65rem;
  margin-bottom: 0;
}


/* all-to-5-only-031-start */
.mode-note {
  margin: .75rem 0 1rem;
  padding: .75rem;
  border: 1px solid #d6e0da;
  border-radius: .75rem;
  background: #f8fbf9;
}
.deck-audio-tools,
.home-beta-audio-panel {
  margin-top: .75rem;
}
.home-beta-audio-modes {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}
/* all-to-5-only-031-end */

/* review-celebration-040-start */
.review-celebration {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(23, 32, 38, .18);
}

.review-celebration p {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 1rem 1.25rem;
  border: 2px solid #f5c542;
  border-radius: .75rem;
  background: #fffdf5;
  color: #172026;
  font-size: clamp(1.5rem, 4vw, 2.75rem);
  font-weight: 900;
  box-shadow: 0 .8rem 2rem rgba(0,0,0,.22);
  animation: celebration-pop .7s ease both;
}

.fireworks {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.fireworks span {
  position: absolute;
  width: .7rem;
  height: .7rem;
  border-radius: 999px;
  background: #f5c542;
  box-shadow:
    0 -3.2rem #e23d28,
    2.4rem -2.1rem #1a9850,
    3.1rem .3rem #2f80ed,
    1.4rem 2.7rem #f46d43,
    -1.5rem 2.6rem #7c3aed,
    -3.1rem .1rem #00a6a6,
    -2.2rem -2.2rem #f5c542;
  animation: firework-burst 1.2s ease-out infinite;
}

.fireworks span:nth-child(1) { left: 18%; top: 28%; animation-delay: 0s; }
.fireworks span:nth-child(2) { left: 78%; top: 25%; animation-delay: .18s; }
.fireworks span:nth-child(3) { left: 30%; top: 70%; animation-delay: .36s; }
.fireworks span:nth-child(4) { left: 68%; top: 68%; animation-delay: .54s; }
.fireworks span:nth-child(5) { left: 50%; top: 18%; animation-delay: .72s; }

@keyframes firework-burst {
  0% {
    transform: scale(.1);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

@keyframes celebration-pop {
  0% {
    transform: scale(.82);
    opacity: 0;
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fireworks span,
  .review-celebration p {
    animation: none;
  }
}
/* review-celebration-040-end */

.password-toggle.is-visible .eye-slash { display: none; }
.legal-document { white-space: pre-wrap; font: inherit; line-height: 1.55; margin: 0; }
.settings-options { display: flex; gap: .6rem; margin: 0 0 1rem; flex-wrap: wrap; }
.settings-options a { text-decoration: none; }
.login-legal-footer { margin-top: 1.35rem; padding-top: .95rem; border-top: 1px solid #d6e5db; }
.login-legal-links { display: flex; gap: .65rem; flex-wrap: wrap; }
.login-legal-links a { color: #4a6458; background: #f7fbf8; border: 1px solid #c5d8cd; border-radius: .6rem; font-size: .92rem; font-weight: 600; line-height: 1.2; padding: .55rem .8rem; text-decoration: none; }
.login-legal-links a:hover { background: #edf6f0; border-color: #8fb39d; color: #244a38; }
.login-legal-links a:focus-visible { outline: 3px solid #7ca894; outline-offset: 2px; }
