:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #050b15;
  --panel: #0d1a2d;
  --panel-raised: #12223a;
  --panel-soft: #0a1627;
  --line: #223652;
  --line-soft: rgba(130, 162, 207, 0.16);
  --text: #edf3fc;
  --text-soft: #c3d0e4;
  --muted: #879bb9;
  --blue: #5d91ff;
  --blue-strong: #3f7af5;
  --cyan: #56d3e8;
  --green: #3bd69b;
  --green-soft: rgba(59, 214, 155, 0.13);
  --amber: #f8b84e;
  --amber-soft: rgba(248, 184, 78, 0.13);
  --red: #ff7182;
  --red-soft: rgba(255, 113, 130, 0.13);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Lo smooth si attiva da JS alla prima interazione: all'arrivo con un hash la
   pagina deve posizionarsi subito, altrimenti l'animazione parte sulla
   posizione provvisoria e resta in volo quando arrivano i dati. */
html.js-smooth {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(ellipse 70% 42% at 78% -8%, rgba(51, 108, 207, 0.26), transparent 66%),
    radial-gradient(ellipse 46% 30% at 8% 18%, rgba(38, 185, 199, 0.09), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

::selection {
  background: rgba(93, 145, 255, 0.36);
  color: #fff;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #8ce4f2;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.7rem, 3.2vw, 2.55rem);
}

h3 {
  font-size: 1.15rem;
}

:focus-visible {
  outline: 3px solid rgba(86, 211, 232, 0.85);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 750;
  transform: translateY(-150%);
  transition: transform 0.18s ease;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(130, 162, 207, 0.12);
  background: rgba(7, 17, 31, 0.78);
  backdrop-filter: blur(18px) saturate(150%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: min(1180px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 7px 22px rgba(63, 122, 245, 0.26);
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 820;
  letter-spacing: -0.04em;
}

.brand-text span {
  color: var(--blue);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.main-nav .nav-info {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-info {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.header-info:hover {
  border-color: var(--blue);
  color: var(--text);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--text-soft);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
  align-items: center;
  gap: clamp(36px, 6vw, 78px);
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 78px 0 40px;
}

.eyebrow,
.kicker {
  margin-bottom: 18px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(59, 214, 155, 0.5);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(59, 214, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 214, 155, 0); }
}

.hero h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(2.9rem, 6.2vw, 5.15rem);
  font-weight: 840;
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(100deg, #8fb7ff 0%, #56d3e8 62%, #85f2cd 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-lead {
  max-width: 610px;
  margin-bottom: 30px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.6vw, 1.13rem);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 21px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 760;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(120deg, var(--blue-strong), #3576f8);
  color: #fff;
  box-shadow: 0 12px 30px rgba(63, 122, 245, 0.3);
}

.button-primary:hover {
  color: #fff;
  box-shadow: 0 15px 36px rgba(63, 122, 245, 0.4);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.button-ghost:hover {
  border-color: rgba(134, 174, 236, 0.48);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.sync-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.78rem;
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.sync-line.is-error .sync-dot {
  background: var(--red);
}

.status-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(112, 157, 224, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(28, 58, 100, 0.74), rgba(11, 25, 45, 0.92) 64%),
    var(--panel);
  box-shadow: var(--shadow);
}

.status-card::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(86, 211, 232, 0.18), transparent 66%);
  pointer-events: none;
}

.status-card::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 105px;
  height: 105px;
  opacity: 0.06;
  background:
    linear-gradient(90deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%);
  transform: rotate(18deg);
  pointer-events: none;
}

.status-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.status-source {
  color: var(--text-soft);
  letter-spacing: 0;
  text-align: right;
  text-transform: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-open {
  color: var(--green);
  background: var(--green-soft);
}

.status-closed {
  color: var(--red);
  background: var(--red-soft);
}

.status-pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-unknown {
  color: var(--muted);
  background: rgba(135, 155, 185, 0.1);
}

.status-main {
  min-height: 158px;
}

.status-main h2 {
  margin: 18px 0 8px;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
}

.status-main p {
  max-width: 390px;
  margin-bottom: 22px;
  color: var(--text-soft);
  font-size: 0.91rem;
}

.status-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(151, 183, 229, 0.18);
  color: var(--muted);
  font-size: 0.78rem;
}

.status-window strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: -0.03em;
}

.status-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 720;
  text-decoration: none;
}

.status-link::after {
  content: "→";
  transition: transform 0.16s ease;
}

.status-link:hover::after {
  transform: translateX(3px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(1180px, calc(100% - 40px));
  margin: 22px auto 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(13, 26, 45, 0.58);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.12);
}

.stat {
  min-width: 0;
  padding: 20px 24px;
}

.stat + .stat {
  border-left: 1px solid var(--line-soft);
}

.stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  overflow: hidden;
  margin-bottom: 3px;
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-note {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  width: min(1180px, calc(100% - 40px));
  margin: 24px auto 0;
  padding: 15px 18px;
  border: 1px solid rgba(255, 113, 130, 0.38);
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  color: var(--text-soft);
  font-size: 0.86rem;
}

.error-banner strong {
  color: var(--red);
}

.error-banner a {
  color: var(--text);
}

.section {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 62px 0 14px;
  scroll-margin-top: 86px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 26px;
}

.section-head .kicker {
  margin-bottom: 10px;
}

.section-lead {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.source-chip,
.count-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.source-chip:hover {
  border-color: rgba(93, 145, 255, 0.65);
  color: var(--text);
}

.source-chip span:last-child {
  color: var(--muted);
}

.night-grid,
.services-grid,
.notice-grid,
.timetable-grid,
.sources-grid,
.calendar-grid {
  display: grid;
  gap: 16px;
}

.night-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.night-card {
  --accent: var(--muted);
  --accent-soft: rgba(135, 155, 185, 0.1);
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(19, 37, 62, 0.8), rgba(10, 22, 39, 0.82));
}

.night-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
}

