/* ==========================================================================
   TIME DETECTIVE - Primary School Educational CSS Stylesheet
   Theme: Bright, High-Contrast Detective Mystery
   Target: Primary school pupils aged 11
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Color Palette - High Contrast & Child-Friendly */
  --bg-color: #f4f7fb;
  --header-bg: #1e293b;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #475569;

  /* Primary Theme Colors */
  --detective-yellow: #f59e0b;
  --detective-yellow-light: #fef3c7;
  --detective-blue: #2563eb;
  --detective-blue-hover: #1d4ed8;
  --detective-navy: #0f172a;

  /* Accent & Feedback Colors */
  --success-green: #16a34a;
  --success-bg: #dcfce7;
  --error-red: #dc2626;
  --error-bg: #fee2e2;
  --warning-orange: #ea580c;
  --warning-bg: #ffedd5;
  --info-purple: #9333ea;
  --info-bg: #f3e8ff;

  /* Typography */
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 18px; /* High legibility for 11-year-olds */

  /* Borders & Shadows */
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
  --border-radius-pill: 9999px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  /* Touch & Focus */
  --min-tap-size: 48px;
  --focus-ring: 3px solid #2563eb;
  --focus-offset: 3px;
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 10px;
  background: var(--detective-yellow);
  color: var(--detective-navy);
  padding: 12px 20px;
  font-weight: bold;
  border-radius: var(--border-radius-sm);
  z-index: 1000;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 10px;
  outline: var(--focus-ring);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* --- App Header & Navigation --- */
.app-header {
  background-color: var(--header-bg);
  color: #ffffff;
  padding: 16px 20px 0 20px;
  box-shadow: var(--shadow-md);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  font-size: 2.8rem;
  line-height: 1;
  background: #334155;
  padding: 8px;
  border-radius: 50%;
  border: 3px solid var(--detective-yellow);
}

.app-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 0.95rem;
  color: #cbd5e1;
  font-weight: 500;
}

.detective-badge-summary {
  background: #334155;
  border: 2px solid var(--detective-yellow);
  padding: 8px 16px;
  border-radius: var(--border-radius-pill);
  font-weight: 700;
  color: var(--detective-yellow);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

/* Top Navigation Tabs */
.top-nav {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.nav-tab {
  background: #334155;
  color: #e2e8f0;
  border: none;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  min-height: var(--min-tap-size);
  transition: background-color 0.2s, color 0.2s;
}

.nav-tab:hover {
  background: #475569;
  color: #ffffff;
}

.nav-tab.active {
  background: var(--bg-color);
  color: var(--detective-navy);
  border-top: 4px solid var(--detective-yellow);
}

/* --- Layout & Main Container --- */
.main-container {
  max-width: 1100px;
  width: 100%;
  margin: 24px auto;
  padding: 0 16px;
  flex: 1;
}

.section-panel {
  display: none;
}

.section-panel.active {
  display: block;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.6rem;
  color: var(--detective-navy);
  margin-bottom: 4px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Cards & Grid Layouts */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .grid-layout {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.25rem;
  color: var(--detective-navy);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 8px;
}

/* Form Elements & Inputs */
.form-group {
  margin-bottom: 16px;
}

.input-label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.date-input,
.text-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  background-color: #f8fafc;
  color: var(--text-primary);
  min-height: var(--min-tap-size);
}

.date-input:focus,
.text-input:focus {
  border-color: var(--detective-blue);
  background-color: #ffffff;
}

.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-form .text-input {
  flex: 1;
  min-width: 140px;
}

/* Custom Toggle Switch */
.toggle-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0;
  padding: 12px;
  background-color: #f8fafc;
  border-radius: var(--border-radius-sm);
  border: 1px solid #e2e8f0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 30px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

input:checked + .toggle-slider {
  background-color: var(--detective-blue);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

.toggle-label-text {
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.help-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  min-height: var(--min-tap-size);
  transition: transform 0.1s, background-color 0.2s, box-shadow 0.2s;
  text-align: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--detective-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--detective-blue-hover);
}

.btn-secondary {
  background-color: var(--detective-yellow);
  color: var(--detective-navy);
}

.btn-secondary:hover {
  background-color: #d97706;
  color: #ffffff;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--detective-blue);
  color: var(--detective-blue);
}

.btn-outline:hover {
  background-color: #eff6ff;
}

.btn-small {
  padding: 8px 14px;
  font-size: 0.9rem;
  min-height: 38px;
}

.btn-tab-sub {
  background: #e2e8f0;
  color: var(--text-muted);
  padding: 10px 16px;
  border-radius: var(--border-radius-pill);
}

.btn-tab-sub.active {
  background: var(--detective-blue);
  color: #ffffff;
}

/* --- Section 1: Explorer Components --- */
.duration-highlight-box {
  background-color: var(--detective-yellow-light);
  border: 2px solid var(--detective-yellow);
  padding: 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #78350f;
  text-align: center;
}

.step-breakdown-container {
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 14px;
  border-radius: var(--border-radius-sm);
}

.step-item {
  padding: 8px 0;
  border-bottom: 1px dotted #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step-item:last-child {
  border-bottom: none;
  font-weight: bold;
  font-size: 1.05rem;
  color: var(--detective-blue);
}

/* Visual Calendar Component */
.visual-calendar-card {
  margin-bottom: 20px;
}

.calendar-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.calendar-month-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--detective-navy);
  padding: 0 10px;
}

