:root {
  --cp: #0077C8;
  --cp-green: #0088EA;
  --cp-deep: #005A9E;
  --cp-hero-green: #005A9E;
  --cp-hero-green-2: #0077C8;
  --cp-tint: #EAF4FD;
  --cp-orange: #D84B00;
  --cp-orange-hover: #C24200;
  --bg: #FBFBF9;
  --body-bg: #EAEDE8;
  --surface: #FFFFFF;
  --surface-card: #F6F7F5;
  --surface-hover: #ECEEEA;
  --surface-2: #F0F2EF;
  --line: #E6E6E1;
  --line-soft: #F0F0EC;
  --ink: #14181A;
  --ink-2: #5A6360;
  --ink-3: #8B9490;
  --late: #B4531B;
  --late-bg: #FCF1E8;
  --early: #2C6E8F;
  --cancel: #A32A2A;
  --cancel-bg: #FBEDED;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(20, 24, 26, .05);
  --shadow-md: 0 4px 16px rgba(20, 24, 26, .08);
  --shadow-lg: 0 12px 32px rgba(20, 24, 26, .14);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: calc(78px + var(--bottom));
}

@media (prefers-color-scheme: dark) {
  :root {
    --cp: #38A9FF;
    --cp-green: #38A9FF;
    --cp-deep: #0077C8;
    --bg: #0C100E;
    --body-bg: #060807;
    --surface: #141816;
    --surface-card: #1A201D;
    --surface-hover: #222A26;
    --surface-2: #202824;
    --line: #232B27;
    --line-soft: #1A211E;
    --ink: #F0F4F2;
    --ink-2: #A0ABA5;
    --ink-3: #6F7A74;
    --cp-tint: rgba(56, 169, 255, 0.14);
    --cp-hero-green: #0A3254;
    --cp-hero-green-2: #0E487A;
    --late: #E5924F;
    --late-bg: #2A1E12;
    --early: #7FB6D4;
    --cancel: #E07A7A;
    --cancel-bg: #2A1616;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
  }
}

body.theme-dark {
  --cp: #38A9FF;
  --cp-green: #38A9FF;
  --cp-deep: #0077C8;
  --bg: #0C100E;
  --body-bg: #060807;
  --surface: #141816;
  --surface-card: #1A201D;
  --surface-hover: #222A26;
  --surface-2: #202824;
  --line: #232B27;
  --line-soft: #1A211E;
  --ink: #F0F4F2;
  --ink-2: #A0ABA5;
  --ink-3: #6F7A74;
  --cp-tint: rgba(56, 169, 255, 0.14);
  --cp-hero-green: #0A3254;
  --cp-hero-green-2: #0E487A;
  --late: #E5924F;
  --late-bg: #2A1E12;
  --early: #7FB6D4;
  --cancel: #E07A7A;
  --cancel-bg: #2A1616;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
}

body.theme-light {
  --bg: #FBFBF9;
  --body-bg: #EAEDE8;
  --surface: #FFFFFF;
  --surface-card: #F6F7F5;
  --surface-hover: #ECEEEA;
  --surface-2: #F0F2EF;
  --line: #E6E6E1;
  --line-soft: #F0F0EC;
  --ink: #14181A;
  --ink-2: #5A6360;
  --ink-3: #8B9490;
  --cp-tint: #EAF4FD;
  --cp-hero-green: #005A9E;
  --cp-hero-green-2: #0077C8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--sans);
  background: var(--body-bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--cp-green); outline-offset: 2px; }

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  box-shadow: none;
}

.view-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  padding-bottom: var(--tabbar-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#view-pesquisar {
  padding-bottom: 0;
  overflow: hidden;
}

.view-panel.is-active { display: flex; }

.topbar-standard {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--top) + 14px) 16px 12px;
  background: var(--bg);
  min-height: 52px;
}

.topbar-menu-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  color: var(--ink);
  background: transparent;
  font-size: 20px;
  transition: background 0.15s, color 0.15s;
}

.topbar-menu-btn:hover { background: var(--surface-hover); color: var(--ink); }
.topbar-menu-btn:active { transform: scale(0.94); }

body.theme-dark .topbar-menu-btn { color: var(--ink); }
body.theme-light .topbar-menu-btn { color: var(--ink); }

.topbar-spacer { width: 44px; height: 44px; }

.screen-header {
  padding: calc(var(--top) + 14px) 16px 12px;
  background: var(--bg);
  z-index: 10;
}

.screen-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
}

.screen-header-row .topbar-menu-btn {
  flex: none;
  width: 52px;
  height: 52px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.18s, color 0.18s, transform 0.1s;
}

.screen-header-row .topbar-menu-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.screen-header-row .topbar-menu-btn:active {
  transform: scale(0.95);
}

body.theme-dark .screen-header-row .topbar-menu-btn {
  background: var(--surface-card);
  color: var(--ink);
  border: none;
  box-shadow: none;
}

body.theme-dark .screen-header-row .topbar-menu-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.screen-header-row .search-box-wrap {
  flex: 1;
  min-width: 0;
  height: 52px;
}

.screen-header-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  min-height: 48px;
}

.screen-title-center-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
}

.topbar-spacer-btn {
  width: 44px;
  height: 44px;
  flex: none;
}

.screen-title {
  font-size: 26px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 4px;
}

.screen-subtitle {
  font-size: 15px;
  color: var(--ink-2);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 18px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  box-shadow: none;
  cursor: pointer;
  transition: background 0.18s;
}

body.theme-dark .search-box-wrap {
  background: var(--surface-card);
  box-shadow: none;
}

.search-box-wrap:focus-within, .search-box-wrap:hover {
  background: var(--surface);
  box-shadow: none;
}

body.theme-dark .search-box-wrap:focus-within,
body.theme-dark .search-box-wrap:hover {
  background: var(--surface-hover);
  box-shadow: none;
}

.search-lens-icon {
  width: 20px;
  height: 20px;
  color: var(--cp);
  margin-right: 12px;
  flex: none;
}

body.theme-dark .search-lens-icon {
  color: var(--cp-green);
}

.search-placeholder-text {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  user-select: none;
}

.search-input-field {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.search-input-field:focus { outline: none; }
.search-input-field::placeholder { color: var(--ink-2); }
.search-input-field::-webkit-search-cancel-button { display: none; }

.search-clear-inline {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink-3);
}

.search-clear-inline:hover { background: var(--line-soft); color: var(--ink); }

.results-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  z-index: 50;
}

.results-popover li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.results-popover li:last-child { border-bottom: none; }
.results-popover li:hover, .results-popover li.is-cursor { background: var(--cp-tint); }
.results-popover li .res-sub { font-size: 13px; color: var(--ink-3); }

.map-viewport {
  position: relative;
  flex: 1;
  min-height: 320px;
  background: #121C14;
  overflow: hidden;
}

.leaflet-map-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #121C14;
}

.leaflet-container {
  font-family: inherit !important;
  background: #121C14 !important;
}

.leaflet-user-pin-icon {
  background: transparent;
  border: none;
}

.user-map-pin {
  position: relative;
  width: 36px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.user-map-pin svg {
  display: block;
  width: 36px;
  height: 46px;
}

.leaflet-station-tag {
  background: transparent !important;
  border: none !important;
}

.station-leaflet-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: transform 0.15s ease, filter 0.15s ease;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.16));
}

.station-leaflet-badge:hover {
  transform: translateY(-2px) scale(1.06);
  z-index: 1000 !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.station-leaflet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10);
  transition: background 0.15s, transform 0.15s;
}

