@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* --- Design tokens (theme XANH DUONG chuan hoa theo yeu cau khach hang,
     lay cam hung tu mockup app "Traveler") ---
     Ten bien giu nguyen (--color-navy, --color-teal...) tu cac ban thiet ke
     truoc de tranh phai sua lai toan bo file, nhung GIA TRI mau da doi
     hoan toan sang 1 tong XANH DUONG duy nhat, chuan hoa (khong con nhieu
     mau ruc ro/tim/hong nhu ban truoc). */
  --color-bg: #F3F6FC;
  --color-surface: #FFFFFF;
  --color-navy: #101B3D;
  --color-navy-soft: #2563EB;
  --color-teal: #2563EB;
  --color-teal-dark: #1D4ED8;
  --color-text: #101B3D;
  --color-muted: #64748B;
  --color-border: #E2E8F0;
  --color-danger: #C0392B;
  --color-danger-bg: #FDECEA;
  --color-warning-bg: #FFF3CD;
  --color-warning-text: #7A5B00;

  --gradient-header: linear-gradient(135deg, #101B3D 0%, #2563EB 100%);
  --gradient-cta: linear-gradient(90deg, #2563EB, #1D4ED8);

  /* Mau "tile" (o icon) rieng cho tung chuc nang/nhiem vu - day la noi duy
     nhat con mau sac ruc ro, con THAN THE cua card da duoc CHUAN HOA ve
     nen trang dong nhat (xem .task-card/.engine-card ben duoi). Dung dung
     1 to mau nen nhat + 1 mau icon dam, giong cach mockup Traveler to mau
     rieng cho tung o chuc nang (Hotels/Cruises/Cars/Flights). */
  --tile-blue-bg: #E1EBFE;
  --tile-blue-fg: #2563EB;
  --tile-red-bg: #FDE3E3;
  --tile-red-fg: #DC2626;
  --tile-green-bg: #DCF6E7;
  --tile-green-fg: #16A34A;
  --tile-amber-bg: #FEF1D6;
  --tile-amber-fg: #D97706;
  --tile-teal-bg: #DAF6F1;
  --tile-teal-fg: #0D9488;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 3px rgba(16, 27, 61, 0.08);
  --shadow-md: 0 10px 28px rgba(16, 27, 61, 0.14);
  --shadow-cta: 0 8px 22px rgba(37, 99, 235, 0.35);

  --font-heading: 'Be Vietnam Pro', -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, "Segoe UI", Roboto, sans-serif;

  --touch-target: 56px;
  --header-height: 64px;
  --bottom-nav-height: 66px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .card-title, .task-title, .engine-title, .verify-label {
  font-family: var(--font-heading);
}

/* =======================================================================
   HEADER — blue gradient, curved bottom corners (mobile-app style)
   ======================================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-height);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  min-height: calc(var(--header-height) + env(safe-area-inset-top));
  background: var(--gradient-header);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  border-radius: 0 0 28px 28px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px;
  object-fit: contain;
  display: block;
}
.header-title {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-title .accent { color: #FDE68A; }
.subtitle {
  display: none;
  color: rgba(255, 255, 255, 0.85);
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 500;
}
.header-help {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.header-help:hover { background: rgba(255, 255, 255, 0.32); }
.header-help:active { transform: scale(0.94); }

@media (min-width: 768px) {
  .app-header { height: 76px; padding: 0 32px; }
  .header-logo { width: 42px; height: 42px; }
  .header-title { font-size: 1.2rem; }
  .subtitle { display: block; }
}

/* Help / About panel (drawer trigger by header ? hoac bottom nav) */
.help-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(16, 27, 61, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.help-panel[hidden] { display: none; }
.help-panel-inner {
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: 26px 26px 0 0;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(16, 27, 61, 0.22);
  animation: slideUp 0.22s ease;
}
@media (min-width: 768px) {
  .help-panel { align-items: center; }
  .help-panel-inner { border-radius: 26px; max-height: 78vh; }
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.help-panel-header h3 { margin: 0; font-size: 1.05rem; }
.help-close {
  border: none;
  background: var(--color-bg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-muted);
}
.help-panel p { font-size: 0.88rem; color: var(--color-muted); margin: 0 0 12px; }
.help-panel p strong { color: var(--color-text); }

.guide-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-navy-soft);
  margin: 18px 0 8px;
}
.guide-section-label:first-of-type { margin-top: 2px; }

.guide-flow { margin-bottom: 4px; }
.guide-flow-svg { width: 100%; height: auto; display: block; }
.guide-flow-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.guide-flow-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.guide-flow-label strong { font-size: 0.72rem; color: var(--color-text); line-height: 1.25; }
.guide-flow-label span { font-size: 0.66rem; color: var(--color-muted); line-height: 1.3; }

@media (max-width: 480px) {
  .guide-flow-labels { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
}

.guide-task-list {
  margin: 0 0 8px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guide-task-list li { font-size: 0.85rem; color: var(--color-muted); line-height: 1.5; }
.guide-task-list li strong { color: var(--color-text); }

/* About panel: dung chung shell voi help-panel, chi khac noi dung ben trong */
.about-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--gradient-header);
  padding: 6px;
  object-fit: contain;
  display: block;
  margin: 4px auto 14px;
}
.about-meta {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 4px;
}

/* =======================================================================
   MAIN LAYOUT
   ======================================================================= */
#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--bottom-nav-height) + 24px + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  #app { max-width: 720px; padding: 28px 28px calc(var(--bottom-nav-height) + 32px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1000px) {
  #app { max-width: 780px; }
}

/* =======================================================================
   STEP BAR — compact pill on mobile, full numbered stepper on desktop
   ======================================================================= */
.step-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 14px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-sm);
}
.step-back {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  color: var(--color-navy);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-back[hidden] { display: none; }
.step-label {
  flex: 1 1 auto;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-dots {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
}
.step-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.2s, transform 0.2s;
}
.step-dots span.done { background: var(--color-teal); }
.step-dots span.current { background: var(--color-navy); transform: scale(1.25); }

.stepper {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--color-muted);
  counter-reset: step;
}
@media (min-width: 768px) {
  .step-bar { display: none; }
  .stepper { display: flex; }
}
.stepper li {
  flex: 1;
  text-align: center;
  padding-top: 34px;
  position: relative;
  font-weight: 600;
  word-break: break-word;
}
.stepper li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-muted);
  font-weight: 700;
  font-size: 0.78rem;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.stepper li::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
  z-index: -1;
}
.stepper li:first-child::after { left: 50%; }
.stepper li:last-child::after { right: 50%; }
.stepper li.done::before { background: var(--color-teal); border-color: var(--color-teal); color: #fff; content: '✓'; }
.stepper li.active { color: var(--color-navy); }
.stepper li.active::before {
  background: var(--gradient-header);
  border-color: transparent;
  color: #ffffff;
}

.step { display: none; }
.step.active { display: block; animation: fadeSlide 0.24s ease; }

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

h2 { font-size: clamp(1.08rem, 3.6vw, 1.28rem); font-weight: 700; margin: 4px 0 2px; }

/* =======================================================================
   TASK / ENGINE CARDS — CHUAN HOA: nen trang dong nhat cho moi the, chi
   con o ICON (tile) la to mau rieng theo tung chuc nang (xem .tile-*).
   Icon to hon (60px) de de nhan dang, dung 1 kieu the duy nhat xuyen suot.
   ======================================================================= */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
#step-engine .card-grid { flex-direction: column; }

.task-card, .engine-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  background: var(--color-surface);
  position: relative;
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.15s;
  min-height: var(--touch-target);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}
