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

:root {
  --bg: #0a0a0a;
  --card: #1a1a1a;
  --card-border: #2a2a2a;
  --green: #22c55e;
  --green-dim: #166534;
  --red: #ef4444;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --text: #e5e5e5;
  --text-dim: #737373;
  --mono: 'Courier New', Consolas, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Night mode */
body.night { --bg: #000; --card: #0a0a0a; --card-border: #1a1a1a; --text: #661a1a; --green: #1a4a1a; --red: #661a1a; --amber: #664a1a; filter: brightness(0.6); }

/* Gloves mode */
body.gloves button, body.gloves .btn { min-height: 80px !important; font-size: 1.2rem !important; }
body.gloves .small-btn { min-height: 60px !important; }

#topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--card); border-bottom: 1px solid var(--card-border);
}
#topbar h1 { font-size: 1rem; font-weight: 800; letter-spacing: 2px; color: var(--green); font-family: var(--mono); }

#mode-indicator {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ─── Bottom Tab Bar ─────────────────────────────────────────────────── */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #111;
  border-top: 1px solid #2a2a2a;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
#tab-bar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: #666;
  font-size: 0.6rem;
  font-family: inherit;
  cursor: pointer;
  gap: 2px;
  transition: color 0.15s;
}
#tab-bar button.active { color: #22c55e; }
#tab-bar .tab-icon { font-size: 1.2rem; }
#tab-bar .tab-label { font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

/* ─── Sub-menu Panel ─────────────────────────────────────────────────── */
.submenu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  transition: opacity 0.2s;
}
.submenu-panel {
  position: fixed;
  bottom: 56px;
  left: 0;
  right: 0;
  background: #111;
  border-top: 1px solid #2a2a2a;
  border-radius: 16px 16px 0 0;
  z-index: 95;
  padding: 16px 12px 12px;
  transform: translateY(0);
  transition: transform 0.25s ease;
  max-height: 60vh;
  overflow-y: auto;
}
.submenu-panel.hidden { transform: translateY(100%); display: none; }
.submenu-overlay.hidden { opacity: 0; pointer-events: none; display: none; }
.submenu-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2a2a2a;
}
.submenu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.submenu-grid button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-align: left;
}
.submenu-grid button:active { transform: scale(0.97); }
.submenu-grid button .submenu-icon { font-size: 1.2rem; }

/* ─── Funnel / Assistant ──────────────────────────────────────────────── */
.funnel-container {
  padding: 8px 0;
}
.funnel-question {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.4;
}
.funnel-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.funnel-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  text-align: left;
  min-height: 56px;
}
.funnel-btn:active { transform: scale(0.97); border-color: var(--green); }
.funnel-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 16px;
}
.funnel-result {
  background: var(--card);
  border: 2px solid var(--green);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.funnel-result .tip-text {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 16px 0;
  text-align: left;
}
.funnel-result .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--green);
  color: #000;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}

