/* Resa: ljung, sjö och mossa. Typsnitt (SIL OFL, se fonts/): Fredoka till rubriker och siffror, Nunito till text. */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 300 700; font-display: swap;
             src: url("/static/fonts/fredoka.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap;
             src: url("/static/fonts/nunito.woff2") format("woff2"); }

:root {
  --bg: #f6f3ee; --panel: #fff; --raise: #efeae2; --text: #1f2430; --muted: #5d6472;
  --line: #e6e0d6; --line-strong: #c9c1b3;
  --accent: #5c3d8c; --accent-soft: #ece5f6; --on-accent: #fff;
  --loch: #1f4e79; --ok: #2f7a45; --ok-soft: #dcefe1; --warn: #a3520f; --warn-soft: #fbead9;
  --bad: #b3261e; --bad-soft: #f9dedb;
  --shadow: 0 1px 2px rgb(31 36 48 / .06), 0 4px 14px rgb(31 36 48 / .06);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  /* Sorterna: samma färger på kartan, i listorna och i chipsen. */
  --k-sevardhet: #8a5a44; --k-natur: #3f7d4e; --k-vandring: #687a22; --k-stad: #4b5d8a; --k-mat: #c4661d;
  --k-pub: #9b3b2e; --k-whisky: #a87a1c; --k-strand: #1f8799; --k-boende: #5c3d8c; --k-annat: #6b6f7a;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161c; --panel: #1d2029; --raise: #262a35; --text: #eceaf2; --muted: #a5a9b8;
          --line: #2c303c; --line-strong: #444a5a; --accent: #b79ae6; --accent-soft: #2e2640; --on-accent: #14161c;
          --loch: #8cb8e3; --ok: #7fcf96; --ok-soft: #1c3324; --warn: #f0a564; --warn-soft: #3a2613;
          --bad: #ff8f86; --bad-soft: #3d1d1b; --shadow: 0 1px 2px rgb(0 0 0 / .3); }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
       font: 16px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
main { max-width: 600px; margin: 0 auto;
       padding: calc(20px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom)); }
header.top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
header.top h1 { flex: 1; min-width: 0; }
header.top > a:not(.back) { font-weight: 700; text-decoration: none; white-space: nowrap; }
h1 { font-family: var(--display); font-size: 30px; line-height: 1.1; font-weight: 600; margin: 0; text-wrap: balance;
     overflow-wrap: anywhere; }
h2 { font-family: var(--display); font-size: 20px; font-weight: 600; margin: 28px 0 10px; }
h2 small { font-family: "Nunito", sans-serif; font-size: 14px; color: var(--muted); font-weight: 700; }
.h3, h3 { display: block; font-size: 15px; font-weight: 800; margin: 0 0 8px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--muted); margin: 0 0 4px; display: flex; align-items: center; gap: 4px; }
.eyebrow .ico { width: 16px; height: 16px; }
a { color: var(--accent); }
p { margin: 0 0 10px; }
.m0 { margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.spaced { margin-top: 16px; }
.warn { color: var(--warn); }
small { color: var(--muted); font-size: 13px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
       stroke-linejoin: round; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
.back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 12px;
        color: var(--text); flex: none; }
.pager { display: flex; gap: 4px; }
.pager a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--panel);
           color: var(--text); box-shadow: var(--shadow); }

.flash { background: var(--accent-soft); border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; font-weight: 600; }
.flash.bad { background: var(--bad-soft); }
.offline { position: sticky; top: 0; z-index: 2000; margin: 0; padding: calc(6px + env(safe-area-inset-top)) 16px 6px;
           background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 14px; text-align: center; }
.card { display: block; background: var(--panel); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow);
        border: 1px solid var(--line); color: inherit; text-decoration: none; }
