/* ============================================
   SağlıkYön – Design System v3
   ============================================ */

/* ── Tokens ── */
:root {
  --font-head: 'Fraunces', serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Brand (sage / clinical) */
  --blue-900: #1f3a35;
  --blue-800: #25453d;
  --blue-700: #2f5048;
  --blue-600: #3c6358;
  --blue-100: #dde9e3;
  --blue-50: #eef4f1;

  --teal-700: #4a7768;
  --teal-100: #d6e5dd;

  /* Surfaces */
  --bg: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #eef1ef;
  --surface-3: #e1e7e3;

  /* Text */
  --text-1: #15201c;
  --text-2: #3c4a44;
  --text-3: #647069;
  --text-4: #8a9590;

  /* Semantic */
  --red: #c0413a;
  --red-light: #fbe9e7;
  --red-dark: #7a2a25;
  --amber: #b97a1f;
  --amber-light: #fbf0e0;
  --amber-dark: #6b4814;
  --yellow: #ab8a16;
  --yellow-light: #fbf6e0;
  --green: #3d7a5c;
  --green-light: #e6f1ea;
  --green-dark: #234c39;

  /* Border */
  --border: #dde3df;
  --border-2: #c7d0cb;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .12);

  /* Transition */
  --t: .18s ease;

  /* Body map — one continuous silhouette, visible without needing hover */
  --bm-fill: #c3ddd0;
  --bm-stroke: transparent;
  --bm-hover: #9cc4b0;
  --bm-active: #74ab93;
  --bm-face: #8aada0;
}

[data-theme="dark"] {
  --bg: #111715;
  --surface: #182320;
  --surface-2: #1e2a26;
  --surface-3: #26352f;
  --text-1: #eef3f0;
  --text-2: #c4d0cb;
  --text-3: #8a9a93;
  --text-4: #4d5d56;
  --border: #2a3933;
  --border-2: #36473f;
  --blue-100: #25453d;
  --blue-50: #182723;
  --red-light: #3d1212;
  --red-dark: #fca5a5;
  --amber-light: #3d2800;
  --amber-dark: #fcd34d;
  --green-light: #0d2e1a;
  --green-dark: #86efac;
  --bm-fill: #2c4a40;
  --bm-stroke: transparent;
  --bm-hover: #3a5c52;
  --bm-active: #4d7a68;
  --bm-face: #4d5d56;
}

/* ── Elderly mode ──
   Every rule bumps font-size AND its matching padding/icon-size/min-height
   together, so nothing looks squeezed or out of proportion. */
body.elderly-mode {
  font-size: 19px;
}

body.elderly-mode .hero-eyebrow {
  font-size: 14px;
}

body.elderly-mode .hero-h1 {
  font-size: 2.6rem;
}

body.elderly-mode .hero-sub {
  font-size: 1.2rem;
}

body.elderly-mode .input-card {
  padding: 26px;
}

body.elderly-mode .input-search-icon {
  font-size: 26px;
  left: 18px;
  top: 18px;
}

body.elderly-mode .symptom-textarea {
  font-size: 1.25rem;
  padding: 20px 64px 20px 56px;
  min-height: 76px;
}

body.elderly-mode .voice-btn {
  width: 54px;
  height: 54px;
}

body.elderly-mode .voice-btn .material-symbols-outlined {
  font-size: 24px;
}

body.elderly-mode .input-footer {
  font-size: 14px;
}

body.elderly-mode .chip {
  font-size: 1rem;
  padding: 10px 18px;
}

body.elderly-mode .btn-analyze {
  font-size: 1.2rem;
  min-height: 64px;
  padding: 16px 26px;
}

body.elderly-mode .btn-analyze .material-symbols-outlined {
  font-size: 24px;
}

body.elderly-mode .error-msg {
  font-size: 16px;
}

body.elderly-mode .section-label {
  font-size: 16px;
  padding-top: 18px;
}

body.elderly-mode .section-label .material-symbols-outlined {
  font-size: 19px;
}

body.elderly-mode .bm-tab {
  font-size: 15px;
  padding: 7px 18px;
}

body.elderly-mode .bm-svg {
  width: 170px;
}

body.elderly-mode .bm-hint {
  font-size: 16px;
}

body.elderly-mode .bm-hint .material-symbols-outlined {
  font-size: 38px;
}

