*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── LIGHT THEME (default) ── */
  --bg: #f7f7fa;
  --surface: #ffffff;
  --surface2: #f0f0f5;
  --surface3: #e6e6ef;
  --accent: #16a34a;
  --accent-dim: rgba(22, 163, 74, 0.12);
  --accent-glow: rgba(22, 163, 74, 0.25);
  --text: #0d0d14;
  --text-muted: #52526e;
  --text-dim: #9898b0;
  --border: rgba(0, 0, 0, 0.08);
  --border-soft: rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --tab-h: 60px;
  --card-shine: inset 0 1px 0 rgba(255,255,255,0.9);
  /* semantic helpers — swap in dark mode */
  --topbar-bg: rgba(247, 247, 250, 0.92);
  --tab-bar-bg: rgba(247, 247, 250, 0.94);
  --overlay: rgba(0, 0, 0, 0.06);
  --overlay-hover: rgba(0, 0, 0, 0.10);
  --overlay-border: rgba(0, 0, 0, 0.10);
  --muted-dot: rgba(0, 0, 0, 0.13);
  --scrollbar-thumb: #c8c8d8;
  --logo-span-end: #15803d;
}

[data-theme="dark"] {
  /* ── DARK THEME ── */
  --bg: #0c0c0f;
  --surface: #14141a;
  --surface2: #1c1c24;
  --surface3: #24242f;
  --accent: #22c55e;
  --accent-dim: rgba(34, 197, 94, 0.18);
  --accent-glow: rgba(34, 197, 94, 0.35);
  --text: #f0f0f5;
  --text-muted: #9090a8;
  --text-dim: #50506a;
  --border: rgba(255,255,255,0.07);
  --border-soft: rgba(255,255,255,0.04);
  --card-shine: inset 0 1px 0 rgba(255,255,255,0.06);
  --topbar-bg: rgba(12, 12, 15, 0.92);
  --tab-bar-bg: rgba(12, 12, 15, 0.94);
  --overlay: rgba(255, 255, 255, 0.09);
  --overlay-hover: rgba(255, 255, 255, 0.15);
  --overlay-border: rgba(255, 255, 255, 0.14);
  --muted-dot: rgba(255, 255, 255, 0.14);
  --scrollbar-thumb: #38384a;
  --logo-span-end: #86efac;
}

html { scroll-behavior: smooth; overflow-x: hidden; }
#main-content:focus { outline: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb); }

/* ── LOGO ── */
.logo {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.8px;
  background: linear-gradient(125deg, var(--text) 0%, var(--text-muted) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
  text-decoration: none;
}
.logo span {
  background: linear-gradient(125deg, var(--accent), var(--logo-span-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-beta {
  display: inline-block; margin-left: 6px;
  font-size: .52rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 5px; border-radius: 4px;
  background: rgba(34,197,94,.18); border: 1px solid rgba(34,197,94,.35);
  color: #22c55e;
  -webkit-text-fill-color: #22c55e;
  vertical-align: middle; line-height: 1;
  position: relative; top: -2px;
}

/* ── ICON BUTTON ── */
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
  text-decoration: none;
}
.icon-btn:hover {
  background: var(--surface3); color: var(--text);
  border-color: rgba(255,255,255,0.12); transform: scale(1.05);
}
.icon-btn svg { width: 17px; height: 17px; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.7rem; font-weight: 800;
  padding: 3px 8px; border-radius: 100px; letter-spacing: 0.2px;
}
.badge-ok   { background: var(--accent); color: #fff; }
.badge-warn { background: #f59e0b; color: #fff; }
.badge-err  { background: #ef4444; color: #fff; }
.badge-muted { background: var(--overlay); color: var(--text-muted); }

/* ── TOP BAR ── */
.topbar {
  position: sticky; top: 0; z-index: 200; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: var(--topbar-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border-soft), 0 4px 24px rgba(0,0,0,0.10);
}

/* ── HAMBURGER BUTTON ── */
.hamburger-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted);
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.hamburger-btn:hover { background: var(--surface2); color: var(--text); }

/* ── NAV BACKDROP ── */
.nav-backdrop {
  position: fixed; inset: 56px 0 0 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.18s ease;
}

/* ── NAV DRAWER ── */
.nav-drawer {
  position: fixed; top: 56px; right: 0; bottom: 0;
  width: 220px;
  z-index: 160;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 10px 8px;
  animation: slideIn 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.nav-drawer-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--radius);
  font-size: 0.92rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.nav-drawer-link svg { flex-shrink: 0; opacity: 0.65; transition: opacity 0.15s; }
.nav-drawer-link:hover { background: var(--surface2); color: var(--text); }
.nav-drawer-link:hover svg { opacity: 1; }
.nav-drawer-link.active { background: var(--surface2); color: var(--text); }
.nav-drawer-link.active svg { opacity: 1; }

.nav-drawer-divider {
  height: 1px; background: var(--border);
  margin: 6px 8px;
}
.nav-drawer-divider--admin { margin-top: 12px; }

.nav-drawer-section-label {
  padding: 8px 16px 2px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Admin free/premium preview toggle ── */
.nav-preview-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px 8px;
}
.nav-preview-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  opacity: .45; font-weight: 700;
}
.nav-preview-seg {
  display: flex;
  background: var(--overlay);
  border: 1px solid var(--overlay-border);
  border-radius: 7px; overflow: hidden;
}
.nav-preview-btn {
  padding: 4px 12px; font-size: .75rem; font-weight: 600;
  border: none; background: transparent; color: var(--text);
  cursor: pointer; opacity: .4; transition: opacity .15s, background .15s, color .15s;
}
.nav-preview-btn--on {
  background: rgba(251,191,36,.18); color: #fbbf24; opacity: 1;
}

.nav-drawer-link--admin {
  font-size: 0.85rem; font-weight: 500;
  opacity: 0.7;
}
.nav-drawer-link--admin:hover,
.nav-drawer-link--admin.active { opacity: 1; }

.nav-admin-toggle {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  color: inherit;
}
.nav-admin-chevron {
  margin-left: auto; flex-shrink: 0; opacity: 0.5;
  transition: transform 0.2s;
}
.nav-admin-chevron--open { transform: rotate(180deg); }

.nav-admin-sub {
  margin: 2px 0 4px 26px;
  border-left: 1px solid var(--border);
  padding-left: 6px;
}
.nav-admin-sub-link {
  display: block;
  padding: 6px 10px; border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  opacity: 0.7;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.nav-admin-sub-link:hover,
.nav-admin-sub-link.active {
  background: var(--surface2); color: var(--text); opacity: 1;
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── SECTION HEADERS ── */
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.section-title { font-size: 1rem; font-weight: 800; letter-spacing: -0.2px; }
.see-all { font-size: 0.78rem; color: var(--accent); text-decoration: none; font-weight: 700; opacity: 0.9; transition: opacity 0.15s; }
.see-all:hover { opacity: 1; }

/* ── PAGE WRAPPER ── */
.page-wrap { max-width: 900px; margin: 0 auto; padding: 24px 18px calc(var(--tab-h) + 40px); }
@media (min-width: 768px) { .page-wrap { padding: 32px 32px 80px; } }

/* ── SECTION ── */
.section { margin-bottom: 40px; }
.section-label {
  font-size: 0.65rem; font-weight: 900; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::before {
  content: '';
  display: inline-block; width: 3px; height: 10px;
  background: var(--accent); border-radius: 2px; flex-shrink: 0;
  opacity: 0.6;
}

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 480px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--card-shine);
}
.stat-label {
  font-size: 0.68rem; font-weight: 700; color: var(--text-dim);
  letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 5px;
}
.stat-value { font-size: 0.92rem; font-weight: 800; color: var(--text); line-height: 1.3; }
.stat-value.accent { color: var(--accent); }

/* ── CARD ── */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--card-shine);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.card:hover { border-color: var(--border); box-shadow: var(--card-shine), 0 8px 32px rgba(0,0,0,0.15); }
.card-body { padding: 16px 18px; }
.card-title { font-size: 0.88rem; font-weight: 800; margin-bottom: 4px; }
.card-sub   { font-size: 0.75rem; color: var(--text-muted); line-height: 1.45; }

/* ── BUTTON ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.88rem; font-weight: 700; padding: 11px 22px;
  border-radius: 20px; border: none; cursor: pointer;
  letter-spacing: 0.1px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap; text-decoration: none;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 8px 28px var(--accent-glow); }

.btn-secondary {
  background: var(--overlay);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--overlay-border); color: var(--text);
}
.btn-secondary:hover { background: var(--overlay-hover); }

.btn-danger { background: #ef4444; color: #fff; box-shadow: 0 4px 20px rgba(239,68,68,0.35); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--overlay); }
.btn-danger:hover { background: #f87171; }

.btn-sm { padding: 7px 14px; font-size: 0.78rem; border-radius: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* ── CHIP / FILTER ── */
.chip {
  flex-shrink: 0; padding: 7px 15px; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); font-size: 0.8rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: all 0.18s ease; letter-spacing: 0.15px;
  display: inline-flex; align-items: center;
}
.chip:hover { border-color: rgba(34,197,94,0.4); color: var(--text); background: var(--surface2); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 18px var(--accent-glow); }
.chip-disabled, .chip:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

.backend-switcher {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0 4px; margin-top: 6px;
  border-top: 1px solid var(--border);
}
.backend-switcher-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-right: 4px;
}

.chips-wrap {
  display: flex; gap: 7px; flex-wrap: wrap; padding: 0 0 4px;
}

/* ── FORM ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin-bottom: 8px;
}
.form-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.95rem; outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-dim); }

/* ── TABLE ── */
.price-table {
  width: 100%; border-collapse: collapse;
}
.price-table th {
  font-size: 0.65rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-dim); padding: 10px 14px;
  text-align: left; border-bottom: 1px solid var(--border);
}
.price-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem; color: var(--text);
}
.price-table tr:last-child td { border-bottom: none; }
.price-table tr:hover td { background: var(--surface2); }
.price-table .td-price { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.price-table .td-store { color: var(--text-muted); font-size: 0.78rem; }
.price-table .td-date  { color: var(--text-dim); font-size: 0.75rem; }

/* ── SCANNER PAGE ── */
.scanner-wrap {
  display: flex; flex-direction: column; gap: 20px;
  max-width: 640px; margin: 0 auto; padding: 24px 18px 80px;
}
@media (min-width: 768px) { .scanner-wrap { padding: 32px 0 80px; } }

.camera-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  position: relative;
}

/* Full-screen camera mode — takes over the entire viewport */
.camera-card--fullscreen {
  position: fixed; inset: 0; z-index: 95;
  border: none; border-radius: 0;
  display: flex; flex-direction: column;
  background: #000;
}
.camera-card--fullscreen .camera-viewport {
  flex: 1; aspect-ratio: unset; min-height: 0;
}
.camera-card--fullscreen .camera-controls {
  border-top: none;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 16px max(env(safe-area-inset-bottom), 24px);
  pointer-events: auto; z-index: 10;
}

.camera-viewport {
  position: relative; width: 100%; aspect-ratio: 4/3; background: #000;
  display: flex; align-items: center; justify-content: center;
}

.camera-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.camera-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}

.yolo-loading-overlay {
  display: none;
  position: absolute; inset: 0; z-index: 10;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  align-items: center; justify-content: center;
}
.yolo-loading-overlay[data-state="loading"],
.yolo-loading-overlay[data-state="error"] { display: flex; }
.yolo-loading-overlay__content {
  background: rgba(15,15,20,.85); border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 20px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  color: #e2e8f0; font-size: .92em; text-align: center; min-width: 180px;
}
.yolo-loading-body {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.yolo-error-body {
  display: none; flex-direction: column; align-items: center; gap: 10px;
}
[data-state="loading"] .yolo-loading-body { display: flex; }
[data-state="loading"] .yolo-error-body   { display: none; }
[data-state="error"]   .yolo-loading-body { display: none; }
[data-state="error"]   .yolo-error-body   { display: flex; }

.camera-overlay-frame {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 2;
}
.camera-frame-border {
  width: 75%; max-width: 320px; aspect-ratio: 2.5/1;
  border: 2px solid rgba(34,197,94,0.7);
  border-radius: 10px;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(34,197,94,0.15);
}
.camera-frame-label {
  position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 700; color: rgba(34,197,94,0.85);
  white-space: nowrap; letter-spacing: 0.5px;
  transition: color 0.2s;
}

/* Detected → amber pulse; Locked → bright green flash */
.camera-frame-border.state-detecting {
  border-color: rgba(251,191,36,0.9);
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(251,191,36,0.2),
              0 0 14px 2px rgba(251,191,36,0.5);
  animation: frame-pulse 0.7s ease-in-out infinite alternate;
}
.camera-frame-border.state-detecting .camera-frame-label { color: rgba(251,191,36,0.9); }
.camera-frame-border.state-locked {
  border-color: #fff;
  box-shadow: 0 0 0 2000px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.3),
              0 0 20px 4px rgba(34,197,94,0.8);
  animation: none;
}
@keyframes frame-pulse {
  from { box-shadow: 0 0 0 2000px rgba(0,0,0,0.35), 0 0 8px 1px rgba(251,191,36,0.3); }
  to   { box-shadow: 0 0 0 2000px rgba(0,0,0,0.35), 0 0 18px 4px rgba(251,191,36,0.6); }
}

