/* WideMath Schengen 90/180 calculator and days-in-a-country counter (2026-10-13).
   Loaded only on /schengen-calculator/, after wm-tools.css. Every selector is
   scoped to .wm-sg (the print rules use body:has(.wm-sg) for the page chrome). */

.wm-sg .wm-card + .wm-card { margin-top: 14px; }
.wm-sg .wm-sg-top { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: center; margin-top: 10px; }
.wm-sg .wm-sg-top .wm-tabs { margin-bottom: 12px; }
.wm-sg .wm-tabs button { min-height: 40px; }
.wm-sg .wm-sg-notice { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 12px; padding: 10px 12px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: .9rem; color: #78350f; }
.wm-sg h2.wm-sg-h { font-size: 1.15rem; font-weight: 700; margin: 0 0 4px; padding: 0; border: 0; color: var(--wm-ink); letter-spacing: -0.01em; }
.wm-sg .wm-sg-sub { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; color: var(--wm-mute); }
.wm-sg .wm-sg-small { margin: 10px 0 0; font-size: .82rem; color: var(--wm-mute); }
.wm-sg .wm-sg-flash { color: var(--wm-green); font-weight: 600; }
.wm-sg .wm-btn { min-height: 40px; font-size: .86rem; }
.wm-sg .wm-field { font: 1rem 'Segoe UI', system-ui, sans-serif; min-height: 44px; padding: 8px 10px; }
.wm-sg input[type="date"].wm-field { display: block; width: 100%; background: #fff; }
.wm-sg .wm-sg-vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- trip rows: stacked on phones, one line from 720px ------------------ */
.wm-sg .wm-sg-list { list-style: none; margin: 0; padding: 0; }
.wm-sg .wm-sg-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "n x" "a b" "l d" "s s";
  gap: 6px 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--wm-line); margin: 0; }
