/* =========================================================================
   Pieve di Teco 2026 — Reise-Companion
   Palette: ligurisches Meer, Olivenhain, Terrakotta, Sand
   ========================================================================= */

:root {
  color-scheme: light;
  --bg:        #FAF6EF;
  --bg-2:      #F1E9DC;
  --surface:   #FFFFFF;
  --surface-2: #FBF7F1;
  --line:      rgba(22, 35, 42, .10);
  --line-2:    rgba(22, 35, 42, .06);
  --ink:       #16232A;
  --ink-2:     #4B5C64;
  --ink-3:     #808F96;
  --sea:       #0E6E80;
  --sea-2:     #12939F;
  --olive:     #6C8A3C;
  --terra:     #C2612F;
  --gold:      #BE8C25;
  --shadow-sm: 0 1px 2px rgba(20,35,42,.05), 0 2px 8px rgba(20,35,42,.05);
  --shadow-md: 0 2px 4px rgba(20,35,42,.05), 0 12px 32px -8px rgba(20,35,42,.14);
  --shadow-lg: 0 8px 24px rgba(20,35,42,.10), 0 32px 64px -16px rgba(20,35,42,.22);
  --r-sm: 10px; --r: 16px; --r-lg: 22px; --r-xl: 30px;
  --nav-w: 250px;
  --top-h: 64px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0A1214;
  --bg-2:      #0E1A1D;
  --surface:   #132126;
  --surface-2: #17282D;
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.055);
  --ink:       #E9F0EF;
  --ink-2:     #A8BCBE;
  --ink-3:     #788D90;
  --sea:       #45BACA;
  --sea-2:     #6ED3DF;
  --olive:     #A0BE60;
  --terra:     #EB9260;
  --gold:      #E0B851;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 2px 6px rgba(0,0,0,.34), 0 16px 40px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.4), 0 40px 80px -20px rgba(0,0,0,.6);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --bg:#0A1214; --bg-2:#0E1A1D; --surface:#132126; --surface-2:#17282D;
    --line:rgba(255,255,255,.10); --line-2:rgba(255,255,255,.055);
    --ink:#E9F0EF; --ink-2:#A8BCBE; --ink-3:#788D90;
    --sea:#45BACA; --sea-2:#6ED3DF; --olive:#A0BE60; --terra:#EB9260; --gold:#E0B851;
    --shadow-sm:0 1px 2px rgba(0,0,0,.3);
    --shadow-md:0 2px 6px rgba(0,0,0,.34), 0 16px 40px -12px rgba(0,0,0,.5);
    --shadow-lg:0 10px 30px rgba(0,0,0,.4), 0 40px 80px -20px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Muss vor allen Komponenten stehen: .modal/.sheet setzen selbst display,
   was das UA-Stylesheet fuer [hidden] sonst ueberstimmt. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.18; margin: 0; letter-spacing: -.012em; }
p { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }
a { color: var(--sea); text-decoration-color: color-mix(in srgb, var(--sea) 35%, transparent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sea-2); outline-offset: 3px; border-radius: 6px; }

.ic { width: 1em; height: 1em; display: block; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- Hintergrund */
.bg-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-hills { position: absolute; bottom: -2px; left: -5%; width: 110%; height: 46vh; min-height: 300px; }
.hill { transform-origin: bottom; }
.hill-3 { fill: color-mix(in srgb, var(--olive) 9%, transparent); animation: drift 34s var(--ease) infinite alternate; }
.hill-2 { fill: color-mix(in srgb, var(--sea) 8%, transparent);  animation: drift 26s var(--ease) infinite alternate-reverse; }
.hill-1 { fill: color-mix(in srgb, var(--terra) 7%, transparent);animation: drift 44s var(--ease) infinite alternate; }
@keyframes drift { from { transform: translateX(-1.4%) } to { transform: translateX(1.4%) } }

.glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; }
.glow-a { width: 46vw; height: 46vw; top: -14vw; right: -10vw; background: color-mix(in srgb, var(--sea) 20%, transparent); animation: float 22s ease-in-out infinite; }
.glow-b { width: 38vw; height: 38vw; bottom: 4vh; left: -12vw; background: color-mix(in srgb, var(--gold) 16%, transparent); animation: float 28s ease-in-out infinite reverse; }
@keyframes float { 0%,100% { transform: translate3d(0,0,0) } 50% { transform: translate3d(2.5vw,-3vh,0) } }

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 0 clamp(14px, 3vw, 26px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid var(--line-2);
}