.card + .card { margin-top: 12px; }
.card.note { white-space: pre-wrap; margin: 12px 0; }
.card.empty { text-align: center; }
.card.empty p { color: var(--muted); }
.card.nudge { display: flex; gap: 12px; align-items: center; font-size: 24px; margin-bottom: 14px; }
.card.nudge span { font-size: 16px; }
.warnbox { background: var(--warn-soft); border-color: transparent; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { font-size: 14px; font-weight: 700; text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > input, .row > textarea, .row > select { flex: 1; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* Startsidan */
.hero { position: relative; margin: 4px 0 18px; padding: 22px 20px 20px; border-radius: 24px; color: #fff;
        background: linear-gradient(140deg, #5c3d8c 0%, #3d4f8f 55%, #1f6b6b 100%); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -10% -40% 30%; height: 120%; border-radius: 50%;
               background: rgb(255 255 255 / .07); pointer-events: none; }
.hero h1 { font-size: 34px; }
.hero .eyebrow { color: rgb(255 255 255 / .8); }
.hero .count { margin: 10px 0 0; font-size: 17px; }
.hero .count b { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1; margin-right: 4px; }
.hero .gear { position: absolute; top: 14px; right: 14px; color: #fff; width: 40px; height: 40px; display: grid;
              place-items: center; border-radius: 12px; background: rgb(255 255 255 / .14); z-index: 1; }
.paste { display: flex; flex-direction: column; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; }
.stats > * { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px;
             text-align: center; text-decoration: none; color: inherit; box-shadow: var(--shadow); min-width: 0; }
.stats b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; white-space: nowrap; }
.stats span span, .stats a span { font-size: 12px; color: var(--muted); }

/* Listor */
ul.list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line);
          border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
ul.list + ul.list { margin-top: 12px; }
ul.list > li { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 14px; min-height: 58px;
               border-bottom: 1px solid var(--line); }
ul.list > li:last-child { border-bottom: 0; }
ul.list > li > a.grow { color: inherit; text-decoration: none; display: flex; flex-direction: column; min-height: 42px;
                        justify-content: center; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 700; overflow-wrap: anywhere; }
.meta { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
ul.list.links a { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; flex: 1;
                  min-height: 40px; font-weight: 600; }
ul.list.links a::after { content: "›"; margin-left: auto; color: var(--muted); font-size: 20px; }
.tag { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 99px; background: var(--raise); vertical-align: 1px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.money { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.paid { color: var(--ok); }
.money.paid::after { content: " ✓"; }

/* Sortmärket: emoji i en färgad ring */
.kind { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
        font-size: 18px; background: var(--raise); line-height: 1; }
.kind .ico { width: 20px; height: 20px; color: var(--muted); }
h2 .kind, .line .kind, p .kind { width: 26px; height: 26px; font-size: 14px; vertical-align: middle; }
.place-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-weight: 700; }
.place-head .kind { width: 46px; height: 46px; font-size: 24px; }
.k-sevardhet { --k: var(--k-sevardhet); } .k-natur { --k: var(--k-natur); } .k-vandring { --k: var(--k-vandring); }
.k-stad { --k: var(--k-stad); } .k-mat { --k: var(--k-mat); } .k-pub { --k: var(--k-pub); }
.k-whisky { --k: var(--k-whisky); } .k-strand { --k: var(--k-strand); } .k-boende, .b-boende { --k: var(--k-boende); }
.k-annat { --k: var(--k-annat); }
.kind[class*="k-"], .kind.b-boende { background: color-mix(in srgb, var(--k) 18%, var(--panel));
                                     box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--k) 55%, transparent); }

/* Hjärtat: "jag vill dit" */
.vote { margin: 0; }
.heart { display: inline-flex; align-items: center; gap: 3px; min-width: 44px; min-height: 44px; justify-content: center;
         background: none; border: 0; padding: 0 6px; color: var(--muted); font-weight: 800; cursor: pointer; }
.heart.on { color: #d4405a; }
.heart.on .ico { fill: currentColor; }

/* Formulär */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px;
                          border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel);
                          font-size: 16px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; display: block; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; color: var(--muted); }
label > input, label > select, label > textarea { color: var(--text); font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-size: 16px; color: var(--text); }
label.check input { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
               padding: 10px 16px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--panel);
               font-weight: 800; text-decoration: none; color: var(--text); cursor: pointer; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.big { min-height: 54px; font-size: 17px; }
button.small { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 12px; white-space: nowrap; }
button.ghost, .btn.ghost { background: transparent; }
button.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
button.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
button:disabled { opacity: .45; cursor: default; }
.wide { width: 100%; }
.icon-btn { min-width: 48px; padding: 0; }
.icon-btn.sm { min-width: 36px; min-height: 36px; border-radius: 10px; }
form.busy button[type="submit"], form.busy button:not([type]) { opacity: .6; pointer-events: none; }
/* Bekräftelse: första trycket visar "Säker?", det andra skickar. */
.second { display: none; }
form.confirming .first { display: none; }
form.confirming .second { display: inline; }
form.confirming button { background: var(--bad); color: #fff; }

details.more, details.hint { margin-top: 16px; }
details > summary { cursor: pointer; font-weight: 800; color: var(--accent); padding: 8px 0; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
details.hint { margin: 0; font-size: 14px; color: var(--muted); }
details.hint p { margin: 4px 0 8px; }

/* Chips: sorterna och filtren */
.chips { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px; border-radius: 99px;
        border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--text); font-weight: 700;
        font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
label.chip { flex-direction: row; color: var(--text); }
.chip:has(input:checked), .chip.on { border-color: var(--k, var(--accent));
                                      background: color-mix(in srgb, var(--k, var(--accent)) 16%, var(--panel)); }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.filter { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--raise); padding: 4px; border-radius: 14px;
       margin-bottom: 12px; }
.seg a { text-align: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 800; }
.seg a.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* Kartorna */
.map { border-radius: 20px; overflow: hidden; background: var(--raise); z-index: 0; }
.map.mini { height: 230px; margin: 8px 0 12px; border: 1px solid var(--line); }
.pick.moving .map.mini { height: 340px; outline: 3px solid var(--accent); }
.pick { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.pick-hint { margin: 0; font-weight: 700; color: var(--accent); }
body.full main { max-width: none; padding: 0; }
.mapwrap { position: fixed; inset: 0 0 calc(68px + env(safe-area-inset-bottom)) 0; }
.map.full { position: absolute; inset: 0; border-radius: 0; }
.map-top { position: absolute; z-index: 500; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px;
           display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.map-bar { display: flex; gap: 8px; max-width: 520px; }
.map-bar select { box-shadow: var(--shadow); font-weight: 700; }
.map-btn { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px;
           background: var(--panel); color: var(--text); box-shadow: var(--shadow); border: 1.5px solid var(--line-strong); }
.map-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.map-chips .chip { min-height: 38px; padding: 4px 10px; font-size: 17px; box-shadow: var(--shadow); }
.map-chips .chip:not(.on) { opacity: .5; filter: grayscale(1); }
.map-note { position: absolute; z-index: 500; left: 50%; transform: translateX(-50%); bottom: 14px; margin: 0;
            background: var(--panel); padding: 8px 14px; border-radius: 99px; box-shadow: var(--shadow); font-weight: 700;
            font-size: 14px; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
/* Nålarna */
.pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0;
       transform: rotate(-45deg); background: var(--k, var(--k-annat)); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .35); }
.pin span { transform: rotate(45deg); font-size: 16px; line-height: 1; }
.pin.visited { opacity: .55; }
.pin.voted::after { content: "❤"; position: absolute; top: -8px; right: -8px; transform: rotate(45deg); font-size: 12px;
                    color: #d4405a; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.pin.lodging { border-radius: 10px; transform: none; background: #2b1d47; width: 36px; height: 36px; }
.pin.lodging span { transform: none; }
.pin.num span { font: 800 14px/1 "Nunito", sans-serif; color: #fff; }
.leaflet-popup-content-wrapper { border-radius: 16px; }
.leaflet-popup-content { margin: 12px 14px; font: 15px/1.4 "Nunito", system-ui, sans-serif; min-width: 180px; }
.leaflet-popup-content b { font-size: 16px; }
.leaflet-popup-content .pop-actions { display: flex; gap: 12px; margin-top: 8px; font-weight: 800; }
.leaflet-container { font-family: "Nunito", system-ui, sans-serif; }
@media (prefers-color-scheme: dark) {
  .leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); }
  .leaflet-bar a, .leaflet-control-layers { background: var(--panel); color: var(--text); border-color: var(--line); }
  .leaflet-control-attribution { background: rgb(20 22 28 / .75) !important; color: var(--muted); }
  .leaflet-control-attribution a { color: var(--accent); }
  /* Mörk karta: bitarna inverteras (nålarna ligger i ett eget lager och påverkas inte). */
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.7); }
}

/* Dagarna */
ol.days { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.day-card { display: flex; gap: 14px; align-items: flex-start; }
.today .day-card { outline: 3px solid var(--accent); }
.day-no { flex: none; width: 58px; font-family: var(--display); font-size: 19px; font-weight: 600; line-height: 1.1; }
.day-no small { display: block; font-family: "Nunito", sans-serif; font-weight: 700; }
.line { display: block; font-size: 14px; padding: 1px 0; overflow-wrap: anywhere; }
.line.night { color: var(--muted); font-weight: 700; }
.timeline .order { display: flex; flex-direction: column; gap: 2px; }
.timeline .order form { margin: 0; }

/* Bokningar */
.kinds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.kinds-grid .card { padding: 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.kinds-grid .card span { font-size: 22px; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
dl.facts dt { color: var(--muted); font-weight: 700; font-size: 14px; padding-top: 1px; }
dl.facts dd { margin: 0; font-weight: 700; }
.ref { font-family: ui-monospace, monospace; letter-spacing: .04em; cursor: copy; }

/* Listorna */
.checklist li.done .title { text-decoration: line-through; color: var(--muted); font-weight: 600; }
.checklist form { margin: 0; }
.check-btn { width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 10px; border: 2px solid var(--line-strong);
             font-weight: 900; }
li.done .check-btn { background: var(--ok); border-color: var(--ok); color: #fff; }
.icon-btn.x { border: 0; background: none; color: var(--muted); font-size: 22px; min-width: 36px; }
form.confirming .icon-btn.x { font-size: 13px; padding: 0 8px; }
.add-item { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.add-item .small { align-self: flex-start; }

/* Inloggning */
.login { max-width: 400px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login .card { text-align: left; }
.login-pin { margin: 0 auto; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px;
             background: var(--accent); color: var(--on-accent); }
.login-pin .ico { width: 34px; height: 34px; }

/* Menyn */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: grid; grid-template-columns: repeat(5, 1fr);
           background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(12px);
           -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
           padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
             font-size: 12px; font-weight: 800; color: var(--muted); text-decoration: none; }
nav.tabs a.active { color: var(--accent); }
nav.tabs a.plus .ico { width: 44px; height: 32px; padding: 4px 11px; border-radius: 12px; background: var(--accent);
                       color: var(--on-accent); stroke-width: 2.6; }
