:root {
  --ink: #0a2e36;
  --ink-soft: #456268;
  --lagoon: #0f7c82;
  --lagoon-deep: #0b5f66;
  --foam: #e8f2ee;
  --paper: #ffffff;
  --mango: #ffb627;
  --hibiscus: #e23e6b;
  --line: #cfe0db;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --thai: "Noto Sans Thai", "Thonburi", sans-serif;
  --bar: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--foam);
  color: var(--ink);
  font: 400 17px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--lagoon-deep); }
:focus-visible { outline: 3px solid var(--mango); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; padding-bottom: calc(var(--bar) + var(--safe-b) + 96px); min-height: 100vh; }
.pad { padding: 0 16px; }

/* ---------- Toppbilde ---------- */
.hero {
  position: relative;
  min-height: 430px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 28px;
  display: flex; flex-direction: column; justify-content: flex-end;
  color: #fff;
  background: var(--ink) center/cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,46,54,.15) 0%, rgba(10,46,54,.1) 35%, rgba(10,46,54,.92) 100%);
}
.hero > * { position: relative; }
.hero-thai {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px;
  font: 700 64px/1 var(--thai); color: rgba(255,255,255,.9);
  text-shadow: 0 2px 24px rgba(10,46,54,.45);
}
.hero-place { font: 500 17px/1.3 var(--body); opacity: .92; }
.hero h1 { font: 800 clamp(40px, 12.5vw, 60px)/.98 var(--display); letter-spacing: -.025em; margin: 6px 0 12px; text-wrap: balance; }
.hero-sub { font-size: 18px; line-height: 1.4; max-width: 30ch; }
.sea {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; margin-top: 16px;
  padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.16);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-weight: 600; font-size: 15px;
}
.sea:empty { display: none; }

