/* static/styles.css */

/* -------------------------
   Base + reset
-------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.tb-body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e5f0ff 0, #f3f4f6 40%, #e5e7eb 100%);
  color: #111827;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6,
.tb-tab {
  font-family: 'Poppins', 'Nunito', system-ui, sans-serif;
}

/* Remove number spinners */
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/* -------------------------
   Header (banner image)
-------------------------- */

.tb-header {
  background: #ffffff;
  padding: 0;
  border-bottom: 1px solid rgba(209, 213, 219, 0.5);
}

.tb-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Guides button lives in the header (top-right), not the main nav.
   Pill style, brand-teal outline, fills on hover. */
.tb-header-guides {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.15rem;
  background: #ffffff;
  color: #0f766e;
  border: 1.5px solid #0f766e;
  border-radius: 999px;
  font-family: Poppins, Nunito, system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.tb-header-guides:hover,
.tb-header-guides:focus-visible {
  background: #0f766e;
  color: #ffffff;
  transform: translateY(-1px);
  outline: none;
}

.tb-header-banner {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
}

/* Hide old text elements — banner replaces them */
.tb-header h1,
.tb-tagline {
  display: none;
}

/* -------------------------
   Main container
-------------------------- */

.tb-main {
  max-width: 1140px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.25rem 3rem;
}

/* -------------------------
   Nav tabs (folder-tab style)
-------------------------- */

.tb-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  margin-bottom: 0;
  padding: 0;
  position: relative;
  z-index: 2;
  /* Thin line across the bottom of the tab bar */
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.tb-tab {
  flex: 1 1 0;
  text-align: center;
  white-space: nowrap;
  padding: 0.6rem 0.3rem 0.55rem;
  border-radius: 0.6rem 0.6rem 0 0;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: #6b7280;
  background: rgba(229, 231, 235, 0.5);
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.tb-tab:hover {
  background: rgba(243, 244, 246, 0.8);
  color: #374151;
}

/* Active tab merges into the content area below */
.tb-tab-active {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-weight: 700;
  border-color: rgba(148, 163, 184, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.92);
  z-index: 3;
}

/* First card after nav — connect to tab bar */
.tb-nav + .tb-card,
.tb-nav + section > .tb-card:first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin-top: 0;
  border-top-color: transparent;
}

/* -------------------------
   Cards (glass / soft)
-------------------------- */

.tb-card {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 1.25rem;
  padding: 1.6rem 1.8rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(18px);
  transition: box-shadow 0.18s ease, transform 0.12s ease, border-color 0.18s ease;
}

.tb-card:hover {
  box-shadow:
    0 22px 55px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  transform: translateY(-1px);
}

.tb-card h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

/* -------------------------
   Form layout (RESTORED: step numbering + section highlight)
-------------------------- */

.tb-form {
  counter-reset: tb-section;
}

.tb-form-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tb-form-section:first-of-type {
  border-top: none;
  padding-top: 0.25rem;
  margin-top: 0;
}



/* Rear-load UI must NOT inflate when section is focused */
.tb-form-section:focus-within .tb-rear-load-wrapper {
  padding: 0;
  margin: 0;
}

/* Section headings get step numbers */
.tb-form-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Only number the h3s that live inside the actual input form. Results
   and map sections reuse .tb-form-section for layout but shouldn't get
   a circled counter pill next to their headings. */
.tb-form .tb-form-section h3::before {
  counter-increment: tb-section;
  content: counter(tb-section);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111827;
  background: #e5edff;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
}

/* Field rows + fields */

.tb-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tb-field {
  flex: 1 1 min(260px, 100%);
}

.tb-field label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.tb-field input,
.tb-field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  outline: none;
  background-color: rgba(249, 250, 251, 0.9);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, transform 0.08s ease;
}

.tb-field input:focus,
.tb-field select:focus {
  border-color: #2563eb;
  background-color: #ffffff;
  transform: none;
  box-shadow:
    0 0 0 2px rgba(37, 99, 235, 0.35),
    0 14px 34px rgba(30, 64, 175, 0.14);
}