.camera-info-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--surface2);
  border-top: 1px solid var(--border);
}
.camera-card--fullscreen .camera-info-bar {
  position: absolute; bottom: 60px; left: 0; right: 0; z-index: 20;
  background: rgba(0,0,0,0.6); border-top: none;
}
.info-fps {
  font: 700 0.8rem/1 monospace; color: #4ade80;
  background: rgba(74,222,128,0.12); padding: 3px 8px;
  border-radius: 5px; border: 1px solid rgba(74,222,128,0.3);
  min-width: 52px; text-align: center;
}
.info-status {
  flex: 1; font-size: 0.78rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.info-matches {
  font: 600 0.78rem/1 monospace; color: var(--accent);
  background: var(--accent-dim); padding: 3px 8px;
  border-radius: 5px; min-width: 52px; text-align: center;
}
.info-interpreter {
  font: 700 0.72rem/1 monospace; padding: 3px 8px;
  border-radius: 5px; text-transform: uppercase; letter-spacing: .04em;
}
.badge-classic { color: #94a3b8; background: rgba(148,163,184,0.12); }
.badge-onnx    { color: #38bdf8; background: rgba(56,189,248,0.15); }
.info-backend  { font: 700 0.72rem/1 monospace; padding: 3px 8px; border-radius: 5px;
                 text-transform: uppercase; letter-spacing: .04em;
                 color: #a78bfa; background: rgba(167,139,250,0.15); }
.info-backend:empty { display: none; }

.scan-pulse {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid var(--accent);
  background: rgba(34,197,94,0.12);
  display: flex; align-items: center; justify-content: center;
  animation: pulse 1.4s ease-in-out infinite;
  cursor: pointer;
}
.scan-pulse:active { transform: scale(0.88); }

/* ── detection preview modal ─────────────────────────────────────────── */
.detection-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
}
.detection-modal {
  background: var(--surface);
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;
}
.detection-modal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  font-weight: 600; font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detection-conf-badge {
  font-size: 0.75rem; font-weight: 700;
  background: rgba(34,197,94,0.15); color: var(--accent);
  border-radius: 6px; padding: 2px 7px;
}
/* Image area fills available vertical space */
.detection-modal-images {
  flex: 1; min-height: 0;
  background: #111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.detection-img-container {
  position: relative;
  /* size to image natural dimensions, capped by available space */
  max-width: 100%; max-height: 100%;
  line-height: 0;
}
.detection-img-group    { display: flex; flex-direction: column; gap: 4px; }
.detection-img-label {
  font-size: 0.7rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.detection-img {
  display: block;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
/* Result panel — scrollable if content overflows */
.detection-ocr-section {
  flex-shrink: 0;
  max-height: 45vh;
  overflow-y: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.detection-ocr-pending {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-muted);
}
.detection-ocr-result { display: flex; flex-direction: column; gap: 6px; }
.detection-ocr-row    { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.detection-ocr-price {
  font-size: 2.8rem; font-weight: 800;
  color: var(--accent); letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.detection-ocr-unit  { font-size: 1.1rem; color: var(--text-muted); }
.detection-ocr-name  { font-size: 0.9rem; color: var(--text); }
.detection-ocr-conf  { font-size: 0.75rem; color: var(--text-dim); }
.detection-ocr-error { font-size: 0.8rem; color: var(--badge-err-text, #f87171); }
/* Per-character word chips */
.detection-words { display: flex; flex-wrap: wrap; gap: 6px; }
.detection-word-chip {
  font-family: monospace; font-size: 1rem; font-weight: 700;
  padding: 3px 9px; border-radius: 5px;
  border: 1.5px solid currentColor;
  line-height: 1.4;
}

.detection-modal-nav {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px; flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.detection-nav-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); cursor: pointer; transition: background 0.15s;
}
.detection-nav-dot--active { background: var(--accent); }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

.camera-idle-msg {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text-dim); font-size: 0.85rem; text-align: center;
  padding: 32px 20px;
}
.camera-idle-msg svg { width: 48px; height: 48px; opacity: 0.3; }

.camera-controls {
  display: flex; gap: 10px; justify-content: center; align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.fixture-buttons {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 8px 16px 14px;
}

/* Saved camera images strip */
.saved-images-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--border);
}
.saved-images-label {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); white-space: nowrap;
}
.saved-images-strip {
  display: flex; gap: 6px; overflow-x: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: var(--surface3) transparent;
  padding-bottom: 2px;
}
.saved-images-strip::-webkit-scrollbar { height: 4px; }
.saved-images-strip::-webkit-scrollbar-track { background: transparent; }
.saved-images-strip::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }
.saved-img-card {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; white-space: nowrap;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  font-size: .8rem; color: var(--text-muted);
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.saved-img-card:hover:not(:disabled) { background: var(--surface3); color: var(--text); }
.saved-img-card--active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.saved-img-card:disabled { opacity: .45; cursor: not-allowed; }

/* Modal dialog */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
}
.modal-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px 24px 20px;
  min-width: 320px; max-width: 460px; width: 90%;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.modal-title {
  font-size: .95rem; font-weight: 700; color: var(--text);
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px;
}

/* Resize handles on SVG bboxes */
.resize-handle { cursor: pointer; }
.cur-nwse   { cursor: nw-resize; }
.cur-nesw   { cursor: ne-resize; }
.cur-ns     { cursor: n-resize; }
.cur-ew     { cursor: e-resize; }
.cur-rotate { cursor: crosshair; }

.shutter-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--accent);
  background: rgba(34,197,94,0.15);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}
.shutter-btn:hover { background: rgba(34,197,94,0.3); transform: scale(1.06); box-shadow: 0 0 24px var(--accent-glow); }
.shutter-btn:active { transform: scale(0.94); }
.shutter-btn svg { width: 28px; height: 28px; color: var(--accent); }

/* ── RESULT PANEL ── */
.result-panel {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); overflow: hidden;
  animation: slideUp 0.22s ease both;
}
/* Floats above the full-screen camera */
.result-panel--overlay {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 98;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.result-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.result-title-row { display: flex; align-items: center; gap: 10px; }
.result-name { font-size: 1rem; font-weight: 800; }
.result-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }

.parsed-fields { display: flex; flex-direction: column; gap: 8px; }
.parsed-field {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border-radius: 10px; padding: 10px 14px;
}
.field-label { font-size: 0.72rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.field-value { font-size: 0.92rem; font-weight: 800; color: var(--text); }
.field-value.accent { color: var(--accent); }

.result-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── FREE USER GATE ── */
.free-gate-banner {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(250,204,21,.10); border: 1px solid rgba(250,204,21,.30);
  font-size: .8rem; color: var(--text-muted);
}
.free-gate-banner--gps { background: rgba(99,102,241,.08); border-color: rgba(99,102,241,.25); }
.free-gate-upgrade {
  margin-left: auto; font-size: .78rem; font-weight: 700;
  color: var(--accent); text-decoration: none; white-space: nowrap;
}

/* ── STORE TREE ── */
.store-tree { display: flex; flex-direction: column; gap: 4px; margin-bottom: 1rem; }
.st-chain { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.st-chain-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--surface2); border: none; color: var(--text); cursor: pointer;
  text-align: left; transition: background .12s;
}
.st-chain-btn:hover { background: var(--surface3); }
.st-chain-name { font-weight: 700; font-size: .9rem; text-transform: capitalize; flex: 1; }
.st-arrow { font-size: .75rem; color: var(--text-muted); width: 12px; }
.st-county { border-top: 1px solid var(--border-soft); }
.st-county-btn {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 28px;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  text-align: left; font-size: .85rem; transition: background .12s, color .12s;
}
.st-county-btn:hover { background: var(--surface2); color: var(--text); }
.st-count { margin-left: auto; font-size: .7rem; background: var(--surface3); border-radius: 100px; padding: 1px 7px; color: var(--text-muted); }
.st-stores { list-style: none; padding: 4px 14px 8px 44px; display: flex; flex-direction: column; gap: 2px; }
.st-store { display: flex; align-items: center; gap: 6px; font-size: .82rem; padding: 3px 0; }
.st-store-name { font-weight: 600; color: var(--text); }
.st-store-meta { color: var(--text-muted); font-size: .75rem; }
.st-store-gps { font-size: .75rem; opacity: .6; }

/* ── SHOPPING LIST ── */
.list-wrap { display: flex; flex-direction: column; gap: 12px; }

.list-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease;
  text-decoration: none; color: inherit;
}
.list-card:hover { border-color: rgba(255,255,255,0.1); background: var(--surface2); }

.list-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-dim); border: 1px solid rgba(34,197,94,0.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--accent);
}
.list-icon svg { width: 22px; height: 22px; }

.list-info { flex: 1; min-width: 0; }
.list-name { font-size: 0.9rem; font-weight: 800; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 0.75rem; color: var(--text-muted); }

.list-chevron { color: var(--text-dim); flex-shrink: 0; }
.list-chevron svg { width: 16px; height: 16px; }