.wm-sg .wm-sg-crow { grid-template-areas: "n x" "c c" "a b" "d d" "s s"; }
.wm-sg .wm-sg-row:first-child { border-top: 0; padding-top: 4px; }
.wm-sg .wm-sg-num { grid-area: n; align-self: center; font-weight: 700; font-size: .86rem; color: var(--wm-ink); }
.wm-sg .wm-sg-fa { grid-area: a; }
.wm-sg .wm-sg-fb { grid-area: b; }
.wm-sg .wm-sg-fl { grid-area: l; }
.wm-sg .wm-sg-fc { grid-area: c; }
.wm-sg .wm-sg-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: .8rem; font-weight: 600; color: var(--wm-text); }
.wm-sg .wm-sg-days { grid-area: d; align-self: center; font-size: .92rem; font-weight: 600; color: var(--wm-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.wm-sg .wm-sg-del { grid-area: x; justify-self: end; align-self: center; width: 40px; height: 40px; padding: 0; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: #94a3b8; font-size: 22px; line-height: 1; cursor: pointer; }
.wm-sg .wm-sg-del:hover { color: var(--wm-err); background: var(--wm-err-bg); }
.wm-sg .wm-sg-del:focus-visible { outline: 2px solid var(--wm-green-2); outline-offset: 1px; }
.wm-sg .wm-sg-st { grid-area: s; font-size: .82rem; color: var(--wm-mute); }
.wm-sg .wm-sg-st:empty { display: none; }
.wm-sg .wm-sg-st.bad { color: var(--wm-err); font-weight: 600; }
.wm-sg .wm-sg-cols { display: none; }
.wm-sg .wm-sg-empty { padding: 12px 0; color: var(--wm-mute); font-size: .92rem; }
.wm-sg .wm-sg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.wm-sg .wm-sg-actions .sp { flex: 1; }
@media (min-width: 720px) {
  .wm-sg .wm-sg-cols { display: grid; padding: 0 0 4px; font-size: .78rem; font-weight: 600; color: var(--wm-mute); }
  .wm-sg .wm-sg-row, .wm-sg .wm-sg-cols { grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr) 96px 40px;
    grid-template-areas: "n a b l d x" ". s s s s s"; align-items: center; column-gap: 10px; row-gap: 2px; }
  .wm-sg .wm-sg-crow, .wm-sg .wm-sg-ccols { grid-template-columns: 58px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 96px 40px;
    grid-template-areas: "n c a b d x" ". s s s s s"; }
  .wm-sg .wm-sg-row { padding: 5px 0; border-top: 0; }
  .wm-sg .wm-sg-row:first-child { padding-top: 0; }
  /* the header row names the columns, so the per-row captions are for screen readers only */
  .wm-sg .wm-sg-f > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- check a date --------------------------------------------------------- */
.wm-sg .wm-row > label { flex: 0 1 230px; }
.wm-sg .wm-sg-verdict { margin-top: 14px; padding: 10px 14px; border-radius: 10px; font-size: 1rem; line-height: 1.45; }
.wm-sg .wm-sg-verdict.ok { background: var(--wm-green-bg); border: 1px solid var(--wm-green-line); color: #14532d; }
.wm-sg .wm-sg-verdict.bad { background: var(--wm-err-bg); border: 1px solid #fecaca; color: var(--wm-err); }
.wm-sg .wm-sg-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.wm-sg .wm-sg-until { margin: 12px 0 0; font-size: .98rem; line-height: 1.55; color: var(--wm-text); }
.wm-sg .wm-sg-warn { margin: 10px 0 0; padding: 8px 12px; border-left: 3px solid var(--wm-err); border-radius: 0 8px 8px 0; background: var(--wm-err-bg);
  color: #7f1d1d; font-size: .92rem; line-height: 1.5; }

/* the 180-day window as a strip */
.wm-sg .wm-sg-tl { margin-top: 16px; }
.wm-sg .wm-sg-tl-m { position: relative; height: 18px; overflow: hidden; font-size: .74rem; color: var(--wm-mute); }
.wm-sg .wm-sg-tl-m span { position: absolute; top: 0; padding-left: 3px; border-left: 1px solid #cbd5e1; line-height: 18px; white-space: nowrap; }
.wm-sg .wm-sg-tl-bar { position: relative; height: 28px; background: var(--wm-soft); border: 1px solid var(--wm-line); border-radius: 6px; overflow: hidden; }
.wm-sg .wm-sg-tl-bar i { position: absolute; top: 0; bottom: 0; background: var(--wm-green-2); }
.wm-sg .wm-sg-tl-bar i.over { background: #dc2626; }
.wm-sg .wm-sg-tl-e { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: .78rem; color: var(--wm-mute); }
.wm-sg .wm-sg-key { margin: 4px 0 0; font-size: .78rem; color: var(--wm-mute); }
.wm-sg .wm-sg-key i { display: inline-block; width: 12px; height: 12px; margin: 0 4px 0 10px; border-radius: 3px; background: var(--wm-green-2); vertical-align: -1px; }
.wm-sg .wm-sg-key i:first-child { margin-left: 0; }
.wm-sg .wm-sg-key i.over { background: #dc2626; }

/* working and buttons under a result */
.wm-sg .wm-sg-steps { margin-top: 12px; }
.wm-sg .wm-steps .m { font: .95rem/1.55 'Segoe UI', system-ui, sans-serif; color: var(--wm-text); }
.wm-sg .wm-sg-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---- plan ------------------------------------------------------------------ */
.wm-sg .wm-sg-seg { margin: 6px 0 12px; }
.wm-sg .wm-seg button { min-height: 40px; padding: 0 12px; font-size: .82rem; letter-spacing: 0; }
.wm-sg .wm-result b { font-weight: 700; }
.wm-sg .wm-sg-unit { font: .95rem 'Segoe UI', system-ui, sans-serif; color: var(--wm-mute); }
.wm-sg .wm-result.wm-sg-no { background: var(--wm-err-bg); border-color: #fecaca; }
@media (max-width: 520px) {
  .wm-sg .wm-sg-seg { display: flex; width: 100%; }
  .wm-sg .wm-sg-seg button { flex: 1 1 0; padding: 6px 4px; line-height: 1.2; white-space: normal; }
  .wm-sg .wm-row > label { flex: 1 1 140px; }
  .wm-sg .wm-result { font-size: 1.15rem; }
}

/* ---- days in a country -------------------------------------------------------- */
.wm-sg .wm-sg-mode { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 12px; font-size: .86rem; font-weight: 600; color: var(--wm-text); }
.wm-sg .wm-sg-mode .wm-sg-seg { margin: 0; }
.wm-sg .wm-sg-ct th { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.wm-sg .wm-sg-ct td { vertical-align: middle; }
.wm-sg .wm-sg-ct td.n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.wm-sg .wm-sg-ct th:nth-child(2) { text-align: right; }
.wm-sg .wm-sg-bar { position: relative; display: block; min-width: 90px; height: 12px; background: var(--wm-soft); border: 1px solid var(--wm-line); border-radius: 4px; }
.wm-sg .wm-sg-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--wm-green-2); border-radius: 3px 0 0 3px; }
.wm-sg .wm-sg-bar em { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--wm-ink); }
.wm-sg .wm-sg-tag { margin-left: 4px; padding: 1px 6px; border: 1px solid var(--wm-green-line); border-radius: 999px; background: var(--wm-green-bg);
  color: var(--wm-green); font-size: .7rem; font-weight: 600; white-space: nowrap; }
.wm-sg .wm-sg-tax { margin-top: 14px; }

@media (max-width: 860px) { .wm-sg .wm-card { padding: 14px 12px; } }

/* ---- print: the trips and results only ----------------------------------------- */
@media print {
  body:has(.wm-sg) .nav, body:has(.wm-sg) .breadcrumb, body:has(.wm-sg) .wm-examples, body:has(.wm-sg) .content,
  body:has(.wm-sg) footer, body:has(.wm-sg) ins.adsbygoogle { display: none !important; }
  .wm-sg .wm-sg-actions, .wm-sg .wm-sg-del, .wm-sg .wm-sg-tools, .wm-sg .wm-tabs, .wm-sg .wm-sg-seg, .wm-sg .wm-sg-notice,
  .wm-sg .wm-sg-small, .wm-sg .wm-sg-ctl .wm-btn { display: none !important; }
  .wm-sg .wm-card { box-shadow: none; break-inside: avoid; }
  .wm-sg .wm-sg-tl-bar i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
