:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --font-body: 'Satoshi', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

:root,
[data-theme='light'] {
  --color-bg: #e8eef2;
  --color-surface: #f5f8fa;
  --color-surface-2: #fbfcfd;
  --color-surface-offset: #dfe7ec;
  --color-surface-dynamic: #d3dee5;
  --color-divider: #c9d4dc;
  --color-border: oklch(0.55 0.02 230 / 0.18);
  --color-text: #12202b;
  --color-text-muted: #5b6b76;
  --color-text-faint: #8a99a4;
  --color-text-inverse: #f4f8fa;
  --color-primary: #0e7c89;
  --color-primary-hover: #0a5f69;
  --color-primary-highlight: #d2e8eb;
  --color-success: #2f6d2a;
  --color-warning: #8a4b12;
  --color-error: #9b2f45;
  --color-notification: #9b2f45;
  --color-blue: #1d5f8a;
  --shadow-sm: 0 1px 2px oklch(0.25 0.03 230 / 0.06);
  --shadow-md: 0 8px 24px oklch(0.25 0.03 230 / 0.08);
}

[data-theme='dark'] {
  --color-bg: #0b1117;
  --color-surface: #121a22;
  --color-surface-2: #18222c;
  --color-surface-offset: #0f161d;
  --color-surface-dynamic: #24303b;
  --color-divider: #1e2a34;
  --color-border: oklch(0.78 0.02 210 / 0.12);
  --color-text: #d7e0e7;
  --color-text-muted: #8b9aa6;
  --color-text-faint: #5d6c77;
  --color-text-inverse: #0b1117;
  --color-primary: #3ec8d4;
  --color-primary-hover: #6ad7e0;
  --color-primary-highlight: #1a3338;
  --color-success: #7dce6c;
  --color-warning: #e0a15a;
  --color-error: #e07a8a;
  --color-notification: #e07a8a;
  --color-blue: #6aa7d1;
  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.28);
  --shadow-md: 0 10px 28px oklch(0 0 0 / 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0b1117;
    --color-surface: #121a22;
    --color-surface-2: #18222c;
    --color-surface-offset: #0f161d;
    --color-surface-dynamic: #24303b;
    --color-divider: #1e2a34;
    --color-border: oklch(0.78 0.02 210 / 0.12);
    --color-text: #d7e0e7;
    --color-text-muted: #8b9aa6;
    --color-text-faint: #5d6c77;
    --color-text-inverse: #0b1117;
    --color-primary: #3ec8d4;
    --color-primary-hover: #6ad7e0;
    --color-primary-highlight: #1a3338;
    --color-success: #7dce6c;
    --color-warning: #e0a15a;
    --color-error: #e07a8a;
    --color-notification: #e07a8a;
    --color-blue: #6aa7d1;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.28);
    --shadow-md: 0 10px 28px oklch(0 0 0 / 0.35);
  }
}

html,
body {
  height: 100%;
  overflow: hidden;
}

.dashboard {
  display: grid;
  grid-template-columns: 15.5rem 1fr;
  grid-template-rows: auto 1fr;
  height: 100dvh;
}

.sidebar {
  grid-row: 1 / -1;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text);
  text-decoration: none;
}

.brand svg {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

/* Ikonet følger navneblokkens højde (Safi.dk + Prisagent). */
.brand #brand-icon {
  --brand-h: calc(var(--text-sm) * 1.5 + var(--text-xs) * 1.5);
  width: var(--brand-h);
  height: var(--brand-h);
  flex: none;
  object-fit: contain;
}

