:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-light: #ccfbf1;
  --accent: #d97706;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --success: #16a34a;
  --bg: #f4f7f5;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 90px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #065f46 0%, #0f766e 100%);
  color: #fff;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(6, 95, 70, 0.25);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.78rem;
  opacity: 0.9;
}

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

.api-status-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.api-status-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.status-dot.disconnected {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}

.disclaimer-banner {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  color: #92400e;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  line-height: 1.45;
}

.api-notice-banner {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.84rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.api-notice-banner.connected {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.sample-chip {
  background: #ffffff;
  border: 1.5px solid #10b981;
  color: #065f46;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sample-chip:hover {
  background: #d1fae5;
}

/* Main Container */
.container {
  max-width: 960px;
  margin: 20px auto;
  padding: 0 16px;
}

/* Navigation Tabs */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--card);
  padding: 6px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.nav-tab {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.nav-tab span.icon {
  font-size: 1.25rem;
}

.nav-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
}

.nav-tab.sos-tab.active {
  background: var(--danger);
}

/* Views */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

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

.card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Form Elements */
.animal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.animal-option {
  border: 2px solid var(--border);
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 0.85rem;
}

.animal-option .emoji {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 4px;
}

.animal-option.selected {
  border-color: var(--primary);
  background: #f0fdfa;
  color: var(--primary-dark);
}

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

.input-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary);
}

/* Upload Box */
.upload-zone {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 2px dashed #94a3b8;
  background: #f8fafc;
  border-radius: 14px;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 14px;
  position: relative;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: #f0fdfa;
}

.upload-zone.disabled {
  opacity: 0.65;
  background: #f1f5f9;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

.upload-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.upload-thumb-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #0f766e;
  background: #0f172a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

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

.upload-thumb-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.15s;
}

.upload-thumb-del:hover {
  transform: scale(1.1);
  background: #b91c1c;
}

.upload-thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(15, 118, 110, 0.9);
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  z-index: 2;
}

.upload-thumb-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font-size: 0.68rem;
  padding: 3px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  z-index: 2;
}

/* ========================================================= */
/* VIZUAL TASHXIS IYERARXIYASI VA KATTA KARTALAR */
/* ========================================================= */

.primary-diagnosis-card {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  border: 2.5px solid #0f766e;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.12);
  margin-bottom: 16px;
}

.primary-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 2px dashed #99f6e4;
  padding-bottom: 10px;
}

.primary-diag-badge {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

.primary-diag-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
  margin: 10px 0 12px 0;
}

.primary-confidence-box {
  background: #ffffff;
  border: 1.5px solid #5eead4;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.92rem;
  color: #0f172a;
  margin-bottom: 14px;
  line-height: 1.45;
}

.primary-reasoning-box {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: #1e293b;
  line-height: 1.5;
  border-left: 5px solid #0f766e;
}

/* User Suspected Disease Evaluation Card */
.suspected-eval-card {
  background: #ffffff;
  border: 2px solid #93c5fd;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.08);
}

.suspected-eval-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.suspected-name-highlight {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.suspected-findings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .suspected-findings-grid {
    grid-template-columns: 1fr;
  }
}

.matching-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  color: #065f46;
}

.mismatching-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  color: #854d0e;
}

/* Boshqa ehtimoliy kasalliklar (Differensial tashxis) kartasi */
.differential-diag-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.differential-diag-header {
  font-size: 0.98rem;
  font-weight: 800;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 8px;
}

.differential-item-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: transform 0.15s, border-color 0.15s;
}

.differential-item-card:hover {
  border-color: #93c5fd;
  background: #f0f7ff;
}

.diff-disease-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.diff-disease-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.45;
}