/* ── PRICE HISTORY ENTRY ── */
.history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft);
}
.history-item:last-child { border-bottom: none; }
.history-thumb {
  width: 48px; height: 48px; border-radius: 10px;
  background: var(--surface2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}
.history-thumb svg { width: 20px; height: 20px; }
.history-info { flex: 1; min-width: 0; }
.history-name { font-size: 0.85rem; font-weight: 800; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-store { font-size: 0.73rem; color: var(--text-muted); }
.history-price { font-size: 1.05rem; font-weight: 900; color: var(--accent); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
  position: relative;
}
.empty-state::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -60%);
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(34,197,94,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.empty-icon { width: 60px; height: 60px; margin: 0 auto 16px; opacity: 0.28; position: relative; }
.empty-state h3 { font-size: 0.95rem; margin-bottom: 6px; color: var(--text-muted); font-weight: 700; }
.empty-state p { font-size: 0.8rem; }

/* ── DUPLICATE WARNING ── */
.duplicate-warning {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.35);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
  color: #fbbf24; font-size: .875rem;
}
.duplicate-warning code { color: #fcd34d; background: rgba(252,211,77,0.12); padding: 1px 5px; border-radius: 4px; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 100px; padding: 10px 20px;
  font-size: 0.85rem; font-weight: 700;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toastIn 0.22s ease both;
  white-space: nowrap; z-index: 9999;
}
.toast.ok  { border-color: rgba(34,197,94,0.4); color: #4ade80; }
.toast.err { border-color: rgba(239,68,68,0.4); color: #f87171; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ── SPINNER ── */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ANIMATIONS ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse {
  0%  { box-shadow: 0 0 0  0   var(--accent-glow); }
  60% { box-shadow: 0 0 0 20px rgba(34,197,94,0); }
  100%{ box-shadow: 0 0 0  0   rgba(34,197,94,0); }
}

/* ── BLAZOR ERROR UI ── */
#blazor-error-ui {
  background: rgba(12,12,15,0.95);
  border-top: 1px solid rgba(239,68,68,0.4);
  bottom: 0; left: 0; right: 0; position: fixed;
  padding: 14px 20px;
  display: none; z-index: 9999;
  color: #f87171; font-size: 0.85rem;
  backdrop-filter: blur(12px);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 12px; color: var(--text-muted); }

/* ── BLAZOR ERROR BOUNDARY ── */
.blazor-error-boundary {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  color: #f87171; font-size: 0.85rem; margin: 1rem 0;
}
.blazor-error-boundary::after { content: "An error has occurred." display: block; }

/* ── FORM VALIDATION ── */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--accent); }
.invalid { outline: 1px solid #ef4444; }
.validation-message { color: #ef4444; font-size: 0.8rem; margin-top: 4px; }

/* ── SCAN-FILE: bbox overlays ── */
.scan-bbox-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}

.zoom-toolbar {
  display: flex; gap: 6px; margin-top: 8px;
}
.zoom-btn {
  padding: 4px 12px; font-size: 0.8rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.zoom-btn:hover    { background: rgba(255,255,255,0.12); border-color: var(--accent); }
.zoom-btn-active   { background: rgba(250,204,21,0.18) !important; border-color: var(--accent) !important; color: var(--accent); }
.zoom-btn-danger   { border-color: #ef4444; color: #ef4444; }
.zoom-btn-danger:hover { background: rgba(239,68,68,0.15) !important; }
.zoom-sep          { width: 1px; background: var(--border); align-self: stretch; margin: 0 2px; }

.word-input-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; font-size: .85rem;
}
.word-input {
  flex: 1; min-width: 160px; padding: 6px 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: .9rem;
}
.word-input:focus { outline: none; border-color: var(--accent); }

.analysis-container {
  position: relative; display: block;
  border-radius: 8px; overflow: hidden;
  background: #000; margin-top: 6px;
  max-height: 65vh;
}
.zoom-inner {
  /* transform applied by initZoomPan(); transform-origin set inline */
  will-change: transform;
  /* must be a positioned block so the absolute SVG is relative to it */
  position: relative; display: block;
}
.analysis-img {
  /* width:100% + height:auto keeps proportional scaling so imgScale = clientWidth/imgW is exact */
  display: block; width: 100%; height: auto;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.analysis-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.word-rect { cursor: pointer; }
.word-rect:hover { stroke-width: 6 !important; }

/* Show a grab cursor hint when hovering with Ctrl held */
.analysis-container:has(.zoom-inner) { cursor: default; }
@supports selector(:has(*)) {
  body.ctrl-held .analysis-container { cursor: grab; }
}

.word-callout {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 10px 14px; margin-top: 8px;
  background: var(--surface2); border-radius: 10px;
  font-size: 0.82rem;
}

/* ── SCAN-FILE: JSON + table ── */
.json-details summary::marker { color: var(--text-dim); }
.json-block {
  font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.72rem; line-height: 1.5;
  background: var(--surface2); color: var(--text-muted);
  border-radius: 8px; padding: 12px 14px;
  overflow-x: auto; white-space: pre; margin-top: 8px;
  max-height: 340px; overflow-y: auto;
}

.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.data-table th {
  text-align: left; padding: 7px 10px;
  color: var(--text-dim); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 7px 10px; border-bottom: 1px solid var(--border-soft); }
.data-table tbody tr:hover { background: var(--surface2); }
.data-table tbody tr.row-selected { background: var(--accent-dim); }

/* ── ADMIN PAGE ── */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.admin-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; margin-top: 2rem; }
.admin-header h2 { font-size: 1.2rem; font-weight: 600; color: var(--text); }

/* ── Admin tabs ──────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 2px; margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.admin-tabs::-webkit-scrollbar { height: 3px; }
.admin-tabs::-webkit-scrollbar-track { background: transparent; }
.admin-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.admin-tab {
    position: relative; padding: .55rem 1rem; font-size: .875rem; font-weight: 500;
    background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-muted); cursor: pointer; transition: color .15s;
    margin-bottom: -1px; white-space: nowrap; flex-shrink: 0;
}
.admin-tab:hover { color: var(--text); }
.admin-tab--active { color: var(--accent); border-bottom-color: var(--accent); }
.admin-tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px;
    font-size: .68rem; font-weight: 700; line-height: 1;
    background: var(--accent); color: #fff; border-radius: 8px;
    margin-left: 5px; vertical-align: middle;
}

/* ── Product graph ───────────────────────────────────────────────────────── */
#pg-container svg { display:block; }
#cg-container svg { display:block; }
.pg-nodes circle        { transition:opacity .2s,r .15s; }
.pg-nodes .pg-match     { stroke:#fff!important;stroke-width:2.5px!important; }
.pg-nodes .pg-focused   { stroke:#fff!important;stroke-width:3px!important;filter:drop-shadow(0 0 8px #ffffff80); }
.pg-nodes .pg-dimmed    { opacity:.12; }
.pg-nodes .pg-on-path   { opacity:.6; }
.pg-labels text         { transition:opacity .2s; }
.pg-labels .pg-dimmed   { opacity:.08; }
.pg-links line          { transition:opacity .2s; }
.pg-links .pg-dimmed    { opacity:.05; }

/* ── Grocery catalogue admin ─────────────────────────────────────────────── */
.cat-add-form {
  display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;
  background:var(--surface2);border:1px solid var(--border);border-radius:10px;
  padding:.75rem;margin-bottom:.75rem;
}
.cat-select { width:auto;flex-shrink:0; }
.cat-group { margin-bottom:1rem; }
.cat-group-header {
  font-size:.72rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  color:var(--text-muted);padding:.25rem 0 .4rem;border-bottom:1px solid var(--border);
  margin-bottom:.5rem;
}
.cat-type-row {
  display:flex;align-items:flex-start;gap:.6rem;padding:.3rem 0;
  border-bottom:1px solid rgba(255,255,255,.04);
}
.cat-type-row:last-child { border-bottom:none; }
.cat-type-name {
  min-width:110px;font-size:.8rem;font-weight:500;color:var(--text-muted);
  padding-top:3px;flex-shrink:0;
}
.cat-kw-chips { display:flex;flex-wrap:wrap;gap:.3rem; }
.cat-kw-chip {
  display:inline-flex;align-items:center;gap:3px;
  font-size:.75rem;border-radius:5px;padding:2px 6px;
}
.cat-kw-chip--w3 { background:rgba(34,197,94,.15);color:#4ade80; }
.cat-kw-chip--w2 { background:rgba(251,191,36,.12);color:#fbbf24; }
.cat-kw-chip--w1 { background:var(--surface2);color:var(--text-muted); }
.cat-kw-remove {
  background:none;border:none;cursor:pointer;padding:0;line-height:1;
  font-size:.9rem;opacity:.5;color:inherit;
}
.cat-kw-remove:hover { opacity:1; }
.admin-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table thead tr { background: var(--surface2); }
.admin-table th { padding: 10px 14px; text-align: left; color: var(--text-muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--surface2); }
.col-id   { color: var(--text-muted); width: 48px; }
.col-date { white-space: nowrap; color: var(--text-muted); }
.col-price { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.job-log { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-size: .78rem; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin-top: .5rem; color: var(--text); max-height: 320px; overflow-y: auto; }

/* ── YOLO LABELLING PAGE ── */
.yolo-progress-bar {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 8px;
}
.yolo-progress-counts { font-size: .9rem; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.yolo-progress-track {
  height: 6px; border-radius: 99px;
  background: var(--surface3); overflow: hidden;
}
.yolo-progress-fill {
  height: 100%; border-radius: 99px;
  background: var(--accent); transition: width .3s ease;
}
.yolo-progress-filename { font-size: .8rem; color: var(--text-muted); font-family: monospace; }

/* ── camera config overlay ──────────────────────────────────────────── */
.cfg-anchor {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.cfg-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer;
}
.cfg-btn:hover { color: var(--text); }
.cfg-btn:active { background: var(--surface3); }
.cfg-panel {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  z-index: 200;
  background: rgba(15,15,20,0.92);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 10px;
  min-width: 210px; backdrop-filter: blur(10px);
}
.cfg-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; cursor: pointer; user-select: none;
}
.cfg-label { font-size: 12px; color: #d1d5db; line-height: 1.3; }
.cfg-toggle {
  appearance: none; -webkit-appearance: none;
  width: 36px; height: 20px; border-radius: 10px;
  background: #374151; border: none; cursor: pointer;
  position: relative; flex-shrink: 0; transition: background .2s;
}
.cfg-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #9ca3af; transition: transform .2s, background .2s;
}
.cfg-toggle:checked { background: #2563eb; }
.cfg-toggle:checked::after { transform: translateX(16px); background: #fff; }

/* ── Tilbudsavis admin section ──────────────────────────────────────────── */
.tilbud-controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tilbud-chain-checks { display: flex; gap: 12px; align-items: center; }
.tilbud-schedule { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1rem; }
.tilbud-schedule-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface2); border-radius: var(--radius); padding: 8px 12px;
}
.tilbud-chain-label {
  width: 52px; font-weight: 600; text-transform: capitalize; font-size: .85rem;
}
.tilbud-select, .tilbud-input {
  background: var(--surface3); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 8px; font-size: .85rem;
}
.tilbud-status { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: .8rem; color: var(--text-muted); }
.badge-err { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }

/* ── Tilbudsavis page ────────────────────────────────────────────────────── */
/* ── SHOPPING LIST ── */
.sl-wrap { max-width: 540px; margin: 0 auto; padding-bottom: calc(var(--tab-h) + 40px); }
@media (min-width: 768px) { .sl-wrap { padding-bottom: 40px; } }

.sl-add-bar { display: flex; gap: 8px; margin-bottom: 12px; position: relative; }
.sl-input-wrap { flex: 1; position: relative; }
.sl-input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: .95rem;
  outline: none; transition: border-color .15s;
}
.sl-input:focus { border-color: rgba(34,197,94,.45); }
.sl-add-btn { flex-shrink: 0; }

.sl-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); z-index: 300;
  overflow: hidden; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.sl-drop-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; gap: 10px; background: none; border: none;
  color: var(--text); cursor: pointer; text-align: left;
  border-bottom: 1px solid var(--border-soft); transition: background .1s;
}
.sl-drop-item:last-child { border-bottom: none; }
.sl-drop-item:hover,
.sl-drop-item--hi { background: var(--surface2); }
.sl-drop-left { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sl-drop-name { font-size: .9rem; font-weight: 600; }
.sl-drop-meta { display: flex; align-items: center; gap: 4px; }
.sl-drop-label { font-size: .73rem; color: var(--text-muted); }
.sl-src-badge {
  font-size: .62rem; font-weight: 700; border-radius: 3px;
  padding: 0px 4px; flex-shrink: 0; white-space: nowrap; line-height: 1.6;
}
.sl-src-badge--tv { background: rgba(255,180,0,.15); color: #f59e0b; border: 1px solid rgba(255,180,0,.3); }
.sl-src-badge--ws { background: rgba(99,102,241,.15); color: #818cf8; border: 1px solid rgba(99,102,241,.3); }
.sl-drop-price { font-size: .82rem; color: var(--accent); font-weight: 700; flex-shrink: 0; }
.sl-drop-generic-tag {
  font-size: .68rem; font-weight: 700; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
  flex-shrink: 0; white-space: nowrap;
}

/* Price summary row */
.sl-price-summary {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px;
  margin-bottom: 8px; font-size: .8rem;
}
.sl-price-summary-best { font-size: .82rem; color: var(--text); }
.sl-price-summary-best strong { color: var(--accent); }
.sl-price-summary-meta { display: flex; align-items: center; color: var(--text-muted); font-size: .75rem; }

/* Inline dot (used in summary row) */
.sl-dot-inline {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 4px; flex-shrink: 0;
  vertical-align: middle;
}
.sl-dot-inline--has  { background: var(--accent); }
.sl-dot-inline--none { background: var(--muted-dot); }

/* Discrete price-availability dot on each list item */
.sl-item-name-row { display: flex; align-items: flex-start; gap: 5px; }
.sl-price-dot {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.sl-price-dot--has  { background: var(--accent); opacity: .7; }
.sl-price-dot--none { background: var(--muted-dot); }

/* Chain cost comparison bar */
.sl-chain-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 16px;
}
.sl-chain-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 10px 10px 8px;
  display: flex; flex-direction: column; gap: 2px; text-align: center;
  position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.sl-chain-card--best {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.05);
}
.sl-chain-name {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
}
.sl-chain-total {
  font-size: 1.05rem; font-weight: 800;
  color: var(--text); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sl-chain-card--best .sl-chain-total { color: var(--accent); }
.sl-chain-extra { color: var(--text-muted); font-size:.9rem; }
.sl-chain-coverage { font-size: .65rem; color: var(--text-dim); }
/* Selected / filtered chain card */
.sl-chain-card--sel {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(9,105,218,.25);
}
.sl-chain-sel-badge {
  position: absolute; top: -7px; right: 6px;
  font-size: .62rem; font-weight: 900; color: var(--accent);
}
/* Compare button next to chain cards */
.sl-chain-compare-btn {
  background: none; border: 1px solid var(--border-soft);
  border-radius: 8px; padding: 4px 9px; font-size: .88rem;
  cursor: pointer; color: var(--text-muted); align-self: center;
  flex-shrink: 0; transition: background .12s, color .12s;
}
.sl-chain-compare-btn:hover { background: var(--surface2); color: var(--text); }
.sl-chain-badge {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #000; font-size: .6rem; font-weight: 900;
  padding: 1px 6px; border-radius: 100px; white-space: nowrap; letter-spacing: .04em;
}

.sl-toprow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.sl-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.sl-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px; margin-bottom: 8px;
}
.sl-count { font-size: .8rem; color: var(--text-muted); }
.sl-clear-btn {
  font-size: .78rem; color: var(--text-muted); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 6px; transition: color .15s;
}
.sl-clear-btn:hover { color: var(--text); }

.sl-group-label {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim);
  padding: 14px 2px 6px; margin-top: 4px;
}

.sl-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }

.sl-item-wrap { display: flex; flex-direction: column; }
.sl-item-wrap--draggable { cursor: grab; }
.sl-item-wrap--draggable:active { cursor: grabbing; }
.sl-item-wrap--dragging > .sl-item { opacity: .35; }
.sl-item-wrap--dragover { border-top: 2px solid var(--accent); margin-top: -2px; }

.sl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-soft);
  transition: opacity .2s;
}
.sl-item-wrap:has(.sl-alt-panel) .sl-item {
  border-bottom-left-radius: 0; border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.sl-item--done { opacity: .45; }

/* "Se priser" tag button */
.sl-prices-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 100px; font-size: .72rem; font-weight: 700;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(34,197,94,.25); cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.sl-prices-btn:hover, .sl-prices-btn--open { background: rgba(34,197,94,.22); }

/* Inline alternatives panel */
.sl-alt-panel {
  background: var(--surface2); border: 1px solid var(--border-soft);
  border-top: none; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius);
  overflow: hidden;
}
.sl-alt-header {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim);
  padding: 8px 14px 4px;
}
.sl-alt-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; background: none; border: none; border-top: 1px solid var(--border-soft);
  color: var(--text); cursor: pointer; text-align: left; gap: 10px;
  transition: background .12s;
}
.sl-alt-row:hover { background: var(--surface3); }
.sl-alt-left { display: flex; flex-direction: column; gap: 1px; }
.sl-alt-name { font-size: .88rem; font-weight: 600; }
.sl-alt-store { font-size: .73rem; color: var(--text-muted); }
.sl-alt-price { font-size: .95rem; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.sl-alt-keep {
  width: 100%; padding: 9px 14px; background: none; border: none;
  border-top: 1px solid var(--border-soft); color: var(--text-dim);
  font-size: .78rem; cursor: pointer; text-align: left; transition: color .12s;
}
.sl-alt-keep:hover { color: var(--text-muted); }
.sl-alt-empty {
  padding: 10px 14px; font-size: .82rem; color: var(--text-muted);
  border-top: 1px solid var(--border-soft); font-style: italic;
}
.sl-alt-generic {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; background: none; border: none;
  border-top: 1px solid var(--border-soft); color: var(--text-muted);
  font-size: .83rem; font-weight: 600; cursor: pointer; text-align: left;
  transition: color .12s, background .12s;
}
.sl-alt-generic:hover { color: var(--text); background: var(--surface3); }
.sl-alt-generic svg { flex-shrink: 0; opacity: .7; }
.sl-alt-generic-sub {
  margin-left: auto; font-size: .7rem; font-weight: 400;
  color: var(--text-dim); white-space: nowrap;
}

/* Offer table inside the alternatives panel */
.sl-alt-table { border-top: 1px solid var(--border-soft); }
.sl-alt-table-row {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border-soft);
}
.sl-alt-table-pick {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: none; border: none; cursor: pointer;
  color: var(--text); text-align: left; min-width: 0;
  transition: background .12s;
}
.sl-alt-table-pick:hover { background: var(--surface3); }
.sl-alt-table-name {
  flex: 1; font-size: .88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sl-alt-table-price {
  font-size: .9rem; font-weight: 800; color: var(--accent); flex-shrink: 0;
}
.sl-alt-table-chain {
  font-size: .68rem; font-weight: 700; border-radius: 4px;
  padding: 1px 5px; flex-shrink: 0; white-space: nowrap;
  background: rgba(255,255,255,.08); color: var(--text-muted);
}
/* Per-chain chain colors */
.sl-chain--kiwi  { background: rgba(255,90,0,.15); color: #fb923c; }
.sl-chain--meny  { background: rgba(16,185,129,.12); color: #34d399; }
.sl-chain--rema  { background: rgba(239,68,68,.12); color: #f87171; }
.sl-chain--coop  { background: rgba(99,102,241,.12); color: #818cf8; }

/* Image icon button on each table row */
.sl-alt-img-btn {
  flex-shrink: 0; padding: 9px 10px;
  background: none; border: none; border-left: 1px solid var(--border-soft);
  color: #f59e0b; cursor: pointer; display: flex; align-items: center;
  transition: background .12s, color .12s; align-self: stretch;
}
.sl-alt-img-btn:hover { background: rgba(245,158,11,.12); color: #fbbf24; }

/* Offer image thumbnail (inline in item row) */
.sl-offer-thumb {
  flex-shrink: 0; width: 38px; height: 38px;
  border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; padding: 0; background: var(--surface2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.sl-offer-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Offer image modal */
.sl-offer-modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.82); display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.sl-offer-modal {
  position: relative; max-width: min(600px, 100%);
  max-height: 90dvh; border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.sl-offer-modal img {
  display: block; width: 100%; height: auto;
  max-height: 90dvh; object-fit: contain;
}
.sl-offer-modal-close {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.55); border: none; border-radius: 50%;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; transition: background .15s;
}
.sl-offer-modal-close:hover { background: rgba(0,0,0,.8); }


/* Chain-specific indicator badge — sits on its own line below the item name */
.sl-chain-specific-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .62rem; font-weight: 700; border-radius: 4px;
  padding: 1px 6px; background: rgba(99,102,241,.15);
  color: #818cf8; border: 1px solid rgba(99,102,241,.25);
  line-height: 1.7; margin-top: 3px;
}
/* Price shown inside the chain-specific badge when single chain */
.sl-cspec-price {
  font-weight: 700; color: #6366f1; opacity: .85; font-size: .6rem;
}
/* Item name dimmed when chain filter active and item not in chain */
.sl-item-name--dimmed { opacity: .38; }

/* Chain filter row inside the alternatives panel */
.sl-chain-filter-row {
  display: flex; gap: 6px; padding: 10px 12px 6px; flex-wrap: wrap;
}
.sl-chain-pill {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface3); cursor: pointer;
  transition: border-color .15s, background .15s; min-width: 52px;
}
.sl-chain-pill:hover { border-color: var(--accent); }
.sl-chain-pill--active {
  border-color: var(--accent); background: rgba(99,102,241,.15);
}
.sl-chain-pill--missing { opacity: .65; }
.sl-chain-pill--missing:hover { border-color: #f59e0b; opacity: 1; }
.sl-chain-pill-name { font-size: .68rem; font-weight: 700; color: var(--text-muted); }
.sl-chain-pill-price { font-size: .82rem; font-weight: 800; color: var(--accent); }
.sl-chain-pill-price--none { color: var(--text-dim); font-weight: 400; }

.sl-check {
  background: none; border: none; cursor: pointer;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  padding: 2px; color: var(--text-dim);
}
.sl-item-body { flex: 1; min-width: 0; }
.sl-item-name {
  font-size: .9rem; font-weight: 600;
  flex: 1; min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.sl-item--done .sl-item-name { text-decoration: line-through; }
.sl-item-sublabel { font-size: .72rem; color: var(--text-dim); display: block; margin-top: 1px; }
.sl-item-hint { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .75rem; color: rgba(34,197,94,.65); }
.sl-item-meta { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.sl-item-meta span { font-size: .75rem; color: var(--text-muted); }
.sl-item-offer-price {
  font-size: .92rem !important; font-weight: 700;
  color: var(--accent) !important; letter-spacing: -.01em;
}
.sl-item-store {
  background: var(--surface3); border-radius: 4px;
  padding: 1px 5px; font-size: .7rem; color: var(--text-muted);
}
/* Quantity stepper */
.sl-stepper {
  display: flex; align-items: center; gap: 0; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.sl-step-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); transition: background .12s, color .12s;
  flex-shrink: 0;
}
.sl-step-btn:hover { background: var(--surface2); color: var(--text); }
.sl-step-btn--del:hover { color: #f87171; background: rgba(248,113,113,.08); }
.sl-step-qty {
  min-width: 26px; text-align: center;
  font-size: .88rem; font-weight: 700; color: var(--text);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  line-height: 32px;
}

/* ── TILBUDSAVIS ── */
.tilbud-page-header {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 1rem;
}
.tilbud-page-title { font-size: 1.3rem; font-weight: 800; margin: 0; }
.tilbud-validity-label { font-size: .82rem; color: var(--text-muted); }
.tilbud-filters {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 1.5rem;
}

/* Category sections */
.tilbud-category-section { margin-bottom: 2rem; }
.tilbud-category-row {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .75rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.tilbud-category-header {
  font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-dim);
  margin: 0; flex: 1;
}
.tilbud-expand-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; color: var(--accent);
  background: none; border: none; cursor: pointer; padding: 2px 0;
  white-space: nowrap; opacity: .8;
}
.tilbud-expand-btn:hover { opacity: 1; }

/* Add-to-list button on offer card */
.tilbud-offer-card { position: relative; }
.tilbud-add-btn {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%; border: none;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.tilbud-offer-card:hover .tilbud-add-btn { opacity: 1; }
.tilbud-add-btn:hover { filter: brightness(1.15); }

/* Toast */
.tilbud-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: .85rem; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  z-index: 300; white-space: nowrap;
  animation: fadeIn .2s ease;
}

/* Offer grid */
.tilbud-offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.tilbud-offer-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.tilbud-offer-card--clickable { cursor: pointer; }
.tilbud-offer-card--clickable:hover {
  border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent);
}

/* Offer image */
.tilbud-offer-img-wrap {
  width: 100%; aspect-ratio: 1; overflow: hidden;
  background: var(--surface2); flex-shrink: 0;
}
.tilbud-offer-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tilbud-offer-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 900; color: var(--accent); opacity: .35;
}

/* Offer body */
.tilbud-offer-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }
.tilbud-offer-name {
  font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tilbud-offer-price { display: flex; align-items: baseline; flex-wrap: wrap; }
.tilbud-price-value { font-size: 1.1rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.tilbud-price-kr { font-size: .75rem; color: var(--text-muted); margin-left: 2px; }
.tilbud-price-unit { font-size: .7rem; color: var(--text-muted); }
.tilbud-price-currency { font-size: .78rem; color: var(--text-muted); }
.tilbud-offer-chain {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-dim); margin-top: 2px;
}

/* Legacy campaign view kept for admin use */
.tilbud-campaign {
  margin-bottom: 2rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.tilbud-campaign-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.tilbud-chain-badge {
  font-size: .78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent);
}
.tilbud-validity { font-size: .8rem; color: var(--text-muted); }

/* Offer detail modal */
.tilbud-modal {
  max-width: 420px; width: 100%; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
  max-height: 90vh;
}
.tilbud-modal-img-wrap {
  background: var(--surface3); width: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; max-height: 260px; overflow: hidden;
}
.tilbud-modal-img { width: 100%; max-height: 260px; object-fit: contain; display: block; }
.tilbud-modal-body { padding: 1.25rem 1.25rem 1.5rem; overflow-y: auto; }
.tilbud-modal-name { font-size: 1.1rem; font-weight: 700; margin: 0 0 .5rem; }
.tilbud-modal-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: .4rem; }
.tilbud-modal-validity { font-size: .82rem; color: var(--text-muted); }
.text-muted { color: var(--text-muted); }

/* ── Middagsplanlegger ───────────────────────────────────────────────────── */
.mp-page { padding-bottom: calc(var(--tab-h) + 90px); }

.mp-household {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: .75rem; font-size: .82rem; color: var(--text-muted);
}
.mp-household-label { display: flex; align-items: center; font-weight: 600; }
.mp-household-group { display: flex; align-items: center; gap: .35rem; }
.mp-household-sublabel { font-size: .78rem; opacity: .75; }
.mp-count-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface2, var(--surface)); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem; line-height: 1; padding: 0; transition: background .15s;
}
.mp-count-btn:hover:not(:disabled) { background: var(--accent-light, #e8f4fd); }
.mp-count-btn:disabled { opacity: .35; cursor: default; }
.mp-count-val { min-width: 1.4em; text-align: center; font-weight: 600; font-size: .9rem; }
.mp-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.mp-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 .2rem; }
.mp-subtitle { font-size: .82rem; color: var(--text-muted); margin: 0; }
.mp-surprise-btn { white-space: nowrap; flex-shrink: 0; }

/* ── Week calendar strip ── */
.mp-calendar {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 6px; margin-bottom: 1.5rem;
  scrollbar-width: none;
}
.mp-calendar::-webkit-scrollbar { display: none; }

/* ── Week templates strip ── */
.mp-tpl-section-label {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  margin: 1rem 0 .5rem;
}
.mp-templates {
  display: flex; gap: 10px; overflow: hidden; padding: 2px 0 4px;
  scrollbar-width: none;
}
.mp-templates::-webkit-scrollbar { display: none; }
.mp-tpl-card {
  flex-shrink: 0; width: 154px; padding: 11px 12px 12px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.mp-tpl-card:hover { border-color: rgba(34,197,94,.55); }
.mp-tpl-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34,197,94,.25);
  background: rgba(34,197,94,.04);
}
.mp-tpl-title {
  font-size: .82rem; font-weight: 700; color: var(--text);
  line-height: 1.25;
}
.mp-tpl-price {
  font-size: .72rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.mp-tpl-days { display: flex; flex-direction: column; gap: 2px; }
.mp-tpl-day  { display: flex; gap: 5px; align-items: baseline; }
.mp-tpl-day-abbr {
  font-size: .67rem; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; width: 22px; line-height: 1.6;
}
.mp-tpl-day-recipe {
  font-size: .7rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 104px;
}
.mp-tpl-day-missing { font-size: .7rem; opacity: .35; color: var(--text-muted); }

/* ── Template carousel navigation ── */
.mp-tpl-carousel {
  display: flex; align-items: flex-start; gap: 6px;
}
.mp-tpl-carousel .mp-templates {
  flex: 1; overflow: hidden;
}
.mp-tpl-nav {
  flex-shrink: 0; margin-top: 2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface2); border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.mp-tpl-nav:hover:not(:disabled) {
  background: var(--surface3);
  border-color: rgba(34,197,94,.4);
  color: var(--accent);
}
.mp-tpl-nav:disabled { opacity: .25; cursor: default; }
.mp-tpl-dots {
  display: flex; justify-content: center; gap: 7px;
  margin-top: 10px;
}
.mp-tpl-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--surface3); cursor: pointer;
  transition: background .15s, transform .15s;
}
.mp-tpl-dot--active {
  background: var(--accent); transform: scale(1.2);
}

.mp-day-cell {
  flex: 0 0 auto; width: 100px;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 0 8px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer; overflow: hidden;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
  user-select: none;
}
.mp-day-cell:hover { border-color: var(--accent); }
.mp-day-cell--active {
  border-color: var(--accent); background: rgba(34,197,94,.06);
  box-shadow: 0 0 0 1px var(--accent);
}
.mp-day-cell--has { border-color: rgba(34,197,94,.5); }
.mp-day-cell--active.mp-day-cell--has { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mp-day-cell--has { cursor: grab; -webkit-touch-callout: none; user-select: none; }
.mp-day-cell--has:active { cursor: grabbing; }
.mp-day-cell--dragging { opacity: 0; cursor: grabbing; }
.mp-day-cell--drag-over {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(34,197,94,.4) !important;
  background: rgba(34,197,94,.08) !important;
}

.mp-day-header-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 6px 6px 4px;
}
.mp-day-abbr {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.mp-day-abbr--today { color: var(--accent); }

.mp-day-img {
  width: 100%; aspect-ratio: 1;
  object-fit: contain; background: var(--surface2);
}
.mp-day-img--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
}
/* Prevent browser's native image drag from hijacking our pointer-event drag */
.mp-day-cell img { -webkit-user-drag: none; pointer-events: none; }

.mp-day-recipe-body {
  display: flex; flex-direction: column; align-items: center; width: 100%;
  cursor: pointer;
}
.mp-day-recipe-body:hover .mp-day-recipe-name { color: var(--accent); }

.mp-day-recipe-name {
  font-size: .68rem; font-weight: 600; color: var(--text);
  text-align: center; line-height: 1.25;
  padding: 5px 6px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .12s;
}
.mp-day-price {
  font-size: .63rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; margin-top: 3px;
}

.mp-day-empty-slot {
  flex: 1; display: flex; align-items: center; justify-content: center;
  height: 60px; color: var(--border);
}

.mp-day-clear {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s; color: var(--text-muted);
}
.mp-day-cell:hover .mp-day-clear,
.mp-day-cell--has .mp-day-clear { opacity: .7; }
.mp-day-clear:hover { opacity: 1 !important; }

/* ── Picker label ── */
.mp-picker-label {
  font-size: .85rem; color: var(--text-muted);
  margin-bottom: .75rem;
}
.mp-picker-label strong { color: var(--text); }
.mp-current-recipe { color: var(--accent); font-size: .78rem; }
.mp-spinner { display: flex; justify-content: center; padding: 3rem 0; }

/* ── Recipe card list ── */
.mp-recipe-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 1rem; }
.mp-recipe-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px;
  transition: border-color .15s;
}
.mp-recipe-card--active { border-color: var(--accent); background: rgba(34,197,94,.04); }
.mp-recipe-card--used { opacity: .45; }
.mp-recipe-card--used .mp-recipe-card-title { text-decoration: line-through; }

