/* ===== Global ===== */
body {
  font-family: var(--font-stack);
  background-color: var(--bg-main);
  overflow-x: hidden;
}

/* App header — hidden during conversation */
body.conversation-active #app-header {
  display: none;
}

/* Settings/help button only shown on non-conversation screens */
body.conversation-active .btn-help-fixed {
  display: none;
}

.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.screen.active {
  display: block;
  opacity: 1;
}

/* ===== Screen 1: Home ===== */
.home-container {
  min-height: calc(100dvh - 52px - 60px - 56px);
  justify-content: center;
}

@media (min-width: 992px) {
  .home-container {
    min-height: calc(100dvh - 52px - 60px);
  }
}

.home-cards-wrapper {
  max-width: 500px;
}

.home-language-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.home-language-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.home-language-card:active {
  transform: scale(0.98);
}

.home-language-card-content {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.home-language-icon {
  font-size: 28px;
  color: var(--color-primary);
  background: #ede5fb;
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.home-language-card-text {
  display: flex;
  flex-direction: column;
}

.home-language-card-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.home-language-card-desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.home-language-chevron {
  color: var(--color-muted);
  font-size: 20px;
}

.home-tips {
  max-width: 500px;
  width: 100%;
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.home-tips-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.home-tips-title .material-symbols-outlined {
  font-size: 20px;
  color: var(--color-primary);
}

.home-tips-list {
  padding-left: 1.25rem;
  margin-bottom: 0;
}

.home-tips-list li {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}

.home-tips-list li:last-child {
  margin-bottom: 0;
}

/* Listening indicator (three dots animation) */
.listening-indicator {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.listening-dot {
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: listening-bounce 1.4s infinite ease-in-out both;
}

.listening-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.listening-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.listening-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes listening-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Speaking indicator */
.speaking-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.speaking-icon {
  font-size: 1.4rem;
  color: var(--color-primary);
  animation: speaking-pulse 1.2s infinite ease-in-out;
}

@keyframes speaking-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ===== Screen 2: Conversation ===== */

/* Layout */
#convo-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#convo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  padding-bottom: 140px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.convo-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.25rem;
}

.convo-toolbar-left {
  display: flex;
  align-items: center;
  min-width: 44px;
}

.convo-toolbar-center {
  flex: 1;
  text-align: center;
}

.convo-progress {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
}

.convo-theme-label {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.convo-toolbar-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  font-size: 1.1rem;
}

/* Image (front and center) */
.convo-image {
  width: 100%;
  flex: 1;
  object-fit: contain;
  min-height: 0;
  border: 3px solid #dee2e6;
}

/* Countdown overlay */
#countdown-overlay {
  position: absolute;
  bottom: 140px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 1rem;
  background: rgba(248, 249, 250, 0.9);
}

.countdown-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

/* Fixed bottom bar */
.convo-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 1030;
}

/* REPEAT / NEXT controls */
.convo-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
}

.btn-convo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 140px;
  min-height: 48px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  letter-spacing: 0.5px;
}

.btn-convo-pill .material-symbols-outlined {
  font-size: 20px;
}

@media (max-width: 576px) {
  .convo-controls {
    max-width: 100%;
  }
  .btn-convo-pill {
    flex: 1;
    min-width: 0;
  }
}

