/* Szlaban24 — plain, useful layout (design/web-proposal by Codex).
 * Blue = brand and links, red only for trains and a lowered barrier.
 * No green for "no train": a gap in the data is never shown as safe. */
@font-face { font-family: Manrope; src: url(/fonts/manrope-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/manrope-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Manrope; src: url(/fonts/manrope-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --brand: #1554d1;
  --brand-dark: #0e3e9f;
  --brand-soft: #edf3ff;
  --on-brand: #ffffff;
  --signal: #b42318;
  --signal-dark: #861c13;
  --signal-soft: #fff0ee;
  --on-signal-soft: #71180f;
  --ink: #172036;
  --muted: #596174;
  --line: #d8dee9;
  --control: #7b8497;
  --surface: #ffffff;
  --subtle: #f5f7fa;
  --focus: #ffbf47;
  --content: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8bb0ff;
    --brand-dark: #b3ccff;
    --brand-soft: #18264a;
    --on-brand: #0b1220;
    --signal: #ff8a7e;
    --signal-dark: #ffb4ac;
    --signal-soft: #3a1a1a;
    --on-signal-soft: #ffd2cc;
    --ink: #eef2f8;
    --muted: #a7b1c4;
    --line: #2a3650;
    --control: #8592ab;
    --surface: #0f1726;
    --subtle: #0b1220;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 500 1rem/1.55 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--brand-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); font-weight: 800; letter-spacing: -.03em; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.08; }
h2 { margin-bottom: 8px; font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.2; }
h3 { margin-bottom: 6px; font-size: 1.1rem; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.container { width: min(100% - 32px, var(--content)); margin-inline: auto; }
.narrow { max-width: 780px; }

.skip-link {
  position: fixed; z-index: 100; top: 8px; left: 8px; min-height: 44px; padding: 10px 16px;
  transform: translateY(-140%); background: var(--ink); color: var(--surface); font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand {
  min-height: 44px; display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-size: 1.1rem; font-weight: 800; text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a {
  min-height: 44px; display: inline-flex; align-items: center;
  color: var(--ink); font-weight: 700; text-decoration: none;
}
.main-nav a:hover { text-decoration: underline; }

/* Home: search */
.search-section { padding: clamp(36px, 7vw, 72px) 0 44px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.search-intro { margin-bottom: 24px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.2rem); }
.crossing-search label { display: block; margin-bottom: 8px; font-weight: 700; }
.search-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-controls input {
  width: 100%; min-height: 56px; border: 2px solid var(--control); border-radius: 8px;
  background: var(--surface); color: var(--ink); padding: 0 16px; font-size: 1.05rem;
}
.search-controls input::placeholder { color: var(--muted); opacity: 1; }
.btn {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--brand); border-radius: 8px; background: var(--brand); color: var(--on-brand);
  padding: 0 24px; font-weight: 800; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--brand-dark); background: var(--brand-dark); color: var(--on-brand); }
.search-status { margin: 14px 0 0; color: var(--muted); font-size: .94rem; }
.search-status:empty { display: none; }
.results { margin: 10px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); background: var(--surface); }
.results:empty { display: none; }
.results li { border-bottom: 1px solid var(--line); }
.results a {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; color: var(--ink); text-decoration: none; font-weight: 700;
}
.results a:hover, .results a:focus-visible { background: var(--brand-soft); }
.results small { color: var(--muted); font-weight: 500; white-space: nowrap; }
.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; margin: 14px 0 0; color: var(--muted); font-size: .94rem; }
.recent[hidden] { display: none; }
.recent a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }

/* Sections and lists */
.content-section { padding: 48px 0 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.section-heading p { margin-bottom: 0; color: var(--muted); }
.text-link { min-height: 44px; display: inline-flex; align-items: center; flex: none; font-weight: 700; }

.rows { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.rows li { border-bottom: 1px solid var(--line); }
.row {
  min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 16px;
  padding: 12px 8px; color: var(--ink); text-decoration: none;
}
.row:hover { background: var(--subtle); color: var(--ink); }
.row strong { display: block; font-size: 1.05rem; font-weight: 800; }
.row .place { color: var(--muted); font-size: .9rem; }
.row .count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.row-arrow { color: var(--brand); font-size: 1.6rem; line-height: 1; }

.app-section { padding: 36px 0; border-block: 1px solid var(--line); background: var(--brand-soft); }
.app-row { display: grid; grid-template-columns: 1.5fr 1fr; align-items: center; gap: 48px; }
.app-row p { max-width: 700px; margin-bottom: 0; }
.store-status { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.store-status li {
  min-height: 56px; display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--control); border-radius: 8px; background: var(--surface);
  padding: 8px 14px; font-weight: 800; line-height: 1.2;
}
.store-status small { color: var(--muted); font-weight: 500; }

.az { margin-top: 20px; }
.az h3 { margin: 0 0 4px; color: var(--brand-dark); }
.az p { margin: 0; line-height: 2.2; color: var(--muted); }
.az a { white-space: nowrap; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0 36px; color: var(--muted); font-size: .88rem; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: var(--muted); }

/* Crossing page */
.crossing-page { background: var(--subtle); }
.forecast { border-bottom: 1px solid var(--line); background: var(--surface); padding: 12px 0 28px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin-bottom: 6px; color: var(--muted); font-size: .88rem; }
.breadcrumbs a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); }
.forecast h1 { margin-bottom: 2px; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.forecast .sub { margin-bottom: 0; color: var(--muted); }

.barrier-report {
  min-height: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 20px 0 0;
  border-left: 4px solid var(--control); background: var(--subtle); padding: 10px 14px;
}
.barrier-report.is-down { border-left-color: var(--signal); background: var(--signal-soft); color: var(--on-signal-soft); }
.barrier-report.is-down::before { content: ""; width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--signal); }

.forecast-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .9fr); gap: 40px; padding-top: 24px; }
.forecast-label { margin-bottom: 4px; color: var(--muted); font-weight: 700; }
.forecast-time { margin-bottom: 10px; font-size: clamp(2.2rem, 7vw, 4rem); font-weight: 800; letter-spacing: -.05em; line-height: 1.05; }
.forecast-time .soon { color: var(--signal); }
.forecast-time time { display: block; margin-top: 6px; color: var(--ink); font-size: .45em; letter-spacing: -.02em; }
.train-route { margin-bottom: 4px; font-size: 1.08rem; font-weight: 700; }
.train-number {
  display: inline-block; margin-right: 8px; border-radius: 4px; background: var(--brand); color: var(--on-brand);
  padding: 2px 8px; font-size: .86rem; font-weight: 800;
}
.source { margin-bottom: 0; color: var(--muted); font-weight: 700; font-size: .94rem; }
.forecast-summary { margin: 0; border-left: 1px solid var(--line); padding-left: 28px; }
.forecast-summary div + div { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.forecast-summary dt { margin-bottom: 4px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.forecast-summary dd { margin: 0; }
.forecast-summary dd strong { display: block; font-size: 1.25rem; }

.crossing-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .7fr); gap: 28px; padding-top: 28px; padding-bottom: 48px; }
.crossing-main, .crossing-aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.box { border: 1px solid var(--line); background: var(--surface); padding: 22px; }
.box > :last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
caption { text-align: left; }
th, td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .8rem; font-weight: 700; }
td.t { font-size: 1.05rem; font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
td .num { font-weight: 800; white-space: nowrap; }
td .close { display: block; color: var(--signal); font-weight: 700; font-size: .88rem; }
.updated { margin: 12px 0 0; color: var(--muted); font-size: .88rem; }

.notice { border-left: 4px solid var(--control); }
.notice p { margin-bottom: 8px; }
.report-box { border-top: 4px solid var(--signal); }
.report-box p { margin-bottom: 12px; }

.facts { margin: 0 0 8px; }
.facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.facts dd { margin: 2px 0 0; }

.nearby ul { margin: 0; padding: 0; list-style: none; }
.nearby li + li { border-top: 1px solid var(--line); }
.nearby a {
  min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--ink); font-weight: 700; text-decoration: none;
}
.nearby a:hover { color: var(--brand-dark); text-decoration: underline; }
.nearby small { color: var(--muted); font-weight: 500; white-space: nowrap; }