.task-card:hover:not([disabled]), .engine-card:hover:not([disabled]) {
  transform: translateY(-2px);
  border-color: var(--color-navy-soft);
  box-shadow: var(--shadow-md);
}
.task-card:active:not([disabled]), .engine-card:active:not([disabled]) {
  transform: translateY(0) scale(0.99);
}
.task-card[disabled], .engine-card[disabled], .task-card.disabled, .engine-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tile mau rieng cho O ICON cua tung chuc nang - THAN card luon trang. */
.tile-blue  { background: var(--tile-blue-bg);  color: var(--tile-blue-fg); }
.tile-red   { background: var(--tile-red-bg);   color: var(--tile-red-fg); }
.tile-green { background: var(--tile-green-bg); color: var(--tile-green-fg); }
.tile-amber { background: var(--tile-amber-bg); color: var(--tile-amber-fg); }
.tile-teal  { background: var(--tile-teal-bg);  color: var(--tile-teal-fg); }

.task-icon {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-icon svg { width: 30px; height: 30px; }

.task-info { flex: 1 1 auto; min-width: 0; }
.task-title, .engine-title {
  font-weight: 700;
  font-size: 0.96rem;
  margin: 0 0 3px;
  color: var(--color-text);
}
.task-subtitle, .engine-desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0;
}