.calendar-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.month-calendar-grid {
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 12px;
  background: #ffffff;
}

.calendar-month-heading {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--detective-navy);
}

.cal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.cal-table th {
  padding: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: bold;
  border-bottom: 1px solid #e2e8f0;
}

.cal-table td {
  padding: 8px 4px;
  font-size: 0.95rem;
  border: 1px solid #f1f5f9;
  border-radius: 4px;
  font-weight: 600;
}

.cal-day-muted {
  color: #cbd5e1;
}

.cal-day-in-range {
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 800;
}

.cal-day-start {
  background-color: var(--detective-yellow) !important;
  color: #000000 !important;
  font-weight: 900;
  border-radius: 50% !important;
}

.cal-day-end {
  background-color: var(--detective-blue) !important;
  color: #ffffff !important;
  font-weight: 900;
  border-radius: 50% !important;
}

.calendar-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.start-date-box { background-color: var(--detective-yellow); }
.in-range-box { background-color: #dbeafe; border: 1px solid #93c5fd; }
.end-date-box { background-color: var(--detective-blue); }

/* Month Length Rhyme Grid */
.rhyme-card {
  background: #fffbe3;
  border: 2px solid var(--detective-yellow);
}

.rhyme-text {
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 16px;
  color: #78350f;
  background: #ffffff;
  padding: 14px;
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--detective-yellow);
}

