:root {
  --navy: #071a2f;
  --navy-2: #0d2b47;
  --green: #079447;
  --green-bright: #14b85d;
  --red: #d6423b;
  --cream: #f5f2e9;
  --paper: #fffefa;
  --ink: #102033;
  --muted: #627081;
  --line: #d9e1e8;
  --shadow: 0 24px 70px rgba(5, 24, 43, .13);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, "SF Pro Display", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 3px solid #f2b84b;
  outline-offset: 3px;
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  min-height: 84px;
  margin: 0 auto;
  padding: 14px 34px;
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
}

.brand-mark svg { width: 30px; fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.2; }
.brand strong { display: block; font-size: 1.16rem; letter-spacing: .03em; }
.brand small { display: block; color: rgba(255,255,255,.65); font-size: .68rem; letter-spacing: .08em; }

.header-nav { display: flex; align-items: center; gap: 34px; }
.header-nav a,
.home-link { color: rgba(255,255,255,.78); font-size: .9rem; text-decoration: none; transition: color .2s ease; }
.header-nav a:hover,
.home-link:hover { color: #fff; }
.home-link { padding: 9px 16px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; }

body::before {
  content: "";
  position: absolute;
  z-index: -2;
  top: 0;
  left: 0;
  width: 100%;
  height: 690px;
  background: var(--navy);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(480px, 1.1fr);
  align-items: center;
  max-width: 1280px;
  min-height: 478px;
  margin: 0 auto;
  padding: 35px 34px 100px;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 51%;
  width: 1px;
  height: 300px;
  background: linear-gradient(transparent, rgba(255,255,255,.16), transparent);
}

.hero-content { position: relative; z-index: 3; max-width: 600px; }
.eyebrow,
.section-kicker { margin: 0 0 15px; color: var(--green-bright); font-size: .72rem; font-weight: 800; letter-spacing: .21em; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 30px; height: 2px; background: var(--green-bright); }
.hero h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2.7rem, 5.3vw, 5.35rem); font-weight: 500; line-height: 1.04; letter-spacing: -.045em; }
.hero h1 em { color: #fff; font-style: normal; }
.hero h1 em::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 12px; border-radius: 50%; background: var(--red); vertical-align: .12em; }
.hero-copy { max-width: 560px; margin: 26px 0 22px; color: rgba(255,255,255,.67); font-size: 1.05rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: 20px; color: rgba(255,255,255,.82); font-size: .84rem; }
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row b { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgba(20,184,93,.18); color: #3fdd83; font-size: .72rem; }

.hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .22; }
.hero-glow-one { top: -90px; left: -170px; width: 390px; height: 390px; background: #0fb362; }
.hero-glow-two { right: -190px; bottom: 10px; width: 430px; height: 330px; background: #206baa; }

.rail-scene { position: relative; z-index: 2; height: 360px; overflow: hidden; }
.sun-disc { position: absolute; top: 14px; right: 20%; width: 192px; height: 192px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #f8c876, #d97a3c 70%, transparent 71%); opacity: .88; box-shadow: 0 0 80px rgba(237,146,69,.23); }
.city { position: absolute; right: 0; bottom: 38px; left: 0; height: 130px; opacity: .32; }
.city::before { content: ""; position: absolute; right: 9%; bottom: 0; width: 66%; height: 100%; background: linear-gradient(90deg, transparent 0 4%, #36516a 4% 10%, transparent 10% 13%, #36516a 13% 23%, transparent 23% 27%, #36516a 27% 33%, transparent 33% 38%, #36516a 38% 51%, transparent 51% 55%, #36516a 55% 63%, transparent 63% 67%, #36516a 67% 81%, transparent 81%); clip-path: polygon(0 100%,0 60%,7% 60%,7% 25%,9% 25%,9% 58%,18% 58%,18% 41%,24% 41%,24% 69%,31% 69%,31% 17%,39% 17%,39% 62%,47% 62%,47% 45%,56% 45%,56% 64%,65% 64%,65% 32%,75% 32%,75% 57%,84% 57%,84% 42%,92% 42%,92% 75%,100% 75%,100% 100%); }
.city-back { transform: translateY(-23px) scale(.9); opacity: .17; }
.hero-train { position: absolute; right: -4%; bottom: 4px; width: 108%; filter: drop-shadow(0 18px 14px rgba(0,0,0,.32)); }
.hero-train .track { stroke: #627b91; stroke-width: 5; }
.hero-train .train-body { stroke: #fff; stroke-width: 1; }
.hero-train .train-nose { fill: #e6edf3; }
.hero-train .train-band { fill: var(--green); }
.hero-train .windows { fill: #173957; }
.hero-train .wheels circle:first-child,
.hero-train .wheels circle:nth-child(3) { fill: #101923; stroke: #8795a2; stroke-width: 3; }
.hero-train .wheels circle:nth-child(2),
.hero-train .wheels circle:nth-child(4) { fill: #697987; }

.search-wrap { position: relative; z-index: 5; max-width: 1280px; margin: -76px auto 0; padding: 0 34px; }
.search-card { padding: 28px 30px 30px; border: 1px solid rgba(7,26,47,.08); border-radius: 24px; background: rgba(255,254,250,.98); box-shadow: var(--shadow); }
.search-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.search-card h2 { margin: 2px 0 0; font-size: 1.45rem; line-height: 1.2; }
.search-card .section-kicker { margin-bottom: 5px; }
.official-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; }
.official-note i { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 4px rgba(20,184,93,.12); }

.route-fields { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr); align-items: start; gap: 12px; }
.trip-fields { display: grid; grid-template-columns: 1.1fr .85fr .72fr 1.15fr; align-items: start; gap: 12px; margin-top: 14px; }
.field { min-width: 0; }
.field label { display: block; margin: 0 0 7px 4px; color: #435163; font-size: .75rem; font-weight: 800; letter-spacing: .04em; }
.input-shell { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 16px; border: 1px solid #d5dde4; border-radius: 13px; background: #f9fbfc; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.input-shell:focus-within { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(7,148,71,.09); }
.input-shell svg { flex: 0 0 auto; width: 21px; height: 21px; fill: none; stroke: var(--green); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.input-shell input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.input-shell input::placeholder { color: #9aa5b0; }
.input-shell input[type="date"],
.input-shell input[type="time"] { min-height: 38px; }
.field-error { min-height: 16px; margin: 4px 4px 0; color: #bd2626; font-size: .72rem; }
.field.has-error .input-shell { border-color: #cc3838; box-shadow: 0 0 0 3px rgba(204,56,56,.08); }
.swap-button { align-self: start; display: grid; place-items: center; width: 42px; height: 42px; margin-top: 27px; border: 1px solid #d8e1e7; border-radius: 50%; background: #fff; color: var(--green); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.swap-button:hover { background: #eff8f2; transform: rotate(180deg); }
.swap-button svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.search-button { align-self: start; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; margin-top: 27px; border: 0; border-radius: 13px; background: var(--green); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 12px 25px rgba(7,148,71,.22); transition: transform .2s ease, background .2s ease, box-shadow .2s ease; }
.search-button:hover { background: #057f3e; transform: translateY(-2px); box-shadow: 0 16px 30px rgba(7,148,71,.26); }
.search-button svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }

.operator-picker { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.operator-picker.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.operator-picker-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(3,18,33,.72); cursor: pointer; backdrop-filter: blur(5px); }
.operator-picker-panel { position: relative; width: min(520px, 100%); padding: 30px; border: 1px solid rgba(255,255,255,.7); border-radius: 24px; outline: 0; background: var(--paper); box-shadow: 0 28px 90px rgba(0,0,0,.35); transform: translateY(18px) scale(.98); transition: transform .22s ease; }
.operator-picker.is-open .operator-picker-panel { transform: translateY(0) scale(1); }
.operator-picker-panel .section-kicker { margin-bottom: 7px; }
.operator-picker-panel h2 { margin: 0; font: 500 clamp(1.8rem, 5vw, 2.45rem)/1.12 Georgia, "Noto Serif SC", serif; letter-spacing: -.035em; }
.operator-picker-lead { margin: 12px 42px 0 0; color: var(--muted); }
.operator-picker-route { margin: 20px 0; padding: 14px 16px; border: 1px solid #d6e2df; border-radius: 13px; background: #eff7f2; color: #204333; font-weight: 800; }
.operator-picker-close { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d6dee4; border-radius: 50%; background: #fff; color: #405064; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.operator-actions { display: grid; gap: 8px; }
.operator-button { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 66px; padding: 10px 17px; border-radius: 14px; color: #fff; text-decoration: none; transition: transform .2s ease, filter .2s ease; }
.operator-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
.operator-button span { font-weight: 800; }
.operator-button small { display: block; font-size: .62rem; font-weight: 500; opacity: .72; }
.operator-button b { font-size: .78rem; white-space: nowrap; }
.operator-button.trenitalia { background: linear-gradient(135deg, #186a46, #25845e); }
.operator-button.italo { background: linear-gradient(135deg, #5f2031, #a9293e); }
.operator-picker-status { min-height: 20px; margin: 12px 2px 0; color: #a22635; font-size: .8rem; font-weight: 700; }
.results-disclaimer { margin: 10px 2px 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }
body.picker-open { overflow: hidden; }

.section { max-width: 1280px; margin: 0 auto; padding: 92px 34px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-heading h2,
.guide-intro h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; line-height: 1.15; letter-spacing: -.035em; }
.section-heading .section-kicker { margin-bottom: 8px; }
.section-heading > p { max-width: 340px; margin: 0 0 5px; color: var(--muted); text-align: right; }

.route-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #bac6cd; border-left: 1px solid #bac6cd; }
.route-card { position: relative; min-height: 145px; padding: 28px 25px; overflow: hidden; border: 0; border-right: 1px solid #bac6cd; border-bottom: 1px solid #bac6cd; background: transparent; color: var(--ink); text-align: left; cursor: pointer; transition: background .22s ease, color .22s ease, transform .22s ease; }
.route-card::after { content: "↗"; position: absolute; right: 22px; top: 22px; width: 28px; height: 28px; border: 1px solid rgba(16,32,51,.28); border-radius: 50%; text-align: center; line-height: 26px; transition: background .22s ease, color .22s ease; }
.route-card:hover { z-index: 2; background: var(--navy); color: #fff; transform: translateY(-4px); box-shadow: 0 18px 35px rgba(7,26,47,.18); }
.route-card:hover::after { border-color: var(--green-bright); background: var(--green-bright); }
.route-number { display: block; margin-bottom: 18px; color: var(--green); font-size: .68rem; font-weight: 900; letter-spacing: .18em; }
.route-card:hover .route-number { color: #4ce38f; }
.route-card strong { display: block; font-size: 1.18rem; }
.route-card strong i { margin: 0 5px; color: var(--red); font-style: normal; }
.route-card small { display: block; margin-top: 8px; color: var(--muted); font-size: .72rem; }
.route-card:hover small { color: rgba(255,255,255,.6); }

.guide-section { display: grid; grid-template-columns: .72fr 1.28fr; gap: 80px; max-width: 1280px; margin: 92px auto 0; padding: 70px 54px; border-radius: 28px; background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.section-kicker.light { color: #49dd8e; }
.guide-intro p { max-width: 430px; margin: 20px 0 0; color: rgba(255,255,255,.63); }
.steps { display: grid; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 48px 1fr; gap: 18px; padding: 23px 0; border-top: 1px solid rgba(255,255,255,.14); }
.steps li:last-child { border-bottom: 1px solid rgba(255,255,255,.14); }
.steps li > span { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #4ce38f; font: 700 1rem Georgia, serif; }
.steps strong { font-size: 1rem; }
.steps p { margin: 4px 0 0; color: rgba(255,255,255,.58); font-size: .85rem; }

.compare-section { padding-top: 96px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare-card { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 24px; padding: 28px; border: 1px solid #cbd5db; border-radius: 18px; background: rgba(255,255,255,.48); }
.operator-logo { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 19px; color: #fff; font-weight: 900; }
.operator-logo.fs { background: linear-gradient(135deg, #16784d, #2b936c); }
.operator-logo.ntv { background: linear-gradient(135deg, #5d1c2e, #bd3245); }
.operator-logo.ntv span { font-size: .82rem; letter-spacing: .08em; }
.compare-card h3 { margin: 0; font-size: 1.2rem; }
.compare-card p { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
.compare-card > a { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 94px; padding: 12px; border-left: 1px solid #ccd5db; color: var(--green); font-size: .78rem; font-weight: 800; text-decoration: none; }
.compare-card > a span { font-size: 1.3rem; }

.faq-section { padding-bottom: 100px; }
.faq-list { border-top: 1px solid #b9c5cc; }
.faq-list details { border-bottom: 1px solid #b9c5cc; }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 5px; font-weight: 800; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #b9c5cc; border-radius: 50%; color: var(--green); font-size: 1.2rem; transition: transform .2s ease; }
.faq-list details[open] summary span { transform: rotate(45deg); }
.faq-list details p { max-width: 780px; margin: -4px 0 23px 5px; color: var(--muted); }

footer { display: grid; grid-template-columns: 1fr auto; gap: 28px; padding: 46px max(34px, calc((100% - 1212px) / 2)); background: #061525; color: #fff; }
footer strong { font-size: 1.1rem; }
footer p { margin: 6px 0 0; color: rgba(255,255,255,.55); font-size: .8rem; }
.footer-links { display: flex; align-items: center; gap: 24px; }
.footer-links a { color: rgba(255,255,255,.72); font-size: .82rem; text-decoration: none; }
.legal { grid-column: 1 / -1; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); }

@media (max-width: 1020px) {
  .header-nav { display: none; }
  .hero { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: clamp(2.8rem, 6vw, 4.2rem); }
  .rail-scene { height: 300px; }
  .trip-fields { grid-template-columns: 1fr 1fr 1fr; }
  .search-button { grid-column: 1 / -1; margin-top: 2px; }
  .route-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .guide-section { gap: 45px; margin-right: 34px; margin-left: 34px; padding: 60px 40px; }
  .compare-card { grid-template-columns: 68px 1fr; }
  .operator-logo { width: 64px; height: 64px; }
  .compare-card > a { grid-column: 1 / -1; flex-direction: row; gap: 8px; min-height: 42px; border-top: 1px solid #ccd5db; border-left: 0; }
}

@media (max-width: 760px) {
  body::before { height: 780px; }
  .site-header { min-height: 72px; padding: 12px 20px; }
  .home-link { padding: 7px 12px; font-size: .78rem; }
  .brand-mark { width: 40px; height: 40px; }
  .hero { display: block; min-height: 590px; padding: 42px 20px 100px; text-align: center; }
  .hero::before { display: none; }
  .hero-content { margin: 0 auto; }
  .eyebrow { justify-content: center; }
  .hero h1 { font-size: clamp(2.7rem, 12vw, 4.2rem); }
  .hero-copy { margin: 20px auto; font-size: .95rem; }
  .trust-row { justify-content: center; }
  .rail-scene { height: 236px; margin: 10px -20px 0; }
  .sun-disc { top: 5px; right: 27%; width: 130px; height: 130px; }
  .hero-train { right: -12%; bottom: -4px; width: 125%; }
  .search-wrap { margin-top: -70px; padding: 0 16px; }
  .search-card { padding: 23px 18px; border-radius: 20px; }
  .search-card-head { display: block; }
  .official-note { margin-top: 10px; }
  .route-fields { grid-template-columns: 1fr 48px; }
  .route-fields .field-station:first-child { grid-column: 1; }
  .swap-button { grid-column: 2; grid-row: 1 / 3; align-self: center; margin-top: 0; transform: rotate(90deg); }
  .swap-button:hover { transform: rotate(270deg); }
  .route-fields .field-station:last-child { grid-column: 1; }
  .trip-fields { grid-template-columns: 1fr 1fr; }
  .trip-fields .field:nth-child(3) { grid-column: 1 / -1; }
  .input-shell { min-height: 54px; }
  .section { padding: 74px 20px 0; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; text-align: left; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 126px; }
  .guide-section { grid-template-columns: 1fr; gap: 28px; margin: 74px 16px 0; padding: 42px 24px; border-radius: 23px; }
  .compare-grid { grid-template-columns: 1fr; }
  .faq-section { padding-bottom: 74px; }
  footer { grid-template-columns: 1fr; padding: 40px 20px; }
  .legal { grid-column: 1; }
}

@media (max-width: 520px) {
  .brand small { display: none; }
  .hero h1 em::after { width: 7px; height: 7px; }
  .trust-row { gap: 12px; }
  .trust-row span { font-size: .76rem; }
  .rail-scene { height: 205px; }
  .trip-fields { grid-template-columns: 1fr; }
  .trip-fields .field:nth-child(3),
  .search-button { grid-column: 1; }
  .operator-picker { align-items: end; padding: 0; }
  .operator-picker-panel { width: 100%; max-height: 92vh; padding: 27px 18px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 24px 24px 0 0; transform: translateY(100%); }
  .operator-picker.is-open .operator-picker-panel { transform: translateY(0); }
  .operator-picker-close { top: 15px; right: 15px; }
  .operator-picker-lead { margin-right: 38px; }
  .operator-button { min-height: 62px; }
  .section-heading h2,
  .guide-intro h2 { font-size: 2rem; }
  .compare-card { grid-template-columns: 56px 1fr; gap: 16px; padding: 21px 18px; }
  .operator-logo { width: 54px; height: 54px; border-radius: 15px; }
  .faq-list summary { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-header, .hero, .search-wrap, .operator-picker, .route-grid, .guide-section, footer { display: none !important; }
}
