:root {
  --ink: #1d2a24; --pine: #1f3a2f; --pine-2: #2c4c3e; --pine-soft: #e7eee9;
  --wine: #7a1f2b; --wine-soft: #f5e8ea; --gold: #b08d57; --gold-soft: #f4ede1;
  --paper: #f6f4ef; --line: #e5dfd4; --muted: #6f6a62;
  --radius: 10px; --shadow: 0 1px 2px #1d2a240a, 0 8px 24px #1d2a240d;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.6 var(--sans); color: var(--ink); background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--wine); text-underline-offset: 3px; }
h1, h2 { font-family: var(--serif); font-weight: 600; }
h2 { font-size: 1.3rem; margin: 0 0 1rem; color: var(--pine); display: flex; align-items: center; gap: .55rem; }
h2 .i { color: var(--gold); width: 1.15em; height: 1.15em; }
.i { width: 1.1em; height: 1.1em; flex-shrink: 0; vertical-align: -.18em; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .7rem; color: var(--gold); margin: 0 0 .2rem; font-weight: 600; }
.eyebrow.light { color: #d9c399; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.pre { white-space: pre-line; margin: 0; }

/* ---------- Kopfzeile ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { max-width: 1100px; margin: auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font: 600 1.2rem var(--serif); color: var(--pine); text-decoration: none; margin-right: auto; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--pine); color: #d9c399; }
.mainnav { display: flex; gap: .15rem; }
.mainnav a, .logout { display: flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; padding: .5rem .75rem; border-radius: 8px; font-size: .9rem; }
.mainnav a .i { color: var(--muted); }
.mainnav a:hover { background: var(--paper); }
.mainnav a.active { background: var(--pine-soft); color: var(--pine); font-weight: 600; }
.mainnav a.active .i { color: var(--pine); }
.logout { color: var(--muted); border: 1px solid var(--line); }
.logout:hover { color: var(--wine); border-color: var(--wine); }
.tabbar { display: none; }

main { width: 100%; max-width: 1100px; margin: 1.75rem auto; padding: 0 1.25rem; flex: 1; }
footer { text-align: center; padding: 1.5rem 1rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  border-radius: 14px; padding: 3rem 1.5rem 2.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M40 34l1.5 4.5L46 40l-4.5 1.5L40 46l-1.5-4.5L34 40l4.5-1.5z' fill='%23ffffff' fill-opacity='.06'/%3E%3Ccircle cx='10' cy='12' r='1' fill='%23ffffff' fill-opacity='.08'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 80% 0%, #3d6b56 0, transparent 55%),
    linear-gradient(160deg, var(--pine), #132a20);
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--wine), var(--gold), var(--wine)); }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.15; margin: .3rem 0 1.75rem; }
.facts { display: inline-flex; flex-wrap: wrap; justify-content: center; margin: 0; background: #ffffff10; border: 1px solid #ffffff22; border-radius: 12px; backdrop-filter: blur(2px); }
.facts div { display: grid; grid-template-columns: auto 1fr; column-gap: .65rem; align-items: center; text-align: left; padding: .85rem 1.5rem; }
.facts div + div { border-left: 1px solid #ffffff22; }
.facts .i { grid-row: span 2; width: 1.5em; height: 1.5em; color: #d9c399; }
.facts dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .15em; color: #ffffffa0; }
.facts dd { margin: 0; font-weight: 600; }
#countdown { display: flex; justify-content: center; gap: .75rem; margin-top: 1.75rem; }
#countdown[hidden], #today[hidden] { display: none; }
#countdown div { min-width: 76px; padding: .7rem .5rem; border-radius: 10px; background: #ffffff; color: var(--pine); box-shadow: 0 4px 0 #0000002a; }
#countdown b { display: block; font: 600 2.1rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--wine); }
#countdown small { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
#today { font: 1.5rem var(--serif); margin-top: 1.5rem; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 2rem; margin: 0; color: var(--pine); line-height: 1.2; }
.page-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 12px; background: var(--pine); color: #d9c399; box-shadow: var(--shadow); }
.page-icon .i { width: 26px; height: 26px; }
.mini-facts { display: flex; gap: .5rem; margin: 0 0 0 auto; }
.mini-facts div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem 1rem; text-align: center; }
.mini-facts dt { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.mini-facts dd { margin: 0; font: 600 1.2rem var(--serif); color: var(--wine); }

/* ---------- Kacheln & Karten ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.tile { display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; text-decoration: none; color: var(--muted); font-size: .85rem; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.tile .ic { grid-row: span 2; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--wine-soft); color: var(--wine); }
.tile .ic .i { width: 22px; height: 22px; }
.tile b { font: 600 1.8rem/1.1 var(--serif); color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }
.grid > div > .card + .card { margin-top: 1.25rem; }
.grid + .card, .card + .grid { margin-top: 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.count { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 99px; background: var(--paper); font-size: .8rem; font-weight: 600; color: var(--muted); }

/* ---------- Formulare ---------- */
label { display: block; margin: .8rem 0; font-size: .84rem; color: var(--muted); }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .65rem .8rem; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; background: #fdfcfa; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine); box-shadow: 0 0 0 3px #1f3a2f1f; background: #fff; }
.row { display: flex; gap: .8rem; }
.row > label { flex: 1; margin-top: .8rem; }
.row > .narrow-field { flex: 0 0 150px; }
.inline { display: flex; gap: .6rem; }
.inline select { flex: 0 0 160px; margin: 0; }
.inline input { flex: 1; margin: 0; }
button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; background: var(--pine); color: #fff; border: 0; padding: .6rem 1.3rem; border-radius: 8px; cursor: pointer; font: 600 .9rem var(--sans); }
button:hover { background: var(--pine-2); }
button.full { width: 100%; margin-top: .4rem; }
button.ghost { background: transparent; color: var(--wine); border: 1px solid var(--wine); }
button.ghost:hover { background: var(--wine-soft); }
button.link { background: none; color: var(--pine); padding: 0; min-height: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { background: transparent; color: var(--muted); padding: 0; width: 40px; min-height: 40px; border-radius: 8px; }
.icon-btn:hover { background: var(--wine-soft); color: var(--wine); }
form.del { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.choice label { margin: 0; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; justify-content: center; gap: .45rem; min-height: 48px; padding: .6rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); cursor: pointer; font-weight: 600; }
.choice input:checked + span { border-color: var(--pine); background: var(--pine); color: #fff; }
.choice input[value="0"]:checked + span { border-color: var(--wine); background: var(--wine); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px #1f3a2f33; }
.switch { display: flex; align-items: center; gap: .75rem; color: var(--ink); font-size: .95rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--line); transition: background .2s; flex-shrink: 0; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .2s; }
.switch input:checked + span { background: var(--pine); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px #1f3a2f33; }

/* ---------- Elemente ---------- */
.flash { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--pine); padding: .75rem 1rem; border-radius: 8px; box-shadow: var(--shadow); }
.flash .i { color: var(--pine); }
.flash.warn { border-left-color: var(--gold); box-shadow: none; }
.flash.warn .i { color: var(--gold); }
.badge { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; }
.badge.yes { background: var(--pine-soft); color: var(--pine); }
.badge.no { background: var(--wine-soft); color: var(--wine); }
.badge.open { background: var(--gold-soft); color: #7c6234; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: .55rem 0 .55rem 1.5rem; border-left: 2px solid var(--gold-soft); margin-left: .35rem; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 1rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--wine); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li > div { display: flex; flex-direction: column; }
.list small { font-size: .78rem; }
.empty { color: var(--muted); font-style: italic; font-size: .9rem; }
.list .empty { border: 0; }
.dish { padding: .8rem 0; border-bottom: 1px dashed var(--line); }
.dish:last-child { border-bottom: 0; }
.dish b { font: 600 1.1rem var(--serif); }
.dish small { display: block; color: var(--muted); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; column-gap: .8rem; padding: .5rem 0; }
.steps li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: #7c6234; font-weight: 700; }
.steps span { color: var(--muted); font-size: .9rem; }
.reveal { text-align: center; padding: 2rem 1.5rem; background: linear-gradient(180deg, #fff, var(--gold-soft)); }
.reveal-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--wine); color: #fff; margin-bottom: .6rem; }
.reveal-icon .i { width: 28px; height: 28px; }
.reveal summary { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; padding: .7rem 1.4rem; margin-top: .6rem; border-radius: 8px; background: var(--pine); color: #fff; font-weight: 600; list-style: none; }
.reveal summary::-webkit-details-marker { display: none; }
.reveal details[open] summary { display: none; }
.partner { justify-content: center; font-size: 2.3rem; color: var(--wine); margin: .3rem 0 1rem; }
.wish { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; max-width: 520px; margin: auto; }

/* Login */
.auth { display: grid; grid-template-columns: 1fr 1fr; max-width: 860px; margin: 1.5rem auto; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.auth-side { color: #fff; padding: 2.5rem; background: radial-gradient(ellipse at 80% 0%, #3d6b56 0, transparent 60%), linear-gradient(160deg, var(--pine), #132a20); }
.auth-side h1 { font-size: 2rem; margin: .2rem 0 1.2rem; line-height: 1.2; }
.auth-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: #ffffff18; color: #d9c399; margin-bottom: 1.2rem; }
.auth-icon .i { width: 26px; height: 26px; }
.auth-points { list-style: none; padding: 0; margin: 0; }
.auth-points li { display: flex; gap: .6rem; align-items: center; padding: .4rem 0; color: #ffffffd0; }
.auth-points .i { color: #d9c399; }
.auth-text { color: #ffffffc0; }
.auth-form { background: #fff; padding: 2.5rem; }

/* Tabelle */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
th, td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fcfbf8; }
.row-actions { text-align: right; }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  .mainnav a span, .logout span { display: none; }
  .mainnav a, .logout { padding: .55rem; }
}

/* ---------- Smartphone ---------- */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .bar { padding: .6rem 1rem; }
  .brand { font-size: 1.05rem; }
  .brand-mark { width: 30px; height: 30px; }
  .mainnav { display: none; }
  main { margin: 1rem auto; padding: 0 .9rem; }
  body.with-tabs main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.with-tabs footer { display: none; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
            padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px #1d2a2412; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem 0; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .68rem; }
  .tabbar a .i { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--pine); font-weight: 600; background: var(--pine-soft); }

  .hero { padding: 2rem 1rem 1.75rem; border-radius: 12px; }
  .facts { display: flex; flex-direction: column; width: 100%; }
  .facts div { padding: .7rem 1rem; }
  .facts div + div { border-left: 0; border-top: 1px solid #ffffff22; }
  #countdown { gap: .45rem; }
  #countdown div { min-width: 0; flex: 1; max-width: 80px; padding: .55rem .2rem; }
  #countdown b { font-size: 1.6rem; }
  #countdown small { font-size: .6rem; letter-spacing: .06em; }

  .tiles { gap: .5rem; }
  .tile { grid-template-columns: 1fr; text-align: center; padding: .8rem .4rem; font-size: .72rem; line-height: 1.3; }
  .tile .ic { grid-row: auto; width: 36px; height: 36px; margin: 0 auto .3rem; }
  .tile b { font-size: 1.4rem; }

  .grid { grid-template-columns: 1fr; gap: 1rem; }
  .grid > div > .card + .card, .grid + .card, .card + .grid { margin-top: 1rem; }
  .card { padding: 1.15rem; margin-bottom: 1rem; }
  .page-head { gap: .75rem; margin-bottom: 1rem; }
  .page-head h1 { font-size: 1.6rem; }
  .page-icon { width: 44px; height: 44px; }
  .mini-facts { margin: 0; width: 100%; }
  .mini-facts div { flex: 1; }
  .row, .inline { flex-direction: column; gap: 0; }
  .row > .narrow-field, .inline select { flex: auto; }
  .inline > * { width: 100%; margin-bottom: .6rem !important; }
  .choice span { min-height: 52px; }
  form > button:not(.icon-btn):not(.link) { width: 100%; }

  .auth { grid-template-columns: 1fr; margin: 0 -.9rem; border-radius: 0; border: 0; }
  .auth-side { padding: 1.75rem 1.25rem; }
  .auth-side h1 { font-size: 1.6rem; }
  .auth-form { padding: 1.5rem 1.25rem; }

  /* Tabelle als Karten */
  table.responsive thead { display: none; }
  table.responsive tr { display: block; position: relative; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  table.responsive tbody tr:hover { background: none; }
  table.responsive td { display: flex; justify-content: space-between; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-align: left; }
  table.responsive td:first-child { font-size: 1rem; padding-right: 48px; }
  table.responsive td:first-child::before { display: none; }
  table.responsive .row-actions { position: absolute; top: .55rem; right: 0; padding: 0; }
}