body.theme-dark .station-leaflet-pill {
  background: var(--surface-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.station-leaflet-dot {
  display: grid;
  place-items: center;
  border-radius: 50%;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.station-leaflet-badge.is-estacao .station-leaflet-dot {
  background: var(--cp-tint);
  color: var(--cp-deep);
}

@media (prefers-color-scheme: dark) {
  .station-leaflet-badge.is-estacao .station-leaflet-dot { color: var(--cp-green); }
}
body.theme-dark .station-leaflet-badge.is-estacao .station-leaflet-dot { color: var(--cp-green); }
body.theme-light .station-leaflet-badge.is-estacao .station-leaflet-dot { color: var(--cp-deep); }

.station-leaflet-badge.is-apeadeiro .station-leaflet-dot {
  background: var(--surface-2);
  color: var(--ink-2);
}

body.theme-dark .station-leaflet-badge.is-apeadeiro .station-leaflet-dot {
  background: var(--surface);
  color: var(--ink);
}

.station-icon-inner {
  font-size: 10px;
}

.station-leaflet-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  line-height: 1;
}

.station-leaflet-badge.is-apeadeiro .station-leaflet-name {
  font-weight: 600;
  color: var(--ink-2);
}

.station-leaflet-anchor-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 2px;
}

.station-leaflet-badge.is-estacao .station-leaflet-anchor-dot {
  background: var(--cp-deep);
}

@media (prefers-color-scheme: dark) {
  .station-leaflet-badge.is-estacao .station-leaflet-anchor-dot { background: var(--cp-green); }
}
body.theme-dark .station-leaflet-badge.is-estacao .station-leaflet-anchor-dot { background: var(--cp-green); }
body.theme-light .station-leaflet-badge.is-estacao .station-leaflet-anchor-dot { background: var(--cp-deep); }

.station-leaflet-badge.is-apeadeiro .station-leaflet-anchor-dot {
  background: var(--ink-3);
}

.leaflet-tooltip.station-live-hover-card {
  background: var(--surface);
  color: var(--ink);
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  padding: 12px 14px;
  font-family: var(--sans);
  pointer-events: none;
  min-width: 230px;
  max-width: 300px;
}

body.theme-dark .leaflet-tooltip.station-live-hover-card {
  background: var(--surface-card);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.leaflet-tooltip-top.station-live-hover-card:before {
  display: none;
}

.station-hover-card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shc-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shc-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shc-st-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}

.shc-st-icon-wrap.is-estacao {
  background: var(--cp-tint);
  color: var(--cp-deep);
}

body.theme-dark .shc-st-icon-wrap.is-estacao {
  color: var(--cp-green);
}

.shc-st-icon-wrap.is-apeadeiro {
  background: var(--surface-2);
  color: var(--ink-2);
}

body.theme-dark .shc-st-icon-wrap.is-apeadeiro {
  background: var(--surface);
  color: var(--ink);
}

.shc-st-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.shc-st-line {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 550;
  line-height: 1.2;
}

.shc-type-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex: none;
}

.shc-type-pill.is-estacao {
  background: var(--cp-tint);
  color: var(--cp-deep);
}

body.theme-dark .shc-type-pill.is-estacao {
  color: var(--cp-green);
}

.shc-type-pill.is-apeadeiro {
  background: var(--surface-2);
  color: var(--ink-2);
}

body.theme-dark .shc-type-pill.is-apeadeiro {
  background: var(--surface);
  color: var(--ink);
}

.shc-body {
  padding: 10px 12px;
  background: var(--surface-2);
  border: none;
  border-radius: var(--r-sm);
}

body.theme-dark .shc-body {
  background: var(--surface);
}

.shc-loading, .shc-no-train {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
}

.shc-next-train-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shc-badge-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.shc-route-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.shc-time-val {
  font-weight: 750;
  color: var(--ink);
  font-size: 13.5px;
}

.shc-arrow {
  color: var(--ink-3);
  font-size: 12px;
}

.shc-dest-val {
  font-weight: 650;
  color: var(--ink);
}

.shc-footer {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
}

.map-zoom-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: none;
  overflow: hidden;
}

.map-zoom-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}

body.theme-dark .map-zoom-btn { color: var(--ink); }
body.theme-light .map-zoom-btn { color: var(--ink); }

.map-zoom-btn:hover { background: var(--surface-hover); color: var(--ink); }
.map-zoom-btn:active { background: var(--line); }
.map-zoom-btn:first-child { border-bottom: 1px solid var(--line-soft); }

.map-locate-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: 50%;
  color: var(--ink);
  box-shadow: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  transform: none !important;
}

body.theme-dark .map-locate-btn { color: var(--ink); }
body.theme-light .map-locate-btn { color: var(--ink); }

.map-locate-btn:hover { background: var(--surface-hover); color: var(--ink); }
.map-locate-btn:active { background: var(--line-soft); }

.map-locate-btn .locate-icon {
  font-size: 19px;
  line-height: 1;
}

.nearby-stations-scroll {
  padding: 12px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nearby-station-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  transition: all 0.15s ease;
  cursor: pointer;
  text-decoration: none;
}

.nearby-station-card:hover {
  background: var(--surface-card);
  border-color: var(--cp);
}

.nearby-station-card:active {
  background: var(--surface-card);
}

.nearby-station-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--surface-card);
  color: var(--cp);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  border: 1px solid var(--line-soft);
}

body.theme-dark .nearby-station-icon {
  background: var(--surface);
}

.nearby-station-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nearby-station-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nearby-station-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-station-type-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-card);
  color: var(--ink-2);
  border: 1px solid var(--line-soft);
  flex-shrink: 0;
}

body.theme-dark .nearby-station-type-tag {
  background: var(--surface);
}

.nearby-station-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nearby-station-line {
  color: var(--ink-2);
  font-weight: 550;
}

.nearby-station-dist {
  font-size: 12px;
  font-weight: 600;
  color: var(--cp);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nearby-station-action-btn {
  color: var(--ink-3);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.nearby-station-card:hover .nearby-station-action-btn {
  color: var(--cp);
  transform: translateX(2px);
}

.map-floating-pill-btn {
  position: absolute;
  bottom: calc(var(--tabbar-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--cp-deep);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--r-pill);
  box-shadow: 0 6px 20px rgba(0, 119, 200, 0.4);
  transition: transform 0.15s, background 0.15s;
}

.map-floating-pill-btn:hover { background: var(--cp-green); }
.map-floating-pill-btn:active { transform: translateX(-50%) scale(0.95); }

.map-provider-watermark {
  position: absolute;
  bottom: calc(var(--tabbar-h) + 8px);
  left: 12px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
  font-family: sans-serif;
  letter-spacing: -0.03em;
  z-index: 10;
}

.leaflet-bottom {
  bottom: calc(var(--tabbar-h) + 2px) !important;
}

@media (prefers-color-scheme: dark) {
  .map-provider-watermark { color: rgba(255, 255, 255, 0.25); }
}

.fav-hero-header {
  position: relative;
  background: linear-gradient(135deg, var(--cp-hero-green) 0%, var(--cp-hero-green-2) 100%);
  padding: calc(var(--top) + 16px) 16px 36px;
  color: #FFFFFF;
  overflow: hidden;
}

.fav-hero-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
}

.fav-hero-star {
  font-size: 22px;
  color: #FFFFFF;
}

.fav-hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.fav-content-card {
  position: relative;
  flex: 1;
  margin-top: -18px;
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  padding: 20px 18px 24px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}

.segmented-pill-tabs {
  display: flex;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-pill);
  padding: 3px;
  margin-bottom: 20px;
}

.seg-pill-opt {
  flex: 1;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.seg-pill-opt.is-active {
  background: var(--cp-deep);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 119, 200, 0.28);
}

@media (prefers-color-scheme: dark) {
  .seg-pill-opt.is-active {
    background: var(--cp-green);
  }
}

body.theme-dark .seg-pill-opt.is-active { background: var(--cp-green); }