.night-card.is-open {
  --accent: var(--green);
  --accent-soft: var(--green-soft);
}

.night-card.is-closed {
  --accent: var(--red);
  --accent-soft: var(--red-soft);
}

.night-card.is-pending {
  --accent: var(--amber);
  --accent-soft: var(--amber-soft);
}

.night-card.is-current {
  border-color: color-mix(in srgb, var(--accent) 53%, transparent);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.night-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 19px;
}

.night-date {
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.night-day {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 8px;
}

.night-day strong {
  font-size: 2.25rem;
  font-weight: 820;
  letter-spacing: -0.065em;
  line-height: 1;
}

.night-day span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: capitalize;
}

.night-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.night-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.night-window {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.73rem;
}

.night-window strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.77rem;
  font-weight: 600;
}

.night-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.7rem;
  text-decoration: none;
}

.night-source:hover {
  color: var(--cyan);
}

.callout {
  display: flex;
  gap: 13px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(248, 184, 78, 0.26);
  border-radius: var(--radius-sm);
  background: rgba(248, 184, 78, 0.06);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.callout strong {
  color: var(--amber);
}

.callout-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  margin-top: 1px;
  border: 1px solid rgba(248, 184, 78, 0.45);
  border-radius: 50%;
  color: var(--amber);
  font-size: 0.75rem;
  font-weight: 850;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.74rem;
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--muted);
}

.legend-dot.status-aparta { background: var(--green); }
.legend-dot.status-chiusa { background: var(--red); }
.legend-dot.status-notturna { background: var(--amber); }
.legend-note { margin-left: auto; color: #687e9f; }

.calendar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.month-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(11, 23, 40, 0.78);
}

.month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--line-soft);
}

.month-head h3 {
  margin: 0;
  font-size: 1rem;
  text-transform: capitalize;
}

.month-head a {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-decoration: none;
}

.month-head a:hover {
  color: var(--cyan);
}

.month-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.month-table th {
  padding: 9px 2px 7px;
  color: #6f84a3;
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.month-table td {
  padding: 3px;
}

.cal-empty {
  pointer-events: none;
}

.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-height: 53px;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.cal-day:hover {
  z-index: 1;
  border-color: rgba(147, 183, 240, 0.35);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.cal-num {
  font-size: 0.77rem;
  font-weight: 730;
  line-height: 1;
}

.cal-status {
  font-size: 0.53rem;
  font-weight: 760;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.cal-day.status-aparta {
  border-color: rgba(59, 214, 155, 0.16);
  background: rgba(59, 214, 155, 0.08);
  color: var(--green);
}

.cal-day.status-chiusa {
  border-color: rgba(255, 113, 130, 0.17);
  background: rgba(255, 113, 130, 0.08);
  color: var(--red);
}

.cal-day.status-notturna {
  border-color: rgba(248, 184, 78, 0.18);
  background: rgba(248, 184, 78, 0.08);
  color: var(--amber);
}

.cal-day.status-non-definita {
  color: var(--muted);
}

.cal-day.is-today::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
}

.cal-day.is-current {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: -2px;
}

.small-note {
  max-width: 900px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.65;
}

.services-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-alert {
  margin: 0 0 16px;
}

.service-alert p {
  margin: 4px 0 8px;
  color: var(--text-soft);
}

.service-alert a {
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
}

.service-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(17, 36, 61, 0.86), rgba(9, 20, 36, 0.9));
}

