/* LCB — Road Safety Panel + Map Markers + Popups
 * Dieter Rams base, warmer tone. Lives next to css/bio.css
 */

.safety-panel {
  background: #fff;
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 14px;
  padding: 22px 24px 24px;
  margin: 0 0 24px;
  box-shadow: var(--shadow-warm, 0 1px 0 rgba(75,60,30,.03), 0 12px 30px -16px rgba(75,60,30,.16));
}

.safety-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line, #ebe6d8);
  margin-bottom: 16px;
}

.safety-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--ink-2, #6f6c63);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.safety-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink, #191712);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.safety-sub {
  font-size: 12px;
  color: var(--ink-2, #6f6c63);
  line-height: 1.5;
  max-width: 540px;
}

.safety-score-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #f4f1e9;
  border: 1px solid var(--line, #ebe6d8);
  min-width: 130px;
  text-align: center;
}
.safety-score-pill[data-band="critical"] { background: #f9e1de; border-color: #b3261e; }
.safety-score-pill[data-band="high"]     { background: #fbe6d4; border-color: #FF6319; }
.safety-score-pill[data-band="moderate"] { background: #fff5d2; border-color: #FCCC0A; }
.safety-score-pill[data-band="low"]      { background: #e7f0e1; border-color: #1f6e43; }
.safety-score-pill[data-band="normal"]   { background: #e7f0e1; border-color: #00853F; }

/* Whole panel takes a band tint when the score is high/critical */
.safety-panel[data-band="critical"],
.safety-panel[data-band="high"] { border-color: var(--neg, #b3261e); }
.safety-panel[data-band="critical"] { box-shadow: 0 0 0 2px rgba(179,38,30,0.18), var(--shadow-warm); }

/* ===== Fam-3 morning ban alert ===== */
.safety-fam3-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 0 16px;
  background: linear-gradient(90deg, #fff5d2 0%, #fff8e0 100%);
  border: 1.5px solid #FCCC0A;
  border-left: 4px solid #FF6319;
  border-radius: 8px;
  animation: safety-pulse 1.6s ease-in-out infinite;
}
@keyframes safety-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,193,10,0.3); }
  50%      { box-shadow: 0 0 0 6px rgba(255,193,10,0); }
}
.safety-fam3-ic { font-size: 28px; line-height: 1; }
.safety-fam3-th {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #191712);
  line-height: 1.4;
}
.safety-fam3-en {
  font-size: 11px;
  color: var(--ink-2, #6f6c63);
  line-height: 1.4;
  font-style: italic;
  margin-top: 2px;
}

/* ===== Score reasons (collapsible) ===== */
.safety-reasons-wrap { margin-bottom: 12px; }
.safety-reasons-details {
  background: #faf9f7;
  border: 1px dashed var(--line, #ebe6d8);
  border-radius: 6px;
  font-size: 11px;
}
.safety-reasons-details summary {
  cursor: pointer;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--ink-2, #6f6c63);
  letter-spacing: 0.02em;
  list-style: none;
  user-select: none;
}
.safety-reasons-details summary::-webkit-details-marker { display: none; }
.safety-reasons-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
.safety-reasons-details[open] summary::before { transform: rotate(90deg); }
.safety-reasons {
  list-style: none;
  padding: 0 12px 10px;
  margin: 0;
}
.safety-reasons li {
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  gap: 8px;
  padding: 4px 0;
  border-top: 1px solid var(--line, #ebe6d8);
  font-size: 11px;
  line-height: 1.4;
}
.safety-reason-w {
  font-weight: 700;
  color: var(--neg, #b3261e);
  font-feature-settings: "tnum";
  text-align: right;
}
.safety-reason-th { color: var(--ink, #191712); font-weight: 500; }
.safety-reason-en { color: var(--ink-2, #6f6c63); font-style: italic; }
.safety-reasons-empty {
  padding: 10px 12px;
  color: var(--ink-2, #6f6c63);
  font-size: 11px;
  font-style: italic;
}

/* ===== Card phone (curated hospitals) ===== */
.safety-card-phone {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line, #ebe6d8);
  font-size: 12px;
}
.safety-card-phone a {
  color: #0039A6;
  text-decoration: none;
  font-weight: 700;
  font-feature-settings: "tnum";
}
.safety-card-phone a:hover { text-decoration: underline; }

.safety-card-fly {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  background: #faf9f7;
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink, #191712);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.safety-card-fly:hover { background: var(--ink, #191712); color: var(--paper); border-color: var(--ink, #191712); }

/* ===== Traffy Fondue button ===== */
.safety-traffy {
  display: inline-block;
  padding: 6px 10px;
  background: #b3261e;
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.15s, transform 0.15s;
}
.safety-traffy:hover {
  background: #8a1d18;
  color: #fff;
  transform: translateY(-1px);
}

.safety-score-n {
  font-size: 38px;
  font-weight: 800;
  font-feature-settings: "tnum";
  line-height: 1;
  color: var(--ink, #191712);
}
.safety-score-l {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink, #191712);
  line-height: 1.3;
  text-align: left;
}
.safety-score-l span {
  font-size: 11px;
  color: var(--ink-2, #6f6c63);
  font-weight: 500;
}

/* ===== Cards (hospital + police) ===== */
.safety-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 800px) { .safety-grid { grid-template-columns: 1fr; } }

.safety-card {
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.safety-card--hospital { border-left: 3px solid #b3261e; }
.safety-card--police   { border-left: 3px solid #0039A6; }

.safety-card-h {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.safety-card-icon { font-size: 26px; line-height: 1; }
.safety-card-eyebrow {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2, #6f6c63);
  font-weight: 600;
}
.safety-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #191712);
  line-height: 1.3;
  margin-top: 2px;
}
.safety-card-en {
  font-size: 12px;
  color: var(--ink-2, #6f6c63);
  line-height: 1.3;
  font-style: italic;
}
.safety-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line, #ebe6d8);
}
.safety-card-stats > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.safety-card-stats .k {
  font-size: 9px;
  color: var(--ink-3, #a9a59a);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.safety-card-stats .v {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink, #191712);
  font-feature-settings: "tnum";
}

/* ===== Daily tip ===== */
.safety-tip {
  background: linear-gradient(135deg, #f4f1e9 0%, #faf9f7 100%);
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.safety-tip-eyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2, #6f6c63);
  font-weight: 700;
  margin-bottom: 6px;
}
.safety-tip-th {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #191712);
  line-height: 1.4;
  margin-bottom: 2px;
}
.safety-tip-en {
  font-size: 12px;
  color: var(--ink-2, #6f6c63);
  line-height: 1.4;
  font-style: italic;
}

/* ===== Emergency hotlines ===== */
.safety-emergency {
  margin-bottom: 16px;
  border: 2px solid #b3261e;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff7f6;
}
.safety-emergency-h {
  font-size: 13px;
  font-weight: 800;
  color: #b3261e;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.safety-emergency-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 700px) { .safety-emergency-grid { grid-template-columns: repeat(3, 1fr); } }

.safety-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 8px;
  background: #fff;
  border: 1.5px solid #b3261e;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s;
  min-height: 72px;
  justify-content: center;
}
.safety-call:hover { background: #b3261e; color: #fff; transform: translateY(-1px); }
.safety-call:hover .safety-call-l1,
.safety-call:hover .safety-call-l2 { color: #fff; }
.safety-call:active { transform: translateY(0); }

.safety-call-n {
  font-size: 18px;
  font-weight: 800;
  color: #b3261e;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
  line-height: 1;
}
.safety-call:hover .safety-call-n { color: #fff; }
.safety-call-l1 {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink, #191712);
  line-height: 1.1;
  text-align: center;
}
.safety-call-l2 {
  font-size: 9px;
  color: var(--ink-2, #6f6c63);
  line-height: 1.1;
  text-align: center;
  font-style: italic;
}

.safety-emergency-note {
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink, #191712);
  padding: 10px 12px;
  background: #fff;
  border: 1px dashed #b3261e;
  border-radius: 6px;
}
.safety-emergency-note b { color: #b3261e; }

/* ===== Rest areas + black spots ===== */
.safety-section-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-2, #6f6c63);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.safety-rest,
.safety-spots { margin-bottom: 16px; }

.safety-rest-list,
.safety-spots-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.safety-rest-list li,
.safety-spots-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #faf9f7;
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 8px;
}
.safety-spots-list li { background: #fdf6f4; }

.safety-rest-ic,
.safety-spots-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 18px;
  background: #00853F;
  color: #fff;
  flex-shrink: 0;
}

.safety-spots-ic {
  background: #B3261E;
}

.safety-rest-n,
.safety-spots-n {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #191712);
  line-height: 1.2;
}
.safety-spots-en {
  font-size: 11px;
  font-style: italic;
  color: var(--ink-2, #6f6c63);
  line-height: 1.2;
}
.safety-rest-sub,
.safety-spots-sub {
  font-size: 11px;
  color: var(--ink-2, #6f6c63);
  line-height: 1.4;
  margin-top: 2px;
}

.safety-rest-d,
.safety-spots-d {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #191712);
  font-feature-settings: "tnum";
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.safety-source-note {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-2, #6f6c63);
}
.safety-source-note summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
}
.safety-source-note ul { margin: 6px 0 0 18px; line-height: 1.6; }
.safety-source-note a { color: var(--ink, #191712); }

/* ===== What-to-do (educational) ===== */
.safety-howto {
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
}
.safety-howto summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink, #191712);
  list-style: none;
  user-select: none;
  padding: 2px 0;
}
.safety-howto summary::-webkit-details-marker { display: none; }
.safety-howto summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}
.safety-howto[open] summary::before { transform: rotate(90deg); }
.safety-howto-list {
  margin: 8px 0 0;
  padding-left: 22px;
  color: var(--ink, #191712);
}
.safety-howto-list li {
  margin-bottom: 4px;
  padding-left: 4px;
}
.safety-howto-list b { font-weight: 700; color: var(--ink, #191712); }
.safety-howto-list i { color: var(--ink-2, #6f6c63); }
.safety-howto-tip {
  margin-top: 10px;
  padding: 8px 10px;
  background: #faf9f7;
  border-left: 3px solid #FCCC0A;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink, #191712);
}
.safety-howto-tip b { color: #b3261e; }

/* ===== SOS FAB (one-tap emergency) =====
 * Stacks above the bio-fab (bottom: 66px). On mobile the bio-fab and
 * about-fab are pinned to the bottom so the SOS sits at ~140px. */
.sos-fab {
  position: fixed;
  right: 18px;
  bottom: 158px;
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 72px;
  height: 72px;
  background: #b3261e;
  color: #fff;
  border-radius: 50%;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(179,38,30,0.45), 0 0 0 4px rgba(255,255,255,0.7);
  transition: transform 0.15s, box-shadow 0.15s;
  animation: sos-pulse 1.6s ease-in-out infinite;
  border: 2px solid #fff;
}
.sos-fab:hover { transform: scale(1.05); }
.sos-fab:active { transform: scale(0.95); }
@keyframes sos-pulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(179,38,30,0.45), 0 0 0 4px rgba(255,255,255,0.7), 0 0 0 0 rgba(179,38,30,0.4); }
  50%      { box-shadow: 0 4px 16px rgba(179,38,30,0.45), 0 0 0 4px rgba(255,255,255,0.7), 0 0 0 12px rgba(179,38,30,0); }
}
.sos-fab-n {
  font-size: 22px;
  font-feature-settings: "tnum";
  line-height: 1;
  letter-spacing: 0.02em;
}
.sos-fab-l {
  font-size: 8px;
  line-height: 1.1;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.sos-fab-l i { font-size: 7px; font-weight: 400; font-style: normal; opacity: 0.85; text-transform: none; letter-spacing: 0; }
@media (max-width: 600px) {
  .sos-fab { right: 12px; bottom: 138px; width: 64px; height: 64px; }
  .sos-fab-n { font-size: 18px; }
  .sos-fab-l { font-size: 7px; }
}

/* ===== Map marker (Leaflet divIcon) ===== */
.safety-marker { background: transparent; border: 0; }
.safety-pin {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 1.5px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  color: #fff;
}
.safety-pin::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
}
.safety-marker--spot .safety-pin {
  background: #B3261E;
  border-radius: 8px;
  transform: rotate(0);
  font-size: 18px;
}
.safety-marker--hazard .safety-pin {
  background: #FF6319;
  border-radius: 6px;
  transform: rotate(0);
}
.safety-marker--weight .safety-pin {
  background: #B3261E;
  border-radius: 4px;
  transform: rotate(0);
}
.safety-marker--hospital .safety-pin,
.safety-marker--police .safety-pin,
.safety-marker--fire .safety-pin,
.safety-marker--clinic .safety-pin,
.safety-marker--school .safety-pin,
.safety-marker--fuel .safety-pin,
.safety-marker--rest .safety-pin {
  /* rotated teardrop default — see base .safety-pin */
}

/* ===== Popup ===== */
.safety-popup .leaflet-popup-content-wrapper {
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 4px 20px rgba(75,60,30,0.18);
}
.safety-popup .leaflet-popup-content {
  margin: 0;
  width: 280px !important;
}
.safety-pop { font-family: inherit; }
.safety-pop-h {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px 8px;
  background: #faf9f7;
  border-bottom: 1px solid var(--line, #ebe6d8);
}
.safety-pop-h > span:first-child {
  font-size: 18px;
  line-height: 1;
  margin-top: 2px;
}
.safety-pop-eyebrow {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2, #6f6c63);
  font-weight: 600;
}
.safety-pop-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #191712);
  line-height: 1.3;
}
.safety-pop-name-en {
  font-size: 11px;
  color: var(--ink-2, #6f6c63);
  font-style: italic;
  line-height: 1.3;
}
.safety-pop-body { padding: 10px 12px 12px; }
.safety-pop-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 4px;
}
.safety-pop-row b {
  color: var(--ink-2, #6f6c63);
  font-weight: 600;
}
.safety-pop-row a {
  color: #0039A6;
  text-decoration: none;
  font-weight: 700;
}
.safety-pop-note {
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.5;
  border-radius: 4px;
}
.safety-pop-note--th {
  background: #faf9f7;
  color: var(--ink, #191712);
  font-weight: 500;
}
.safety-pop-note--en {
  background: #f0f4f9;
  color: var(--ink, #191712);
  font-style: italic;
  margin-top: 4px;
}
.safety-pop-coord {
  margin-top: 6px;
  font-size: 10px;
  color: var(--ink-3, #a9a59a);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-align: right;
}

/* ============================================================
   LIFE-SAVING ENHANCEMENTS (v3) — checkpoint alert, school zone,
   first-aid guide, 1669 script overlay, driver timer, ICE card,
   pre-trip checklist, trip advisor, hazmat, share-location
   ============================================================ */

/* ===== Active checkpoint / school-zone alerts ===== */
.safety-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid;
  border-left-width: 5px;
  border-radius: 6px;
  background: #fff;
  animation: safetyPulse 2.4s ease-in-out infinite;
}
.safety-alert--check {
  border-color: #0039A6;
  background: linear-gradient(180deg, #f0f4fa 0%, #fff 100%);
  border-left-color: #0039A6;
}
.safety-alert--school {
  border-color: #FCCC0A;
  background: linear-gradient(180deg, #fefbe6 0%, #fff 100%);
  border-left-color: #FCCC0A;
}
.safety-alert-ic { font-size: 22px; line-height: 1; flex: none; }
.safety-alert-th { font-size: 13px; font-weight: 700; color: var(--ink, #191712); line-height: 1.4; }
.safety-alert-en { font-size: 11px; color: var(--ink-2, #6f6c63); margin-top: 2px; line-height: 1.45; }
.safety-alert-list { margin-top: 8px; font-size: 11px; line-height: 1.55; color: var(--ink-2, #6f6c63); }
.safety-alert-list b { color: var(--ink, #191712); font-weight: 600; }
.safety-alert-list a { color: #0039A6; text-decoration: none; }
.safety-alert-list a:hover { text-decoration: underline; }

@keyframes safetyPulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; }
  50% { box-shadow: 0 0 0 6px rgba(0,0,0,0); }
}

/* ===== First 5 minutes — first-aid guide ===== */
.safety-firstaid {
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 8px;
  margin: 14px 0;
  background: #fff;
}
.safety-firstaid-h {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #ebe6d8);
  background: linear-gradient(180deg, #fef3f3 0%, #fff 100%);
  display: flex;
  align-items: center;
  gap: 10px;
}
.safety-firstaid-ic { font-size: 22px; }
.safety-firstaid-ht { font-size: 13px; font-weight: 700; color: var(--neg, #b3261e); }
.safety-firstaid-he { font-size: 11px; color: var(--ink-2, #6f6c63); margin-top: 1px; }

.safety-firstaid-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #ebe6d8);
  background: #faf9f7;
}
.safety-firstaid-tab {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2, #6f6c63);
  background: #fff;
  border: 1px solid var(--line-2, #d6d1c4);
  border-radius: 14px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 28px;
}
.safety-firstaid-tab:hover { background: #fff8e6; border-color: #FCCC0A; }
.safety-firstaid-tab[aria-pressed="true"] {
  background: var(--neg, #b3261e);
  color: #fff;
  border-color: var(--neg, #b3261e);
}

.safety-firstaid-step {
  display: flex;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #ebe6d8);
}
.safety-firstaid-step:last-child { border-bottom: 0; }
.safety-firstaid-step-n {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--neg, #b3261e);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.safety-firstaid-step--crit .safety-firstaid-step-n { background: #b3261e; animation: safetyPulse 1.5s ease-in-out infinite; }
.safety-firstaid-step--warn .safety-firstaid-step-n { background: #FF6319; }
.safety-firstaid-step--info .safety-firstaid-step-n { background: #0039A6; }
.safety-firstaid-step-b { flex: 1; min-width: 0; }
.safety-firstaid-step-th { font-size: 12px; font-weight: 700; color: var(--ink, #191712); line-height: 1.4; }
.safety-firstaid-step-en { font-size: 11px; color: var(--ink-2, #6f6c63); margin-top: 1px; line-height: 1.45; font-style: italic; }
.safety-firstaid-step-tip {
  font-size: 11px;
  margin-top: 4px;
  padding: 4px 8px;
  background: #fefbe6;
  border-left: 2px solid #FCCC0A;
  color: var(--ink, #191712);
  line-height: 1.5;
}
.safety-firstaid-step-dont {
  font-size: 11px;
  margin-top: 4px;
  padding: 4px 8px;
  background: #fdebeb;
  border-left: 2px solid var(--neg, #b3261e);
  color: var(--ink, #191712);
  line-height: 1.5;
}
.safety-firstaid-mistakes {
  padding: 10px 14px;
  background: #faf3f3;
  border-top: 1px solid var(--line, #ebe6d8);
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-2, #6f6c63);
}
.safety-firstaid-mistakes b { color: var(--neg, #b3261e); }

/* ===== 1669 call script overlay ===== */
.safety-modal-veil {
  position: fixed;
  inset: 0;
  background: rgba(25, 23, 18, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.safety-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 60px -10px rgba(0,0,0,0.4);
  animation: safetyModalIn 0.2s var(--ease-spring);
}
@keyframes safetyModalIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.safety-modal-h {
  padding: 16px 18px;
  background: var(--neg, #b3261e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px 10px 0 0;
}
.safety-modal-ht { font-size: 14px; font-weight: 700; }
.safety-modal-he { font-size: 11px; opacity: 0.85; margin-top: 1px; }
.safety-modal-close {
  background: rgba(255,255,255,0.15);
  border: 0;
  color: #fff;
  font-size: 18px;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  flex: none;
  font-weight: 700;
}
.safety-modal-close:hover { background: rgba(255,255,255,0.3); }
.safety-modal-b { padding: 16px 18px; }
.safety-modal-row { margin-bottom: 12px; }
.safety-modal-l { font-size: 11px; font-weight: 700; color: var(--ink-2, #6f6c63); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.safety-modal-gps {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f0f4fa;
  border: 1px solid #d0dbed; border-radius: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
}
.safety-modal-gps-l { flex: 1; }
.safety-modal-gps-b {
  background: #0039A6; color: #fff; border: 0;
  font-size: 10px; font-weight: 700;
  padding: 4px 8px; border-radius: 4px; cursor: pointer;
  min-height: 28px;
}
.safety-modal-gps-b:hover { background: #002670; }
.safety-modal-sel {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.safety-modal-chip {
  font-size: 12px; font-weight: 600;
  background: #fff; color: var(--ink, #191712);
  border: 1px solid var(--line-2, #d6d1c4);
  border-radius: 14px;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 32px;
}
.safety-modal-chip:hover { border-color: var(--neg, #b3261e); }
.safety-modal-chip[aria-pressed="true"] {
  background: var(--neg, #b3261e);
  color: #fff;
  border-color: var(--neg, #b3261e);
}
.safety-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-2, #d6d1c4);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  background: #faf9f7;
  min-height: 36px;
}
.safety-modal-input:focus { outline: 2px solid var(--accent, #1f6e43); outline-offset: 0; border-color: var(--accent, #1f6e43); }
.safety-modal-script {
  background: #f0f4fa;
  border-left: 4px solid #0039A6;
  padding: 10px 12px;
  border-radius: 0 5px 5px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink, #191712);
  font-family: 'Sarabun', sans-serif;
}
.safety-modal-script b { color: #0039A6; }
.safety-modal-mistakes {
  background: #faf3f3;
  border-left: 4px solid var(--neg, #b3261e);
  padding: 8px 12px;
  border-radius: 0 5px 5px 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink, #191712);
  margin-top: 12px;
}
.safety-modal-call {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--neg, #b3261e);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 12px;
  border: 3px solid #fff;
  outline: 3px solid var(--neg, #b3261e);
}
.safety-modal-call:hover { background: #8a1d17; }
.safety-modal-call:active { background: #6e1812; }
.safety-modal-cancel {
  display: block;
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--ink-2, #6f6c63);
  text-align: center;
  border: 0;
  font-size: 12px;
  margin-top: 6px;
  cursor: pointer;
}

/* ===== Driver fatigue timer ===== */
.safety-timer {
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 8px;
  margin: 14px 0;
  background: #fff;
  padding: 14px;
}
.safety-timer-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.safety-timer-h-l { display: flex; align-items: center; gap: 8px; }
.safety-timer-ic { font-size: 20px; }
.safety-timer-ht { font-size: 13px; font-weight: 700; color: var(--ink, #191712); }
.safety-timer-he { font-size: 11px; color: var(--ink-2, #6f6c63); }
.safety-timer-clock {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink, #191712);
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 8px;
  background: #faf9f7;
  border-radius: 6px;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.safety-timer-clock--warn { color: #FF6319; background: #fff5e8; }
.safety-timer-clock--crit { color: #fff; background: var(--neg, #b3261e); animation: safetyPulse 1.2s ease-in-out infinite; }
.safety-timer-bar { height: 4px; background: var(--line, #ebe6d8); border-radius: 2px; margin-bottom: 8px; overflow: hidden; }
.safety-timer-bar-f { height: 100%; background: var(--accent, #1f6e43); transition: width 1s linear, background 0.3s; }
.safety-timer-bar-f--warn { background: #FF6319; }
.safety-timer-bar-f--crit { background: var(--neg, #b3261e); }
.safety-timer-row { display: flex; gap: 6px; }
.safety-timer-b {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line-2, #d6d1c4);
  background: #fff;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.safety-timer-b:hover { background: #faf9f7; }
.safety-timer-b--primary { background: var(--ink, #191712); color: #fff; border-color: var(--ink, #191712); }
.safety-timer-b--primary:hover { background: #000; }
.safety-timer-b--rest { background: #1f6e43; color: #fff; border-color: #1f6e43; }
.safety-timer-b--rest:hover { background: #155533; }
.safety-timer-msg {
  font-size: 12px;
  line-height: 1.55;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 5px;
}
.safety-timer-msg--ok { background: #f0f8f4; color: #1f6e43; border-left: 3px solid #1f6e43; }
.safety-timer-msg--warn { background: #fff5e8; color: #b35900; border-left: 3px solid #FF6319; }
.safety-timer-msg--crit { background: #fdebeb; color: var(--neg, #b3261e); border-left: 3px solid var(--neg, #b3261e); font-weight: 600; }
.safety-timer-meta { font-size: 10px; color: var(--ink-3, #a9a59a); margin-top: 8px; text-align: right; }

/* ===== Pre-trip inspection checklist ===== */
.safety-pretrip {
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 8px;
  margin: 14px 0;
  background: #fff;
}
.safety-pretrip-h { padding: 12px 14px; border-bottom: 1px solid var(--line, #ebe6d8); display: flex; align-items: center; gap: 10px; }
.safety-pretrip-ic { font-size: 20px; }
.safety-pretrip-ht { font-size: 13px; font-weight: 700; }
.safety-pretrip-he { font-size: 11px; color: var(--ink-2, #6f6c63); }
.safety-pretrip-body { padding: 8px 0; }
.safety-pretrip-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.safety-pretrip-item:hover { background: #faf9f7; }
.safety-pretrip-cb {
  flex: none;
  width: 20px; height: 20px;
  border: 2px solid var(--line-2, #d6d1c4);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  transition: all 0.15s;
  margin-top: 1px;
}
.safety-pretrip-item[aria-checked="true"] .safety-pretrip-cb {
  background: var(--accent, #1f6e43);
  border-color: var(--accent, #1f6e43);
  color: #fff;
}
.safety-pretrip-item[aria-checked="true"] .safety-pretrip-cb::after { content: '✓'; font-size: 13px; font-weight: 700; }
.safety-pretrip-tx { flex: 1; min-width: 0; }
.safety-pretrip-th { font-size: 12px; font-weight: 600; color: var(--ink, #191712); }
.safety-pretrip-en { font-size: 11px; color: var(--ink-2, #6f6c63); }
.safety-pretrip-item[aria-checked="true"] .safety-pretrip-th { text-decoration: line-through; color: var(--ink-3, #a9a59a); }
.safety-pretrip-foot {
  padding: 8px 14px 12px;
  display: flex; gap: 8px; align-items: center;
  border-top: 1px solid var(--line, #ebe6d8);
  font-size: 11px;
  color: var(--ink-2, #6f6c63);
}
.safety-pretrip-foot-b {
  padding: 4px 10px;
  background: #fff;
  border: 1px solid var(--line-2, #d6d1c4);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  min-height: 28px;
}
.safety-pretrip-foot-b:hover { background: #faf9f7; }
.safety-pretrip-pct { font-weight: 700; color: var(--accent, #1f6e43); }

/* ===== Trip departure advisor ===== */
.safety-trip {
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 8px;
  margin: 14px 0;
  background: #fff;
  padding: 14px;
}
.safety-trip-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.safety-trip-ic { font-size: 20px; }
.safety-trip-ht { font-size: 13px; font-weight: 700; }
.safety-trip-he { font-size: 11px; color: var(--ink-2, #6f6c63); }
.safety-trip-now {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: #f0f4fa;
  border-radius: 6px;
  margin-bottom: 10px;
}
.safety-trip-now-l { flex: 1; }
.safety-trip-now-th { font-size: 12px; font-weight: 700; }
.safety-trip-now-en { font-size: 11px; color: var(--ink-2, #6f6c63); margin-top: 1px; }
.safety-trip-now-b { font-size: 24px; }
.safety-trip-windows { display: flex; flex-direction: column; gap: 6px; }
.safety-trip-window {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  background: #faf9f7;
  font-size: 11px;
  line-height: 1.5;
}
.safety-trip-window--good { background: #f0f8f4; border-left: 3px solid #1f6e43; }
.safety-trip-window--ok { background: #faf9f7; border-left: 3px solid #6f6c63; }
.safety-trip-window--bad { background: #faf3f3; border-left: 3px solid #b3261e; }
.safety-trip-window-h { font-size: 12px; font-weight: 700; color: var(--ink, #191712); }
.safety-trip-window-m { color: var(--ink-2, #6f6c63); font-size: 11px; }
.safety-trip-window-i { font-size: 18px; }

/* ===== Hazmat protocol ===== */
.safety-hazmat {
  border: 1px solid #FF6319;
  border-left-width: 5px;
  background: #fff8f0;
  border-radius: 6px;
  margin: 14px 0;
  padding: 14px;
}
.safety-hazmat-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.safety-hazmat-ic { font-size: 20px; }
.safety-hazmat-ht { font-size: 13px; font-weight: 700; color: #b35900; }
.safety-hazmat-he { font-size: 11px; color: var(--ink-2, #6f6c63); }
.safety-hazmat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
@media (max-width: 600px) { .safety-hazmat-grid { grid-template-columns: 1fr; } }
.safety-hazmat-card {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line, #ebe6d8);
  border-radius: 5px;
}
.safety-hazmat-card-th { font-size: 12px; font-weight: 700; color: #b35900; }
.safety-hazmat-card-en { font-size: 10px; color: var(--ink-2, #6f6c63); font-style: italic; margin-top: 1px; }
.safety-hazmat-card-tx { font-size: 11px; line-height: 1.55; color: var(--ink, #191712); margin-top: 4px; }

/* ===== Share location / ICE card ===== */
.safety-share {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0;
}
.safety-share-b {
  flex: 1 1 calc(50% - 4px);
  min-width: 140px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line-2, #d6d1c4);
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink, #191712);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px;
  cursor: pointer;
  transition: all 0.15s;
}
.safety-share-b:hover { background: #faf9f7; border-color: var(--ink, #191712); }
.safety-share-ic { font-size: 22px; flex: none; }
.safety-share-th { font-size: 12px; font-weight: 700; line-height: 1.3; }
.safety-share-en { font-size: 10px; color: var(--ink-2, #6f6c63); font-weight: 500; line-height: 1.3; }
.safety-share-b--primary { background: #0039A6; color: #fff; border-color: #0039A6; }
.safety-share-b--primary:hover { background: #002670; }
.safety-share-b--primary .safety-share-en { color: rgba(255,255,255,0.85); }
.safety-share-b--line { background: #06C755; color: #fff; border-color: #06C755; }
.safety-share-b--line:hover { background: #05a844; }
.safety-share-b--line .safety-share-en { color: rgba(255,255,255,0.9); }

/* ===== ICE card modal / print ===== */
.safety-ice-card {
  background: #fff;
  border: 2px solid var(--neg, #b3261e);
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
}
.safety-ice-h { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--neg, #b3261e); padding-bottom: 8px; margin-bottom: 10px; }
.safety-ice-h-t { font-size: 14px; font-weight: 800; color: var(--neg, #b3261e); letter-spacing: 0.05em; }
.safety-ice-h-e { font-size: 10px; color: var(--ink-2, #6f6c63); }
.safety-ice-name { font-size: 18px; font-weight: 800; color: var(--ink, #191712); margin-bottom: 4px; }
.safety-ice-row { display: flex; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px dashed var(--line, #ebe6d8); }
.safety-ice-row:last-child { border: 0; }
.safety-ice-row-k { flex: none; width: 100px; color: var(--ink-2, #6f6c63); font-weight: 600; }
.safety-ice-row-v { flex: 1; color: var(--ink, #191712); font-weight: 500; }
.safety-ice-row-v b { color: var(--neg, #b3261e); }

@media print {
  .safety-modal-veil, .safety-share, .safety-modal-cancel, .safety-modal-close { display: none !important; }
  .safety-ice-card { border: 2px solid #000; page-break-inside: avoid; }
}

/* ===== Thai wisdom strip ===== */
.safety-wisdom {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fefbe6 0%, #fff 100%);
  border-left: 3px solid #FCCC0A;
  border-radius: 0 5px 5px 0;
  font-size: 12px;
  line-height: 1.55;
}
.safety-wisdom-th { font-weight: 700; color: var(--ink, #191712); }
.safety-wisdom-en { color: var(--ink-2, #6f6c63); font-style: italic; font-size: 11px; margin-top: 2px; }