.mp-recipe-card-imgs {
  display: flex; gap: 4px; flex-shrink: 0;
}
.mp-rc-thumb {
  width: 44px; height: 44px; border-radius: 6px;
  object-fit: contain; background: var(--surface2);
}
.mp-rc-thumb--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
}

.mp-recipe-card-body { flex: 1; min-width: 0; }
.mp-recipe-card-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 4px;
}
.mp-rc-price { font-size: .75rem; font-weight: 700; color: var(--accent); }
.mp-rc-used-badge {
  font-size: .65rem; font-weight: 700; padding: 1px 5px;
  background: rgba(34,197,94,.15); color: var(--accent);
  border-radius: 4px;
}
.mp-recipe-card-title {
  font-size: .88rem; font-weight: 700; margin: 0 0 2px; color: var(--text);
}
.mp-rc-portions {
  display: flex; flex-wrap: wrap; gap: .3rem .6rem;
  margin: .3rem 0 .2rem; font-size: .72rem; color: var(--text-muted);
}
.mp-rc-portion-item b { color: var(--text); font-weight: 600; }
.mp-modal-persons-badge {
  display: flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 600; color: var(--accent);
  margin-bottom: .75rem;
}
.mp-recipe-card-desc {
  font-size: .75rem; color: var(--text-muted); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.mp-assign-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: 8px;
  font-size: .78rem; font-weight: 700;
  background: var(--surface2); border: 1.5px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.mp-assign-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.mp-assign-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Recipe detail modal ─────────────────────────────────────────────────── */
.mp-recipe-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: min(480px, 94vw);
  max-height: 90dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.mp-recipe-modal-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mp-recipe-modal-title {
  font-size: 1.05rem; font-weight: 800; margin: 0;
}
.mp-recipe-modal-desc {
  font-size: .82rem; color: var(--text-muted); margin: 4px 0 0;
  line-height: 1.5;
}
.mp-recipe-modal-imgs {
  display: flex; gap: 6px; padding: 12px 18px;
  background: var(--surface2); flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none;
}
.mp-recipe-modal-imgs::-webkit-scrollbar { display: none; }
.mp-recipe-modal-img {
  width: 60px; height: 60px; border-radius: 8px; flex-shrink: 0;
  object-fit: contain; background: var(--surface3);
}
.mp-recipe-modal-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 0;
}
.mp-recipe-modal-ings {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
  margin: 0; padding: 0;
}
.mp-recipe-modal-ing {
  display: flex; align-items: center; gap: 10px; font-size: .88rem;
}
.mp-recipe-modal-ing-img {
  width: 34px; height: 34px; border-radius: 6px; flex-shrink: 0;
  object-fit: cover; background: var(--surface2);
}
.mp-recipe-modal-ing-placeholder {
  background: var(--surface2);
}
.mp-recipe-modal-ing-name { flex: 1; }
.mp-recipe-modal-ing-qty  { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }
.mp-recipe-modal-ing-price {
  color: var(--accent); font-weight: 700; font-size: .8rem;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: .25rem;
}
.mp-recipe-modal-ing-price-detail {
  color: var(--text-muted); font-weight: 400; font-size: .75rem;
}
.mp-recipe-modal-instructions {
  border-top: 1px solid var(--border); margin-top: 16px; padding-top: 14px;
}
.mp-recipe-modal-instructions-label {
  font-size: .68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); margin-bottom: 8px;
}
.mp-recipe-modal-instructions p {
  font-size: .85rem; line-height: 1.65; white-space: pre-line;
  margin: 0; color: var(--text-muted);
}
.mp-recipe-modal-footer {
  display: flex; gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Sticky bottom bar ── */
.mp-bottom-bar {
  position: fixed; bottom: var(--tab-h); left: 0; right: 0;
  display: flex; align-items: center; gap: .75rem;
  padding: 12px 16px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
@media (min-width: 768px) { .mp-bottom-bar { bottom: 0; } }
.mp-progress-dots { display: flex; gap: 5px; flex-shrink: 0; }
.mp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--border); transition: background .15s;
}
.mp-dot--filled { background: var(--accent); }
.mp-dot--active { box-shadow: 0 0 0 2px rgba(34,197,94,.4); }
.mp-create-btn { flex: 1; }
.mp-create-count { opacity: .75; font-size: .78rem; margin-left: 5px; }

