:root{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
body{margin:0}
img{max-width:100%}
[hidden]{display:none!important}
/* Layout: butikshylla. Sticky header, hero med text + karta, filtrerbar varuhylla, steg, butiksformulär, mörk footer. */
:root {
  --bg-main: #f8f6f0;
  --bg-alt: #eee8dc;
  --bg-card: #ffffff;
  --bg-glass: rgba(248, 246, 240, 0.82);
  --text-main: #181c19;
  --text-muted: #56615a;
  --border-color: #ded8cb;
  --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
  --btn-text: #ffffff;
  --bg-footer: #092419;
  --accent-main: #0f402d;
  --accent-hover: #195e43;
  --accent-light: #dcf2e9;
  --accent-pop: #facc15;

  --sticker-text: #1b1a0c;
  --urgent: #a8321c;
  --urgent-bg: #fbe7e1;
  --footer-text: #cfe3d8;
  --footer-muted: #86a596;
  --water: #d7e6e4;
  --water-line: #b9d0cd;
  --land: #f1ede3;
  --road: #ddd5c4;
  --tint-mejeri: #e4edf5;
  --tint-kott: #f6e6e1;
  --tint-brod: #f4eadb;
  --tint-frukt: #e3efdc;
  --tint-fardig: #f4eed7;

  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-sm: 6px;
  --r-md: 12px;
  --wrap: 1180px;
}
:root { color-scheme: light; }

* { box-sizing: border-box; }
body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 60; background: var(--bg-main);
}
.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) {
  .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); }
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-main); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-data); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: var(--bg-glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.logo { display: block; height: 40px; width: auto; max-width: 100%; }
.footer .logo { height: 46px; margin-block: 0; }
@media (max-width: 760px) { .logo { height: 34px; } }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: var(--accent-main);
  display: grid; place-items: center; position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; right: -4px; top: -4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent-pop); border: 2px solid var(--bg-main);
}
.brand-mark svg { width: 16px; height: 16px; }
.brand small { font-weight: 500; color: var(--text-muted); font-size: 14px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-size: 15px; color: var(--text-muted); font-weight: 500; }
.nav a:hover { color: var(--text-main); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--accent-main); color: var(--btn-text); font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; transition: background .15s ease, transform .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text-main); border-color: var(--border-color); }
.btn.ghost:hover { background: var(--bg-alt); }
.btn.sm { padding: 8px 14px; font-size: 14px; }
@media (max-width: 760px) { .nav a { display: none; } .nav { gap: 0; } }

/* Prototype banner */
.proto {
  background: var(--accent-light); color: var(--accent-main); font-size: 13px;
}
.proto .wrap { padding-block: 8px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.proto strong { font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

/* Hero */
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px;
  padding-block: 64px 56px; align-items: center;
}
@media (max-width: 900px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 40px; } }
.hero h1 { font-size: clamp(38px, 5.6vw, 64px); line-height: 1.02; font-weight: 700; letter-spacing: -0.035em; }
.hero h1 .tag {
  display: inline-block; background: var(--accent-pop); color: var(--sticker-text);
  padding: 0 .18em; border-radius: 4px; transform: rotate(-1.5deg);
}
.hero-lead { margin-top: 20px; font-size: 19px; color: var(--text-muted); max-width: 34em; }
.search {
  margin-top: 32px; display: flex; gap: 8px; background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: var(--r-md); padding: 6px;
  box-shadow: var(--shadow-elevated); max-width: 520px;
}
.search label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-left: 12px; }
.search svg { flex: none; color: var(--text-muted); }
.search input { border: 0; background: transparent; width: 100%; min-width: 0; padding: 10px 0; outline: none; font-size: 16px; }
.search input::placeholder { color: var(--text-muted); }
.hero-facts { margin-top: 28px; display: flex; gap: 28px; flex-wrap: wrap; color: var(--text-muted); font-size: 14px; }
.hero-facts b { color: var(--text-main); font-family: var(--font-data); font-weight: 600; }