.service-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 170px;
  height: 100px;
  border-radius: 50%;
  border: 1px solid rgba(86, 211, 232, 0.14);
  transform: rotate(-18deg);
  pointer-events: none;
}

.service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.service-kind {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(86, 211, 232, 0.09);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.service-times-label {
  color: var(--muted);
  font-size: 0.68rem;
}

.service-route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 17px;
  font-size: 1.15rem;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.service-route .arrow {
  color: var(--cyan);
  font-weight: 400;
}

.time-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.time-chip {
  padding: 4px 8px;
  border: 1px solid rgba(86, 211, 232, 0.16);
  border-radius: 6px;
  background: rgba(86, 211, 232, 0.06);
  color: #dffaff;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.service-note {
  margin-bottom: 15px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.source-row a {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 650;
  text-decoration: none;
}

.source-row a:hover {
  color: var(--cyan);
}

.notice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(360px, 100%);
  min-height: 43px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 19, 34, 0.72);
}

.search-field:focus-within {
  border-color: rgba(93, 145, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(93, 145, 255, 0.12);
}

.search-field svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
}

.search-field input::placeholder {
  color: #667c9c;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 720;
  cursor: pointer;
}

.filter:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
}

.filter.is-active {
  border-color: rgba(93, 145, 255, 0.25);
  background: rgba(93, 145, 255, 0.12);
  color: #c9dcff;
}

.notice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notice-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(11, 24, 42, 0.74);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.notice-card:hover {
  border-color: rgba(112, 157, 224, 0.35);
  background: rgba(15, 31, 53, 0.82);
  transform: translateY(-2px);
}

.notice-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(93, 145, 255, 0.1);
  color: #a8c6ff;
  font-size: 0.62rem;
  font-weight: 770;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.notice-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.68rem;
}

.notice-card h3 {
  margin-bottom: 9px;
  font-size: 1.06rem;
  line-height: 1.3;
}

.notice-summary {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  color: #8198b8;
  font-size: 0.62rem;
  font-weight: 650;
}

.notice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.notice-actions a,
.notice-actions button {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 680;
  text-decoration: none;
}

.notice-actions button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.notice-actions a:hover,
.notice-actions button:hover {
  color: var(--cyan);
}

.count-chip {
  color: var(--muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: center;
}

.empty-state strong {
  color: var(--text-soft);
}

.timetable-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timetable-card {
  display: flex;
  flex-direction: column;
  padding: 21px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(11, 24, 42, 0.74);
}

.timetable-card h3 {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.timetable-meta {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.72rem;
}

.pdf-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 14px;
  border: 1px solid rgba(93, 145, 255, 0.25);
  border-radius: 9px;
  background: rgba(93, 145, 255, 0.08);
  color: #c7daff;
  font-size: 0.77rem;
  font-weight: 720;
  text-decoration: none;
}

.pdf-button:hover {
  border-color: rgba(93, 145, 255, 0.5);
  color: #fff;
}

.pdf-button span:last-child {
  color: var(--muted);
}

.sources-section {
  padding-bottom: 28px;
}

.sources-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-card {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(11, 24, 42, 0.6);
}

.source-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.source-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}

.source-card a {
  font-size: 0.69rem;
  font-weight: 650;
  word-break: break-word;
}

.site-footer {
  margin-top: 54px;
  border-top: 1px solid var(--line-soft);
  background: rgba(5, 12, 22, 0.58);
}

.footer-inner,
.footer-bottom {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  padding: 34px 0 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.footer-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.footer-brand strong {
  font-size: 0.9rem;
}

.footer-brand span,
.footer-meta span {
  color: var(--muted);
  font-size: 0.66rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links a {
  color: var(--text-soft);
  font-size: 0.68rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--cyan);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0 22px;
  border-top: 1px solid var(--line-soft);
  color: #657a99;
  font-size: 0.62rem;
}

.detail-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: min(85vh, 900px);
  margin: auto;
  padding: 0;
  border: 1px solid rgba(112, 157, 224, 0.3);
  border-radius: 20px;
  background: #0b182b;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.detail-dialog::backdrop {
  background: rgba(2, 7, 15, 0.76);
  backdrop-filter: blur(4px);
}

.detail-dialog form {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(7, 17, 31, 0.8);
  cursor: pointer;
}

.dialog-close:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.dialog-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-soft);
  stroke-linecap: round;
  stroke-width: 2;
}

.dialog-content {
  overflow-y: auto;
  max-height: min(85vh, 900px);
  padding: clamp(24px, 5vw, 42px);
}

.dialog-content h2 {
  padding-right: 40px;
  margin-bottom: 13px;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 0.72rem;
}

.dialog-section {
  margin-top: 22px;
  padding-top: 19px;
  border-top: 1px solid var(--line-soft);
}

