:root {
  --green-deep: #0c3b2e;
  --green: #1a5c45;
  --green-soft: #e7f2ed;
  --red: #b42318;
  --red-deep: #8a1a12;
  --red-soft: #f8e8e6;
  --snow: #f7faf8;
  --ink: #14201c;
  --muted: #5a6b64;
  --line: #d5e0db;
  --card: #e8f3ed;
  --shadow: 0 8px 24px rgba(12, 59, 46, 0.12);
  --radius: 12px;
  --font-display: "Amatic SC", "Segoe UI", sans-serif;
  --font-ui: "Outfit", "Segoe UI", sans-serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;
  --ease: 160ms ease;
  --bg-green: #146b48;
  --bg-green-mid: #1e7a54;
  --bg-red: #b01f1a;
  --bg-red-mid: #9a2218;
  --flake-green: #3d9a72;
  --flake-red: #d45a52;
  --on-bg: #f4f8f5;
  --on-bg-muted: rgba(244, 248, 245, 0.78);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(720px 480px at 0% 0%, rgba(176, 31, 26, 0.72), transparent 55%),
    radial-gradient(820px 520px at 100% -5%, rgba(20, 107, 72, 0.78), transparent 52%),
    radial-gradient(700px 460px at 85% 70%, rgba(176, 31, 26, 0.55), transparent 55%),
    radial-gradient(640px 420px at 15% 95%, rgba(30, 122, 84, 0.5), transparent 50%),
    linear-gradient(125deg, var(--bg-green) 0%, var(--bg-green-mid) 32%, var(--bg-red-mid) 62%, var(--bg-red) 100%);
  background-attachment: fixed;
}

