/* ============================================================
   EB-2 NIW Interview Prep — Global Styles
   Brand color: #005175
   Mobile-first, clean, professional
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --brand: #005175;
  --brand-dark: #003d5a;
  --brand-light: #e6f2f7;
  --brand-mid: #0074a6;

  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --white: #ffffff;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.14);
  --transition: 0.2s ease;
  --header-h: 56px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100dvh;
  line-height: 1.55;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Header ---------- */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--brand);
  color: var(--white);
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 16px;
  max-width: 960px;
  margin: 0 auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-icon { font-size: 1.25rem; }

.main-nav {
  display: none;
}

/* Mobile dropdown — slides below the fixed header */
.main-nav.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--brand);
  z-index: 99;
  padding: 8px 12px 16px;
  gap: 2px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* Overlay behind the open menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  z-index: 98;
  background: rgba(0,0,0,0.3);
}
.nav-overlay.visible { display: block; }

.nav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: left;
  width: 100%;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-btn:hover, .nav-btn.active {
  background: rgba(255,255,255,0.15);
  color: var(--white);
}

.nav-toggle {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

/* ---------- Main Content ---------- */
#app-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

.screen { width: 100%; }

.screen-inner {
  padding-top: calc(var(--header-h) + 20px);
}

.screen-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.screen-title-row h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

/* ---------- Onboarding Screen ---------- */
.onboarding-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
}

.onboarding-logo { font-size: 4rem; }

.onboarding-wrap h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gray-900);
}

.onboarding-sub {
  max-width: 480px;
  color: var(--gray-500);
  font-size: 1rem;
  line-height: 1.6;
}

.onboarding-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.onboarding-form label {
  font-weight: 600;
  color: var(--gray-700);
  text-align: left;
}

.onboarding-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color var(--transition);
  outline: none;
}

.onboarding-form input:focus { border-color: var(--brand); }

.onboarding-hint {
  font-size: 0.82rem;
  color: var(--gray-400);
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin-bottom: 16px;
}

.card-alert {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-left: 4px solid var(--warning);
}

.card-success {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-left: 4px solid var(--success);
}

.card-icon { font-size: 1.8rem; flex-shrink: 0; padding-top: 2px; }

.card-content { flex: 1; }

.card-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.card-content p {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-outline, .btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-secondary {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-light);
}
.btn-secondary:hover { background: #cce4ef; border-color: #cce4ef; }

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover { background: var(--brand-light); }

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger-outline:hover { background: var(--danger-light); }

.btn-lg { padding: 14px 28px; font-size: 1.05rem; width: 100%; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }

/* ---------- Home Screen ---------- */
.home-header {
  padding-top: calc(var(--header-h) + 20px);
  margin-bottom: 20px;
}

.home-header h2 { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); }
.home-subtitle { color: var(--gray-500); margin-top: 4px; }

.question-count-control {
  margin-bottom: 16px;
}

.question-count-control label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.question-count-control input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
  height: 6px;
  cursor: pointer;
}

.q-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 4px;
}

.cost-estimate {
  text-align: center;
  font-size: 0.82rem;
  color: var(--gray-400);
  margin-top: 8px;
}

.home-quick-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.quick-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.quick-nav-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.qnc-icon { font-size: 1.6rem; }
.qnc-label { font-size: 0.88rem; font-weight: 700; color: var(--gray-800); }
.qnc-desc { font-size: 0.76rem; color: var(--gray-500); line-height: 1.3; }

/* ---------- Tab Bar ---------- */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------- Prose Content (Learn screen) ---------- */
.prose-content {
  line-height: 1.7;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.prose-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 28px 0 10px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
}

.prose-content h2:first-child { border-top: none; margin-top: 0; }

.prose-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  margin: 20px 0 8px;
}

.prose-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 16px 0 6px;
}

.prose-content p { margin-bottom: 12px; }

.prose-content ul, .prose-content ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.prose-content li { margin-bottom: 4px; }

.prose-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 16px 0;
  overflow-x: auto;
  display: block;
}

.prose-content th {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 700;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid var(--brand);
}

.prose-content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.prose-content tr:hover td { background: var(--gray-50); }

.prose-content blockquote {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  font-style: italic;
  color: var(--gray-700);
}

.prose-content strong { color: var(--gray-900); }

.prose-content em { color: var(--gray-600); }

.prose-content hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 24px 0;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
  margin-bottom: 16px;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}

