/* ==========================================================================
   KLINISCHE KASUISTIK ZAHN 47 – CSS STYLESHEET
   Design: Nüchternes, professionelles zahnmedizinisches Design (Clinical Slate)
   Vollständig mobiloptimiert (Mobile-First & Touch-Friendly)
   ========================================================================== */

:root {
  /* Sober Clinical Color Palette */
  --bg-page: #0a0f18;
  --bg-surface: #0f1724;
  --bg-surface-elevated: #152032;
  --bg-surface-hover: #1b293f;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(56, 189, 248, 0.15);
  --border-active: #0284c7;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8292a6;
  --text-subtle: #4e6178;

  /* Clinical Accents (Sober / Non-Dramatic) */
  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-teal: #0d9488;
  --accent-emerald: #10b981;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;

  /* WhatsApp Theme (Neutral Medical Dark Mode) */
  --wa-bg: #0b141a;
  --wa-header-bg: #1f2c34;
  --wa-bubble-in: #202c33;
  --wa-bubble-out: #005c4b;
  --wa-text: #e9edef;
  --wa-subtext: #8696a0;
  --wa-ticks: #53bdeb;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;

  /* Layout & Spacing */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --container-max: 1200px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-primary);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle Technical Grid Background (Replaces flashy neon glows) */
.clinical-grid-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.section-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
}

/* Typography Helpers */
h1, h2, h3, h4 {
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.highlight {
  color: var(--accent-cyan);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  min-height: 44px;
}

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-blue);
  color: #fff;
  transform: translateY(-1px);
}

.btn-micro {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition);
  min-height: 36px;
}

.btn-drive {
  background: #143324;
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
  font-weight: 600;
}

.btn-drive:hover, .btn-drive:focus-visible {
  background: #194630;
  color: #fff;
  border-color: #34d399;
  transform: translateY(-1px);
}

.drive-nav-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-xs);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
}

.drive-nav-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
  border-color: #10b981;
}

.mobile-drive-link {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  color: #6ee7b7 !important;
  font-weight: 600;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 15, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.nav-brand .brand-icon {
  color: var(--accent-cyan);
  font-size: 1.15rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition);
  padding: 0.4rem 0.2rem;
}

.nav-link:hover {
  color: var(--accent-cyan);
}

.nav-chat-link {
  color: #25d366 !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.anonymity-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  color: #fff;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 57px;
  left: 0;
  width: 100%;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem;
  z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.mobile-drawer.open {
  display: block;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.mobile-link:active, .mobile-link:hover {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
}

/* ==========================================================================
   HERO / ANAMNESE SECTION
   ========================================================================== */
.hero-section {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border-light);
}

.clinical-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.meta-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.meta-tag.tag-muted {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-light);
  color: var(--text-muted);
}

.meta-tag.tag-status {
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.3);
  color: #c084fc;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero-summary {
  font-size: clamp(0.95rem, 1.8vw, 1.08rem);
  color: var(--text-secondary);
  max-width: 880px;
  line-height: 1.65;
  margin-bottom: 2rem;
}

/* Anamnese Cards Grid */
.anamnese-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.anamnese-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
}

.card-caption {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-weight: 600;
  margin-bottom: 0.3rem;
  letter-spacing: 0.5px;
}

.card-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}

.card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.quick-jump-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   SECTION COMMON STYLES
   ========================================================================== */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-light);
}

.section-header {
  margin-bottom: 2rem;
  max-width: 780px;
}

.section-pretitle {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 0.96rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   SECTION 1: KRANKHEITSTAGEBUCH (TABS & SPLIT LAYOUT)
   ========================================================================== */
.mobile-tabs-bar {
  display: none;
  margin-bottom: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  gap: 0.25rem;
}

.mobile-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.65rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
}

.mobile-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.diary-layout-container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: start;
}