.tb-helper-text {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #6b7280;
}

.tb-helper-muted {
  color: #9ca3af;
}

.tb-helper-text-inline {
  font-weight: 400;
  color: #6b7280;
  font-size: 0.75rem;
}

.tb-required {
  color: #b91c1c;
}

/* -------------------------
   Buttons
-------------------------- */

.tb-form-actions {
  margin-top: 1.25rem;
}

.tb-button-primary {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.7rem 1.8rem;
  font-family: 'Poppins', 'Nunito', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
  transition: background 0.2s ease, box-shadow 0.2s ease,
    transform 0.15s ease;
}

.tb-button-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.tb-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
  background: #1e40af;
}

/* -------------------------
   Result header / pill
-------------------------- */

.tb-result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.tb-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tb-status-pill--grey { background: #e5e7eb; color: #4b5563; }
.tb-status-pill--green { background: #dcfce7; color: #166534; }
.tb-status-pill--amber { background: #fef3c7; color: #92400e; }
.tb-status-pill--red { background: #fee2e2; color: #b91c1c; }

.tb-risk-label {
  font-size: 0.95rem;
  color: #4b5563;
}

.tb-summary-text {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: #111827;
}

/* -------------------------
   Mode picker (touring entry-point)
-------------------------- */

.tb-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 760px) {
  .tb-picker-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
  .tb-picker-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .tb-picker-card .tb-picker-icon {
    font-size: 1.4rem;
    margin: 0;
    flex-shrink: 0;
  }
  .tb-picker-card h3 {
    margin: 0;
    font-size: 0.95rem;
  }
  .tb-picker-card p {
    display: none;
  }
}

.tb-picker-card {
  display: block;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.25rem;
  padding: 1.6rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.tb-picker-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 55px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
  border-color: rgba(59, 130, 246, 0.55);
}

.tb-picker-card:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.tb-picker-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.tb-picker-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: #111827;
}

.tb-picker-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.4;
}

.tb-link-back {
  font-size: 0.85rem;
  color: #6b7280;
  text-decoration: none;
}

.tb-link-back:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* -------------------------
   Pin-drop on touring destination flow
-------------------------- */

.tb-pickmap-link {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0;
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.tb-pickmap-link:hover {
  text-decoration: underline;
}

.tb-pickmap-wrapper {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
}

.tb-pickmap-map {
  width: 100%;
  height: 360px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.4);
  cursor: crosshair;
}

.tb-pickmap-confirm {
  margin-top: 0.8rem;
  padding: 0.85rem 1rem;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tb-pickmap-confirm-text strong {
  display: block;
  font-size: 1rem;
  color: #065f46;
}

.tb-pickmap-confirm-context {
  display: block;
  font-size: 0.82rem;
  color: #047857;
  margin-top: 0.1rem;
}

.tb-pickmap-confirm-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tb-button-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.tb-button-secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* -------------------------
   Rig card highlight + containment
-------------------------- */

.tb-card-rig {
  position: relative;
  background: linear-gradient(
      145deg,
      rgba(243, 244, 246, 0.9),
      rgba(255, 255, 255, 0.98)
    );
  border-radius: 1.25rem;
  padding: 1.8rem 1.9rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.tb-rig-visual {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 0.9rem;
  background: rgba(243, 244, 246, 0.7);
  border: 1px solid rgba(209, 213, 219, 0.9);
  padding: 0.75rem;
}

.tb-rig-image {
  width: 100%;
  max-width: 820px;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 0.75rem;
}

.tb-rig-caption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #374151;
}

#rig-danger-badge {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  background-color: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
  pointer-events: none;
}

/* -------------------------
   Checks list
-------------------------- */

.tb-checks-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tb-check-item {
  border-radius: 0.9rem;
  padding: 0.8rem 0.8rem 0.7rem;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.7rem;
  background: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease, background 0.15s ease;
}

.tb-check-item:hover {
  border-color: rgba(148, 163, 184, 0.7);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.tb-check-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.tb-check-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #111827;
}

.tb-check-detail {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: #4b5563;
}

/* Check badges */

.tb-check-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tb-check-status--ok { background-color: #dcfce7; color: #166534; }
.tb-check-status--amber { background-color: #fef3c7; color: #92400e; }
.tb-check-status--red { background-color: #fee2e2; color: #b91c1c; }
.tb-check-status--unknown { background-color: #e5e7eb; color: #4b5563; }

/* -------------------------
   Footer
-------------------------- */

.tb-footer {
  text-align: center;
  padding: 0.6rem 1.25rem 0.7rem;
  font-size: 0.75rem;
  color: #9ca3af;
  background: #ffffff;
  border-top: 1px solid rgba(209, 213, 219, 0.4);
  line-height: 1.4;
}

.tb-footer-img {
  display: block;
  margin: 0 auto 0.4rem;
  width: 100%;
  max-width: 320px;
  height: auto;
}

.tb-footer-copyright {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  color: #b0b5bd;
}

.tb-footer a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.tb-footer a:hover {
  color: #2563eb;
}

.tb-footer-copyright {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: #b0b5bd;
}

/* -------------------------
   Disclaimer
-------------------------- */

.tb-tip-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0.4rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #1e3a5f;
}

.tb-disclaimer-strong {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: #4b5563;
}

.tb-disclaimer-strong strong {
  font-weight: 900;
}

/* -------------------------
   Motorhome loading results
-------------------------- */

section#mh-result.mh-result-good { border: 2.5px solid #10b981 !important; box-shadow: 0 0 16px rgba(16, 185, 129, 0.25); }
section#mh-result.mh-result-over { border: 2.5px solid #ef4444 !important; box-shadow: 0 0 16px rgba(239, 68, 68, 0.25); }

.mh-verdict-good  { background: #ecfdf5; border-left: 4px solid #10b981; border-radius: 0.4rem; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.mh-verdict-tight { background: #fffbeb; border-left: 4px solid #f59e0b; border-radius: 0.4rem; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.mh-verdict-over  { background: #fef2f2; border-left: 4px solid #ef4444; border-radius: 0.4rem; padding: 0.75rem 1rem; margin-bottom: 1rem; }

.mh-check-row { padding: 0.5rem 0.7rem; margin: 0.4rem 0; border-radius: 0.3rem; font-size: 0.88rem; line-height: 1.5; }
.mh-good  { background: #f0fdf4; }
.mh-tight { background: #fffbeb; }
.mh-over  { background: #fef2f2; font-weight: 600; }

.mh-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
  margin-right: 0.3rem;
  vertical-align: middle;
}
.mh-good  .mh-badge { background: #d1fae5; color: #065f46; }
.mh-tight .mh-badge { background: #fef3c7; color: #92400e; }
.mh-over  .mh-badge { background: #fecaca; color: #991b1b; }

.mh-note {
  font-size: 0.85rem;
  padding: 0.6rem 0.8rem;
  margin: 0.6rem 0;
  background: #f3f4f6;
  border-radius: 0.3rem;
  line-height: 1.5;
}

/* -------------------------
   Pre-flight checklist
-------------------------- */

.pf-checklist { display: flex; flex-direction: column; gap: 0.35rem; }

.pf-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.4rem;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 0.9rem;
  line-height: 1.45;
}

.pf-item:hover { background: #f0f4ff; }

.pf-item input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: #10b981;
  cursor: pointer;
}

.pf-item input[type="checkbox"]:checked + span {
  color: #6b7280;
  text-decoration: line-through;
}

.pf-section-done {
  border: 2px solid #10b981 !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

#pf-status-bar {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
#pf-status-label { font-weight: 400; font-size: 0.9rem; color: #6b7280; }
#pf-status-verdict { text-align: center; font-size: 0.95rem; margin-top: 0.4rem; }

/* -------------------------
   Mobile nav hamburger
-------------------------- */

.tb-nav-toggle {
  display: none;             /* hidden on desktop */
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}

.tb-nav-toggle::after {
  content: " ▼";
  font-size: 0.7rem;
  float: right;
  margin-top: 0.2rem;
}

.tb-nav-toggle.open::after {
  content: " ▲";
}

/* -------------------------
   Responsive tweaks
-------------------------- */

@media (max-width: 640px) {

  /* --- Header --- */
  .tb-header h1 { font-size: 1.25rem; }
  .tb-tagline { font-size: 0.8rem; }
  /* Shrink the Guides pill so it sits beside the banner on phones. */
  .tb-header-guides { font-size: 0.8rem; padding: 0.4rem 0.85rem; }
  .tb-header-banner { max-width: 60vw; }

  /* --- Nav: hamburger on mobile --- */
  .tb-nav-toggle { display: block; }

  .tb-nav {
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
    display: none;            /* collapsed by default */
    border-bottom: none;
    padding: 0;
  }

  .tb-nav.open { display: flex; }

  .tb-tab {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    text-align: left;
    border: 1px solid rgba(209, 213, 219, 0.5);
    margin-bottom: 0;
    background: rgba(249, 250, 251, 0.8);
    color: #374151;
  }

  .tb-tab-active {
    background: #2563eb;
    color: #f9fafb;
    border-color: #1d4ed8;
    border-bottom: 1px solid #1d4ed8;
    font-weight: 700;
  }

  /* Undo the first-card radius removal on mobile */
  .tb-nav + .tb-card,
  .tb-nav + section > .tb-card:first-child {
    border-top-left-radius: 0.85rem;
    border-top-right-radius: 0.85rem;
    border-top-color: rgba(148, 163, 184, 0.35);
  }

  /* --- Cards --- */
  .tb-card {
    padding: 1.1rem 1rem;
    border-radius: 0.85rem;
  }

  .tb-card h2 { font-size: 1.1rem; }

  /* --- Forms --- */
  .tb-field-row { flex-direction: column; }

  .tb-form-section:focus-within {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .tb-form label { font-size: 0.88rem; }

  .tb-form input,
  .tb-form select {
    font-size: 1rem;          /* prevents iOS zoom on focus */
    padding: 0.6rem 0.7rem;
  }

  .tb-button-primary {
    width: 100%;
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
  }

  /* --- Pre-flight checklist --- */
  .pf-item {
    padding: 0.7rem 0.6rem;
    font-size: 0.92rem;
    min-height: 44px;          /* Apple touch target guideline */
    align-items: center;
  }

  .pf-item input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
  }

  /* --- Tip boxes --- */
  .tb-tip-box { font-size: 0.83rem; padding: 0.65rem 0.8rem; }

  /* --- Tables --- */
  .tb-table { font-size: 0.78rem; }
  .tb-table th,
  .tb-table td { padding: 0.4rem 0.5rem; }

  /* --- Hero image --- */
  .tb-card img { max-width: 100%; }
}
/* -------------------------
   Weights quick guide table
-------------------------- */

.tb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0.75rem;
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-radius: 0.9rem;
  overflow: hidden;
  background: #ffffff;
}

.tb-table th,
.tb-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(229, 231, 235, 1);
}

.tb-table thead th {
  font-size: 0.85rem;
  font-weight: 900;
  color: #111827;
  background: rgba(243, 244, 246, 0.9);
}

.tb-table tbody th {
  font-weight: 800;
  color: #111827;
  width: 28%;
}

.tb-table tbody td:nth-child(2) {
  width: 18%;
  font-weight: 800;
  white-space: nowrap;
}

.tb-table tbody td:nth-child(3) {
  width: 54%;
  color: #374151;
}

.tb-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.tb-table tbody tr:nth-child(even) {
  background: rgba(243, 244, 246, 0.65);
}

.tb-table tbody tr:last-child th,
.tb-table tbody tr:last-child td {
  border-bottom: none;
}

/* Force Result summary sizing (override anything else) */
#towing-summary {
  font-size: 0.8rem !important;
  line-height: 1.35;
}

/* Rear-load gauge + commentary (STACKED) */
.tb-rear-load-wrapper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.tb-rear-gauge {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(229, 231, 235, 1);
  overflow: hidden;
  border: 1px solid rgba(209, 213, 219, 0.9);
}

.tb-rear-gauge-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.tb-rear-commentary-pill {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.25;
  border: 1px solid rgba(209, 213, 219, 0.9);
}

.tb-rear-commentary-pill--ghost {
  color: #6b7280;
  background: rgba(249, 250, 251, 0.9);
}

.tb-rear-commentary-pill--ok {
  color: #166534;
  background: #dcfce7;
  border-color: rgba(22, 101, 52, 0.25);
}

.tb-rear-commentary-pill--amber {
  color: #92400e;
  background: #fef3c7;
  border-color: rgba(146, 64, 14, 0.25);
}

.tb-rear-commentary-pill--red {
  color: #b91c1c;
  background: #fee2e2;
  border-color: rgba(185, 28, 28, 0.25);
}


/* Rear-load gauge: force a thin bar (no !important, just higher specificity) */
.tb-rear-load-wrapper .tb-rear-gauge {
  height: 10px;
  min-height: 10px;
  max-height: 10px;
  padding: 0;
  margin: 0;
  display: block;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(229, 231, 235, 1);
  border: 1px solid rgba(209, 213, 219, 0.9);
}

.tb-rear-load-wrapper .tb-rear-gauge-fill {
  height: 100%;
  width: 0%;
  display: block;
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* Touring mode – tidy radio options (prevents stretched labels / weird divider lines) */
.tb-radio-group {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.tb-radio-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border: 0;
  width: auto;
}

.tb-radio-option input[type="radio"] {
  margin: 0;
}

/* =========================================================
   FORMS (Touring + Towing): make interactions stable
   - No card "lift" inside forms (prevents pointer slip/jump)
   - No input "lift" on focus (removes micro-jitter)
   - No section highlight for radio steps
   ========================================================= */

/* 1) Form cards never move on hover */
.tb-form .tb-card:hover {
  transform: none;
}

/* 2) Focused fields never move */
.tb-form .tb-field input:focus,
.tb-form .tb-field select:focus {
  transform: none;
}

/* 3) Radio steps: no highlight at all */
.tb-form-section:focus-within:has(input[type="radio"]:focus),
.tb-form-section:focus-within:has(input[type="radio"]:checked) {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-color: transparent;
}
/* Input focus – stronger, premium (no jump, no helper highlight) */
.tb-field input:focus,
.tb-field select:focus {
  outline: none;
  border-color: #2563eb;
  background-color: #ffffff;
  transform: none;
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.35),
    0 18px 40px rgba(30, 64, 175, 0.18);
}

/* Cards that contain autocomplete dropdowns need an opaque
   background and no backdrop-filter. The blur(18px) on .tb-card
   creates a stacking context that makes content beneath the card
   bleed through absolutely-positioned dropdown lists.
   Apply .tb-card--has-dropdown to any card with a dropdown <ul>. */
.tb-card--has-dropdown {
  background: #ffffff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Weather snapshot: two-column grid that stacks to one column on phones */
.tb-weather-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}
@media (max-width: 540px) {
  .tb-weather-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Stable step highlight (towing-style)
   Paints the highlight — NO layout changes, NO jumping.
   ========================================================= */

.tb-form-section {
  position: relative;
  border-radius: 1rem; /* so the overlay matches your vibe */
}

/* Default: no overlay */
.tb-form-section::before {
  content: "";
  position: absolute;
  left: -14px;
  right: -14px;
  top: -12px;
  bottom: -12px;
  border-radius: 1.1rem;
  background: linear-gradient(
    135deg,
    rgba(219, 234, 254, 0.40),
    rgba(239, 246, 255, 0.92)
  );
  box-shadow: 0 10px 30px rgba(30, 64, 175, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 0;
}

/* Show overlay when anything inside the section is focused */
.tb-form-section:focus-within::before {
  opacity: 1;
}

/* Keep section content above the overlay */
.tb-form-section > * {
  position: relative;
  z-index: 1;
}

/* Briefing grid rows */
/* Spinner */
.tb-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  margin: 0 auto;
  animation: tb-spin 0.8s linear infinite;
}

@keyframes tb-spin {
  to { transform: rotate(360deg); }
}

.tb-error {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 0.4rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: #991b1b;
}

/* Reminder buttons */
.tb-reminder-btn {
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 0.5rem 1.1rem;
  border-radius: 0.4rem;
  font-family: 'Poppins', 'Nunito', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tb-reminder-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.tb-reminder-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tb-briefing-narrative {
  font-size: 1rem;
  font-weight: 600;
  color: #1e3a5f;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0.4rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.tb-briefing-row {
  display: grid;
  grid-template-columns: 1.5fr 1.3fr 1.2fr 0.8fr 0.7fr 0.8fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.85rem;
  align-items: center;
}

.tb-briefing-row--head {
  border-top: none;
  padding-top: 0;
  font-weight: 600;
  opacity: 0.7;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tb-briefing-col--day {
  font-weight: 600;
}

.tb-briefing-col--conditions {
  font-size: 0.85rem;
  line-height: 1.4;
}

.tb-weather-icon {
  font-size: 1.6rem;
  vertical-align: middle;
  margin-right: 0.15rem;
}

/* Value colour coding — inline pills in the grid */
.tb-val-green  { color: #059669; font-weight: 600; }
.tb-val-yellow { color: #b45309; font-weight: 600; }
.tb-val-amber  { color: #dc2626; font-weight: 700; }
.tb-val-red    { color: #991b1b; font-weight: 800; background: #fef2f2; border-radius: 0.3rem; padding: 0.1rem 0.35rem; }

/* Narrative box colour variants */
.tb-narrative-green  { background: #ecfdf5; border-left-color: #10b981; color: #065f46; }
.tb-narrative-yellow { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }
.tb-narrative-amber  { background: #fff7ed; border-left-color: #f97316; color: #9a3412; }
.tb-narrative-red    { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }

@media (max-width: 640px) {
  .tb-briefing-row {
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    padding: 12px 0;
  }

  .tb-briefing-row--head { display: none; }

  .tb-briefing-col--day {
    grid-column: 1 / -1;
    font-size: 0.95rem;
    margin-bottom: 2px;
  }

  .tb-briefing-col::before {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #6b7280;
    display: block;
  }
}
/* ===========================
   Trip Scorecard
=========================== */
.tb-scorecard {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 1rem;
}

.tb-score-ring {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 120px;
}

.tb-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.tb-score-ring-bg {
  fill: none;
  stroke: #e5e7eb;
  stroke-width: 8;
}

.tb-score-ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s ease-out, stroke 0.5s ease;
}

.tb-score-number {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  line-height: 1;
  color: #111827;
}

.tb-score-number small {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  margin-top: 0.2rem;
}

.tb-score-details {
  flex: 1;
  min-width: 0;
}

.tb-score-verdict {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: #111827;
}

.tb-score-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-score-factor {
  font-size: 0.82rem;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tb-score-factor-icon {
  font-size: 1rem;
}

.tb-score-factor-bar {
  width: 48px;
  height: 5px;
  border-radius: 3px;
  background: #e5e7eb;
  overflow: hidden;
}

.tb-score-factor-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease-out;
}

/* ===========================
   3-day Weather Timeline Strip
=========================== */
.tb-timeline {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.tb-timeline-day {
  flex: 1;
  text-align: center;
  padding: 1rem 0.5rem;
  border-right: 1px solid #f3f4f6;
  position: relative;
}

.tb-timeline-day:last-child {
  border-right: none;
}

.tb-timeline-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.tb-timeline-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.tb-timeline-temp {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #111827;
}

.tb-timeline-wind {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

.tb-timeline-rain {
  font-size: 0.75rem;
  color: #3b82f6;
  margin-top: 0.1rem;
}

/* ===========================
   Share Button
=========================== */
.tb-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 0.45rem 1rem;
  border-radius: 0.4rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.75rem;
}

.tb-share-btn:hover {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* ===========================
   Page transition fade-in
=========================== */
@keyframes tb-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tb-main {
  animation: tb-fade-in 0.35s ease-out;
}

/* ===========================
   Scorecard responsive
=========================== */
@media (max-width: 640px) {
  .tb-scorecard {
    flex-direction: column;
    text-align: center;
    padding: 1.2rem;
  }

  .tb-score-factors {
    justify-content: center;
  }

  .tb-timeline-icon {
    font-size: 1.5rem;
  }
}


/* ---- Chip toggles (Camps filter bar) ---- */

.tb-chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.tb-chip-toggle input {
  display: none;
}

.tb-chip-toggle:has(input:checked) {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.tb-chip-toggle:hover {
  border-color: #9ca3af;
}

/* ---- Camp card ---- */

.tb-camp-card {
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s;
}

.tb-camp-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tb-camp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.tb-camp-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.tb-camp-distance {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  white-space: nowrap;
}

.tb-camp-type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.tb-camp-type--doc       { background: #dbeafe; color: #1e40af; }
.tb-camp-type--freedom   { background: #d1fae5; color: #065f46; }
.tb-camp-type--holiday   { background: #fef3c7; color: #92400e; }
.tb-camp-type--basic     { background: #f3f4f6; color: #4b5563; }
.tb-camp-type--scenic    { background: #ede9fe; color: #5b21b6; }
.tb-camp-type--serviced  { background: #e0e7ff; color: #3730a3; }

.tb-camp-facilities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tb-camp-fac {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: #f3f4f6;
  color: #4b5563;
}

.tb-camp-fac--match {
  background: #d1fae5;
  color: #065f46;
}

.tb-camp-fee {
  font-size: 0.8rem;
  color: #059669;
  font-weight: 600;
  margin-top: 0.3rem;
}

.tb-camp-link {
  font-size: 0.8rem;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

.tb-camp-link:hover {
  text-decoration: underline;
}

/* Required-field indicator — the * next to a form label. */
.tb-required {
  color: #dc2626;
  font-weight: 700;
  margin-left: 0.15em;
}

/* "Open in Google Maps for turn-by-turn" button — the primary CTA
   after a user has settled on a trip / destination. Matches the
   brand teal-gradient pattern used elsewhere for affirmative CTAs. */
.tb-gmaps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  color: #ffffff !important;
  text-decoration: none !important;
  border-radius: 0.55rem;
  font-family: Nunito, system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.tb-gmaps-btn:hover,
.tb-gmaps-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  background: linear-gradient(135deg, #115e59 0%, #0f766e 100%);
  outline: none;
}

.tb-gmaps-btn-wrap {
  text-align: center;
  margin-top: 0.9rem;
}

/* ============================================================
   HELP PILL + POPOVER
   - Fixed top-right pill, one per page, keyed by data-help-key.
   - First-visit pulse dot controlled by localStorage
     (see help-popover.js). Dot disappears after first click.
   - Popover opens as a floating card on desktop, slides up as a
     bottom sheet on mobile (<600px).
============================================================ */

.tb-help-pill {
  position: fixed;
  top: 0.75rem;
  right: 1rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  background: #0f766e;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-family: Nunito, system-ui, -apple-system, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.tb-help-pill:hover,
.tb-help-pill:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.35);
  background: #115e59;
  outline: none;
}

.tb-help-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  background: #ffffff;
  color: #0f766e;
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.tb-help-pill-text {
  white-space: nowrap;
}

/* Pulse dot — only shown when the pill has .tb-help-pill--new
   (added by help-popover.js when localStorage says user hasn't
   seen this page's help yet). */
.tb-help-pulse {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  background: #f59e0b;
  border-radius: 50%;
  border: 2px solid #ffffff;
  pointer-events: none;
}

.tb-help-pill--new .tb-help-pulse {
  display: block;
  animation: tbHelpPulse 1.6s ease-out infinite;
}

@keyframes tbHelpPulse {
  0%   { box-shadow: 0 0 0 0    rgba(245, 158, 11, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);   }
  100% { box-shadow: 0 0 0 0    rgba(245, 158, 11, 0);   }
}

/* Backdrop — dims the page and catches click-to-close. */
.tb-help-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 100;
  animation: tbHelpFadeIn 0.15s ease-out;
}

@keyframes tbHelpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Popover card — desktop default. */
.tb-help-popover {
  position: fixed;
  top: 3.5rem;
  right: 1rem;
  z-index: 101;
  width: calc(100vw - 2rem);
  max-width: 420px;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 0.9rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);
  animation: tbHelpSlideDown 0.2s ease-out;
}

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

.tb-help-close {
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.12s, color 0.12s;
}

.tb-help-close:hover,
.tb-help-close:focus-visible {
  background: #f1f5f9;
  color: #0f172a;
  outline: none;
}

.tb-help-content {
  padding: 1.5rem 1.4rem 1.3rem;
  font-family: Nunito, system-ui, -apple-system, sans-serif;
  color: #1f2937;
}

.tb-help-content h2 {
  font-family: Poppins, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f766e;
  margin: 0 0 0.6rem;
  padding-right: 2rem;
}

.tb-help-content p {
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0.7rem 0;
  color: #374151;
}

.tb-help-content strong {
  color: #0f172a;
}

.tb-help-content a {
  color: #0f766e;
  font-weight: 600;
}

.tb-help-content ul {
  padding-left: 1.2rem;
  margin: 0.4rem 0 0.6rem;
}

.tb-help-content li {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.35rem;
  color: #374151;
}

/* Callout for a single flagship feature on each page (e.g. Loop). */
.tb-help-highlight {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 0.55rem;
}

.tb-help-highlight h3 {
  font-family: Poppins, sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 0.35rem;
}

.tb-help-highlight p {
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
  color: #78350f;
}

.tb-help-tips-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1rem 0 0.35rem;
}

/* On viewports up to 900px the header banner (1200x240, capped at
   max-width: 720px) stretches near the right edge of the viewport,
   AND the .tb-nav sits right below the banner -- so there's no
   room for the pill either over the banner or under it. Solution:
   carve out a 2.75rem strip ABOVE the header using body padding-top,
   and park the pill fixed at top-right inside that strip. Pill stays
   position: fixed so it's still accessible after scrolling. */
@media (max-width: 900px) {
  /* :has() selector scopes this to bodies with a pill only, so
     splash / terms / unsubscribe pages don't gain a dead gap at
     the top where no pill sits. */
  body.tb-body:has(.tb-help-pill) {
    padding-top: 2.75rem;
  }
  .tb-help-pill {
    top: 0.5rem;
    right: 0.5rem;
  }
}

/* Mobile: smaller pill. Popover drops down from just under the pill
   (earlier bottom-sheet pattern was disconnected from where the
   user clicked). Pill top/right set by the 900px rule above. */
@media (max-width: 600px) {
  .tb-help-pill {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
  }

  .tb-help-popover {
    top: 3rem;                      /* just below the pill strip */
    right: 0.5rem;
    left: 0.5rem;
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 4rem);
    border-radius: 0.9rem;
  }
}