.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon { font-size: 3rem; }

.upload-zone-inner h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-700);
}

.upload-zone-inner p {
  font-size: 0.85rem;
  color: var(--gray-400);
}

.file-input-hidden {
  position: absolute;
  width: 0; height: 0;
  opacity: 0; pointer-events: none;
}

/* Progress bar */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-700);
}

.progress-bar-wrap {
  background: var(--gray-200);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-detail {
  font-size: 0.82rem;
  color: var(--gray-500);
}

/* Case info */
.case-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.case-info-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.case-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.case-info-item { display: flex; flex-direction: column; gap: 2px; }
.case-info-label { font-size: 0.78rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.05em; }
.case-info-value { font-size: 0.92rem; font-weight: 600; color: var(--gray-800); }

.case-summary-preview {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
}

.case-summary-preview h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-preview-text {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.6;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ---------- Practice Screen ---------- */
.practice-setup { padding-top: calc(var(--header-h) + 20px); }

.practice-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.practice-info-item { display: flex; flex-direction: column; gap: 2px; }
.pi-label { font-size: 0.78rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.04em; }
.pi-value { font-size: 1rem; font-weight: 700; color: var(--brand); }

/* Active session */
.practice-session {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100dvh;
  padding-top: var(--header-h);
}

.session-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-700);
  position: sticky;
  top: var(--header-h);
  z-index: 10;
}

.session-timer {
  background: var(--brand-light);
  color: var(--brand);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.btn-end-early {
  background: none;
  border: 1px solid var(--gray-300);
  color: var(--gray-500);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-end-early:hover { border-color: var(--danger); color: var(--danger); }

/* Agent bubble */
.agent-area {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.agent-avatar {
  font-size: 2.5rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--brand-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand);
}

.agent-bubble {
  background: var(--brand);
  color: var(--white);
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 16px 20px;
  flex: 1;
  box-shadow: var(--shadow);
}

.agent-bubble-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-bottom: 8px;
}

.agent-text {
  font-size: 1rem;
  line-height: 1.6;
}

/* Audio indicator */
.audio-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.8rem;
  opacity: 0.85;
}

.audio-wave {
  width: 4px;
  height: 12px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  animation: wave 0.8s infinite ease-in-out;
}
.audio-wave:nth-child(2) { animation-delay: 0.15s; }
.audio-wave:nth-child(3) { animation-delay: 0.3s; }

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.4); }
}

/* User area */
.user-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-transcript-area {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--gray-200);
}

.user-bubble-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.user-transcript-text {
  font-size: 0.95rem;
  color: var(--gray-800);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Recording controls */
.recording-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.btn-record {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--white);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: all var(--transition);
  color: var(--gray-700);
}

.btn-record:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-record.recording {
  border-color: var(--danger);
  background: var(--danger-light);
  color: var(--danger);
  animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

.record-icon { font-size: 1.4rem; }

.recording-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--danger);
}

.rec-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: blink 1s infinite;
}

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

.transcription-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.answer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Report ---------- */
.report-header {
  text-align: center;
  padding: 24px 0 20px;
}

.report-header h2, .report-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.report-meta {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.report-score-big {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.score-circle small {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.8;
}

.score-circle.score-low { background: var(--danger); }
.score-circle.score-mid { background: var(--warning); }
.score-circle.score-high { background: var(--success); }

.report-scores-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.score-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-bar-label {
  width: 130px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  flex-shrink: 0;
}

.score-bar-wrap {
  flex: 1;
  background: var(--gray-200);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.8s ease;
  width: 0%;
}

.score-bar-val {
  width: 44px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-600);
  flex-shrink: 0;
}

.report-markdown {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
}

.report-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- Checklist Screen ---------- */
.checklist-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist-progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
}

.checklist-progress-bar-wrap {
  background: var(--gray-200);
  border-radius: 999px;
  height: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}

.checklist-progress-bar {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Checklist sections */
.checklist-section {
  margin-bottom: 12px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.checklist-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: var(--white);
  transition: background var(--transition);
}

.checklist-section-header:hover { background: var(--gray-50); }

.checklist-section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
}