.dialog-section h3 {
  margin-bottom: 9px;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 780;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dialog-section p {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 0.87rem;
  line-height: 1.72;
  white-space: pre-line;
}

.dialog-section ul {
  margin: 0;
  padding-left: 19px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.dialog-window {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.dialog-source {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  padding: 11px 15px;
  border: 1px solid rgba(93, 145, 255, 0.3);
  border-radius: 9px;
  background: rgba(93, 145, 255, 0.08);
  color: #c9dcff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.dialog-source:hover {
  border-color: rgba(93, 145, 255, 0.6);
  color: #fff;
}

.skeleton-card,
.skeleton-calendar {
  min-height: 170px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.015) 20%, rgba(255, 255, 255, 0.055) 36%, rgba(255, 255, 255, 0.015) 52%),
    rgba(11, 24, 42, 0.6);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}

.skeleton-calendar {
  min-height: 330px;
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

.noscript {
  position: fixed;
  right: 15px;
  bottom: 15px;
  left: 15px;
  z-index: 200;
  padding: 15px;
  border: 1px solid var(--amber);
  border-radius: 10px;
  background: #1b1609;
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
}

.info-page .page-hero {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0 22px;
}

.info-page .page-hero h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
}

.info-page .page-hero p {
  max-width: 680px;
  color: var(--text-soft);
  font-size: 1.05rem;
}

.info-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 44px;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.info-content section {
  padding: 29px 0;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 86px;
}

.info-content section:first-child {
  border-top: 0;
  padding-top: 0;
}

.info-content h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
}

.info-content h3 {
  margin-top: 22px;
  font-size: 1rem;
}

.info-content p,
.info-content li {
  color: var(--text-soft);
  font-size: 0.91rem;
  line-height: 1.75;
}

.info-content ul {
  padding-left: 21px;
}

.info-content li + li {
  margin-top: 6px;
}

.info-content a {
  word-break: break-word;
}

.info-content code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(93, 145, 255, 0.1);
  color: #b9d1ff;
  font-family: var(--mono);
  font-size: 0.88em;
}

.info-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgba(11, 24, 42, 0.58);
}

.info-toc strong {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.info-toc a {
  display: block;
  padding: 4px 0;
  color: var(--text-soft);
  font-size: 0.76rem;
  text-decoration: none;
}

.info-toc a:hover {
  color: var(--cyan);
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.info-card {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.info-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.info-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.info-note {
  margin-top: 20px;
  padding: 15px 17px;
  border: 1px solid rgba(248, 184, 78, 0.24);
  border-radius: 10px;
  background: rgba(248, 184, 78, 0.055);
  color: var(--text-soft);
  font-size: 0.81rem;
}

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 58px;
  }

  .status-card {
    width: min(600px, 100%);
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .footer-links {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
  }
}

@media (max-width: 820px) {
  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #0a1729;
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 11px 12px;
  }

  .menu-toggle {
    display: block;
  }

  .stats,
  .night-grid,
  .services-grid,
  .notice-grid,
  .timetable-grid,
  .sources-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    gap: 0;
  }

  .stat + .stat {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .notice-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .info-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .info-toc {
    position: static;
    order: -1;
  }
}

@media (max-width: 640px) {
  .section,
  .info-content section {
    scroll-margin-top: 78px;
  }

  .header-inner {
    width: calc(100% - 28px);
    min-height: 62px;
  }

  .header-info {
    display: none;
  }

  .info-page .header-info {
    display: inline-flex;
  }

  .main-nav .nav-info {
    display: block;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 9px 9px;
  }

  .hero,
  .stats,
  .section,
  .error-banner,
  .footer-inner,
  .footer-bottom,
  .info-page .page-hero,
  .info-layout {
    width: calc(100% - 28px);
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 12vw, 3.7rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .status-card {
    padding: 20px;
  }

  .status-main {
    min-height: 0;
  }

  .section {
    padding-top: 48px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .cal-day {
    min-height: 49px;
  }

  .cal-status {
    font-size: 0.5rem;
  }

  .legend-note {
    width: 100%;
    margin-left: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .footer-meta {
    text-align: left;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .dialog-content {
    padding: 26px 20px;
  }
}

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

@media print {
  .site-header,
  .hero-actions,
  .status-link,
  .notice-toolbar,
  .site-footer,
  .detail-dialog,
  .button {
    display: none !important;
  }

  body {
    background: #fff;
    color: #111;
  }

  .hero,
  .section,
  .stats {
    width: 100%;
  }

  .status-card,
  .night-card,
  .month-card,
  .service-card,
  .notice-card,
  .timetable-card {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
    color: #111;
  }
}
