/* Grafarvogur – viðburðir. Mobile-first, no framework. */
:root {
  --bg: #F4F7F6; --surface: #FFFFFF; --surface-2: #E9EFEE; --border: #D9E2E1;
  --ink: #1D2A33; --muted: #56656C; --teal: #0F5E6B; --teal-ink: #FFFFFF;
  --lupine: #5B3FD0; --lupine-ink: #FFFFFF; --sun: #F5C04A;
  --open: #1E7A46; --soon: #8A5A00; --closed: #B3261E;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-full: 999px;
  --shadow: 0 8px 28px rgb(29 42 51 / .14), 0 1px 3px rgb(29 42 51 / .10);
  --font-d: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: 16px; --max: 1200px; --nav-h: 64px; --top-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1A20; --surface: #17242B; --surface-2: #213139; --border: #2C3D45;
    --ink: #E8EEEE; --muted: #A2B1B6; --teal: #6FC7C9; --teal-ink: #0B1416;
    --lupine: #A99AF5; --lupine-ink: #120B2E; --sun: #F5C04A;
    --open: #6BCB8E; --soon: #F2B544; --closed: #FF8A80;
    --shadow: 0 8px 28px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) [style*="--cd"] { --c: var(--cd); }
}
:root[data-theme="dark"] {
  --bg: #0F1A20; --surface: #17242B; --surface-2: #213139; --border: #2C3D45;
  --ink: #E8EEEE; --muted: #A2B1B6; --teal: #6FC7C9; --teal-ink: #0B1416;
  --lupine: #A99AF5; --lupine-ink: #120B2E; color-scheme: dark;
}
:root[data-theme="dark"] [style*="--cd"] { --c: var(--cd); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font); hyphens: auto;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.i { width: 22px; height: 22px; flex: none; }
.i-s { width: 18px; height: 18px; }

/* ---------- header + nav ---------- */
.top { position: sticky; top: 0; z-index: 40; isolation: isolate; }
.top::before { content: ''; position: absolute; inset: 0; z-index: -1; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.top-in { max-width: var(--max); margin: 0 auto; height: var(--top-h); padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 800 1.3rem/1 var(--font-d); letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; color: var(--teal); }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 600; min-height: 44px; }
.nav a[aria-current="page"] { color: var(--teal); }
.nav a[aria-current="page"] .i { stroke-width: 2.3; }
.nav .nav-add .i { background: var(--lupine); color: var(--lupine-ink); border-radius: var(--r-full); width: 44px; height: 30px; padding: 4px 11px; }
.top .btn-add { display: none; }

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .nav { position: static; display: flex; gap: 4px; height: auto; padding: 0; background: none; border: 0; margin-left: 8px; }
  .nav a { flex-direction: row; gap: 7px; font-size: .95rem; padding: 8px 14px; border-radius: var(--r-full); }
  .nav a:hover { background: var(--surface-2); color: var(--ink); }
  .nav a[aria-current="page"] { background: color-mix(in oklab, var(--teal) 12%, transparent); }
  .nav .nav-add { display: none; }
  .top .btn-add { display: inline-flex; margin-left: auto; background: var(--lupine); color: var(--lupine-ink); border-color: transparent; }
  .top .btn-add:hover { background: color-mix(in oklab, var(--lupine) 88%, black); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .12s, transform .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--teal); color: var(--teal-ink); border-color: transparent; }
.btn-primary:hover { background: color-mix(in oklab, var(--teal) 86%, black); }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 52px; font-size: 1.05rem; padding: 12px 22px; }

/* ---------- hero + search ---------- */
.hero { max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter) 8px; }
.h1 { font: 800 clamp(2rem, 1.3rem + 3.6vw, 3.6rem)/1.02 var(--font-d); letter-spacing: -.035em; margin: 0 0 10px; text-wrap: balance; }
.hero-sm .h1 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.9rem); }
.h2 { font: 700 1.35rem/1.2 var(--font-d); letter-spacing: -.02em; margin: 32px 0 12px; }
.h3 { font: 700 1.1rem/1.25 var(--font-d); margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 18px; max-width: 60ch; }