.task-badge {
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.task-arrow, .engine-arrow {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform 0.15s, color 0.15s;
}
.task-card:hover .task-arrow, .engine-card:hover .engine-arrow {
  transform: translateX(3px);
  color: var(--color-navy-soft);
}

/* Engine cards: icon + badge above description */
.engine-card { align-items: flex-start; }
.engine-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.engine-icon svg { width: 28px; height: 28px; }
.engine-info { flex: 1 1 auto; min-width: 0; }
.engine-header-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.engine-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--tile-blue-bg);
  color: var(--tile-blue-fg);
}

.engine-note {
  font-size: 0.82rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-top: 4px;
}

.hint { color: var(--color-muted); font-size: 0.85rem; }
.upload-hint { margin-top: -2px; margin-bottom: 12px; }

/* =======================================================================
   REFERENCE INPUTS
   ======================================================================= */
.reference-inputs { margin: 14px 0; display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 768px) {
  .reference-inputs { flex-direction: row; flex-wrap: wrap; }
  .reference-inputs .field { flex: 1 1 220px; }
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--color-navy); }
.field input {
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  font-size: 18px; /* >=16px de tranh iOS Safari tu zoom khi focus */
  font-weight: 600;
  min-height: 56px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  font-family: var(--font-body);
}
.field input:focus {
  outline: none;
  border-color: var(--color-navy-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.field-help { color: var(--color-muted); font-size: 0.76rem; }

/* Checkbox tuy chon rieng cua task (VD Artemia: "phan loai chi tiet theo
   giai doan") - mac dinh tat, tick de bat, canh bao phan tich se lau hon. */
.field-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
  cursor: pointer;
}
.field-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--color-navy-soft);
  cursor: pointer;
}
.field-toggle-text { display: flex; flex-direction: column; gap: 2px; }
.field-toggle-text strong { font-size: 0.85rem; color: var(--color-text); font-weight: 600; }
.field-toggle-text small { font-size: 0.74rem; color: var(--color-muted); }

/* =======================================================================
   CAPTURE AREA — 4:3 camera zone with placeholder state
   ======================================================================= */
.camera-area {
  position: relative;
  margin: 14px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0B1730;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm);
}
.camera-preview, .capture-preview video, .capture-preview img {
  width: 100%;
  height: 100%;
  max-height: min(58vh, 460px);
  object-fit: contain;
  background: #0B1730;
  display: block;
}
.camera-preview:not([srcObject]) { display: none; }
.capture-preview { position: absolute; inset: 0; }
.capture-preview:empty { display: none; position: static; }

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  padding: 20px;
  cursor: pointer;
}
.camera-placeholder[hidden] { display: none; }
.camera-placeholder svg { width: 40px; height: 40px; opacity: 0.85; }
.camera-placeholder span { font-size: 0.85rem; font-weight: 600; }