.fav-items-list {
  display: flex;
  flex-direction: column;
}

.fav-trip-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s;
}

.fav-trip-card:hover { background: var(--cp-tint); border-radius: var(--r-sm); }
.fav-trip-card:active { transform: scale(0.99); }

.fav-trip-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.fav-trip-lens-icon {
  font-size: 18px;
  color: var(--ink);
  margin-top: 2px;
  flex: none;
}

.fav-trip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fav-trip-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.fav-trip-sub {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 450;
}

.fav-trip-badge {
  font-size: 13.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.fav-trip-chevron {
  font-size: 16px;
  color: var(--ink-3);
  flex: none;
}

.fav-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-top: 18px;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--cp-deep);
  font-weight: 600;
  font-size: 14.5px;
}

.fav-add-btn:hover { background: var(--cp-tint); border-color: var(--cp-green); }

.assistente-header {
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 14px;
}

.assistente-title-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assistente-ia-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: linear-gradient(135deg, #0077C8, #2E7D32);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0, 119, 200, 0.25);
}

.assistente-reset-btn {
  display: grid;
  place-items: center;
  color: var(--ink-2);
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 16px;
  transition: all 0.15s ease;
}

.assistente-reset-btn:hover {
  color: var(--cp);
  transform: none;
}

.assistente-chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100% - 110px);
  overflow: hidden;
}

.assistente-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.assistente-welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  margin: 8px 0;
  box-shadow: var(--shadow-sm);
}

.assistente-welcome-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cp-hero-green), var(--cp-hero-green-2));
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.3);
}

.assistente-welcome-title {
  font-size: 18px;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 6px;
}

.assistente-welcome-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
  max-width: 380px;
  margin-bottom: 16px;
}

.assistente-topic-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.assistente-topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.assistente-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 88%;
  animation: fadeIn 0.2s ease;
}

.assistente-msg-row.is-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.assistente-msg-row.is-assistant {
  align-self: flex-start;
}

.assistente-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
  padding: 3px;
}

.assistente-msg-avatar .assistente-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.assistente-msg-avatar.is-user {
  background: var(--cp-deep);
  color: #FFFFFF;
  font-size: 13px;
  border: 1px solid var(--line-soft);
  padding: 0;
}

.assistente-msg-avatar.is-user .assistente-avatar-img {
  object-fit: cover;
  border-radius: 50%;
}

body.theme-dark .assistente-msg-avatar.is-user {
  background: var(--cp-green);
  color: #141816;
}

.assistente-history-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.assistente-history-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--ink-3);
  font-size: 13.5px;
}

.assistente-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.assistente-history-item:hover {
  border-color: var(--cp);
  background: var(--surface-card);
}

.assistente-history-item.is-current {
  border: 1.5px solid var(--cp) !important;
  border-color: var(--cp) !important;
  background: var(--surface-card);
  box-shadow: none !important;
}

.assistente-history-main {
  flex: 1;
  min-width: 0;
  margin-right: 8px;
}

.assistente-history-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assistente-history-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.assistente-history-del-btn {
  background: transparent;
  border: none;
  color: var(--ink-3);
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.assistente-history-del-btn:hover {
  color: #E74C3C;
  background: rgba(231, 76, 60, 0.1);
}

.assistente-bubble {
  padding: 12px 15px;
  border-radius: 16px;
  position: relative;
  word-break: break-word;
}

.assistente-msg-row.is-user .assistente-bubble {
  background: var(--cp-deep);
  color: #FFFFFF;
  border-top-right-radius: 4px;
}

.assistente-msg-row.is-assistant .assistente-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.assistente-bubble-content {
  font-size: 14px;
  line-height: 1.55;
  color: inherit;
}

.assistente-bubble-content p {
  margin: 0 0 10px 0;
  line-height: 1.55;
}

.assistente-bubble-content p:last-child {
  margin-bottom: 0;
}

.assistente-bubble-content strong {
  font-weight: 700;
}

.assistente-bubble-content em {
  font-style: italic;
}

.assistente-bubble-content ul,
.assistente-bubble-content ol {
  margin: 6px 0 10px 0;
  padding-left: 20px;
}

.assistente-bubble-content li {
  margin-bottom: 5px;
  line-height: 1.5;
}

.assistente-msg-row.is-assistant .assistente-bubble-content li::marker {
  color: var(--cp);
  font-weight: bold;
}

.assistente-bubble-content blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--cp);
  background: var(--surface-card);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px;
}

.assistente-msg-row.is-user .assistente-bubble-content blockquote {
  border-left-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
}

.assistente-bubble-content code {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
}

body.theme-dark .assistente-bubble-content code {
  background: rgba(255, 255, 255, 0.1);
  color: #85E89D;
}

.assistente-msg-row.is-user .assistente-bubble-content code {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.assistente-bubble-content pre {
  margin: 10px 0;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-card);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.assistente-bubble-content pre code {
  background: transparent;
  padding: 0;
}

.assistente-bubble-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}

.assistente-bubble-content th,
.assistente-bubble-content td {
  padding: 7px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.assistente-bubble-content th {
  background: var(--surface-card);
  font-weight: 700;
  color: var(--ink);
}

.assistente-bubble-content hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 10px 0;
}

.assistente-bubble-time {
  display: block;
  font-size: 10.5px;
  margin-top: 6px;
  opacity: 0.65;
  text-align: right;
}

.assistente-heading-1,
.assistente-heading-2,
.assistente-heading-3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px 0;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

.assistente-heading-1 {
  font-size: 15.5px;
  padding-bottom: 4px;
  border-bottom: 1.5px solid var(--line);
}

.assistente-heading-2 {
  font-size: 14px;
}

.assistente-heading-3 {
  font-size: 13px;
  color: var(--ink-2);
}

.assistente-trip-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0;
}

.assistente-trip-card {
  background: var(--surface-card);
  border: 1.2px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assistente-trip-card:hover {
  border-color: var(--cp);
  background: var(--surface-hover);
}

.assistente-trip-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.assistente-trip-times {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.assistente-trip-times .trip-time-arrow {
  font-size: 11px;
  color: var(--ink-3);
}

.assistente-trip-times .trip-dur-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: var(--r-pill);
}

.assistente-trip-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.assistente-service-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: rgba(39, 174, 96, 0.12);
  color: #27AE60;
  border: 1px solid rgba(39, 174, 96, 0.25);
}

.assistente-service-tag.is-alfa {
  background: rgba(41, 128, 185, 0.12);
  color: #2980B9;
  border-color: rgba(41, 128, 185, 0.25);
}

.assistente-service-tag.is-ic {
  background: rgba(142, 68, 173, 0.12);
  color: #8E44AD;
  border-color: rgba(142, 68, 173, 0.25);
}

.assistente-service-tag.is-regional {
  background: rgba(211, 84, 0, 0.12);
  color: #D35400;
  border-color: rgba(211, 84, 0, 0.25);
}

.assistente-platform-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.assistente-delay-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
}

.assistente-delay-tag.is-ontime {
  background: rgba(46, 204, 113, 0.12);
  color: #27AE60;
  border: 1px solid rgba(46, 204, 113, 0.25);
}

.assistente-delay-tag.is-late {
  background: rgba(230, 126, 34, 0.12);
  color: #E67E22;
  border: 1px solid rgba(230, 126, 34, 0.3);
}

.assistente-delay-tag.is-canceled {
  background: rgba(231, 76, 60, 0.12);
  color: #E74C3C;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.assistente-transfer-route {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  padding-left: 2px;
  line-height: 1.4;
}

.assistente-nearby-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0;
}

.assistente-nearby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--surface-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  gap: 8px;
}