/* Mic level indicator */
.mic-level-container {
  width: 160px;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

/* Threshold marker line at 25% (RMS 10 / 40 normalization) */
.mic-level-threshold {
  position: absolute;
  left: 25%;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.mic-level-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0A8217, #F79009, #D7260F);
  border-radius: 3px;
  transition: width 0.08s ease-out;
}

/* Caption shown on 2nd+ repeat */
.convo-caption {
  text-align: center;
  font-size: 0.95rem;
  color: #333;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

/* Recording indicator */
.recording-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.recording-dot {
  width: 14px;
  height: 14px;
  background-color: #D7260F;
  border-radius: 50%;
  animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
  0% {
    box-shadow: 0 0 0 0 rgba(215, 38, 15, 0.5);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(215, 38, 15, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(215, 38, 15, 0);
  }
}

/* ===== Screen 3: Feedback ===== */
.feedback-celebration {
  padding: 2rem 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.feedback-celebration h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.feedback-encouragement {
  font-size: 1.1rem;
  color: #667085;
  margin-bottom: 1.5rem;
}

.feedback-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.feedback-score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.1;
}

.feedback-score-bar {
  width: 100%;
  max-width: 300px;
  height: 12px;
  background: #e9ecef;
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto;
}

.feedback-score-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease-out;
  background: var(--color-primary);
}

.feedback-stimulus-section {
  text-align: center;
}

.feedback-theme-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Criteria cards with colored progress */
.criteria-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.criteria-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.criteria-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #212529;
}

.criteria-card-score {
  font-weight: 700;
  font-size: 0.95rem;
}

.criteria-progress {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.criteria-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.criteria-card-band {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.criteria-card-comment {
  font-size: 0.85rem;
  color: #667085;
  margin-bottom: 0;
}

.band-badge {
  display: inline-block;
  padding: 0.75rem 2.5rem;
  border-radius: 50px;
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  animation: badge-pop 0.4s ease-out;
}

@keyframes badge-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.band-outstanding {
  background-color: var(--band-l5);
}

.band-strong {
  background-color: var(--band-l4);
}

.band-competent {
  background-color: var(--band-l3);
}

.band-developing {
  background-color: var(--band-l2);
}

.band-weak {
  background-color: var(--band-l1);
}

.criterion-card {
  border-left: 4px solid;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 0 8px 8px 0;
}

.criterion-card.bucket-5 {
  border-left-color: var(--band-l5);
}

.criterion-card.bucket-4 {
  border-left-color: var(--band-l4);
}

.criterion-card.bucket-3 {
  border-left-color: var(--band-l3);
}

.criterion-card.bucket-2 {
  border-left-color: var(--band-l2);
}

.criterion-card.bucket-1 {
  border-left-color: var(--band-l1);
}

/* Per-question card */
.q-card {
  background: #fff;
  border: 1px solid var(--color-border, #e9ecef);
  border-radius: var(--radius-lg, 12px);
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.q-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15em 0.5em;
  border-radius: var(--radius-pill, 9999px);
  background: #f0f4f8;
  color: #667085;
}

.q-badge-evaluated {
  background: #e6f9ed;
  color: #0A8217;
}

.perq-band-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.perq-eval-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.perq-feedback-item {
  font-size: 0.85rem;
  color: #495057;
  line-height: 1.4;
}

.perq-feedback-label {
  font-weight: 600;
}

.perq-strength i {
  color: #0A8217;
}

.perq-improvements i {
  color: #F79009;
}

.perq-feedback-text i {
  color: #0F71BB;
}

/* Suggested answer in transcript */
.suggested-answer {
  background-color: #f0faf0;
  border-left: 3px solid var(--color-success);
  padding: 0.5rem 0.75rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
}

.suggested-answer-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* Two-panel feedback layout */
.feedback-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.feedback-nav {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.feedback-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feedback-nav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  color: #495057;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: background 0.15s;
  white-space: nowrap;
}

.feedback-nav-link:hover,
.feedback-nav-link.active {
  background: #f0f4f8;
  color: #212529;
  font-weight: 500;
}

.feedback-nav-divider {
  height: 1px;
  background: #e9ecef;
  margin: 0.4rem 0.75rem;
}

/* Mini segments in left nav */
.nav-mini-segments {
  display: flex;
  gap: 2px;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.nav-mini-segment {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #ccc;
  background: transparent;
}

/* Main criterion segments */
.criterion-segments {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 0.5rem;
}

.criterion-segment {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: transparent;
}

/* Filled segment colors per bucket */
.segment-filled-5 { background: var(--band-l5); border-color: var(--band-l5); }
.segment-filled-4 { background: var(--band-l4); border-color: var(--band-l4); }
.segment-filled-3 { background: var(--band-l3); border-color: var(--band-l3); }
.segment-filled-2 { background: var(--band-l2); border-color: var(--band-l2); }
.segment-filled-1 { background: var(--band-l1); border-color: var(--band-l1); }

.criterion-band-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-left: 0.25rem;
}

/* Criterion sections */
.feedback-main {
  flex: 1;
  min-width: 0;
}

.feedback-section {
  scroll-margin-top: 1rem;
  margin-bottom: 0;
}

.feedback-section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  border-left: 4px solid;
  padding-left: 0.75rem;
  margin-bottom: 0.75rem;
}

/* ===== Help / Settings ===== */

.btn-help-fixed {
  position: fixed;
  top: 3.5rem;
  right: 0.75rem;
  z-index: 1060;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #adb5bd;
  background: white;
  color: #667085;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.15s, color 0.15s;
}

.btn-help-fixed:hover {
  background: var(--bg-main);
  color: #495057;
}

@media (max-width: 576px) {
  .btn-help-fixed {
    width: 2.75rem;
    height: 2.75rem;
  }
}

.help-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1070;
}

.help-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1080;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}

.help-modal.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.help-modal-dialog {
  background: white;
  border-radius: 1rem 1rem 0 0;
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.help-modal-body {
  /* intentionally plain */
}

.volume-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.volume-slider {
  flex: 1;
}

/* Settings cards */
.settings-card {
  background: var(--bg-main);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.875rem;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.settings-card-header .material-symbols-outlined {
  font-size: 22px;
  color: var(--color-primary);
}

.settings-mic-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.settings-mic-status .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-muted);
}

/* ===== Responsive ===== */

/* Desktop (>=992px): Single-panel conversation layout (centered) */
@media (min-width: 992px) {
  #convo-layout {
    display: flex;
    justify-content: center;
    height: 100vh;
  }

  #convo-main {
    max-width: 800px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* Safe area for bottom bar on notched devices */
  .convo-bottom-bar {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }

  #convo-main {
    padding-top: env(safe-area-inset-top, 1rem);
  }

  /* Image min-height so it's visible even on short screens */
  .convo-image {
    min-height: 180px;
  }

  /* Feedback main padding */
  .feedback-main {
    padding: 0 0.25rem;
  }
}