.brand { display: flex; align-items: center; gap: 11px; background: none; border: 0; padding: 6px 8px 6px 4px; margin-left: -4px; border-radius: 14px; cursor: pointer; transition: background .2s var(--ease); }
.brand:hover { background: var(--line-2); }
.brand-mark { font-size: 26px; color: var(--olive); transition: transform .5s var(--spring); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.08); }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 17.5px; font-weight: 600; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.weather-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); font-size: 13px; font-variant-numeric: tabular-nums;
  animation: pop .5s var(--spring) both;
}
.weather-chip .wx-icon { font-size: 16px; color: var(--gold); }
.weather-chip .wx-temp { font-weight: 650; }
.weather-chip .wx-place { color: var(--ink-3); font-size: 12px; }

.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--spring), background .2s var(--ease), border-color .2s;
}
.icon-btn:hover { transform: translateY(-1.5px); border-color: color-mix(in srgb, var(--sea) 40%, var(--line)); }
.icon-btn:active { transform: scale(.94); }

/* ---------------------------------------------------------------- Rail (Desktop) */
.rail {
  position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--nav-w); z-index: 30;
  display: none; flex-direction: column; padding: 18px 14px 16px;
  border-right: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.rail-items { position: relative; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; scrollbar-width: thin; }
.rail-pill {
  position: absolute; left: 14px; width: calc(var(--nav-w) - 28px); height: 42px; border-radius: 13px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transform: translateY(var(--pill-y, 0)); opacity: 0;
  transition: transform .46s var(--spring), opacity .3s var(--ease);
  pointer-events: none; z-index: 0;
}
.rail-pill.on { opacity: 1; }
.rail-pill::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 20px;
  transform: translateY(-50%); border-radius: 0 3px 3px 0; background: var(--sea);
}

.nav-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 13px; border: 0; background: none; border-radius: 13px;
  cursor: pointer; color: var(--ink-2); text-align: left; width: 100%;
  transition: color .2s var(--ease), transform .3s var(--spring);
}
.nav-item span[data-icon] { font-size: 19px; transition: transform .38s var(--spring), color .2s; }
.nav-item i { font-style: normal; font-size: 14.5px; font-weight: 500; letter-spacing: -.005em; }
.nav-item:hover { color: var(--ink); }
.nav-item:hover span[data-icon] { transform: translateX(1px) scale(1.12); }
.nav-item.active { color: var(--ink); font-weight: 600; }
.nav-item.active span[data-icon] { color: var(--sea); }
.nav-item.active i { font-weight: 640; }

.rail-foot { padding: 14px 12px 2px; border-top: 1px solid var(--line-2); margin-top: 10px; }
.rail-countdown { font-size: 12.5px; color: var(--ink-3); display: block; line-height: 1.45; }

/* ---------------------------------------------------------------- Main */
.main {
  position: relative; z-index: 10;
  padding: calc(var(--top-h) + 22px) clamp(14px, 4vw, 34px) 116px;
  max-width: 1180px; outline: none;
}