body.elderly-mode .sev {
  font-size: 14px;
  padding: 11px 10px;
}

body.elderly-mode .trust-row {
  gap: 8px;
}

body.elderly-mode .trust-item {
  font-size: 13px;
}

body.elderly-mode .trust-item .material-symbols-outlined {
  font-size: 16px;
}

body.elderly-mode .result-dept-name {
  font-size: 2.2rem;
}

body.elderly-mode .fq-question {
  font-size: 1.25rem;
}

body.elderly-mode .fq-btn {
  font-size: 1.1rem;
  min-height: 58px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  transition: background var(--t), color var(--t);
}

a {
  color: var(--blue-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

textarea {
  font-family: var(--font-body);
}

.hidden {
  display: none !important;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1);
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--blue-800);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.brand-icon .material-symbols-outlined {
  font-size: 20px;
}

.brand-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Header buttons */
.hbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
  min-height: 36px;
}

.hbtn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}


.hbtn-icon {
  padding: 6px;
}

.hbtn-icon .material-symbols-outlined {
  font-size: 20px;
}

.hbtn-ghost .material-symbols-outlined {
  font-size: 18px;
}

.hbtn-label {
  font-size: 13px;
}

.hbtn-badge {
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-100);
  color: var(--blue-800);
  padding: 1px 7px;
  border-radius: var(--r-full);
  min-width: 20px;
  text-align: center;
}

.hbtn-danger {
  color: var(--red);
}

.hbtn-danger:hover {
  background: var(--red-light);
}

/* ── Main / Screens ── */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 80px;
  position: relative;
}

.screen {
  padding-top: 48px;
}

/* ── Hero ── */
.hero {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--teal-700);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.dot {
  display: none;
}

.hero-h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.22;
  color: var(--text-1);
  margin-bottom: 14px;
}

.hero-sub {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Input Card ── */
.input-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  max-width: 680px;
  margin: 0 auto 48px;
  transition: border-color var(--t), box-shadow var(--t);
}

.input-card:focus-within {
  border-color: var(--blue-700);
  box-shadow: 0 0 0 4px rgba(47, 80, 72, .12);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 10px;
}

.input-search-icon {
  position: absolute;
  left: 16px;
  top: 16px;
  font-size: 22px;
  color: var(--text-3);
  pointer-events: none;
}

.symptom-textarea {
  flex: 1;
  padding: 16px 56px 16px 50px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-1);
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  min-height: 60px;
  max-height: 180px;
}

.symptom-textarea::placeholder {
  color: var(--text-4);
}

.voice-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--blue-700);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t);
  box-shadow: var(--shadow-sm);
}

.voice-btn:hover {
  background: var(--blue-50);
}

.voice-btn.listening {
  background: var(--red-light);
  color: var(--red);
  animation: pulse-btn 1.2s infinite;
}

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

@keyframes pulse-btn {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}

.input-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 0 4px 12px;
  color: var(--text-3);
}

.voice-status {
  color: var(--teal-700);
}

.voice-status.error {
  color: var(--red);
}

.rate-status {
  color: var(--text-3);
}

.rate-status.warn {
  color: var(--amber);
  font-weight: 500;
}

.char-count {
  margin-left: auto;
  color: var(--text-4);
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-800);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t), transform var(--t);
  user-select: none;
}

.chip:hover {
  background: var(--blue-100);
  transform: translateY(-1px);
}

[data-theme="dark"] .chip {
  color: #9cc4b0;
  border-color: #2f4a42;
}

.btn-analyze {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--blue-800);
  color: #fff;
  border-radius: var(--r-lg);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: background var(--t), transform var(--t);
  min-height: 52px;
}

.btn-analyze:hover {
  background: var(--blue-700);
}

.btn-analyze:active {
  transform: scale(0.99);
}

.btn-analyze:disabled {
  opacity: .45;
  cursor: not-allowed;
}

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

.error-msg {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--red-light);
  color: var(--red-dark);
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.5;
}

/* ── Body Map Accordion (text-first; map is a fallback) ── */
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--blue-700);
  text-align: left;
  cursor: pointer;
}

.section-label .material-symbols-outlined {
  font-size: 16px;
  vertical-align: -3px;
}

.bodymap-top-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.bodymap-top-label .material-symbols-outlined {
  font-size: 18px;
  color: var(--blue-700);
}