.diary-pane {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-header {
  padding: 0.9rem 1.2rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.text-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
}

.transcript-list {
  max-height: 560px;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Custom Scrollbar */
.transcript-list::-webkit-scrollbar,
.wa-app-messages::-webkit-scrollbar {
  width: 5px;
}

.transcript-list::-webkit-scrollbar-thumb,
.wa-app-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.t-entry {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.t-entry:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-blue);
  transform: translateX(3px);
}

.t-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.t-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.t-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.badge-pain-zero { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.badge-pain-low { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.badge-pain-mid { background: rgba(217, 119, 6, 0.15); color: #fbbf24; }
.badge-pain-high { background: rgba(225, 29, 72, 0.18); color: #fda4af; }
.badge-neutral { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); }

.t-content {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.t-action {
  font-size: 0.74rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.t-entry:hover .t-action {
  color: var(--accent-cyan);
}

/* Image Pane */
.image-box {
  position: relative;
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.doc-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition);
}

.doc-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-emerald);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pane-footer {
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.015);
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* ==========================================================================
   SECTION 2: SCHMERZVERLAUF (CHART)
   ========================================================================== */
.chart-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.chart-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.c-legend {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.c-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green { background: var(--accent-emerald); }
.dot-cyan { background: var(--accent-cyan); }
.dot-amber { background: var(--accent-amber); }
.dot-rose { background: var(--accent-rose); }
.dot-purple { background: var(--accent-purple); }

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 340px;
}

#painChartCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

/* Tooltip */
.custom-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.85rem;
  font-size: 0.8rem;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
  z-index: 10;
  display: none;
  max-width: 250px;
}

/* Timeline Chips Bar (Horizontally scrollable on mobile) */
.chart-timeline-scroll {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
}

.chart-chip {
  flex: 0 0 auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: center;
  min-width: 95px;
  transition: all var(--transition);
}

.chart-chip:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-surface-hover);
}

.chip-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-subtle);
}

.chip-name {
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.chip-score {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
}

.score-0 { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.score-3 { background: rgba(56, 189, 248, 0.15); color: var(--accent-cyan); }
.score-5 { background: rgba(217, 119, 6, 0.15); color: #fbbf24; }
.score-6 { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
.score-7 { background: rgba(234, 88, 12, 0.18); color: #fdba74; }
.score-8 { background: rgba(225, 29, 72, 0.2); color: #fca5a5; }
.score-9 { background: rgba(225, 29, 72, 0.3); color: #fecdd3; }
.score-cmd { background: rgba(147, 51, 234, 0.2); color: #d8b4fe; }

/* ==========================================================================
   SECTION 3: CHRONOLOGIE (17 PHASEN)
   ========================================================================== */
.timeline-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
  padding-left: 1.75rem;
}

.timeline-wrapper::before {
  content: '';
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 12px;
  width: 2px;
  background: var(--border-light);
}

.timeline-row {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
}

.timeline-row::after {
  content: '';
  position: absolute;
  top: 24px;
  left: -22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-page);
  border: 2px solid var(--accent-blue);
}

.timeline-row.highlight-border {
  border-color: rgba(225, 29, 72, 0.3);
}

.timeline-row.highlight-border::after {
  border-color: var(--accent-rose);
}

.row-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-xs);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
}

.row-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.date-tag {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.score-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
}

.place-tag {
  font-size: 0.76rem;
  color: var(--text-subtle);
}

.row-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
}

.diary-quote {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--accent-blue);
  padding: 0.65rem 0.85rem;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  font-style: normal;
}

.row-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Clinical Box */
.clinical-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-xs);
  background: rgba(2, 132, 199, 0.07);
  border: 1px solid rgba(2, 132, 199, 0.2);
  font-size: 0.84rem;
  color: #bae6fd;
  display: flex;
  gap: 0.75rem;
  line-height: 1.45;
}

.clinical-box i {
  font-size: 1.05rem;
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.clinical-box.box-alert {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.25);
  color: #fde68a;
}

.clinical-box.box-alert i {
  color: var(--accent-amber);
}