/* ---------------------------------------------------------------- Tabbar (Mobil) */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 40; display: flex; gap: 2px; padding: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.7); -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: min(440px, calc(100vw - 24px));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 6px; border: 0; background: none; border-radius: 16px;
  color: var(--ink-3); cursor: pointer;
  transition: color .22s var(--ease), background .22s var(--ease);
}
.tab span[data-icon] { font-size: 21px; transition: transform .4s var(--spring); }
.tab i { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
.tab.active { color: var(--sea); background: color-mix(in srgb, var(--sea) 10%, transparent); }
.tab.active span[data-icon] { transform: translateY(-2px) scale(1.08); }
.tab:active span[data-icon] { transform: scale(.9); }

/* ---------------------------------------------------------------- Sheet */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8,16,18,.45); backdrop-filter: blur(3px); animation: fade .28s var(--ease) both; }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(560px, 100%); max-height: 84vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 10px 18px calc(26px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: sheetUp .45s var(--spring) both;
}
.sheet.closing .sheet-panel { animation: sheetDown .26s var(--ease) both; }
.sheet.closing .sheet-backdrop { animation: fade .26s var(--ease) reverse both; }
.sheet-handle { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 14px; cursor: pointer; }
.sheet-title { font-size: 19px; margin-bottom: 14px; padding-left: 4px; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; }
.sheet-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 13px 12px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; text-align: left;
  animation: popUp .42s var(--spring) both; animation-delay: calc(var(--i) * 26ms);
  transition: transform .26s var(--spring), border-color .2s, background .2s;
}
.sheet-item:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--sea) 45%, var(--line)); }
.sheet-item span[data-icon] { font-size: 22px; color: var(--sea); }
.sheet-item i { font-style: normal; font-size: 13px; font-weight: 600; line-height: 1.25; }
.sheet-item.active { background: color-mix(in srgb, var(--sea) 12%, var(--surface-2)); border-color: color-mix(in srgb, var(--sea) 45%, var(--line)); }

@keyframes sheetUp { from { transform: translate(-50%, 100%) } to { transform: translate(-50%, 0) } }
@keyframes sheetDown { from { transform: translate(-50%, 0) } to { transform: translate(-50%, 100%) } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: scale(.9) } to { opacity: 1; transform: none } }
@keyframes popUp { from { opacity: 0; transform: translateY(10px) scale(.96) } to { opacity: 1; transform: none } }

