/* Spårvagn Live – i Göttigts kläder.
   Krämvit botten, vita kort, Göttigt-orange, Pacifico-logga, Fraunces-rubriker och Inter. */
:root {
  --bg: #fef9f1;
  --card: #ffffff;
  --ink: #271610;
  --muted: #706052;
  --soft: #f4eee4;
  --soft-2: #f2eadd;
  --line: #e7dcd0;
  --orange: #f65307;
  --orange-ink: #c2410c;
  --orange-soft: #fff1e8;
  --red: #b3261e;
  --cancel: #c2412f;
  --green: #007656;
  --me: #2563eb;
  --shadow: 0 2px 14px rgba(39, 22, 16, 0.08);
  --shadow-lg: 0 -4px 24px rgba(39, 22, 16, 0.14);
  --radius: 22px;
  --display: "Fraunces", "Playfair Display", Georgia, serif;
  --script: "Pacifico", "Brush Script MT", cursive;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --head-h: calc(64px + var(--safe-t));
  --nav-h: calc(70px + var(--safe-b));
}
.dark {
  --bg: #141414;
  --card: #201d1a;
  --ink: #faf8f5;
  --muted: #b3a89c;
  --soft: #2a2622;
  --soft-2: #302b26;
  --line: rgba(255, 255, 255, 0.12);
  --orange-ink: #ff8a4c;
  --orange-soft: rgba(246, 83, 7, 0.16);
  --cancel: #e0705f;
  --green: #3fbf8a;
  --shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 -4px 24px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
.brand svg, .sheet svg, .overlay svg, .tabbar svg, .setup svg, .map-buttons svg, .toast svg { fill: none; }
#map { position: fixed; inset: 0; background: #f5f1e8; }
.dark #map { background: #1b1b1b; }

/* ---------- Sidhuvud ---------- */
.brand {
  position: fixed;
  z-index: 1070;
  top: 0; left: 0; right: 0;
  height: var(--head-h);
  padding: calc(10px + var(--safe-t)) 14px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
}
.brand-icon {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: grid; place-items: center;
}
.brand-icon.big { width: 76px; height: 76px; margin: 0 auto; }
.brand-text { min-width: 0; flex: 1; }
.brand h1 {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.3;
  margin-top: -4px;
  color: var(--orange);
  white-space: nowrap;
}
.tagline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange-ink);
  white-space: nowrap;
  overflow: hidden;
}
.tag-text { overflow: hidden; text-overflow: ellipsis; flex: none; }
.tag-text::after { content: "·"; margin-left: 6px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 500; min-width: 0; padding-left: 2px; }
#live-text { overflow: hidden; text-overflow: ellipsis; }
.live-dot {
  flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
.live.stale .live-dot { background: var(--red); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 118, 86, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(0, 118, 86, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 118, 86, 0); }
}
@media (max-width: 420px) { #live-text { display: none; } .tag-text::after { content: ""; margin: 0; } }

.region {
  flex: none;
  height: 32px;
  padding: 0 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 4px;
}
.region::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); margin-left: 3px; }
.round {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  display: grid; place-items: center;
  padding: 0;
  transition: transform 0.15s ease;
}
.round:active { transform: scale(0.94); }
.round.lg { width: 46px; height: 46px; box-shadow: var(--shadow); color: var(--orange); }