.diff-distinguish-feature {
  font-size: 0.82rem;
  color: #0284c7;
  font-weight: 600;
  margin-top: 6px;
  background: #e0f2fe;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Shoshilinchlik va veterinar ko'rigi bloki */
.urgency-referral-block {
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-width: 2px;
  border-style: solid;
}

.urgency-high-block {
  background: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.urgency-moderate-block {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.urgency-standard-block {
  background: #f0fdf4;
  border-color: #10b981;
  color: #065f46;
}

/* Birinchi yordam bloki */
.first-aid-block {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.first-aid-header {
  font-size: 0.98rem;
  font-weight: 800;
  color: #14532d;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.first-aid-list {
  padding-left: 20px;
  margin: 0;
  color: #14532d;
  font-size: 0.92rem;
  line-height: 1.55;
}

.first-aid-list li {
  margin-bottom: 6px;
}

/* Visual findings with thumbnails */
.visual-findings-block {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.visual-thumbs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.visual-thumb-item {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid #94a3b8;
}

/* Quick Symptom Chips */
.symptom-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.symptom-chip {
  background: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.symptom-chip:hover {
  background: #e2e8f0;
}

.symptom-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Primary Buttons */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0f766e 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.28);
  transition: transform 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  opacity: 0.95;
}

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

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid #cbd5e1;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* AI Consultation Chat & Questions */
.chat-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}

.ai-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ai-bubble {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  flex: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.question-block {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.question-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.question-title {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 8px;
  color: #0f172a;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.q-option-btn {
  text-align: left;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.q-option-btn.selected {
  border-color: var(--primary);
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 700;
}

/* Diagnosis Result Banner */
.urgency-banner {
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.urgency-critical {
  background: #fef2f2;
  border: 1.5px solid #f87171;
  color: #991b1b;
}

.urgency-high {
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  color: #92400e;
}

.urgency-moderate {
  background: #f0fdf4;
  border: 1.5px solid #4ade80;
  color: #166534;
}

.step-list {
  list-style: none;
  margin: 12px 0;
}

.step-list li {
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  margin-bottom: 8px;
  font-size: 0.92rem;
}

/* Drug Cards with Realistic Illustrated Vials */
.drugs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.drug-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.drug-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.drug-visual {
  height: 155px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.drug-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
}

.drug-price {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.drug-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drug-name {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}

.drug-cat {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.drug-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.drug-meta strong {
  color: #0f172a;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

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

.modal-card {
  background: #fff;
  max-width: 500px;
  width: 100%;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
  .animal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .row-inputs {
    grid-template-columns: 1fr;
  }
  .nav-tab {
    font-size: 0.75rem;
  }
}

/* Refined visual system */
:root {
  --primary: #16745d;
  --primary-dark: #105b49;
  --primary-light: #e8f5ef;
  --bg: #f3f6f4;
  --text: #172820;
  --text-muted: #66756d;
  --border: #e0e8e3;
  --radius: 18px;
  --shadow: 0 8px 28px rgba(23, 54, 39, 0.055);
}

body {
  background: radial-gradient(ellipse at top, #eaf4ee 0, var(--bg) 520px);
  color: var(--text);
  line-height: 1.55;
}

.app-header {
  background: linear-gradient(120deg, #123d31, #16745d 70%, #208568);
  padding: 18px 24px;
  box-shadow: 0 8px 26px rgba(18, 61, 49, .18);
}

.header-inner,
.container { max-width: 1060px; }
.container { margin-top: 28px; }
.brand { gap: 14px; }
.brand-logo {
  width: 48px; height: 48px; border-radius: 15px;
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22);
}
.brand-title { font-size: 1.25rem; letter-spacing: -.035em; }
.brand-subtitle { margin-top: 2px; color: rgba(255,255,255,.76); }

.disclaimer-banner {
  border: 1px solid #f0d99d; border-left: 4px solid #d69b28;
  border-radius: 12px; padding: 11px 15px; color: #71551c;
  background: #fff9e9; font-size: .84rem;
}
.api-notice-banner { border-radius: 14px; padding: 13px 16px; }
.nav-tabs {
  padding: 7px; gap: 6px; border-radius: 16px;
  box-shadow: 0 5px 18px rgba(23,54,39,.045);
}
.nav-tab { min-height: 66px; border-radius: 12px; }
.nav-tab.active { background: #16745d; box-shadow: 0 5px 12px rgba(22,116,93,.2); }
.nav-tab.sos-tab.active { background: #c7463c; }
.card {
  padding: 24px; border-radius: 18px; margin-bottom: 20px;
  box-shadow: 0 7px 24px rgba(23,54,39,.045);
}
.card-title { font-size: 1.08rem; letter-spacing: -.015em; }
.card-desc { margin-top: 2px; color: #738078; }
.animal-option {
  border: 1px solid #e0e8e3; background: #fbfcfb; padding: 13px 8px;
  border-radius: 14px; transition: border-color .18s, background .18s, transform .18s;
}
.animal-option:hover { transform: translateY(-1px); border-color: #9bc8b3; }
.animal-option.selected { border: 1.5px solid #23856b; background: #edf7f1; }
.input-group input, .input-group select, .input-group textarea {
  border: 1px solid #dce5df; border-radius: 11px; background: #fff;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
  border-color: #23856b; box-shadow: 0 0 0 3px rgba(35,133,107,.11);
}
.upload-zone {
  border: 1.5px dashed #a8bdb1; border-radius: 16px; background: #f8fbf9;
}
.upload-zone:hover { border-color: #23856b; background: #f0f8f3; }
.sample-chip {
  border: 1px solid #d4e7db; color: #285c48; padding: 8px 13px;
}
.sample-chip:hover { background: #edf7f1; border-color: #9bc8b3; }
.btn-primary {
  min-height: 48px; border-radius: 12px; font-weight: 750;
  box-shadow: 0 5px 12px rgba(22,116,93,.16);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-secondary { border-radius: 10px; }
.new-consult-btn { margin: 10px 0 0 8px; min-height: 44px; border: 1px solid #b91c1c; color: #fff; background: #dc2626; font-weight: 700; }
.new-consult-btn[hidden] { display: none !important; }
.new-consult-btn:hover { background: #b91c1c; }
.new-consult-btn:focus-visible { outline: 3px solid #fecaca; outline-offset: 2px; }
.optional-label {
  display: inline-flex; align-items: center; margin-left: 3px; padding: 2px 8px;
  border-radius: 999px; color: #6d7c73; background: #f0f4f1;
  font-size: .68rem; font-weight: 650; letter-spacing: 0;
}

.history-consent { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; margin:12px 0 16px; border:1px solid #d7e7dd; border-radius:12px; background:#f4faf6; color:#34483b; font-size:.86rem; line-height:1.5; }
.history-consent input { width:18px; height:18px; accent-color:#23856b; flex:none; }
.history-filters,.disease-search-row,.history-update-grid { display:flex; gap:10px; align-items:end; flex-wrap:wrap; }
.history-filters label,.history-update-grid label { flex:1; min-width:150px; font-size:.82rem; color:#53645a; }
.history-filters input,.history-filters select,.history-update-grid input,.history-update-grid select,.disease-search-row input,.disease-search-row select { width:100%; min-height:42px; border:1px solid #dce5df; border-radius:10px; padding:8px 10px; background:white; }
.disease-search-row input { flex:2; min-width:190px; }
.disease-search-row select { width:auto; min-width:125px; }
.disease-card h3 { color:#155e46; font-size:1.1rem; margin-bottom:3px; }
.disease-card p { margin:8px 0; color:#34443a; line-height:1.5; }
.disease-card-head span,.source-meta { color:#718078; font-size:.8rem; }
.source-links a,.external-result a { color:#087a5b; font-weight:700; }
.source-links,.source-meta,.external-search-note { margin-top:9px; font-size:.82rem; color:#596a60; }
.external-search-note { padding:8px 10px; background:#f5f8f6; border-radius:8px; }
.status-pill { display:inline-block; margin:0 0 8px; padding:4px 9px; color:#765718; background:#fff7df; border-radius:99px; font-size:.76rem; }
.outcome-record { margin:2px 0 10px; padding:8px 10px; color:#175f47; background:#edf8f1; border-radius:8px; font-size:.84rem; }
.disease-match-card { border-left:4px solid #23856b; }
.disease-match-card h3 { color:#155e46; margin-bottom:6px; }
.disease-match-card p,.disease-match-card div { margin:7px 0; font-size:.86rem; color:#43564b; }
.history-details { margin:12px 0; color:#425248; font-size:.86rem; }
.history-details summary { cursor:pointer; font-weight:700; color:#16634a; margin-bottom:8px; }
.history-image { max-width:100px; max-height:100px; object-fit:cover; border-radius:8px; margin:4px; }
.history-update-grid { padding:12px; border-radius:12px; background:#f7faf8; }
.unverified-note { margin-top:8px; padding:8px 10px; color:#795917; background:#fff8e7; border-radius:8px; font-size:.8rem; }

@media (max-width: 640px) {
  .app-header { padding: 14px 16px; }
  .container { margin-top: 16px; padding: 0 12px; }
  .card { padding: 18px 16px; }
  .brand-subtitle { max-width: 220px; font-size: .72rem; }
  .api-status-btn { padding: 8px 10px; }
  .nav-tabs { gap: 4px; }
  .nav-tab { min-height: 62px; padding: 8px 4px; }
  .disease-search-row { align-items:stretch; }
  .disease-search-row select { width:100%; }
  .history-filters > * { width:100%; }
}
