/* Jet Lag Calculator (/jet-lag-calculator/, generated by scripts/build-jet-lag.mjs).
   Builds on site.css tokens and the shared tool components (.bm-section, .bvr-calc, .bvr-grid, .bvr-field, .bvr-result,
   .bvr-headline, .bm-stats, .bvr-cards, .col-select, .col-note, .col-disclaimer, .card, .btn, .hc-related).
   No inline styles anywhere (CSP): js/jet-lag-calculator.js places the timeline blocks through the CSSOM. */

.jl-page [hidden] { display: none !important; }
.jl-intro p { max-width: 760px; margin: 0 0 14px; color: var(--muted); font-size: 16.5px; line-height: 1.65; }
.jl-intro p:last-child { margin-bottom: 0; }

/* ---------- Form ---------- */
.jl-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.jl-group + .jl-group { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.jl-group legend { padding: 0; margin-bottom: 14px; font-size: 17px; font-weight: 800; }
.jl-input {
  width: 100%; min-height: 50px; box-sizing: border-box; padding: 13px 14px; font: inherit; font-size: 16px; font-weight: 700;
  color: var(--ink); background-color: var(--bg); border: 1px solid var(--line); border-radius: 14px;
  font-variant-numeric: tabular-nums; color-scheme: dark;
}
.jl-input:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-color: var(--lime); }
.jl-input[aria-invalid="true"], .jl-select .col-select[aria-invalid="true"] { border-color: var(--amber); }
.jl-input::placeholder { color: var(--muted); font-weight: 600; }
.jl-select { position: relative; }
.jl-select::after { content: ""; position: absolute; inset-inline-end: 18px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--lime); border-bottom: 2px solid var(--lime); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.jl-select .col-select { border-color: var(--line); border-radius: 14px; }
.jl-zone { margin-top: 10px; }

.jl-label { margin-bottom: 7px; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .9px; text-transform: uppercase; }
.bvr-field label.jl-switch { display: inline-flex; justify-content: flex-start; align-items: center; gap: 12px; min-height: 50px; margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; cursor: pointer; }
.jl-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.jl-switch__track { position: relative; flex: none; width: 52px; height: 30px; background: var(--bg); border: 1px solid rgba(234, 242, 230, 0.28); border-radius: 999px; transition: background-color .15s ease, border-color .15s ease; }
.jl-switch__track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; background: var(--muted); border-radius: 50%; transition: transform .15s ease, background-color .15s ease; }
.jl-switch input:checked + .jl-switch__track { background: var(--lime); border-color: var(--lime); }
.jl-switch input:checked + .jl-switch__track::after { background: var(--on-lime); transform: translateX(22px); }
[dir="rtl"] .jl-switch input:checked + .jl-switch__track::after { transform: translateX(-22px); }
.jl-switch input:focus-visible + .jl-switch__track { outline: 2px solid var(--lime); outline-offset: 2px; }

.jl-error { display: grid; gap: 4px; margin: 20px 0 0; padding: 14px 18px; color: var(--ink); font-size: 15px; line-height: 1.5; background: rgba(221, 164, 60, 0.10); border: 1px solid rgba(221, 164, 60, 0.55); border-radius: 14px; }
.jl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 22px; }
button.jl-submit { min-width: 180px; padding: 15px 30px; font-size: 16.5px; }
.jl-actions .col-note { margin: 0; font-size: 13.5px; }

/* ---------- Summary ---------- */
.jl-result[data-tone="ok"] { border-inline-start-color: var(--lime); }
.jl-result[data-tone="ok"] .bvr-headline { color: var(--lime); }
.jl-result[data-tone="shift"] { border-inline-start-color: var(--amber); }
.jl-result[data-tone="shift"] .bvr-headline { color: var(--amber); }
.jl-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Day-by-day plan ---------- */
.jl-plan { margin-top: 26px; }
.jl-plan h3.jl-plan__title { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
.jl-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.jl-legend span { display: inline-flex; align-items: center; gap: 7px; }
.jl-key { display: inline-block; flex: none; width: 14px; height: 10px; border-radius: 3px; }
.jl-key--sleep { background: rgba(147, 165, 150, 0.42); }
.jl-key--seek { background: var(--lime); }
.jl-key--avoid { background: var(--amber); }
.jl-key--flight { height: 4px; background: var(--ink); }
.jl-key--mel { width: 10px; background: var(--ink); border-radius: 50%; }

.jl-days { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.jl-day { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--muted); border-radius: 18px; }
.jl-day[data-phase="travel"], .jl-day[data-phase="arrival"] { border-inline-start-color: var(--amber); }
.jl-day[data-phase="after"] { border-inline-start-color: rgba(198, 239, 60, 0.55); }
.jl-day[data-phase="done"] { border-inline-start-color: var(--lime); }
.jl-day__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.jl-day__head h3 { margin: 0; font-size: 17.5px; font-weight: 800; line-height: 1.3; }
.jl-day__date { color: var(--muted); font-size: 14px; font-weight: 700; }
.jl-day__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 0 0 14px; }
.jl-day__list dt { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.jl-day__list dd { margin: 3px 0 0; font-size: 16px; font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
.jl-item--seek dd { color: var(--lime); }
.jl-item--avoid dd { color: var(--amber); }
.jl-item--mel { grid-column: span 2; }

/* Timeline: always left-to-right, from one wake-up to the next */
.jl-track { position: relative; height: 34px; border-radius: 7px; overflow: hidden; background-color: rgba(234, 242, 230, 0.05); direction: ltr; }
.jl-bar { position: absolute; }
.jl-bar--sleep { top: 8px; bottom: 0; background: rgba(147, 165, 150, 0.42); border-radius: 5px; }
.jl-bar--seek, .jl-bar--avoid { z-index: 1; bottom: 0; height: 12px; border-radius: 4px; }
.jl-bar--seek { background: var(--lime); }
.jl-bar--avoid { background: var(--amber); }
.jl-bar--flight { z-index: 2; top: 0; height: 4px; background: var(--ink); border-radius: 2px; }
.jl-dot { position: absolute; z-index: 3; top: 9px; width: 10px; height: 10px; margin-left: -5px; background: var(--ink); border: 2px solid var(--card); border-radius: 50%; box-sizing: content-box; }
.jl-axis { position: relative; height: 18px; margin-top: 5px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; direction: ltr; }
.jl-axis span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.jl-axis span[data-edge="start"] { transform: none; }
.jl-axis span[data-edge="end"] { transform: translateX(-100%); }
.jl-day__meta { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.jl-day__note { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; }
.jl-plan .col-note { font-size: 13.5px; }

/* ---------- Tips, closing block, disclaimer ---------- */
.jl-tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.jl-tips .card { padding: 22px; }
.jl-next > p { max-width: 720px; margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.jl-disclaimer { margin-bottom: 56px; }

@media (max-width: 900px) {
  .jl-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .jl-grid--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; align-items: end; }
  .jl-grid--pair .jl-field--place { grid-column: 1 / -1; }
  .jl-input { padding-inline: 10px; }
  .jl-day { padding: 16px; }
  .jl-day__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jl-tips { grid-template-columns: minmax(0, 1fr); }
  button.jl-submit { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .jl-switch__track, .jl-switch__track::after { transition: none; }
}