.search { position: relative; display: flex; align-items: center; max-width: 680px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--r-full); padding: 4px 6px 4px 46px; box-shadow: 0 1px 2px rgb(29 42 51 / .05); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 18%, transparent); }
.search .s-ic { position: absolute; left: 16px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 44px; font-size: 1.05rem; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.s-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; justify-content: center; border: 0; border-radius: var(--r-full); background: none; color: var(--muted); cursor: pointer; padding: 0 10px; font-weight: 600; font-size: .9rem; }
.s-btn:hover { background: var(--surface-2); color: var(--ink); }
.s-btn.ai { background: color-mix(in oklab, var(--lupine) 12%, transparent); color: var(--lupine); }
.mic.listening { background: var(--closed); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in oklab, var(--closed) 20%, transparent); } }

/* ---------- sticky filter bar ---------- */
.bar { position: sticky; top: var(--top-h); z-index: 30; background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.bar.stuck { border-bottom-color: var(--border); }
.bar > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.strip, .cats { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--gutter); scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
.strip::-webkit-scrollbar, .cats::-webkit-scrollbar { display: none; }
.strip { padding-bottom: 4px; }
.day {
  flex: none; scroll-snap-align: start; display: grid; justify-items: center; align-content: center; gap: 1px;
  min-width: 52px; height: 66px; padding: 6px 8px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s;
}
.day .d-w { font-size: .72rem; font-weight: 600; color: var(--muted); }
.day .d-n { font: 700 1.3rem/1 var(--font-d); font-variant-numeric: tabular-nums; }
.day.wknd .d-w { color: var(--teal); }
.day-all, .day-wkd { min-width: 78px; }
.day-all .d-n, .day-wkd .d-n { font-size: 1rem; }
.dots { display: flex; gap: 3px; height: 5px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); opacity: .7; }
.day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.day[aria-pressed="true"] .d-w, .day[aria-pressed="true"].wknd .d-w { color: inherit; opacity: .8; }
.day[aria-pressed="true"] .dots i { background: var(--sun); opacity: 1; }
.day.today:not([aria-pressed="true"]) { border-color: var(--teal); }
.day.past { display: none; }

.bar-row { display: flex; align-items: center; gap: 8px; }
.bar-row .cats { flex: 1; min-width: 0; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 13px 6px 10px;
  border: 1.5px solid var(--border); border-radius: var(--r-full); background: var(--surface); cursor: pointer;
  font-size: .92rem; font-weight: 600; white-space: nowrap; color: var(--ink); transition: background .15s, border-color .15s;
}
.chip .i { color: var(--c, var(--teal)); }
.chip:hover { border-color: var(--c, var(--teal)); }
.chip[aria-pressed="true"], .chip:has(input:checked) { background: var(--c, var(--teal)); border-color: var(--c, var(--teal)); color: var(--bg); }
.chip[aria-pressed="true"] .i, .chip:has(input:checked) .i { color: inherit; }
.chip .n { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
.chip.zero { opacity: .45; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.cats.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.view { flex: none; display: flex; padding: 3px; margin-right: var(--gutter); background: var(--surface-2); border-radius: var(--r-full); }
.vbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-full); background: none; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); }
.vbtn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
@media (max-width: 599px) { .vbtn span { display: none; } .vbtn { padding: 0 10px; } }

/* ---------- list ---------- */
.split { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 40px; }
.status { margin: 10px 0 0; color: var(--muted); font-size: .92rem; }
.status:empty { display: none; }
.dgroup { margin-top: 10px; }
.dgroup + .dgroup { margin-top: 22px; }
.dhead { position: sticky; top: calc(var(--top-h) + var(--bar-h, 136px)); z-index: 5; display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 10px 0 8px; background: var(--bg); font: 800 clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem)/1.1 var(--font-d); letter-spacing: -.03em; }
.dh-date { font: 600 .9rem/1 var(--font); color: var(--muted); letter-spacing: 0; }
.dh-date.dup { display: none; }
.evs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev-link {
  position: relative; display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px;
  padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border);
  color: var(--ink); text-decoration: none; overflow: hidden; transition: border-color .15s, transform .12s;
}
.ev-link:hover { border-color: var(--c); text-decoration: none; }
.ev-link:active { transform: scale(.995); }
.ev-time { display: grid; font: 700 1.08rem/1.1 var(--font-d); font-variant-numeric: tabular-nums; }
.ev-time small { font: 500 .78rem/1.3 var(--font); color: var(--muted); }
.ev-body { display: grid; gap: 3px; min-width: 0; }
.ev-title { font-weight: 650; font-size: 1.04rem; line-height: 1.3; overflow-wrap: anywhere; }
.ev-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; color: var(--muted); font-size: .9rem; }
.ev-meta .i { color: var(--muted); width: 15px; height: 15px; }
.free { margin-left: 4px; padding: 1px 8px; border-radius: var(--r-full); background: color-mix(in oklab, var(--open) 14%, transparent); color: var(--open); font-weight: 700; font-size: .78rem; }
.ev-cat { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in oklab, var(--c) 13%, var(--surface)); color: var(--c); }
.ev.hl .ev-link { border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in oklab, var(--c) 30%, transparent); }
.evs.compact .ev-link { padding: 10px 12px; }

