/* Offline Toolkit -- dark "survival kit" styling, self-contained so the
   page reads clearly even if other stylesheets failed to cache. */

.toolkit-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.toolkit-intro {
  color: var(--muted, #6B7280);
  margin: 6px 0 18px;
  line-height: 1.5;
}

.toolkit-net-badge {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 700;
  color: #15803D;
}

.toolkit-net-badge.offline {
  color: #B45309;
}

.net-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #15803D;
  vertical-align: middle;
}

.toolkit-card {
  background: #16132B;
  color: #EDEAFB;
  border-radius: 18px;
  padding: 20px 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 12px 34px rgba(10, 8, 24, 0.3);
}

.toolkit-card h2 {
  font-size: 19px;
  margin: 0 0 8px;
  font-family: "Poppins", var(--font-ui, sans-serif);
}

.toolkit-sub {
  color: #B4ABD1;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 14px;
}

.toolkit-note {
  color: #8F87B8;
  font-size: 12.5px;
  margin: 10px 0 0;
  line-height: 1.5;
}

.toolkit-note.stale { color: #FBBF24; }

.toolkit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.toolkit-row[hidden] {
  display: none;
}

.toolkit-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8F87B8;
}

.toolkit-select,
.toolkit-input {
  background: #0F0D1F;
  border: 1.5px solid #443C77;
  color: #EDEAFB;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14.5px;
  font-family: inherit;
  min-width: 0;
}

.toolkit-input { width: 100%; box-sizing: border-box; margin-bottom: 10px; }
.toolkit-row .toolkit-input { width: auto; flex: 1; margin-bottom: 0; }