.checklist-section-badge {
  font-size: 0.75rem;
  background: var(--brand-light);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.checklist-section-toggle {
  font-size: 1rem;
  color: var(--gray-400);
  transition: transform var(--transition);
}

.checklist-section.open .checklist-section-toggle { transform: rotate(90deg); }

.checklist-section-body { display: none; padding: 8px 18px 18px; border-top: 1px solid var(--gray-100); }
.checklist-section.open .checklist-section-body { display: block; }

.checklist-table {
  width: 100%;
  border-collapse: collapse;
}

.checklist-table td {
  padding: 8px 4px;
  vertical-align: top;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
  color: var(--gray-700);
}

.checklist-table td:first-child { width: 28px; padding-right: 10px; }

.checklist-table tr:last-child td { border-bottom: none; }

.checklist-item-label { line-height: 1.5; }
.checklist-item-label.checked {
  text-decoration: line-through;
  color: var(--gray-400);
}

input[type="checkbox"].checklist-cb {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
  margin-top: 2px;
}

/* Useful contacts table */
.contacts-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.contacts-table th {
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
}
.contacts-table td { padding: 8px 12px; border-bottom: 1px solid var(--gray-100); }
.contacts-table tr:last-child td { border-bottom: none; }

/* ---------- Sessions Screen ---------- */
.sessions-table {
  width: 100%;
  border-collapse: collapse;
}

.sessions-table th {
  background: var(--gray-100);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sessions-table td {
  padding: 12px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.sessions-table tr { cursor: pointer; transition: background var(--transition); }
.sessions-table tr:hover td { background: var(--brand-light); }

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--white);
}
.score-badge.low { background: var(--danger); }
.score-badge.mid { background: var(--warning); }
.score-badge.high { background: var(--success); }

/* ---------- Spend Widget ---------- */
.spend-widget {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 200;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

.spend-widget-main {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 8px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.spend-widget-main:hover { box-shadow: var(--shadow-lg); }

.spend-icon { font-size: 1.1rem; }

.spend-info { display: flex; flex-direction: column; }
.spend-label { font-size: 0.7rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.spend-amount { font-weight: 800; color: var(--gray-800); font-size: 0.95rem; }
.spend-amount.green { color: var(--success); }
.spend-amount.amber { color: var(--warning); }
.spend-amount.red { color: var(--danger); }

.spend-expand-icon { color: var(--gray-400); font-size: 0.75rem; }

.spend-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  width: 220px;
}

.spend-popover-title {
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.spend-breakdown { display: flex; flex-direction: column; gap: 6px; }

.spend-row {
  display: flex;
  justify-content: space-between;
  color: var(--gray-600);
  font-size: 0.85rem;
}

.spend-divider { height: 1px; background: var(--gray-200); margin: 4px 0; }

.spend-total-row { font-weight: 800; color: var(--gray-900); font-size: 0.9rem; }

.spend-updated {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 10px;
  margin-bottom: 8px;
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 48px 20px;
}

.empty-icon { font-size: 3rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-700); }
.empty-state p { font-size: 0.9rem; color: var(--gray-500); max-width: 300px; }

/* ---------- Loading State ---------- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 48px 20px;
}

.loading-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-700); }
.loading-state p { font-size: 0.9rem; color: var(--gray-500); }
.loading-sub { font-size: 0.82rem !important; color: var(--gray-400) !important; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--gray-900);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease;
  max-width: 320px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Back button ---------- */
.back-btn { margin-bottom: 16px; }

/* ---------- Responsive: Tablet+ ---------- */
@media (min-width: 640px) {
  .main-nav {
    display: flex !important; /* always visible on desktop */
    position: static;
    flex-direction: row;
    flex: 1;
    justify-content: flex-end;
    gap: 4px;
    padding: 0;
    box-shadow: none;
    border-top: none;
    background: transparent;
  }
  .main-nav.open { flex-direction: row; }
  .nav-btn {
    font-size: 0.88rem;
    padding: 6px 12px;
    width: auto;
    text-align: center;
  }
  .nav-toggle { display: none; }
  .nav-overlay { display: none !important; }

  .header-inner { padding: 0 24px; }

  #app-main { padding: 0 24px 100px; }

  .home-quick-nav { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Print Styles ---------- */
@media print {
  .app-header, .spend-widget, .toast-container,
  .btn-primary, .btn-secondary, .btn-outline,
  .btn-record, .session-topbar, .report-actions { display: none !important; }

  body { background: white; }
  .screen { display: block !important; }
  .screen:not(#screen-checklist) { display: none !important; }
  .checklist-section-body { display: block !important; }
}