/* Positionsknappen – som i Göttigt: vit rund knapp nere till höger, precis ovanför kortet. */
.map-buttons {
  position: fixed;
  z-index: 850;
  right: 16px;
  bottom: var(--locate-b, calc(var(--nav-h) + 160px));
  transition: bottom 0.28s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.locate {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid; place-items: center;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 10px 15px -3px rgba(39, 22, 16, 0.12), 0 4px 6px -4px rgba(39, 22, 16, 0.1), 0 0 0 1px var(--line);
  transition: background 0.15s ease, transform 0.15s ease;
}
.locate:hover { background: var(--soft); }
.locate:active { transform: scale(0.94); }
.locate.active { color: var(--orange); }
@media (min-width: 820px) { .map-buttons { right: 24px; bottom: 24px !important; } }

/* ---------- Bottenmeny ---------- */
.tabbar {
  position: fixed;
  z-index: 1080;
  left: 0; right: 0; bottom: 0;
  height: var(--nav-h);
  padding-bottom: var(--safe-b);
  background: var(--card);
  box-shadow: 0 -1px 0 var(--line);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
}
.tabbar button {
  border: 0;
  background: none;
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 0;
}
.tabbar button.on { color: var(--orange); font-weight: 700; }
.tabbar .fab-wrap { justify-content: flex-end; padding-bottom: 9px; color: var(--ink); font-weight: 600; }
.fab {
  width: 58px; height: 58px;
  margin-top: -30px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: grid; place-items: center;
  border: 4px solid var(--card);
  box-shadow: 0 4px 12px rgba(246, 83, 7, 0.4);
  transition: transform 0.15s ease;
}
.fab-wrap:active .fab { transform: scale(0.94); }

/* ---------- Panelen ---------- */
.sheet {
  position: fixed;
  z-index: 900;
  left: 8px; right: 8px;
  bottom: calc(var(--nav-h) + 8px);
  max-height: calc(54vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 0 16px 14px;
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
}
.sheet.collapsed { transform: translateY(calc(100% - 132px)); overflow: hidden; }
.grip {
  display: block;
  width: 100%;
  padding: 10px 0 8px;
  border: 0;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 2;
}
.grip span { display: block; margin: 0 auto; width: 40px; height: 4px; border-radius: 2px; background: var(--line); }

@media (min-width: 820px) {
  .sheet {
    left: 16px; right: auto;
    top: calc(var(--head-h) + 16px);
    bottom: calc(var(--nav-h) + 16px);
    width: 400px;
    max-height: none;
    padding-top: 12px;
  }
  .sheet.collapsed { transform: none; overflow-y: auto; }
  .grip { display: none; }
  .leaflet-bottom.leaflet-right { margin-bottom: calc(var(--nav-h) + 6px); margin-right: 6px; }
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 12px; border-radius: 22px; box-shadow: var(--shadow), 0 0 0 1px var(--line); height: 70px; padding: 0; }
  .sheet { bottom: 98px; }
}

.stop-head { display: flex; align-items: flex-start; gap: 12px; margin-top: 2px; }
.pin {
  flex: none;
  width: 42px; height: 42px;
  margin: 4px 2px 0;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--orange);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(120, 40, 0, 0.25);
}
.pin svg { transform: rotate(45deg); }
.stop-title { flex: 1; min-width: 0; }
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.stop-head h2 {
  margin: 1px 0 2px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.stop-meta { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stop-buttons { display: flex; gap: 6px; flex: none; }
.circ {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--orange);
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  font-size: 8.5px;
  font-weight: 700;
  padding: 0;
  transition: transform 0.15s ease;
}
.circ:active { transform: scale(0.94); }
.circ.fav.on svg { fill: #fff; }
.stop-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.mini-link { border: 0; background: none; padding: 2px 0; font-size: 12.5px; font-weight: 700; color: var(--orange-ink); }

.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 2px 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 0;
  background: var(--soft-2);
  color: var(--ink);
  height: 34px;
  padding: 0 13px;
  border-radius: 17px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.on { background: var(--ink); color: var(--card); }
.chip .dist { opacity: 0.65; font-weight: 500; }
.chip.home::before { content: "★"; color: var(--orange); }

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-ink);
}
.section-label i { flex: 1; height: 1px; background: var(--line); }
.link { border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 0; }

.departures { list-style: none; margin: 0; padding: 0; }
.dep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--soft-2);
}
.dep:last-child { border-bottom: 0; }
.badge {
  flex: none;
  min-width: 36px;
  height: 32px;
  padding: 0 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
}
.dep-main { flex: 1; min-width: 0; }
.dep-dir { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dep-time {
  flex: none;
  text-align: right;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
}
.dep-time small { display: block; font-family: var(--body); font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.dep-time.now { color: var(--orange); }
.dep.cancelled { opacity: 0.75; }
.dep.cancelled .dep-dir, .dep.cancelled .dep-time { text-decoration: line-through; }
.rt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 5px; vertical-align: 1px; }
.empty { padding: 18px 4px; color: var(--muted); font-weight: 500; }

.lines .chip { padding: 0; min-width: 40px; height: 36px; justify-content: center; font-size: 15px; font-weight: 700; border-radius: 10px; }
.lines .chip.off { opacity: 0.28; filter: grayscale(0.6); }

.credits { margin: 14px 0 0; font-size: 11px; color: var(--muted); }
.credits a { color: inherit; }

/* ---------- Sista ölen-knappen ---------- */
.beer-open {
  width: 100%;
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  border: 0;
  background: var(--orange);
  color: #fff;
}
.beer-open-icon { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--orange); display: grid; place-items: center; flex: none; }
.beer-open strong { display: block; font-family: var(--display); font-weight: 700; font-size: 17px; }
.beer-open small { display: block; font-size: 12.5px; font-weight: 500; opacity: 0.92; margin-top: 1px; }
.beer-open span:nth-child(2) { flex: 1; }
.beer-open-arrow { font-size: 26px; line-height: 1; }