@media (min-width: 769px) and (max-width: 991px) {
  #screen-feedback .container {
    max-width: 700px;
  }
}

@media (min-width: 992px) {
  #screen-feedback .container {
    max-width: 1100px;
  }
}

/* ===== Feedback Transcript Play Buttons ===== */
.transcript-play-btn {
  color: var(--color-primary);
  line-height: 1.2;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.transcript-play-btn:hover {
  opacity: 1;
}

.transcript-play-btn.playing {
  color: #D7260F;
  opacity: 1;
}

#btn-play-all.playing {
  background-color: #D7260F;
  border-color: #D7260F;
  color: #fff;
}

/* ===== Screen: Theme Selection ===== */

#screen-themes {
  min-height: 100vh;
}

.themes-container {
  max-width: 960px;
}

@media (max-width: 767px) {
  .themes-container {
    max-width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .themes-container {
    max-width: 720px;
  }
}

/* Controls row */
.themes-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.themes-search-wrapper {
  position: relative;
  flex: 1;
}

.themes-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--color-muted);
  pointer-events: none;
}

.themes-search-input {
  padding-left: 2.5rem;
}

.themes-filter-select {
  width: auto;
  min-width: 140px;
}

/* Random topic button */
.themes-random-btn {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 360px;
  display: block;
}

/* Image grid */
.themes-image-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .themes-image-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .themes-image-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Theme card */
.theme-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.theme-card--loading {
  opacity: 0.5;
  pointer-events: none;
}

.theme-card-image-wrapper {
  width: 100%;
  padding-top: 66.67%;
  position: relative;
  background: #f0f0f0;
  overflow: hidden;
}

.theme-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.theme-card-image[data-src] {
  opacity: 0;
}