#screenBodyMap .followup-wrap {
  max-width: 680px;
}

.body-map-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  margin-top: 14px;
}

.body-map-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.bm-svg-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.bm-tabs {
  display: flex;
  gap: 6px;
}

.bm-tab {
  padding: 5px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t);
}

.bm-tab-active {
  background: var(--blue-800);
  border-color: var(--blue-800);
  color: #fff;
}

.bm-svg {
  width: 132px;
  height: auto;
  display: block;
}

.bp {
  fill: var(--bm-fill);
  stroke: none;
  cursor: pointer;
  transition: fill var(--t);
}

.bp:hover {
  fill: var(--bm-hover);
}

.bp-active {
  fill: var(--bm-active) !important;
}

.bm-panel {
  flex: 1;
  min-width: 0;
  min-height: 240px;
  display: block;
}

.bm-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 240px;
  color: var(--text-4);
  font-size: 14px;
  text-align: center;
}

.bm-hint .material-symbols-outlined {
  font-size: 32px;
}

/* Drill-down popup (inline panel) */
.drill-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.drill-region-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-800);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drill-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 16px;
  transition: background var(--t);
}

.drill-close-btn:hover {
  background: var(--surface-2);
}

.drill-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.drill-crumb {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drill-crumb-cur {
  color: var(--text-2);
  font-weight: 500;
}

.drill-sep {
  color: var(--border-2);
}

.drill-question {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 10px;
  line-height: 1.4;
}

.drill-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.drill-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-md);
  text-align: left;
  font-size: 13px;
  color: var(--text-1);
  transition: background var(--t);
}

.drill-opt:hover {
  background: var(--blue-50);
  color: var(--blue-800);
}

.drill-opt .material-symbols-outlined {
  font-size: 15px;
  color: var(--text-4);
  flex-shrink: 0;
}

.drill-opt:hover .material-symbols-outlined {
  color: var(--blue-700);
}

.drill-back-row {
  display: flex;
  margin-bottom: 8px;
}

.drill-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: var(--r-md);
  transition: background var(--t), color var(--t);
}

.drill-back-btn:hover {
  background: var(--surface-2);
  color: var(--text-2);
}

.drill-back-btn .material-symbols-outlined {
  font-size: 15px;
}

.drill-done-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--green-light);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--green-dark);
  line-height: 1.4;
}

.drill-done-banner .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Severity legend ── */
.severity-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.sev {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 8px;
  border-radius: var(--r-md);
}

.sev-red {
  background: var(--red-light);
  color: var(--red-dark);
}

.sev-amber {
  background: var(--amber-light);
  color: var(--amber-dark);
}

.sev-green {
  background: var(--green-light);
  color: var(--green-dark);
}

/* ── Trust row (quiet caption, not a badge row) ── */
.trust-row {
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 14px auto 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.trust-item:not(:last-child)::after {
  content: '·';
  margin-left: 6px;
  color: var(--border-2);
}

.trust-item .material-symbols-outlined {
  font-size: 14px;
  color: var(--teal-700);
}

/* ── Follow-up Screen ── */
.followup-wrap {
  max-width: 600px;
  margin: 0 auto;
}

.followup-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

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

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--blue-700);
  border-radius: var(--r-full);
  transition: width 0.4s ease;
}

.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}

.followup-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Follow-up question card */
.fq-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.25s ease;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fq-symptom-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-800);
  background: var(--blue-50);
  padding: 4px 12px;
  border-radius: var(--r-full);
  margin-bottom: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.fq-question {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 20px;
}

/* Yes/No tipi */
.fq-yesno {
  display: flex;
  gap: 10px;
}

.fq-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--t);
  min-height: 52px;
  cursor: pointer;
}

.fq-btn:hover {
  border-color: var(--blue-700);
  color: var(--blue-800);
  background: var(--blue-50);
}

.fq-btn.selected-yes {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green-dark);
}

.fq-btn.selected-no {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red-dark);
}

.fq-btn.selected-skip {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text-2);
}

.fq-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.fq-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Süre tipi */
.fq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fq-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--t);
  text-align: left;
  width: 100%;
  min-height: 52px;
}

.fq-option:hover {
  border-color: var(--blue-700);
  color: var(--blue-800);
  background: var(--blue-50);
}

