:root {
  --bg: #f6f3ec; --panel: #fffdf8; --text: #1d2430; --muted: #6b7280;
  --line: #e4ded1; --accent: #2f5d8a; --err: #a33a2a; --ok: #3f7d4e;
  --head-h: 52px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; }
h1, h2, h3, .brand { font-family: Fraunces, Georgia, serif; font-weight: 700; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Topp */
.top { height: var(--head-h); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.brand { text-decoration: none; color: var(--text); font-size: 1.1rem; white-space: nowrap; }
.top nav { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top nav a { text-decoration: none; }
.who { color: var(--muted); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sump { color: var(--muted); font-size: .85rem; }
form.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.btn { display: inline-block; background: var(--accent); color: #fff !important; border: 0; border-radius: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.small { padding: 5px 12px; font-size: .9rem; }
.btn:hover { filter: brightness(1.1); }

.flash { margin: 0; padding: 10px 16px; background: #e9f3ec; color: #24543a; border-bottom: 1px solid #cfe3d6; }
.flash.err { background: #f8e8e5; color: var(--err); border-color: #efcdc7; }
.form .flash, .narrow .flash { border-radius: 8px; border: 0; margin: 0 0 10px; }

/* Karta + lista */
.app { display: grid; grid-template-columns: 400px 1fr; height: calc(100vh - var(--head-h)); height: calc(100dvh - var(--head-h)); }
.panel { overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); }
.controls { padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 5; }
.controls input[type=search], .controls select, .form input, .form textarea, .form select, .searchrow input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; color: inherit; }
.controls select { width: auto; padding: 4px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip.off { opacity: .45; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li:hover, .list li.active { background: #f3eee1; }
.list li.active { box-shadow: inset 3px 0 0 var(--accent); }
.num { width: 30px; height: 30px; border-radius: 50%; color: #fff; font-weight: 600; font-size: .8rem; display: grid; place-items: center; }
.item h3 { font-family: Inter, system-ui, sans-serif; font-weight: 600; font-size: .98rem; margin: 0; }
.item .meta { color: var(--muted); font-size: .82rem; }
.item p { margin: 3px 0 4px; font-size: .88rem; }
.chipscore { display: inline-block; background: #eee9dd; border-radius: 6px; padding: 0 6px; font-size: .75rem; color: #555; margin-right: 3px; }
.chipscore.total { background: #d8d2c0; color: var(--text); font-weight: 600; }
.chipscore.zero { opacity: .5; }
.compact li { padding: 8px 14px; }
.outside { padding-bottom: 24px; }
.outside h2 { padding: 0 14px; font-size: 1rem; }
.empty { padding: 20px 14px; color: var(--muted); }

.map { background: #dfe9ef; }
.small-map { height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pin { width: 26px; height: 26px; border-radius: 50%; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4);
  display: grid; place-items: center; font: 600 11px Inter, sans-serif; transition: transform .15s; }
.far .pin { transform: scale(.45); font-size: 0; }
.pin.hot { transform: scale(1.35); z-index: 999; }
.homepin { width: 24px; height: 24px; background: #1d2430; color: #fff; border: 2px solid #fff; border-radius: 4px;
  display: grid; place-items: center; font: 700 12px Fraunces, serif; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.popup b { font-family: Fraunces, serif; }
.popup .muted { font-size: .85rem; }
.leaflet-container { font-family: Inter, system-ui, sans-serif; }

/* Sidor */
.page { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }
.page.narrow { max-width: 480px; }
.lead { font-size: 1.05rem; }
.crumb { margin: 0; }
.rankbadge { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: 50%; color: #fff; font: 600 1rem Inter, sans-serif; vertical-align: middle; padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.kv { border-collapse: collapse; width: 100%; }
.kv th { text-align: left; padding: 6px 10px 6px 0; font-weight: 600; }
.kv td { padding: 6px 10px 6px 0; }
.nearlist { padding-left: 18px; }
.form { display: flex; flex-direction: column; gap: 14px; margin: 16px 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.searchrow { display: flex; gap: 8px; margin-bottom: 10px; max-width: 420px; }
.tablewrap { overflow-x: auto; }
.tbl { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f3eee1; font-size: .85rem; }
.sources li { margin: 4px 0; }

/* Mobil */
@media (max-width: 760px) {
  .app { display: block; height: auto; }
  .map#map { position: sticky; top: var(--head-h); height: 52vh; z-index: 10; }
  .panel { overflow: visible; border-right: 0; }
  .controls { position: static; }
  .grid2 { grid-template-columns: 1fr; }
  .form .two { grid-template-columns: 1fr; }
  .top { padding: 0 10px; }
  .brand { font-size: .95rem; }
  .who, .sump { display: none; }
}

/* Tummar, kommentarer, admin */
.social { margin-top: 4px; font-size: .85rem; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.social .up, .social .down, .social .cmt { white-space: nowrap; }
.social .mine { font-weight: 700; text-decoration: underline; }
.feedback { margin-top: 28px; }
.votes { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 16px; }
.votebtn { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; font: inherit; cursor: pointer; color: var(--text); }
.votebtn .ico { font-size: 1.25rem; line-height: 1; }
.votebtn.mine { border-color: var(--accent); background: #e8f0f8; box-shadow: inset 0 0 0 1px var(--accent); }
.votebtn.static { cursor: default; }
.votebtn:not(.static):hover { border-color: var(--accent); }
.comments { list-style: none; padding: 0; margin: 0 0 16px; }
.comments li { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.comments p { margin: 4px 0 0; overflow-wrap: anywhere; }
.chead { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.form textarea { resize: vertical; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form label.check input { width: auto; }
.form input:disabled { background: #eee; }
.dim td { opacity: .6; }
.actions { white-space: nowrap; }
.actions form { margin-left: 8px; }
.searchrow { align-items: center; max-width: none; }
.searchrow form { display: flex; gap: 8px; flex: 1; max-width: 420px; }
@media (max-width: 760px) { .votebtn { padding: 8px 18px; } }