/* =======================================================================
   CAPTURE CONTROLS — 2-tier button hierarchy (camera / upload)
   ======================================================================= */
.capture-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 6px;
}

.btn {
  padding: 14px 20px;
  border-radius: 16px;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, transform 0.1s;
  min-height: var(--touch-target);
  touch-action: manipulation;
  font-family: var(--font-body);
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:hover:not(:disabled) { border-color: var(--color-navy-soft); }

/* Tier 1 — primary CTA (open camera / capture photo / use image link) */
.btn-cta-primary {
  display: block;
  width: 100%;
  background: var(--gradient-cta);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-cta);
}
.btn-cta-primary:hover:not(:disabled) { filter: brightness(1.05); }
.btn-cta-primary, .btn-cta-secondary { font-size: 1rem; min-height: 58px; }

/* Tier 2 — secondary outlined (upload file) */
.btn-cta-secondary {
  display: block;
  width: 100%;
  background: var(--color-surface);
  color: var(--color-teal-dark);
  border: 1.5px solid var(--color-teal);
}
.btn-cta-secondary:hover:not(:disabled) { background: #EAF1FE; }

.btn-retake {
  background: var(--color-surface);
  color: var(--color-navy);
  border: 1.5px solid var(--color-border);
}

.btn-primary { background: var(--color-teal); color: #fff; border-color: var(--color-teal); }
.btn-primary:hover:not(:disabled) { background: var(--color-teal-dark); border-color: var(--color-teal-dark); color: #fff; }

.btn-analyze {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  min-height: 60px;
  border-radius: 20px;
  background: var(--gradient-cta);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-cta);
  font-family: var(--font-heading);
}
.btn-analyze:hover:not(:disabled) { filter: brightness(1.05); }
.btn-analyze:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.btn-analyze:disabled { background: #CBD9F7; box-shadow: none; cursor: not-allowed; }

.spinner {
  width: 18px;
  height: 18px;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-link {
  background: none;
  border: none;
  color: var(--color-teal-dark);
  text-decoration: underline;
  padding: 10px 0;
  font-weight: 600;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.btn-back { display: block; margin-bottom: 10px; color: var(--color-muted); font-weight: 700; }

/* =======================================================================
   URL INPUT — dan link anh thay vi camera/tai len
   ======================================================================= */
.url-input-box {
  margin: 4px 0 18px;
}
.url-input-box[hidden] { display: none; }
.url-input-box::before {
  content: 'hoặc';
  display: block;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0 12px;
}
.url-input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 8px;
}
.url-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.url-input {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 14px;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-surface);
}
.url-input:focus {
  outline: none;
  border-color: var(--color-navy-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.btn-use-url { width: 100%; }
@media (min-width: 600px) {
  .url-input-row { flex-direction: row; }
  .url-input { flex: 1 1 auto; }
  .btn-use-url { flex: 0 0 auto; width: auto; padding-left: 28px; padding-right: 28px; }
}

/* =======================================================================
   CAPTCHA — subtle inline row
   ======================================================================= */
.verify-box {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: #EFF4FF;
  border: 1px solid var(--color-border);
}
.verify-helper {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted);
}
.verify-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.verify-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-navy);
  flex: 0 0 auto;
}
.verify-code-display {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--color-navy);
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.verify-arrow { color: var(--color-navy-soft); font-size: 1rem; font-weight: 700; flex: 0 0 auto; }
.verify-code-input {
  flex: 1 1 90px;
  max-width: 110px;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-align: center;
  font-weight: 700;
  font-family: var(--font-body);
}
.verify-code-input:focus { outline: none; border-color: var(--color-navy-soft); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.verify-refresh {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  cursor: pointer;
  font-size: 1rem;
}
.verify-refresh:hover { border-color: var(--color-navy-soft); color: var(--color-navy); }
.verify-hint { margin: 8px 0 0; font-size: 0.72rem; }

.cooldown-banner {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  font-size: 0.85rem;
  font-weight: 600;
}

/* =======================================================================
   RESULT STEP
   ======================================================================= */
.loading { text-align: center; padding: 28px; color: var(--color-muted); font-weight: 600; }

.skeleton-block {
  height: 18px;
  border-radius: 8px;
  margin: 10px 0;
  background: linear-gradient(90deg, #E3ECFB 25%, #F1F5FD 37%, #E3ECFB 63%);
  background-size: 400% 100%;
  animation: skeletonShine 1.4s ease infinite;
}
@keyframes skeletonShine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.result-table { width: 100%; border-collapse: collapse; margin-top: 14px; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.result-table td { padding: 14px; border-bottom: 1px solid var(--color-border); }
.result-table tr:last-child td { border-bottom: none; }
.result-label { color: var(--color-muted); font-size: 0.88rem; }
.result-value { text-align: right; font-weight: 800; color: var(--color-teal-dark); font-variant-numeric: tabular-nums; }
.result-formula { font-size: 0.8rem; color: var(--color-muted); margin-top: 12px; }
.result-notes { font-size: 0.85rem; margin-top: 10px; }
.result-disclaimer {
  font-size: 0.8rem;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
}
.result-warning {
  font-size: 0.8rem;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
}

/* === Antibiogram (kháng sinh đồ) chi tiết từng đĩa === */
.antibiogram-wrap { margin-top: 18px; }
.antibiogram-heading { font-size: 0.95rem; margin-bottom: 8px; color: var(--color-text); }
.antibiogram-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
}
.antibiogram-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.antibiogram-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.antibiogram-table tr:last-child td { border-bottom: none; }
.antibiogram-zone { font-variant-numeric: tabular-nums; font-weight: 700; }
.antibiogram-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.antibiogram-chip--sensitive { background: var(--tile-green-bg); color: var(--tile-green-fg); }
.antibiogram-chip--intermediate { background: var(--tile-amber-bg); color: var(--tile-amber-fg); }
.antibiogram-chip--resistant { background: var(--tile-red-bg); color: var(--tile-red-fg); }
.antibiogram-chip--unknown { background: #E9ECF2; color: var(--color-muted); }

.result-error {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-weight: 600;
}
.result-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
@media (min-width: 768px) {
  .result-actions { flex-direction: row; justify-content: center; }
  .result-actions .btn { flex: 0 1 auto; }
}

/* =======================================================================
   FOOTER — hidden on mobile, minimal on desktop (nam TREN bottom nav)
   ======================================================================= */
.app-footer { display: none; }
@media (min-width: 768px) {
  .app-footer {
    display: block;
    text-align: center;
    font-size: 0.72rem;
    color: var(--color-muted);
    padding: 20px 16px calc(var(--bottom-nav-height) + 16px + env(safe-area-inset-bottom));
  }
}

/* =======================================================================
   BOTTOM NAV — menu shortcut dinh huong co dinh o day man hinh, giong
   thanh tab "Shop travel / Trips / Account" trong mockup tham khao.
   ======================================================================= */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 18px rgba(16, 27, 61, 0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 9px 4px 8px;
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  font-family: var(--font-body);
  min-height: var(--touch-target);
  transition: color 0.15s, transform 0.1s;
}
.bottom-nav-item svg { width: 24px; height: 24px; }
.bottom-nav-item span { font-size: 0.68rem; font-weight: 600; }
.bottom-nav-item.active { color: var(--color-navy-soft); }
.bottom-nav-item:active { transform: scale(0.94); }

@media (min-width: 768px) {
  .bottom-nav { max-width: 720px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
}

/* Vung cham (link/button) toi thieu theo khuyen nghi Apple/Google cho
   thao tac ngon tay tren dien thoai/tablet. */
button, input[type="file"] + label, .btn, .task-card, .engine-card { -webkit-tap-highlight-color: transparent; }