/* ---------- Felles byggeklosser ---------- */
.block { margin-top: 28px; }
.block > h2 { font: 700 26px/1.1 var(--display); letter-spacing: -.015em; margin: 0 16px 12px; }
.panel { background: var(--paper); border-radius: 22px; margin: 0 12px; padding: 18px; }
.panel + .panel { margin-top: 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 12px 18px;
  border: 0; border-radius: 16px; background: var(--ink); color: #fff;
  font-weight: 700; font-size: 18px; text-decoration: none; text-align: center;
}
.btn:active { transform: scale(.985); }
.btn.sea-btn { background: var(--lagoon); }
.btn.light { background: var(--foam); color: var(--ink); }
.btn.mango { background: var(--mango); color: var(--ink); }
.btn.warn { background: #fde8ee; color: #a3163f; }
.btn svg, .mini svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-row { display: grid; gap: 10px; }
.btn-row.two { grid-template-columns: 1fr 1fr; }

/* Neste steg */
.next { background: var(--mango); border-radius: 22px; margin: -18px 12px 0; padding: 18px; position: relative; }
.next h2 { font: 700 15px/1.2 var(--body); margin-bottom: 4px; }
.next p { font: 700 21px/1.25 var(--display); }
.next .btn { margin-top: 14px; }

/* 7-Eleven-knappen: stripene er butikkens egne */
.seven { background: #fff; color: var(--ink); position: relative; overflow: hidden; padding-left: 34px; justify-content: flex-start; }
.seven::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 18px;
  background: linear-gradient(90deg, #f58220 0 33.3%, #008a4b 33.3% 66.6%, #e4002b 66.6%);
}

/* Dagsplan */
.day { display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; padding-top: 0; }
.day:last-child { padding-bottom: 0; }
.day-date { text-align: center; }
.day-date b { display: block; font: 800 26px/1 var(--display); }
.day-date span { font-size: 14px; color: var(--ink-soft); }
.day.today .day-date b { color: var(--hibiscus); }
.day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.day li { font-weight: 600; line-height: 1.3; }
.day li.fixed { font-weight: 500; color: var(--ink-soft); }
.day li button { background: none; border: 0; padding: 0; font-weight: 600; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.day .empty { color: var(--ink-soft); font-size: 15px; }

/* ---------- Ønsker ---------- */
.top { padding: calc(env(safe-area-inset-top, 0px) + 22px) 16px 0; }
.top h1 { font: 800 40px/1 var(--display); letter-spacing: -.02em; }
.who { margin-top: 8px; background: none; border: 0; padding: 6px 0; font-size: 16px; color: var(--ink-soft); text-align: left; }
.who b { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: #d6e6e1; border-radius: 14px; padding: 4px; margin: 14px 16px 0; }
.seg button { border: 0; background: none; border-radius: 11px; min-height: 46px; font-weight: 700; }
.seg button.on { background: var(--paper); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; min-height: 44px; padding: 8px 16px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.list { display: grid; gap: 10px; margin-top: 12px; }
.wish { background: var(--paper); border-radius: 22px; margin: 0 12px; padding: 18px; }
.wish-head { display: flex; gap: 12px; align-items: flex-start; }
.wish-emoji { font-size: 30px; line-height: 1.1; flex: none; }
.wish h3 { font: 700 21px/1.2 var(--display); letter-spacing: -.01em; overflow-wrap: anywhere; }
.wish-note { margin-top: 4px; }
.wish-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; color: var(--ink-soft); align-items: center; }
.tag { background: var(--foam); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-weight: 600; font-size: 13.5px; }
.tag.calm { background: #d5f0f1; color: var(--lagoon-deep); }
.tag.planned { background: #fff0cc; }
.vote {
  margin-top: 14px; width: 100%; min-height: 58px; border-radius: 16px;
  border: 2px solid var(--hibiscus); background: var(--paper); color: var(--hibiscus);
  font-weight: 700; font-size: 18px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.vote svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.vote.on { background: var(--hibiscus); color: #fff; }
.vote.on svg { fill: currentColor; }
.vote.pop svg { animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.35); } }
.voters { margin-top: 8px; font-size: 15px; color: var(--ink-soft); min-height: 22px; }
.wish-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mini { min-height: 50px; border: 0; border-radius: 14px; background: var(--foam); font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); padding: 6px 10px; }
.del { margin-top: 10px; background: none; border: 0; color: var(--ink-soft); font-size: 15px; text-decoration: underline; padding: 8px 0; }
.empty-list { text-align: center; padding: 40px 28px; color: var(--ink-soft); }

#map { height: calc(100vh - 330px); min-height: 380px; margin: 12px 12px 0; border-radius: 22px; overflow: hidden; background: #cfe3e6; z-index: 0; }
.pin { width: 38px; height: 38px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--paper); border: 2.5px solid var(--ink); display: grid; place-items: center; box-shadow: 0 3px 8px rgba(10,46,54,.3); }
.pin span { transform: rotate(45deg); font-size: 18px; line-height: 1; }
.pin.home { background: var(--mango); }
.leaflet-popup-content { font: 400 16px/1.4 var(--body); margin: 14px 16px; }
.leaflet-popup-content b { font: 700 18px/1.2 var(--display); display: block; margin-bottom: 4px; }
.leaflet-popup-content a { display: inline-block; margin-top: 8px; font-weight: 700; }

.fab {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bar) + var(--safe-b) + 14px); z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 62px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--mango); color: var(--ink); font: 700 20px/1 var(--display);
  box-shadow: 0 10px 28px rgba(10,46,54,.28);
}
.fab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.fab[hidden] { display: none; }

/* ---------- Info ---------- */
.fold { background: var(--paper); border-radius: 22px; margin: 10px 12px 0; }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 68px; font: 700 21px/1.2 var(--display); cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .ico { font-size: 26px; flex: none; }
.fold > summary::after { content: ""; margin-left: auto; width: 11px; height: 11px; border-right: 2.5px solid var(--ink); border-bottom: 2.5px solid var(--ink); transform: rotate(45deg); transition: transform .2s; flex: none; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold-body { padding: 0 18px 20px; display: grid; gap: 14px; }
.fold-body p { max-width: 62ch; }
.fold-body ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.fold-body h3 { font: 700 17px/1.3 var(--body); }

.flight { border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; }
.flight-top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; color: var(--ink-soft); font-size: 15px; }
.flight-legs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 10px; }
.flight-legs div:last-child { text-align: right; }
.flight-legs b { display: block; font: 800 32px/1 var(--display); letter-spacing: -.02em; }
.flight-legs span { font-size: 15px; color: var(--ink-soft); }
.flight-legs i { width: 44px; height: 2px; background: var(--line); position: relative; }
.flight-legs i::after { content: "✈"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); font-style: normal; background: var(--paper); padding: 0 4px; color: var(--lagoon); }
.alert { background: #fff0cc; border-radius: 16px; padding: 14px 16px; font-weight: 600; line-height: 1.35; }
.alert.red { background: #fde8ee; color: #7d1030; }

.check { display: grid; gap: 4px; list-style: none; padding: 0 !important; }
.check label { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; padding: 10px 0; cursor: pointer; }
.check input { appearance: none; -webkit-appearance: none; width: 34px; height: 34px; border: 2.5px solid var(--ink); border-radius: 10px; margin: 0; display: grid; place-items: center; background: var(--paper); }
.check input:checked { background: var(--lagoon); border-color: var(--lagoon); }
.check input:checked::after { content: ""; width: 9px; height: 16px; border: solid #fff; border-width: 0 3.5px 3.5px 0; transform: rotate(45deg) translate(-1px, -2px); }
.check input:checked + span { color: var(--ink-soft); text-decoration: line-through; }
.check span b { display: block; }
.check span small { font-size: 15px; color: var(--ink-soft); display: block; }
.check a { font-weight: 600; }

.calc { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.calc label { font-size: 15px; color: var(--ink-soft); display: grid; gap: 4px; }
.calc input, .calc output { display: block; width: 100%; min-height: 58px; border-radius: 14px; border: 2px solid var(--line); padding: 8px 12px; font: 800 24px/1.6 var(--display); background: var(--paper); }
.calc output { background: var(--foam); border-color: var(--foam); }
.calc > span { padding-bottom: 16px; font-weight: 700; }

.call { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.call:first-of-type { border-top: 0; }
.call b { display: block; }
.call small { color: var(--ink-soft); font-size: 15px; }
.call em { font-style: normal; background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 700; white-space: nowrap; }

/* ---------- Bunnmeny ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--bar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar button { border: 0; background: none; display: grid; place-content: center; justify-items: center; gap: 3px; color: var(--ink-soft); font-weight: 600; font-size: 14px; }
.tabbar svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on svg { stroke: var(--lagoon); stroke-width: 2.4; }
.tabbar button.on span { font-weight: 700; }

/* ---------- Ark nedenfra ---------- */
.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 26px 26px 0 0; background: var(--paper); color: var(--ink); overflow: auto;
}
.sheet::backdrop { background: rgba(10,46,54,.55); }
.sheet[open] { animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-in { padding: 22px 18px calc(22px + var(--safe-b)); display: grid; gap: 16px; }
.sheet h2 { font: 800 28px/1.1 var(--display); letter-spacing: -.015em; padding-right: 50px; }
.sheet .x { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--foam); font-size: 26px; line-height: 1; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; }
.field small { color: var(--ink-soft); font-size: 15px; }
.field input, .field textarea { width: 100%; min-height: 58px; border-radius: 14px; border: 2px solid var(--line); padding: 14px; font-size: 18px; background: var(--paper); }
.field input:focus, .field textarea:focus, .calc input:focus { outline: 0; border-color: var(--lagoon); }
.paste { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.paste button { border: 0; border-radius: 14px; background: var(--foam); font-weight: 700; padding: 0 18px; }
.cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cats button { border: 2px solid var(--line); background: var(--paper); border-radius: 14px; padding: 10px 2px; display: grid; justify-items: center; gap: 2px; font-size: 13px; font-weight: 600; }
.cats button i { font-style: normal; font-size: 26px; line-height: 1.2; }
.cats button.on { border-color: var(--ink); background: var(--foam); }
.err { color: #a3163f; font-weight: 600; }
.err:empty { display: none; }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.days button { border: 2px solid var(--line); background: var(--paper); border-radius: 14px; min-height: 64px; display: grid; place-content: center; font-size: 14px; color: var(--ink-soft); }
.days button b { font: 800 22px/1 var(--display); color: var(--ink); }
.days button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.days button.on b { color: #fff; }

.driver { background: var(--ink); color: #fff; }
.driver .sheet-in { text-align: center; gap: 20px; padding-top: 60px; }
.driver .x { background: rgba(255,255,255,.15); color: #fff; }
.driver .th { font: 700 30px/1.5 var(--thai); }
.driver .en { font: 800 30px/1.15 var(--display); }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar) + var(--safe-b) + 92px); transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 60; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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