/* ---------------------------------------------------------------- View-Transition */
.view { animation: viewIn .42s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
.stagger > * { animation: riseIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
@keyframes riseIn { from { opacity: 0; transform: translateY(16px) } to { opacity: 1; transform: none } }

/* ---------------------------------------------------------------- Bausteine */
.page-head { margin-bottom: 22px; }
.page-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .11em; text-transform: uppercase; color: var(--sea);
  padding: 5px 11px; border-radius: 999px; background: color-mix(in srgb, var(--sea) 11%, transparent);
  margin-bottom: 12px;
}
.page-eyebrow span[data-icon] { font-size: 14px; }
.page-title { font-size: clamp(28px, 5.2vw, 40px); margin-bottom: 8px; }
.page-lead { color: var(--ink-2); font-size: 16.5px; max-width: 68ch; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .32s var(--spring), box-shadow .32s var(--ease), border-color .25s;
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--sea) 26%, var(--line)); }
.card-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 12px; }
.card-ic {
  flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-size: 21px; color: var(--sea);
  background: color-mix(in srgb, var(--sea) 11%, transparent);
  transition: transform .4s var(--spring);
}
.card.hoverable:hover .card-ic { transform: rotate(-7deg) scale(1.07); }
.card-ic.olive { color: var(--olive); background: color-mix(in srgb, var(--olive) 13%, transparent); }
.card-ic.terra { color: var(--terra); background: color-mix(in srgb, var(--terra) 13%, transparent); }
.card-ic.gold  { color: var(--gold);  background: color-mix(in srgb, var(--gold) 15%, transparent); }
.card-title { font-size: 18px; }
.card-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.card-body { color: var(--ink-2); font-size: 14.6px; }
.card-body strong { color: var(--ink); font-weight: 620; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 34px 0 14px; flex-wrap: wrap; }
.section-head h2 { font-size: 23px; }
.section-head p { color: var(--ink-3); font-size: 13.5px; margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12.2px; font-weight: 600; letter-spacing: .005em;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.chip span[data-icon] { font-size: 14px; }
.chip.sea   { color: var(--sea);   background: color-mix(in srgb, var(--sea) 10%, transparent);   border-color: color-mix(in srgb, var(--sea) 26%, transparent); }
.chip.olive { color: var(--olive); background: color-mix(in srgb, var(--olive) 12%, transparent); border-color: color-mix(in srgb, var(--olive) 28%, transparent); }
.chip.terra { color: var(--terra); background: color-mix(in srgb, var(--terra) 12%, transparent); border-color: color-mix(in srgb, var(--terra) 30%, transparent); }
.chip.gold  { color: var(--gold);  background: color-mix(in srgb, var(--gold) 14%, transparent);  border-color: color-mix(in srgb, var(--gold) 32%, transparent); }

.note-box {
  display: flex; gap: 12px; padding: 15px 17px; border-radius: var(--r);
  background: color-mix(in srgb, var(--gold) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  font-size: 14.4px; color: var(--ink-2); line-height: 1.6;
}
.note-box span[data-icon] { flex: none; font-size: 19px; color: var(--gold); margin-top: 1px; }
.note-box.sea { background: color-mix(in srgb, var(--sea) 8%, var(--surface)); border-color: color-mix(in srgb, var(--sea) 26%, transparent); }
.note-box.sea span[data-icon] { color: var(--sea); }
.note-box.terra { background: color-mix(in srgb, var(--terra) 8%, var(--surface)); border-color: color-mix(in srgb, var(--terra) 28%, transparent); }
.note-box.terra span[data-icon] { color: var(--terra); }
.note-box b { color: var(--ink); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-size: 12.6px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; padding-top: 2px; }
.kv dd { margin: 0; color: var(--ink-2); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.list li { position: relative; padding-left: 20px; font-size: 14.6px; color: var(--ink-2); }
.list li::before {
  content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%;
  background: color-mix(in srgb, var(--sea) 55%, transparent);
}

/* ---------------------------------------------------------------- Hero (Start) */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: clamp(24px, 4vw, 40px);
  background: linear-gradient(140deg,
      color-mix(in srgb, var(--sea) 16%, var(--surface)) 0%,
      var(--surface) 46%,
      color-mix(in srgb, var(--gold) 13%, var(--surface)) 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow-md); margin-bottom: 22px;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--sea) 26%, transparent), transparent 68%);
  animation: float 18s ease-in-out infinite;
}
.hero-inner { position: relative; z-index: 2; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); margin-bottom: 10px; }
.hero p { color: var(--ink-2); font-size: 16.5px; max-width: 56ch; }

.countdown { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.cd-box {
  min-width: 76px; padding: 12px 14px; border-radius: var(--r);
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line);
  text-align: center; backdrop-filter: blur(6px);
}
.cd-box b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-box small { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.crew-card {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .3s var(--spring), border-color .22s;
}
.crew-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--olive) 40%, var(--line)); }
.crew-av {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--olive) 14%, transparent); color: var(--olive);
}
.crew-card.is-dog .crew-av { background: color-mix(in srgb, var(--terra) 14%, transparent); color: var(--terra); }
.crew-name { font-weight: 640; font-size: 14.5px; line-height: 1.2; }
.crew-role { font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- Timeline / Route */
.route-ctrl {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px;
  padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.ctrl-block { display: flex; flex-direction: column; gap: 7px; min-width: 190px; flex: 1; }
.ctrl-label { font-size: 11.4px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.ctrl-row { display: flex; align-items: center; gap: 10px; }
.time-display { font-family: var(--font-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 88px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--sea) var(--fill, 40%), var(--line) var(--fill, 40%));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--sea); box-shadow: var(--shadow-sm); cursor: grab;
  transition: transform .22s var(--spring);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.18); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface);
  border: 2.5px solid var(--sea); cursor: grab;
}