/* Map */
.map-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md);
  box-shadow: var(--shadow-elevated); overflow: hidden;
}
.map-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border-color); gap: 12px; }
.map-head h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
.map-head button { border: 0; background: none; color: var(--accent-main); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px; }
.map-head button[hidden] { display: none !important; }
.map-wrap { background: var(--water); }
.map-svg { display: block; width: 100%; height: auto; max-width: 100%; max-height: 520px; margin: 0 auto; touch-action: manipulation; }
.map-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.map-tools .btn { padding: 6px 12px; font-size: 13px; }
.dist { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-data); font-size: 13px; font-weight: 600; color: var(--accent-main); background: var(--accent-light); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.dist svg { flex: none; }
.maplink { border: 0; background: none; padding: 0; color: var(--text-muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.maplink:hover { color: var(--text-main); }
.map-attrib { font-size: 11px; color: var(--text-muted); }
.map-svg .water { fill: var(--water); }
.map-svg .coast { fill: none; stroke: var(--water-line); stroke-width: 2; }
.map-svg .land { fill: var(--land); }
.map-svg .road { fill: none; stroke: var(--road); stroke-width: 5; stroke-linecap: round; }
.map-svg .road.minor { stroke-width: 2.5; }
.map-svg .area { font-family: var(--font-data); font-size: 9.5px; letter-spacing: .1em; fill: var(--text-muted); text-transform: uppercase; }
.map-svg .sea { font-family: var(--font-data); font-size: 11px; letter-spacing: .3em; fill: var(--text-muted); opacity: .7; }
.pin { cursor: pointer; }
.pin .ring { fill: var(--accent-main); opacity: 0; transition: opacity .2s; }
.pin .dot { fill: var(--accent-main); stroke: var(--bg-card); stroke-width: 2; }
.pin.empty .dot { fill: var(--bg-card); stroke: var(--accent-main); stroke-width: 1.6; }
.pin .count { font-family: var(--font-data); font-size: 10px; font-weight: 600; fill: var(--btn-text); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pin:hover .ring, .pin:focus .ring { opacity: .3; }
.pin.active .dot { fill: var(--accent-pop); }
.pin.active .ring { fill: var(--accent-pop); opacity: .45; }
.pin.active .dot { stroke: var(--text-main); }
.pin:focus { outline: none; }
.pin:focus-visible .dot { stroke: var(--text-main); }
.you .dot { fill: var(--text-main); stroke: var(--bg-card); stroke-width: 3; }
.you .halo { fill: var(--text-main); opacity: .12; }
.you text { font-family: var(--font-data); font-size: 9.5px; fill: var(--text-main); font-weight: 600; }
.map-foot { padding: 12px 16px; font-size: 13px; color: var(--text-muted); border-top: 1px solid var(--border-color); min-height: 46px; }
.map-foot b { color: var(--text-main); }
.map-head h2 { white-space: nowrap; }
#gpsBtn { padding: 6px 12px; font-size: 13px; }
#gpsBtn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.locpick { border-top: 1px solid var(--border-color); padding: 14px 16px 16px; display: grid; gap: 10px; background: var(--bg-card); }
.locsugg { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.locsugg button { width: 100%; text-align: left; border: 0; background: none; padding: 10px 10px; border-radius: var(--r-sm); cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.locsugg button:hover, .locsugg button:focus-visible { background: var(--bg-alt); outline: none; }
.locsugg small { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.lochint { font-size: 13px; color: var(--text-muted); }
.you .acc { fill: var(--text-main); opacity: .07; stroke: var(--text-main); stroke-opacity: .25; stroke-width: 1; }
.you .arrow { fill: var(--text-main); }
.you text { paint-order: stroke; stroke: var(--land); stroke-width: 3.5px; stroke-linejoin: round; font-size: 11px; }

/* Section */
.section { padding-block: 72px; }
.section.alt { background: var(--bg-alt); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.08; }
.section-head p { color: var(--text-muted); margin-top: 8px; max-width: 46em; }

/* Filters */
.toolbar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-main);
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--text-muted); }
.chip[aria-pressed="true"] { background: var(--accent-main); color: var(--btn-text); border-color: var(--accent-main); }
.chip .n { font-family: var(--font-data); font-size: 12px; opacity: .7; margin-left: 4px; }
.sort { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); }
.sort select {
  border: 1px solid var(--border-color); background: var(--bg-card); padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: var(--text-main);
}
.active-store {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 14px;
  background: var(--accent-light); color: var(--accent-main); padding: 10px 14px; border-radius: var(--r-sm);
}
.active-store button { margin-left: auto; border: 0; background: none; color: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.item {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; position: relative; min-width: 0;
  transition: box-shadow .2s, transform .2s;
}
.item:hover { box-shadow: var(--shadow-elevated); }
.item { --pad: 18px; }
.pic { margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0; height: 148px; border-radius: var(--r-md) var(--r-md) 0 0; position: relative; display: grid; place-items: center; overflow: hidden; }
.pic svg { width: 76%; max-width: 230px; height: 100%; display: block; }
.pic img { width: 100%; height: 100%; object-fit: contain; padding: 12px; box-sizing: border-box; mix-blend-mode: multiply; }
.pic .art-fb { display: contents; }
.pic .sticker { position: absolute; top: 12px; right: 12px; }
.thumb { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; flex: none; }
.thumb svg { width: 100%; height: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; box-sizing: border-box; mix-blend-mode: multiply; }
.thumb .art-fb { display: contents; }
.item-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.store-line { font-size: 13px; color: var(--text-muted); line-height: 1.35; min-width: 0; }
.store-line b { display: block; color: var(--text-main); font-weight: 600; font-size: 14px; }
.sticker {
  flex: none; background: var(--accent-pop); color: var(--sticker-text); font-family: var(--font-data);
  font-weight: 600; font-size: 15px; padding: 6px 9px; border-radius: 4px; transform: rotate(3deg);
  box-shadow: 0 2px 0 rgba(0,0,0,.08);
}
.item h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.item .meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.expiry {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-alt); color: var(--text-main); width: fit-content;
}
.expiry::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-main); }
.expiry.soon { background: var(--urgent-bg); color: var(--urgent); }
.expiry.soon::before { background: var(--urgent); }
.price-row { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px dashed var(--border-color); margin-top: auto; flex-wrap: wrap; }
.price { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.price .now { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; display: block; }
.price .now small { font-size: 14px; font-weight: 500; }
.price .was { font-size: 13px; color: var(--text-muted); }
.price .was s { margin-right: 6px; }
.item .btn[disabled] { background: var(--bg-alt); color: var(--text-muted); cursor: default; }
.left { font-size: 12px; color: var(--text-muted); font-family: var(--font-data); }
.empty { padding: 48px 20px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-color); border-radius: var(--r-md); }
.empty b { display: block; color: var(--text-main); font-size: 18px; margin-bottom: 6px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; overflow-x: auto; }
.tab {
  border: 0; background: none; padding: 12px 16px; font-size: 16px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tab:hover { color: var(--text-main); }
.tab[aria-selected="true"] { color: var(--text-main); border-bottom-color: var(--accent-main); }
.tab .n { font-family: var(--font-data); font-size: 12px; background: var(--bg-card); border: 1px solid var(--border-color); padding: 1px 8px; border-radius: 999px; color: var(--text-main); }
.tab[aria-selected="true"] .n { background: var(--accent-main); border-color: var(--accent-main); color: var(--btn-text); }
.tab .n.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.25); } }

.tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button.dist { border: 0; cursor: pointer; font: inherit; font-family: var(--font-data); font-size: 13px; font-weight: 600; }
button.dist:hover { background: var(--accent-main); color: var(--btn-text); }
.addbtn.added { color: var(--accent-main); border-color: var(--accent-main); background: var(--accent-light); }
.addbtn.added:hover { background: var(--accent-light); }
section[id], #karta { scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 76px); }

/* Bottom bar (mobile) */
.bottombar { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .bottombar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--bg-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-color);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  }
  .bottombar button {
    border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; margin: 0;
    font: inherit; font-size: 11px; font-weight: 600; color: var(--text-muted); cursor: pointer; min-width: 0;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none;
  }
  .bottombar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.3; }
  .bottombar .ico {
    position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px;
    transition: background .18s ease, transform .12s ease;
  }
  .bottombar .ico svg { display: block; }
  .bottombar button:active .ico { transform: scale(.92); }
  .bottombar button[aria-current="true"] { color: var(--accent-main); }
  .bottombar button[aria-current="true"] .ico { background: var(--accent-light); }
  .bottombar button:focus-visible { outline: none; }
  .bottombar button:focus-visible .ico { outline: 2px solid var(--accent-main); outline-offset: 1px; }
  .bb-badge {
    position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: var(--accent-pop); color: var(--sticker-text); font-family: var(--font-data); font-size: 11px; line-height: 14px; text-align: center;
    border: 2px solid var(--bg-main); box-sizing: border-box;
  }
  .bottombar { transition: transform .2s ease; }
  .bottombar.away { transform: translateY(110%); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

  /* Header */
  .site-header .wrap { padding-block: 10px; }
  .listbtn { display: none; }
  .brand { font-size: 18px; }

  /* Rhythm */
  .proto .wrap { padding-block: 6px; font-size: 12px; }
  .hero .wrap { padding-block: 28px 32px; gap: 28px; }
  .hero-lead { font-size: 17px; margin-top: 14px; }
  .search { margin-top: 22px; }
  .hero-facts { margin-top: 18px; gap: 6px 18px; font-size: 13px; }
  .section { padding-block: 40px; }
  .section-head { margin-bottom: 18px; }
  .section-head p { font-size: 15px; }

  /* Tabs + filters */
  .tabs { margin-bottom: 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--hdr, 51px)); z-index: 20; background: var(--bg-alt); margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); }
  .tab { flex: 1; justify-content: center; padding: 12px 8px; font-size: 15px; }
  .toolbar { gap: 10px; margin-bottom: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); padding-block: 2px; width: calc(100% + 2 * max(16px, env(safe-area-inset-left, 0px))); scroll-padding-inline: 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 8px 13px; }
  .sort { width: 100%; justify-content: space-between; }
  .sort select { flex: 1; max-width: 220px; }

  /* Cards */
  .grid { gap: 12px; }
  .item { padding: 14px 14px 12px; gap: 10px; --pad: 14px; }
  .pic { height: 116px; margin-bottom: 2px; }
  .pic .sticker { top: 10px; right: 10px; }
  .item h3 { font-size: 17px; }
  .item .meta { font-size: 12px; margin-top: 2px; }
  .store-line { font-size: 12px; }
  .store-line b { font-size: 13px; }
  .sticker { font-size: 14px; padding: 5px 8px; }
  .price-row { padding-top: 10px; align-items: center; flex-wrap: nowrap; }
  .price .now { font-size: 22px; }
  .addbtn { padding: 10px 14px; }

  /* Map + list */
  .map-svg { max-height: 420px; }
  .map-head { padding: 10px 12px; }
  .route { padding: 16px; gap: 14px; }
  .route h3 { font-size: 19px; }
  .lgroup-head { padding: 12px 14px; }
  .lgroup-head a { width: 100%; padding-left: 42px; }
  .lrow { padding: 12px 14px; gap: 10px; grid-template-columns: 40px minmax(0, 1fr) auto auto; }
  .thumb { width: 40px; height: 40px; }
  .steps { gap: 22px; }
  .form { padding: 18px; }
  .footer .wrap { padding-block: 36px 28px; }
}

