:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #e8edf3;
  --ink: #0b1324;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e8ef;
  --brand: #10b981;
  --brand-strong: #059669;
  --brand-ink: #064e3b;
  --brand-soft: #ecfdf5;
  --grad: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
  --danger: #dc2626;
  --warn: #b45309;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 10px 30px -8px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px -12px rgba(15, 23, 42, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15.5px; line-height: 1.5; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }

/* ---------- Varumärke ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.brand__mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 12px -2px rgba(16, 185, 129, .55); }
.brand__mark .ic { width: 19px; height: 19px; fill: #fff; stroke: none; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--muted); letter-spacing: 0; margin-top: -2px; }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--ink);
  white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--primary:hover { background: #1e293b; }
.btn--brand { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .7); }
.btn--brand:hover { background: var(--brand-strong); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { color: var(--danger); border-color: #fecaca; }
.btn--danger:hover { background: #fef2f2; }
.btn--small { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn--icon { width: 46px; padding: 0; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .ic { width: 18px; height: 18px; }

/* ---------- Fält ---------- */
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #94a3b8; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus, select.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(16, 185, 129, .16); }
.btn:focus-visible, .opt:focus-within { outline: none; box-shadow: 0 0 0 4px rgba(16, 185, 129, .25); }

.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer; font-weight: 500; }
.select > .ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); width: 18px; height: 18px; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span, .label { font-weight: 600; font-size: .86rem; color: var(--ink-2); }
.field small, .hint { color: var(--muted); font-size: .82rem; }
.req { color: var(--brand-strong); }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.row--3 { grid-template-columns: 2fr 1fr 1.4fr; }
@media (max-width: 600px) { .row, .row--3 { grid-template-columns: 1fr; gap: 0; } }