.fq-option.selected {
  background: var(--blue-50);
  border-color: var(--blue-700);
  color: var(--blue-800);
}

.fq-option:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.fq-option-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-2);
  border-radius: 50%;
  flex-shrink: 0;
  transition: all var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fq-option.selected .fq-option-dot {
  border-color: var(--blue-700);
  background: var(--blue-700);
}

.fq-option.selected .fq-option-dot::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
}

/* ── Result Screen ── */
.result-wrap {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  padding: 8px 12px;
  border-radius: var(--r-md);
  width: fit-content;
  transition: background var(--t), color var(--t);
}

.result-back-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.result-back-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Triage banner */
.triage-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--r-xl);
  border: 1px solid;
  animation: fadeSlideUp 0.3s ease;
}

.triage-banner.emergency {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red-dark);
}

.triage-banner.urgent {
  background: var(--amber-light);
  border-color: var(--amber);
  color: var(--amber-dark);
}

.triage-banner.soon {
  background: var(--yellow-light);
  border-color: var(--yellow);
  color: #713f12;
}

.triage-banner.routine {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green-dark);
}

.triage-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.triage-icon .material-symbols-outlined {
  font-size: 20px;
}

.triage-label {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.triage-desc {
  font-size: 13px;
  opacity: .85;
  line-height: 1.5;
}

/* Dept card */
.dept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.35s ease;
  position: relative;
}

.dept-card-glow {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: var(--blue-100);
  border-radius: 50%;
  opacity: .25;
  pointer-events: none;
}

.dept-card-body {
  padding: 28px 28px 20px;
  position: relative;
  z-index: 1;
}

.dept-overline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 4px 12px;
  border-radius: var(--r-full);
  margin-bottom: 14px;
}

.dept-overline .material-symbols-outlined {
  font-size: 13px;
}

.dept-name {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--blue-800);
  line-height: 1.1;
  margin-bottom: 12px;
}

.dept-reasoning {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 20px;
}

.conf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.conf-track {
  flex: 1;
  height: 5px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.conf-fill {
  height: 100%;
  background: var(--blue-700);
  border-radius: var(--r-full);
  transition: width .8s ease;
}

.conf-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-800);
  white-space: nowrap;
}

.conf-info-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: var(--r-full);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t), color var(--t);
}

.conf-info-btn:hover,
.conf-info-btn[aria-expanded="true"] {
  background: var(--surface-2);
  color: var(--blue-700);
}

.conf-info-btn .material-symbols-outlined {
  font-size: 17px;
}

.conf-info-text {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
}

.dept-symptoms-section {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
}

.dept-symptoms-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 10px;
}

.symptom-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.symptom-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  color: var(--text-2);
}

.symptom-tag .material-symbols-outlined {
  font-size: 13px;
  color: var(--blue-700);
}

.alt-section {
  padding: 14px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.alt-label {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
}

.alt-tag {
  font-size: 13px;
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-md);
}

.dept-card-footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-mhrs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--blue-800);
  color: #fff;
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 600;
  transition: background var(--t);
  min-height: 42px;
}

.btn-mhrs:hover {
  background: var(--blue-700);
  color: #fff;
  text-decoration: none;
}

.btn-mhrs .material-symbols-outlined {
  font-size: 17px;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--r-lg);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  min-height: 42px;
  cursor: pointer;
}

.btn-copy:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-copy .material-symbols-outlined {
  font-size: 17px;
}

.result-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

#resultContent {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-disclaimer .material-symbols-outlined {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Sonuç geri bildirimi (itiraz DEĞİL — basit faydalı/faydasız) */
.result-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}

.result-feedback-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.result-feedback-btns {
  display: flex;
  gap: 8px;
}

.result-feedback-btns .feedback-btn {
  flex: none;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
}

.result-feedback-btns .feedback-btn .material-symbols-outlined {
  font-size: 16px;
}

.age-band-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  font-size: 12.5px;
  color: var(--text-3);
}

.age-band-label .material-symbols-outlined {
  font-size: 16px;
  color: var(--blue-700);
  flex-shrink: 0;
}

.age-band-label strong {
  color: var(--text-2);
  font-weight: 600;
}

/* Family doctor card */
.family-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.35s ease;
}

.family-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 24px 0;
}

.family-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

