:root {
  --bg: #f6efe2;
  --berry: #c8401e;
  --card: #fffaf0;
  --ink: #2b2620;
  --muted: #6f6556;
  --line: #e6dcc8;
  --accent: #2f5d3e;      /* den grønne hoveddør */
  --accent-ink: #ffffff;
  --warm: #b85f24;        /* efterårsblade */
  --bar: #3f7a52;
  --bar-hover: #2a5a3a;
  --grid: #e9e0cf;
  --shadow: 0 2px 10px rgba(60, 45, 20, 0.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Nunito, system-ui, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; margin: 0; }
h2 { font-size: 1.3rem; margin: 26px 0 10px; }
h3 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.9rem; margin: -6px 0 10px; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* Topbillede der skifter ved tryk */
.hero {
  position: relative;
  height: 46vw; min-height: 210px; max-height: 340px;
  overflow: hidden; cursor: pointer;
  border-radius: 0 0 28px 28px;
  background: #2f4a37;
  -webkit-tap-highlight-color: transparent;
}
.hero-img {
  position: absolute; inset: 0;
  background: center / cover no-repeat;
  transition: opacity 0.7s ease;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 16, 10, 0.65), rgba(20, 16, 10, 0) 55%);
  pointer-events: none;
}
.hero-text {
  position: absolute; left: 20px; bottom: 18px; z-index: 1;
  color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}
