:root {
  --bg: #0c0e13;
  --panel: #171a22;
  --panel-2: #1c202a;
  --line: #262b36;
  --text: #e8eaef;
  --muted: #8b94a3;
  --accent: #5ac8fa;
  --accent-2: #7b8cff;
  --in: #4ade80;
  --out: #f87171;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(0,0,0,.32);
  --shadow-hover: 0 10px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; color: var(--text);
  background: radial-gradient(1100px 560px at 50% -8%, #161b27 0%, var(--bg) 58%) fixed;
  font: 14.5px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.muted { color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* --- search --- */
.search-bar input {
  width: 100%; padding: 16px 20px;
  font-size: 19px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90,200,250,.16), var(--shadow); }

.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 12px 0;
}
.filters select, .filters input[type="number"] {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-size: 13px;
}
.filters input[type="number"] { width: 110px; }
.filters .check {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel);
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip {
  background: rgba(90, 200, 250, 0.12); color: var(--accent);
  border: 1px solid rgba(90, 200, 250, 0.4);
  padding: 2px 10px; border-radius: 999px; font-size: 12px;
}

.status { margin: 10px 0; font-size: 13px; }

/* --- two-column layout: shop sidebar + results --- */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  align-items: start;
}

.shop-sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 30px);
  overflow-y: auto;
}
.shop-sidebar h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); margin: 0 0 8px;
}
.shop-list { list-style: none; padding: 0; margin: 0; }
.shop-item {
  padding: 7px 10px;
  border-radius: 5px;
  cursor: pointer;
  margin-bottom: 2px;
  font-size: 13px;
}
.shop-item:hover { background: rgba(255,255,255,0.04); }
.shop-item.active {
  background: rgba(90,200,250,0.15);
  color: var(--accent);
  font-weight: 600;
}
.shop-line {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
}
.shop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-count {
  color: var(--muted);
  font-size: 11px;
  background: rgba(255,255,255,0.04);
  padding: 1px 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.shop-item.active .shop-count {
  background: rgba(90,200,250,0.2);
  color: var(--accent);
}
.shop-price {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .shop-sidebar { position: static; max-height: 200px; }
}

/* --- results --- */
.results { list-style: none; padding: 0; margin: 0; }
.result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 9px;
  background: linear-gradient(var(--panel), var(--panel-2));
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.result:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #39414f;
}
.r-thumb-wrap {
  width: 60px; height: 60px; flex: none; display: flex;
  align-items: center; justify-content: center; overflow: hidden;
  border-radius: 8px; background: #fff; border: 1px solid var(--line);
  font-size: 26px; text-decoration: none;
}
.r-thumb-wrap.empty { background: var(--panel-2); }
.r-thumb { width: 100%; height: 100%; object-fit: contain; background: #fff; }
/* Vandret-scroll-container så brede tabeller (sammenlign/historik) ikke sprænger
   siden på mobil (audit: produktside-tabeller tvang <body> til at scrolle). */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.r-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.r-name { grid-column: 1; font-size: 15px; font-weight: 550; letter-spacing: -.01em; }
.result:hover .r-name { color: #fff; }
.r-name mark, mark {
  background: #ffd54a; color: #1a1a1a; padding: 0 2px;
  border-radius: 2px; font-weight: 600;
}
.r-meta { grid-column: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.r-price { flex: none; margin-left: auto; font-size: 19px; font-weight: 700;
  align-self: center; white-space: nowrap; color: var(--accent);
  letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.r-domain { color: var(--muted); }
.tag {
  background: #232732; color: #9ab2d1;
  padding: 1px 8px; border-radius: 5px; font-size: 11px;
}
.r-price.checking { opacity: 0.45; }
.r-price.stale { opacity: 0.7; }
.live-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  background: rgba(74,222,128,0.15); color: var(--in);
  padding: 1px 5px; border-radius: 4px; vertical-align: middle;
  letter-spacing: 0.5px;
}
/* Udenlandsk-butik flag: gør tydeligt at prisen er i fremmed valuta (SEK/EUR…) */
.r-flag {
  background: rgba(251,191,36,0.13); color: #fbbf24;
  padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 600;
  white-space: nowrap; cursor: help;
}
.r-stock { padding: 1px 8px; border-radius: 4px; font-size: 11px; }
.r-stock.in { background: rgba(74,222,128,0.12); color: var(--in); }
.r-stock.out { background: rgba(248,113,113,0.12); color: var(--out); }
.r-stock.locked { background: rgba(251,191,36,0.15); color: #fbbf24; font-weight: 600; }

/* Cross-shop sammenligning på produktsiden */
.compare { width: 100%; border-collapse: collapse; margin: 8px 0 24px; }
.compare td { padding: 8px 10px; border-bottom: 1px solid #2a2a2a; font-size: 13px; vertical-align: middle; }
.compare tr:hover td { background: rgba(255,255,255,0.03); }
.compare .c-price { font-weight: 700; color: #5ac8fa; white-space: nowrap; }
.compare .cheaper { color: #4ade80; font-weight: 600; font-size: 11px; margin-left: 6px; }
.compare .c-shop { color: #9aa; white-space: nowrap; }
.compare .c-stock { font-size: 11px; white-space: nowrap; }
.compare .c-stock.in { color: var(--in); }
.compare .c-stock.out { color: var(--out); }
.compare .c-name a { color: #ddd; text-decoration: none; }
.compare .c-name a:hover { text-decoration: underline; }
.compare .c-buy { color: #5ac8fa; text-decoration: none; white-space: nowrap; }

/* "Billigere hos X" deal-banner */
.deal-banner { margin: 8px 0 14px; padding: 10px 14px; border-radius: 8px; font-size: 14px;
  background: rgba(74,222,128,0.10); border: 1px solid rgba(74,222,128,0.3); color: #d6f5e0; }
.deal-banner strong { color: #4ade80; }
.deal-banner.best { background: rgba(90,200,250,0.08); border-color: rgba(90,200,250,0.3); color: #bfe3f5; }
.deal-go { margin-left: 8px; color: #4ade80; text-decoration: none; font-weight: 600; white-space: nowrap; }

/* Deals-side */
.deals-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.deals-table td { padding: 10px 12px; border-bottom: 1px solid #2a2a2a; font-size: 14px; vertical-align: middle; }
.deals-table tr:hover td { background: rgba(255,255,255,0.03); }
.d-save { color: #4ade80; font-weight: 700; white-space: nowrap; }
.d-pct { color: #888; font-weight: 400; font-size: 11px; margin-left: 6px; }
.d-name a { color: #ddd; text-decoration: none; }
.d-name a:hover { text-decoration: underline; }
.d-range { color: #5ac8fa; white-space: nowrap; }
.d-shops, .d-best { color: #9aa; font-size: 12px; white-space: nowrap; }
.nav-deals { color: #4ade80; text-decoration: none; font-weight: 600; }
.nav-deals:hover { text-decoration: underline; }

.pager { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.pager button {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
}
.pager button:hover { border-color: var(--accent); }

/* --- product page --- */
.product .back { display: inline-block; margin-bottom: 12px; }
.product h1 { font-size: 22px; margin: 4px 0 8px; }
.p-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.p-price { font-size: 30px; font-weight: 700; margin: 8px 0 16px; color: var(--accent); }
.buy {
  display: inline-block; padding: 10px 18px;
  background: var(--accent); color: #0f1115;
  border-radius: 6px; font-weight: 600;
}
.buy:hover { text-decoration: none; opacity: 0.9; }

/* --- feedback widget --- */
.fb-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  background: var(--accent); color: #0f1115; border: none;
  padding: 10px 16px; border-radius: 24px; font-size: 14px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.fb-btn:hover { opacity: 0.92; }
.fb-panel {
  position: fixed; right: 20px; bottom: 70px; z-index: 50; width: 320px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; box-shadow: 0 8px 28px rgba(0,0,0,0.5);
}
.fb-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.fb-x { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.fb-hint { color: var(--muted); font-size: 12px; margin: 6px 0 8px; }
.fb-panel textarea {
  width: 100%; box-sizing: border-box; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 8px; font-size: 13px; resize: vertical;
}
.fb-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.fb-status { color: var(--muted); font-size: 12px; }
.fb-send {
  background: var(--accent); color: #0f1115; border: none;
  padding: 7px 16px; border-radius: 6px; font-weight: 600; cursor: pointer;
}
.fb-send:disabled { opacity: 0.5; cursor: default; }

.product canvas {
  width: 100%; max-width: 800px; height: auto;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; margin-bottom: 20px;
}

.history { width: 100%; border-collapse: collapse; margin-top: 12px; }
.history th, .history td {
  text-align: left; padding: 6px 10px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.history th { color: var(--muted); font-weight: 500; }