.assistente-nearby-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.assistente-nearby-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--cp);
  background: var(--cp-tint);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.assistente-nearby-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assistente-nearby-dist {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--cp-deep);
  background: var(--cp-tint);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}

body.theme-dark .assistente-nearby-dist {
  color: var(--cp-green);
  background: rgba(76, 175, 80, 0.15);
}

.assistente-actions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 4px 0;
}

.assistente-action-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface-card);
  border: 1.2px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  text-align: left;
}

.assistente-action-card-btn i:first-child {
  color: var(--cp);
  font-size: 13px;
}

body.theme-dark .assistente-action-card-btn i:first-child {
  color: var(--cp-green);
}

.assistente-action-card-btn i:last-child {
  font-size: 10px;
  color: var(--ink-3);
  margin-left: 2px;
}

.assistente-action-card-btn:hover {
  background: var(--cp-tint);
  border-color: var(--cp);
  color: var(--cp-deep);
  transform: translateY(-1px);
}

body.theme-dark .assistente-action-card-btn:hover {
  background: var(--surface-hover);
  border-color: var(--cp-green);
  color: var(--cp-green);
}

.assistente-action-card-btn:active {
  transform: scale(0.97);
}

.assistente-inline-link {
  color: var(--cp);
  font-weight: 600;
  text-decoration: underline;
}

body.theme-dark .assistente-inline-link {
  color: var(--cp-green);
}

.assistente-msg-row.is-typing .typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--ink-3);
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.assistente-footer-area {
  padding: 8px 16px 14px;
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
}

.assistente-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.assistente-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.assistente-quick-chip:hover {
  border-color: var(--cp);
  color: var(--cp);
  background: var(--surface);
}

.assistente-input-form {
  display: flex;
  align-items: center;
}

.assistente-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px 6px 4px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.assistente-input-wrapper:focus-within {
  border-color: var(--cp-green);
  box-shadow: 0 0 0 3px rgba(33, 150, 83, 0.15);
}

.assistente-text-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
}

.assistente-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cp-deep);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.assistente-send-btn:hover {
  background: var(--cp);
  transform: scale(1.05);
}

.assistente-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(0, 119, 200, 0.35) !important;
  border-radius: 50% !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: #0077C8 !important;
  color: #FFFFFF !important;
  font-family: var(--sans) !important;
  font-weight: 750 !important;
  font-size: 12px !important;
  border: 2px solid #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45) !important;
  border-radius: 50% !important;
}

.mycp-body-scroll {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mycp-section-card {
  padding: 16px 18px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.theme-dark .mycp-section-card {
  background: var(--surface-card);
  box-shadow: none;
}

.setting-row-menu-style {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  cursor: default;
}

.setting-row-menu-style:hover {
  background: transparent !important;
  color: var(--ink) !important;
}

.setting-row-menu-style:hover .drawer-item-icon-box {
  background: var(--surface-card) !important;
  color: var(--ink-2) !important;
}

body.theme-dark .setting-row-menu-style:hover .drawer-item-icon-box {
  background: var(--surface) !important;
  color: var(--ink) !important;
}

.setting-action-drawer-btn {
  width: 100%;
  justify-content: space-between;
  cursor: pointer;
  box-sizing: border-box;
}

.setting-menu-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.setting-menu-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.setting-menu-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.2;
}

.setting-badge-action {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-card);
  color: var(--cp-deep);
  font-size: 12.5px;
  font-weight: 650;
  transition: all 0.15s ease;
}

body.theme-dark .setting-badge-action {
  background: var(--surface);
  color: var(--cp-green);
}

.setting-action-drawer-btn:hover .setting-badge-action {
  background: var(--cp-deep);
  color: #FFFFFF;
}

body.theme-dark .setting-action-drawer-btn:hover .setting-badge-action {
  background: var(--cp-green);
  color: #0E1211;
}

.theme-segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--surface-card);
  border: none;
  border-radius: var(--r-pill);
  padding: 3px;
  gap: 2px;
}

body.theme-dark .theme-segmented-control {
  background: var(--surface);
}

.theme-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-seg-btn:hover {
  color: var(--ink);
}

.theme-seg-btn.is-active {
  background: #0077C8;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 119, 200, 0.25);
}

body.theme-dark .theme-seg-btn.is-active {
  background: var(--cp-green);
  color: #0E1211;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 230, 118, 0.25);
}

.setting-version-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-card);
  border: none;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--mono);
}

body.theme-dark .setting-version-number {
  background: var(--surface);
}

.bottom-tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  justify-items: center;
  height: var(--tabbar-h);
  padding: 0 4px calc(var(--bottom) + 4px);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.tabbar-item {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 0;
  margin: 0 auto;
  gap: 4px;
  color: var(--ink-3);
  transition: all 0.15s ease;
  border-radius: var(--r-md);
}

.tabbar-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.theme-dark .tabbar-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tabbar-item.is-active { color: var(--cp-deep); }

@media (prefers-color-scheme: dark) {
  .tabbar-item.is-active { color: var(--cp-green); }
}

body.theme-dark .tabbar-item.is-active { color: var(--cp-green); }
body.theme-light .tabbar-item.is-active { color: var(--cp-deep); }

.tabbar-icon-box {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 22px;
}

.tabbar-text {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1;
}

.app-fullscreen-modal {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: inherit;
  overflow: hidden;
}

.modal-surface-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  height: 100dvh;
  background: var(--bg);
  overflow-y: auto;
  animation: slideUpModal 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

#modal-trip-planner {
  position: absolute;
  inset: 0;
  z-index: 120;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  border-radius: inherit;
  overflow: hidden;
  animation: none !important;
  transition: none !important;
  transform: none !important;
  padding: 0 !important;
}

#modal-trip-planner .modal-surface-container {
  width: 100%;
  max-width: 520px;
  height: 100dvh;
  margin: 0 auto;
  border-radius: 0;
  background: var(--bg);
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

#modal-trip-planner .modal-head-bar {
  padding: calc(var(--top) + 14px) 18px 10px;
  background: var(--bg);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#modal-trip-planner .modal-scroll-body {
  padding: 12px 20px calc(var(--bottom) + 30px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#modal-trip-planner.step-1 .modal-scroll-body,
#modal-trip-planner.step-2 .modal-scroll-body,
#modal-trip-planner:not(.step-3) .modal-scroll-body {
  justify-content: center;
}

#modal-trip-planner.step-3 .modal-scroll-body {
  justify-content: flex-start;
}

@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--top) + 12px) 16px 8px;
  background: var(--bg);
}

.modal-close-icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  color: var(--cp-deep);
  font-size: 18px;
}

@media (prefers-color-scheme: dark) {
  .modal-close-icon-btn { color: var(--cp-green); }
}

.modal-scroll-body {
  padding: 12px 20px calc(var(--bottom) + 30px);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.modal-head-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
}

.no-shadow {
  box-shadow: none !important;
}

.planner-steps-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 4px 4px;
}

.planner-step-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.planner-step-item .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  flex: none;
}

.planner-step-item.is-active {
  color: var(--cp-deep);
}

@media (prefers-color-scheme: dark) {
  .planner-step-item.is-active { color: var(--cp-green); }
}
body.theme-dark .planner-step-item.is-active { color: var(--cp-green); }
body.theme-light .planner-step-item.is-active { color: var(--cp-deep); }

.planner-step-item.is-active .step-num {
  background: var(--cp-deep);
  border-color: var(--cp-deep);
  color: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  .planner-step-item.is-active .step-num {
    background: var(--cp-green);
    border-color: var(--cp-green);
    color: #0E1211;
  }
}
body.theme-dark .planner-step-item.is-active .step-num {
  background: var(--cp-green);
  border-color: var(--cp-green);
  color: #0E1211;
}
body.theme-light .planner-step-item.is-active .step-num {
  background: var(--cp-deep);
  border-color: var(--cp-deep);
  color: #FFFFFF;
}

