/* ------------------------------------------------------------
   Neuseeland 2027 – Reisebegleiter
   Eine Schrift (Bricolage Grotesque), Glacier/Farn-Palette,
   die Route als durchlaufendes Band ist der Hingucker.
   ------------------------------------------------------------ */

:root {
  --bg: #EEF3F2;
  --surface: #FFFFFF;
  --surface-2: #E3EBE8;
  --ink: #14261C;
  --ink-2: #4E6058;
  --line: #CFDAD6;
  --fern: #1F4D36;
  --fern-soft: #D7E7DE;
  --pukaki: #2A7D96;
  --pukaki-soft: #D3E8EE;
  --tussock: #9A731F;
  --tussock-soft: #F1E6C9;
  --rust: #9C3B2A;
  --rust-soft: #F3DBD5;
  --grey: #6B7A74;
  --radius-s: 4px;
  --radius-l: 14px;
  --nav-h: 60px;
  --font: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1A14;
    --surface: #172620;
    --surface-2: #1F3129;
    --ink: #E6EEEA;
    --ink-2: #A3B3AB;
    --line: #2C3F36;
    --fern: #7FC59E;
    --fern-soft: #1E3A2C;
    --pukaki: #6FC2D8;
    --pukaki-soft: #16343D;
    --tussock: #E2B75A;
    --tussock-soft: #3A2E12;
    --rust: #E08A78;
    --rust-soft: #3F1F19;
    --grey: #8C9A94;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1A14;
  --surface: #172620;
  --surface-2: #1F3129;
  --ink: #E6EEEA;
  --ink-2: #A3B3AB;
  --line: #2C3F36;
  --fern: #7FC59E;
  --fern-soft: #1E3A2C;
  --pukaki: #6FC2D8;
  --pukaki-soft: #16343D;
  --tussock: #E2B75A;
  --tussock-soft: #3A2E12;
  --rust: #E08A78;
  --rust-soft: #3F1F19;
  --grey: #8C9A94;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-variation-settings: "opsz" 16, "wdth" 100;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--pukaki); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 32px, 720px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-s); z-index: 50; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--pukaki); outline-offset: 2px; }

/* Header ----------------------------------------------------- */
.top { padding-top: calc(14px + env(safe-area-inset-top)); }
.top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 96, "wdth" 88;
}
.brand p { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 7px 10px; cursor: pointer; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); }

/* Fortschrittsband: 21 Striche, einer pro Tag, Fähre als Lücke */
.progress { display: flex; gap: 3px; margin-top: 12px; height: 6px; }
.progress i { flex: 1; background: var(--line); border-radius: 2px; display: block; }
.progress i.n { background: var(--fern); opacity: .55; }
.progress i.s { background: var(--pukaki); opacity: .55; }
.progress i.past { opacity: 1; }
.progress i.today { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.progress i.gap { flex: 0 0 6px; background: transparent; }

/* Tabs ------------------------------------------------------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs-row { display: flex; }
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; font-size: 12px; text-decoration: none; color: var(--ink-2);
  border-top: 2px solid transparent; margin-top: -1px;
}
.tabs a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--ink); border-top-color: var(--ink); }

@media (min-width: 760px) {
  body { padding-bottom: 40px; }
  .tabs { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); margin-top: 16px; }
  .tabs a { flex: 0 0 auto; flex-direction: row; padding: 12px 16px; font-size: 15px; border-top: 0; border-bottom: 2px solid transparent; margin: 0 0 -1px; }
  .tabs a.on { border-bottom-color: var(--ink); }
  .tabs a svg { width: 18px; height: 18px; }
}

main { padding-top: 18px; }
.tab > * + * { margin-top: 16px; }

/* Hero (Heute / Countdown) ---------------------------------- */
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 18px 18px 16px;
}
.hero .big {
  font-size: 30px; font-weight: 700; letter-spacing: -0.015em;
  font-variation-settings: "opsz" 96, "wdth" 85;
}
.hero .sub { color: var(--ink-2); margin-top: 4px; }
.hero .meta { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.hero.today { border-color: var(--fern); border-width: 2px; }
.hero .cta { margin-top: 12px; display: inline-block; font-weight: 600; }

/* Toolbar ---------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { background: transparent; border: 0; padding: 7px 11px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--bg); }
input[type="search"] {
  flex: 1 1 180px; min-width: 0; font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--surface); color: var(--ink);
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-size: 14px; cursor: pointer; user-select: none;
}
.chip input { margin: 0; accent-color: var(--fern); }
.chip:has(input:checked) { border-color: var(--ink); }
.chip-hdr:has(input:checked) { border-color: var(--tussock); background: var(--tussock-soft); }
.wrap-chips { justify-content: flex-start; gap: 8px; }
.hint { color: var(--ink-2); font-size: 14px; }

/* Route-Band ------------------------------------------------- */
.ribbon { position: relative; padding-left: 64px; }
/* Jede Zeile trägt ihr eigenes Stück Linie: grün Nordinsel, blau Südinsel */
.day, .ferry { position: relative; }
.day::before, .ferry::before {
  content: ""; position: absolute; left: -9px; top: 0; bottom: 0; width: 3px; background: var(--fern);
}
.day.sued::before { background: var(--pukaki); }
.day:first-child::before { top: 16px; }
.day:last-child::before { bottom: auto; height: 22px; }
.day { padding: 10px 0 10px 18px; }
.day + .day { border-top: 1px solid var(--line); }
.day.hide, .ferry.hide { display: none; }
.day .dot {
  position: absolute; left: -14px; top: 16px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--fern); z-index: 1;
}
.day.sued .dot { border-color: var(--pukaki); }
.day.today-day .dot { background: var(--ink); border-color: var(--ink); }
.day .when {
  position: absolute; left: -64px; top: 10px; width: 40px; text-align: right; line-height: 1;
}
.day .when b { display: block; font-size: 22px; font-weight: 700; font-variation-settings: "opsz" 48, "wdth" 85; }
.day .when small { display: block; color: var(--ink-2); font-size: 11px; margin-top: 3px; white-space: nowrap; }
.day .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.day .ttl { display: block; font-size: 17px; font-weight: 600; }
.day .sleep { color: var(--ink-2); font-size: 14px; margin-top: 2px; margin-right: 6px; }
.day .caret { flex: 0 0 auto; width: 18px; height: 18px; color: var(--ink-2); transition: transform .18s ease; margin-top: 3px; }
.day.open .caret { transform: rotate(180deg); }
.day .body { display: none; margin-top: 10px; }
.day.open .body { display: block; }
.day .stops li { position: relative; padding-left: 14px; margin: 4px 0; }
.day .stops li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.day .facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.day .note { margin-top: 8px; font-size: 14px; padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-s); }
.ferry { padding: 8px 0 8px 18px; color: var(--pukaki); font-size: 14px; }
.ferry::before { background: repeating-linear-gradient(to bottom, var(--pukaki) 0 5px, transparent 5px 10px); }