/* ─── Situation Banner ────────────────────────────────────────────────── */
.situation-banner {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
.situation-banner .sit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.situation-banner .sit-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.situation-banner .sit-update-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: transparent;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ─── Situation Validation Prompt ──────────────────────────────────────── */
.situation-check {
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.situation-check .check-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.situation-check ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.situation-check li {
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 3px 0;
}
.situation-check li::before {
  content: '\2022';
  color: var(--green);
  margin-right: 8px;
}
.situation-check .check-btns {
  display: flex;
  gap: 8px;
}
.situation-check .check-btns button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ─── Quick Actions ───────────────────────────────────────────────────── */
.quick-actions {
  margin-top: 16px;
}
.quick-actions .qa-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.quick-action-card:active { border-color: var(--green); }
.quick-action-card .qa-icon { font-size: 1.4rem; }
.quick-action-card .qa-text { flex: 1; }
.quick-action-card .qa-text .qa-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.quick-action-card .qa-text .qa-desc { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; }
.quick-action-card .qa-arrow { color: var(--text-dim); font-size: 0.8rem; }

#content { padding: 12px; padding-bottom: 130px; }

#emergency-btn {
  position: fixed; bottom: 70px; right: 16px;
  padding: 12px 20px; border: 2px solid var(--red); border-radius: 12px;
  background: rgba(239,68,68,0.15); color: var(--red);
  font-size: 0.9rem; font-weight: 900; letter-spacing: 2px;
  cursor: pointer; z-index: 200; animation: emergency-pulse 1.5s infinite;
  backdrop-filter: blur(8px);
}
@keyframes emergency-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); } 50% { box-shadow: 0 0 20px 10px rgba(239,68,68,0.1); } }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px;
}
.card-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--green); margin-bottom: 10px; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px; border: 1px solid var(--card-border); border-radius: 10px;
  background: var(--card); color: var(--text); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s; text-align: center;
  min-height: 56px;
}
.btn:active { transform: scale(0.97); }
.btn-green { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.08); }
.btn-red { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.08); }
.btn-amber { border-color: var(--amber); color: var(--amber); background: rgba(245,158,11,0.08); }
.btn-blue { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.08); }
.btn-big { min-height: 80px; font-size: 1.3rem; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

/* Indicators */
.indicator {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border-left: 3px solid var(--green);
  margin-bottom: 6px; font-size: 0.85rem;
}
.indicator.warn { border-color: var(--amber); }
.indicator.danger { border-color: var(--red); }
.indicator .value { font-family: var(--mono); font-weight: 700; font-size: 1rem; }

/* Alert */
.alert {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 10px;
  font-size: 0.85rem; font-weight: 600;
}
.alert-red { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.alert-amber { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: var(--amber); }
.alert-green { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }

/* Input */
input, select, textarea {
  width: 100%; padding: 12px; border: 1px solid var(--card-border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 0.9rem;
}
input:focus, select:focus { outline: none; border-color: var(--green); }
label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; }
.form-group { margin-bottom: 12px; }

/* Checkbox / Checklist */
.check-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: var(--card); border: 1px solid var(--card-border);
  border-radius: 8px; margin-bottom: 6px; cursor: pointer; min-height: 50px;
}
.check-item.done { opacity: 0.5; text-decoration: line-through; border-color: var(--green); }
.check-item .check-box {
  width: 24px; height: 24px; border: 2px solid var(--text-dim); border-radius: 4px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.check-item.done .check-box { background: var(--green); border-color: var(--green); }
.check-item.done .check-box::after { content: '\2713'; color: #000; font-weight: 900; }

/* Section title */
.section-header {
  font-size: 1.2rem; font-weight: 900; letter-spacing: 1px;
  color: var(--text); margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--green);
}

/* Progress bar */
.progress { height: 6px; background: var(--card-border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }
.progress-fill.warn { background: var(--amber); }
.progress-fill.danger { background: var(--red); }

/* Steps */
.step {
  padding: 14px; border: 1px solid var(--card-border); border-radius: 8px;
  margin-bottom: 8px; background: var(--card);
}
.step-number { display: inline-block; width: 28px; height: 28px; background: var(--green); color: #000; font-weight: 900; text-align: center; line-height: 28px; border-radius: 50%; margin-right: 10px; font-size: 0.85rem; }
.step-warning { color: var(--red); font-weight: 700; font-size: 0.8rem; margin-top: 6px; }

/* Modal overlay */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.85); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 20px; width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto;
}
.modal-title {
  font-size: 1rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 2px; color: var(--green); margin-bottom: 16px;
  font-family: var(--mono);
}

/* Tags */
.tag {
  display: inline-block; padding: 4px 10px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.tag-green { background: rgba(34,197,94,0.15); color: var(--green); }
.tag-red { background: rgba(239,68,68,0.15); color: var(--red); }
.tag-amber { background: rgba(245,158,11,0.15); color: var(--amber); }
.tag-blue { background: rgba(59,130,246,0.15); color: var(--blue); }

/* Monospace data */
.mono { font-family: var(--mono); }
.data-value { font-family: var(--mono); font-weight: 700; font-size: 1.4rem; color: var(--green); }
.data-label { font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* Divider */
.divider { height: 1px; background: var(--card-border); margin: 16px 0; }

/* Scrollable list */
.scroll-list { max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.scroll-list::-webkit-scrollbar { width: 4px; }
.scroll-list::-webkit-scrollbar-track { background: var(--bg); }
.scroll-list::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 2px; }

/* Table-like rows */
.data-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--card-border);
}
.data-row:last-child { border-bottom: none; }

/* Tabs within sections */
.tab-bar { display: flex; gap: 4px; margin-bottom: 12px; }
.tab-bar button {
  flex: 1; padding: 10px; border: 1px solid var(--card-border); border-radius: 6px;
  background: var(--bg); color: var(--text-dim); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; cursor: pointer;
}
.tab-bar button.active { background: var(--green-dim); color: var(--green); border-color: var(--green); }

/* Stat block */
.stat-block {
  text-align: center; padding: 16px; background: var(--card);
  border: 1px solid var(--card-border); border-radius: 10px;
}
.stat-block .data-value { display: block; margin-bottom: 4px; }

/* Badge / counter */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; font-size: 0.7rem; font-weight: 900;
  background: var(--red); color: #fff;
}

/* Accordion */
.accordion-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px; background: var(--card); border: 1px solid var(--card-border);
  border-radius: 8px; cursor: pointer; margin-bottom: 4px;
  font-weight: 700; font-size: 0.9rem;
}
.accordion-header::after { content: '\25BC'; font-size: 0.7rem; color: var(--text-dim); transition: transform 0.2s; }
.accordion-header.open::after { transform: rotate(180deg); }
.accordion-body {
  padding: 0 14px; max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.accordion-body.open { max-height: 500px; padding: 14px; }

/* Utility */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-blue { color: var(--blue); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.font-mono { font-family: var(--mono); }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking { letter-spacing: 1px; }

/* Map */
#map-container, #scenario-map-container { height: 55vh; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--card-border); z-index: 1; }
.map-info-bar { padding: 10px 14px; background: var(--card); border: 1px solid var(--card-border); border-radius: 8px; margin-top: 8px; font-size: 0.85rem; }
.map-info-bar .distance-display { font-family: var(--mono); font-weight: 700; font-size: 1.2rem; color: var(--green); }
.marker-btn { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border: 1px solid var(--card-border); border-radius: 8px; background: var(--card); color: var(--text); font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.marker-btn:active { transform: scale(0.95); }
.marker-btn.active { border-color: var(--green); background: var(--green-dim); color: var(--green); }

/* GPS pulse animation for map */
@keyframes gps-pulse {
  0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.5); }
  70% { box-shadow: 0 0 0 12px rgba(59,130,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}
.gps-dot {
  width: 14px; height: 14px; background: var(--blue); border: 2px solid #fff;
  border-radius: 50%; animation: gps-pulse 2s infinite;
}

/* Hidden */
.hidden { display: none !important; }

/* ─── Stealth Mode ──────────────────────────────────────────────────── */
body.mode-stealth { background: #000 !important; color: #333 !important; }
body.mode-stealth * { background: transparent !important; border-color: #111 !important; color: #444 !important; box-shadow: none !important; animation: none !important; transition: none !important; }
body.mode-stealth .stealth-visible { color: #666 !important; }
body.mode-stealth #tab-bar, body.mode-stealth #emergency-btn, body.mode-stealth .submenu-panel, body.mode-stealth .submenu-overlay { display: none !important; }
body.mode-stealth #topbar { border-color: #111 !important; }
body.mode-stealth .stealth-tap-area { position: fixed; inset: 0; z-index: 9999; }
body.mode-stealth .stealth-content { display: block !important; }
body.mode-stealth .stealth-hidden { display: none !important; }

/* ─── Fauna Cards ───────────────────────────────────────────────────── */
.fauna-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--green);
}
.fauna-card.dangerous {
  border-left-color: var(--red); background: rgba(239,68,68,0.06);
}
.fauna-badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
}
.fauna-badge.mammifere { background: rgba(245,158,11,0.2); color: #f59e0b; }
.fauna-badge.oiseau { background: rgba(59,130,246,0.2); color: #3b82f6; }
.fauna-badge.poisson, .fauna-badge.crustace, .fauna-badge.mollusque { background: rgba(34,197,94,0.2); color: #22c55e; }
.fauna-badge.insecte, .fauna-badge.arachnide { background: rgba(168,85,247,0.2); color: #a855f7; }
.fauna-badge.reptile { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ─── Medicinal Plant Cards ─────────────────────────────────────────── */
.med-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px; border-left: 4px solid #10b981;
}
.med-pill {
  display: inline-block; padding: 3px 8px; border-radius: 12px;
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  margin: 2px;
}
.med-pill.antiseptique { background: rgba(239,68,68,0.15); color: #ef4444; }
.med-pill.digestif { background: rgba(34,197,94,0.15); color: #22c55e; }
.med-pill.respiratoire { background: rgba(59,130,246,0.15); color: #3b82f6; }
.med-pill.cicatrisation { background: rgba(245,158,11,0.15); color: #f59e0b; }
.med-pill.calmant { background: rgba(168,85,247,0.15); color: #a855f7; }
.med-pill.fièvre, .med-pill.fievre { background: rgba(236,72,153,0.15); color: #ec4899; }
.med-pill.default { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.med-reliability {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%;
  text-align: center; line-height: 24px; font-size: 0.7rem; font-weight: 900;
}
.med-reliability.a { background: rgba(34,197,94,0.2); color: #22c55e; }
.med-reliability.b { background: rgba(245,158,11,0.2); color: #f59e0b; }
.med-reliability.c { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ─── Stay or Go ────────────────────────────────────────────────────── */
.staygo-btn {
  display: block; width: 100%; padding: 10px 14px; margin: 4px 0;
  border: 1px solid var(--card-border); border-radius: 8px;
  background: var(--card); color: var(--text-dim); font-size: 0.8rem;
  font-weight: 600; cursor: pointer; text-align: left; font-family: inherit;
  transition: all 0.15s;
}
.staygo-btn.active-stay { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.1); }
.staygo-btn.active-go { border-color: var(--amber); color: var(--amber); background: rgba(245,158,11,0.1); }
.staygo-btn.active-neg { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.08); }

/* ─── Medical Journal ───────────────────────────────────────────────── */
.journal-entry {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 14px; margin-bottom: 10px; border-left: 4px solid var(--green);
}
.journal-entry.urgency-high { border-left-color: var(--red); }
.journal-entry.urgency-medium { border-left-color: var(--amber); }
.journal-vital-btn {
  display: inline-block; padding: 6px 10px; margin: 2px;
  border: 1px solid var(--card-border); border-radius: 6px;
  background: var(--bg); color: var(--text-dim); font-size: 0.7rem;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.journal-vital-btn.selected { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.1); }
.journal-vital-btn.selected-amber { border-color: var(--amber); color: var(--amber); background: rgba(245,158,11,0.1); }
.journal-vital-btn.selected-red { border-color: var(--red); color: var(--red); background: rgba(239,68,68,0.1); }
.journal-vital-btn.selected-blue { border-color: var(--blue); color: var(--blue); background: rgba(59,130,246,0.1); }

/* ─── Route Journal ─────────────────────────────────────────────────── */
.route-entry {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 14px; margin-bottom: 10px; position: relative;
  padding-left: 40px;
}
.route-entry .route-day {
  position: absolute; left: -1px; top: 12px;
  width: 28px; height: 28px; background: var(--green-dim); color: var(--green);
  font-weight: 900; font-size: 0.7rem; text-align: center; line-height: 28px;
  border-radius: 50%;
}
.mood-btn {
  display: inline-block; padding: 6px 12px; margin: 2px;
  border: 1px solid var(--card-border); border-radius: 8px;
  font-size: 1.2rem; cursor: pointer; background: var(--bg);
}
.mood-btn.selected { border-color: var(--green); background: rgba(34,197,94,0.1); }

/* ─── Agriculture ───────────────────────────────────────────────────── */
.agri-month {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; margin: 2px;
  font-size: 0.7rem; font-weight: 700; border: 1px solid var(--card-border);
  color: var(--text-dim); background: var(--bg);
}
.agri-month.current { border-color: var(--green); color: var(--green); background: rgba(34,197,94,0.15); }
.difficulty-stars { color: var(--amber); font-size: 0.7rem; letter-spacing: 1px; }

/* ─── Flora / Plant Cards ─────────────────────────────────────────────────── */
.flora-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px; border-left: 4px solid var(--green);
}
.flora-card.comestible_a { border-left-color: #22c55e; }
.flora-card.comestible_b { border-left-color: #f59e0b; }
.flora-card.toxique { border-left-color: #ef4444; }
.flora-card.mortel { border-left-color: #991b1b; }
.flora-toxic {
  background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.3);
}
.flora-mortal {
  background: rgba(153,27,27,0.12); border-color: #991b1b;
  animation: mortal-pulse 2s infinite;
}
@keyframes mortal-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(153,27,27,0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(153,27,27,0.15); }
}
.flora-badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
}
.flora-badge.comestible_a { background: rgba(34,197,94,0.2); color: #22c55e; }
.flora-badge.comestible_b { background: rgba(245,158,11,0.2); color: #f59e0b; }
.flora-badge.toxique { background: rgba(239,68,68,0.2); color: #ef4444; }
.flora-badge.mortel { background: rgba(153,27,27,0.4); color: #fca5a5; }

/* ─── Confusion Warning ──────────────────────────────────────────────────── */
.confusion-warning {
  padding: 14px 16px; border-radius: 10px; margin: 10px 0;
  background: rgba(239,68,68,0.15); border: 2px solid var(--red);
  color: var(--red); font-weight: 700; font-size: 0.85rem;
}
.confusion-warning::before { content: '\26A0\FE0F '; font-size: 1.1rem; }

/* ─── Autonomy Technique Cards ───────────────────────────────────────────── */
.autonomy-technique {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 14px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.2s;
}
.autonomy-technique:hover { border-color: var(--green); }
.autonomy-technique.open { border-color: var(--green); }
.autonomy-technique .tech-header {
  display: flex; justify-content: space-between; align-items: center;
}
.autonomy-technique .tech-body {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
}
.autonomy-technique.open .tech-body { max-height: 2000px; }

/* ─── Trip Day Cards ─────────────────────────────────────────────────────── */
.trip-day {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 8px;
  padding: 12px; margin-bottom: 6px; display: flex; justify-content: space-between;
  align-items: center; gap: 8px;
}
.trip-day .day-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--green-dim); color: var(--green);
  font-weight: 900; font-size: 0.85rem; border-radius: 50%; flex-shrink: 0;
}
.trip-day .day-info { flex: 1; font-size: 0.8rem; }
.trip-day .day-stats {
  display: flex; gap: 10px; font-size: 0.7rem; color: var(--text-dim);
}

/* ─── Contamination Cards ────────────────────────────────────────────────── */
.contam-card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 16px; margin-bottom: 12px;
}
.contam-card .contam-header {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
}
.contam-emergency {
  font-size: 1.3rem; font-weight: 900; line-height: 1.6;
}

/* ─── Health History Chart ───────────────────────────────────────────────── */
.health-chart { margin-top: 10px; }
.health-chart-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.health-chart-label {
  font-size: 0.6rem; color: var(--text-dim); width: 40px; text-align: right; flex-shrink: 0;
}
.health-chart-cells { display: flex; gap: 2px; flex: 1; }
.health-chart-cell {
  flex: 1; height: 14px; border-radius: 2px; min-width: 8px;
}

/* ─── Print Page ─────────────────────────────────────────────────────────── */
.print-page {
  background: white; color: black; font-family: -apple-system, sans-serif;
  padding: 20px; max-width: 800px; margin: 0 auto;
}
.print-page h1 { font-size: 1.5rem; border-bottom: 2px solid #333; padding-bottom: 8px; margin-bottom: 16px; }
.print-page h2 { font-size: 1.1rem; color: #333; margin-top: 20px; margin-bottom: 8px; border-left: 4px solid #333; padding-left: 8px; }
.print-page h3 { font-size: 0.95rem; color: #555; margin-top: 12px; margin-bottom: 6px; }
.print-page .print-card { border: 1px solid #ccc; border-radius: 6px; padding: 12px; margin-bottom: 10px; }
.print-page .print-alert { padding: 8px 12px; border: 1px solid #cc0000; border-radius: 4px; color: #cc0000; margin-bottom: 8px; font-weight: 600; }
.print-page ul { padding-left: 20px; margin: 4px 0; }
.print-page li { font-size: 0.85rem; margin-bottom: 2px; }
.print-page table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.print-page td, .print-page th { border: 1px solid #ccc; padding: 6px 8px; font-size: 0.8rem; text-align: left; }
.print-page th { background: #f0f0f0; font-weight: 700; }

/* ─── Print Media ────────────────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  .card { border: 1px solid #ccc; }
  #emergency-btn, #topbar, #tab-bar, .submenu-panel, .submenu-overlay { display: none; }
  .print-page { padding: 0; }
  .print-page .print-card { break-inside: avoid; }
}

/* Compass v0.5 */
.compass-ring { width:200px; height:200px; border-radius:50%; border:2px solid var(--green); position:relative; margin:0 auto; transition:transform 0.3s ease-out; }
.compass-n { position:absolute; top:8px; left:50%; transform:translateX(-50%); color:#ff4444; font-weight:bold; font-size:18px; }
.compass-s { position:absolute; bottom:8px; left:50%; transform:translateX(-50%); color:var(--text-dim); font-size:14px; }
.compass-e { position:absolute; right:8px; top:50%; transform:translateY(-50%); color:var(--text-dim); font-size:14px; }
.compass-w { position:absolute; left:8px; top:50%; transform:translateY(-50%); color:var(--text-dim); font-size:14px; }
.compass-needle { position:absolute; top:50%; left:50%; width:4px; height:80px; background:linear-gradient(#ff4444 50%, #ccc 50%); transform-origin:bottom center; transform:translateX(-50%) translateY(-100%); border-radius:2px; }
.compass-destination { position:absolute; top:50%; left:50%; width:2px; height:70px; background:var(--cyan,#0af); transform-origin:bottom center; opacity:0.7; border-radius:1px; }