/* ── AI planleggingsassistent ──────────────────────────────────────────────── */
.mp-ai-section {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin-bottom: 20px;
}
.mp-ai-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.mp-ai-icon { color: var(--accent); flex-shrink: 0; }
.mp-ai-title {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  flex: 1;
}
.mp-ai-clear-btn {
  background: none;
  border: none;
  font-size: .73rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
}
.mp-ai-clear-btn:hover { color: var(--text-muted); background: var(--surface2); }

.mp-ai-hint {
  font-size: .83rem;
  color: var(--text-dim);
  margin: 0 0 8px;
  line-height: 1.55;
}
.mp-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.mp-ai-suggestion-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: .78rem;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.mp-ai-suggestion-chip:hover {
  background: var(--accent-dim);
  border-color: rgba(34,197,94,.35);
  color: var(--accent);
}

/* scrollable thread */
.mp-ai-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 2px;
  scroll-behavior: smooth;
}
.mp-ai-thread::-webkit-scrollbar { width: 3px; }
.mp-ai-thread::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 2px; }

/* individual messages */
.mp-ai-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 11px;
  font-size: .85rem;
  line-height: 1.5;
}
.mp-ai-msg--user {
  align-self: flex-end;
  background: var(--accent-dim);
  border: 1px solid rgba(34,197,94,.22);
  color: var(--text);
}
.mp-ai-msg--assistant {
  align-self: flex-start;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.mp-ai-msg-text { margin: 0; }

/* typing indicator */
.mp-ai-msg--thinking {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 10px 14px;
}
.mp-ai-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: mp-ai-bounce .9s infinite ease-in-out;
}
.mp-ai-dot:nth-child(2) { animation-delay: .16s; }
.mp-ai-dot:nth-child(3) { animation-delay: .32s; }
@keyframes mp-ai-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: .35; }
  40%           { transform: translateY(-5px); opacity: 1;   }
}

/* action buttons */
.mp-ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mp-ai-action-btn {
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 11px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  line-height: 1.4;
}
.mp-ai-action-btn:hover:not(:disabled) {
  background: var(--accent-dim);
  border-color: rgba(34,197,94,.4);
  color: var(--accent);
}
.mp-ai-action-btn--done {
  background: var(--accent-dim);
  border-color: rgba(34,197,94,.5);
  color: var(--accent);
  opacity: .75;
  cursor: default;
}