.hero-text h1 { font-size: 2rem; line-height: 1.1; }
.hero-text p { margin: 2px 0 0; opacity: 0.9; }
.hero-dots { position: absolute; right: 16px; top: calc(14px + env(safe-area-inset-top)); z-index: 1; display: flex; gap: 6px; }
.hero-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
.hero-dots span.on { background: #fff; }

/* Kort og lister */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.card p { margin: 0 0 10px; }
.card p:last-child { margin-bottom: 0; }
.list { display: grid; gap: 10px; }
.stay {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.stay .title { font-weight: 700; }
.stay .when { color: var(--muted); font-size: 0.9rem; }
.stay .price { grid-row: span 2; text-align: right; font-weight: 700; font-size: 1.1rem; }
.stay .price small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.stay.upcoming { border-left: 5px solid var(--warm); cursor: default; }
.empty { color: var(--muted); font-style: italic; }

/* Periode-vælger */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips button {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; font: inherit; font-size: 0.9rem; cursor: pointer;
}
.chips button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 16px; }
.range label { font-size: 0.85rem; color: var(--muted); display: grid; gap: 4px; }
input[type="datetime-local"], input[type="number"] {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; width: 100%; min-width: 0;
}

/* Resultat */
.total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.total .kr { font-family: Fraunces, Georgia, serif; font-size: 2.4rem; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.stat { background: var(--bg); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 1.05rem; }
.stat span { font-size: 0.78rem; color: var(--muted); }
.breakdown { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-top: 6px; }
.breakdown td { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown tr.sum td { font-weight: 700; border-bottom: none; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 10px; }
.warn { background: #fff1dc; color: #6b3d0c; border-radius: 12px; padding: 8px 12px; font-size: 0.9rem; margin: 10px 0 0; }
[data-theme="dark"] .warn { background: #3a2a17; color: #f3cf9f; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; border: 0;
  border-radius: 14px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.pay { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.box-no { font-size: 1.05rem; }

/* Graf */
.chart { margin-top: 14px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .label { font-size: 11px; fill: var(--muted); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart rect.bar { fill: var(--bar); }
.chart rect.bar.hover { fill: var(--bar-hover); }
.chart-cap { font-size: 0.85rem; color: var(--muted); margin: 0 0 4px; }
.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 6px 10px;
  font-size: 0.85rem; line-height: 1.35; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

/* Indstillinger */
.settings label { display: grid; gap: 6px; margin-bottom: 14px; }
.input-unit { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.input-unit input { width: 90px; }
.toggle { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--accent); }

/* Bundmenu */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabs button {
  flex: 1; max-width: 140px; background: none; border: 0; color: var(--muted);
  font: inherit; font-size: 0.78rem; display: grid; justify-items: center; gap: 2px;
  padding: 6px 0; cursor: pointer; border-radius: 12px;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 700; }

/* Detaljevisning */
dialog {
  border: 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  width: 100%; max-width: 640px; max-height: 88vh;
  margin: auto auto 0; border-radius: 24px 24px 0 0;
  background: var(--bg); color: var(--ink);
}
dialog::backdrop { background: rgba(20, 16, 10, 0.45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.close { background: var(--card); border: 1px solid var(--line); color: var(--ink); border-radius: 50%; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; }

/* Udseende */
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.swatch {
  display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 4px 0;
  color: var(--ink); font: inherit; font-size: 0.8rem; cursor: pointer;
}
.swatch i {
  width: 44px; height: 44px; border-radius: 50%; display: block;
  border: 2px solid var(--line); box-shadow: inset 0 0 0 4px var(--card);
}
.swatch[aria-pressed="true"] i { border-color: var(--ink); }
.swatch[aria-pressed="true"] { font-weight: 700; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.segmented button { background: none; border: 0; color: var(--ink); font: inherit; padding: 8px 0; border-radius: 9px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--card); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* Login */
.login-page { padding-bottom: 0; min-height: 100vh; }
.login-bg { position: fixed; inset: 0; background: url(/img/5.jpg) center / cover; z-index: -1; }
.login-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20, 16, 10, 0.1), rgba(20, 16, 10, 0.55)); }
.login { min-height: 100vh; display: grid; align-items: end; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.login-card { max-width: 420px; width: 100%; margin: 0 auto; }
.login-card h1 { font-size: 2rem; }
.login-card form, .login-card label { display: grid; gap: 8px; }
.login-card form { margin-top: 16px; gap: 12px; }
.login-card label { font-size: 0.9rem; color: var(--muted); }
#googleBox { margin-top: 18px; display: grid; justify-items: center; }
#googleBox[hidden] { display: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; width: 100%; margin: 20px 0 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
input[type="email"], input[type="text"], input[type="date"], textarea {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; min-width: 0;
}
#code { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; }
.linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; }

/* Booking og medlemmer */
.book-btn { width: 100%; margin-top: 18px; padding: 14px; font-size: 1.05rem; }
.book-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.book-form { display: grid; gap: 12px; margin-top: 14px; }
.book-form > label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.book-form .range { margin: 0; }
input[type="time"] { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; }
.stay .who { font-size: 0.85rem; color: var(--muted); }
.stay .actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; border-radius: 10px; }
.me { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.me p { margin: 0; }
.add-member { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.add-member input[type="email"] { grid-column: 1 / -1; }
.add-member .toggle { margin: 0; }
.members { list-style: none; margin: 14px 0 0; padding: 0; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--line); }
.members .badge { font-size: 0.7rem; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.members .remove { background: none; border: 0; color: var(--warm); font: inherit; font-size: 0.85rem; cursor: pointer; }

/* Betalt: en lille klase rønnebær */
.berries { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex: none; }
.berries circle { fill: var(--berry); }
.berries .twig { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; }
.paid-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-style: italic; }
.paid-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 0 !important; color: var(--muted); }
.paid-btn { margin-top: 8px; gap: 6px; }
.linkbtn.small { font-size: 0.85rem; }
.google-lead { margin: 0 0 8px; font-weight: 600; }

/* Periodevælger */
.period-kind { margin-bottom: 12px; grid-template-columns: repeat(4, 1fr); }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.stepper span { font-weight: 700; text-align: center; flex: 1; }
.step {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0 3px;
}
.step:disabled { opacity: 0.35; cursor: default; }
.settings input:disabled { opacity: 0.7; }
.google-btn { width: 100%; background: var(--card); color: var(--ink); border: 1px solid var(--line); gap: 10px; }
.google-btn svg { width: 20px; height: 20px; flex: none; }

/* Installation */
.install { text-align: center; display: grid; gap: 12px; }
.install h1 { margin-top: -4px; }
.install-icon { width: 84px; height: 84px; border-radius: 20px; margin: -58px auto 0; box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
.install section { display: grid; gap: 10px; }
.install-btn { padding: 14px; font-size: 1.05rem; }
.steps { text-align: left; margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.share-ico {
  display: inline-block; width: 1.05em; height: 1.25em; vertical-align: -0.25em; margin: 0 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M10 1v13M5.5 5.5 10 1l4.5 4.5M6 9H3v13h14V9h-3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M10 1v13M5.5 5.5 10 1l4.5 4.5M6 9H3v13h14V9h-3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.link-box { font-weight: 700; background: var(--bg); border-radius: 12px; padding: 10px; margin: 0; }
.install details { text-align: left; }
.install-banner {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 10px;
}
.install-banner img { border-radius: 10px; flex: none; }
.install-banner a { flex: 1; color: var(--ink); font-weight: 600; text-decoration: none; }
.install-banner .close { width: 30px; height: 30px; flex: none; }

/* Bekræftelse og tilføj medlem */
dialog.confirm { margin: auto; border-radius: 22px; max-width: 360px; width: calc(100% - 32px); padding: 20px; }
.confirm h3 { margin-bottom: 8px; }
.confirm p { margin: 0 0 18px; color: var(--muted); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-toggle { width: 100%; margin-top: 12px; }
.add-member { margin-top: 12px; }

/* Profil-fane og layout på brede skærme */
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 0.8rem; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 48px; height: 48px; font-size: 1.3rem; flex: none; }
.tabs button[aria-current="page"] .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); }
.me p { flex: 1; }
.tabs { padding-left: max(8px, calc((100% - 640px) / 2)); padding-right: max(8px, calc((100% - 640px) / 2)); }
.hero-text { left: max(16px, calc((100% - 640px) / 2 + 16px)); }
.hero-dots { right: max(16px, calc((100% - 640px) / 2 + 16px)); }
details.fold summary { list-style: none; cursor: pointer; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary h2 { display: flex; align-items: center; gap: 8px; }
details.fold summary h2::after { content: "›"; font-family: Nunito, sans-serif; color: var(--muted); transition: transform 0.2s; margin-left: auto; }
details.fold[open] summary h2::after { transform: rotate(90deg); }
details.fold .count { color: var(--muted); font-family: Nunito, sans-serif; font-weight: 400; font-size: 1rem; }
details.fold summary { color: var(--ink); }

/* Kom godt i gang */
.onboarding { margin-top: 12px; display: grid; gap: 4px; }
.ob-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.ob-row + .ob-row { border-top: 1px dashed var(--line); padding-top: 10px; }
.ob-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.ob-row.done .ob-check { background: var(--accent); border-color: var(--accent); }
.ob-row.done .ob-check::after { content: "✓"; color: var(--accent-ink); font-weight: 700; font-size: 0.85rem; }
.onboarding.all-done { opacity: 0.85; }
.m-status { margin-left: 8px; font-size: 0.85rem; letter-spacing: 2px; }
.m-status span { filter: grayscale(1); opacity: 0.3; }
.m-status span.on { filter: none; opacity: 1; }