.listbtn { position: relative; }
.listbtn .badge { font-family: var(--font-data); font-size: 12px; background: var(--accent-pop); color: var(--sticker-text); border-radius: 999px; padding: 0 7px; line-height: 18px; }

/* Shopping list */
.list-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-areas: "groups route"; gap: 24px; align-items: start; }
.list-layout .route { grid-area: route; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); }
.list-layout .groups { grid-area: groups; display: grid; gap: 16px; min-width: 0; }
@media (max-width: 900px) { .list-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "route" "groups"; } .list-layout .route { position: static; } }
.route { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--shadow-elevated); padding: 20px; display: grid; gap: 16px; min-width: 0; }
.route h3 { font-size: 22px; font-weight: 700; line-height: 1.15; }
.route-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.route-sum div { background: var(--bg-main); border-radius: var(--r-sm); padding: 10px; min-width: 0; }
.route-sum span { display: block; font-size: 12px; color: var(--text-muted); }
.route-sum b { font-family: var(--font-data); font-size: 16px; font-variant-numeric: tabular-nums; }
.route-sum .save b { color: var(--accent-main); }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border-color); border-radius: var(--r-sm); overflow: hidden; }
.modes input { position: absolute; opacity: 0; pointer-events: none; }
.modes label { text-align: center; padding: 9px 4px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text-muted); border-left: 1px solid var(--border-color); }
.modes label:first-of-type { border-left: 0; }
.modes input:checked + label { background: var(--accent-main); color: var(--btn-text); }
.modes input:focus-visible + label { outline: 2px solid var(--accent-main); outline-offset: -3px; }
.stops { list-style: none; margin: 0; padding: 0; display: grid; }
.stops li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; position: relative; }
.stops li + li::before { content: ""; position: absolute; left: 12px; top: -10px; height: 20px; border-left: 2px dotted var(--border-color); }
.stops .no { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-data); font-size: 12px; font-weight: 600; background: var(--accent-main); color: var(--btn-text); position: relative; z-index: 1; }
.stops .no.start { background: var(--text-main); color: var(--bg-main); }
.stops .nm { font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.stops .nm small { display: block; font-weight: 400; color: var(--text-muted); font-size: 12px; }
.stops .leg { font-family: var(--font-data); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.route .btn.wide { width: 100%; }
.route-note { font-size: 12px; color: var(--text-muted); }

.lgroup { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); overflow: hidden; min-width: 0; }
.lgroup-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-color); background: var(--bg-main); flex-wrap: wrap; }
.lgroup-head .no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-data); font-weight: 600; font-size: 13px; background: var(--accent-main); color: var(--btn-text); flex: none; }
.lgroup-head .who { min-width: 0; flex: 1; }
.lgroup-head h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.lgroup-head p { font-size: 13px; color: var(--text-muted); }
.lgroup-head a { font-size: 13px; font-weight: 600; color: var(--accent-main); }
.lrows { list-style: none; margin: 0; padding: 0; }
.lrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-color); }
.lrow:last-child { border-bottom: 0; }
.lrow .nm { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.lrow .nm small { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); }
.lrow .nm small.soon { color: var(--urgent); }
.lrow .pr { font-family: var(--font-data); text-align: right; font-variant-numeric: tabular-nums; }
.lrow .pr s { display: block; font-size: 12px; color: var(--text-muted); }
.lrow .pr b { font-weight: 600; }
.remove { border: 1px solid var(--border-color); background: var(--bg-card); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--text-muted); }
.remove:hover { color: var(--urgent); border-color: var(--urgent); }
.lgroup-foot { display: flex; justify-content: space-between; padding: 10px 16px; font-size: 13px; color: var(--text-muted); background: var(--bg-main); border-top: 1px solid var(--border-color); }
.lgroup-foot b { font-family: var(--font-data); color: var(--text-main); }
.list-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }
.list-empty { padding: 56px 20px; text-align: center; border: 1px dashed var(--border-color); border-radius: var(--r-md); background: var(--bg-card); display: grid; gap: 10px; justify-items: center; }
.list-empty b { font-size: 20px; color: var(--text-main); }
.list-empty p { color: var(--text-muted); max-width: 30em; }
.textbtn { border: 0; background: none; color: var(--text-muted); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 4px; }
.textbtn:hover { color: var(--urgent); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; counter-reset: s; }
@media (max-width: 820px) { .steps { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.step { border-top: 2px solid var(--text-main); padding-top: 18px; }
.step .num { font-family: var(--font-data); font-size: 13px; color: var(--text-muted); }
.step h3 { font-size: 22px; font-weight: 600; margin-top: 10px; }
.step p { color: var(--text-muted); margin-top: 8px; max-width: 32em; }

/* Store form */
.store-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .store-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.store-copy h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; line-height: 1.08; }
.store-copy > p { color: var(--text-muted); margin-top: 12px; max-width: 36em; }
.benefits { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.benefits li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; }
.benefits svg { color: var(--accent-main); margin-top: 3px; }
.benefits b { display: block; }
.benefits span { color: var(--text-muted); font-size: 15px; }
.form {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md);
  box-shadow: var(--shadow-elevated); padding: 24px; display: grid; gap: 16px; min-width: 0;
}
.form-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.form-title h3 { font-size: 18px; font-weight: 600; letter-spacing: 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 13px; font-weight: 600; }
.field input, .field select {
  width: 100%; border: 1px solid var(--border-color); background: var(--bg-main);
  padding: 10px 12px; border-radius: var(--r-sm); font-size: 15px; min-width: 0;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent-main); outline-offset: -1px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.scan {
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--border-color);
  border-radius: var(--r-sm); background: var(--bg-main); font-size: 14px; color: var(--text-muted);
}
.scan .bars { font-family: var(--font-data); color: var(--text-main); font-size: 13px; }
.scan button { margin-left: auto; }
.scanbox { display: grid; gap: 12px; padding: 14px; border: 1px dashed var(--border-color); border-radius: var(--r-sm); background: var(--bg-main); }
.ean-row { display: flex; gap: 8px; }
.ean-row input { font-family: var(--font-data); letter-spacing: .04em; }
.scan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-actions .btn { flex: 1 1 auto; }
#reader { border-radius: var(--r-sm); overflow: hidden; background: #000000; }
#reader video { width: 100% !important; display: block; }
.scan-status { font-size: 13px; color: var(--text-muted); }
.scan-status.ok { color: var(--accent-main); font-weight: 600; }
.scan-status.err { color: var(--urgent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.range-out { font-family: var(--font-data); font-weight: 600; }
input[type="range"] { accent-color: var(--accent-main); padding: 0; border: 0; background: none; }
.preview-label { font-size: 12px; }
.calc { font-size: 14px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.calc b { color: var(--text-main); font-family: var(--font-data); }
.form-note { font-size: 12px; color: var(--text-muted); }

/* Footer */
.footer { background: var(--bg-footer); color: var(--footer-text); }
.footer .wrap { padding-block: 48px 36px; display: grid; gap: 32px; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .footer .wrap { grid-template-columns: minmax(0, 1fr); } }
.footer .brand { color: #ffffff; }
.footer .brand small { color: var(--footer-muted); }
.footer .brand-mark { background: #1d6b4c; }
.footer .brand-mark::after { border-color: var(--bg-footer); }
.footer p, .footer li { color: var(--footer-muted); font-size: 14px; }
.footer h4 { margin: 0 0 12px; font-family: var(--font-data); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--footer-text); font-weight: 500; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { text-decoration: none; }
.footer a:hover { color: #ffffff; }
.footer-bottom { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--footer-muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text-main); color: var(--bg-main); padding: 12px 18px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px);
  box-shadow: var(--shadow-elevated);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Konto, butikspanel och admin */
@media (max-width: 760px) { .nav a#accountLink { display: inline; margin-right: 14px; } }
.store-cta p { font-size: 15px; color: var(--text-muted); }
.btn.wide { width: 100%; text-align: center; justify-content: center; }
.page-link { font-size: 15px; font-weight: 500; color: var(--text-muted); text-decoration: none; }
.page-link:hover { color: var(--text-main); }
@media (max-width: 760px) { body.page { padding-bottom: 0; } }
.page-main { min-height: calc(100vh - 80px); }
.narrow { max-width: 480px; margin-inline: auto; }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(28px, 5vw, 38px); margin-top: 8px; }
.page-head p:not(.eyebrow) { color: var(--text-muted); margin-top: 8px; }
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-alt); border-radius: var(--r-md); margin-bottom: 18px; }
.switch button { font: inherit; font-weight: 600; font-size: 15px; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); cursor: pointer; }
.switch button[aria-selected="true"] { background: var(--bg-card); color: var(--text-main); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; }
.role-pick legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.role-pick label { display: block; padding: 14px; border: 1.5px solid var(--border-color); border-radius: var(--r-md); background: var(--bg-card); cursor: pointer; }
.role-pick label b { display: block; font-size: 16px; }
.role-pick label span { display: block; font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.role-pick label:has(input:checked) { border-color: var(--accent-main); background: var(--accent-light); }
.role-pick label:has(input:focus-visible) { outline: 2px solid var(--accent-main); outline-offset: 2px; }
.form-error { font-size: 14px; color: var(--urgent); background: var(--urgent-bg); padding: 10px 12px; border-radius: var(--r-sm); }
.linkbtn { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--accent-main); text-decoration: underline; cursor: pointer; justify-self: start; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .panel-grid { grid-template-columns: minmax(0, 1fr); } }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.panel-title h2 { font-size: 20px; }
.panel-title span { font-size: 14px; color: var(--text-muted); }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); }
.row.off { opacity: .62; }
.row b { font-size: 16px; overflow-wrap: anywhere; }
.row small { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.row small.soon { color: var(--urgent); font-weight: 600; }
.row .code { font-family: var(--font-data); font-size: 15px; letter-spacing: .03em; }
.row-actions { display: flex; align-items: center; gap: 10px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--r-sm); }
.stepper button { font: inherit; font-size: 18px; width: 40px; height: 40px; border: 0; background: none; cursor: pointer; color: var(--text-main); }
.stepper output { min-width: 30px; text-align: center; font-family: var(--font-data); font-size: 15px; }
.gate { text-align: center; padding: 56px 20px; }
.gate p { color: var(--text-muted); margin: 8px 0 18px; }
.prose h2 { font-size: 20px; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--text-muted); font-size: 16px; line-height: 1.55; }
.prose ul { padding-left: 20px; margin: 0; display: grid; gap: 6px; }
.prose b { color: var(--text-main); }
.import { margin-bottom: 32px; }
.drop { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 20px; border: 2px dashed var(--border-color); border-radius: var(--r-md); background: var(--bg-main); cursor: pointer; color: var(--text-muted); transition: border-color .15s, background .15s; }
.drop b { font-size: 18px; color: var(--text-main); }
.drop span:not(.btn) { font-size: 14px; max-width: 34em; }
.drop .btn { margin-top: 6px; }
.drop:hover, .drop.over { border-color: var(--accent-main); background: var(--accent-light); }
.drop:has(input:focus-visible) { outline: 2px solid var(--accent-main); outline-offset: 2px; }
.imp-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.imp-head h3 { font-size: 20px; }
.imp-head p { font-size: 13px; color: var(--text-muted); margin-top: 4px; overflow-wrap: anywhere; }
#impPreview { display: grid; gap: 16px; }
#impPreview[hidden] { display: none; }
.imp-rows { max-height: 460px; overflow: auto; padding-right: 2px; }
.imp-rows .row { grid-template-columns: minmax(0, 1fr); padding: 10px 14px; }
