@font-face {
  font-family: local-serif;
  src: local("Georgia");
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f6f5ef;
  color: #253c39;
  font-family:
    Segoe UI,
    Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.5;
}
body.reviewing {
  overflow: hidden;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  cursor: pointer;
  border: 1px solid #d8dfd6;
  background: #fff;
  color: #26443d;
  border-radius: 10px;
  padding: 11px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover,
.button:hover {
  background: #edf3ec;
  border-color: #829a8d;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #d9aa54;
  outline-offset: 3px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 23px 5%;
  border-bottom: 1px solid #dfe4da;
  background: #fbfbf5;
}
.brand {
  font:
    27px Georgia,
    serif;
  letter-spacing: -1.1px;
  color: #26443d;
  text-decoration: none;
  white-space: nowrap;
}
.brand span {
  font-weight: bold;
}
.brand small {
  font:
    10px Segoe UI,
    sans-serif;
  letter-spacing: 1.5px;
  vertical-align: top;
  margin: 6px 0 0 9px;
  display: inline-block;
  background: #e1ebde;
  padding: 3px 6px;
  border-radius: 5px;
}
nav {
  display: flex;
  gap: 8px;
}
.nav {
  border: 0;
  background: transparent;
  color: #65746c;
  padding: 10px 15px;
}
.nav.active {
  background: #e5edde;
  color: #274839;
  font-weight: 600;
}
.language {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #5b6c64;
}
.language select {
  font-size: 15px;
  padding: 7px 8px;
}
main {
  max-width: 1420px;
  margin: auto;
  padding: 35px 5% 25px;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  margin: 8px 0 30px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: #6c7f66;
}
h1 {
  font:
    43px Georgia,
    serif;
  letter-spacing: -1.4px;
  margin: 8px 0 10px;
  line-height: 1.15;
}
h2 {
  font:
    25px Georgia,
    serif;
  line-height: 1.3;
  margin: 7px 0 20px;
}
h3 {
  font-size: 20px;
  font-weight: 600;
}
.intro p {
  color: #66766c;
  margin: 0;
  max-width: 670px;
  font-size: 16px;
}
.health {
  font-size: 13px;
  background: #e6edde;
  color: #44644a;
  border-radius: 30px;
  padding: 9px 15px;
  max-width: 260px;
}
.card {
  background: #fffef9;
  border: 1px solid #dce2d6;
  border-radius: 18px;
  box-shadow: 0 4px 15px #253c3903;
}
.practice-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
}
.setup {
  padding: 27px;
}
.setup label:not(.check) {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 22px 0 7px;
}
input,
select,
textarea {
  border: 1px solid #cfd8ce;
  color: #293f37;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
}
textarea {
  resize: vertical;
  min-height: 88px;
}
.topics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 11px 0 22px;
}
.topics button {
  font-size: 12px;
  border-radius: 20px;
  padding: 5px 10px;
  background: #f0f4eb;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  margin: 22px 0 12px;
}
.check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #305b45;
  margin-top: 3px;
}
.hint {
  font-size: 13px;
  color: #6b776b;
  line-height: 1.55;
}
details {
  margin-top: 24px;
  border-top: 1px solid #e2e7dc;
  padding-top: 17px;
}
summary {
  font-size: 14px;
  color: #5d7262;
  cursor: pointer;
  min-height: 32px;
}
.small {
  font-size: 13px;
  padding: 8px 11px;
  margin: 5px 3px 0 0;
}
.conversation {
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  min-height: 570px;
  height: 760px;
  min-width: 0;
}
.conversation > :not(.messages) {
  flex-shrink: 0;
}
.conversation-top,
.review-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e5e9df;
  padding-bottom: 17px;
}
.conversation-top h2 {
  margin-bottom: 0;
}
  .conversation-actions {display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px;}
  .conversation-top {flex-wrap: wrap;}
  .voice-choice {display: flex; align-items: center; gap: 8px;}
  .voice-choice select {flex: 1; min-width: 0;}
  .review-voice, .analysis-voice {display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 0;}
  .review-voice label, .analysis-voice label {margin: 0;}
  .review-voice select, .analysis-voice select {width: auto; max-width: 100%;}
  .review-voice .hint, .analysis-voice .hint {margin: 0; flex-basis: 100%;}
  #inspection pre {white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px;}