/* Soft snowflakes — a few shades lighter than the red/green wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%233d9a72' stroke-width='1.1' opacity='0.55'%3E%3Cpath d='M40 28v22M29 39h22M32.5 31.5l15 15M32.5 46.5l15-15'/%3E%3C/g%3E%3Cg fill='none' stroke='%23d45a52' stroke-width='1.1' opacity='0.5'%3E%3Cpath d='M128 72v26M115 85h26M119 76.5l18 18M119 93.5l18-18'/%3E%3C/g%3E%3Cg fill='none' stroke='%2348a87d' stroke-width='0.9' opacity='0.42'%3E%3Cpath d='M86 138v16M78 146h16M81 141l10 10M81 151l10-10'/%3E%3C/g%3E%3Cg fill='none' stroke='%23db6b64' stroke-width='0.9' opacity='0.4'%3E%3Cpath d='M158 28v14M151 35h14M153.5 30.5l9 9M153.5 39.5l9-9'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%2352b388' stroke-width='1' opacity='0.38'%3E%3Cpath d='M52 168v20M42 178h20M45.5 171.5l13 13M45.5 184.5l13-13'/%3E%3C/g%3E%3Cg fill='none' stroke='%23e07a73' stroke-width='1' opacity='0.36'%3E%3Cpath d='M198 48v22M187 59h22M191 52l14 14M191 66l14-14'/%3E%3C/g%3E%3Cg fill='none' stroke='%233d9a72' stroke-width='0.85' opacity='0.32'%3E%3Cpath d='M210 196v12M204 202h12M206 198l8 8M206 206l8-8'/%3E%3C/g%3E%3Ccircle cx='24' cy='42' r='1.4' fill='%2348a87d' opacity='0.45'/%3E%3Ccircle cx='148' cy='210' r='1.2' fill='%23d45a52' opacity='0.4'/%3E%3Ccircle cx='92' cy='28' r='1' fill='%23db6b64' opacity='0.35'/%3E%3C/svg%3E");
  background-size: 180px 180px, 260px 260px;
  background-position: 0 0, 60px 90px;
  animation: flake-drift 48s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'%3E%3Cg fill='none' stroke='%2348a87d' stroke-width='1' opacity='0.34'%3E%3Cpath d='M70 90v18M61 99h18M64.5 93.5l11 11M64.5 104.5l11-11'/%3E%3C/g%3E%3Cg fill='none' stroke='%23d45a52' stroke-width='1' opacity='0.32'%3E%3Cpath d='M250 220v20M240 230h20M243.5 223.5l13 13M243.5 236.5l13-13'/%3E%3C/g%3E%3Ccircle cx='180' cy='60' r='1.3' fill='%2352b388' opacity='0.4'/%3E%3Ccircle cx='40' cy='250' r='1.1' fill='%23e07a73' opacity='0.38'/%3E%3Ccircle cx='280' cy='140' r='1' fill='%233d9a72' opacity='0.35'/%3E%3C/svg%3E");
  background-size: 320px 320px;
  background-position: 120px 40px;
  opacity: 0.85;
  animation: flake-drift-alt 64s linear infinite;
}

@keyframes flake-drift {
  from {
    background-position: 0 0, 60px 90px;
  }
  to {
    background-position: 0 180px, 60px 350px;
  }
}

@keyframes flake-drift-alt {
  from {
    background-position: 120px 40px;
  }
  to {
    background-position: 120px 360px;
  }
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--red);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(900px, calc(100% - 1.5rem));
  margin: 0 auto;
}

.shell-wide {
  width: min(1240px, calc(100% - 1.5rem));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.35rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  color: var(--on-bg);
  text-shadow: 0 1px 10px rgba(10, 40, 28, 0.25);
}

.brand-mark span {
  color: #ffd2ce;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--on-bg-muted);
  font-weight: 500;
}

.nav {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--on-bg);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: rgba(244, 248, 245, 0.18);
  border-color: rgba(244, 248, 245, 0.35);
  color: #fff;
}

.hero {
  display: grid;
  gap: 0.85rem 1.25rem;
  align-items: end;
  padding: 1.1rem 0 0.85rem;
}

@media (min-width: 720px) {
  .hero:not(.hero-compact) {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.hero-compact {
  padding-bottom: 0.4rem;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  color: var(--on-bg);
  max-width: 16ch;
  text-wrap: balance;
  text-shadow: 0 2px 16px rgba(10, 40, 28, 0.28);
}

.hero p {
  margin: 0.65rem 0 0;
  max-width: 40rem;
  color: var(--on-bg-muted);
  font-size: 0.98rem;
}

.fleet {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  justify-content: flex-start;
  margin-top: 0.15rem;
  filter: drop-shadow(0 6px 14px rgba(10, 40, 28, 0.28));
}

.fleet-vehicle {
  display: block;
  width: clamp(88px, 22vw, 132px);
  height: auto;
  animation: fleet-bob 4.2s ease-in-out infinite;
}

.fleet-vehicle:nth-child(2) {
  animation-delay: -1.2s;
  animation-duration: 4.8s;
}

.fleet-vehicle:nth-child(3) {
  animation-delay: -2.4s;
  animation-duration: 5.1s;
}

@keyframes fleet-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fleet-vehicle {
    animation: none;
  }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.95rem;
}

.filters {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.filters-schedule {
  grid-template-columns: 1fr;
  align-items: end;
}

.filter-block {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.filter-block-full {
  grid-column: 1 / -1;
}

.filter-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.btn-clear {
  height: 2.65rem;
  align-self: end;
}

.filter-label,
label.filter-label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--green-deep);
}

.type-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.seg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-deep);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.seg-icon {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
}

.seg:hover {
  border-color: #a9c5b8;
  background: var(--green-soft);
}

.seg.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.multi {
  position: relative;
}

.multi-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid #c9d7d0;
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.multi-caret {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -0.2rem;
}

.multi-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.55rem;
  max-height: 260px;
  overflow: auto;
}

.multi-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0.15rem 0.25rem 0.45rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.35rem;
}

.linkish {
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  padding: 0;
}

.linkish:hover {
  color: var(--red);
}

.multi-options {
  display: grid;
  gap: 0.15rem;
}

.multi-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.35rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.multi-option:hover {
  background: var(--green-soft);
}

.multi-option input {
  accent-color: var(--green);
  width: 1rem;
  height: 1rem;
}

label:not(.multi-option) {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-deep);
}

input[type="search"],
select {
  width: 100%;
  border: 1px solid #c9d7d0;
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  background: #fff;
}

input[type="search"]:focus,
select:focus,
button:focus-visible,
.day-row:focus-visible,
.cal-cell:focus-visible,
.entry:focus-visible,
.seg:focus-visible,
.multi-toggle:focus-visible,
.suggest-item:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  transition: background var(--ease);
  white-space: nowrap;
}

.btn:hover {
  background: var(--red-deep);
}

.btn.secondary {
  background: var(--green-soft);
  color: var(--green-deep);
}

.btn.secondary:hover {
  background: #d7ebe2;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin: 0.25rem 0 0.85rem;
  color: var(--on-bg-muted);
  font-size: 0.88rem;
}

.panel .meta-row,
.panel .status-line {
  color: var(--muted);
}

.status-line {
  margin: 0 0 0.85rem;
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 650;
  font-size: 0.78rem;
}

.pill.red {
  background: var(--red-soft);
  color: var(--red-deep);
}

a.pill {
  text-decoration: none;
  transition: background var(--ease), color var(--ease);
}

a.pill:hover {
  color: var(--green-deep);
  background: #d7ebe3;
}

a.pill.red:hover {
  color: var(--red-deep);
  background: #f0d4d0;
}

.footer-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.schedule-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 860px) {
  .schedule-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
  }
}

.aside-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--green-deep);
}

.days-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3faf6;
  padding: 0.7rem;
}

.days-list {
  display: grid;
  gap: 0.3rem;
  max-height: 60vh;
  overflow: auto;
}

.day-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 0.48rem 0.55rem;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  transition: background var(--ease), border-color var(--ease);
}

.day-row:hover {
  background: var(--green-soft);
}

.day-row.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.day-row.active .day-row-count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.day-row.today:not(.active) {
  border-color: #c5ddd3;
}

.day-row-main {
  font-size: 0.86rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-row-count {
  flex: 0 0 auto;
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
}

.day-group {
  margin-bottom: 1rem;
}

.type-group {
  margin-bottom: 0.75rem;
}

.type-group:last-child {
  margin-bottom: 0;
}

.type-group-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
}

.type-group-head h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--muted, #5a6b63);
  text-transform: none;
}

.type-group-head .type-icon {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
}

.type-group-head .pill {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
}

.day-group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}

.day-group-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--green-deep);
}

.results,
.results-stack {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.entry {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbf9;
  animation: rise 0.28s ease both;
}

.entry-compact,
.entry-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  padding: 0.42rem 0.55rem;
  min-height: 2.35rem;
  border-radius: 8px;
}

.entry-compact {
  padding: 0.34rem 0.48rem;
  min-height: 2.15rem;
  gap: 0.3rem 0.4rem;
  min-width: 0;
}

.entry-lead {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: 0 0 auto;
  line-height: 0;
}

.entry-lead .entry-type {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
}

.entry-compact p,
.entry-row p {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.line-badge {
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.35rem;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--green);
  flex: 0 0 auto;
  box-sizing: border-box;
}

.line-badge.sm {
  min-width: 1.55rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  font-size: 0.72rem;
  border-radius: 4px;
}

.line-badge.bus {
  background: var(--red);
}

.line-badge.trolleybus {
  background: #0f5f8a;
}

.line-badge.lubricator {
  background: #6b4e16;
}

.type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 0;
}

.type-icon svg {
  display: block;
  width: 1em;
  height: 1em;
}

.entry-type {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--green);
}

.entry-type.bus {
  color: var(--red);
}

.entry-type.trolleybus {
  color: #0f5f8a;
}

.entry-type.lubricator {
  color: #6b4e16;
}

.entry-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.entry h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--green-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.line-primary {
  font-weight: 700;
  color: var(--green-deep);
}

.line-spec {
  font-weight: 500;
  color: var(--muted);
}

.entry p {
  margin: 0.08rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
}

.entry-actions a,
.entry-actions button {
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-deep);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}

.entry-actions a:hover,
.entry-actions button:hover {
  border-color: #b7cfc4;
  background: var(--green-soft);
  color: var(--green-deep);
}

.empty,
.empty-sm {
  color: var(--muted);
  text-align: center;
}

.empty {
  padding: 1.4rem 0.4rem;
}

.empty-sm {
  padding: 0.7rem 0.2rem;
  font-size: 0.88rem;
}

.footer {
  margin: 1.75rem 0 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(244, 248, 245, 0.28);
  color: var(--on-bg-muted);
  font-size: 0.84rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

.footer a {
  color: #ffd2ce;
}

.footer a:hover {
  color: #fff;
}

/* Map */
.map-layout {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

@media (min-width: 960px) {
  .map-layout {
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: calc(100vh - 12.5rem);
  }
}

.map-side {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  min-height: 0;
}

#map {
  min-height: 58vh;
  height: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-list {
  display: grid;
  gap: 0.3rem;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow: auto;
}

.map-list .entry {
  cursor: pointer;
  flex-wrap: nowrap;
}

.map-list .entry-actions {
  flex-shrink: 0;
}

.map-list .entry.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(26, 92, 69, 0.12);
}