.planner-step-item.is-done {
  color: var(--ink-2);
}

.planner-step-item.is-done .step-num {
  background: var(--cp-tint);
  border-color: var(--cp-green);
  color: var(--cp-deep);
}

body.theme-dark .planner-step-item.is-done .step-num {
  color: var(--cp-green);
}

.planner-step-line {
  flex: 1;
  height: 2px;
  background: var(--line);
  margin: 0 8px;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.planner-step-line.is-active {
  background: var(--cp-green);
}

.planner-route-summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.theme-dark .planner-route-summary-card {
  background: var(--surface-card);
  box-shadow: none;
}

.summary-route-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cp-tint);
  color: var(--cp-deep);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex: none;
}

body.theme-dark .summary-route-icon {
  color: var(--cp-green);
}

.summary-route-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.summary-route-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-route-sub {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
}

.summary-route-edit-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  border: none;
  background: var(--surface-card);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
  flex: none;
}

body.theme-dark .summary-route-edit-btn {
  background: var(--surface);
}

.summary-route-edit-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.modal-centered-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.fav-detail-route-card {
  padding: 0 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.route-headline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.route-lens-icon {
  font-size: 18px;
  color: var(--ink);
  flex: none;
}

.route-main-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.route-sub-text {
  font-size: 15px;
  color: var(--ink-2);
  padding-left: 28px;
}

.date-pickers-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0 24px;
}

.date-picker-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}

.date-picker-box:hover { border-color: var(--cp-green); }

.date-picker-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 550;
  color: var(--ink-2);
}

.cal-mini-icon {
  font-size: 16px;
  color: var(--ink-3);
}

.cal-mini-icon.green-cal { color: var(--cp-deep); }

@media (prefers-color-scheme: dark) {
  .cal-mini-icon.green-cal { color: var(--cp-green); }
}

.date-picker-val {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
}

.time-picker-inline-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
}

body.theme-dark .time-picker-inline-input {
  color-scheme: dark;
}

.trip-type-section {
  margin-bottom: 32px;
}

.trip-type-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.radio-choices-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  cursor: pointer;
}

.radio-left-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
  font-weight: 550;
  color: var(--ink);
}

.radio-option-item input[type="radio"] {
  display: none;
}

.radio-indicator {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  transition: all 0.15s ease;
}

.radio-option-item input[type="radio"]:checked + .radio-indicator {
  border-color: var(--cp-deep);
}

@media (prefers-color-scheme: dark) {
  .radio-option-item input[type="radio"]:checked + .radio-indicator {
    border-color: var(--cp-green);
  }
}

.radio-option-item input[type="radio"]:checked + .radio-indicator::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cp-deep);
}

@media (prefers-color-scheme: dark) {
  .radio-option-item input[type="radio"]:checked + .radio-indicator::after {
    background: var(--cp-green);
  }
}

.radio-option-item.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.radio-option-item.is-disabled .radio-indicator {
  background: var(--surface-card);
  border-color: var(--line);
}

.fav-detail-cta-bottom {
  margin-top: 10px;
}

.primary-orange-cta-btn, .primary-green-cta-btn, #btn-planner-find-trains, #btn-search-fav-trip-cta {
  display: block;
  width: 100%;
  padding: 15px 20px;
  background-color: #0077C8 !important;
  color: #FFFFFF !important;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border-radius: var(--r-md);
  border: none;
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.35);
  transition: transform 0.15s, background-color 0.15s, opacity 0.15s;
  cursor: pointer;
}

.primary-orange-cta-btn:hover, .primary-green-cta-btn:hover, #btn-planner-find-trains:hover, #btn-search-fav-trip-cta:hover {
  background-color: #005FA3 !important;
}

.primary-orange-cta-btn:active, .primary-green-cta-btn:active, #btn-planner-find-trains:active, #btn-search-fav-trip-cta:active {
  transform: scale(0.98);
}

.route-picker-card {
  position: relative;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.route-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.route-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}

.route-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.origin-dot { background: var(--cp-green); }
.dest-dot { background: var(--cp-orange); }

.route-station-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.route-station-input:focus { outline: none; }

.route-clear-btn {
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 14px;
}

.route-swap-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cp-deep);
  box-shadow: var(--shadow-sm);
  z-index: 5;
  font-size: 14px;
}

.planner-quick-tags {
  margin-bottom: 20px;
}

.quick-tags-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  display: block;
  margin-bottom: 8px;
}

.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.station-chip-tag {
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  cursor: pointer;
}

.station-chip-tag:hover { border-color: var(--cp-green); background: var(--cp-tint); }

.trip-results-container {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.trip-direction-block {
  margin-bottom: 20px;
}

.trip-direction-header {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.trip-direction-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--cp-tint);
  color: var(--cp);
}

.trip-direction-route {
  color: var(--ink);
  font-weight: 700;
}

.trip-result-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 10px;
}

.trip-result-card:hover {
  border-color: var(--cp);
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.12);
  transform: translateY(-1px);
}

.trip-result-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.trip-result-route-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.trip-route-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.trip-result-details {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
}

.trip-result-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.trip-time-under-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.trip-live-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--late);
}

.trip-sched-time {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.trip-sched-time.is-struck {
  text-decoration: line-through;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
}

.trip-filter-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.trip-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.trip-filter-chip:hover:not(:disabled) {
  border-color: var(--cp);
  color: var(--cp);
}

.trip-filter-chip.is-active {
  background: var(--cp-deep);
  border-color: var(--cp-deep);
  color: #FFFFFF;
}

.trip-filter-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.chip-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.trip-filter-chip.is-active .chip-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.trip-result-top-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.trip-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: -0.01em;
}

.trip-type-badge.is-direct {
  background: rgba(46, 125, 50, 0.12);
  color: var(--on-time);
}

.trip-type-badge.is-transfer {
  background: rgba(230, 81, 0, 0.12);
  color: #D84315;
}

body.theme-dark .trip-type-badge.is-transfer {
  background: rgba(255, 112, 67, 0.18);
  color: #FF8A65;
}

.trip-duration-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trip-route-final-dest {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  display: block;
  margin-top: 2px;
}

.trip-result-card.is-transfer-card {
  padding: 16px 18px 14px;
  cursor: default;
}

.transfer-journey-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.transfer-leg-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-card);
  border: 1px solid var(--line-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.transfer-leg-box:hover {
  border-color: var(--cp);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateX(2px);
}

.transfer-leg-time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 54px;
  flex-shrink: 0;
}

.leg-time-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--mono);
}

.leg-time-val.is-delayed {
  color: var(--late);
}

.leg-time-struck {
  font-size: 10.5px;
  color: var(--ink-3);
  text-decoration: line-through;
  font-family: var(--mono);
}

.leg-stop-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.leg-number-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: inline-block;
  margin-right: 4px;
}

.transfer-leg-action-hint {
  margin-left: auto;
  align-self: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.7;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.transfer-leg-box:hover .transfer-leg-action-hint {
  color: var(--cp);
  opacity: 1;
  transform: translateX(2px);
}

.transfer-leg-node-line {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 14px;
  padding-top: 4px;
  flex-shrink: 0;
}

.transfer-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  z-index: 2;
}

.transfer-node-dot.origin-dot {
  background: var(--cp-deep);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1.5px var(--cp-deep);
}

.transfer-node-dot.transfer-dot {
  background: #E65100;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1.5px #E65100;
}

.transfer-node-dot.dest-dot {
  background: var(--ink);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1.5px var(--ink);
}

.transfer-v-line {
  position: absolute;
  top: 14px;
  bottom: -22px;
  width: 2px;
  background: var(--line);
  z-index: 1;
}