.toolkit-primary-btn {
  display: inline-block;
  background: #7C3AED;
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.toolkit-primary-btn:hover { background: #6D28D9; }

.toolkit-secondary-btn {
  background: transparent;
  color: #A78BFA;
  border: 1.5px dashed #443C77;
  border-radius: 100px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* SOS */
.sos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
}

.sos-cell {
  background: #0F0D1F;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sos-cell-label { font-size: 11px; color: #8F87B8; text-transform: uppercase; letter-spacing: 0.04em; }
.sos-cell-value { font-size: 14.5px; font-weight: 700; }

.sos-message {
  width: 100%;
  box-sizing: border-box;
  background: #0F0D1F;
  color: #EDEAFB;
  border: 1.5px solid #443C77;
  border-radius: 12px;
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  font-family: inherit;
  margin-bottom: 10px;
}

.sos-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Emergency numbers */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.number-cell {
  background: #0F0D1F;
  border: 1.5px solid #443C77;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: #EDEAFB;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.number-cell:hover { border-color: #7C3AED; }
.number-emoji { font-size: 22px; }
.number-label { font-size: 11.5px; color: #8F87B8; text-transform: uppercase; letter-spacing: 0.05em; }
.number-value { font-size: 20px; font-weight: 800; color: #A78BFA; }

/* Medical ID */
.medical-id-card {
  background: linear-gradient(135deg, #1E1936, #0F0D1F);
  border: 1.5px solid #7C3AED;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.medical-field { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px dashed #2A2547; }
.medical-field:last-child { border-bottom: none; }
.medical-label { color: #8F87B8; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; flex-shrink: 0; }
.medical-value { font-weight: 700; text-align: right; }

.medical-form .toolkit-label { display: block; margin: 10px 0 4px; }

/* POI results */
.poi-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px dashed #2A2547;
}

.poi-emoji { font-size: 18px; }
.poi-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.poi-name { font-weight: 700; font-size: 14px; }
.poi-address { color: #8F87B8; font-size: 12.5px; }
.poi-map-link { color: #A78BFA; font-size: 13px; font-weight: 700; text-decoration: none; }

/* Currency */
.currency-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.currency-row .toolkit-input { width: 110px; margin-bottom: 0; }
.fx-arrow { color: #8F87B8; font-weight: 800; }
.fx-result { font-size: 21px; font-weight: 800; margin-top: 12px; color: #A78BFA; font-family: "Poppins", sans-serif; }

/* Phrasebook */
.phrase-cat { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: #8F87B8; margin: 16px 0 6px; }
.phrase-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  padding: 8px 4px;
  border-bottom: 1px dashed #2A2547;
}

.phrase-en { color: #B4ABD1; font-size: 13.5px; }
.phrase-native { font-weight: 700; font-size: 15px; text-align: right; }
.phrase-phon { grid-column: 1 / -1; color: #8F87B8; font-size: 12px; font-style: italic; text-align: right; }

@media (max-width: 560px) {
  .toolkit-card { padding: 16px 14px 18px; }
}

/* --- Offline vault --- */
.vault-row .poi-map-link { background: none; border: none; cursor: pointer; font-family: inherit; }

.vault-viewer {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 8, 24, 0.96);
  display: flex;
  flex-direction: column;
}

.vault-viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #EDEAFB;
}

.vault-viewer-caption { flex: 1; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.vault-viewer-zoom,
.vault-viewer-close {
  background: #16132B;
  color: #EDEAFB;
  border: 1.5px solid #443C77;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
}

.vault-viewer-stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.vault-viewer-stage:active { cursor: grabbing; }

.vault-viewer-content {
  transition: transform 0.05s linear;
  text-align: center;
}

.vault-viewer-content img { max-width: 90vw; max-height: 78vh; user-select: none; -webkit-user-drag: none; pointer-events: none; }

.vault-qr-frame { background: #fff; display: inline-block; padding: 14px; border-radius: 14px; }
.vault-qr-frame svg { width: min(70vw, 340px); height: auto; display: block; }
.vault-qr-text { color: #B4ABD1; font-size: 13px; margin-top: 10px; word-break: break-all; }

.poi-distance { color: #FBBF24; font-size: 12px; font-weight: 700; margin-left: 4px; }

.stay-cardlet { margin-bottom: 12px; }
.stay-cardlet .sos-actions { margin-top: 12px; }
#stay-add-btn { margin-top: 4px; }

/* ==========================================================================
   Toolkit v2: trip picker + vertical sidebar menu
   ========================================================================== */

.toolkit-main-v2 {
  max-width: 980px;
  width: 100%;
}

.toolkit-trip-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolkit-trip-picker label {
  font-size: 13px;
  font-weight: 600;
  color: #B4ABD1;
}

.toolkit-trip-select-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.toolkit-trip-select {
  width: 100%;
  appearance: none;
  padding: 12px 40px 12px 16px;
  border-radius: 100px;
  border: none;
  background: linear-gradient(90deg, #7C3AED, #EC4899);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.toolkit-trip-select option {
  background: #16132B;
  color: #fff;
}

.toolkit-trip-select-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  pointer-events: none;
}

.toolkit-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.toolkit-sidebar {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 20px;
}

.toolkit-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: #B4ABD1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.toolkit-nav-icon {
  font-size: 18px;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Even at rest, each item's icon carries a soft tint of its own
   category color -- a colorful, quickly-scannable menu rather than a
   uniform grey list that only gains color once something is selected. */
.toolkit-nav-vault .toolkit-nav-icon { background: rgba(124, 58, 237, 0.18); }
.toolkit-nav-stay .toolkit-nav-icon { background: rgba(37, 99, 235, 0.18); }
.toolkit-nav-sos .toolkit-nav-icon { background: rgba(220, 38, 38, 0.18); }
.toolkit-nav-numbers .toolkit-nav-icon { background: rgba(234, 88, 12, 0.18); }
.toolkit-nav-medical .toolkit-nav-icon { background: rgba(219, 39, 119, 0.18); }
.toolkit-nav-essentials .toolkit-nav-icon { background: rgba(13, 148, 136, 0.18); }
.toolkit-nav-currency .toolkit-nav-icon { background: rgba(22, 163, 74, 0.18); }
.toolkit-nav-phrasebook .toolkit-nav-icon { background: rgba(217, 119, 6, 0.18); }

.toolkit-nav-item.active .toolkit-nav-icon {
  background: rgba(255, 255, 255, 0.2);
}

.toolkit-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.toolkit-nav-item.active {
  color: #fff;
}

/* Each category gets its own accent when active -- a colorful, quickly
   scannable menu rather than a single uniform highlight color. */
.toolkit-nav-vault.active { background: linear-gradient(90deg, #7C3AED, #A78BFA); }
.toolkit-nav-stay.active { background: linear-gradient(90deg, #2563EB, #60A5FA); }
.toolkit-nav-sos.active { background: linear-gradient(90deg, #DC2626, #F87171); }
.toolkit-nav-numbers.active { background: linear-gradient(90deg, #EA580C, #FB923C); }
.toolkit-nav-medical.active { background: linear-gradient(90deg, #DB2777, #F472B6); }
.toolkit-nav-essentials.active { background: linear-gradient(90deg, #0D9488, #2DD4BF); }
.toolkit-nav-currency.active { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.toolkit-nav-phrasebook.active { background: linear-gradient(90deg, #D97706, #FBBF24); }

.toolkit-content {
  flex: 1;
  min-width: 0;
}

.toolkit-content .toolkit-card {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .toolkit-layout {
    flex-direction: column;
  }
  .toolkit-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .toolkit-nav-item {
    width: auto;
    flex: 1 1 auto;
    justify-content: center;
    font-size: 13px;
    padding: 10px 12px;
  }
  .toolkit-nav-item span:not(.toolkit-nav-icon) {
    display: none;
  }
}