/* Policy / 404 */
.doc { max-width: 760px; padding: 28px 0 40px; }
.doc h2 { font-size: 1.3rem; margin: 28px 0 8px; }
.doc li { margin: 4px 0; }

/* Consent banner (js/analytics.js) */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 20; max-width: 560px; margin: 0 auto;
  background: var(--surface); color: var(--ink); border: 1px solid var(--control); border-radius: 8px;
  padding: 14px 16px; box-shadow: 0 6px 24px rgba(11, 27, 58, .14);
}
.consent p { margin: 0 0 10px; font-size: .95rem; }
.consent div { display: flex; flex-wrap: wrap; gap: 8px; }
.consent button {
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 2px solid var(--brand); font-weight: 800;
  background: var(--brand); color: var(--on-brand); cursor: pointer;
}
.consent button.ghost { background: var(--surface); color: var(--ink); border-color: var(--control); }

@media (max-width: 820px) {
  .app-row, .forecast-grid, .crossing-layout { grid-template-columns: 1fr; }
  .app-row, .forecast-grid, .crossing-layout { gap: 24px; }
  .forecast-summary { border-top: 1px solid var(--line); border-left: 0; padding-top: 20px; padding-left: 0; }
}
@media (max-width: 560px) {
  .container { width: min(100% - 32px, var(--content)); }
  .main-nav a.opt { display: none; }
  .search-controls { grid-template-columns: 1fr; }
  .search-controls .btn { min-height: 52px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .row { grid-template-columns: minmax(0, 1fr) 20px; gap: 8px; }
  .row .count { grid-column: 1; grid-row: 2; }
  .row-arrow { grid-column: 2; grid-row: 1 / span 2; }
  .store-status { grid-template-columns: 1fr; }
  .box { padding: 18px; }
  th, td { padding: 10px 6px; }
}
@media print {
  .skip-link, .main-nav, .consent { display: none; }
  .crossing-page { background: #fff; }
  .crossing-layout { grid-template-columns: 1fr; }
}