.brand > span {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand > span > strong,
.brand > span > span {
  line-height: 1.5;
}

.brand-mark {
  color: var(--color-primary);
}

.brand strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand span {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  min-height: 44px;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}

.nav a[hidden] { display: none !important; }

.nav a:hover,
.nav a.is-active {
  background: var(--color-surface-offset);
  color: var(--color-text);
}

.nav a.is-active {
  color: var(--color-primary);
}

.nav-group {
  min-width: 0;
}

.nav-submenu {
  display: flex;
  flex-direction: column;
  margin: var(--space-1) 0 var(--space-2) var(--space-3);
  padding-left: var(--space-2);
  border-left: 1px solid var(--color-divider);
}

.nav-submenu[hidden] {
  display: none;
}

.nav-submenu a {
  min-height: 44px;
  padding: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.nav-submenu a.is-active {
  color: var(--color-primary-hover);
  font-weight: 600;
}

.nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.header {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  background: color-mix(in oklab, var(--color-bg) 88%, transparent);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(12px);
}

.header h1 {
  font-size: var(--text-lg);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.main {
  grid-column: 2;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6) var(--space-8) var(--space-12);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.kpi {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.kpi dt {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi dd {
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
}

.search {
  flex: 1;
  min-width: 12rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  min-height: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-ghost {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  overflow-y: visible;
}

table.data {
  font-size: var(--text-sm);
}

table.data th,
table.data td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

table.data th {
  position: sticky;
  top: 0;
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
  z-index: 1;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-ok {
  background: color-mix(in oklab, var(--color-success) 16%, transparent);
  color: var(--color-success);
}

.badge-warn {
  background: color-mix(in oklab, var(--color-warning) 16%, transparent);
  color: var(--color-warning);
}

.badge-err {
  background: color-mix(in oklab, var(--color-error) 16%, transparent);
  color: var(--color-error);
}

.badge-low {
  background: color-mix(in oklab, var(--color-primary) 16%, transparent);
  color: var(--color-primary);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card h2,
.section-title {
  font-size: var(--text-sm);
  font-weight: 650;
  margin-bottom: var(--space-4);
}

.muted {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.scan-bar {
  height: 4px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-3);
}

.scan-bar > span {
  display: block;
  height: 100%;
  background: var(--color-primary);
  width: 0%;
  transition: width 240ms ease;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.alert-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.alert-item strong {
  display: block;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.chart-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  min-height: 22rem;
}

.threshold-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.threshold-row input {
  width: 8rem;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-family: var(--font-mono);
}

.empty {
  text-align: left;
  padding: var(--space-10) var(--space-4);
  color: var(--color-text-muted);
}

.empty h3 {
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 25%,
    var(--color-surface-dynamic) 50%,
    var(--color-surface-offset) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
  height: 1.1rem;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.view {
  display: none;
}
.view.is-visible {
  display: block;
}

.link {
  color: var(--color-primary);
}

@media (max-width: 960px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
  }
  .sidebar {
    grid-row: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
  }
  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    overflow: visible;
  }
  .nav-group {
    display: contents;
  }
  .nav-submenu {
    order: 1;
    flex: 0 0 100%;
    flex-direction: row;
    margin: 0;
    padding: var(--space-1) 0;
    border-left: 0;
    border-top: 1px solid var(--color-divider);
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }
  .nav-submenu a {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .header,
  .main {
    grid-column: 1;
  }
  .header {
    flex-wrap: wrap;
  }
  .header-actions {
    flex-wrap: wrap;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
  .main,
  .header {
    padding-inline: var(--space-4);
  }
}

.vat-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.vat-toggle button {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
}
.vat-toggle button.is-active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
.stack-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--space-3);
  align-items: end;
  margin-bottom: var(--space-5);
}
.stack-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.stack-form input,
.stack-form select {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
}
.catalog-list {
  display: flex;
  flex-direction: column;
}
.catalog-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
}
.section-title {
  margin-top: var(--space-2);
}

.form-msg {
  color: var(--color-error);
  font-size: var(--text-sm);
  min-height: 1.25em;
  margin: var(--space-2) 0 var(--space-3);
}

.notice p + p {
  margin-top: var(--space-2);
}
.row-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.wizard-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.wizard-fields label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
}
.wizard-fields input {
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-weight: 400;
}

.filter-drop {
  position: relative;
}
.filter-summary {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}
.filter-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 8;
  padding-top: 4px;
  min-width: 14rem;
  max-height: 16rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.filter-drop:hover .filter-menu,
.filter-drop:focus-within .filter-menu {
  display: block;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  font-size: var(--text-sm);
  font-weight: 400;
}
th[data-sort] {
  cursor: pointer;
  user-select: none;
}
th[data-sort]:hover {
  color: var(--color-text);
}
th.is-sorted {
  color: var(--color-primary);
}

.scan-log {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.scan-log article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.scan-log table {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}
.scan-log th,
.scan-log td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  white-space: normal;
}

.pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pager .muted {
  font-size: 0.85rem;
}

.product-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.product-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 104px;
  padding: 0 4px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-tile:hover {
  border-color: var(--color-primary);
}

.product-tile.is-selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.product-tile.is-opaque {
  background: #fff;
  color: #111;
}

.product-tile img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  object-fit: contain;
}

.product-tile-sku {
  color: inherit;
  margin-top: auto;
  font-size: 0.78rem;
  font-weight: 600;
  word-break: break-word;
}

.product-editor {
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  margin: auto;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  background: var(--color-surface);
}

.product-editor::backdrop { background: rgb(0 0 0 / 60%); }
.product-editor form { display: grid; gap: 1rem; }
.product-editor label { display: grid; gap: .35rem; }
.product-editor input {
  width: 100%;
  padding: .65rem .75rem;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.product-editor input[readonly] { color: var(--color-text-muted); }
.product-editor .row-actions { justify-content: flex-end; }

/* safi-overview-layout-v1 */
@media (min-width: 961px) {
  .dashboard { grid-template-columns: 15.5rem minmax(0, 1fr); }
}
.header { min-width: 0; }
.header-actions { min-width: 0; flex-wrap: wrap; }
.view[data-view="/"] { min-width: 0; max-width: 100%; }
.view[data-view="/"] > .table-wrap { width: 100%; max-width: 100%; min-width: 0; }
#overview-price-table { table-layout: fixed; width: 100%; min-width: 0; }
#overview-price-table th,
#overview-price-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  padding: .7rem clamp(.25rem, .65vw, .75rem);
  vertical-align: top;
}
#overview-price-table .badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
#overview-price-table .num { font-size: clamp(.75rem, .78vw, 1rem); }
#overview-price-table td:last-child { text-align: center; }
#overview-price-table td:last-child a { display: inline-block; padding-block: .2rem; }
#scan-card { margin-bottom: 1.25rem; }
#scan-card[hidden],
#scan-card [hidden],
#scan-card[data-scan-active="false"] .scan-bar,
#scan-card[data-scan-active="false"] #btn-stop-scan { display: none !important; }
#scan-card #btn-stop-scan { margin-top: .75rem; }
#coverage-card:not([hidden]) { margin-bottom: 1.25rem; }
.overview-status-filter[aria-pressed="true"] {
  background: var(--color-primary-highlight);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
/* end safi-overview-layout-v1 */

/* safi-eu-price-breakdown-css-v1 */
#price-body .eu-price-breakdown {
  margin-top: .4rem;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: var(--font-body, sans-serif);
  font-size: .75rem;
  line-height: 1.45;
  text-align: left;
}
#price-body .eu-price-breakdown summary {
  color: var(--color-primary);
  cursor: pointer;
  padding: .2rem 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
#price-body .eu-price-breakdown summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
#price-body .eu-breakdown-content {
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
  white-space: normal;
  overflow-wrap: anywhere;
}
#price-body .eu-breakdown-content > div + div { margin-top: .2rem; }
#price-body .eu-breakdown-content .muted { font-size: inherit; }
/* end safi-eu-price-breakdown-css-v1 */

/* Historik og oprydning – oktober 2026 */
.history-shops { display:flex; flex-wrap:wrap; gap:.5rem; margin:0 0 1rem; }
.history-shop { min-height:32px; padding:.25rem .65rem; font-size:var(--text-xs); }
.history-shop.is-selected { background:var(--color-primary); color:var(--color-text-inverse); border-color:var(--color-primary); }
.cleanup-scope { border:1px solid var(--color-border); border-radius:var(--radius-md); padding:.75rem; margin:1rem 0; }
.cleanup-scope legend { padding:0 .3rem; font-size:var(--text-sm); }
.cleanup-scope label { display:inline-flex; gap:.4rem; align-items:center; margin-right:1rem; font-size:var(--text-sm); }
.cleanup-shops { display:flex; flex-wrap:wrap; gap:.5rem 1rem; margin-top:.75rem; }
.cleanup-shops[hidden] { display:none; }
.settings-intro { margin-bottom:1rem; }
.settings-intro p + p, .settings-intro ul + p { margin-top:.75rem; }
.settings-intro ul { padding-left:1.25rem; margin:.75rem 0; }
#reset-card > p { margin-bottom:1rem; }
#backup-list { list-style:none; margin:.5rem 0 0 !important; padding:0; }
#backup-list li { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; padding:.4rem 0; }
#backup-list a { overflow-wrap:anywhere; }
#backup-list .btn { min-height:32px; padding:.2rem .6rem; }
#daily-price-list td > div { line-height:1.6; }

/* SAFI_UI_OCT23: shared shop palette, fixed-size row icons and KPI links. */
.history-shop[data-history-shop]:not([data-history-shop=""]) {
  background: var(--shop-color);
  border-color: var(--shop-color);
  color: #111827;
}
.history-shop[data-history-shop]:not([data-history-shop=""]).is-selected {
  box-shadow: 0 0 0 2px var(--color-text);
}
.history-shop[data-history-shop]:not([data-history-shop=""]):hover {
  filter: brightness(1.08);
}
.product-tile-all { justify-content: center; align-self: stretch; min-height: 40px; font-weight: 600; }
.product-with-icon { position: relative; padding-left: 34px; min-width: 0; }
.row-product-icon {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; overflow: hidden; border-radius: 4px;
}
.row-product-icon img { display: block; width: 24px; height: 24px; object-fit: contain; }
.row-product-icon.is-opaque { background: #fff; }
.kpi { position: relative; }
.kpi-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.kpi:has(.kpi-link):hover { border-color: var(--color-primary); }
.kpi-link:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }

#safi-shop-buttons[hidden] { display: none !important; }


/* SAFI_HISTORY_V2: kun aktive webshopknapper får bundfarve; periodevælger. */
.history-shop[data-history-shop]:not([data-history-shop=""]) {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: none;
}
.history-shop[data-history-shop]:not([data-history-shop=""])::before {
  content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--shop-color); margin-right: .4rem; vertical-align: middle;
}
.history-shop[data-history-shop]:not([data-history-shop=""]).is-selected {
  background: var(--shop-color);
  border-color: var(--shop-color);
  color: #111827;
  box-shadow: 0 0 0 2px var(--color-text);
}
.history-shop[data-history-shop]:not([data-history-shop=""]).is-selected::before { background: #111827; }
.history-shop[data-history-shop=""], .history-shop[data-history-shop=""].is-selected,
.product-tile-all, .product-tile-all.is-selected {
  background: transparent; color: var(--color-text); border-color: var(--color-border); box-shadow: none;
}
.history-shop[data-history-shop=""]:disabled, .product-tile-all:disabled { opacity: .45; cursor: default; }
.history-period { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin:0 0 1rem; }
.history-period label { display:inline-flex; align-items:center; gap:.4rem; font-size:var(--text-sm); }
.history-period input[type="date"] {
  min-height:32px; padding:.2rem .4rem; border:1px solid var(--color-border);
  border-radius:var(--radius-md); background:var(--color-surface, transparent); color:var(--color-text); font:inherit;
}
.history-preset { min-height:32px; padding:.25rem .65rem; font-size:var(--text-xs); }
.history-preset.is-selected { background:var(--color-primary); color:var(--color-text-inverse); border-color:var(--color-primary); }
.history-range-info { font-size:var(--text-xs); }
.history-empty { display:flex; align-items:center; justify-content:center; height:100%; text-align:center; padding:1rem; }


/* SAFI_ORDER_V1: træk-og-slip af produkter og redigering af webshopnavn. */
.product-order-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem; margin:.75rem 0 .25rem; }
.product-order-row { cursor: grab; }
.product-order-row > .product-with-icon { flex: 1 1 auto; }
.product-order-row.is-dragging { opacity: .45; outline: 2px dashed var(--color-primary); }
.drag-handle { flex: 0 0 auto; cursor: grab; color: var(--color-text-muted, #888); font-size: 1.1rem; line-height: 1; padding: 0 .25rem; user-select: none; letter-spacing: -2px; }
.shop-name-edit { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; flex:1 1 auto; min-width:0; }
.shop-name-edit input { min-height:32px; padding:.25rem .5rem; border:1px solid var(--color-border); border-radius:var(--radius-md); background:transparent; color:var(--color-text); font:inherit; min-width: 8rem; width: 12rem; flex: 0 1 12rem; }
.shop-name-edit .muted { flex-basis: 100%; }

/* Persistent scan activation; historic prices remain visible. */
.badge-inactive { background:rgba(128,128,128,.15); color:inherit; }
.is-scan-disabled { border-left:3px solid #8a8a8a; }