.theme-card-image.loaded {
  opacity: 1;
}

.theme-card-body {
  padding: 0.625rem 0.75rem;
}

.theme-card-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.theme-card-status {
  font-size: 0.72rem;
  color: var(--color-muted);
}

.theme-card-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: var(--radius-pill);
}

.theme-card-score {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-muted);
}

.theme-card-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  z-index: 2;
}

@media (max-width: 576px) {
  .themes-random-btn {
    max-width: 100%;
  }
  .themes-controls {
    flex-direction: column;
  }
  .themes-filter-select {
    width: 100%;
  }
}




/* ===== History Screen ===== */
.history-container {
  max-width: 900px;
}

.history-stat-card {
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.history-stat-value {
  line-height: 1.2;
}

.history-stat-delta {
  color: #12b76a;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.history-row:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

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

.history-row-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.history-date {
  font-size: 0.8rem;
}

.history-theme {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-row-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

.history-score {
  font-size: 0.82rem;
  color: #667085;
  font-weight: 500;
}

/* ===== Auth Screens (Sign Up / Login) ===== */
.auth-container {
  min-height: calc(100dvh - 52px - 60px - 56px);
  justify-content: center;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 992px) {
  .auth-container {
    min-height: calc(100dvh - 52px - 60px);
  }
}

.auth-card {
  max-width: 400px;
  border-radius: var(--radius-lg);
}

.auth-card .input-group .btn {
  border-color: #dee2e6;
}

/* ===== OTP Modal ===== */
.otp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  padding: 1rem;
}

.otp-modal {
  background: #fff;
  border-radius: var(--radius-lg, 0.5rem);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.otp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e9ecef;
}

.otp-modal-body {
  padding: 1.25rem;
}

.otp-digit-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.otp-digit {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  border: 2px solid #dee2e6;
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.otp-digit:focus {
  border-color: var(--color-primary, #6d0dfd);
  box-shadow: 0 0 0 3px rgba(109, 13, 253, 0.15);
}

/* ===== Parent Dashboard ===== */
.dashboard-container {
  max-width: 600px;
  margin: 0 auto;
}

.dashboard-child-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dashboard-child-card .btn-sm {
  padding: 0.25rem 0.5rem;
}

/* ===== Child Modal Preview Avatar ===== */
.child-modal-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 2rem;
}

/* ===== Dashboard Toast ===== */
.dashboard-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #198754;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill, 9999px);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10100;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.dashboard-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Profile Screen ===== */
.profile-container {
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 575px) {
  .profile-container {
    max-width: 100%;
  }
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-stat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.profile-stat-card .card-body {
  padding: 1rem;
}

.profile-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.25rem;
}

.profile-stat-label {
  font-size: 0.8rem;
  color: #667085;
  margin-bottom: 0;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: none;
  text-decoration: none;
  color: #212529;
  transition: background 0.15s;
  width: 100%;
  text-align: left;
  background: none;
  cursor: pointer;
}

.profile-menu-item:hover {
  background: var(--bg-main);
  text-decoration: none;
  color: #212529;
}

.profile-menu-item.text-danger:hover {
  background: #fcdad6;
}

.profile-menu-icon {
  font-size: 22px;
  color: #667085;
  flex-shrink: 0;
}

.profile-menu-item.text-danger .profile-menu-icon {
  color: var(--color-danger);
}

.profile-menu-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
}

.profile-menu-chevron {
  font-size: 20px;
  color: #adb5bd;
  flex-shrink: 0;
}

/* ===== Score Reveal Animations ===== */

@keyframes scoreCountUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bandReveal {
  0% { opacity: 0; transform: scale(0.3); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.score-reveal {
  animation: scoreCountUp 0.6s ease-out forwards;
}

.band-reveal {
  animation: bandReveal 0.5s ease-out forwards;
}

/* Staggered criteria card entrance */
@keyframes criteriaSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.criteria-card-reveal {
  animation: criteriaSlideIn 0.4s ease-out forwards;
}
