/* ==========================================================================
   Designsystem
   Palett: varm neutral bas + djupgrön accent (bästa pris) + rostorange (rabatt).
   Alla textfärger klarar WCAG AA mot sin bakgrund.
   Mobile first: basstilar = mobil, media queries bygger uppåt.
   ========================================================================== */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0eb;
  --surface-3: #e9e9e3;
  --ink: #15171c;
  --ink-2: #3d424b;
  --muted: #5d636e;
  --faint: #8a909a;
  --line: #e4e4de;
  --line-strong: #cfcfc6;
  --accent: #136f4f;
  --accent-ink: #0e5a40;
  --accent-soft: #e3f1ea;
  --sale: #b4380f;
  --sale-soft: #fbebe3;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(21, 23, 28, .05);
  --shadow: 0 1px 2px rgba(21, 23, 28, .05), 0 8px 24px rgba(21, 23, 28, .07);
  --shadow-lg: 0 2px 6px rgba(21, 23, 28, .06), 0 20px 44px rgba(21, 23, 28, .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --header-h: 116px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5; letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent); color: #fff; }
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- header */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 70; }
.top {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line); transition: box-shadow .3s var(--ease);
}
.top.scrolled { box-shadow: 0 6px 20px rgba(21, 23, 28, .06); }
.top-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "loc menu" "search search"; align-items: center; gap: 6px 12px; padding-top: 8px; padding-bottom: 10px; }
.top .wrap:not(.top-row) { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.loc { grid-area: loc; display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.loc svg { flex: none; color: var(--accent); }
.loc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc small { color: var(--muted); font-weight: 400; }
.search { grid-area: search; position: relative; display: flex; align-items: center; gap: 8px; min-width: 0;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 14px; padding: 4px 4px 4px 14px;
  transition: background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease); }
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(19, 111, 79, .12); }
.search > svg { flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; display: inline-grid; place-items: center; color: var(--muted); transition: background .2s var(--ease), color .2s var(--ease); }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.nav { display: none; gap: 4px; }
.nav a { position: relative; font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 9px 14px; border-radius: 999px; transition: color .2s var(--ease), background .2s var(--ease); white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { color: var(--accent-ink); background: var(--accent-soft); }
.menu-btn { grid-area: menu; width: 44px; height: 44px; margin-right: -8px; border: 0; background: none; display: grid; place-items: center; border-radius: 12px; }
.menu-btn .bars { display: grid; gap: 5px; }
.menu-btn .bars span { display: block; width: 18px; height: 1.6px; border-radius: 2px; background: var(--ink); transition: transform .4s var(--ease); }
body.menu-open .menu-btn .bars span:first-child { transform: translateY(3.3px) rotate(45deg); }
body.menu-open .menu-btn .bars span:last-child { transform: translateY(-3.3px) rotate(-45deg); }
.sheet {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 45; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 20px; visibility: hidden; opacity: 0; transform: translateY(-8px);
  transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s .4s; box-shadow: var(--shadow-lg);
}
body.menu-open .sheet { visibility: visible; opacity: 1; transform: none; transition: opacity .3s var(--ease), transform .4s var(--ease); }
.sheet a { display: flex; align-items: center; justify-content: space-between; min-height: 54px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(-6px); transition: opacity .35s var(--ease), transform .45s var(--ease); }
.sheet a:last-child { border-bottom: 0; }
body.menu-open .sheet a { opacity: 1; transform: none; }
body.menu-open .sheet a:nth-child(2) { transition-delay: .04s; } body.menu-open .sheet a:nth-child(3) { transition-delay: .08s; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(21, 23, 28, .32); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s .3s; }
body.menu-open .scrim, body.drawer-open .scrim { opacity: 1; visibility: visible; transition: opacity .3s var(--ease); }
body.drawer-open .scrim { z-index: 55; }

/* ---------------------------------------------------------------- knappar & chips */
.btn, .chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; font-size: 15px; font-weight: 600; white-space: nowrap; user-select: none;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); box-shadow: var(--shadow); }
.btn.secondary, .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover, .btn.ghost:hover { border-color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.btn.danger { background: var(--surface); color: var(--sale); border-color: var(--line-strong); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.chip { min-height: 38px; padding: 0 14px; font-size: 14px; font-weight: 500; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip small { font-size: 12px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip.on small { color: rgba(255, 255, 255, .7); }
.btn:active, .chip:active, .seg-btn:active, .tab-btn:active { transform: scale(.96); transition-duration: .08s; }

/* ---------------------------------------------------------------- avdelningar (överst) */
.depts-wrap { position: relative; margin-top: 14px; }
.depts { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 0 6px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.depts::-webkit-scrollbar { display: none; }
.depts .chip { scroll-snap-align: start; flex: none; }

/* ---------------------------------------------------------------- strip: billigast / rabatt */
.strip-wrap { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px 0 14px 14px; box-shadow: var(--shadow-sm); }
.strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 14px; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; position: relative; }
.seg-btn { position: relative; z-index: 1; border: 0; background: transparent; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: color .25s var(--ease), transform .2s var(--ease); white-space: nowrap; }
.seg-btn[aria-selected="true"] { color: var(--ink); }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .45s var(--ease), width .45s var(--ease); }
.strip-nav { display: none; gap: 6px; }
.strip-nav .icon-btn { border: 1px solid var(--line); background: var(--surface); }
.strip-nav .icon-btn:disabled { opacity: .35; cursor: default; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 72%); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 14px; padding: 2px 14px 4px 0; scrollbar-width: none; overscroll-behavior-x: contain; }
.strip::-webkit-scrollbar { display: none; }
.mini { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 10px; text-align: left; scroll-snap-align: start;
  background: var(--bg); border: 1px solid transparent; border-radius: 14px;
  transition: opacity .6s var(--ease), transform .5s var(--ease), background .25s var(--ease), border-color .25s var(--ease); transition-delay: var(--d, 0s), var(--d, 0s), 0s, 0s; }
.mini.in:hover { background: var(--surface); border-color: var(--line-strong); transition-delay: 0s; }
.mini .thumb { grid-row: span 3; width: 64px; height: 64px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.mini .thumb img { width: 88%; height: 88%; object-fit: contain; mix-blend-mode: multiply; }
.mini-cat { font-size: 11.5px; font-weight: 600; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-name { font-size: 13.5px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 17px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mini-price small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.mini .store { grid-column: 2; }
.mini.empty-mini { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- huvudflikar */
.tabs-main { display: flex; gap: 4px; margin-top: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-btn { position: relative; border: 0; background: none; min-height: 48px; padding: 0 4px; margin-right: 18px; font-size: 16px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .2s var(--ease); }
.tab-btn:hover { color: var(--ink); }
.tab-btn[aria-selected="true"] { color: var(--ink); }
.tab-btn::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .4s var(--ease); }
.tab-btn[aria-selected="true"]::after { transform: scaleX(1); }
.tab-btn .count-pill { margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
[role="tabpanel"][hidden] { display: none; }
.panel-in { animation: panelIn .45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- layout: filter + resultat */
.layout { display: block; padding-top: 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .count { margin: 0; flex: 1 1 160px; font-size: 14px; color: var(--muted); min-height: 20px; }
.toolbar .count b { color: var(--ink); font-weight: 600; }
.toolbar .sort { flex: 0 1 230px; min-width: 190px; }
.filter-btn { min-height: 44px; padding: 0 16px; }
.badge-count { min-width: 22px; height: 22px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; display: inline-grid; place-items: center; padding: 0 6px; }
.badge-count[data-n="0"] { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 12px; }
.active-filters:empty { display: none; }
.af { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 500; border: 0; }
.af svg { opacity: .7; }
.af:hover svg { opacity: 1; }
.af.clear { background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; }

/* filterpanel – mobil: bottenark, desktop: sidokolumn */
.sidebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); visibility: hidden; transition: transform .5s var(--ease), visibility 0s .5s;
}
body.drawer-open .sidebar { transform: none; visibility: visible; transition: transform .5s var(--ease); }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
.sb-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.sb-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-strong); }
.sb-body { overflow-y: auto; padding: 4px 18px 16px; display: grid; gap: 18px; overscroll-behavior: contain; }
.sb-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.sb-foot .btn { flex: 1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); outline: 0; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(19, 111, 79, .12); }
.pair { display: flex; gap: 8px; }
.chains { display: flex; flex-wrap: wrap; gap: 6px; }
.chains .chip { min-height: 36px; font-size: 13px; padding: 0 12px; }

/* dropdown */
.dd { position: relative; }
.dd-btn { width: 100%; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); text-align: left; font-size: 14.5px; font-weight: 500;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.dd-btn:hover, .dd.open .dd-btn { border-color: var(--ink-2); }
.dd-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn svg { flex: none; color: var(--muted); transition: transform .35s var(--ease); }
.dd.open .dd-btn svg { transform: rotate(180deg); }
.dd-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(320px, 90vw); max-height: 340px; overflow: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left;
  transition: opacity .2s var(--ease), transform .3s var(--ease), visibility 0s .3s; }
.dd.right .dd-menu { left: auto; right: 0; transform-origin: top right; }
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s var(--ease), transform .3s var(--ease); }
.dd-menu li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 9px; font-size: 14.5px; cursor: pointer;
  opacity: 0; transform: translateY(-3px); transition: background .15s var(--ease), opacity .25s var(--ease), transform .3s var(--ease); }
.dd.open .dd-menu li { opacity: 1; transform: none; transition-delay: calc(var(--i) * 14ms); }
.dd-menu li:hover, .dd-menu li.focus { background: var(--surface-2); }
.dd-menu li small { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dd-menu li[aria-selected="true"] { color: var(--accent-ink); font-weight: 600; }
.dd-menu li[aria-selected="true"]::after { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.dd-menu li.dd-head { min-height: 30px; padding-top: 8px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; cursor: default; }
.dd-menu li.dd-head:hover { background: none; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14.5px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 42px; height: 26px; border-radius: 999px; background: var(--line-strong); transition: background .3s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .35s var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- produktkort */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 340px;
  transition: opacity .6s var(--ease), transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s var(--ease);
  transition-delay: var(--d, 0s), 0s, 0s, 0s;
}
.card.in:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); transition-delay: 0s; }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 78%; height: 82%; object-fit: contain; mix-blend-mode: multiply; transition: transform .6s var(--ease); }
.card.in:hover .card-img img { transform: scale(1.05); }
.noimg { font-size: 30px; font-weight: 700; color: var(--line-strong); }
.badge { position: absolute; top: 8px; left: 8px; z-index: 1; font-size: 11.5px; font-weight: 700; letter-spacing: .01em; padding: 4px 9px; border-radius: 999px; }
.badge.best { background: var(--accent); color: #fff; }
.badge.save { left: auto; right: 8px; background: var(--sale); color: #fff; }
.badge.state { top: auto; bottom: 8px; background: var(--ink); color: #fff; }
.card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; flex: 1; min-width: 0; }
.store { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; font-weight: 500; }
.store span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store img { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; flex: none; background: #fff; }
.card h3 { margin: 2px 0 0; font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { margin-top: 8px; font-size: 21px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.unit { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.unit b { color: var(--accent-ink); font-weight: 700; }
.ord { font-size: 12px; color: var(--muted); }
.ord .save-txt { color: var(--sale); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 11px; color: var(--ink-2); background: var(--surface-2); border-radius: 6px; padding: 2px 7px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag.member { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.valid { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--muted); }
.valid.soon { color: var(--sale); font-weight: 600; }
.card-link { position: absolute; inset: 0; z-index: 2; border-radius: var(--radius); }
.card.expired, .card.removed { opacity: .6 !important; }
.card.expired img, .card.removed img { filter: grayscale(1); }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 15px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); grid-column: 1 / -1; }
.more { display: flex; margin: 24px auto 0; min-width: 220px; }

/* reveal / stagger / byte */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.swap-out { opacity: 0 !important; transform: translateY(6px) !important; transition: opacity .16s var(--ease-in-out), transform .16s var(--ease-in-out) !important; transition-delay: 0s !important; }

/* skeleton */
.skel { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.skel .s-img { aspect-ratio: 4 / 3; }
.s-line { height: 10px; margin: 12px 12px 0; border-radius: 6px; }
.s-line.w60 { width: 60%; } .s-line.w40 { width: 40%; height: 18px; margin-bottom: 14px; }
.skel.mini-skel { height: 86px; border-radius: 14px; border: 0; }
.shimmer { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 45%, var(--surface-2) 90%); background-size: 300% 100%; animation: shimmer 1.4s var(--ease-in-out) infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------------------------------------------------------------- jämförelse */
.cmp-head { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; margin-bottom: 12px; }
.cmp-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cmp-tabs::-webkit-scrollbar { display: none; }
.cmp-tabs .chip { flex: none; }
.cmp-sub { font-size: 13.5px; color: var(--muted); }
.cmp-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cmp-row { display: grid; grid-template-columns: 22px 52px minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 14px 12px; border-top: 1px solid var(--line);
  transition: opacity .55s var(--ease), transform .65s var(--ease), background .25s var(--ease); transition-delay: var(--d, 0s), var(--d, 0s), 0s; }
.cmp-row:first-child { border-top: 0; }
.cmp-row:hover { background: var(--bg); }
.cmp-row.best { background: var(--accent-soft); }
.rank { font-size: 13px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.cmp-row.best .rank { color: var(--accent-ink); }
.cmp-row > img, .cmp-row > .ph { width: 52px; height: 52px; object-fit: contain; mix-blend-mode: multiply; border-radius: 10px; background: var(--surface-2); }
.cmp-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.cmp-sub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.cmp-sub-row a { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; position: relative; z-index: 1; }
.cmp-price { grid-column: 3; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.cmp-price .price { margin: 0; font-size: 19px; }
.pill-best { font-size: 11px; font-weight: 700; background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 999px; }

/* ---------------------------------------------------------------- källor & footer */
footer { margin-top: 56px; padding: 8px 0 40px; border-top: 1px solid var(--line); background: var(--surface); }
.sources-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; min-height: 56px; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 600; text-align: left; }
.sources-toggle svg { transition: transform .4s var(--ease); }
.sources-toggle[aria-expanded="true"] svg { transform: rotate(45deg); }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--ease); }
.collapse > div { overflow: hidden; min-height: 0; }
.collapse.open { grid-template-rows: 1fr; }
.sources { display: grid; grid-template-columns: 1fr; gap: 0 24px; padding: 4px 0 16px; }
.src { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.src .store { font-size: 13.5px; color: var(--ink); }
.src .st { color: var(--muted); font-size: 12.5px; text-align: right; }
.src .st.err { color: var(--sale); }
.fine { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }

.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 35; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center;
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none; transition: opacity .3s var(--ease), transform .4s var(--ease); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------------------------------------------------------------- admin */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.block-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.form-grid input:not([type=checkbox]), .form-grid select, .form-grid textarea, #aq { height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: 15px; color: var(--ink); outline: 0; font-weight: 400; }
.form-grid input:focus, .form-grid select:focus, #aq:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(19, 111, 79, .12); }
.form-grid input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
.meta { color: var(--muted); font-size: 13px; }
table.admin { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin th, table.admin td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.admin th { font-size: 12px; font-weight: 600; color: var(--muted); border-top: 0; }
table.admin a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.table-scroll { overflow-x: auto; }
.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.active { background: var(--accent-soft); color: var(--accent-ink); }
.pill.upcoming { background: #e8eefb; color: #23408e; }
.pill.expired, .pill.removed { background: var(--sale-soft); color: var(--sale); }
.pill.hidden { background: var(--surface-3); color: var(--muted); }
.msg { padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 12px; font-size: 14px; background: var(--accent-soft); color: var(--accent-ink); }
.msg.err { background: var(--sale-soft); color: var(--sale); }

/* ---------------------------------------------------------------- brytpunkter */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .strip { grid-auto-columns: 280px; }
  .strip-nav { display: flex; }
  .card-body { padding: 12px 14px 14px; }
  .price { font-size: 23px; }
  .cmp-row { grid-template-columns: 28px 64px minmax(0, 1fr) auto; gap: 16px; padding: 16px 18px; }
  .cmp-row > img, .cmp-row > .ph { width: 64px; height: 64px; }
  .cmp-price { grid-column: auto; flex-direction: column; align-items: flex-end; text-align: right; }
  .cmp-price .price { font-size: 21px; }
  .sources { grid-template-columns: 1fr 1fr; }
  .cmp-head { flex-direction: row; align-items: center; justify-content: space-between; }
  .cmp-sub { flex: none; }
}
@media (min-width: 1024px) {
  :root { --header-h: 72px; --gutter: 32px; }
  .top-row { grid-template-columns: minmax(170px, 1fr) minmax(360px, 640px) minmax(170px, 1fr); grid-template-areas: "loc search nav"; padding-top: 0; padding-bottom: 0; min-height: var(--header-h); gap: 20px; }
  .nav { grid-area: nav; display: flex; justify-self: end; }
  .menu-btn, .sheet { display: none; }
  .search input { height: 44px; }
  .depts { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .strip { grid-auto-columns: 288px; }
  .layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
  .sidebar { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); transform: none; visibility: visible; transition: none; z-index: 1;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
  .sb-grip, .sb-close, .sb-foot { display: none; }
  .sb-head { padding: 16px 18px 4px; }
  .filter-btn { display: none; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .sources { grid-template-columns: repeat(3, 1fr); }
  body.drawer-open { overflow: auto; }
}
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1600px) { .wrap { max-width: 1560px; } .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (hover: none) {
  .card.in:hover { transform: none; box-shadow: none; }
  .card.in:hover .card-img img { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
}