/* input row */
.mp-ai-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}
.mp-ai-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .88rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color .15s;
  min-width: 0;
}
.mp-ai-input:focus { border-color: rgba(34,197,94,.5); }
.mp-ai-input::placeholder { color: var(--text-dim); }
.mp-ai-input:disabled { opacity: .5; }
.mp-ai-send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .12s, box-shadow .12s;
}
.mp-ai-send-btn:hover:not(:disabled) { box-shadow: 0 0 16px var(--accent-glow); }
.mp-ai-send-btn:disabled { opacity: .35; cursor: default; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-wrap {
  max-width: 400px; margin: 3rem auto; padding: 0 1.5rem;
}
.auth-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem;
}
.auth-field {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem;
}
.auth-field label {
  font-size: .85rem; font-weight: 600; color: var(--text-muted);
}
.auth-field input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; font-size: 1rem;
  color: var(--text); outline: none; width: 100%; box-sizing: border-box;
}
.auth-field input:focus { border-color: var(--accent); }
.auth-submit { width: 100%; margin-top: .5rem; }
.auth-error {
  background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3);
  border-radius: 8px; color: #f87171; padding: 10px 14px;
  font-size: .88rem; margin-bottom: 1rem;
}
.auth-hint {
  font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem;
}
.auth-alt {
  margin-top: 1.25rem; font-size: .88rem; color: var(--text-muted); text-align: center;
}
.auth-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-terms { display: flex; align-items: flex-start; gap: 10px; margin: .75rem 0 .25rem; cursor: pointer; }
.auth-terms input[type="checkbox"] { margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.auth-terms span { font-size: .88rem; color: var(--text-muted); line-height: 1.45; }
.auth-terms-link { background: none; border: none; padding: 0; color: var(--accent); font-size: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.auth-terms-link:hover { opacity: .85; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--text-muted); font-size: .82rem; margin: .25rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-passkey-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Terms modal */
.terms-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.terms-modal { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; }
.terms-header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.terms-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; border-radius: 6px; }
.terms-close:hover { background: var(--surface3); color: var(--text); }
.terms-body { overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.terms-updated { font-size: .78rem; color: var(--text-dim); }
.terms-body h4 { font-size: .88rem; font-weight: 700; color: var(--text); margin-top: .25rem; }
.terms-body p { font-size: .84rem; color: var(--text-muted); line-height: 1.6; }
.terms-footer { padding: .9rem 1.25rem; border-top: 1px solid var(--border); flex-shrink: 0; }
.sl-page-title { font-size:1.1rem;font-weight:700;padding:1rem 1rem .25rem;margin:0;color:var(--text); }

/* ── User management (admin) ─────────────────────────────────────────────── */
.user-reset-box {
  display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
  background:rgba(99,102,241,.1);border:1px solid rgba(99,102,241,.3);
  border-radius:8px;padding:10px 14px;margin-bottom:1rem;font-size:.88rem;
}
.user-temp-pw {
  background:rgba(0,0,0,.3);border-radius:4px;padding:2px 8px;
  font-family:monospace;font-size:.95rem;letter-spacing:.04em;color:var(--accent);
  user-select:all;
}

.nav-drawer-email {
  display: block;
  padding: 10px 16px 4px;
  font-size: .78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}
a.nav-drawer-email:hover { color: var(--text); }

/* ── Privacy / Personvern cards ─────────────────────────────────────────── */
.privacy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.privacy-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.privacy-icon { opacity: .7; flex-shrink: 0; }
.privacy-summary {
  font-size: .83rem;
  color: var(--text-muted);
  margin: 0 0 6px;
  line-height: 1.45;
}
.privacy-retention {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--text-muted);
  opacity: .8;
}
.privacy-basis-badge {
  margin-left: auto;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 500;
}
.privacy-basis-contract            { background: rgba(39,174,96,.12);  color: #27ae60; }
.privacy-basis-consent             { background: rgba(52,152,219,.12); color: #2980b9; }
.privacy-basis-legitimate-interest { background: rgba(243,156,18,.12); color: #d68910; }
.privacy-third-parties {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.privacy-third-party-row {
  display: flex;
  gap: 10px;
  font-size: .82rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.privacy-third-party-row:last-child { border-bottom: none; }
.privacy-tp-name    { font-weight: 600; min-width: 110px; }
.privacy-tp-purpose { color: var(--text-muted); }

/* ── Innsyn (data access) blocks ────────────────────────────────────────── */
.innsyn-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.innsyn-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
.innsyn-summary::-webkit-details-marker { display: none; }
.innsyn-summary::after {
  content: "›";
  margin-left: auto;
  opacity: .4;
  font-size: 1.1em;
  transition: transform .15s;
}
details[open] > .innsyn-summary::after { transform: rotate(90deg); }
.innsyn-badge {
  background: var(--accent, #3498db);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}
.innsyn-body {
  padding: 0 14px 10px;
  font-size: .82rem;
}
.innsyn-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
}
.innsyn-row:last-child { border-bottom: none; }
.innsyn-row > span:first-child { color: var(--text-muted); min-width: 110px; }
.innsyn-status {
  font-size: .72rem;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--border);
}
.innsyn-status--ok  { background: rgba(39,174,96,.15);  color: #27ae60; }
.innsyn-status--err { background: rgba(192,57,43,.15);  color: #c0392b; }

/* ── Delete-account notice ───────────────────────────────────────────────── */
.delete-notice {
  display: flex;
  gap: 10px;
  background: rgba(52,152,219,.08);
  border: 1px solid rgba(52,152,219,.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .85rem;
  line-height: 1.5;
  color: var(--text);
}
.delete-notice--warn {
  background: rgba(192,57,43,.08);
  border-color: rgba(192,57,43,.25);
}

/* ── Lists overview ──────────────────────────────────────────────────────── */
.sl-new-bar {
  display:flex;flex-wrap:wrap;gap:.6rem;padding:.75rem 1rem 1rem;
}

.sl-list-cards { display:flex;flex-direction:column;gap:.5rem;padding:0 1rem .75rem; }
.sl-show-more {
  display:block;width:calc(100% - 2rem);margin:0 1rem 2rem;
  padding:.65rem;border-radius:var(--radius);border:1px solid var(--border);
  background:var(--surface2);color:var(--text-muted);font-size:.85rem;
  cursor:pointer;text-align:center;
}
.sl-show-more:hover { background:var(--surface3); color:var(--text); }

.sl-list-card {
  display:flex;align-items:center;gap:.5rem;
  background:var(--surface2);border:1px solid var(--border);border-radius:10px;
  padding:12px 14px;cursor:pointer;
  box-shadow: var(--card-shine);
  transition:border-color .15s, box-shadow .15s;
}
.sl-list-card:hover { border-color:var(--accent); box-shadow: var(--card-shine), 0 4px 16px rgba(0,0,0,.3); }
.sl-list-card--done .sl-list-card-name { text-decoration:line-through;opacity:.5; }

.sl-list-card-body { flex:1;display:flex;flex-direction:column;gap:2px; }
.sl-list-card-name-row { display:flex;align-items:center;gap:.5rem;flex-wrap:wrap; }
.sl-list-card-name { font-size:.95rem;font-weight:600;color:var(--text); }
.sl-list-card-meta { font-size:.78rem;color:var(--text-muted); }
.sl-list-emoji { font-size:.95rem;line-height:1.2;display:block;margin-bottom:1px; }
.sl-share-badge {
  display:inline-flex;align-items:center;gap:3px;
  font-size:.68rem;font-weight:500;color:var(--accent);
  background:var(--accent-dim);border-radius:4px;padding:1px 5px;
}

.sl-list-card-del {
  flex-shrink:0;width:28px;height:28px;border:none;background:transparent;
  color:var(--text-muted);cursor:pointer;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s,color .15s;
}
.sl-list-card-del:hover { background:rgba(248,113,113,.15);color:#f87171; }

/* ── Templates ────────────────────────────────────────────────────────────── */
.sl-section-title {
  font-size:.78rem;font-weight:600;color:var(--text-muted);letter-spacing:.04em;
  text-transform:uppercase;padding:.75rem 1rem .25rem;margin:0;
}
.sl-list-card--template { border-color:rgba(99,102,241,.3); }
.sl-list-card--template:hover { border-color:#818cf8; }

.sl-template-badge {
  font-size:.62rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  background:rgba(99,102,241,.15);color:#818cf8;border:1px solid rgba(99,102,241,.3);
  border-radius:4px;padding:1px 5px;flex-shrink:0;
}
.sl-template-use-btn {
  flex-shrink:0;display:flex;align-items:center;gap:4px;
  padding:4px 10px;border:1px solid rgba(99,102,241,.4);border-radius:6px;
  background:rgba(99,102,241,.1);color:#818cf8;font-size:.75rem;font-weight:600;
  cursor:pointer;transition:background .15s,border-color .15s;white-space:nowrap;
}
.sl-template-use-btn:hover { background:rgba(99,102,241,.2);border-color:#818cf8; }

.sl-drop-item--template { border-top:1px solid var(--border); }
.sl-drop-template-tag {
  font-size:.72rem;font-weight:700;color:#818cf8;
  background:rgba(99,102,241,.12);border:1px solid rgba(99,102,241,.25);
  border-radius:4px;padding:2px 7px;flex-shrink:0;
}

/* ── List detail header ───────────────────────────────────────────────────── */
.sl-detail-header {
  display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem .25rem;
}
.sl-back-btn {
  flex-shrink:0;width:32px;height:32px;border:none;background:transparent;
  color:var(--text-muted);cursor:pointer;border-radius:8px;
  display:flex;align-items:center;justify-content:center;
  transition:background .15s,color .15s;
}
.sl-back-btn:hover { background:var(--surface2);color:var(--text); }
.sl-detail-title { font-size:1.1rem;font-weight:700;margin:0;flex:1; }
.sl-share-btn {
  display:inline-flex;align-items:center;gap:5px;
  background:var(--surface2);border:1px solid var(--border);border-radius:8px;
  padding:6px 12px;font-size:.8rem;font-weight:500;color:var(--text-muted);
  cursor:pointer;transition:border-color .15s,color .15s;white-space:nowrap;
}
.sl-share-btn:hover { border-color:var(--accent);color:var(--accent); }

.sl-scan-ai-btn { border-color:rgba(139,92,246,.35);color:#8b5cf6; }
.sl-scan-ai-btn:hover { border-color:#8b5cf6;color:#8b5cf6;background:rgba(139,92,246,.08); }

.sl-scan-ai-icon {
  position:relative;display:inline-flex;align-items:center;
}
.sl-sparkle {
  position:absolute;top:-5px;right:-5px;
  color:#f59e0b;
  animation:sparkle-pulse 2.4s ease-in-out infinite;
}
@keyframes sparkle-pulse {
  0%,100% { transform:scale(1) rotate(0deg);  opacity:1;   }
  50%      { transform:scale(1.4) rotate(20deg); opacity:.7; }
}

.sl-pairing-bar {
  display:flex;align-items:center;gap:.4rem;
  background:var(--accent-dim);border-radius:8px;
  padding:.45rem .75rem;margin:.25rem 1rem .5rem;
  font-size:.78rem;color:var(--text);
}
.sl-pairing-bar svg { flex-shrink:0;opacity:.7; }
.sl-pairing-bar strong { font-weight:600; }
.sl-pairing-revoke {
  margin-left:auto;background:transparent;border:none;
  font-size:.72rem;color:var(--text-muted);cursor:pointer;padding:0;
  text-decoration:underline;
}
.sl-pairing-revoke:hover { color:#f87171; }

/* ── Share modal ─────────────────────────────────────────────────────────── */
.sl-modal-backdrop {
  position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:100;
  display:flex;align-items:center;justify-content:center;padding:1rem;
}
.sl-modal {
  background:var(--surface);border:1px solid var(--border);border-radius:14px;
  width:100%;max-width:340px;overflow:hidden;
}
.sl-modal-header {
  display:flex;align-items:center;justify-content:space-between;
  padding:.75rem 1rem;border-bottom:1px solid var(--border);
  font-weight:600;font-size:.95rem;
}
.sl-modal-close {
  width:28px;height:28px;border:none;background:transparent;
  color:var(--text-muted);cursor:pointer;border-radius:6px;
  display:flex;align-items:center;justify-content:center;
}
.sl-modal-body { padding:1.25rem 1rem; }
.sl-share-hint { font-size:.82rem;color:var(--text-muted);margin:0 0 1rem;text-align:center; }
.sl-qr-wrap { display:flex;justify-content:center;margin-bottom:.75rem; }
.sl-qr-wrap canvas { border-radius:8px; }
.sl-share-url {
  font-size:.68rem;color:var(--text-muted);word-break:break-all;
  text-align:center;margin:0 0 .5rem;
}
.sl-share-info {
  background:var(--surface2);border-radius:8px;padding:.75rem;
  margin-bottom:.75rem;display:flex;flex-direction:column;gap:.4rem;
}
.sl-share-info-row { display:flex;justify-content:space-between;gap:.5rem; }
.sl-share-label { font-size:.78rem;color:var(--text-muted); }
.sl-share-value { font-size:.78rem;font-weight:500; }
.sl-share-revoke {
  width:100%;padding:.55rem;border:1px solid rgba(248,113,113,.4);
  border-radius:8px;background:transparent;color:#f87171;
  font-size:.82rem;cursor:pointer;transition:background .15s;
}
.sl-share-revoke:hover { background:rgba(248,113,113,.1); }

/* ── List card progress bar ──────────────────────────────────────────────── */
.sl-progress { height:3px;background:var(--border);border-radius:99px;margin-top:5px;overflow:hidden; }
.sl-progress-fill { height:100%;background:var(--accent);border-radius:99px;transition:width .3s; }
.sl-list-card--done .sl-progress-fill { background:rgba(34,197,94,.35); }

/* ── Recipe-locked list: chain banner ───────────────────────────────────── */
.sl-locked-chain-banner {
  display: flex; align-items: baseline; gap: .5rem;
  padding: 10px 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.sl-locked-chain-name {
  font-size: 1.35rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent);
}
.sl-locked-chain-sub {
  font-size: .72rem; color: var(--text-muted); font-weight: 500;
}

/* ── Recipe card (in list detail) ────────────────────────────────────────── */
.sl-recipe-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; cursor: pointer;
  overflow: hidden;
}
.sl-recipe-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: .85rem; font-weight: 600; color: var(--text);
}
.sl-recipe-card-title { flex: 1; }
.sl-recipe-card--open .sl-recipe-card-header { border-bottom: 1px solid var(--border); }
.sl-recipe-ing-list { list-style: none; margin: 0; padding: 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.sl-recipe-ing-row {
  display: flex; align-items: center; gap: 8px; font-size: .82rem;
}
.sl-recipe-ing-img { width: 28px; height: 28px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.sl-recipe-ing-name { flex: 1; }
.sl-recipe-ing-qty  { color: var(--text-muted); white-space: nowrap; }
.sl-recipe-ing-price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.sl-recipe-instructions {
  font-size: .82rem; line-height: 1.6; white-space: pre-line;
  padding: 8px 14px 12px; margin: 0; color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── Hero cheapest total ─────────────────────────────────────────────────── */
.sl-best-total { display:flex;align-items:baseline;gap:.4rem;flex-wrap:wrap;padding:4px 2px 10px; }
.sl-best-total-amount { font-size:2rem;font-weight:900;color:var(--accent);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums; }
.sl-best-total-chain { font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);align-self:flex-end;padding-bottom:3px; }
.sl-best-total-saving { font-size:.72rem;color:var(--accent);opacity:.7;border:1px solid rgba(34,197,94,.25);border-radius:100px;padding:1px 7px;align-self:flex-end;padding-bottom:3px; }
.sl-best-total-coverage { width:100%;font-size:.7rem;color:var(--text-dim);margin-top:-2px; }
.sl-excluded-items { display:flex;flex-wrap:wrap;gap:.3rem;padding:6px 2px 10px;align-items:center; }
.sl-excluded-label { font-size:.68rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.06em;margin-right:.2rem; }
.sl-excluded-item { font-size:.72rem;color:var(--text-muted);display:flex;align-items:center;gap:.25rem;background:var(--surface2);border-radius:6px;padding:2px 7px; }
.sl-excluded-reason { font-size:.65rem;color:var(--text-dim);font-style:italic; }
.sl-no-comparison { padding:6px 2px 10px;font-size:.75rem;color:var(--text-dim);font-style:italic; }
.sl-comparison-disclaimer { margin:4px 0 6px;font-size:.68rem;color:var(--text-dim);font-style:italic; }

/* ── Inline rename ───────────────────────────────────────────────────────── */
.sl-detail-title--tap { cursor:pointer; }
.sl-detail-title--tap:hover { color:var(--accent); }
.sl-title-input { flex:1;font-size:1.05rem;font-weight:700;color:var(--text);background:var(--surface2);border:1px solid rgba(34,197,94,.5);border-radius:8px;padding:5px 10px;outline:none;min-width:0; }

/* ── Share link button + panel ───────────────────────────────────────────── */
.sl-link-btn { flex-shrink:0;width:32px;height:32px;border:none;border-radius:8px;background:transparent;color:var(--text-muted);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s; }
.sl-link-btn:hover, .sl-link-btn--active { background:var(--accent-dim);color:var(--accent); }
.sl-sharelink-panel { display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;background:var(--surface2);border:1px solid var(--border);border-radius:10px;padding:.6rem .75rem;margin:.25rem 1rem .5rem; }
.sl-sharelink-url { flex:1;font-size:.72rem;color:var(--text-muted);word-break:break-all;min-width:0; }
.sl-sharelink-copy { flex-shrink:0;padding:4px 10px;background:var(--accent);color:#000;border:none;border-radius:6px;font-size:.75rem;font-weight:700;cursor:pointer;transition:opacity .15s; }
.sl-sharelink-copy:hover { opacity:.85; }
.sl-sharelink-revoke { flex-shrink:0;padding:4px 10px;background:transparent;border:1px solid rgba(248,113,113,.4);color:#f87171;border-radius:6px;font-size:.75rem;cursor:pointer;transition:background .15s; }
.sl-sharelink-revoke:hover { background:rgba(248,113,113,.1); }
.sl-sharelink-expiry { width:100%;font-size:.68rem;color:var(--text-dim);margin-bottom:2px; }

/* ── Shared list header ──────────────────────────────────────────────────── */
.sl-shared-badge { display:inline-flex;align-items:center;font-size:.65rem;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--accent);background:var(--accent-dim);border-radius:4px;padding:2px 7px;margin-bottom:2px; }

/* ── OCR diagnostics (admin) ─────────────────────────────────────────────── */
.ocr-diag-grid { display:flex;flex-direction:column;gap:0;margin-bottom:.5rem; }
.ocr-diag-row {
  display:grid;grid-template-columns:160px 1fr;gap:.75rem;
  padding:6px 0;border-bottom:1px solid var(--border);font-size:.85rem;
}
.ocr-diag-key { color:var(--text-muted);font-weight:500;flex-shrink:0;padding-top:1px; }
.ocr-diag-val { word-break:break-all;line-height:1.5; }
.ocr-ok  { color:#4ade80; }
.ocr-err { color:#f87171; }
.ocr-lib-list { display:flex;flex-direction:column;gap:2px; }
.ocr-lib-entry { font-size:.78rem;color:var(--text-muted); }
.ocr-lib-entry.ocr-ok { color:#4ade80; }
.ocr-req-row { display:flex;align-items:center;gap:.5rem;padding:2px 0; }

/* ── Fridge modal ─────────────────────────────────────────────────────────── */
.fridge-backdrop { position:fixed;inset:0;background:rgba(0,0,0,.65);z-index:300;display:flex;align-items:center;justify-content:center;padding:1rem; }
.fridge-modal { background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius-lg);width:100%;max-width:480px;display:flex;flex-direction:column;max-height:90vh; }
.fridge-header { display:flex;align-items:center;gap:.5rem;padding:.9rem 1.1rem;border-bottom:1px solid var(--border);font-weight:700;font-size:.95rem;flex-shrink:0; }
.fridge-header span { flex:1; }
.fridge-body { flex:1;overflow-y:auto;display:flex;flex-direction:column;align-items:center;gap:.75rem;padding:1rem; }
.fridge-img { width:100%;border-radius:10px;object-fit:cover;max-height:60vh; }
.fridge-ts { font-size:.78rem;color:var(--text-muted);align-self:flex-start; }
.fridge-empty { display:flex;flex-direction:column;align-items:center;gap:.75rem;padding:2rem 0;color:var(--text-dim); }
.fridge-empty p { font-size:.88rem; }
.fridge-saving { display:flex;align-items:center;gap:.75rem;padding:2rem;color:var(--text-muted);font-size:.9rem; }
.fridge-footer { padding:.9rem 1rem;border-top:1px solid var(--border);flex-shrink:0; }
.fridge-video { width:100%;border-radius:10px;object-fit:cover;max-height:60vh;background:#000; }

/* ── Landing page ─────────────────────────────────────────────────────────── */
.landing-wrap { max-width: 540px; margin: 0 auto; padding: 4rem 1.5rem 3rem; display: flex; flex-direction: column; gap: 3.5rem; }
.landing-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.25rem; }
.landing-title { font-size: 2.6rem; font-weight: 900; letter-spacing: -1.5px; background: linear-gradient(125deg, var(--text) 0%, var(--text-muted) 40%, var(--accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.1; }
.landing-accent { background: linear-gradient(125deg, var(--accent), var(--logo-span-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.landing-tagline { font-size: 1.05rem; color: var(--text-muted); line-height: 1.6; max-width: 400px; }
.landing-cta { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; margin-top: .5rem; }
.landing-btn { min-width: 130px; text-align: center; text-decoration: none; }

/* ── Landing scan showcase ────────────────────────────────────────────────── */
.landing-showcase { display: flex; flex-direction: column; gap: .65rem; }
.landing-showcase-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.landing-showcase-empty { padding: 2rem 1.5rem; text-align: center; color: var(--text-muted); font-size: .88rem; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.lsc-carousel { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border-soft); background: #111; }
.lsc-track { display: flex; transition: transform .45s cubic-bezier(.4,0,.2,1); will-change: transform; }
.lsc-slide { min-width: 100%; flex-shrink: 0; }
.lsc-dots { display: flex; justify-content: center; gap: .45rem; padding: .55rem; background: var(--surface); border-top: 1px solid var(--border-soft); }
.lsc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface3); cursor: pointer; transition: background .2s, transform .2s; border: none; padding: 0; }
.lsc-dot.active { background: var(--accent); transform: scale(1.35); }

/* ── Scan card (shared: landing carousel + nyeste-priser grid) ─────────────── */
.scan-card { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border-soft); }
.scan-card-img { position: relative; background: #111; line-height: 0; }
.scan-card-img img { width: 100%; display: block; object-fit: cover; max-height: 220px; }
.scan-card-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scan-card-price-badge { position: absolute; bottom: .5rem; right: .5rem; background: rgba(0,0,0,.72); backdrop-filter: blur(6px); border-radius: 8px; padding: .3rem .65rem; display: flex; align-items: baseline; gap: .3rem; }
.scan-card-price-kr { font-size: 1.25rem; font-weight: 800; color: #fff; }
.scan-card-price-unit { font-size: .75rem; color: rgba(255,255,255,.65); }
.scan-card-meta { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; background: var(--surface); }
.scan-card-store { font-size: .82rem; font-weight: 600; color: var(--accent); }
.scan-card-time { font-size: .75rem; color: var(--text-dim); }

/* ── Nyeste priser page ───────────────────────────────────────────────────── */
.scan-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.np-page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.np-page-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 .2rem; }
.np-page-sub { font-size: .82rem; color: var(--text-dim); margin: 0; }
.np-card-wrap { position: relative; }
.np-edit-btn {
  position: absolute; top: .45rem; right: .45rem; z-index: 2;
  background: rgba(0,0,0,.58); backdrop-filter: blur(4px);
  border: none; border-radius: 7px; color: #fff; cursor: pointer;
  padding: 6px; display: flex; align-items: center; justify-content: center;
  transition: background .15s, opacity .15s;
}
.np-edit-btn:hover { background: rgba(0,0,0,.82); }
.np-no-img {
  background: var(--surface2); padding: 1.5rem 1rem;
  display: flex; align-items: baseline; gap: .4rem; min-height: 80px;
}
.np-no-img-price { font-size: 2rem; font-weight: 800; color: var(--text); }
.np-no-img-unit { font-size: .9rem; color: var(--text-muted); }
.np-no-img-empty { font-size: .9rem; color: var(--text-dim); }
.np-product-name {
  font-size: .8rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .15rem;
}

/* ── Edit modal ──────────────────────────────────────────────────────────── */
.np-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.55); display: flex;
  align-items: center; justify-content: center; padding: 1rem;
}
.np-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.np-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem; border-bottom: 1px solid var(--border-soft);
  font-weight: 700; font-size: .95rem;
}
.np-modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  font-size: 1rem; padding: 2px 6px; border-radius: 5px; line-height: 1;
  transition: color .15s;
}
.np-modal-close:hover { color: var(--text); }
.np-modal-body { padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.np-field { display: flex; flex-direction: column; gap: .3rem; }
.np-field > span { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.np-field-row { display: grid; grid-template-columns: 2fr 1fr; gap: .6rem; }
.np-field-error { font-size: .82rem; color: #f87171; margin: 0; }
.np-modal-footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: .75rem 1rem; border-top: 1px solid var(--border-soft);
}


/* ── Receipt scanner ──────────────────────────────────────────────────────── */
.sl-receipt-btn {
  background: none; border: none; cursor: pointer; padding: 6px;
  color: var(--text-muted); border-radius: 8px; display: flex;
  transition: color .15s, background .15s;
}
.sl-receipt-btn:hover { color: var(--text); background: var(--surface2); }

.rcpt-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center;
}
.rcpt-modal {
  width: min(480px, 100vw); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
}
.rcpt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft);
}
.rcpt-title { font-size: .95rem; font-weight: 700; }
.rcpt-close {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px; border-radius: 6px; display: flex;
  transition: color .15s;
}
.rcpt-close:hover { color: var(--text); }
.rcpt-camera-wrap { position: relative; background: #000; }
.rcpt-video  { width: 100%; display: block; }
.rcpt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rcpt-status {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.65); color: #fff; font-size: .82rem; font-weight: 600;
  padding: 5px 14px; border-radius: 20px; white-space: nowrap;
}
.rcpt-status--ok { background: rgba(0,180,80,.75); }

/* ── Recipes ────────────────────────────────────────────────────────────── */
.recipe-grid {
  display: flex; flex-direction: column; gap: 12px;
}
.recipe-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; cursor: pointer;
  transition: border-color .15s;
}
.recipe-card:hover { border-color: var(--accent); }
.recipe-card--open  { border-color: var(--accent); }
.recipe-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 14px 16px 10px;
}
.recipe-card-info { flex: 1; min-width: 0; }
.recipe-title  { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.recipe-desc   { font-size: .85rem; color: var(--text-muted); margin: 0; }
.recipe-total-price {
  font-size: .82rem; font-weight: 700; color: var(--accent);
  background: var(--accent-dim); padding: 2px 8px; border-radius: 10px;
}
.recipe-thumb-strip {
  display: flex; gap: 4px; padding: 0 16px 12px; flex-wrap: wrap;
}
.recipe-thumb {
  width: 52px; height: 52px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border-soft); background: var(--surface2);
  flex-shrink: 0;
}
.recipe-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-body {
  border-top: 1px solid var(--border); padding: 16px;
  display: flex; flex-direction: column; gap: 1.25rem;
}
.recipe-section-title {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; opacity: .5; margin: 0 0 10px;
}
.recipe-ing-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.recipe-ing-row  {
  display: flex; align-items: center; gap: 10px; font-size: .88rem;
}
.recipe-ing-img  {
  width: 36px; height: 36px; border-radius: 5px; object-fit: cover;
  border: 1px solid var(--border-soft); flex-shrink: 0;
}
.recipe-ing-placeholder {
  background: var(--surface2);
}
.recipe-ing-name  { flex: 1; }
.recipe-ing-qty   { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.recipe-ing-price { color: var(--accent); font-weight: 700; font-size: .82rem; white-space: nowrap; }
.recipe-instructions { font-size: .88rem; line-height: 1.7; white-space: pre-line; margin: 0; }
.recipe-chevron  { color: var(--text-muted); margin-top: 2px; }
.recipe-action-row { display: flex; justify-content: flex-end; padding-top: 4px; }
.recipe-list-btn { display: flex; align-items: center; font-size: .85rem; padding: 8px 16px; }

/* Scan modal — fullscreen on mobile for max camera real-estate */
.scan-modal {
  max-height: 100dvh;
  overflow-y: auto;
}
@media (max-width: 600px) {
  .scan-modal {
    width: 100vw;
    min-height: 100dvh;
    border-radius: 0;
    max-height: none;
    overflow-y: auto;
  }
  .scan-modal .rcpt-camera-wrap { flex: 1; }
}

/* Receipt admin card */
.rcpt-admin-card {
  display: flex; gap: 16px; padding: 16px;
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  margin-bottom: 12px; background: var(--surface2);
}
.rcpt-admin-img { flex-shrink: 0; }
.rcpt-admin-img img {
  width: 120px; height: auto; max-height: 200px;
  object-fit: contain; border-radius: 6px; display: block;
  border: 1px solid var(--border-soft);
}
.rcpt-admin-text { flex: 1; min-width: 0; }
.rcpt-admin-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rcpt-admin-ocr {
  font-size: .75rem; color: var(--text-muted); white-space: pre-wrap;
  word-break: break-word; max-height: 200px; overflow-y: auto;
  background: var(--surface3); border-radius: 6px; padding: 8px;
  border: 1px solid var(--border-soft); margin: 0;
}

/* ── DATABASE ADMIN PAGE ─────────────────────────────────────────────────── */
.db-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 700px) { .db-layout { grid-template-columns: 1fr; } }

.db-results-col { display: flex; flex-direction: column; }

.db-detail-col { min-width: 0; }

.db-detail-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--card-shine);
}

.db-hit-row {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-soft);
  color: var(--text); cursor: pointer; text-align: left;
  box-shadow: var(--card-shine);
  transition: border-color .12s, background .12s;
}
.db-hit-row:hover { border-color: rgba(255,255,255,.1); background: var(--surface2); }
.db-hit-row--active {
  border-color: var(--accent);
  background: rgba(34,197,94,.05);
  box-shadow: var(--card-shine), 0 0 0 1px var(--accent);
}

.db-src-badge {
  font-size: .62rem; font-weight: 700; border-radius: 4px;
  padding: 1px 5px; white-space: nowrap; flex-shrink: 0; line-height: 1.7;
}
.db-src-badge--normalized { background: rgba(56,189,248,.15); color: #38bdf8; border: 1px solid rgba(56,189,248,.3); }
.db-src-badge--generic    { background: rgba(34,197,94,.15);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.db-src-badge--grocery    { background: rgba(251,191,36,.15); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }

/* ── APP FOOTER ─────────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  padding: 1.5rem 1rem calc(var(--tab-h, 60px) + env(safe-area-inset-bottom, 0px) + 1.5rem);
  line-height: 1.8;
}
.app-footer a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.app-footer a:hover { color: var(--accent); }
@media (min-width: 768px) { .app-footer { padding-bottom: 2rem; } }

/* ── BOTTOM TAB BAR ─────────────────────────────────────────────────────── */
.bottom-tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 90;
  display: flex; align-items: stretch;
  background: var(--tab-bar-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 768px) { .bottom-tab-bar { display: none; } }

.bottom-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  transition: color 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-tab svg { flex-shrink: 0; transition: transform 0.15s ease; }
.bottom-tab:hover  { color: var(--text); }
.bottom-tab:hover svg { transform: translateY(-1px); }
.bottom-tab.active { color: var(--accent); }
.bottom-tab.active svg { color: var(--accent); }
.bottom-tab.active::after {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}

/* ── SKELETON LOADING ────────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    var(--surface3) 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-line     { height: 12px; }
.skeleton-line--sm { height: 9px; }
.skeleton-line--lg { height: 20px; }
.skeleton-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--card-shine);
}

/* ── CHAIN CARD ACCENTS ──────────────────────────────────────────────────── */
.sl-chain-card {
  box-shadow: var(--card-shine);
  border-left-width: 2px; border-left-style: solid;
  border-left-color: transparent;
}
.sl-chain-card--kiwi  { border-left-color: rgba(251,146,60,.55); }
.sl-chain-card--meny  { border-left-color: rgba(52,211,153,.55); }
.sl-chain-card--rema  { border-left-color: rgba(248,113,113,.55); }
.sl-chain-card--coop  { border-left-color: rgba(129,140,248,.55); }
.sl-chain-card--kiwi .sl-chain-name { color: #fb923c; }
.sl-chain-card--meny .sl-chain-name { color: #34d399; }
.sl-chain-card--rema .sl-chain-name { color: #f87171; }
.sl-chain-card--coop .sl-chain-name { color: #818cf8; }

/* ── PRICE BREAKDOWN TABLE ───────────────────────────────────────────────── */
.sl-price-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.sl-price-table thead th {
  padding: .55rem .6rem; border-bottom: 1px solid var(--border);
  font-weight: 600; white-space: nowrap;
}
.sl-price-table tbody tr + tr { border-top: 1px solid rgba(255,255,255,.05); }
.sl-price-table tbody tr:hover { background: rgba(255,255,255,.03); }
.sl-price-table tfoot tr { border-top: 2px solid var(--border); }
.sl-pt-name {
  text-align: left; padding: .5rem .6rem;
  color: var(--text); max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sl-pt-chain { text-align: center; padding: .55rem .4rem; color: var(--text-muted); }
.sl-pt-chain--sel { background: rgba(255,255,255,.06); }
.sl-pt-price {
  text-align: center; padding: .5rem .4rem;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.sl-pt-price--best { color: var(--accent); font-weight: 700; }
.sl-pt-kr { font-size: .7em; opacity: .65; margin-left: 1px; }
.sl-pt-qty { font-size: .72em; opacity: .55; margin-left: 3px; }
.sl-pt-na { opacity: .3; }
.sl-pt-total-row .sl-pt-name { font-weight: 700; color: var(--text); }
.sl-pt-total-row .sl-pt-price { font-weight: 700; }

/* ── LANDING WIDE ────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .landing-wrap { padding: 5rem 2rem 4rem; }
  .scan-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── PREMIUM BADGE ────────────────────────────────────────────────────────── */
.pro-badge {
  display: inline-flex; align-items: center;
  font-size: .55rem; font-weight: 800; letter-spacing: .07em;
  text-transform: uppercase;
  padding: 2px 5px; border-radius: 4px;
  background: rgba(251,191,36,.14);
  border: 1px solid rgba(251,191,36,.35);
  color: #fbbf24;
  flex-shrink: 0; vertical-align: middle; line-height: 1.2;
}

/* ── PREMIUM MODAL ────────────────────────────────────────────────────────── */
.pm-backdrop {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.pm-modal {
  background: var(--surface);
  border: 1px solid rgba(251,191,36,.22);
  border-radius: var(--radius-xl);
  padding: 32px 28px 24px;
  max-width: 400px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(251,191,36,.07);
  animation: pmSlideUp .22s cubic-bezier(.34,1.36,.64,1);
}
@keyframes pmSlideUp { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.pm-crown {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(251,191,36,.11);
  border: 1px solid rgba(251,191,36,.25);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; color: #fbbf24;
}
.pm-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 16px; }
.pm-body  { font-size: .88rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 18px; }

/* ── Feature comparison grid ── */
.pm-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 18px; text-align: left;
}
.pm-compare-col {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px; padding: 12px;
}
.pm-compare-col--pluss {
  background: rgba(251,191,36,.06);
  border-color: rgba(251,191,36,.22);
}
.pm-compare-head {
  font-size: .7rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; opacity: .5; margin-bottom: 8px;
}
.pm-compare-col--pluss .pm-compare-head { color: #fbbf24; opacity: 1; }
.pm-compare-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.pm-compare-list li { font-size: .8rem; line-height: 1.3; }
.pm-trial-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700; color: #fbbf24;
  background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.22);
  border-radius: 100px; padding: 5px 12px; margin-bottom: 18px;
}
.pm-vipps-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px 20px;
  background: #ff5b24; color: #fff;
  border: none; border-radius: var(--radius);
  font-size: .97rem; font-weight: 700;
  cursor: pointer; margin-bottom: 8px;
  transition: opacity .15s;
}
.pm-vipps-btn:hover { opacity: .88; }
.pm-skip {
  display: block; width: 100%; padding: 9px;
  background: none; border: none;
  color: var(--text-muted); font-size: .86rem;
  cursor: pointer; border-radius: var(--radius);
  transition: color .15s; text-decoration: none; text-align: center;
}
.pm-skip:hover { color: var(--text); }

/* ── PLUSS PAGE GATE (blur for non-premium users) ────────────────────────── */
.pluss-gate--blur {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

/* ── MOCKED AD MODAL ─────────────────────────────────────────────────────── */
.ad-modal-backdrop {
  position: fixed; inset: 0; z-index: 800;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.ad-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl);
  padding: 24px 24px 20px;
  max-width: 320px; width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: pmSlideUp .22s cubic-bezier(.34,1.36,.64,1);
}
.ad-modal-label {
  display: inline-block;
  font-size: .6rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 4px; padding: 2px 7px; margin-bottom: 16px;
}
.ad-modal-logo { font-size: 2.5rem; margin-bottom: 10px; }
.ad-modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.ad-modal-body  { font-size: .85rem; color: rgba(255,255,255,.6); line-height: 1.5; margin-bottom: 6px; }
.ad-modal-brand { font-size: .72rem; color: rgba(255,255,255,.3); margin-bottom: 18px; }
.ad-modal-skip {
  display: block; width: 100%;
  padding: 9px; margin-bottom: 8px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); color: rgba(255,255,255,.5);
  font-size: .85rem; cursor: not-allowed;
  transition: background .15s, color .15s, cursor .15s;
}
.ad-modal-skip--ready {
  background: rgba(255,255,255,.12); color: var(--text);
  cursor: pointer;
}
.ad-modal-skip--ready:hover { background: rgba(255,255,255,.18); }
.ad-modal-pluss {
  display: block; width: 100%;
  padding: 9px; background: none; border: none;
  color: #fbbf24; font-size: .82rem; font-weight: 600;
  cursor: pointer; opacity: .85; transition: opacity .15s;
}
.ad-modal-pluss:hover { opacity: 1; }

/* ── PREMIUM UPGRADE BAR ─────────────────────────────────────────────────── */
.pm-upgrade-bar {
  display: flex; align-items: center; gap: .75rem;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px;
  padding: .75rem 1rem;
  margin-bottom: 1.25rem;
}

/* ── PREMIUM PAGE GATE (kept for backward compat, no longer used) ─────────── */
.pm-page-blur {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: .55;
}
.pm-page-gate {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(12,12,15,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── PREMIUM HINT BLUR (LinkedIn-style) ───────────────────────────────────── */
.sl-item-hint--locked {
  cursor: pointer;
  opacity: .85;
  transition: opacity .15s;
}
.sl-item-hint--locked:hover { opacity: .65; }
.sl-hint-blur {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
}

/* ── BOTTOM TAB PRO DOT ───────────────────────────────────────────────────── */
.tab-pro-dot {
  position: absolute; top: 5px; right: calc(50% - 20px);
  width: 6px; height: 6px; border-radius: 50%;
  background: #fbbf24;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* BUTIKKER PAGE                                                              */
/* ══════════════════════════════════════════════════════════════════════════ */
.bk-page { padding-bottom: 5rem; }

.bk-header { margin-bottom: .75rem; }
.bk-title  { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.bk-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* ── Store search ── */
.bk-search-row {
  position: relative; margin-bottom: .75rem;
}
.bk-search-input {
  width: 100%; padding: .55rem .9rem .55rem 2.2rem;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--card-bg); color: var(--text);
  font-size: .9rem; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: .65rem center;
  background-size: 15px;
}
.bk-search-input:focus { border-color: var(--accent); }
.bk-search-clear {
  position: absolute; right: .6rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .85rem; padding: 2px 4px; line-height: 1;
}
.bk-search-clear:hover { color: var(--text); }
.bk-gps-coords { font-size: .65rem; opacity: .55; margin-left: 4px; }

/* ── Chain filter chips ── */
.bk-filters {
  display: flex; gap: 7px; flex-wrap: wrap;
  margin-bottom: .75rem;
}
.bk-chain-chip {
  padding: 5px 13px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface2); color: var(--text-muted);
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.bk-chain-chip:hover { border-color: rgba(255,255,255,.2); color: var(--text); }
.bk-chain-chip--on   { color: #fff; }
.bk-chain-chip--rema.bk-chain-chip--on  { background: rgba(230,57,70,.25);  border-color: #e63946; color: #ff8b92; }
.bk-chain-chip--kiwi.bk-chain-chip--on  { background: rgba(34,197,94,.18);  border-color: var(--accent); color: var(--accent); }
.bk-chain-chip--meny.bk-chain-chip--on  { background: rgba(74,144,217,.2);  border-color: #4a90d9; color: #8ab6e8; }
.bk-chain-chip--coop.bk-chain-chip--on  { background: rgba(244,162,97,.2);  border-color: #f4a261; color: #f4a261; }
.bk-chain-chip--joker.bk-chain-chip--on { background: rgba(155,93,229,.2);  border-color: #9b5de5; color: #bf9bf8; }

/* ── GPS row ── */
.bk-gps-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: .75rem; min-height: 26px;
}
.bk-gps-status        { font-size: .8rem; color: var(--text-muted); }
.bk-gps-status--ok    { color: var(--accent); }
.bk-gps-status--err   { color: #f87171; }
.bk-refresh-btn       { margin-left: auto; }

/* ── Map container ── */
.bk-map {
  width: 100%; height: 340px;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  background: var(--surface2);
}
@media (min-width: 640px) { .bk-map { height: 420px; } }

/* ── Store list meta ── */
.bk-list-meta {
  font-size: .75rem; color: var(--text-muted);
  margin-bottom: .5rem; padding-left: 2px;
}

/* ── Store list ── */
.bk-list {
  display: flex; flex-direction: column; gap: 6px;
}
.bk-store-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  transition: border-color .14s, background .14s;
}
.bk-store-row--link { cursor: pointer; }
.bk-store-row--link:hover {
  border-color: rgba(34,197,94,.35);
  background: var(--surface3);
}
.bk-store-badge {
  flex-shrink: 0; padding: 3px 7px; border-radius: 6px;
  font-size: .66rem; font-weight: 800; letter-spacing: .03em;
  text-align: center; min-width: 44px;
}
.bk-chain-badge--rema  { background: rgba(230,57,70,.2);  color: #ff8b92; }
.bk-chain-badge--kiwi  { background: rgba(34,197,94,.18); color: #22c55e; }
.bk-chain-badge--meny  { background: rgba(74,144,217,.2); color: #8ab6e8; }
.bk-chain-badge--coop  { background: rgba(244,162,97,.2); color: #f4a261; }
.bk-chain-badge--joker { background: rgba(155,93,229,.2); color: #bf9bf8; }

.bk-store-body  { flex: 1; min-width: 0; }
.bk-store-name  {
  font-size: .88rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bk-store-addr  {
  font-size: .73rem; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bk-store-right {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
}
.bk-dist {
  font-size: .8rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bk-hours-link {
  font-size: .75rem; color: var(--text-muted);
  text-decoration: none; white-space: nowrap; padding: 2px 5px;
  border: 1px solid var(--surface3); border-radius: 4px;
}
.bk-hours-link:hover { color: var(--text); border-color: var(--accent); }

/* ── opening hours in store row ──────────────────────────────────────────── */
.bk-hours-row {
  display: flex; align-items: center; gap: 6px; margin-top: 3px;
}
.bk-today-hours {
  font-size: .72rem; font-weight: 500;
}
.bk-today-hours--open   { color: #22c55e; }
.bk-today-hours--closed { color: var(--text-muted); }
.bk-hours-toggle {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: .65rem; padding: 0 3px; line-height: 1;
}
.bk-hours-toggle:hover { color: var(--text); }
.bk-hours-week {
  display: grid; grid-template-columns: 2.8rem 1fr;
  gap: 1px 6px; margin-top: 4px; font-size: .7rem;
}
.bk-hours-day  { color: var(--text-muted); font-weight: 500; }
.bk-hours-time { color: var(--text); }
.bk-hours-time--closed { color: var(--text-muted); font-style: italic; }

.bk-more {
  text-align: center; font-size: .78rem; color: var(--text-muted);
  padding: .75rem; opacity: .6;
}

/* ── Analytics / Statistikk admin page ────────────────────────────────── */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.stats-card {
  background: var(--surface, #1a1a2e);
  border: 1px solid var(--border, #2d2d44);
  border-radius: 10px;
  padding: 1rem;
}
.stats-card-label { font-size: .75rem; color: var(--text-muted); margin-bottom: .25rem; }
.stats-card-value { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stats-card-sub   { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; }
.stats-table-wrap { margin-top: .5rem; }


/* ── PWA install banner (MainLayout, above bottom nav) ─────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  left: 0; right: 0;
  z-index: 95;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface, #1e293b);
  border-top: 1px solid var(--border, #334155);
  box-shadow: 0 -4px 16px rgba(0,0,0,.35);
}
@media (min-width: 768px) {
  .pwa-install-banner { bottom: 0; }
}