/* Nearby */
.nearby-form {
  display: grid;
  gap: 0.75rem;
}

.nearby-grid {
  display: grid;
  gap: 0.65rem;
}

.nearby-grid > .filter-block {
  min-width: 0;
}

.place-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: stretch;
}

.time-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.4rem;
  width: 100%;
}

.time-row .time-field {
  flex: 1 1 0;
  min-width: 4.5rem;
  display: grid;
  gap: 0.35rem;
}

.time-row .time-field > label {
  display: block;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-deep);
}

.time-row .time-field select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 0.75rem;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.time-sep {
  flex: 0 0 auto;
  align-self: flex-end;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--green-deep);
  line-height: 1;
}

.btn-icon {
  min-width: 3.2rem;
  padding-inline: 0.7rem;
}

.suggest {
  gap: 0.15rem;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  max-height: 220px;
  overflow: auto;
}

.suggest:not([hidden]) {
  display: grid;
}

.suggest[hidden] {
  display: none;
}

.suggest-item {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.5rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
}

.suggest-item:hover {
  background: var(--green-soft);
}

.suggest-main {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-deep);
}

.suggest-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.nearby-form .hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.nearby-body {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}

.nearby-body .dist-line {
  display: block;
  margin: 0;
  white-space: normal;
}

.nearby-body .times-line {
  color: var(--green-deep);
  font-weight: 650;
}

