/* Nordrange – stil. Färger ligger som variabler och byts för mörkt läge. */
/* Färgerna utgår från loggan: nordisk natt (#0E1B26) och laddgrön (#12B76A). */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --line: #dfe5ea;
  --text: #0e1b26;
  --muted: #5a6977;
  --accent: #12b76a;
  --accent-strong: #0a7f48;
  --on-accent: #0e1b26;
  --accent-soft: rgba(18, 183, 106, .13);
  --from: #2f6fed;
  --to: #e5484d;
  --warn-bg: #fff4e5;
  --warn-text: #8a4b00;
  --err-bg: #fdecec;
  --err-text: #a3262a;
  --shadow: 0 1px 2px rgba(14, 27, 38, .05), 0 4px 16px rgba(14, 27, 38, .07);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --route: #12b76a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a141d; --surface: #102030; --surface-2: #162a3b; --line: #213649; --text: #eaf0f4; --muted: #93a6b6;
    --accent: #1fc77a; --accent-strong: #4fdc9a; --on-accent: #0e1b26; --accent-soft: rgba(31, 199, 122, .15);
    --from: #6b9bff; --to: #ff6b6f; --warn-bg: #2d2210; --warn-text: #f5c27a; --err-bg: #2e1517; --err-text: #ff9a9c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --route: #1fc77a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a141d; --surface: #102030; --surface-2: #162a3b; --line: #213649; --text: #eaf0f4; --muted: #93a6b6;
  --accent: #1fc77a; --accent-strong: #4fdc9a; --on-accent: #0e1b26; --accent-soft: rgba(31, 199, 122, .15);
  --from: #6b9bff; --to: #ff6b6f; --warn-bg: #2d2210; --warn-text: #f5c27a; --err-bg: #2e1517; --err-text: #ff9a9c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); --route: #1fc77a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
a { color: var(--accent-strong); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select { font: inherit; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 2000; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Toppfält ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand-mark { width: 32px; height: 32px; stroke: none; border-radius: 8px; }
.topnav { display: flex; gap: 4px; }
.navlink { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; }
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink[aria-current="page"] { color: var(--text); background: var(--surface-2); }
@media (max-width: 520px) { .navlabel { display: none; } .navlink.icon-link { padding: 8px; } }

/* ---------- Layout ---------- */
/* Mobil: en kolumn där kartan hamnar direkt efter resultatet och före informationstexten. */
.layout { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.panel { display: contents; }
.layout .result { display: contents; }
.stats, .weather-line, .notice { order: 1; }
.map-wrap { display: none; order: 2; }
.timeline, .result-actions { order: 3; }
.about { order: 5; }
.has-result .map-wrap { display: block; }
#map { height: 58vh; min-height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(380px, 440px) 1fr; gap: 0; padding: 0; height: calc(100dvh - 61px); }
  .panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; overflow-y: auto; padding: 20px; }
  .layout .result { display: flex; }
  .map-wrap, .has-result .map-wrap { display: block; padding: 20px 20px 20px 0; }
  #map { height: 100%; }
}

.intro h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 4px; letter-spacing: -.02em; }
.intro p { margin: 0; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

/* ---------- Formulär ---------- */
#plan-form { display: flex; flex-direction: column; gap: 14px; }
.battery-head, .slider-head { display: flex; align-items: baseline; justify-content: space-between; }
.battery-head label, .slider-head label { font-weight: 600; font-size: 15px; }
#soc-out { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
#soc-out small { font-size: 16px; color: var(--muted); margin-left: 2px; font-weight: 600; }
#cons-out, #target-out { font-weight: 700; font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 4px 0 0; cursor: pointer;
  --fill: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px; border-radius: 99px; background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-2) var(--fill));
  border: 1px solid var(--line);
}
input[type="range"]::-moz-range-track { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
input[type="range"]::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); margin-top: -9px;
  border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }

.car-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2);
  color: var(--text); text-decoration: none; font-size: 14.5px; border: 1px solid transparent;
}
.car-chip:hover { border-color: var(--line); }
.car-chip #car-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-chip .chev { color: var(--muted); width: 18px; height: 18px; }

.places { position: relative; display: flex; flex-direction: column; gap: 8px; }
.field {
  position: relative; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 6px 0 12px; height: 50px; margin-right: 44px;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; height: 100%; font-size: 16px; }