.empty { text-align: center; padding: 48px 16px; border: 2px dashed var(--border); border-radius: var(--r-lg); margin-top: 24px; }
.empty-t { font: 700 1.3rem/1.2 var(--font-d); margin: 0 0 6px; }

.regular { margin-top: 40px; }
.reg { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.reg a, .reg > li > span { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.reg span span, .reg a span { color: var(--muted); font-size: .9rem; }

/* ---------- map ---------- */
.mapcol { position: relative; }
.map { height: calc(100dvh - var(--top-h) - 150px - var(--nav-h)); min-height: 360px; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); margin-top: 12px; }
.map-mode .listcol { display: none; }
@media (min-width: 1024px) {
  .split.has-map { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .map-mode .listcol { display: block; }
  .mapcol { position: sticky; top: calc(var(--top-h) + 150px); align-self: start; }
  .map { height: calc(100dvh - var(--top-h) - 170px); }
  .split.has-map .dhead { position: static; }
}
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c, var(--teal)); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .3); display: grid; place-items: center; }
.pin b { transform: rotate(45deg); color: #fff; font: 700 .78rem/1 var(--font); }
.leaflet-popup-content { font: 400 .95rem/1.4 var(--font); margin: 12px 14px; }
.leaflet-popup-content a { font-weight: 600; }
.pop-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.pop-list small { color: #56656C; display: block; }

/* ---------- detail ---------- */
.detail { max-width: 760px; margin: 0 auto; padding: 12px var(--gutter) 48px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 14px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.back:hover { color: var(--ink); }
.d-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.d-date { display: grid; justify-items: center; width: 68px; padding: 8px 0 10px; border-radius: var(--r-md); background: var(--c); color: #fff; }
.dd-m { font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
.dd-d { font: 800 2rem/1 var(--font-d); }
.d-title { font-size: clamp(1.8rem, 1.3rem + 2.6vw, 2.8rem); margin-top: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: var(--r-full); background: color-mix(in oklab, var(--c, var(--teal)) 13%, var(--surface)); color: var(--c, var(--teal)); font-weight: 700; font-size: .82rem; }
.d-img { width: 100%; border-radius: var(--r-lg); margin: 18px 0 4px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.facts { display: grid; gap: 14px; margin: 22px 0; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.facts div { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.facts dt { color: var(--teal); padding-top: 1px; }
.facts dd { margin: 0; }
.facts:empty { display: none; }
[data-reldate]:not(:empty)::before { content: ' · '; color: var(--muted); }
[data-reldate] { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
@media (max-width: 599px) {
  .actions .btn-primary { flex: 1 1 100%; }
  .actions .btn { flex: 1 1 auto; }
}
.prose { max-width: 65ch; font-size: 1.05rem; }
.prose p { margin: 0 0 1em; }
.prose.narrow { margin: 0 auto; padding: 0 var(--gutter) 40px; max-width: calc(65ch + 2 * var(--gutter)); }
.minimap { position: relative; display: block; margin: 24px 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); aspect-ratio: 8 / 3; border: 1px solid var(--border); }
.tiles { position: absolute; inset: 0; overflow: hidden; }
.tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.tile-pin { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -26px 0 0 -13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c, var(--teal)); border: 3px solid #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tiles img { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); } }
.minimap span { position: absolute; right: 10px; bottom: 10px; display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: var(--r-full); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); }
.src { font-size: .9rem; margin-top: 32px; }
.more .h2 { font-size: 1.15rem; }

.hours { border-collapse: collapse; width: 100%; max-width: 420px; }
.hours th, .hours td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.hours th { font-weight: 500; color: var(--muted); }
.hours tr.today th, .hours tr.today td { color: var(--ink); font-weight: 700; }

/* ---------- places ---------- */
.pls { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.split.has-map .pls { grid-template-columns: 1fr; }
.pl a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); color: var(--ink); text-decoration: none; height: 100%; }
.pl a:hover { border-color: var(--teal); }
.pl-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in oklab, var(--teal) 11%, var(--surface)); color: var(--teal); }
.pl-body { display: grid; gap: 2px; min-width: 0; }
.pl-name { font-weight: 650; }
.pl-meta { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-side { display: grid; justify-items: end; gap: 4px; }
.rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .88rem; }
.rating .i { color: #E3A008; fill: #E3A008; }
.open-badge { padding: 2px 9px; border-radius: var(--r-full); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.open-badge.is-open { background: color-mix(in oklab, var(--open) 14%, transparent); color: var(--open); }
.open-badge.is-soon { background: color-mix(in oklab, var(--soon) 14%, transparent); color: var(--soon); }
.open-badge.is-closed { background: color-mix(in oklab, var(--closed) 11%, transparent); color: var(--closed); }

/* ---------- year ---------- */
.year { list-style: none; max-width: var(--max); margin: 8px auto 48px; padding: 0 var(--gutter); display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.month { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.month.now { border: 2px solid var(--teal); }
.m-name { font: 800 1.5rem/1 var(--font-d); letter-spacing: -.02em; margin: 0 0 12px; text-transform: capitalize; }
.month.now .m-name::after { content: 'núna'; margin-left: 8px; padding: 2px 8px; border-radius: var(--r-full); background: var(--teal); color: var(--teal-ink); font: 700 .75rem/1.4 var(--font); vertical-align: middle; }
.month ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.month li li { display: grid; position: relative; padding-left: 16px; }
.month li li::before { content: ''; position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--teal)); }
.month li li span { color: var(--muted); font-size: .88rem; }

/* ---------- form ---------- */
.form-wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) 48px; display: grid; gap: 32px; }
@media (min-width: 900px) { .form-wrap { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; } .alt { position: sticky; top: calc(var(--top-h) + 20px); } }
.form { display: grid; gap: 18px; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-weight: 650; padding: 0; margin-bottom: 2px; }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md); background: var(--bg); transition: border-color .15s; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--teal) 16%, transparent); }
.field textarea { resize: vertical; }
.field .row { display: flex; gap: 8px; }
.field .row input { flex: 1; }
.hint { margin: 0; color: var(--muted); font-size: .88rem; }
.paste { padding: 14px; border-radius: var(--r-md); background: color-mix(in oklab, var(--lupine) 7%, var(--surface)); }
.paste .btn { color: var(--lupine); }
.grid2 { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.more-fields summary { cursor: pointer; font-weight: 650; color: var(--teal); padding: 6px 0; }
.more-fields[open] summary { margin-bottom: 14px; }
.more-fields > .field + .field, .more-fields > .grid2 + .field { margin-top: 14px; }
.hp { position: absolute; left: -9999px; }
.form-msg { margin: 0; font-weight: 600; }
.form-msg.ok { color: var(--open); }
.form-msg.err { color: var(--closed); }
.alt { display: grid; gap: 8px; padding: 22px; border-radius: var(--r-lg); background: var(--surface-2); }
.alt p { margin: 0 0 14px; }
.done { text-align: center; padding: 40px 22px; }
.done .h1 { font-size: 2rem; }

/* ---------- feeds ---------- */
.feeds { list-style: none; max-width: 860px; margin: 0 auto 48px; padding: 0 var(--gutter); display: grid; gap: 10px; }
.feed { display: grid; grid-template-columns: 44px 1fr; gap: 12px 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); }
.feed-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in oklab, var(--c) 13%, var(--surface)); color: var(--c); }
.feed-body { display: grid; }
.feed-body span { color: var(--muted); font-size: .9rem; }
.feed-act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 700px) { .feed { grid-template-columns: 44px 1fr auto; } .feed-act { grid-column: auto; } }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--border); margin-top: 24px; }
.foot-in { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 32px; font-size: .95rem; }
.foot p { margin: 0 0 8px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; padding: 10px 18px; border-radius: var(--r-full); background: var(--ink); color: var(--bg); font-weight: 600; z-index: 60; transition: opacity .2s, transform .2s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1024px) { .toast { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Dark map tiles: OSM raster has no dark style, so invert it. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); } }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
.leaflet-container { font-family: var(--font); background: var(--surface-2); }