.transfer-leg-info-col {
  flex: 1;
  min-width: 0;
}

.transfer-leg-st-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.3;
}

.transfer-leg-st-name.dest-title {
  font-size: 14px;
  font-weight: 700;
}

.transfer-leg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.service-badge.sm {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 4px;
}

.platform-tag.sm {
  font-size: 10.5px;
  padding: 2px 6px;
}

.status-pill.sm {
  font-size: 10.5px;
  padding: 2px 6px;
}

.transfer-interchange-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 6px 64px;
  padding: 7px 12px;
  background: rgba(230, 81, 0, 0.08);
  border-left: 3px solid #E65100;
  border-radius: 4px;
}

body.theme-dark .transfer-interchange-banner {
  background: rgba(255, 112, 67, 0.12);
  border-left-color: #FF8A65;
}

.transfer-interchange-icon {
  font-size: 13px;
  color: #E65100;
  animation: spinSlow 8s linear infinite;
}

body.theme-dark .transfer-interchange-icon {
  color: #FF8A65;
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.transfer-interchange-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.interchange-title {
  font-size: 12px;
  color: var(--ink);
}

.interchange-wait {
  font-size: 11.5px;
  color: var(--ink-2);
}

.transfer-dest-arrival-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 4px;
}

.transfer-card-footer-cta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.btn-view-transfer-journey {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 119, 200, 0.08);
  border: 1px solid rgba(0, 119, 200, 0.2);
  border-radius: var(--r-sm);
  color: var(--cp);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-view-transfer-journey:hover {
  background: var(--cp);
  border-color: var(--cp);
  color: #FFFFFF;
}

.journey-segment-header-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  margin: 12px 0 8px;
  background: var(--surface-card);
  border-left: 3px solid var(--cp);
  border-radius: 4px;
  list-style: none;
}

.journey-segment-header-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.journey-segment-header-badge i {
  color: var(--cp);
}

.journey-segment-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.journey-transfer-interchange-item {
  list-style: none;
  margin: 14px 0 14px;
  padding: 0 4px;
}

.journey-interchange-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(230, 81, 0, 0.08);
  border: 1.5px dashed #E65100;
  border-radius: var(--r-sm);
}

body.theme-dark .journey-interchange-inner {
  background: rgba(255, 112, 67, 0.12);
  border-color: #FF8A65;
}

.journey-interchange-icon {
  font-size: 16px;
  color: #E65100;
  margin-top: 2px;
  animation: spinSlow 8s linear infinite;
}

body.theme-dark .journey-interchange-icon {
  color: #FF8A65;
}

.journey-interchange-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.journey-interchange-text .interchange-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.journey-interchange-text .interchange-times {
  font-size: 12.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.interchange-wait-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: #E65100;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
}

body.theme-dark .interchange-wait-pill {
  background: #FF8A65;
  color: #121212;
}

.stop-badge-pill.transfer-pill {
  background: rgba(230, 81, 0, 0.12);
  color: #D84315;
}

body.theme-dark .stop-badge-pill.transfer-pill {
  background: rgba(255, 112, 67, 0.18);
  color: #FF8A65;
}

.stop-item-dot.origin-dot {
  background: var(--cp-deep) !important;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--cp-deep) !important;
}

.stop-item-dot.transfer-dot {
  background: #E65100 !important;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px #E65100 !important;
}

.stop-item-dot.dest-dot {
  background: var(--ink) !important;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink) !important;
}

.bottom-slide-sheet {
  position: absolute;
  inset: 0;
  z-index: 160;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: inherit;
  overflow: hidden;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  animation: fadeInScrim 0.2s ease;
}

@keyframes fadeInScrim { from { opacity: 0; } to { opacity: 1; } }

.sheet-card-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  max-height: 85dvh;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 12px 18px calc(var(--bottom) + 20px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUpSheet 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-pull-handle {
  width: 38px;
  height: 4.5px;
  background: var(--line);
  border-radius: 3px;
  margin: 4px auto 12px;
}

.sheet-station-head, .sheet-journey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-station-name, .journey-head-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.sheet-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-circle-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-card);
  color: var(--ink-2);
  font-size: 16px;
}

.icon-circle-btn:hover { background: var(--line-soft); color: var(--ink); }
.icon-circle-btn.is-fav-active { color: var(--cp-deep); }

.sheet-station-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.mode-switch-group {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px;
  background: var(--surface-card);
}

.mode-opt {
  flex: 1;
  padding: 6px 12px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--r-pill);
  color: var(--ink-2);
  text-align: center;
}

.mode-opt.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.station-filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip-btn {
  padding: 5px 12px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-2);
  white-space: nowrap;
}

.filter-chip-btn.is-active {
  background: var(--cp-deep);
  color: #FFFFFF;
  border-color: var(--cp-deep);
}

.comboios-content-panel {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px calc(var(--tabbar-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comboios-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  margin: auto 0;
}

.comboios-empty-state[hidden] {
  display: none !important;
}

.comboios-empty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--cp-tint);
  color: var(--cp);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 16px;
}

.comboios-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.comboios-empty-text {
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 290px;
  line-height: 1.45;
  margin: 0;
}

.station-board-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.comboios-tab-station-head {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}

.journey-card-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.journey-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}

.station-board-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.board-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 8px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  border-radius: var(--r-md);
  transition: background 0.15s ease;
}

.board-row:hover { background: var(--cp-tint); }

.board-time-cell {
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}