.field input::placeholder { color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-from { border: 3px solid var(--from); }
.dot-to { background: var(--to); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn.clear svg { width: 16px; height: 16px; }
.icon-btn.locate.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.swap {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.swap:hover { color: var(--text); }
.swap svg { width: 18px; height: 18px; }

.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1100; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 320px; overflow-y: auto;
}
.suggest li { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--surface-2); }
.suggest .s-name { font-weight: 550; }
.suggest .s-sub { font-size: 13px; color: var(--muted); }
.suggest .s-empty { color: var(--muted); cursor: default; }

.primary {
  height: 50px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s;
}
.primary:hover { filter: brightness(1.05); }
.primary:disabled { opacity: .7; cursor: progress; }
.primary .spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.secondary {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.secondary:hover { background: var(--surface-2); }
.form-msg { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--err-bg); color: var(--err-text); font-size: 14px; }

/* ---------- Resultat ---------- */
.result { display: flex; flex-direction: column; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; scroll-margin-top: 76px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.stat b { display: block; font-size: 20px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 12px; font-size: 14.5px; }
.weather-line { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.weather-line b { color: var(--text); }
.arrive .slider-head label { font-size: 14px; font-weight: 550; }
.weather-toggle { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.weather-toggle small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.ok { background: var(--accent-soft); color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 4px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.timeline li { position: relative; display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; padding: 14px 0; align-items: start; }
.timeline li + li { border-top: 1px solid var(--line); }
.timeline .marker {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--surface-2); color: var(--text);
}
.timeline .marker.start { background: var(--from); color: #fff; }
.timeline .marker.end { background: var(--to); color: #fff; }
.timeline .marker.stop { color: #fff; }
.timeline .t-title { font-weight: 600; line-height: 1.3; }
.timeline .t-sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.timeline .t-right { text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.timeline .t-right b { display: block; font-size: 15px; }
.timeline .soc-bar { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 8px; overflow: hidden; position: relative; }
.timeline .soc-bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); }
.timeline .soc-bar i.from { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.timeline button.t-link { all: unset; cursor: pointer; }
@media (hover: hover) { .timeline button.t-link:hover .t-title { text-decoration: underline; } }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-right: 4px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Om-sektion (även för sökmotorer) ---------- */
.about { color: var(--muted); font-size: 14.5px; padding: 4px 2px 8px; }
.about h2 { color: var(--text); font-size: 16px; margin: 8px 0 6px; }
.about p { margin: 0 0 10px; }
.about details { border-top: 1px solid var(--line); padding: 10px 0; }
.about summary { cursor: pointer; color: var(--text); font-weight: 550; }
.about details p { margin: 8px 0 0; }

/* ---------- Karta ---------- */
.maplibregl-map { font: 13px/1.4 var(--font); }
.maplibregl-ctrl-group { background: var(--surface) !important; border: 1px solid var(--line); box-shadow: var(--shadow) !important; }
.maplibregl-ctrl-group button + button { border-top-color: var(--line) !important; }
:root[data-theme="dark"] .maplibregl-ctrl-icon { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .maplibregl-ctrl-icon { filter: invert(1); } }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib.maplibregl-compact { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-attrib-button { background-color: var(--surface) !important; }
.maplibregl-popup-content { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border-radius: 12px; padding: 12px 30px 12px 14px; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 20px; width: 28px; height: 28px; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.pop-title { font-weight: 650; font-size: 14px; }
.pop-sub { color: var(--muted); margin-top: 2px; }
.pop-link { display: inline-block; margin-top: 8px; font-weight: 600; }
.t-nav { display: block; width: fit-content; margin: 6px 0 0 auto; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 650; text-decoration: none; }
.t-nav:hover { filter: brightness(1.1); }
/* Samma stil som Navigera-knapparna: allt som startar en vägbeskrivning ser likadant ut */
.nav-route {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: 99px; background: rgba(18, 183, 106, .2); border: 1px solid rgba(18, 183, 106, .35);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-strong); font-weight: 650; font-size: 15px; text-decoration: none;
}
.nav-route svg { width: 18px; height: 18px; }
.nav-route:hover { filter: brightness(1.1); }
@media (max-width: 480px) { .nav-route { width: 100%; } }
.pin { cursor: pointer; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 12px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pin-stop { width: 28px; height: 28px; font-size: 13px; }
.pin-start { width: 18px; height: 18px; background: #fff; border: 5px solid var(--from); }
.pin-end { width: 20px; height: 20px; background: var(--to); }
.pin-station { width: 12px; height: 12px; border-width: 2px; opacity: .9; }

/* ---------- Nätverksfärger ---------- */

/* ---------- Inställningar ---------- */
.settings { padding: 16px; }
.settings-inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 32px; }
.settings h1 { font-size: 26px; margin: 4px 0 2px; letter-spacing: -.02em; }
.row2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1.6fr; } }
.select, .num { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.select select, .num input {
  height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 12px; font-size: 16px; color: var(--text);
  appearance: none; -webkit-appearance: none;
}
.select select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px;
}
.select select:focus, .num input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.custom-car { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.specs div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.specs dt { font-size: 12.5px; color: var(--muted); }
.specs dd { margin: 2px 0 0; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.specs dd small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.slider-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.slider-foot .hint { margin: 0; }
.link-btn { border: 0; background: none; color: var(--accent-strong); font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 0; }
.link-btn:disabled { color: var(--muted); cursor: default; opacity: .6; }

.nets { display: flex; flex-direction: column; margin-top: 8px; }
.net-group { font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 2px; }
.net-group:first-child { margin-top: 4px; }
.net-group + .net { border-top: 0; }
.net { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.net + .net { border-top: 1px solid var(--line); }
.net-logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: -.02em; }
.net-name { flex: 1; font-weight: 550; }
.net-count { color: var(--muted); font-size: 13px; margin-right: 6px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); padding: 4px; border-radius: 12px; gap: 4px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 9px 4px; border-radius: 9px; font-weight: 550; font-size: 14.5px; color: var(--muted); pointer-events: none; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.sources p { margin: 0 0 6px; }

/* ---------- Installera som app (samma upplägg som Mängdkollen och Rawfeed) ---------- */
.btn-small {
  min-height: 36px; padding: 6px 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; flex: none;
}
.btn-small:hover { filter: brightness(1.05); }
.toast {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; z-index: 1200;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(14, 27, 38, .22);
  padding: 8px 6px 8px 8px; border-radius: 18px; font-size: 15px;
  width: max-content; max-width: calc(100% - 24px);
  animation: toast-in .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.toast-icon { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.toast-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.toast-text strong { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-text small { color: var(--muted); font-size: 12.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-close { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.toast-close:hover { color: var(--text); }
@keyframes toast-in { from { transform: translate(-50%, 120%); opacity: 0; } }
/* Plats längst ner så att rutan inte täcker sidans sista knapp eller text */
body.has-install .settings-inner, body.has-install .about { padding-bottom: 84px; }
@media (max-width: 959px) { body.has-install .layout { padding-bottom: 84px; } }
@media (max-width: 380px) { .toast-icon { display: none; } .toast { padding-left: 14px; } }
@media (max-width: 330px) { .toast-text small { display: none; } }
@media (pointer: coarse) { .toast-close { min-width: 44px; min-height: 44px; } }

.sheet { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); animation: fade-in .2s ease both; }
.sheet-panel {
  position: relative; width: 100%; max-width: 480px; margin: 0 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 22px;
  padding: 20px 20px 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  animation: sheet-in .3s cubic-bezier(.2, .9, .3, 1.1) both;
}
@media (min-width: 700px) { .sheet { align-items: center; } }
.sheet-close { position: absolute; top: 8px; right: 8px; }
.sheet-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.sheet-head img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.sheet-steps { list-style: none; counter-reset: step; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.sheet-steps li {
  counter-increment: step; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  padding: 10px 12px 10px 48px; position: relative; min-height: 48px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; font-size: 15px;
}
.sheet-steps li::before {
  content: counter(step); position: absolute; left: 12px; top: 50%; margin-top: -13px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 13.5px;
}
.sheet-steps i { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); vertical-align: middle; }
.sheet-steps .muted { color: var(--muted); font-size: 13px; }
.sheet-steps .muted i { width: 22px; height: 22px; border-radius: 6px; }
.sheet-steps svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-strong); stroke-width: 2; }
.sheet-steps svg circle { fill: var(--accent-strong); stroke: none; }
.sheet-hint { margin: 12px 2px 0; color: var(--muted); font-size: 13.5px; }
.sheet-arrow { display: none; justify-content: center; margin-top: 6px; }
.sheet-arrow svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 2.6; }
.sheet-arrow.is-down { display: flex; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(6px); } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }

.install-row { display: flex; align-items: center; gap: 14px; }
.install-row img { width: 44px; height: 44px; border-radius: 11px; flex: none; }
.install-row .hint { margin: 0; flex: 1; }
@media (max-width: 480px) { .install-row { flex-wrap: wrap; } .install-row .btn-small { width: 100%; min-height: 44px; } }

/* Upphovsrad längst ner på sidan och i inställningarna */
.credit { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.credit a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.credit a:hover { color: var(--text); text-decoration-color: currentColor; }
.sources .credit { margin-top: 10px; }
.noscript { padding: 16px; text-align: center; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