/* Valbara kort (tjänster) */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); font-weight: 600; font-size: .92rem; transition: border-color .15s, background .15s; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); flex: none; }
.opt__ic .ic { width: 18px; height: 18px; }
@media (max-width: 600px) {
  .opt-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .opt { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; font-size: .86rem; line-height: 1.25; }
}
.opt:hover { border-color: #cbd5e1; }
.opt:has(input:checked) { border-color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 7%, white); }
.opt:has(input:checked)::after { content: ""; position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; border-radius: 50%; background: var(--c, var(--brand)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/10px no-repeat; }

/* Märkesval (piller) */
.brand-group { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; background: var(--surface); }
.brand-group__head { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 500; user-select: none; transition: all .12s; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:hover { border-color: #cbd5e1; }
.pill:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(16, 185, 129, .25); }

.switch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); font-weight: 600; font-size: .92rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- Taggar och märken ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 3px 9px 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c) 10%, white); color: color-mix(in srgb, var(--c) 80%, black); }
.tag__ic { width: 13px; height: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.badge--ok { background: var(--brand-soft); color: var(--brand-ink); }
.badge--muted { background: var(--surface-2); color: var(--muted); }
.badge--warn { background: #fef3c7; color: #78350f; }
.badge--danger { background: #fee2e2; color: #7f1d1d; }

/* ---------- Kartnålar ---------- */
.mk-wrap { background: none; border: none; }
.mk {
  position: absolute; left: 2px; top: 0; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: var(--c); border: 2.5px solid #fff; box-shadow: 0 6px 14px -3px rgba(15,23,42,.45);
  display: grid; place-items: center; transition: transform .18s cubic-bezier(.3,1.6,.6,1);
}
.mk__ic { width: 16px; height: 16px; color: #fff; transform: rotate(45deg); }
.mk--round { border-radius: 50%; transform: none; outline: 2px solid var(--c); outline-offset: 2px; }
.mk--round .mk__ic { transform: none; }
.mk--round.mk--hl { transform: scale(1.28); }
.mk--hl { transform: rotate(-45deg) scale(1.28); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 30%, transparent), 0 8px 18px -3px rgba(15,23,42,.5); }
.cl { background: none; }
.cl span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: .9rem; border: 3px solid #fff; box-shadow: 0 0 0 5px rgba(11,19,36,.14), 0 6px 14px -3px rgba(15,23,42,.45); }
.me-dot { width: 20px; height: 20px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); position: relative; }
.me-dot::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; background: rgba(37,99,235,.25); animation: pulse 2s ease-out infinite; }
@keyframes pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.origin-pin { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; border: 3px solid #fff; box-shadow: 0 6px 14px -3px rgba(15,23,42,.5); }
.origin-pin .ic { width: 16px; height: 16px; }
.leaflet-container { font-family: var(--font); background: #eef1f4; }
.leaflet-tile-pane { filter: saturate(.3) brightness(1.04) contrast(.92); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; border-radius: 6px 0 0 0; }
.leaflet-bar { border: none !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; overflow: hidden; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--ink) !important; border-color: var(--line) !important; font-size: 20px !important; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5000; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: 13px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); transition: opacity .4s, transform .4s; font-weight: 500; }
.toast--error { background: var(--danger); }
.toast--ok { background: var(--brand-strong); }
.toast--out { opacity: 0; transform: translateY(8px); }

/* ---------- Formulärsidor (anmälan, admin) ---------- */
.page-bg { background: radial-gradient(1200px 500px at 10% -10%, rgba(16,185,129,.14), transparent 60%), radial-gradient(900px 400px at 100% 0%, rgba(14,165,233,.12), transparent 60%), var(--bg); background-repeat: no-repeat; min-height: 100%; }
.page-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.page-header__inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.container { max-width: 1100px; margin: 0 auto; padding: 32px 16px 80px; }
.narrow { max-width: 780px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.card h2 { margin: 0 0 4px; font-size: 1.12rem; letter-spacing: -.01em; }
.card .sub { color: var(--muted); margin: 0 0 18px; font-size: .9rem; }
@media (max-width: 600px) { .card { padding: 20px 16px; } }
.step { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.step__n { width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--brand-strong); background: var(--brand-soft); padding: 5px 11px; border-radius: 999px; margin-bottom: 14px; }
.eyebrow .ic { width: 14px; height: 14px; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; letter-spacing: -.03em; line-height: 1.15; }
.lead { color: var(--ink-2); margin: 12px 0 28px; font-size: 1.02rem; max-width: 60ch; }
.pick-map { height: 300px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); margin: 10px 0 8px; overflow: hidden; }
.geo-results { display: grid; gap: 6px; margin-top: 8px; }
.geo-results button { text-align: left; padding: 11px 13px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; font-size: .9rem; }
.geo-results button:hover { border-color: var(--brand); background: var(--brand-soft); }
.inline { display: flex; gap: 8px; }
.inline .input { flex: 1; }
@media (max-width: 520px) { .inline { flex-wrap: wrap; } .inline .input { flex-basis: 100%; } .inline .btn { flex: 1; } }
.private { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius-sm); background: #f8fafc; border: 1.5px dashed #cbd5e1; margin-bottom: 16px; }
.private .ic { color: var(--ink-2); margin-top: 2px; }
.private p { margin: 0; font-size: .86rem; color: var(--ink-2); }
.hp { position: absolute; left: -9999px; }

/* ---------- Logga ---------- */
.logo-up { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1.5px dashed #cbd5e1; border-radius: var(--radius-sm); background: #fbfcfd; transition: border-color .15s, background .15s; }
.logo-up.is-over { border-color: var(--brand); background: var(--brand-soft); }
.logo-up__preview { width: 96px; height: 96px; flex: none; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; padding: 8px; }
.logo-up__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-up__empty { display: grid; justify-items: center; gap: 4px; color: #94a3b8; font-size: .72rem; font-weight: 600; }
.logo-up__body { display: grid; gap: 8px; min-width: 0; }
.logo-up__btns { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 420px) { .logo-up { flex-direction: column; align-items: flex-start; } }

/* ---------- Dialogruta ---------- */
body.modal-open { overflow: hidden; }
.modal-bd { position: fixed; inset: 0; z-index: 4000; background: rgba(11, 19, 36, .5); display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out; }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--surface); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.8,.2,1); }
.modal h2 { margin: 0 0 6px; font-size: 1.3rem; letter-spacing: -.02em; }
.modal__lead { color: var(--ink-2); margin: 0 0 20px; }
.modal__ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); margin-bottom: 14px; }
.modal__ic .ic { width: 26px; height: 26px; }
.modal__ic--warn { background: #fef3c7; color: #b45309; }
.modal__x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 11px; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; }
.modal__x .ic { width: 18px; height: 18px; }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.reasons { display: grid; gap: 8px; }
.reason { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: .92rem; }
.reason input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; flex: none; }
.reason:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 600px) {
  .modal-bd { place-items: end stretch; padding: 0; }
  .modal { width: 100%; border-radius: 22px 22px 0 0; padding: 24px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92dvh; }
  .modal__actions .btn { flex: 1; }
}

