/* Schengen 90/180 Day Calculator (/schengen-calculator/, generated by scripts/build-schengen.mjs).
   Builds on site.css tokens, the shared tool components (.bm-section, .bvr-calc, .bvr-field, .bvr-result, .bvr-headline,
   .bm-stats, .bvr-cards, .col-select, .col-note, .col-disclaimer, .card, .btn, .hc-related) and the form controls of
   css/jet-lag-calculator.css (.jl-input, .jl-select, .jl-error, .jl-actions, .jl-submit, .jl-intro, .jl-tips, .jl-next).
   No inline styles anywhere (CSP): js/schengen-calculator.js sizes the bars through the CSSOM. */

.sc-page { --sc-over: #f0715f; }

/* ---------- Trips form ---------- */
.sc-trips { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.sc-trip { padding: 16px 18px 18px; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
.sc-trip__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sc-trip__n { font-size: 16px; font-weight: 800; }
.sc-trip__days { flex: 1; color: var(--lime); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-trip__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.sc-trip .jl-input, .sc-trip .col-select { background-color: var(--card); }
button.sc-remove, button.sc-ghost {
  min-height: 40px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
button.sc-remove:hover, button.sc-ghost:hover { color: var(--ink); border-color: rgba(234, 242, 230, 0.35); }
button.sc-remove:focus-visible, button.sc-ghost:focus-visible, button.sc-add:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
button.sc-ghost[data-armed="true"] { color: var(--sc-over); border-color: var(--sc-over); }
.sc-tools { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 14px; }
button.sc-add {
  min-height: 46px; padding: 10px 20px; font: inherit; font-size: 15.5px; font-weight: 800; color: var(--lime);
  background: transparent; border: 1px dashed rgba(198, 239, 60, 0.6); border-radius: 999px; cursor: pointer;
}
button.sc-add:hover { background: rgba(198, 239, 60, 0.08); }
button.sc-add:disabled { opacity: .45; cursor: not-allowed; }
.sc-check { max-width: 340px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.sc-check small { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.sc-saved { margin: 14px 0 0; font-size: 13.5px; }

/* ---------- Summary ---------- */
.sc-result[data-tone="ok"] { border-inline-start-color: var(--lime); }
.sc-result[data-tone="ok"] .bvr-headline { color: var(--lime); }
.sc-result[data-tone="warn"] { border-inline-start-color: var(--amber); }
.sc-result[data-tone="warn"] .bvr-headline { color: var(--amber); }
.sc-result[data-tone="over"] { border-inline-start-color: var(--sc-over); }
.sc-result[data-tone="over"] .bvr-headline { color: var(--sc-over); }
.sc-meter { position: relative; height: 12px; margin-top: 16px; overflow: hidden; background: rgba(234, 242, 230, 0.08); border-radius: 999px; direction: ltr; }
.sc-meter i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--lime); border-radius: 999px; transition: width .2s ease; }
.sc-meter[data-tone="warn"] i { background: var(--amber); }
.sc-meter[data-tone="over"] i { background: var(--sc-over); }
.sc-meter__scale { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; direction: ltr; }
.sc-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- 180-day timeline: always left-to-right, oldest day first ---------- */
.sc-window { margin-top: 26px; }
.sc-window h3, .sc-breakdown h3.sc-breakdown__title { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
.sc-track { position: relative; height: 30px; overflow: hidden; background-color: rgba(234, 242, 230, 0.05); border: 1px solid var(--line); border-radius: 8px; direction: ltr; }
.sc-bar { position: absolute; top: 0; bottom: 0; min-width: 2px; background: var(--lime); }
.sc-axis { position: relative; height: 18px; margin-top: 5px; color: var(--muted); font-size: 11.5px; direction: ltr; }
.sc-axis span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.sc-axis span[data-edge="start"] { transform: none; }
.sc-axis span[data-edge="end"] { transform: translateX(-100%); }
.sc-window .col-note, .sc-breakdown .col-note { font-size: 13.5px; }

/* ---------- Trip by trip ---------- */
.sc-breakdown { margin-top: 26px; }
.sc-rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sc-row { padding: 16px 20px; background: var(--card); border: 1px solid var(--line); border-inline-start: 4px solid var(--lime); border-radius: 18px; }
.sc-row[data-when="planned"] { border-inline-start-color: rgba(198, 239, 60, 0.5); }
.sc-row[data-status="over"] { border-inline-start-color: var(--sc-over); }
.sc-row__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; }
.sc-row__head h3 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.3; }
.sc-row__days { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sc-row__dates { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.sc-row__note { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; }
.sc-row[data-status="over"] .sc-row__note { color: var(--sc-over); }

/* ---------- Countries ---------- */
.sc-countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin: 0 0 14px; padding: 0; list-style: none; font-size: 15.5px; }
.sc-countries li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.sc-area > p { max-width: 760px; margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.6; }

@media (max-width: 900px) {
  .sc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sc-trip { padding: 14px; }
  .sc-trip__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .sc-field--country { grid-column: 1 / -1; }
  .sc-check { max-width: none; }
  .sc-row { padding: 14px 16px; }
}
@media (max-width: 480px) {
  /* Two date fields side by side cut off the year on a phone: one field per line. */
  .sc-trip__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .sc-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .sc-meter i { transition: none; }
}
