/* Autobuses Córdoba – estilos */

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

:root {
  --hdr:       #3f5a1b;
  --accent:    #d29a25;
  --bg:        #ececec;
  --card:      #f7f7f4;
  --text:      #1c2a05;
  --text2:     #505340;
  --border:    #d8d8d2;
  --stop-ring: #3f5a1b;
  --terminal:  #f2b51e;
  --green:     #2d8a3e;
  --red:       #c42020;
}

html { font-size: 16px; overscroll-behavior-y: contain; scrollbar-gutter: stable; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* ── Skip to content (accesibilidad) ───────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  background: var(--hdr);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 0 0 8px 8px;
  font-size: .9rem;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 0; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Splash screen ──────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, #5a7e2a 0%, #3f5a1b 55%, #2a3d12 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  color: #fff;
  overflow: hidden;
  transition: opacity .38s ease;
}
.splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.10) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 80%, rgba(255,255,255,.08) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 18%, rgba(255,255,255,.06) 0 1px, transparent 2px);
  background-size: 22px 22px, 36px 36px, 28px 28px;
  opacity: .6;
  pointer-events: none;
}
.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}
.splash-bus {
  width: 280px;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.4));
  animation: busDrive 1400ms cubic-bezier(.2,.7,.2,1) both;
}
@keyframes busDrive {
  0%   { transform: translateX(-140%) rotate(-1.5deg); opacity: 0; }
  55%  { transform: translateX(6%)    rotate(0.8deg);  opacity: 1; }
  75%  { transform: translateX(-2%)   rotate(-0.4deg); }
  100% { transform: translateX(0)     rotate(0deg);    opacity: 1; }
}
.splash-bus .wheel {
  transform-box: fill-box;
  transform-origin: center;
  animation: wheelSpin 800ms linear infinite;
}
@keyframes wheelSpin { to { transform: rotate(360deg); } }
.splash-title {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: .03em;
  color: #f6e2a8;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  text-align: center;
  margin: 0;
  animation: titleIn 700ms ease 250ms both;
}
.splash-sub {
  font-size: .82rem;
  letter-spacing: .28em;
  color: rgba(255,255,255,.78);
  text-transform: uppercase;
  margin: -20px 0 0;
  animation: titleIn 700ms ease 420ms both;
}
@keyframes titleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.splash-loader {
  display: flex;
  gap: 8px;
  animation: titleIn 700ms ease 600ms both;
}
.splash-loader span {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #f2b51e;
  animation: loaderBounce 900ms ease-in-out infinite;
}
.splash-loader span:nth-child(2) { animation-delay: 150ms; background: #f6e2a8; }
.splash-loader span:nth-child(3) { animation-delay: 300ms; background: #fff; }
@keyframes loaderBounce {
  0%, 80%, 100% { transform: translateY(0);    opacity: .4; }
  40%           { transform: translateY(-8px); opacity: 1; }
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: var(--hdr);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
}
.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  padding: .6rem .75rem;
  min-height: 52px;
}
.hdr-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .2rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1;
}
.hdr-btn:hover { color: #fff; }
.hdr-center {
  position: absolute;
  left: 0; right: 0;
  top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0 52px;
}
.hdr-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hdr-sub-inline {
  color: rgba(255,255,255,.85);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.hdr-spacer { flex-shrink: 0; width: 48px; }

/* ── Sección favoritos ──────────────────────────────────── */
.favs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem .9rem .45rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.favs-title {
  color: var(--accent);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.lines-header {
  margin-top: .75rem;
  padding: .55rem .9rem .45rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.lines-title {
  color: var(--text2);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
/* ── Feria section ───────────────────────────────────────── */
.favs-refresh-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: .1rem .3rem;
  display: inline-block;
}
.favs-refresh-btn:hover { color: var(--text); }
.favs-refresh-btn.spinning { animation: spin360 .7s linear infinite; }

.fav-row {
  display: flex;
  align-items: center;
  gap: .38rem;
  padding: .38rem .6rem .38rem .5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  min-height: 44px;
}
.fav-row:hover { background: #f7f7f7; }
.fav-row:last-child { border-bottom: 2px solid var(--border); }
.fav-row-dragging {
  opacity: .75;
  background: var(--bg) !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.13);
  z-index: 10;
  position: relative;
}
.fav-drag {
  background: none;
  border: none;
  color: var(--text2);
  cursor: grab;
  flex-shrink: 0;
  padding: .35rem .25rem;
  opacity: .45;
  touch-action: none;
  line-height: 1;
}
.fav-drag:active { cursor: grabbing; opacity: .9; }
.fav-badge {
  border-radius: 4px;
  flex-shrink: 0;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 3px 6px;
  min-width: 2.1rem;
  text-align: center;
}
.fav-badge-stop { background: var(--accent); color: #fff; }
.fav-badge-line { color: #fff; }
.fav-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .06rem;
}
.fav-name {
  color: var(--text);
  font-size: .87rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-sub {
  color: var(--text2);
  font-size: .71rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: .22rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: .16rem;
}
.fav-chips::-webkit-scrollbar { display: none; }
.fav-bus-chip {
  display: flex;
  align-items: center;
  gap: .22rem;
  background: var(--bg);
  border-radius: 5px;
  padding: 1px 5px 1px 2px;
  flex-shrink: 0;
}
.fav-bus-num {
  border-radius: 3px;
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 4px;
}
.fav-bus-mins {
  color: var(--text);
  font-size: .73rem;
  font-weight: 600;
}
.fav-alias-input {
  background: var(--bg);
  border: 1.5px solid var(--accent);
  border-radius: 5px;
  color: var(--text);
  font-size: .87rem;
  font-weight: 600;
  padding: 2px 6px;
  width: 100%;
  outline: none;
}
.fav-edit-btn,
.fav-remove-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  opacity: .5;
  padding: .35rem .22rem;
}
.fav-edit-btn { font-size: .78rem; }
.fav-remove-btn { font-size: .8rem; }
.fav-edit-btn:hover,
.fav-remove-btn:hover { opacity: 1; color: var(--text); }
.fav-loading { color: var(--text2); font-size: .72rem; }
.fav-no-buses { color: var(--text2); font-size: .72rem; }

/* ── Search bar ─────────────────────────────────────────── */
.search-wrapper {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: .6rem .9rem;
  gap: .55rem;
}
.search-icon { color: var(--text2); font-size: 1.1rem; flex-shrink: 0; }
.search-wrapper input {
  background: none;
  border: none;
  color: var(--text);
  flex: 1;
  font-size: .95rem;
  outline: none;
}
.search-wrapper input::placeholder { color: var(--text2); }

/* ── QR button in search bar ────────────────────────────── */
.qr-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: .2rem;
}
.qr-btn:hover { opacity: .75; }

/* ── QR Scanner overlay ─────────────────────────────────── */
.qr-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: env(safe-area-inset-top);
}
.qr-overlay.hidden { display: none; }
.qr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .65rem .75rem;
}
.qr-close {
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
}
.qr-title { color: #fff; font-size: .95rem; font-weight: 600; }
.qr-viewport {
  position: relative;
  width: min(85vw, 320px);
  aspect-ratio: 1;
  margin: 1.5rem auto;
}
.qr-viewport video {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
.qr-frame {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  border: 2px solid rgba(255,255,255,.6);
  pointer-events: none;
}
.qr-frame::before, .qr-frame::after,
.qr-frame > span::before, .qr-frame > span::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-color: #fff;
  border-style: solid;
}
.qr-hint  { color: rgba(255,255,255,.75); font-size: .9rem; text-align: center; }
.qr-status { color: #fff; font-size: .85rem; font-weight: 600; min-height: 1.2em; text-align: center; }

/* ── Card balance modal (dialog nativo → top layer) ─────── */
#cardModal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 480px;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  background: transparent;
}
#cardModal::backdrop {
  background: rgba(0,0,0,.45);
}
.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-header h2 {
  color: var(--text);
  font-size: 1.05rem;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: .2rem .4rem;
}
.modal-body {
  padding: 1.2rem;
}
.modal-hint {
  color: var(--text2);
  font-size: .9rem;
  margin: 0 0 1rem;
}
#cardInput {
  width: 100%;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1.05rem;
  letter-spacing: .15em;
  padding: .8rem .7rem;
  margin-bottom: .8rem;
  font-family: monospace;
  font-weight: 600;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
#cardInput::placeholder {
  color: var(--text2);
  opacity: .8;
}
#cardInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 92, 53, .1);
}
#cardCheckBtn {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem;
  transition: background .2s, opacity .15s;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#cardCheckBtn:hover:not(:disabled) {
  background: #1a4a2b;
}
#cardCheckBtn:active:not(:disabled) {
  opacity: .9;
}
#cardCheckBtn:disabled {
  opacity: .6;
  cursor: not-allowed;
}
#cardResult {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
}
#cardResult.hidden {
  display: none;
}
.card-type {
  color: var(--text2);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 .6rem;
}
.card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .6rem;
}
.card-label {
  color: var(--text2);
  font-size: .9rem;
}
.card-balance {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}
.card-note {
  color: var(--text2);
  font-size: .82rem;
  margin: .5rem 0 0;
}
.card-error {
  color: #d32f2f;
  font-size: .9rem;
  margin-top: .8rem;
  padding: .6rem;
  background: rgba(211, 47, 47, .1);
  border-radius: 6px;
}
.card-error.hidden {
  display: none;
}