/* Tag-Marker als Information, nicht Deko */
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-s); margin: 6px 6px 0 0; line-height: 1.3; }
.tag.FIX { background: var(--rust-soft); color: var(--rust); }
.tag.HdR { background: var(--tussock-soft); color: var(--tussock); }
.tag.PUFFER { background: var(--surface-2); color: var(--grey); }
.tag.gebucht { background: var(--fern-soft); color: var(--fern); }

/* Karte ------------------------------------------------------ */
#map { height: min(72vh, 640px); border-radius: var(--radius-l); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); }
.mk-sleep {
  width: 24px; height: 24px; border-radius: 50%; background: var(--fern); color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.mk-sleep.sued { background: var(--pukaki); }
.mk-poi { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-2); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--ink-2); }
.mk-poi.hdr { background: var(--tussock); box-shadow: 0 0 0 1px var(--tussock); }
.mk-poi.optional { opacity: .7; }
.mk-poi.raus { background: var(--line); box-shadow: 0 0 0 1px var(--grey); }
.leaflet-popup-content { font-family: var(--font); font-size: 14px; }
.leaflet-popup-content b { display: block; font-size: 15px; }

/* Orte ------------------------------------------------------- */
.island-h { font-size: 13px; color: var(--ink-2); margin-top: 20px; }
.region { margin-top: 14px; }
.region h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.place { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.place.hide { display: none; }
.place .nm { flex: 1; }
.place .nm small { display: block; color: var(--ink-2); font-size: 13px; }
.place.raus .nm { color: var(--ink-2); }
.place .dy { flex: 0 0 auto; font-size: 13px; color: var(--pukaki); font-weight: 600; white-space: nowrap; }
.place .dy.opt { color: var(--ink-2); font-weight: 400; }
.place .ring { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--tussock); align-self: center; }
.empty { color: var(--ink-2); padding: 24px 0; text-align: center; }

/* Infos ------------------------------------------------------ */
.acc { border-top: 1px solid var(--line); }
.acc summary { cursor: pointer; padding: 14px 0; font-size: 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; color: var(--ink-2); font-weight: 400; font-size: 20px; }
.acc[open] summary::after { content: "–"; }
.acc .item { padding: 0 0 14px; }
.acc .item h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.acc .item li { position: relative; padding-left: 14px; margin: 3px 0; font-size: 15px; }
.acc .item li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--line); }

/* Checkliste ------------------------------------------------- */
.cl-group { margin-top: 18px; }
.cl-group h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.cl { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer; }
.cl input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--fern); flex: 0 0 auto; }
.cl.done span { color: var(--ink-2); text-decoration: line-through; }

/* Toast ------------------------------------------------------ */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  background: var(--ink); color: var(--bg); padding: 10px 12px 10px 16px; border-radius: 999px; display: flex; gap: 12px; align-items: center;
  z-index: 30; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-size: 14px;
}
.toast button { background: var(--bg); color: var(--ink); border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 600; cursor: pointer; }
@media (min-width: 760px) { .toast { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