/* Image Gallery Grids */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.gallery-grid.dual-col {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.gallery-grid.quad-col {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.gallery-grid.single-col {
  grid-template-columns: 1fr;
  max-width: 650px;
}

.thumb-card {
  position: relative;
  background: #000;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.thumb-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.thumb-card img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.gallery-grid.single-col .thumb-card img {
  height: auto;
  max-height: 380px;
  object-fit: contain;
}

.thumb-card figcaption {
  padding: 0.5rem 0.65rem;
  background: var(--bg-surface-elevated);
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   DVT CBCT VIEWER CONSOLE (MULTIPLANAR & SCROLLBAR SLICE STACK)
   ========================================================================== */
.dvt-console-card {
  background: #070c14;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  margin: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
}

.dvt-console-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: #0b121e;
  border-bottom: 1px solid #1e293b;
}

.dvt-top-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dvt-console-badge {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.03em;
}

.dvt-console-sub {
  font-size: 0.74rem;
  color: #94a3b8;
}

.dvt-plane-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.plane-btn {
  background: #131d2e;
  border: 1px solid #24344d;
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
  min-height: 36px;
}

.plane-btn:hover {
  background: #1c2b42;
  border-color: #38bdf8;
  color: #fff;
}

.plane-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Viewport with HUD */
.dvt-viewer-viewport {
  position: relative;
  background: #000;
  width: 100%;
  height: 520px;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: ns-resize;
}

.dvt-screen-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
  pointer-events: none;
}

.dvt-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.hud-top-left {
  background: rgba(8, 14, 23, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  max-width: 340px;
  pointer-events: auto;
}

.hud-plane {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hud-level {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 0.2rem 0;
}

.hud-depth {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: #34d399;
  font-weight: 500;
}

.hud-top-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  align-self: flex-start;
}

.hud-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #334155;
  white-space: nowrap;
}

.hud-zoom-btn {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid #334155;
  color: #cbd5e1;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}

.hud-zoom-btn:hover {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

.hud-bottom-hint {
  align-self: center;
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(10, 16, 26, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* Scrubber Toolbar */
.dvt-scrubber-toolbar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: #0b121e;
  border-top: 1px solid #1e293b;
  border-bottom: 1px solid #1e293b;
}

.scrub-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #141e30;
  border: 1px solid #28374f;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  font-size: 0.9rem;
}

.scrub-btn:hover {
  background: #1e2d47;
  color: #fff;
  border-color: #38bdf8;
}

.scrub-btn.btn-play {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
}

.scrub-btn.btn-play:hover {
  background: #0369a1;
}

.scrub-btn.btn-play.playing {
  background: #e11d48;
  border-color: #fb7185;
}

.scrub-slider-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 140px;
}

.dvt-slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.dvt-slider-input:focus {
  background: #27354a;
}

.dvt-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #0f172a;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  cursor: ew-resize;
  transition: transform 0.15s, background-color 0.15s;
}

.dvt-slider-input::-webkit-slider-thumb:hover,
.dvt-slider-input::-webkit-slider-thumb:active {
  transform: scale(1.18);
  background: #7dd3fc;
}

.dvt-slider-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #38bdf8;
  border: 3px solid #0f172a;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.7);
  cursor: ew-resize;
  transition: transform 0.15s, background-color 0.15s;
}

.scrub-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b;
  font-family: var(--font-mono);
  user-select: none;
}