/* ── Generic item list ──────────────────────────────────── */
.item-list { list-style: none; background: var(--card); }

.item-list li {
  background: linear-gradient(to bottom, #ffffff, #f6f6f6);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background .1s;
}
.item-list li:last-child { border-bottom: none; }
.item-list li:hover, .item-list li.active { background: #f7f7f7; }

/* ── Line item ──────────────────────────────────────────── */
.item-list li.line-item {
  display: flex;
  align-items: center;
  padding: 0;
  cursor: pointer;
}

.line-num {
  align-items: center;
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 800;
  justify-content: center;
  min-height: 54px;
  width: 58px;
}
.line-label {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  padding: .8rem .75rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.item-chevron {
  color: var(--border);
  font-size: 1.5rem;
  font-weight: 300;
  padding: 0 .75rem;
  line-height: 1;
}

/* Stop item (within a line) */
.stop-circle-wrap {
  position: relative;
  width: 52px;
  flex-shrink: 0;
  align-self: stretch;
  overflow: hidden;
}
.stop-circle-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 7px;
  background: var(--stop-ring);
  transform: translateX(-50%);
}
#stopsList li:only-child  .stop-circle-wrap::before { display: none; }
#stopsList li:first-child .stop-circle-wrap::before { top: 50%; }
#stopsList li:last-child  .stop-circle-wrap::before { bottom: 50%; }
.stop-circle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 5px solid var(--stop-ring);
  background: #fff;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.stop-circle.terminal {
  width: 30px; height: 30px;
  background: var(--terminal);
  border-color: var(--stop-ring);
}
.stop-chevron {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--stop-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  margin-right: .75rem;
}

.stop-info { flex: 1 1 0; overflow: hidden; padding: .75rem .5rem; }
.stop-label {
  color: var(--text);
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Separación entre filas — sin gap para no cortar la línea verde */
#stopsList li {
  background: linear-gradient(to right, #eff7ed, #ffffff);
  border-bottom: none;
  overflow: hidden;
}
#stopsList li:last-child { border-bottom: none; }

/* Generic stop badge (search results) */
.stop-num {
  background: var(--accent);
  border-radius: 5px;
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  min-width: 2.6rem;
  padding: 4px 8px;
  text-align: center;
  flex-shrink: 0;
  margin: 0 .75rem;
}
.stop-name { flex: 1; font-size: .97rem; padding: .72rem 0; }

.list-loading {
  color: var(--text2);
  font-size: .88rem;
  padding: 1.2rem 1rem;
  cursor: default !important;
  background: none !important;
}
.hint-text {
  color: var(--text2);
  font-size: .85rem;
  padding: 1.5rem 1rem;
  text-align: center;
}

.line-chevron {
  margin-right: .85rem;
  color: #bbb;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Line favourite star */
.line-fav-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
  opacity: .4;
  padding: .6rem .45rem;
  transition: color .15s, opacity .15s;
}
.line-fav-btn:hover { opacity: .85; }
.line-fav-btn.active { color: #f0c040; opacity: 1; }

/* ── Line banner (stops view) ───────────────────────────── */
.line-banner { display: flex; align-items: center; }
.line-banner-badge {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 1.05rem;
  font-weight: 800;
  justify-content: center;
  min-height: 52px;
  width: 58px;
  background: rgba(0,0,0,.2);
  flex-shrink: 0;
}
.line-banner-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .22rem;
  padding: .45rem .65rem;
}
.line-banner-name {
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.dir-pill {
  align-self: flex-start;
  background: rgba(255,255,255,.22);
  border: none;
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: .25rem .75rem;
  text-transform: uppercase;
  transition: background .15s;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-pill:hover         { background: rgba(255,255,255,.38); }
.dir-pill.no-toggle     { cursor: default; pointer-events: none; }

/* ── Stop banner (times view) ───────────────────────────── */
.stop-banner {
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .9rem;
  gap: .5rem;
}
.stop-banner-name { color: #fff; font-size: .9rem; font-weight: 700; flex: 1; }
.stop-banner-right { display: flex; align-items: center; gap: .45rem; flex-shrink: 0; }
.icon-btn-dark {
  background: rgba(0,0,0,.18);
  border: none;
  border-radius: 50%;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.icon-btn-dark:hover { background: rgba(0,0,0,.3); }
#refreshBtn.spinning svg { animation: spin360 .7s linear infinite; }
@keyframes spin360 { to { transform: rotate(360deg); } }

#refreshOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.refresh-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(255,255,255,.2);
  border-top-color: #8bc34a;
  border-radius: 50%;
  animation: spin360 .7s linear infinite;
}

/* ── Arrivals ───────────────────────────────────────────── */
#timesContent { display: flex; flex-direction: column; gap: 1px; background: var(--border); }
.line-section  { background: var(--card); }

.line-header {
  color: #fff;
  display: flex;
  align-items: stretch;
  min-height: 50px;
}
.line-badge {
  align-items: center;
  background: rgba(0,0,0,.2);
  color: #fff;
  display: flex;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 800;
  justify-content: center;
  padding: 0 .75rem;
  min-width: 52px;
}
.line-route {
  color: rgba(255,255,255,.9);
  flex: 1;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .65rem .65rem;
  text-transform: uppercase;
  align-self: center;
}
.time-row {
  align-items: center;
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: .72rem .9rem;
}
.time-row:last-child { border-bottom: none; }
.time-label { color: var(--text2); font-size: .85rem; }
.time-mins  { font-size: 1.05rem; font-weight: 800; }
.time-now   { animation: now-pulse 1s ease-in-out infinite; }
@keyframes now-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .35; }
}

.no-buses { color: var(--text2); font-size: .9rem; padding: 1.5rem; text-align: center; background: var(--card); }
.loading   { color: var(--text2); font-size: .9rem; padding: 1.5rem; text-align: center; background: var(--card); }

/* ── Empty states ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 2.8rem 1.5rem;
  text-align: center;
  background: var(--card);
}
.empty-state-icon { color: var(--border); line-height: 0; }
.empty-state-title { color: var(--text2); font-size: .95rem; font-weight: 600; margin: 0; }
.empty-state-sub   { color: var(--text2); font-size: .8rem; opacity: .75; margin: 0; max-width: 22ch; line-height: 1.4; }

/* ── Banner instalar PWA ────────────────────────────────── */
.install-banner {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px)); /* encima del ad-slot */
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .75rem;
  z-index: 150;
  animation: banner-up .3s ease;
}
@keyframes banner-up {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.ios-banner { bottom: 72px; }
.install-banner-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}
.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.install-banner-text strong {
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.install-banner-text span {
  font-size: .85rem;
  color: var(--text2);
}
.install-banner-btn {
  background: var(--hdr);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  padding: .5rem .95rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.install-banner-btn:hover { opacity: .88; }
.install-banner-dismiss {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 1rem;
  padding: .2rem;
  flex-shrink: 0;
  line-height: 1;
}
.install-banner-dismiss:hover { color: var(--text); }

/* ── Promo bar (fijo en pie de pantalla) ─────────────────── */
.promo-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  overflow: hidden;
  z-index: 100;
}
.promo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 320px;
  height: 50px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  background: #f9f9f9;
  gap: 2px;
}
.promo-placeholder-label {
  color: #bbb;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.promo-placeholder-size {
  color: #ccc;
  font-size: .6rem;
}

.partner-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: calc(100% - 24px);
  max-width: 456px;
  height: 50px;
  padding: 0 1rem 0 .85rem;
  background: linear-gradient(100deg, #6b1010 0%, #9b2a10 60%, #b84010 100%);
  text-decoration: none;
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: filter .15s;
}
.partner-agenda {
  background: linear-gradient(100deg, #0f1a2e 0%, #1a2a45 60%, #1e3255 100%);
}
.partner-aucorsa {
  background: linear-gradient(100deg, #0d4028 0%, #166c4b 60%, #1a7d57 100%);
}
.partner-cordoba {
  background: linear-gradient(100deg, #0d3318 0%, #1a5c2a 60%, #1e6b30 100%);
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  position: relative;
  transition: filter .15s;
}
.partner-card:hover { filter: brightness(1.1); }
.partner-icon { font-size: 1.7rem; flex-shrink: 0; line-height: 1; }
.partner-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.partner-title {
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.partner-sub {
  font-size: .75rem;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
}
.partner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.partner-cta {
  font-size: .82rem;
  font-weight: 700;
  color: #ffd080;
  white-space: nowrap;
}
.partner-agenda .partner-cta { color: #f5c518; }
.partner-agenda .partner-title { color: #fff; }
.partner-agenda .partner-sub { color: rgba(255,255,255,.68); }
.partner-tag {
  font-size: .48rem;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* ── Admin ──────────────────────────────────────────────── */
.admin-section {
  background: var(--card);
  border-top: 3px solid var(--hdr);
  margin-top: 1.5rem;
}
.admin-section details > summary {
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  padding: .75rem 1rem;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--hdr);
}
.admin-section details > summary::-webkit-details-marker { display: none; }
.admin-section details[open] > summary { border-bottom: 1px solid var(--border); }
.admin-body { padding: 1rem; display: flex; flex-direction: column; gap: .9rem; }
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn {
  border: none; border-radius: 6px; cursor: pointer;
  font-size: .85rem; font-weight: 600; padding: .45rem .9rem; transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary   { background: var(--hdr); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-success   { background: var(--green); color: #fff; }
.btn-danger    { background: var(--red); color: #fff; font-size: .78rem; padding: 3px 8px; }
.btn-warning   { background: #c88000; color: #fff; font-size: .78rem; padding: 3px 8px; }
.admin-message { border-radius: 6px; font-size: .85rem; padding: .55rem .85rem; }
.admin-message.success { background: #d4f0db; border: 1px solid var(--green); color: #1a5028; }
.admin-message.error   { background: #f8d8d8; border: 1px solid var(--red);   color: #8a1010; }
.add-stop-form { border: 1px solid var(--border); border-radius: 6px; padding: .8rem; }
.add-stop-form legend { color: var(--text2); font-size: .82rem; font-weight: 600; padding: 0 .35rem; }
.form-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; align-items: flex-end; }
.form-row label { display: flex; flex-direction: column; font-size: .75rem; color: var(--text2); gap: 3px; }
.form-row input {
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  color: var(--text); font-size: .85rem; padding: .35rem .65rem; width: 110px; outline: none;
}
.form-row input:focus { border-color: var(--accent); }
.admin-filter {
  background: var(--bg); border: 1px solid var(--border); border-radius: 5px;
  color: var(--text); font-size: .85rem; margin-bottom: .5rem; outline: none;
  padding: .35rem .65rem; width: 100%;
}
#stopsTable { width: 100%; border-collapse: collapse; font-size: .82rem; }
#stopsTable th {
  color: var(--text2); font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  padding: .4rem .55rem; text-align: left; text-transform: uppercase;
  border-bottom: 2px solid var(--border);
}
#stopsTable td { padding: .4rem .55rem; border-bottom: 1px solid var(--border); }
#stopsTable tr.inactive td { color: var(--text2); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; }
.status-dot.on  { background: var(--green); }
.status-dot.off { background: var(--red); }

/* ── Footer ─────────────────────────────────────────────── */
.features-section {
  max-width: 480px;
  margin: 0 auto;
  padding: 1.4rem 1rem 1rem;
  border-top: 1px solid var(--border);
}
.features-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text2);
  margin: 0 0 .9rem;
}
.features-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.features-list li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.feat-icon {
  font-size: 1.1rem;
  line-height: 1.3;
  flex-shrink: 0;
}
.features-list div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.features-list strong {
  font-size: .82rem;
  color: var(--text);
}
.features-list span {
  font-size: .75rem;
  color: var(--text2);
  line-height: 1.4;
}

footer {
  color: var(--text2);
  font-size: .72rem;
  margin-top: auto;
  padding: .9rem;
  text-align: center;
}
footer a { color: var(--hdr); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .25rem; }
.footer-link-btn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--hdr); font: inherit; cursor: pointer;
  text-decoration: none;
}
.footer-link-btn:hover { text-decoration: underline; }
#appVersion { margin-top: .4rem; opacity: .75; }

/* ── Modal de contacto ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn .15s ease;
}
.modal-box {
  background: var(--card);
  border-radius: 14px;
  padding: 1.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  animation: slideUp .18s ease;
}
.modal-close {
  position: absolute;
  top: .6rem; right: .7rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text2);
  padding: .25rem .4rem;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}
.contact-form { display: flex; flex-direction: column; gap: .7rem; }
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text2);
}
.contact-form input,
.contact-form textarea {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: .55rem .7rem;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  width: 100%;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 90px; }
.contact-error { color: #c00; font-size: .8rem; margin-top: -.2rem; }
.modal-submit {
  background: var(--hdr);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .65rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: .15rem;
}
.modal-submit:hover { opacity: .88; }
@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ── Utils ──────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animaciones de vista (slide) ───────────────────────── */
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(44px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-44px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-in-right { animation: slide-in-right .23s cubic-bezier(.25,.46,.45,.94) both; }
.slide-in-left  { animation: slide-in-left  .23s cubic-bezier(.25,.46,.45,.94) both; }

/* ── Skeleton shimmer ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    var(--border) 0%, var(--bg) 50%, var(--border) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Skeleton rows ──────────────────────────────────────── */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem;
  border-bottom: 1px solid var(--border);
  pointer-events: none;
}
.sk-badge   { width: 46px; height: 46px; border-radius: 6px; flex-shrink: 0; }
.sk-circle  { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.sk-label   { flex: 1; height: 14px; border-radius: 6px; }
.sk-chevron { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }

/* ── Time urgency ───────────────────────────────────────── */
.time-row--urgent { background: rgba(22,163,74,.06); }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.82);
  color: #fff;
  border-radius: 20px;
  padding: .5rem 1.2rem;
  font-size: .85rem;
  z-index: 300;
  white-space: nowrap;
  animation: toast-in .2s ease;
  transition: opacity .3s;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.toast-out { opacity: 0; }

@media (min-width: 481px) { body { box-shadow: 0 0 30px rgba(0,0,0,.1); } }
@media (max-width: 480px) {
  .form-row input { width: 100%; }
  .form-row { flex-direction: column; }
}

/* ── Planificador de viaje ──────────────────────────────── */
.planner-box {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: .9rem 1rem .6rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.planner-inputs { display: flex; flex-direction: column; gap: 0; }
.planner-field-wrap { display: flex; flex-direction: column; }
.planner-field-sub {
  font-size: .76rem; color: var(--text2);
  padding: .15rem .75rem .25rem 2.2rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.planner-field {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem 0;
}
.planner-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.dot-origin { background: var(--green); }
.dot-dest   { background: var(--red); }
.planner-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .8rem;
  font-size: .95rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-width: 0;
}
.planner-input:focus { border-color: var(--stop-ring); box-shadow: 0 0 0 2px rgba(63,90,27,.15); }
.planner-clear {
  border: none; background: none; cursor: pointer;
  color: var(--text2); padding: .3rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.planner-clear:hover { background: var(--border); }
.planner-middle-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .1rem 0;
}
.planner-vline {
  width: 2px; height: 24px; background: var(--border);
  border-radius: 1px; margin-left: 5px;
}
.planner-swap {
  border: 1px solid var(--border); background: var(--card);
  border-radius: 50%; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2);
  transition: background .15s;
  margin-left: auto;
}
.planner-swap:hover { background: var(--bg); color: var(--text); }
.planner-dropdown {
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  margin-top: .3rem;
  max-height: 260px;
  overflow-y: auto;
  position: relative;
  z-index: 20;
}
.planner-stop-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem .9rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.planner-stop-item:last-child { border-bottom: none; }
.planner-stop-item:hover { background: var(--bg); }
.psi-code {
  font-size: .75rem; font-weight: 700; color: var(--text2);
  background: var(--border); border-radius: 4px;
  padding: .15rem .4rem; flex-shrink: 0;
}
.psi-name { font-size: .9rem; color: var(--text); flex: 1; }
.psi-walk { font-size: .75rem; color: var(--text2); white-space: nowrap; flex-shrink: 0; }
.psi-loading { color: var(--text2); font-size: .85rem; font-style: italic; }
.planner-results { padding: .8rem .8rem 1rem; display: flex; flex-direction: column; gap: .7rem; }
.planner-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem .9rem;
  cursor: pointer;
  transition: background .15s;
}
.planner-card:hover { background: var(--bg); }
.planner-card-top {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem;
}
.planner-badge {
  font-size: .82rem !important; padding: .2rem .55rem !important;
  border-radius: 6px !important; font-weight: 700 !important;
  line-height: 1.3; flex-shrink: 0;
}
.planner-headsign {
  font-size: .85rem; font-weight: 600; color: var(--text); flex: 1; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.planner-nstops {
  font-size: .78rem; color: var(--text2); white-space: nowrap; flex-shrink: 0;
}
.planner-legs { display: flex; flex-direction: column; gap: .35rem; }
.planner-leg {
  display: flex; align-items: center; gap: .6rem; font-size: .88rem;
}
.planner-leg .planner-dot { width: 10px; height: 10px; }
.leg-label { color: var(--text2); font-size: .8rem; white-space: nowrap; }
.leg-stop  { color: var(--text); font-weight: 500; }
.planner-empty { padding: 2rem 1rem; text-align: center; color: var(--text2); font-size: .9rem; }

/* ── Nearby stops ──────────────────────────────────────── */
.nearby-header {
  display: flex; align-items: center; gap: .4rem;
  padding: .6rem 1rem .3rem; color: var(--text2);
}
.nearby-header svg { fill: var(--hdr); flex-shrink: 0; }
.nearby-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--hdr); }
.nearby-loading { padding: .6rem 1rem; font-size: .85rem; color: var(--text2); margin: 0; }
.nearby-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .65rem 1rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s; list-style: none;
}
.nearby-item:hover { background: #f5f5f5; }
.nearby-code {
  font-size: .75rem; font-weight: 700; color: var(--text2);
  background: var(--border); border-radius: 5px;
  padding: .15rem .4rem; flex-shrink: 0; min-width: 28px; text-align: center;
}
.nearby-name { flex: 1; font-size: .9rem; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-dist { font-size: .78rem; color: var(--text2); white-space: nowrap; flex-shrink: 0; }
.nearby-btn {
  background: none; border: none; cursor: pointer;
  color: var(--hdr); padding: .3rem .4rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background .12s;
}
.nearby-btn:hover { background: rgba(0,0,0,.06); }
.nearby-btn.active { background: var(--hdr); color: #fff; }
.nearby-btn.active:hover { background: var(--hdr); opacity: .88; }
.nearby-btn svg { display: block; }

/* ── Times tabs (real-time / horarios) ─────────────────── */
.times-tabs {
  display: flex; border-bottom: 2px solid var(--border);
  background: var(--card);
}
.times-tab {
  flex: 1; padding: .65rem .5rem; font-size: .88rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text2); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color .15s;
}
.times-tab.active { color: var(--hdr); border-bottom-color: var(--hdr); }
.times-tab:hover:not(.active) { color: var(--text); }

/* ── Schedule view ─────────────────────────────────────── */
.sched-daytabs {
  display: flex; gap: .5rem; padding: .75rem 1rem .5rem;
}
.sched-daytab {
  padding: .35rem .9rem; border-radius: 20px; font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--border); background: none;
  color: var(--text2); cursor: pointer; transition: all .15s;
}
.sched-daytab.active {
  background: var(--hdr); border-color: var(--hdr); color: #fff;
}
.sched-line {
  padding: .75rem 1rem; border-bottom: 1px solid var(--border);
}
.sched-line-hdr {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem;
}
.sched-badge    { font-size: .8rem !important; padding: .15rem .5rem !important; border-radius: 5px !important; flex-shrink: 0; }
.sched-line-name { font-size: .82rem; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-times {
  display: flex; flex-wrap: wrap; gap: .3rem;
}
.sched-time {
  font-size: .8rem; font-weight: 500; color: var(--text);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: .2rem .45rem;
}
.sched-past { color: var(--text2); opacity: .45; }

/* ── Journey steps ─────────────────────────────────────── */
.pj-wrap   { display: flex; flex-direction: column; gap: 0; padding: .8rem; }
.pj-step   {
  display: flex; align-items: flex-start; gap: .8rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: .85rem .9rem;
}
.pj-icon   { font-size: 1.3rem; flex-shrink: 0; margin-top: .1rem; }
.pj-body   { flex: 1; min-width: 0; }
.pj-label  { font-size: .75rem; color: var(--text2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.pj-name   { font-size: 1rem; font-weight: 600; color: var(--text); }
.pj-code   { font-size: .8rem; color: var(--text2); margin-top: .1rem; }
.pj-times-btn {
  flex-shrink: 0; align-self: center;
  background: var(--hdr); color: #fff;
  border: none; border-radius: 8px;
  padding: .45rem .75rem; font-size: .82rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.pj-times-btn:hover { opacity: .88; }
.pj-connector {
  display: flex; align-items: center; gap: .6rem;
  padding: .15rem 1.1rem;
}
.pj-vline  { width: 2px; height: 18px; background: var(--border); border-radius: 1px; flex-shrink: 0; }
.pj-conn-info {
  display: flex; align-items: center; gap: .5rem; flex: 1;
  font-size: .82rem; color: var(--text2);
}
.pj-line-badge {
  font-size: .78rem !important; padding: .15rem .5rem !important;
  border-radius: 5px !important; font-weight: 700 !important; flex-shrink: 0;
}
.pj-back-btn {
  display: block; width: 100%; margin-top: .6rem;
  background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: .65rem;
  color: var(--text2); font-size: .88rem; cursor: pointer;
  text-align: center;
}
.pj-back-btn:hover { background: var(--bg); }

/* ── Planner results cards (prc) ───────────────────────── */
.prc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 0 .75rem .75rem;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}
.prc-card:first-child { margin-top: .5rem; }
.prc-card:hover, .prc-card:focus { box-shadow: 0 3px 12px rgba(0,0,0,.09); outline: none; }
.prc-row1 {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem;
}
.prc-transport { display: flex; align-items: center; gap: .2rem; font-size: .88rem; color: var(--text2); }
.prc-walk      { font-size: .82rem; color: var(--text2); }
.prc-chevron   { font-size: .8rem; color: var(--text2); }
.prc-bus-icon  { display: flex; align-items: center; flex-shrink: 0; }
.prc-badge     { font-size: .82rem !important; padding: .18rem .55rem !important; border-radius: 6px !important; flex-shrink: 0; }
.prc-duration  { margin-left: auto; font-size: .95rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.prc-row2 {
  display: flex; align-items: center; gap: .3rem;
  font-size: .88rem; font-weight: 500; color: var(--text); margin-bottom: .2rem;
}
.prc-stop-from, .prc-stop-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 42%; }
.prc-stop-arrow { color: var(--text2); flex-shrink: 0; font-size: .8rem; }
.prc-row3      { font-size: .76rem; color: var(--text2); }
/* Walk blocks — blocks 1 and 3 in the 3-block card layout */
.prc-walk-block {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem;
  font-size: .74rem; color: var(--text2);
  background: rgba(0,0,0,.03);
}
.prc-walk-block-from { border-bottom: 1px solid var(--border); }
.prc-walk-block-to   { border-top:    1px solid var(--border); }
.prc-wb-icon  { flex-shrink: 0; }
.prc-wb-min   { white-space: nowrap; font-weight: 600; flex-shrink: 0; }
.prc-wb-path  { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prc-route-block { padding: .65rem .9rem .55rem; }
.prc-badge-xs {
  display: inline-block; flex-shrink: 0;
  font-size: 1rem; font-weight: 800; line-height: 1;
  padding: .15em .38em; border-radius: 4px;
  vertical-align: middle;
}

/* Journey timeline walk segments */
.pjt-node-user   { background: #4285f4; border-color: #4285f4; }
.pjt-line-seg-walk {
  flex: 1; width: 3px; min-height: 16px; border-radius: 2px;
  background: repeating-linear-gradient(to bottom, #aaa 0, #aaa 4px, transparent 4px, transparent 8px);
}
.pjt-walk-label { color: #4285f4 !important; font-style: italic; }

/* ── Journey timeline view (pjt) ───────────────────────── */
.pjt-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 0; margin: .5rem .6rem;
  overflow: hidden;
}
.pjt-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem .9rem; border-bottom: 1px solid var(--border);
}
.pjt-badge    { font-size: .82rem !important; padding: .18rem .55rem !important; border-radius: 6px !important; flex-shrink: 0; }
.pjt-title    { flex: 1; font-size: .88rem; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjt-duration { font-size: .88rem; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.pjt-timeline { padding: .5rem .9rem .75rem; display: flex; flex-direction: column; }
.pjt-row {
  display: flex; align-items: stretch; gap: .7rem; min-height: 44px;
}
.pjt-row-mid { min-height: 32px; }
.pjt-rail {
  display: flex; flex-direction: column; align-items: center;
  width: 20px; flex-shrink: 0;
}
.pjt-node {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border);
}
.pjt-node-origin { background: #34a853; border-color: #34a853; }
.pjt-node-dest   { background: #ea4335; border-color: #ea4335; }
.pjt-line-seg { flex: 1; width: 3px; border-radius: 2px; min-height: 12px; }
.pjt-info {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; padding: .15rem 0;
}
.pjt-stop-name { font-size: .92rem; font-weight: 600; color: var(--text); }
.pjt-stop-sub  { font-size: .75rem; color: var(--text2); margin-top: .05rem; }
.pjt-times-btn {
  flex-shrink: 0; align-self: center;
  background: var(--hdr); color: #fff;
  border: none; border-radius: 8px;
  padding: .4rem .7rem; font-size: .78rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.pjt-times-btn:hover { opacity: .88; }
.pjt-mid-info {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; color: var(--text2); flex: 1;
}
.pjt-stops-count { font-weight: 600; color: var(--text); }
.pjt-dir { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjt-inline-badge { font-size: .78rem !important; padding: .12rem .45rem !important; border-radius: 5px !important; flex-shrink: 0; }

/* Transfer-specific journey styles */
.pjt-node-transfer { background: #f5a623; border-color: #f5a623; }
.pjt-row-transfer .pjt-info { border-top: 1px dashed var(--border); padding-top: .3rem; }
.pjt-transfer-label { color: #f5a623 !important; font-weight: 600; }
.pjt-transfer-sep { font-size: 1rem; color: var(--text2); flex-shrink: 0; }

/* Transfer arrow in result cards */
.prc-transfer-arrow { font-size: .78rem; color: var(--text2); flex-shrink: 0; }

/* ── Dark mode ──────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0f0f0f;
    --card:      #1c1c1c;
    --text:      #e8e8e8;
    --text2:     #9a9a9a;
    --border:    #303030;
    --stop-ring: #5a7a2e;
    --terminal:  #f2b51e;
  }

  /* desktop shadow */
  @media (min-width: 481px) { body { box-shadow: 0 0 30px rgba(0,0,0,.4); } }

  /* list rows */
  .item-list li                 { background: linear-gradient(to bottom, #1e1e1e, #191919); }
  #stopsList li                 { background: linear-gradient(to right, #18221a, #1a1a1a); }

  /* list hover */
  .item-list li:hover,
  .item-list li.active          { background: #252525; }
  .stop-chevron { background: var(--stop-ring); }

  /* fav rows */
  .fav-row:hover                { background: #252525; }
  .fav-row-dragging             { background: #1c1c1c !important; }
  .fav-alias-input              { background: #252525; }

  /* card balance modal */
  #cardInput                    { background: #252525; border-color: #383838; }
  #cardCheckBtn                 { background: #1e5c35; }
  #cardCheckBtn:active          { background: #1a4a2b; }

  /* install banner */
  .install-banner               { background: #1c1c1c; border-color: #383838; }

  /* promo placeholder */
  .promo-placeholder            { background: #1c1c1c; border-color: #383838; }
  .promo-placeholder-label      { color: #555; }
  .promo-placeholder-size       { color: #444; }

  /* admin messages */
  .admin-message.success        { background: #0f2e16; border-color: #1a5028; color: #5fcf7f; }
  .admin-message.error          { background: #2e0f0f; border-color: #8a1010; color: #e07070; }

  /* form inputs */
  .form-row input,
  .admin-filter                 { background: #252525; border-color: #383838; }


  /* planner */
  .planner-box { background: #1c1c1c; }
  .planner-card { background: linear-gradient(to bottom, #1e1e1e, #191919); }
  .planner-card:hover { background: #252525; }
  .planner-dropdown { background: #1c1c1c; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
  .planner-stop-item:hover { background: #252525; }

  /* nearby */
  .nearby-item:hover { background: #222; }
  .nearby-code { background: #2a2a2a; }

  /* schedule */
  .sched-time { background: #1a1a1a; }

  /* planner results / journey */
  .prc-card { background: #1a1a1a; border-color: #2a2a2a; }
  .prc-card:hover, .prc-card:focus { box-shadow: 0 3px 12px rgba(0,0,0,.3); }
  .prc-walk-block { background: rgba(255,255,255,.03); }
  .pjt-card { background: #1e1e1e; }

  .cookie-banner { background: #1c1c1c; border-top-color: #333; }
  .cookie-banner-text { color: #bbb; }
  .cookie-banner-link { color: #5fcf7f; }
  .cookie-btn--accept { background: #1e5c35; color: #fff; }
  .cookie-btn--accept:hover { background: #2d7a4a; }
  .cookie-btn--decline { background: #333; color: #bbb; }
  .cookie-btn--decline:hover { background: #444; }
}

/* ── Cookie consent banner ─────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  z-index: 9999;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
  font-size: .82rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-text { margin: 0; flex: 1 1 200px; color: #444; line-height: 1.4; }
.cookie-banner-link { color: #1e5c35; }
.cookie-banner-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.cookie-btn {
  border: none;
  border-radius: 6px;
  padding: .4rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.cookie-btn--accept { background: #1e5c35; color: #fff; }
.cookie-btn--accept:hover { background: #2d7a4a; }
.cookie-btn--decline { background: #f0f0f0; color: #555; }
.cookie-btn--decline:hover { background: #e0e0e0; }

/* ── SEO section – colapsable, discreta, contenido indexable por Google ── */
.seo-section {
  border-top: 1px solid #d8d8d8;
  margin: 0;
  padding: 0;
}
.seo-summary {
  display: block;
  padding: .55rem 1rem;
  font-size: .75rem;
  color: #888;
  cursor: pointer;
  list-style: none;
  user-select: none;
  text-align: center;
  letter-spacing: .02em;
}
.seo-summary::-webkit-details-marker { display: none; }
.seo-summary::after { content: " ▾"; font-size: .65rem; }
.seo-section[open] .seo-summary::after { content: " ▴"; }
.seo-summary:hover { color: #555; }
.seo-body {
  padding: .75rem 1rem 1rem;
  font-size: .78rem;
  color: #666;
  max-width: 860px;
  margin: 0 auto;
}
.seo-body p { margin: 0 0 .5rem; line-height: 1.5; }
.seo-body h2 {
  font-size: .8rem;
  font-weight: 600;
  color: #555;
  margin: .8rem 0 .3rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.seo-lines {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: .1rem .75rem;
}
.seo-lines a { color: #1e5c35; text-decoration: none; font-size: .78rem; }
.seo-lines a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  .seo-section { border-top-color: #2a2a2a; }
  .seo-summary { color: #555; }
  .seo-summary:hover { color: #888; }
  .seo-body { color: #666; }
  .seo-body h2 { color: #555; }
  .seo-lines a { color: #5db882; }
}