.seg-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.seg-toggle button {
  border: 0; background: none; padding: 7px 13px; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  transition: background .24s var(--ease), color .2s;
}
.seg-toggle button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.arrival-badge {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r);
  background: color-mix(in srgb, var(--sea) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--sea) 28%, transparent); margin-bottom: 22px;
}
.arrival-badge .big { font-family: var(--font-display); font-size: 27px; font-weight: 600; color: var(--sea); font-variant-numeric: tabular-nums; }
.arrival-badge .txt { font-size: 14px; color: var(--ink-2); }
.arrival-badge.late { background: color-mix(in srgb, var(--terra) 10%, var(--surface)); border-color: color-mix(in srgb, var(--terra) 30%, transparent); }
.arrival-badge.late .big { color: var(--terra); }

.timeline { position: relative; padding-left: 4px; }
.timeline::before {
  content: ""; position: absolute; left: 25px; top: 24px; bottom: 30px; width: 2px;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--sea) 40%, transparent), color-mix(in srgb, var(--terra) 40%, transparent));
  border-radius: 2px;
}
.stop { position: relative; padding-left: 62px; padding-bottom: 16px; animation: riseIn .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms + 80ms); }
.stop-dot {
  position: absolute; left: 6px; top: 4px; width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; font-size: 20px; z-index: 2;
  background: var(--surface); border: 1px solid var(--line); color: var(--sea); box-shadow: var(--shadow-sm);
  transition: transform .36s var(--spring), border-color .25s;
}
.stop:hover .stop-dot { transform: scale(1.09) rotate(-6deg); border-color: color-mix(in srgb, var(--sea) 50%, var(--line)); }
.stop-drive {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.4px; color: var(--ink-3);
  margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2);
}
.stop-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: transform .3s var(--spring), box-shadow .3s, border-color .25s;
}
.stop:hover .stop-card { transform: translateX(3px); box-shadow: var(--shadow-md); }
.stop-time {
  font-family: var(--font-display); font-size: 21px; font-weight: 600; color: var(--sea);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.stop-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 2px 0 3px; }
.stop-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stop-headline { color: var(--terra); font-size: 13.6px; font-weight: 620; margin-bottom: 10px; }
.stop-why { font-size: 14.6px; color: var(--ink-2); margin-bottom: 13px; }
.stop-facts { display: flex; flex-direction: column; gap: 9px; }
.fact { display: flex; gap: 10px; font-size: 13.8px; color: var(--ink-2); }
.fact span[data-icon] { flex: none; font-size: 16px; color: var(--ink-3); margin-top: 2px; }
.fact b { color: var(--ink); font-weight: 620; }

.maplink {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  margin-top: 12px; padding: 7px 13px; border-radius: 10px; text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  transition: transform .24s var(--spring), border-color .2s, color .2s;
}
.maplink:hover { transform: translateY(-2px); color: var(--sea); border-color: color-mix(in srgb, var(--sea) 40%, var(--line)); }
.maplink span[data-icon] { font-size: 15px; }

/* ---------------------------------------------------------------- Tageskarten */
.day-card { cursor: pointer; }
.day-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: none; width: 52px; height: 56px; border-radius: 14px;
  background: color-mix(in srgb, var(--sea) 10%, transparent); color: var(--sea);
}
.day-date b { font-family: var(--font-display); font-size: 21px; line-height: 1; font-weight: 600; }
.day-date small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .8; }
.day-card.past { opacity: .58; }
.day-card.today { border-color: color-mix(in srgb, var(--terra) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--terra) 14%, transparent), var(--shadow-sm); }
.day-card.today .day-date { background: color-mix(in srgb, var(--terra) 14%, transparent); color: var(--terra); }

/* ---------------------------------------------------------------- Rating / Meta */
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: block; }
.dots i.on { background: var(--gold); }

.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.6px; color: var(--ink-3); margin-top: 10px; }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }
.meta-row span[data-icon] { font-size: 14px; }