/* Diagnostic Findings Note */
.dvt-clinical-summary {
  padding: 1.1rem 1.25rem;
  background: #080d16;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.summary-head {
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.summary-bullets {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.summary-bullets li {
  position: relative;
  padding-left: 1.2rem;
}

.summary-bullets li::before {
  content: "•";
  position: absolute;
  left: 0.35rem;
  color: #38bdf8;
  font-weight: bold;
}

@media (max-width: 768px) {
  .dvt-viewer-viewport {
    height: 380px;
  }
  .dvt-console-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .hud-bottom-hint {
    display: none;
  }
  .scrub-ticks {
    display: none;
  }
}

/* ==========================================================================
   SECTION 4: ÄTIOLOGIE & PATHOPHYSIOLOGIE
   ========================================================================== */
.patho-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.patho-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.patho-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.patho-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.patho-sub {
  font-size: 0.75rem;
  color: var(--accent-teal);
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
}

.patho-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   SECTION 5: WHATSAPP TERMINHISTORIE (MESSENGER SIMULATOR)
   ========================================================================== */
.wa-app-container {
  background: var(--wa-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

/* Header */
.wa-app-header {
  background: var(--wa-header-bg);
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-contact-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wa-avatar-box {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #128c7e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.wa-contact-name {
  color: var(--wa-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.wa-contact-status {
  font-size: 0.72rem;
  color: var(--wa-subtext);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: #25d366;
  border-radius: 50%;
}

.wa-msg-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--wa-subtext);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
}

/* Search & Filter Controls */
.wa-app-controls {
  background: #111b21;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.wa-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.wa-input-group i {
  position: absolute;
  left: 12px;
  color: var(--wa-subtext);
  font-size: 0.85rem;
}

.wa-input-group input {
  width: 100%;
  background: #202c33;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 0.6rem 2.2rem 0.6rem 2.2rem;
  color: var(--wa-text);
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  min-height: 40px;
}

.wa-input-group input:focus {
  border-color: #00a884;
}

.btn-clear-input {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--wa-subtext);
  cursor: pointer;
  display: none;
  padding: 0.3rem;
}

.btn-clear-input.visible {
  display: block;
}

.wa-filter-scroll {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.wa-filter-pill {
  flex: 0 0 auto;
  background: #202c33;
  color: var(--wa-subtext);
  border: 1px solid transparent;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
}

.wa-filter-pill:hover {
  color: var(--wa-text);
  background: #2a3942;
}

.wa-filter-pill.active {
  background: #00a884;
  color: #fff;
  font-weight: 600;
}

/* Messages Area */
.wa-app-messages {
  background: var(--wa-bg);
  padding: 1.25rem;
  height: 540px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.wa-status-text {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--wa-subtext);
  font-size: 0.9rem;
}

.wa-date-divider {
  align-self: center;
  background: #182229;
  color: var(--wa-subtext);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-xs);
  margin: 0.6rem 0;
}

.wa-system-msg {
  align-self: center;
  max-width: 90%;
  background: rgba(24, 34, 41, 0.9);
  color: #fde047;
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.85rem;
  font-size: 0.74rem;
  text-align: center;
  margin: 0.3rem 0;
  line-height: 1.4;
}

.wa-bubble {
  max-width: 82%;
  padding: 0.5rem 0.8rem 0.4rem;
  border-radius: var(--radius-xs);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  word-break: break-word;
}

.wa-bubble.sender-praxis {
  align-self: flex-start;
  background: var(--wa-bubble-in);
  border-top-left-radius: 0;
}

.wa-bubble.sender-patient {
  align-self: flex-end;
  background: var(--wa-bubble-out);
  border-top-right-radius: 0;
}

.wa-bubble-author {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.sender-praxis .wa-bubble-author { color: #53bdeb; }
.sender-patient .wa-bubble-author { color: #25d366; }

.wa-bubble-text {
  font-size: 0.86rem;
  color: var(--wa-text);
  line-height: 1.4;
  white-space: pre-wrap;
}

.wa-bubble-meta {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.65rem;
  color: var(--wa-subtext);
  margin-top: 0.2rem;
}

.wa-ticks {
  color: var(--wa-ticks);
  font-size: 0.68rem;
}

.wa-highlight {
  background-color: rgba(202, 138, 4, 0.45);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}

.wa-app-footer {
  background: var(--wa-header-bg);
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  color: var(--wa-subtext);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-modal.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(8px);
}

.lightbox-window {
  position: relative;
  z-index: 1001;
  width: 95vw;
  max-width: 1100px;
  height: 88vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-header {
  padding: 0.75rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-title-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.lightbox-btn-bar {
  display: flex;
  gap: 0.4rem;
}

.lb-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
}

.lb-btn:hover {
  background: var(--accent-blue);
}

.lb-btn.lb-close:hover {
  background: var(--accent-rose);
}

.lightbox-canvas-area {
  flex-grow: 1;
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0.75rem;
}

.lb-main-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.15s ease;
  user-select: none;
}

.lightbox-footer {
  padding: 0.75rem 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-caption-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.lightbox-anonym-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-emerald);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.clinical-footer {
  border-top: 1px solid var(--border-light);
  padding: 3rem 0 2rem;
  background: var(--bg-surface);
}

.footer-flex {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  max-width: 750px;
  line-height: 1.55;
}

.footer-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.f-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   MOBILE & RESPONSIVE BREAKPOINTS (MOBILE-FRIENDLY FIRST)
   ========================================================================== */
@media (max-width: 992px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .diary-layout-container {
    grid-template-columns: 1fr;
  }

  .mobile-tabs-bar {
    display: flex;
  }

  /* When tabs are active on mobile, hide the inactive pane */
  .diary-pane.mobile-hidden {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0 1.75rem;
  }

  .section {
    padding: 2.75rem 0;
  }

  .anamnese-grid {
    grid-template-columns: 1fr;
  }

  .canvas-wrapper {
    height: 280px;
  }

  .timeline-wrapper {
    padding-left: 1.25rem;
  }

  .timeline-wrapper::before {
    left: 8px;
  }

  .timeline-row {
    padding: 1.15rem;
  }

  .timeline-row::after {
    left: -17px;
    width: 8px;
    height: 8px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid.quad-col,
  .gallery-grid.dual-col {
    grid-template-columns: 1fr;
  }

  .wa-app-messages {
    height: 440px;
    padding: 0.85rem;
  }

  .wa-bubble {
    max-width: 90%;
  }

  .dvt-tab-group {
    flex-direction: column;
  }

  .dvt-tab-btn {
    width: 100%;
    text-align: left;
  }
}