.family-icon .material-symbols-outlined {
  font-size: 24px;
}

.family-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
}

.family-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 2px;
}

.family-body {
  padding: 16px 24px 24px;
}

.family-msg {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 16px;
}

.family-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.benefit-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
}

.benefit-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--teal-700);
}

.benefit-item span:last-child {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.4;
}

.family-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  gap: 10px;
}

/* ── Emergency Screen ── */
.emergency-screen {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emergency-inner {
  text-align: center;
  max-width: 480px;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.emergency-pulse {
  width: 80px;
  height: 80px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  animation: emergencyPulse 1.5s infinite;
  margin-bottom: 8px;
}

.emergency-pulse .material-symbols-outlined {
  font-size: 40px;
}

@keyframes emergencyPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .4);
  }

  50% {
    box-shadow: 0 0 0 20px rgba(220, 38, 38, 0);
  }
}

.emergency-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.02em;
}

.emergency-msg {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 400px;
}

.btn-112 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 40px;
  background: var(--red);
  color: #fff;
  border-radius: var(--r-xl);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  transition: opacity var(--t), transform var(--t);
  min-height: 64px;
  width: 100%;
}

.btn-112:hover {
  opacity: .9;
  text-decoration: none;
  color: #fff;
  transform: scale(1.01);
}

.btn-112 .material-symbols-outlined {
  font-size: 24px;
}

.emergency-note {
  font-size: 14px;
  color: var(--text-3);
}

/* ── Emergency verification (ambiguous red-flag confirm) ── */
.emergency-verify {
  width: 100%;
  max-width: 420px;
  margin: 20px auto 0;
  text-align: center;
}

.emergency-verify-divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 18px;
}

.emergency-verify-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.emergency-verify-question {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 14px;
  line-height: 1.4;
}

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

.btn-verify-confirm,
.btn-verify-reassure {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: background var(--t), border-color var(--t);
}

.btn-verify-confirm {
  background: var(--red-light);
  color: var(--red-dark);
  border-color: var(--red-light);
}

.btn-verify-confirm:hover {
  background: var(--red);
  color: #fff;
}

.btn-verify-reassure {
  background: var(--surface);
  color: var(--text-2);
}

.btn-verify-reassure:hover {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: var(--green-light);
}

.btn-ghost-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  padding: 8px 14px;
  border-radius: var(--r-md);
  transition: background var(--t), color var(--t);
  margin-top: 8px;
}

.btn-ghost-sm:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.btn-ghost-sm .material-symbols-outlined {
  font-size: 17px;
}

/* ── Loading ── */
.loading-screen {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-ring {
  width: 64px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-track {
  position: absolute;
  inset: 0;
  border: 3px solid var(--surface-3);
  border-top-color: var(--blue-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.loading-icon {
  font-size: 28px;
  color: var(--blue-700);
}

.loading-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
}

.ls {
  font-size: 13px;
  color: var(--text-4);
  padding: 7px 14px;
  border-radius: var(--r-md);
  transition: all var(--t);
}

.ls.active {
  background: var(--blue-50);
  color: var(--blue-800);
  font-weight: 600;
}

/* ── History Panel ── */
.history-panel {
  position: fixed;
  right: 20px;
  top: 72px;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: fadeSlideUp .2s ease;
}

.hp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.hp-header h3 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.hp-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.hp-item {
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t);
}

.hp-item:hover {
  background: var(--surface-2);
}

.hp-symptom {
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 4px;
  line-height: 1.4;
}

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

.hp-dept {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-800);
}

.hp-date {
  font-size: 12px;
  color: var(--text-4);
}

.hp-empty {
  padding: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--text-4);
}

#clearHistory {
  margin: 8px;
}

/* ── Footer ── */
.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-3);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
}

.footer-links a {
  color: var(--blue-700);
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .main {
    padding: 0 16px 60px;
  }

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

  .hbtn-label {
    display: none;
  }

  .body-map-inner {
    flex-direction: column;
    align-items: center;
  }

  .bm-panel {
    width: 100%;
    min-height: 160px;
  }

  .bm-hint {
    height: 120px;
  }

  .family-benefits {
    grid-template-columns: 1fr;
  }

  .history-panel {
    right: 8px;
    left: 8px;
    width: auto;
  }

  .fq-yesno {
    flex-wrap: wrap;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}