.linkbtn { border: 0; background: none; padding: 0; color: var(--brand-strong); font-weight: 600; text-decoration: underline; cursor: pointer; font-size: inherit; }
.res__rate { color: #b45309; font-weight: 700; }
.radius-ok, .radius-out { margin: 8px 0 0 !important; font-size: .86rem; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.radius-ok { color: var(--brand-strong) !important; }
.radius-out { color: var(--muted) !important; font-weight: 500; }
.res__rc { color: var(--muted); }

/* ---------- Stjärnor ---------- */
.stars { position: relative; display: inline-block; font-size: var(--s, 16px); line-height: 1; letter-spacing: 1px; white-space: nowrap; vertical-align: -2px; }
.stars__bg { color: #e2e8f0; }
.stars__fg { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: #f59e0b; }
.star-input { display: inline-flex; gap: 4px; direction: rtl; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 34px; line-height: 1; color: #e2e8f0; cursor: pointer; transition: color .1s, transform .1s; padding: 2px; }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: #f59e0b; }
.star-input label:active { transform: scale(.9); }
.star-input input:focus-visible + label { outline: 3px solid rgba(16,185,129,.35); border-radius: 6px; }
.rate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rate-row:last-child { border-bottom: 0; }
.rate-row strong { font-size: 1rem; }
.rate-row small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
.review { padding: 14px 0; border-top: 1px solid var(--line); }
.review__top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.review__who { font-weight: 700; font-size: .92rem; }
.review__who small { color: var(--muted); font-weight: 500; }
.review p { margin: 6px 0 0; color: var(--ink-2); font-size: .93rem; white-space: pre-wrap; }
.review__reply { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; font-size: .88rem; }
.review__reply strong { display: block; font-size: .78rem; color: var(--brand-ink); margin-bottom: 2px; }
.rating-sum { display: flex; gap: 16px; align-items: center; }
.rating-sum__big { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.bars { display: grid; gap: 4px; flex: 1; min-width: 0; }
.bar { display: grid; grid-template-columns: 82px 1fr 26px; gap: 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.bar i { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar i b { display: block; height: 100%; background: #f59e0b; border-radius: 3px; }
.trust-note { font-size: .78rem; color: var(--muted); margin: 10px 0 0; display: flex; gap: 6px; }
.trust-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--brand-strong); }

/* Statusrad under organisationsnummer */
.orgnr-info { font-size: .82rem; font-weight: 600; }
.orgnr-info.is-ok { color: var(--brand-strong); }
.orgnr-info.is-bad { color: var(--danger); }

/* Loggruta i listor och kort: vit bakgrund så att alla loggor ser bra ut */
.logo-tile { background: #fff !important; border: 1px solid var(--line); overflow: hidden; padding: 4px; }
.logo-tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
