:root {
  --navy: #0b3d5c;
  --navy-2: #12577f;
  --aqua: #1896a0;
  --sand: #f2b66d;
  --sand-soft: #fdf3e4;
  --bg: #f3f6f8;
  --card: #ffffff;
  --ink: #17222b;
  --muted: #5d6b76;
  --line: #dde4e9;
  --ok: #1f8a5b;
  --warn: #b7791f;
  --bad: #c0392b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 61, 92, .06), 0 6px 20px rgba(11, 61, 92, .07);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
a { color: var(--navy-2); }
.boot { padding: 2rem; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grid2 { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: .75rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grid2.keep { grid-template-columns: 1fr; } }

/* Kopf + Navigation */
.top {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff; padding: calc(.8rem + env(safe-area-inset-top)) 1rem .8rem;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  position: sticky; top: 0; z-index: 5;
}
.top .brand { font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: .5rem; }
.top .brand .star { color: var(--sand); }
.top button.ghost { background: rgba(255,255,255,.14); color: #fff; border: 0; padding: .4rem .8rem; border-radius: 999px; font-size: .85rem; }
.wrap { max-width: 880px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: #fff; border-top: 1px solid var(--line);
  display: flex; justify-content: space-around; padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
  overflow-x: auto;
}
.nav a {
  flex: 1 0 auto; min-width: 62px; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; padding: .35rem .3rem; border-radius: 10px; white-space: nowrap;
}
.nav a .ic { display: block; font-size: 1.25rem; line-height: 1.2; }
.nav a.on { color: var(--navy); font-weight: 600; background: var(--sand-soft); }
@media (min-width: 900px) {
  .nav { position: static; border: 0; background: transparent; max-width: 880px; margin: .75rem auto 0; padding: 0 1rem; justify-content: flex-start; gap: .25rem; }
  .nav a { flex: none; padding: .45rem .9rem; font-size: .9rem; background: #fff; border: 1px solid var(--line); }
  .nav a .ic { display: inline; font-size: 1rem; margin-right: .3rem; }
  .wrap { padding-bottom: 3rem; }
}

/* Karten */
.card { background: var(--card); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.card + .card, .card + .stack, .stack + .card { margin-top: .85rem; }
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--aqua) 100%);
  color: #fff; border-radius: 20px; padding: 1.2rem 1.2rem 1.1rem; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after { content: "★"; position: absolute; right: -10px; top: -30px; font-size: 9rem; color: rgba(242,182,109,.16); }
.hero .lvl { display: inline-block; background: var(--sand); color: #3a2a0c; font-weight: 700; font-size: .78rem; letter-spacing: .08em; padding: .2rem .65rem; border-radius: 999px; }
.hero .pts { font-size: 3rem; font-weight: 800; line-height: 1.1; margin-top: .5rem; }
.hero .pts small { font-size: 1rem; font-weight: 500; opacity: .85; }
.hero .sub { opacity: .9; font-size: .9rem; }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; margin: .6rem 0 .3rem; }
.bar > i { display: block; height: 100%; background: var(--sand); border-radius: 999px; }
.card .bar { background: #e6ecf0; }

.note { border-radius: 12px; padding: .65rem .85rem; font-size: .92rem; }
.note.warn { background: #fff4de; color: #7a4d06; }
.note.info { background: #e6f3f6; color: #0d4a57; }
.note.ok { background: #e4f5ec; color: #135a3a; }

/* Formulare */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: .7rem 0 .2rem; }
input, select, textarea {
  width: 100%; font: inherit; color: inherit; padding: .65rem .75rem; border: 1px solid #c9d3da; border-radius: 12px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--aqua); outline-offset: 1px; border-color: var(--aqua); }
input[type=checkbox] { width: auto; margin-right: .5rem; }
.check { display: flex; align-items: flex-start; gap: .25rem; font-weight: 400; color: var(--ink); font-size: .9rem; }
textarea { min-height: 6rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: .7rem 1.1rem; cursor: pointer;
  background: var(--navy); color: #fff; text-decoration: none; display: inline-block; text-align: center;
}
button:hover { background: var(--navy-2); }
button.sec { background: #e9eff3; color: var(--navy); }
button.sec:hover { background: #dbe5ec; }
button.warn { background: #fbe9e6; color: var(--bad); }
button.ok { background: var(--ok); }
button.sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 9px; }
button.block { width: 100%; margin-top: 1rem; }
button:disabled { opacity: .55; cursor: default; }

/* Listen + Tabellen */
.list > .item { padding: .7rem 0; border-top: 1px solid var(--line); }
.list > .item:first-child { border-top: 0; }
.item .t { font-weight: 600; }
.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; background: #e9eff3; color: var(--navy); vertical-align: middle; }
.pill.ok { background: #e4f5ec; color: var(--ok); } .pill.warn { background: #fff4de; color: var(--warn); } .pill.bad { background: #fbe9e6; color: var(--bad); }
.plus { color: var(--ok); font-weight: 700; } .minus { color: var(--bad); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .4rem; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; color: var(--muted); border-top: 0; }
td.c, th.c { text-align: center; }
.scroll { overflow-x: auto; }
.cur { background: var(--sand-soft); font-weight: 700; }
.code { font: 700 1.6rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .15em; background: var(--sand-soft); border-radius: 12px; padding: .5rem 1rem; display: inline-block; }

/* Anmeldung */
.auth { max-width: 440px; margin: 0 auto; padding: 2rem 1.1rem 3rem; }
.auth .logo { text-align: center; margin-bottom: 1.2rem; }
.auth .logo img { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); }
.auth .logo h1 { margin-top: .6rem; color: var(--navy); }
.auth .logo p { color: var(--muted); margin: .25rem 0 0; }

/* Dialog */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 25, 35, .55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 1.1rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }

#toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translateX(-50%) translateY(20px); background: #17222b; color: #fff; padding: .65rem 1.1rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: .25s; z-index: 40; max-width: 90vw; text-align: center; font-size: .92rem; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { background: var(--bad); }
.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 1.5rem 0 0; }
.install { display: none; }
.install.show { display: block; }

/* Kompakte Vergleichstabelle (Level) – passt auch auf kleine Handys */
table.cmp { table-layout: fixed; font-size: .8rem; }
table.cmp th, table.cmp td { padding: .45rem .2rem; word-break: break-word; hyphens: auto; }
table.cmp th:first-child, table.cmp td:first-child { width: 31%; padding-left: .1rem; }
table.cmp th { font-size: .66rem; letter-spacing: 0; }

/* Platz für Installations-Hinweise (leer = unsichtbar) */
.install-slot { margin-top: .85rem; }
.install-slot:empty { display: none; }
.install-slot .note, .install-slot .card { margin-top: 0; }

/* Einstiegsseite (NFC-Karte / QR-Code) */
.perks { list-style: none; margin: 0; padding: 0; }
.perks li { display: flex; gap: .6rem; padding: .35rem 0; line-height: 1.4; }
.step { display: flex; gap: .85rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.step:first-of-type { border-top: 0; }
.step .n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--sand); color: #3a2a0c; font-weight: 800; display: grid; place-items: center; }
.step .grow { flex: 1; min-width: 0; }
.step .install-slot, .step a.btn { margin-top: .6rem; }
.step a.btn.block { display: block; margin-top: .6rem; }
.card.welcome + .card.steps { margin-top: .85rem; }
input[type=range] { accent-color: var(--accent, #1896a0); padding: 0; }

/* Buchungsübersicht */
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .35rem .8rem; font-size: .82rem; color: inherit; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.trip-table { display: none; }
.trip-table table { font-size: .85rem; }
.trip-table th.r, .trip-table td.r { text-align: right; white-space: nowrap; }
.trip-table td, .trip-table th { padding: .5rem .45rem; }
@media (min-width: 760px) { .trip-cards { display: none; } .trip-table { display: block; } }
input[type=search] { -webkit-appearance: none; appearance: none; }
.nav a { min-width: 0; font-size: .7rem; }

/* ===== Design 1.4: Verlauf des Reudnitzer-Reisen-Logos, Kachel-Menü, gleichmäßiger Rhythmus ===== */
:root { --sea: #00b6e8; --sea-2: #0a84bd; --sun: #f7c61e; --foam: #e6f6fd; --gap: 14px; --deep: #06324d; }
body { background: radial-gradient(900px 420px at 88% -8%, #cfeefb 0%, rgba(207,238,251,0) 70%), var(--bg); background-attachment: fixed; }
.top { background: linear-gradient(115deg, #0a7fbd 0%, #00a3da 55%, #00b6e8 100%); box-shadow: 0 2px 14px rgba(0, 120, 180, .25); }
.top .brand { font-weight: 800; font-size: 1.05rem; }
.top .brand .star { color: var(--sun); }

/* gleichmäßiger Abstand zwischen allen Blöcken */
.wrap { display: flex; flex-direction: column; gap: var(--gap); padding-bottom: 7.5rem; }
.wrap > * { margin: 0 !important; }
.wrap > h1 { font-size: 1.6rem; font-weight: 800; color: var(--deep); }
.auth { display: flex; flex-direction: column; gap: var(--gap); }
.auth > * { margin: 0 !important; }
.grid2, .grid3 { gap: var(--gap); align-items: stretch; }
.grid2 > *, .grid3 > * { margin: 0 !important; height: 100%; }
.stack > * + * { margin-top: var(--gap); }
.card { border-radius: 18px; box-shadow: 0 1px 2px rgba(6, 50, 77, .05), 0 8px 24px rgba(6, 50, 77, .07); }
.card + .card, .card + .stack, .stack + .card { margin-top: 0; }

/* Kopfkachel */
.hero { background: linear-gradient(135deg, #00b6e8 0%, #3cc8ee 42%, #bfe9f8 78%, #f2fbff 100%); color: var(--deep); border-radius: 22px; padding: 1.3rem 1.3rem 1.2rem; box-shadow: 0 10px 30px rgba(0, 140, 200, .22); min-height: 12.5rem; }
.hero::after { content: ""; position: absolute; right: 0; bottom: 0; width: 66%; height: 78%; background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 320 200%22%3E%3Cg stroke=%22%23f7c61e%22 stroke-width=%228%22 stroke-linecap=%22round%22 opacity=%22.9%22%3E%3Cline x1=%22186.1%22 y1=%22152.7%22 x2=%22167.3%22 y2=%22145.9%22/%3E%3Cline x1=%22197.9%22 y1=%22132.3%22 x2=%22182.6%22 y2=%22119.4%22/%3E%3Cline x1=%22216.0%22 y1=%22117.1%22 x2=%22206.0%22 y2=%2299.8%22/%3E%3Cline x1=%22238.2%22 y1=%22109.0%22 x2=%22234.7%22 y2=%2289.3%22/%3E%3Cline x1=%22261.8%22 y1=%22109.0%22 x2=%22265.3%22 y2=%2289.3%22/%3E%3Cline x1=%22284.0%22 y1=%22117.1%22 x2=%22294.0%22 y2=%2299.8%22/%3E%3Cline x1=%22302.1%22 y1=%22132.3%22 x2=%22317.4%22 y2=%22119.4%22/%3E%3Cline x1=%22313.9%22 y1=%22152.7%22 x2=%22332.7%22 y2=%22145.9%22/%3E%3C/g%3E%3Ccircle cx=%22250%22 cy=%22176%22 r=%2256%22 fill=%22%23f7c61e%22/%3E%3Cpath d=%22M0 168 C60 150 110 186 170 168 S280 150 320 166 V200 H0Z%22 fill=%22%230b6aa8%22 opacity=%22.55%22/%3E%3Cpath d=%22M0 184 C70 170 120 198 190 184 S290 172 320 182 V200 H0Z%22 fill=%22%2306456f%22 opacity=%22.7%22/%3E%3C/svg%3E") no-repeat right bottom / contain; font-size: 0; opacity: .95; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .lvl { background: var(--sun); color: #3a2a00; letter-spacing: .06em; box-shadow: 0 2px 6px rgba(120, 90, 0, .25); }
.hero .pts { font-size: 3.2rem; font-weight: 800; color: var(--deep); letter-spacing: -.01em; }
.hero .pts small { color: #0b4a6f; opacity: 1; }
.hero .sub { color: #0b4a6f; opacity: 1; max-width: 22rem; }
.hero .bar { background: rgba(255, 255, 255, .6); max-width: 16rem; }
.hero .bar > i { background: linear-gradient(90deg, #0a84bd, #06456f); }

/* Navigation: Kacheln mit Symbol, der Name erscheint beim aktiven Eintrag und bei Hover */
.nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 6; background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(0, 150, 200, .15); border-radius: 24px;
  box-shadow: 0 10px 34px rgba(6, 50, 77, .2); padding: 6px; display: flex; gap: 4px; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 1 1 0; min-width: 44px; height: 54px; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: 0; border-radius: 18px;
  color: var(--sea-2); text-decoration: none; font-weight: 700; font-size: .85rem; background: transparent; border: 0; white-space: nowrap; transition: flex-grow .3s, background .2s, color .2s; }
.nav a .ic { display: grid; place-items: center; font-size: 0; margin: 0; }
.nav a .ic svg { width: 27px; height: 27px; }
.nav a .lb { max-width: 0; opacity: 0; overflow: hidden; transition: max-width .3s ease, opacity .25s ease; }
.nav a.on { flex: 0 0 auto; padding: 0 16px; background: linear-gradient(135deg, #00b6e8, #0a84bd); color: #fff; box-shadow: 0 4px 12px rgba(0, 130, 190, .35); font-weight: 700; }
.nav a.on .lb { max-width: 9rem; opacity: 1; }
@media (hover: hover) { .nav a:not(.on):hover { background: var(--foam); } .nav a:hover .lb { max-width: 9rem; opacity: 1; } .nav a:not(.on):hover { flex: 0 0 auto; padding: 0 14px; } }
.nav a:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
@media (min-width: 900px) {
  .nav { position: static; max-width: 880px; margin: 1rem auto 0; width: calc(100% - 2rem); background: #fff; }
  .nav a { flex: 0 0 auto; min-width: 56px; height: 56px; padding: 0 14px; }
  .wrap { padding-bottom: 3rem; }
}
#toast { bottom: 6.5rem; }

/* Kennzahl-Kacheln (immer gleich hoch) */
.stat { display: flex; flex-direction: column; gap: .15rem; min-height: 9.5rem; }
.stat .chip-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--foam); color: var(--sea-2); margin-bottom: .35rem; }
.stat .chip-ic svg { width: 22px; height: 22px; }
.stat .k { color: var(--muted); font-size: .82rem; }
.stat .v { font-size: 1.6rem; font-weight: 800; line-height: 1.15; color: var(--deep); }
.stat .v.sm { font-size: 1.15rem; }
.stat .s { margin-top: auto; color: var(--muted); font-size: .8rem; padding-top: .3rem; }
.stat button { margin-top: auto; align-self: flex-start; }

/* Kreisdiagramm */
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring .tr { stroke: #e3eef4; }
.ring .rg { transition: stroke-dasharray 1.1s cubic-bezier(.25, .8, .25, 1); }
.ring .mid { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.1; }
.ring .mid b { font-size: 1.55rem; color: var(--deep); font-weight: 800; }
.ring .mid span { font-size: .7rem; color: var(--muted); }
.ringcard { display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; min-height: 9.5rem; }
.ringcard .ring { margin-top: .1rem; }
.ringcard button { margin-top: auto; }
.legend { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-size: .75rem; color: var(--muted); justify-content: center; }
.legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .3rem; vertical-align: baseline; }
.redeem-ring { display: flex; justify-content: center; margin: .6rem 0 .2rem; }
@media (prefers-reduced-motion: reduce) { .ring .rg, .nav a, .nav a .lb { transition: none; } }

/* Symbole in Listen */
.lico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--foam); color: var(--sea-2); }
.lico.neg { background: #fff2dc; color: #b26a00; }
.lico svg { width: 21px; height: 21px; }
.lrow { display: flex; align-items: center; gap: .75rem; }
.lrow .grow { flex: 1; min-width: 0; }
.mag { display: flex; align-items: center; gap: .8rem; }
.mag .lico { width: 44px; height: 44px; }
svg.i { width: 1.15em; height: 1.15em; vertical-align: -.2em; }
/* 1.4.0 Hero: Motiv klein, rechts oben, hinter dem Text */
.hero::after { top: 0; bottom: auto; width: 42%; height: 46%; opacity: .5; background-position: right top; z-index: 0; border-top-right-radius: 22px; }
.hero { overflow: hidden; }
/* 2.0.3 Los-Kachel: gleich groß wie das Kreisdiagramm */
.ticket { width: 132px; height: 112px; display: grid; place-items: center; margin-top: .1rem; }
.ticket svg { width: 132px; height: auto; display: block; filter: drop-shadow(0 4px 8px rgba(6, 50, 77, .12)); }
.tk-note { margin-top: auto; }