/* ---------- Fordonskort ---------- */
.vehicle-card {
  margin: 2px 0 10px;
  padding: 12px;
  border-radius: 18px;
  background: var(--soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.vehicle-card .badge { height: 44px; min-width: 44px; font-size: 20px; border-radius: 12px; }
.vehicle-card .v-main { flex: 1; min-width: 0; }
.vehicle-card .v-dir { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.15; }
.vehicle-card .v-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.vehicle-card .v-actions { display: flex; flex-direction: column; gap: 6px; }
.vbtn { border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; font-size: 12.5px; font-weight: 700; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.vbtn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.vbtn svg { width: 15px; height: 15px; }

/* ---------- Kartmarkörer ---------- */
.tram { position: relative; width: 34px; height: 34px; transition: opacity 0.3s; }
.tram-arrow { position: absolute; inset: -9px; transform-origin: 50% 50%; }
.tram-arrow::before {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid var(--tram-bg);
  filter: drop-shadow(0 -1px 0 rgba(255,255,255,0.9));
}
.tram-body {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--tram-bg);
  color: var(--tram-fg);
  display: grid;
  place-items: center;
  font-family: var(--body);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 0 2.5px #fff, 0 3px 8px rgba(39, 22, 16, 0.35);
}
.dark .tram-body { box-shadow: 0 0 0 2.5px #201d1a, 0 4px 12px rgba(0,0,0,0.6); }
.tram.selected .tram-body { box-shadow: 0 0 0 3px var(--orange), 0 0 0 7px rgba(246, 83, 7, 0.3), 0 6px 14px rgba(39, 22, 16, 0.4); }
.tram.dim { opacity: 0.18; }
.small .tram { transform: scale(0.72); }
.tiny .tram { transform: scale(0.5); }
.tiny .tram-arrow { display: none; }
.tram.long .tram-body { font-size: 11px; letter-spacing: -0.02em; }
.tram.m-train .tram-body { border-radius: 10px; }

.stop-pin {
  width: 28px; height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--orange);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(120, 40, 0, 0.35);
  border: 2px solid #fff;
}
.dark .stop-pin { border-color: #201d1a; }
.stop-pin svg { transform: rotate(45deg); fill: none; }
.stop-pin.sel { background: var(--ink); }
.m-bus .stop-pin, .m-ferry .stop-pin { width: 24px; height: 24px; border-width: 1.5px; }
.m-train .stop-pin { background: #c2410c; }
.small .stop-pin { transform: rotate(-45deg) scale(0.72); transform-origin: 0 100%; }

.me { position: relative; width: 22px; height: 22px; }
.me::before {
  content: "";
  position: absolute; inset: -16px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.2);
  animation: me-pulse 2.4s ease-out infinite;
}
.me::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--me);
  border: 3.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
@keyframes me-pulse { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

.stop-tip {
  background: var(--card) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  font-family: var(--body);
  font-weight: 600;
  font-size: 12.5px;
  padding: 5px 9px !important;
  box-shadow: var(--shadow) !important;
}
.stop-tip::before { display: none; }

.leaflet-container { font-family: var(--body); background: var(--soft); }
.leaflet-control-attribution { display: none; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow) !important; border-radius: 14px !important; overflow: hidden; }
.leaflet-control-zoom a { width: 38px !important; height: 38px !important; line-height: 38px !important; background: var(--card) !important; color: var(--ink) !important; border-color: var(--line) !important; }
@media (max-width: 819px) { .leaflet-control-zoom { display: none; } }

/* ---------- Toast & installation ---------- */
.toast {
  position: fixed;
  z-index: 1100;
  left: 50%;
  top: calc(var(--head-h) + 12px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--card);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  max-width: calc(100% - 32px);
  text-align: center;
}
.setup {
  position: fixed; inset: 0; z-index: 1150;
  display: grid; place-items: center;
  background: rgba(39, 22, 16, 0.6);
  padding: 20px;
}
.setup-card {
  background: var(--card);
  color: var(--ink);
  border-radius: 26px;
  padding: 30px 26px;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow);
}
.setup-card h2 { font-family: var(--display); font-weight: 700; font-size: 28px; margin: 14px 0 6px; }
.setup-card p { color: var(--muted); line-height: 1.5; margin: 0 0 18px; }
.btn { display: inline-block; background: var(--orange); color: #fff; padding: 13px 20px; border-radius: 14px; font-weight: 700; text-decoration: none; }

/* ---------- Helsidor (resa, öl, favoriter) ---------- */
.overlay {
  position: fixed;
  z-index: 1050;
  left: 0; right: 0;
  top: var(--head-h);
  bottom: var(--nav-h);
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 24px;
}
@media (min-width: 820px) { .overlay { bottom: 0; padding-bottom: 110px; } }
.pl-inner, .beer-inner { max-width: 640px; margin: 0 auto; }
.ov-head { display: flex; align-items: center; gap: 12px; padding: 0 0 14px; }
.ov-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; flex: 1; }
.ov-head .round { width: 42px; height: 42px; }

/* Sök resa */
.pl-form { background: var(--card); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); }
.pl-fields { position: relative; display: grid; gap: 8px; padding-right: 54px; }
.pl-field {
  display: flex; align-items: center; gap: 10px;
  background: var(--soft);
  border-radius: 12px;
  padding: 0 8px 0 12px;
}
.pl-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; width: 30px; flex: none; }
.pl-field input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  color: var(--ink); font: inherit; font-size: 16px; font-weight: 600;
  padding: 13px 0;
}
.pl-field input::placeholder { color: var(--muted); font-weight: 500; }
.pl-field:focus-within { box-shadow: 0 0 0 2px var(--orange); }
.pl-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.pl-dot.from { border: 3px solid var(--me); }
.pl-dot.to { background: var(--orange); }
.pl-clear { border: 0; background: none; color: var(--muted); font-size: 14px; padding: 6px; }
.pl-swap {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--orange); color: #fff;
  display: grid; place-items: center; padding: 0;
}
.pl-suggest { list-style: none; margin: 10px 0 0; padding: 4px; background: var(--soft); border-radius: 14px; max-height: 46vh; overflow-y: auto; }
.pl-suggest li button {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  border: 0; background: none; color: var(--ink); padding: 10px; border-radius: 10px; font-weight: 600; font-size: 15px;
}
.pl-suggest li button:hover, .pl-suggest li button:focus { background: var(--card); outline: none; }
.pl-suggest .ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); flex: none; font-size: 15px; }
.pl-suggest small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.pl-suggest .sec { padding: 8px 10px 2px; font-size: 11px; font-weight: 700; color: var(--orange-ink); }
.pl-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.seg { display: flex; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--card); color: var(--ink); height: 34px; padding: 0 14px; border-radius: 17px; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: var(--card); }
.pl-when input {
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font: inherit; font-weight: 600;
  background: var(--soft); color: var(--ink);
}
.dark .pl-when input { color-scheme: dark; }
.pl-go {
  width: 100%; margin-top: 12px; border: 0; border-radius: 14px; padding: 14px;
  background: var(--orange); color: #fff; font-weight: 700; font-size: 16px;
}