/* ---------------------------------------------------------------- Checkliste */
.check-group { margin-bottom: 18px; }
.check-item {
  display: flex; align-items: flex-start; gap: 11px; padding: 9px 12px; border-radius: 12px;
  cursor: pointer; user-select: none; transition: background .18s var(--ease);
}
.check-item:hover { background: var(--surface-2); }
.check-box {
  flex: none; width: 21px; height: 21px; border-radius: 7px; border: 1.8px solid var(--line);
  display: grid; place-items: center; color: transparent; margin-top: 1px; font-size: 13px;
  transition: background .24s var(--spring), border-color .2s, color .2s, transform .24s var(--spring);
}
.check-item.done .check-box { background: var(--olive); border-color: var(--olive); color: #fff; transform: scale(1.04); }
.check-item.done .check-label { color: var(--ink-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink-3) 50%, transparent); }
.check-label { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }
.progress-bar { height: 5px; border-radius: 5px; background: var(--line); overflow: hidden; margin-top: 10px; }
.progress-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--olive), var(--sea)); transition: width .6s var(--ease); }

/* ---------------------------------------------------------------- Formulare */
.form-grid { display: grid; gap: 11px; }
input[type="text"], input[type="number"], input[type="time"], textarea, select {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14.5px;
  transition: border-color .2s, background .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--sea); background: var(--surface); outline: none; }
textarea { min-height: 90px; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.4px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 13px; border: 1px solid transparent; cursor: pointer;
  font-size: 14.4px; font-weight: 640; background: var(--sea); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .24s var(--spring), filter .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { color: var(--sea); border-color: color-mix(in srgb, var(--sea) 45%, var(--line)); }
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: none; color: var(--terra); border-color: color-mix(in srgb, var(--terra) 35%, transparent); box-shadow: none; }

.add-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--r-lg); margin-top: 18px;
  border: 1.5px dashed color-mix(in srgb, var(--sea) 34%, var(--line));
  background: color-mix(in srgb, var(--sea) 4%, transparent);
}
.add-strip p { font-size: 13.8px; color: var(--ink-3); margin: 0; }

.custom-flag {
  position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--olive); padding: 3px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--olive) 14%, transparent);
}

/* ---------------------------------------------------------------- Modal */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,16,18,.5); backdrop-filter: blur(4px); animation: fade .26s var(--ease) both; }
.modal-panel {
  position: relative; width: min(680px, 100%); max-height: 86vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 28px clamp(20px, 4vw, 34px); box-shadow: var(--shadow-lg);
  animation: modalIn .42s var(--spring) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(22px) scale(.97) } to { opacity: 1; transform: none } }
.modal.closing .modal-panel { animation: modalIn .22s var(--ease) reverse both; }
.modal.closing .modal-backdrop { animation: fade .22s var(--ease) reverse both; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; font-size: 16px; color: var(--ink-3);
  transition: transform .22s var(--spring), color .2s;
}
.modal-close:hover { transform: rotate(90deg); color: var(--terra); }
.modal-body h3 { font-size: 24px; margin-bottom: 4px; }
.modal-body .modal-sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 18px; }
.modal-sec { margin-top: 20px; }
.modal-sec h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--sea); margin-bottom: 8px; font-family: var(--font-ui); font-weight: 800; }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 90; padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  animation: toastIn .4s var(--spring) both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) } to { opacity: 1; transform: translate(-50%, 0) } }

/* ---------------------------------------------------------------- Wetter */
.wx-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; }
.wx-day { text-align: center; padding: 11px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.wx-day .d { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.wx-day .i { font-size: 22px; margin: 5px 0 3px; color: var(--gold); display: flex; justify-content: center; }
.wx-day .t { font-size: 13.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wx-day .t small { color: var(--ink-3); font-weight: 500; }
.wx-day .p { font-size: 11px; color: var(--sea); font-weight: 650; }

.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); font-size: 14.5px; }

/* ---------------------------------------------------------------- Desktop-Layout
   Bewusst am Dateiende: die Regeln muessen die Basis-Regeln von .main/.tabbar
   ueberschreiben, ohne mit !important zu arbeiten. */
@media (min-width: 1040px) {
  .rail { display: flex; }
  .tabbar { display: none; }
  .main {
    margin-left: var(--nav-w);
    padding-bottom: 70px;
    max-width: calc(var(--nav-w) + 1000px);
  }
  .toast { bottom: 26px; }
}

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