.board-time-real {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.board-time-real.is-delayed {
  color: var(--late);
  font-weight: 750;
}

.board-time-real.on-time {
  color: var(--ink);
}

.board-time-sched.is-struck {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: line-through;
  letter-spacing: 0;
}

.board-dest-box {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.board-dest-name {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.board-service-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.service-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  color: var(--ink);
}

.service-badge[data-t="AP"] { background: #E8F4FD; color: #0C6291; border-color: #BEE3F8; }
.service-badge[data-t="IC"] { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.service-badge[data-t="IR"] { background: #F3E8FF; color: #6B21A8; border-color: #E9D5FF; }
.service-badge[data-t="R"] { background: #EFF6FF; color: #1D4ED8; border-color: #DBEAFE; }
.service-badge[data-t="U"] { background: var(--cp-tint); color: var(--cp-deep); border-color: #C6F6D5; }

body.theme-dark .service-badge[data-t="AP"] { background: rgba(12, 98, 145, 0.28); color: #7FD3FF; border-color: rgba(12, 98, 145, 0.45); }
body.theme-dark .service-badge[data-t="IC"] { background: rgba(146, 64, 14, 0.28); color: #FCD34D; border-color: rgba(146, 64, 14, 0.45); }
body.theme-dark .service-badge[data-t="IR"] { background: rgba(107, 33, 168, 0.28); color: #D8B4FE; border-color: rgba(107, 33, 168, 0.45); }
body.theme-dark .service-badge[data-t="R"] { background: rgba(29, 78, 216, 0.28); color: #93C5FD; border-color: rgba(29, 78, 216, 0.45); }
body.theme-dark .service-badge[data-t="U"] { background: rgba(56, 169, 255, 0.18); color: var(--cp-green); border-color: rgba(56, 169, 255, 0.35); }

.board-status-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
}

.status-pill.on { background: var(--cp-tint); color: var(--cp-deep); }
.status-pill.late { background: var(--late-bg); color: var(--late); }
.status-pill.cancel { background: var(--cancel-bg); color: var(--cancel); }

.platform-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.board-loading-skeleton {
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton-shimmer-bar {
  height: 48px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--surface-card) 25%, var(--cp-tint) 50%, var(--surface-card) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.journey-header-route {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.journey-head-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.journey-number-tag { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.journey-time-tag { font-size: 13px; color: var(--ink-3); }

.journey-stops-container {
  flex: 1;
  overflow-y: auto;
}

.journey-stops-list {
  list-style: none;
  position: relative;
  padding: 8px 0;
  margin: 0;
}

.stop-item-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 10px;
  border-radius: var(--r-md);
  transition: background 0.15s ease;
}

.stop-item-row.is-origin { background: rgba(0, 119, 200, 0.08); }
.stop-item-row.is-dest { background: rgba(0, 119, 200, 0.12); }

.stop-timeline-col {
  width: 22px;
  position: relative;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}

.stop-timeline-col::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2.5px;
  background: var(--line);
  z-index: 1;
}

.stop-item-row:first-child .stop-timeline-col::before { top: 50%; }
.stop-item-row:last-child .stop-timeline-col::before { bottom: 50%; }

.stop-item-dot {
  position: relative;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid #0077C8;
  box-sizing: border-box;
}

.stop-item-row.is-passed .stop-item-dot {
  background: var(--line);
  border-color: var(--line);
}

.stop-item-row.is-passed .stop-item-name {
  color: var(--ink-3);
}

.stop-item-row.is-next {
  background: rgba(0, 119, 200, 0.08);
}

.stop-item-row.is-next .stop-item-name {
  color: #0077C8;
  font-weight: 700;
  font-size: 15.5px;
}

.stop-item-row.is-next .stop-item-dot {
  width: 15px;
  height: 15px;
  background: #0077C8;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 3px #0077C8;
  animation: pulseNextDot 1.8s infinite;
}

@keyframes pulseNextDot {
  0% { box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.7); }
  70% { box-shadow: 0 0 0 7px rgba(0, 119, 200, 0); }
  100% { box-shadow: 0 0 0 2px rgba(0, 119, 200, 0.7); }
}

.stop-item-row.is-origin .stop-item-dot {
  width: 16px;
  height: 16px;
  background: #0077C8;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 0 2px #0077C8;
}

.stop-item-row.is-dest .stop-item-dot {
  width: 16px;
  height: 16px;
  background: #103F1C;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 0 2px #103F1C;
}

.stop-item-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stop-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-item-name {
  font-size: 15px;
  font-weight: 550;
  color: var(--ink);
}

.stop-item-row.is-origin .stop-item-name,
.stop-item-row.is-dest .stop-item-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}

.stop-badge-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stop-badge-pill.origin {
  background: #E8F5E9;
  color: #0077C8;
  border: 1px solid rgba(0, 119, 200, 0.25);
}

.stop-badge-pill.dest {
  background: #103F1C;
  color: #FFFFFF;
}

.stop-badge-pill.next {
  background: #0077C8;
  color: #FFFFFF;
  border: 1px solid rgba(0, 119, 200, 0.4);
}

.stop-time-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}

.stop-time-real {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.stop-time-real.is-delayed {
  color: var(--late);
  font-weight: 750;
}

.stop-time-real.on-time {
  color: var(--ink);
}

.stop-time-scheduled.is-struck {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: line-through;
  letter-spacing: 0;
}

.stop-item-row.is-passed { opacity: 0.55; }
.stop-item-row.is-passed .stop-time-real { color: var(--ink-3); }
.stop-item-row.is-next .stop-time-real { color: var(--cp-green); font-weight: 800; }

@media (prefers-color-scheme: dark) {
  .stop-badge-pill.origin {
    background: rgba(0, 119, 200, 0.35);
    color: #4ADE80;
    border-color: rgba(74, 222, 128, 0.4);
  }
  .stop-item-row.is-origin { background: rgba(74, 222, 128, 0.08); }
  .stop-item-row.is-dest { background: rgba(74, 222, 128, 0.12); }
}

.side-drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.drawer-panel {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--top) + 12px) 20px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.drawer-heading-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.drawer-close-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink-2);
  background: var(--surface-card);
  font-size: 18px;
  transition: background 0.15s, color 0.15s;
}

.drawer-close-btn:hover { background: var(--line-soft); color: var(--ink); }

.drawer-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.drawer-user-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 0.15s;
}

body.theme-dark .drawer-user-preview {
  background: var(--surface-card);
  box-shadow: none;
}

.drawer-user-preview:hover {
  background: var(--surface-hover);
}

.drawer-avatar-wrap {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex: none;
  overflow: hidden;
}

body.theme-dark .drawer-avatar-wrap {
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.drawer-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--cp-green);
}

.drawer-google-logo-svg,
.google-logo-svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  stroke: none !important;
  stroke-width: 0 !important;
  display: block;
}

.drawer-google-logo-svg path,
.google-logo-svg path {
  stroke: none !important;
  stroke-width: 0 !important;
}

.drawer-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-user-name { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.drawer-user-status { font-size: 13px; color: var(--ink-3); font-weight: 500; }

.drawer-logout-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--ink-3);
  margin-left: auto;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
}

.drawer-logout-btn:hover {
  background: var(--cancel-bg);
  color: var(--cancel);
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: none;
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.theme-dark .drawer-nav-list {
  background: var(--surface-card);
  box-shadow: none;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}

.drawer-item:hover { background: var(--cp-tint); color: var(--cp-deep); }

@media (prefers-color-scheme: dark) {
  .drawer-item:hover { color: var(--cp-green); }
}

body.theme-dark .drawer-item:hover { color: var(--cp-green); }
body.theme-light .drawer-item:hover { color: var(--cp-deep); }

.drawer-item-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-card);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}

.drawer-item:hover .drawer-item-icon-box {
  background: var(--cp-deep);
  color: #FFFFFF;
}

.drawer-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 6px 0;
}