.pill {
  font-size: 12px;
  background: #edf1e7;
  padding: 6px 13px;
  border-radius: 20px;
  white-space: nowrap;
}
.messages {
  min-height: 150px;
  overflow: auto;
  flex: 1;
  scroll-behavior: smooth;
  padding: 22px 0;
}
.empty {
  text-align: center;
  color: #778574;
  padding: 30px 15px;
}
.empty-icon {
  font-size: 57px;
  color: #8aab89;
  display: block;
  line-height: 1;
}
.empty h3 {
  font:
    24px Georgia,
    serif;
  color: #54705d;
  margin: 20px 0 10px;
}
.empty p {
  font-size: 14px;
  max-width: 310px;
  margin: auto;
}
.live-status {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 14px;
  color: #6d7f6d;
  padding: 15px 0;
  min-height: 50px;
}
#indicator {
  height: 8px;
  width: 8px;
  flex-shrink: 0;
  border-radius: 100%;
  background: #bdc8b8;
}
#indicator.listening {
  background: #447450;
  box-shadow: 0 0 0 4px #dfeadb;
}
.controls {
  padding: 17px 0;
  border-bottom: 1px solid #e5e9df;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.primary {
  background: #2c5842;
  color: #fff;
  border-color: #2c5842;
  padding: 13px 22px;
  font-weight: 600;
}
.primary:hover {
  background: #214535;
  color: #fff;
}
.secondary {
  background: #eaf0e4;
  border-color: #d3ddca;
}
.quiet {
  background: transparent;
  border-color: transparent;
}
.typing {
  margin-top: 17px;
  padding-top: 12px;
}
.typing form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.privacy {
  font-size: 12px;
  color: #7a8678;
  margin: 20px 0;
  text-align: center;
}
.bubble {
  margin: 0 0 17px;
  border-radius: 12px;
  padding: 16px 20px;
  background: #eef2e8;
  max-width: 92%;
  border: 1px solid #dde5d5;
}
.bubble.user {
  background: #fff;
  margin-left: auto;
  border-color: #d8e0d5;
}
.bubble.assistant {
  border-left: 3px solid #89a785;
}
.who {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  color: #6d816b;
}
.content {
  font-size: 17px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 5px 0;
}
.meta,
.feedback-badges {
  font-size: 12px;
  color: #697969;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.feedback-badges span {
  border-radius: 5px;
  padding: 3px 7px;
  background: #ebf2e7;
  color: #3e6446;
}
.feedback-badges .practice {
  background: #fff0d4;
  color: #825b13;
}
.feedback-badges .uncertain {
  background: #eceef1;
  color: #596472;
}
.feedback-badges .pending {
  background: #f0f1ed;
  color: #70776d;
}
.bubble.practice {
  border-left: 4px solid #dcb356;
}
.bubble.uncertain {
  border-left: 4px solid #9aa7b2;
}
.bubble.clear {
  border-left: 4px solid #7d9f70;
}
.actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.actions button {
  font-size: 12px;
  padding: 5px 9px;
  background: transparent;
}
.translation {
  font-size: 15px;
  color: #56785d;
  padding-top: 9px;
  border-top: 1px dashed #dce4d6;
  margin-top: 12px;
}
.review-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
}
.saved-list {
  padding: 25px;
  align-self: start;
}
.saved-list h2 {
  font-size: 22px;
}
.saved-entry {
  display: block;
  width: 100%;
  text-align: left;
  margin: 8px 0;
  background: #f6f7ef;
  padding: 13px 12px;
}
.saved-entry.selected {
  border-color: #76956b;
  background: #edf3e7;
}
.saved-entry strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
.saved-entry span {
  font-size: 12px;
  display: block;
  color: #768171;
}
.review {
  padding: 27px;
}
.review-toolbar {
  align-items: flex-start;
  flex-wrap: wrap;
}
.review-toolbar h2 {
  margin: 0;
}
.review-toolbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.review #review-messages {
  padding-top: 16px;
  max-height: 540px;
  overflow: auto;
}
.review .bubble {
  max-width: 100%;
}
.review .bubble.user {
  cursor: pointer;
}
.review .bubble.selected {
  outline: 2px solid #7c9a70;
  outline-offset: 2px;
}
#inspection {
  padding: 0;
}
.analysis-body {padding: 22px 24px 28px; min-width: 0;}
.analysis-settings {margin: 0 0 22px; padding-top: 0; border-top: 0;}
.analysis-settings > summary {padding: 10px 0;}
.analysis-body .analysis-voice {gap: 10px 14px;}
.analysis-voice select {flex: 1; min-width: 0;}
.pronunciation-summary {margin: 18px 0; padding: 18px; background: #f5f7f0; border: 1px solid #dce5d7; border-radius: 12px;}
.pronunciation-summary h3 {font: 22px Georgia, serif; margin: 0 0 8px;}
.pronunciation-summary .scores {margin: 12px 0; flex-wrap: wrap;}
.pronunciation-summary .score {min-width: 180px;}
.pronunciation-summary .hint {margin: 8px 0 0;}
.pronunciation-detail {margin-top: 0;}
.sound-panel {margin-top: 18px; padding: 16px; border: 1px solid #dce5d7; border-radius: 10px;}
.sound-controls {display: flex; flex-wrap: wrap; align-items: center; gap: 10px;}
.sound-controls label {margin: 0;}
.sound-controls select {flex: 1; min-width: 100px; max-width: 100%;}
.sound-table-scroll {overflow-x: auto; max-width: 100%;}
.sound-table {width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 15px;}
.sound-table caption {text-align: left; padding: 8px 0; color: #647464; font-size: 14px;}
.sound-table th, .sound-table td {text-align: left; padding: 9px 12px; border-bottom: 1px solid #e0e6dc; overflow-wrap: anywhere;}
.sound-table td:first-child, .sound-table td:nth-child(2) {font-size: 20px;}
.sound-table .sound-low {background: #fff4e0;}
.analysis-tabs {display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0; border-bottom: 1px solid #e0e6dc; margin-bottom: 16px;}
.analysis-tabs button {font-size: 15px; padding: 9px 14px;}
.analysis-tabs button.active {background: #315846; color: #fff; border-color: #315846;}
.transcript-panel textarea {margin-bottom: 8px;}
.analysis-status {margin: 8px 0; padding: 12px 14px; border-radius: 8px; background: #eff3e9; font-size: 14px;}
.analysis-status.failed {background: #fff0e3; color: #84421f;}
#analysis-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: 90dvh;
  padding: 0;
  border: 1px solid #d4ddcd;
  border-radius: 16px;
  color: inherit;
  background: #fffef9;
  overflow: auto;
  overscroll-behavior: contain;
}
#analysis-dialog::backdrop {
  background: rgb(30 50 40 / 45%);
}
.analysis-header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 18px 24px;
  background: #fffef9;
  border-bottom: 1px solid #dfe5d6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.analysis-header h2 {
  margin: 0;
}
.recording-part {
  margin-bottom: 20px;
}
.recording-part select {
  margin-top: 8px;
}
.bubble .review-open {
  font-weight: 600;
  background: #edf3e7;
}
#inspection h3 {
  font:
    24px Georgia,
    serif;
  margin: 0 0 12px;
}
audio {
  width: 100%;
  height: 42px;
  margin: 10px 0;
}
.scores {
  display: flex;
  gap: 15px;
  margin: 17px 0;
}
.score {
  flex: 1;
  background: #eff3e9;
  border-radius: 9px;
  padding: 13px;
}
.score strong {
  font-size: 26px;
  display: block;
}
.score span {
  font-size: 12px;
  color: #6a7963;
}
.words {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.words button {
  font-size: 14px;
  background: #edf2e8;
  padding: 8px 10px;
}
.words button.practice {
  background: #fff0d4;
  border-color: #e4c47d;
}
.words button.unscored {
  background: #f1f1ee;
  color: #7c8179;
}
.grammar {
  background: #f3f6ed;
  border-radius: 10px;
  padding: 17px;
  margin: 18px 0;
}
.grammar p {
  margin: 7px 0;
}
.grammar ul {
  padding-left: 22px;
}
.grammar .corrected {
  font-size: 19px;
  color: #305e42;
}
.stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}
.stat {
  background: #edf2e5;
  border: 1px solid #d9e3d0;
  padding: 25px;
  border-radius: 14px;
}
.stat strong {
  display: block;
  font:
    38px Georgia,
    serif;
}
.stat span {
  font-size: 14px;
  color: #6d7e64;
}
.progress-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.progress-grid .card {
  padding: 27px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid #e2e6dc;
  padding: 13px 8px;
}
th {
  font-weight: 600;
  font-size: 12px;
  color: #74836d;
}
.repeated-word {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #e3e8dd;
  font-size: 15px;
}
#error {
  background: #f9e8df;
  color: #844c35;
  padding: 14px 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  font-size: 15px;
}
.danger {
  color: #9c5242;
}
footer {
  display: flex;
  justify-content: space-between;
  margin: 30px 5% 0;
  border-top: 1px solid #dfe5d7;
  padding: 20px 0;
  color: #85917e;
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  header {
    flex-wrap: wrap;
    padding: 18px 4%;
    gap: 16px;
  }
  nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .practice-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .setup {
    padding: 23px;
  }
  .conversation {
    padding: 23px;
  }
  .intro {
    align-items: flex-start;
  }
  h1 {
    font-size: 36px;
  }
  .review-grid {
    grid-template-columns: 230px minmax(0, 1fr);
  }
}
@media (max-width: 720px) {
  body {
    font-size: 16px;
  }
  main {
    padding: 24px 5%;
  }
  .intro {
    display: block;
  }
  .health {
    display: inline-block;
    margin-top: 14px;
  }
  .practice-grid,
  .review-grid,
  .progress-grid {
    grid-template-columns: 1fr;
  }
  .setup {
    padding: 22px;
  }
  .setup h2 {
    margin-bottom: 12px;
  }
  .setup label:not(.check) {
    margin-top: 15px;
  }
  .setup .hint {
    margin-bottom: 0;
  }
  .conversation {
    min-height: 500px;
  }
  .nav {
    font-size: 13px;
    padding: 10px;
  }
  h1 {
    font-size: 34px;
  }
  .stats-cards {
    gap: 9px;
  }
  .stat {
    padding: 16px 12px;
  }
  .stat strong {
    font-size: 29px;
  }
  .stat span {
    font-size: 12px;
  }
  .saved-list {
    padding: 20px;
  }
  .saved-list #saved-list {
    max-height: 230px;
    overflow: auto;
  }
  .bubble {
    max-width: 98%;
    padding: 14px 15px;
  }
  .review {
    padding: 20px;
  }
  footer {
    gap: 20px;
  }
  .language span {
    display: none;
  }
  .topics {
    margin-bottom: 0;
  }
}
body.portal-loading header, body.portal-loading main, body.portal-loading footer { display: none; }
.portal-login { max-width: 38rem; margin: 8vh auto; padding: 2rem; }
.portal-google { display: inline-block; text-decoration: none; margin-top: 1rem; }
.portal-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: .75rem 2rem; }
.portal-toolbar span { margin-right: auto; overflow-wrap: anywhere; }
.portal-admin { width: min(60rem, 92vw); max-height: 85vh; border: 1px solid #d7dfd1; border-radius: 1rem; padding: 1.5rem; overflow-y: auto; }
.portal-admin::backdrop { background: rgba(30,45,35,.45); }
.portal-admin-row { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: .75rem 0; border-bottom: 1px solid #d7dfd1; }
.portal-admin-row span { flex: 1 1 16rem; overflow-wrap: anywhere; }
.portal-admin-row input[type=email] { flex: 1 1 16rem; }
.portal-admin-row label { display: flex; align-items: center; gap: .4rem; }
.portal-error { color: #9c341b; }