.pl-results { margin-top: 8px; display: grid; gap: 10px; }
.pl-msg { color: var(--muted); padding: 14px 4px; font-weight: 500; text-align: center; }
.pl-more { border: 1px dashed var(--line); background: none; color: var(--muted); font-weight: 600; padding: 11px; border-radius: 14px; }
.jr {
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 2px solid transparent;
}
.jr.fastest { border-color: var(--orange); }
.jr.cancelled { border-color: var(--cancel); opacity: 0.85; }
.jr.departed { opacity: 0.55; }
.jr-top { width: 100%; text-align: left; border: 0; background: none; color: inherit; padding: 12px 14px; display: grid; gap: 8px; }
.jr-row { display: flex; align-items: baseline; gap: 10px; }
.jr-times { font-family: var(--display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.jr-times s { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 3px; }
.jr-times .late { color: var(--orange-ink); }
.jr-meta { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.jr-meta strong { display: block; color: var(--ink); font-size: 14px; }
.jr-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.jr-chain .badge { height: 26px; min-width: 28px; font-size: 13px; border-radius: 8px; padding: 0 7px; }
.jr-chain .walk { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.jr-chain .sep { color: var(--muted); font-size: 12px; }
.jr-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 10px; }
.flag.fast { background: var(--orange); color: #fff; text-transform: uppercase; letter-spacing: 0.04em; }
.flag.red { background: var(--cancel); color: #fff; }
.flag.amber { background: #ffe9c7; color: #6a3d00; }
.dark .flag.amber { background: rgba(255, 170, 60, 0.18); color: #ffcf8a; }
.flag.blue { background: var(--soft-2); color: var(--ink); }
.flag.go { background: var(--soft-2); color: var(--ink); }

.jr-detail { border-top: 1px solid var(--soft-2); padding: 8px 14px 14px; background: var(--bg); }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 50px 18px 1fr; gap: 8px; align-items: start; padding: 6px 0; }
.tl .t { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.tl .t s { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.tl .rail { position: relative; height: 100%; min-height: 22px; display: flex; justify-content: center; }
.tl .rail::before { content: ""; width: 4px; border-radius: 2px; background: var(--rail, var(--line)); position: absolute; top: 0; bottom: -12px; }
.tl .rail.walkrail::before { background: repeating-linear-gradient(to bottom, var(--muted) 0 3px, transparent 3px 7px); width: 3px; }
.tl .rail .node { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 3px solid var(--rail, var(--ink)); margin-top: 3px; }
.tl .stop { font-weight: 600; font-size: 14.5px; }
.tl .stop small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.tl .ride { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.tl .ride .badge { height: 24px; min-width: 24px; font-size: 12.5px; border-radius: 7px; padding: 0 5px; }
.tl .note { margin: 4px 0; padding: 7px 9px; border-radius: 10px; background: #fff1d6; color: #5d3a00; font-size: 12.5px; font-weight: 600; }
.tl .note.high { background: #fde2df; color: #8e1f16; }
.dark .tl .note { background: rgba(255,170,60,0.15); color: #ffd9a3; }
.dark .tl .note.high { background: rgba(226,71,58,0.2); color: #ffc7c1; }
.jr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.jr-actions button { border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; height: 44px; font-weight: 600; font-size: 14px; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.jr-actions button.primary { flex: 1; justify-content: center; background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }
.jr-actions svg { width: 17px; height: 17px; }

.trip-card {
  margin: 2px 0 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--soft);
  border: 2px solid var(--orange);
}
.trip-card .tc-top { display: flex; align-items: baseline; gap: 8px; }
.trip-card .tc-times { font-family: var(--display); font-weight: 700; font-size: 20px; }
.trip-card .tc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.trip-card .jr-chain { margin-top: 8px; }
.trip-card .tc-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* Sista ölen */
.beer-title { flex: 1; min-width: 0; }
.beer-title h2 { margin: 0; font-family: var(--script); font-weight: 400; font-size: 26px; line-height: 1.2; color: var(--orange); }
.beer-title p { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--orange-ink); }
.beer-clock { text-align: right; }
.beer-clock strong { display: block; font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.beer-clock span { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.beer-q { font-size: 15px; color: var(--muted); margin: 6px 2px 10px; }
.beer-q strong { color: var(--ink); }
.beer-lines { display: grid; gap: 8px; }
.beer-line {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  font-weight: 600;
}
.beer-line small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }

.beer-hero {
  margin: 0 0 4px;
  padding: 18px;
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.beer-hero .route { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-weight: 600; color: var(--muted); font-size: 14px; }
.beer-hero .route .badge { height: 30px; min-width: 32px; font-size: 15px; }
.beer-ring { position: relative; width: 210px; height: 210px; margin: 14px auto 6px; }
.beer-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.beer-ring circle { fill: none; stroke-width: 16; }
.beer-ring .track { stroke: var(--soft-2); }
.beer-ring .val { stroke: var(--orange); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.beer-ring.z-green .val { stroke: #1f9d55; }
.beer-ring.z-yellow .val { stroke: #f2b705; }
.beer-ring.z-orange .val { stroke: var(--orange); }
.beer-ring .in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.beer-ring .in span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.beer-ring .big { font-family: var(--display); font-weight: 700; font-size: 68px; line-height: 1; font-variant-numeric: tabular-nums; }
.beer-ring .in small { font-size: 15px; font-weight: 600; }
.beer-hero .big.plain { font-family: var(--display); font-weight: 700; font-size: 30px; margin: 16px 0 6px; }
.beer-hero .sub { color: var(--muted); font-size: 13.5px; }
.beer-hero .sub strong { color: var(--ink); }
.beer-hero .status { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 18px; border-radius: 18px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.beer-hero .status svg { width: 22px; height: 22px; }
.beer-hero .hint { margin-top: 10px; color: var(--muted); font-size: 14px; }
.beer-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.beer-facts div { padding: 10px 4px; border-radius: 14px; background: var(--soft); }
.beer-facts strong { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; }
.beer-facts span { font-size: 11px; color: var(--muted); }

.st-ok { background: #1f9d55; color: #fff; }
.st-sip { background: #f2b705; color: #2b1d00; }
.st-soon, .st-go, .st-run { background: var(--orange); color: #fff; }
.st-gone { background: var(--soft-2); color: var(--muted); }
.beer-hero .status.st-run, .beer-hero .status.st-go { animation: throb 1s ease-in-out infinite alternate; }
@keyframes throb { from { transform: scale(1); } to { transform: scale(1.05); } }

.beer-table-head, .beer-row {
  display: grid;
  grid-template-columns: 40px 0.9fr 0.9fr 1.7fr;
  gap: 10px;
  align-items: center;
}
.beer-table-head { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 4px 12px 6px; font-weight: 700; }
.beer-table { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.beer-row { width: 100%; text-align: left; border: 2px solid transparent; color: var(--ink); font-family: var(--body); padding: 10px 12px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
button.beer-row { cursor: pointer; }
.beer-row.sel { border-color: var(--orange); }
.beer-row:disabled { cursor: default; }
.beer-row .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.beer-row .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beer-row .badge { height: 28px; min-width: 28px; font-size: 13px; border-radius: 8px; padding: 0 6px; }
.beer-row .pill { padding: 6px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 5px; }
.beer-row .pill svg { width: 15px; height: 15px; flex: none; margin-right: 1px; }
.beer-hero .status svg { margin-right: 2px; }
.beer-row .now { color: var(--red); font-weight: 700; }
.beer-row.gone { opacity: 0.5; }
.beer-change { margin: 12px 0 0; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 600; height: 40px; padding: 0 16px; border-radius: 20px; }

.beer-settings { margin-top: 10px; display: grid; gap: 10px; }
.beer-set { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 14px; }
.step { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 3px; }
.step button { border: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--soft); color: var(--ink); font-size: 18px; font-weight: 700; }
.step strong { min-width: 58px; text-align: center; font-size: 14px; }
.beer-foot { margin: 18px 2px 0; font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 380px) {
  .beer-ring { width: 180px; height: 180px; }
  .beer-ring .big { font-size: 56px; }
  .beer-table-head, .beer-row { grid-template-columns: 34px 0.9fr 0.9fr 1.7fr; gap: 8px; font-size: 13px; }
}

/* Favoriter */
.fav-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 4px 4px; }
.fav-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 0; background: none; color: var(--ink); padding: 10px; border-radius: 14px;
}
.fav-item + .fav-item { border-top: 1px solid var(--soft-2); border-radius: 0; }
.fav-item .ico { width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; flex: none; }
.fav-item .ico.soft { background: var(--orange-soft); color: var(--orange-ink); }
.fav-item b { display: block; font-weight: 600; font-size: 15px; }
.fav-item small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.fav-item .go { margin-left: auto; color: var(--muted); font-size: 22px; }
.fav-empty { padding: 16px; color: var(--muted); font-size: 14px; }

/* Region */
.tram.m-bus .tram-body { border-radius: 50%; }

@media (prefers-reduced-motion: reduce) {
  .live-dot, .me::before, .beer-hero .status { animation: none !important; }
  .sheet { transition: none; }
}