.month-length-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.month-chip {
  background: #ffffff;
  padding: 8px 10px;
  border-radius: var(--border-radius-sm);
  text-align: center;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.month-chip span {
  font-size: 1.1rem;
  font-weight: 800;
}

.months-31 { border-top: 4px solid #3b82f6; }
.months-30 { border-top: 4px solid #10b981; }
.months-feb { border-top: 4px solid #f59e0b; background: #fff7ed; }

/* --- Section 2: Leap Year Lab --- */
.result-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
}

.result-leap {
  background-color: var(--success-bg);
  border: 2px solid var(--success-green);
  color: #14532d;
}

.result-not-leap {
  background-color: var(--warning-bg);
  border: 2px solid var(--warning-orange);
  color: #7c2d12;
}

.nearest-leap-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.nearest-leap-box h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.leap-chips-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.leap-chip {
  background: var(--detective-navy);
  color: var(--detective-yellow);
  padding: 4px 12px;
  border-radius: var(--border-radius-pill);
  font-weight: 800;
  font-size: 0.9rem;
}

.feb-toggle-btn-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.feb-visual-box {
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  padding: 14px;
  border-radius: var(--border-radius-sm);
  min-height: 220px;
}

/* Mini Game Elements */
.minigame-card {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  border: 2px solid var(--detective-blue);
}

.minigame-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.game-score-badge {
  background: var(--detective-navy);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--border-radius-pill);
  font-weight: 800;
  font-size: 0.95rem;
}

.game-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 16px 0;
}

@media (min-width: 600px) {
  .game-cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.game-card-item {
  background: #ffffff;
  border: 3px solid #cbd5e1;
  border-radius: var(--border-radius-md);
  padding: 20px 10px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--detective-navy);
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-card-item:hover {
  border-color: var(--detective-blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.game-card-item.correct {
  background-color: var(--success-bg);
  border-color: var(--success-green);
  color: var(--success-green);
}

.game-card-item.incorrect {
  background-color: var(--error-bg);
  border-color: var(--error-red);
  color: var(--error-red);
  opacity: 0.6;
}

.game-feedback {
  min-height: 48px;
  margin-bottom: 12px;
  font-weight: bold;
}

.game-footer {
  display: flex;
  justify-content: flex-end;
}

/* --- Section 3: Practice Components --- */
.practice-card {
  max-width: 800px;
  margin: 0 auto 20px auto;
}

.practice-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--border-radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-category {
  background-color: #e0e7ff;
  color: #3730a3;
}

.case-number {
  font-weight: 800;
  color: var(--text-muted);
}

.problem-display {
  background-color: #f8fafc;
  border-left: 5px solid var(--detective-blue);
  padding: 18px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.case-icon {
  font-size: 2rem;
  line-height: 1;
}

.problem-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--detective-navy);
  line-height: 1.5;
}

.practice-input-area {
  margin-bottom: 16px;
}

.unit-tag {
  font-weight: bold;
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.answer-input {
  max-width: 140px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.practice-action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.hint-box {
  background-color: var(--info-bg);
  border: 2px solid var(--info-purple);
  padding: 14px;
  border-radius: var(--border-radius-sm);
  margin-top: 14px;
  color: #581c87;
}

.hint-title {
  font-weight: 800;
  display: block;
  margin-bottom: 4px;
}

.feedback-box {
  padding: 16px;
  border-radius: var(--border-radius-sm);
  margin-top: 16px;
  font-size: 1.05rem;
}

.feedback-correct {
  background-color: var(--success-bg);
  border: 2px solid var(--success-green);
  color: #14532d;
}

.feedback-incorrect {
  background-color: var(--error-bg);
  border: 2px solid var(--error-red);
  color: #7f1d1d;
}

.feedback-diagnostic-title {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Section 4: Quiz Components --- */
.quiz-card {
  max-width: 800px;
  margin: 0 auto 20px auto;
}

.quiz-progress-bar-wrapper {
  margin-bottom: 20px;
}

.quiz-progress-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.progress-bar-bg {
  background-color: #e2e8f0;
  height: 12px;
  border-radius: var(--border-radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--detective-blue) 0%, var(--detective-yellow) 100%);
  height: 100%;
  transition: width 0.3s ease;
}

.quiz-question-title {
  font-size: 1.25rem;
  color: var(--detective-navy);
  margin-bottom: 18px;
  line-height: 1.4;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 600px) {
  .quiz-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.quiz-option-btn {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 14px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--detective-navy);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.2s, border-color 0.2s;
  min-height: var(--min-tap-size);
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-option-btn:hover {
  border-color: var(--detective-blue);
  background-color: #f8fafc;
}

.quiz-option-btn.selected-correct {
  background-color: var(--success-bg);
  border-color: var(--success-green);
  color: #14532d;
}

.quiz-option-btn.selected-incorrect {
  background-color: var(--error-bg);
  border-color: var(--error-red);
  color: var(--error-red);
}

.quiz-inline-feedback {
  padding: 12px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  font-weight: 700;
}

.quiz-footer {
  display: flex;
  justify-content: flex-end;
}

/* Quiz Results & Review Screen */
.quiz-results-card {
  max-width: 800px;
  margin: 0 auto 20px auto;
  text-align: center;
}

.results-header {
  margin-bottom: 24px;
}

.badge-graphic {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 10px;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.results-title {
  font-size: 1.8rem;
  color: var(--detective-navy);
  margin-bottom: 6px;
}

.stars-display {
  font-size: 2.2rem;
  margin: 8px 0;
  letter-spacing: 4px;
}

.results-score {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--detective-blue);
  margin-bottom: 4px;
}

.results-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.results-actions {
  margin-bottom: 30px;
}

.results-review-section {
  text-align: left;
  border-top: 2px solid #e2e8f0;
  padding-top: 20px;
}

.results-review-section h4 {
  font-size: 1.3rem;
  color: var(--detective-navy);
  margin-bottom: 4px;
}

.review-list-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.review-item {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 14px;
}

.review-item.review-correct {
  border-left: 5px solid var(--success-green);
}

.review-item.review-incorrect {
  border-left: 5px solid var(--error-red);
}

.review-q-num {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
}

.review-q-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 4px 0 8px 0;
}

.review-user-ans {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.review-correct-ans {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--success-green);
  margin-bottom: 8px;
}

.review-explanation {
  background: #ffffff;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  border: 1px dashed #cbd5e1;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* --- App Footer --- */
.app-footer {
  background-color: var(--header-bg);
  color: #cbd5e1;
  text-align: center;
  padding: 20px;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 4px solid var(--detective-yellow);
}

.footer-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    width: 100%;
  }

  .nav-tab {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .app-title {
    font-size: 1.5rem;
  }

  .card {
    padding: 16px;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form .text-input {
    width: 100%;
  }
}