@media (min-width: 960px) {
  .nearby-layout {
    grid-template-columns: 340px minmax(0, 1fr);
  }
}

/* Calendar */
.cal {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.cal-summary {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 1px solid #c9d7d0;
  border-radius: 10px;
  padding: 0.62rem 0.8rem;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}

.cal-summary > span:first-child {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cal-summary .multi-caret {
  flex: 0 0 auto;
}

.cal-summary:hover {
  border-color: #a9c5b8;
  background: var(--green-soft);
}

.cal-summary.open {
  border-color: var(--green);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.multi-caret.up {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.cal-popover {
  border: 1px solid #c9d7d0;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  padding: 0.55rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.cal-all {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 650;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}

.cal-all:hover {
  background: #d7ebe2;
}

.cal-head {
  display: grid;
  grid-template-columns: 2rem 1fr 2rem;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.cal-title {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.03em;
  color: var(--green-deep);
  text-transform: capitalize;
}

.cal-nav {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green-deep);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.cal-nav:hover:not(:disabled) {
  background: var(--green-soft);
}

.cal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.2rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.cal-cell {
  height: 2rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: default;
}

.cal-cell.empty {
  visibility: hidden;
}

.cal-cell.has {
  cursor: pointer;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.cal-cell.has:hover {
  border-color: #a9c5b8;
  background: var(--green-soft);
}

.cal-cell.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.cal-cell.today:not(.active) {
  box-shadow: inset 0 0 0 1.5px var(--red);
}

.leaflet-popup-content {
  font-family: var(--font-body);
  margin: 0.55rem 0.7rem !important;
}

.leaflet-popup-content strong {
  color: var(--green-deep);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body::before,
  body::after {
    animation: none;
  }
  .entry,
  .seg,
  .day-row,
  .cal-cell {
    animation: none;
    transition: none;
  }
}