.drawer-footer {
  padding: 14px 20px calc(var(--bottom) + 14px);
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

.cal-popover {
  position: absolute;
  inset: 0;
  z-index: 150;
  background: rgba(0,0,0,0.5);
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: inherit;
  overflow: hidden;
}

.cal-surface {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.cal-nav { padding: 4px 10px; font-size: 18px; color: var(--ink-2); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-dow { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }

.cal-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.cal-day:hover { background: var(--cp-tint); }

.cal-day.is-sel { background: var(--cp-deep); color: #FFFFFF; font-weight: 700; }
.cal-day.is-today { border: 1.5px solid var(--cp-green); }
.cal-day.is-off { opacity: 0.25; pointer-events: none; }

.cal-quick-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.cal-quick-chip {
  flex: 1;
  padding: 8px;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.toast {
  position: absolute;
  bottom: calc(var(--tabbar-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 250;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 550;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tabbar-item.is-disabled-btn,
.drawer-item.is-disabled-btn,
.map-floating-pill-btn.is-disabled-btn,
.icon-circle-btn.is-disabled-btn,
#btn-planner-save-fav.is-disabled-btn,
#btn-add-fav-trip.is-disabled-btn {
  opacity: 0.42 !important;
  cursor: pointer !important;
  transform: none !important;
  box-shadow: none !important;
}

.tabbar-item.is-disabled-btn:hover {
  opacity: 0.58 !important;
}

.drawer-item.is-disabled-btn:hover {
  background: var(--surface-card) !important;
  color: var(--ink-3) !important;
}

.map-floating-pill-btn.is-disabled-btn:hover {
  background: var(--cp-deep) !important;
  color: #FFFFFF !important;
}

.icon-circle-btn.is-disabled-btn:hover {
  background: var(--surface-card) !important;
  color: var(--ink-3) !important;
}

#btn-planner-save-fav.is-disabled-btn:hover {
  background: var(--surface-card) !important;
  color: var(--cp) !important;
  border-color: var(--cp) !important;
}

.fav-locked-card {
  padding: 42px 20px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fav-locked-icon-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--cp-tint);
  color: #0077C8;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 18px;
}

.fav-locked-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.fav-locked-desc {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
  margin-bottom: 24px;
  max-width: 320px;
}

.btn-google-auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  padding: 13px 20px;
  background: #FFFFFF;
  color: #3C4043;
  border: 1.5px solid #DADCE0;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(60,64,67, 0.08);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn-google-auth-main:hover {
  background: #F8F9FA;
  border-color: #D2E3FC;
  box-shadow: 0 2px 8px rgba(60,64,67, 0.15);
}
.btn-google-auth-main:active { transform: scale(0.98); }
.btn-google-auth-main .google-logo-svg { width: 22px; height: 22px; }

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-3);
}

a, button, input, select,
.tabbar-item, .drawer-item, .fav-trip-card, .board-row, 
.nearby-station-card, .trip-result-card, .mode-opt, 
.filter-chip-btn, .station-chip-tag, .cal-day, .icon-circle-btn {
  touch-action: manipulation;
}

.tabbar, .screen-header, .topbar-standard, .fav-hero-header, 
.drawer-header, .segmented-pill-tabs, .mode-switch-group, 
.station-filter-chips, .map-ctrl-bar, .map-locate-btn, .map-floating-pill-btn {
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 580px) {
  body {
    padding: 10px 0;
  }

  .app-shell {
    height: min(97vh, 980px);
    max-height: 980px;
    border-radius: 28px;
    border: 2px solid var(--cp);
    box-shadow: none;
  }

  body.theme-dark .app-shell {
    border-color: var(--cp-green);
    box-shadow: none;
  }

  .side-drawer-backdrop {
    position: absolute;
    inset: 0;
    max-width: 100%;
    border-radius: 28px;
    overflow: hidden;
  }

  .app-fullscreen-modal {
    position: absolute;
    inset: 0;
    max-width: 100%;
    border-radius: 28px;
    overflow: hidden;
  }

  .bottom-slide-sheet {
    position: absolute;
    inset: 0;
    max-width: 100%;
    border-radius: 28px;
    overflow: hidden;
  }

  .sheet-card-panel {
    max-width: 100%;
    border-radius: 28px 28px 0 0;
  }

  .cal-popover {
    position: absolute;
    inset: 0;
    max-width: 100%;
    border-radius: 28px;
    overflow: hidden;
  }

  .toast {
    position: absolute;
    bottom: calc(var(--tabbar-h) + 16px);
  }
}

@media (max-width: 380px) {
  :root {
    --pad: 14px;
    --tabbar-h: calc(58px + var(--bottom));
  }

  .topbar-standard {
    padding-left: 12px;
    padding-right: 12px;
  }

  .screen-header {
    padding: calc(var(--top) + 4px) 14px 10px;
  }

  .screen-header-title {
    font-size: 19px;
  }

  .tabbar-item {
    padding: 6px 2px 4px;
  }

  .tabbar-label {
    font-size: 10.5px;
    letter-spacing: -0.02em;
  }

  .tabbar-icon-wrap {
    font-size: 17px;
  }

  .board-time-cell {
    width: 64px;
  }

  .board-time-real {
    font-size: 14.5px;
  }

  .board-dest-name {
    font-size: 14.5px;
  }

  .board-dest-box {
    padding: 0 8px;
  }

  .status-pill {
    font-size: 11px;
    padding: 2px 7px;
  }

  .fav-content-card {
    padding: 16px 12px 20px;
  }

  .fav-trip-title {
    font-size: 14.5px;
  }

  .fav-trip-badge-tag {
    font-size: 10.5px;
    padding: 2px 7px;
  }

  .mode-opt {
    font-size: 12px;
    padding: 5px 8px;
  }

  .filter-chip-btn {
    font-size: 11.5px;
    padding: 4px 10px;
  }

  .cal-surface {
    padding: 14px;
  }

  .cal-title {
    font-size: 15px;
  }

  .cal-day {
    font-size: 13px;
  }
}

@media (max-width: 330px) {
  :root {
    --pad: 10px;
  }

  .tabbar-label {
    font-size: 9.5px;
  }

  .tabbar-icon-wrap {
    font-size: 15px;
  }

  .board-time-cell {
    width: 56px;
  }

  .board-time-real {
    font-size: 13.5px;
  }

  .board-dest-name {
    font-size: 13.5px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --tabbar-h: calc(48px + var(--bottom));
  }

  .topbar-standard {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .screen-header {
    padding-top: 4px;
    padding-bottom: 6px;
  }

  .screen-header-title {
    font-size: 17px;
  }

  .screen-header-subtitle {
    display: none;
  }

  .fav-hero-header {
    padding-top: 8px;
    padding-bottom: 22px;
  }

  .fav-content-card {
    margin-top: -12px;
    padding: 12px 14px;
  }

  .sheet-card-panel {
    max-height: 94dvh;
  }

  .drawer-scroll-body {
    padding: 10px 14px;
  }
}

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


/* Bus Specific Additions (Preserving exact layout and design language) */
.stop-leaflet-tag {
  background: transparent;
  border: none;
}
.stop-leaflet-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.stop-leaflet-badge:hover {
  transform: scale(1.08);
  z-index: 1000 !important;
}
.stop-leaflet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.stop-leaflet-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #FFFFFF;
  background: var(--cp);
}
.stop-leaflet-badge.is-linhas .stop-leaflet-dot { background: #E30613; }
.stop-leaflet-badge.is-stcp .stop-leaflet-dot { background: #0077C8; }

.bus-live-map-icon {
  background: transparent;
  border: none;
}
.bus-marker-pin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #0077C8;
  color: #FFFFFF;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  font-size: 11px;
  font-weight: 800;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.bus-marker-pin.is-linhas { background: #E30613; }
.bus-marker-pin.is-stcp { background: #0077C8; }

.bus-heading-arrow {
  position: absolute;
  top: -7px;
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-bottom: 7px solid #FFFFFF;
}

.map-live-bus-pill {
  position: absolute;
  top: 16px;
  left: 68px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00E676;
  box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.4);
  animation: pulseLive 1.6s infinite;
}
@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

.res-network-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
}
.res-network-tag.is-linhas { background: rgba(227, 6, 19, 0.12); color: #E30613; }
.res-network-tag.is-stcp { background: rgba(0, 119, 200, 0.12); color: #0077C8; }

.line-number-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--cp);
  text-align: center;
}

/* Planner Stations Popover Specifics */
#dropdown-planner-stations {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  list-style: none;
  z-index: 1200;
}
#dropdown-planner-stations li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 550;
  transition: background 0.12s ease;
}
#dropdown-planner-stations li:last-child {
  border-bottom: none;
}
#dropdown-planner-stations li:hover {
  background: var(--cp-tint);
}

/* Interactive Planner Trip Cards */
.trip-result-card.is-interactive:hover {
  border-color: var(--cp) !important;
  box-shadow: 0 4px 16px rgba(0, 119, 200, 0.12);
}
.trip-result-card.is-interactive:active {
  transform: scale(0.99);
}
.planner-itinerary-drawer {
  animation: fadeInDown 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Planner Stops Scroll & Realtime Timeline */
.planner-stops-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.planner-stops-scroll::-webkit-scrollbar {
  width: 5px;
}
.planner-stops-scroll::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.timeline-stop-row:hover {
  background: var(--cp-tint);
  border-radius: var(--r-sm);
}

/* Primary CTA Blue Buttons */
.primary-green-cta-btn,
.primary-orange-cta-btn,
#btn-planner-step1-next,
#btn-planner-find-trains,
#btn-search-fav-trip-cta {
  background-color: #0077C8 !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.35) !important;
}
.primary-green-cta-btn:hover,
.primary-orange-cta-btn:hover,
#btn-planner-step1-next:hover,
#btn-planner-find-trains:hover,
#btn-search-fav-trip-cta:hover {
  background-color: #005FA3 !important;
}
