@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/nunito-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Förslag B "Varm och personlig": djupgrönt varumärke mot krämvit bakgrund. */
:root {
  color-scheme: light;
  --bg: #f4f1e8;
  --surface: #ffffff;
  --ink: #1d2925;
  --muted: #5d6a65;
  --line: #e4dfd2;
  --brand: #085041;
  --brand-2: #0f6e56;
  --brand-ink: #e1f5ee;
  --brand-muted: #9fe1cb;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --accent-soft: #e1f5ee;
  --low: #3b6d11;
  --low-bg: #eaf3de;
  --med: #854f0b;
  --med-bg: #faeeda;
  --high: #a32d2d;
  --high-bg: #fcebeb;
  --alert-bg: #faeeda;
  --alert-line: #ef9f27;
  --radius: 18px;
  --font: "Nunito Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1513;
    --surface: #16211d;
    --ink: #e8efec;
    --muted: #9eaba6;
    --line: #26332e;
    --brand: #0a3b31;
    --brand-2: #0f6e56;
    --brand-ink: #e1f5ee;
    --brand-muted: #9fe1cb;
    --accent: #5dcaa5;
    --accent-ink: #04342c;
    --accent-soft: #123a30;
    --low: #97c459;
    --low-bg: #1f3310;
    --med: #fac775;
    --med-bg: #3b2a0c;
    --high: #f09595;
    --high-bg: #3f1717;
    --alert-bg: #3b2a0c;
    --alert-line: #ba7517;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Topp */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--brand); color: var(--brand-ink);
}
.brand { font-size: 1.15rem; font-weight: 900; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 22px; height: 22px; color: var(--brand-muted); }
.back { all: unset; cursor: pointer; display: grid; place-items: center; padding: 4px; border-radius: 10px; }
.back .ic { width: 24px; height: 24px; }
.back:focus-visible { outline: 2px solid var(--brand-muted); }

main { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 24px; }
.view { display: flex; flex-direction: column; gap: 16px; }
.view.center { align-items: center; padding-top: 48px; }

/* Knappar */
.btn {
  font: inherit; font-weight: 800; border-radius: 999px; padding: 12px 20px;
  border: 1px solid transparent; cursor: pointer; min-height: 48px;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .chip:focus-visible, .tabbar button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Kamera */
.camera {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #0b100d; aspect-ratio: 4 / 3; max-width: 100%;
  display: grid; place-items: center;
}
#reader { width: 100%; }
#reader video { width: 100% !important; height: auto !important; display: block; }
.camera-idle { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; padding: 16px; }
.camera-idle .muted { color: #a9b7af; }

/* Formulär */
.manual { display: flex; flex-direction: column; gap: 8px; }
.manual label, .field label, legend { font-weight: 600; font-size: .9rem; }
.row { display: flex; gap: 8px; }
input, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
.error { color: var(--high); font-size: .9rem; }
.samples { display: flex; flex-direction: column; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .9rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 12px; cursor: pointer;
}

/* Produkt */
.product-head { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: center; }
.product-img {
  width: 88px; height: 88px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  object-fit: contain; display: grid; place-items: center; color: var(--muted); font-size: .75rem; text-align: center;
}
.product-head h2 { font-size: 1.25rem; }
.meta { color: var(--muted); font-size: .92rem; }
.source {
  display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-top: 6px;
}
.source.community { background: var(--med-bg); color: var(--med); }

.alert {
  border: 1px solid var(--alert-line); background: var(--alert-bg); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.alert strong { font-size: 1rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

.nutrition { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.nutrition td { padding: 8px 0; border-top: 1px solid var(--line); }
.nutrition tr:first-child td { border-top: 0; }
.nutrition td.value { text-align: right; white-space: nowrap; padding-left: 12px; }
.nutrition td.lvl { text-align: right; width: 64px; padding-left: 10px; }
.nutrition tr.sub td:first-child { padding-left: 14px; color: var(--muted); }
.level { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.level.low { color: var(--low); background: var(--low-bg); }
.level.medium { color: var(--med); background: var(--med-bg); }
.level.high { color: var(--high); background: var(--high-bg); }

.additives { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.additives li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.additives li:first-child { border-top: 0; padding-top: 0; }
.additives .code { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.additives .cat { color: var(--muted); font-size: .85rem; }
.additives .note { font-size: .88rem; margin-top: 2px; }

.ingredients { line-height: 1.6; }
.ingredients mark { background: var(--alert-bg); color: inherit; font-weight: 700; border-radius: 3px; padding: 0 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .82rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.tag.allergen { border-color: var(--alert-line); }
.tag.trace { border-style: dashed; }
.fineprint { font-size: .8rem; color: var(--muted); }
.fineprint a { color: var(--accent); }

/* Bidra */
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.photo {
  position: relative; aspect-ratio: 3 / 4; border: 1.5px dashed var(--line); border-radius: 12px;
  background: var(--surface); display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden;
}
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-label { font-size: .85rem; font-weight: 600; padding: 6px; }
.photo.filled { border-style: solid; border-color: var(--accent); }
#photo-step, #contribute-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nutrition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.segmented { display: flex; gap: 16px; }
.segmented label { font-weight: 400; display: flex; gap: 6px; align-items: center; }
.segmented input { width: auto; }
.allergen-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.allergen-grid .a-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: .92rem; }
.allergen-grid select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.notice { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }

/* Profil */
.allergen-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.allergen-list label { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.allergen-list label:first-child { border-top: 0; }
.allergen-list input { width: 20px; height: 20px; accent-color: var(--accent); }
.disclaimer { margin-top: 4px; }

/* Historik */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.history button {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 44px 1fr; gap: 12px;
  align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.history button:focus-visible { outline: 2px solid var(--accent); }
.history img, .history .ph { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: var(--bg); }
.history .name { font-weight: 600; }
.history .sub { font-size: .82rem; color: var(--muted); }

/* Menyrad */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar button {
  all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 10px; font-size: .74rem; font-weight: 700; color: var(--muted);
}
.tabbar button .ic { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--brand-2); font-weight: 800; }
@media (prefers-color-scheme: dark) { .tabbar button[aria-current="page"] { color: var(--accent); } }

/* Övrigt */
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 10;
  max-width: calc(100% - 32px);
}
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
@media (max-width: 380px) {
  .photos { grid-template-columns: 1fr 1fr; }
  .field-row, .nutrition-grid { grid-template-columns: 1fr; }
}

/* ---------- Återkallelseradar ---------- */
.tabbar button { position: relative; }
.tabbar .badge {
  position: absolute; top: 4px; left: calc(50% + 8px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--high); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.recall-alert {
  display: flex; flex-direction: column; gap: 4px;
  margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--high-bg); border: 1px solid var(--high); color: var(--ink);
}
.recall-alert strong { color: var(--high); }
.recall-alert.possible { background: var(--alert-bg); border-color: var(--alert-line); }
.recall-alert.possible strong { color: var(--med); }
.recall-alert a { color: inherit; font-weight: 600; }
.section-title { margin: 22px 0 10px; font-size: 1rem; }
.ok-note { padding: 12px 14px; border-radius: var(--radius); background: var(--low-bg); color: var(--low); }
.recalls { list-style: none; margin: 0; padding: 0; }
.recalls li { border-bottom: 1px solid var(--line); }
.recalls a { display: flex; flex-direction: column; padding: 10px 2px; color: var(--ink); text-decoration: none; }
.recalls .date { font-size: 0.8rem; color: var(--muted); }
.recalls .name { overflow-wrap: anywhere; }

.recall-alert.ok { background: var(--low-bg); border-color: var(--low); }
.recall-alert.ok strong { color: var(--low); }
.recall-alert .btn { margin-top: 6px; }
.small-btn { padding: 6px 12px; font-size: .85rem; width: auto; align-self: flex-start; }
.check-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius);
  background: var(--alert-bg); border: 1px solid var(--alert-line);
}
.check-banner span { overflow-wrap: anywhere; }
.push-card .btn { margin-top: 4px; }
.recalls button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; flex-direction: column; padding: 10px 2px; color: var(--ink);
}
.recalls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#view-recall h2 { margin-top: 0; overflow-wrap: anywhere; }

/* ---------- Datum på förpackningen ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.photo.wide { aspect-ratio: 16 / 7; }
.check { display: flex; gap: 10px; align-items: center; font-size: .92rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.field select { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.plain { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pantry li { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: stretch; }
.pantry .remove {
  all: unset; cursor: pointer; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: .82rem; display: grid; place-items: center;
}
.pantry .remove:focus-visible { outline: 2px solid var(--accent); }
.pantry .when { font-size: .85rem; font-weight: 600; color: var(--low); }
.pantry .soon .when { color: var(--med); }
.pantry .passed .when { color: var(--high); }
.pantry .soon > button:first-child { border-color: var(--alert-line); }
.pantry .passed > button:first-child { border-color: var(--high); }

/* ---------- Råd för gravida och barn ---------- */
.advice-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.advice-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.advice-list p { margin: 2px 0 0; }
.level-tag { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.advice-list .avoid .level-tag { background: var(--high-bg); color: var(--high); }
.advice-list .limit .level-tag { background: var(--med-bg); color: var(--med); }
.advice-list .info .level-tag { background: var(--accent-soft); color: var(--accent); }

/* ---------- Safety Gate ---------- */
.kind-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 4px 0 14px; border-radius: 12px; background: var(--line); }
.kind-switch button { all: unset; cursor: pointer; text-align: center; padding: 8px; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.kind-switch button[aria-selected="true"] { background: var(--surface); color: var(--ink); }
.kind-switch button:focus-visible { outline: 2px solid var(--accent); }
.recalls.alerts button { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.recalls.alerts img, .recalls.alerts .ph { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.recalls.alerts .sub { display: block; font-size: .82rem; color: var(--muted); }
.recalls.alerts .name { display: block; font-weight: 600; }
.alert-pictures { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; }
.alert-pictures img { height: 140px; border-radius: 10px; background: var(--surface); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 14px; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Livsmedel utan streckkod ---------- */
.food-search { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.food-search label { font-weight: 600; font-size: .9rem; }
.food-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.food-results li { border-bottom: 1px solid var(--line); }
.food-results button { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 10px 4px; }
.food-results button:focus-visible { outline: 2px solid var(--accent); }

/* ---------- Förslag B: hjälte, statuschips, näringsrutor, utfällbara kort ---------- */
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.hero {
  margin: -20px -16px 0; padding: 6px 20px 24px;
  background: var(--brand); color: var(--brand-ink);
  border-radius: 0 0 28px 28px;
}
.hero h2 { color: #ffffff; font-size: 1.6rem; }
.hero p { color: var(--brand-muted); }
.scan-hero { display: flex; flex-direction: column; gap: 6px; padding-bottom: 28px; }
.scan-hero h2 { font-size: 1.75rem; }

.product-hero { display: flex; flex-direction: column; gap: 14px; }
.hero-row { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.product-hero .product-img {
  width: 84px; height: 84px; border-radius: 20px; background: #ffffff; border: 0; padding: 6px;
  object-fit: contain; display: grid; place-items: center; color: var(--brand-2);
}
.product-hero .product-img .ic { width: 34px; height: 34px; }
.hero-text { min-width: 0; }
.hero-text h2 { font-size: 1.45rem; overflow-wrap: anywhere; margin: 2px 0; }
.hero-meta { font-size: .9rem; }
.hero-meta.small { font-size: .78rem; }
.hero .mono { color: var(--brand-muted); }

.chips-status { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-status {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 8px; border-radius: 999px;
  font-size: .82rem; font-weight: 800; line-height: 1.2;
}
.chip-status .ic { width: 16px; height: 16px; }
.chip-status.ok { background: #e1f5ee; color: #085041; }
.chip-status.warn { background: #fac775; color: #633806; }
.chip-status.danger { background: #f7c1c1; color: #791f1f; }
.chip-status.neutral { background: #d3d1c7; color: #444441; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px;
}
.tile-value { font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.tile-label { font-size: .78rem; color: var(--muted); }
.tile-level { font-size: .7rem; font-weight: 800; margin-top: 3px; padding: 1px 8px; border-radius: 999px; }
.tile.low .tile-value { color: var(--low); }
.tile.low .tile-level { background: var(--low-bg); color: var(--low); }
.tile.medium .tile-value { color: var(--med); }
.tile.medium .tile-level { background: var(--med-bg); color: var(--med); }
.tile.high .tile-value { color: var(--high); }
.tile.high .tile-level { background: var(--high-bg); color: var(--high); }

details.fold { gap: 0; }
details.fold > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { flex: 1; }
details.fold > summary .chev { transition: transform .15s ease; color: var(--muted); }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold[open] > summary { margin-bottom: 12px; }
details.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

.camera { border-radius: 24px; margin-top: -14px; }
.chip { border-radius: 999px; font-weight: 700; }
.recall-alert, .alert { border-radius: var(--radius); }
.advice { border-color: var(--alert-line); }
.kind-switch { border-radius: 999px; }
.kind-switch button { border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { details.fold > summary .chev { transition: none; } }

.link-btn { display: inline-flex; justify-content: center; align-items: center; text-decoration: none; }
.btn.danger-btn { color: var(--high); border-color: var(--high-bg); }

/* Bild på användarens egen vara i en återkallelse */
.recall-alert.with-thumb { flex-direction: row; align-items: flex-start; gap: 12px; }
.recall-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.recall-thumb { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 12px; background: #ffffff; padding: 4px; }

/* Produktgrupper i Safety Gate */
.sg-groups { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.sg-groups::-webkit-scrollbar { display: none; }
.sg-groups button {
  flex: none; font: inherit; font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.sg-groups button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.sg-sweden, .push-extra { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: .92rem; margin: 6px 0; }
.sg-sweden input, .push-extra input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.push-extra[hidden] { display: none; }

/* Indragna läkemedel */
.med-info { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: var(--radius); background: #e6f1fb; color: #0c447c; border: 1px solid #b5d4f4; margin-bottom: 12px; }
.med-info .btn { align-self: flex-start; }
.med-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.med-list details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.med-list summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.med-list summary::-webkit-details-marker { display: none; }
.med-list .date { font-size: .8rem; color: var(--muted); }
.med-list .name { font-weight: 800; }
.med-list .sub { font-size: .88rem; color: var(--muted); }
.med-list p { margin: 8px 0 0; }
.danger-text { color: #a32d2d; }

/* Bandrollen "Senast larmat" (startsidan och appen) */
.ticker { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.ticker-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticker-head h2, .ticker-head h3 { margin: 0; font-size: 1.1rem; }
.ticker-pause {
  font: inherit; font-size: .82rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.ticker-viewport {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.ticker-track {
  list-style: none; margin: 0; padding: 2px 0; display: flex; gap: 12px; width: max-content;
  animation: ticker-roll var(--ticker-duration, 60s) linear infinite;
}
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track, .ticker.paused .ticker-track, .ticker.touching .ticker-track {
  animation-play-state: paused;
}
/* Halva bandet plus halva mellanrummet: då står kopian exakt där originalet började. */
@keyframes ticker-roll { to { transform: translateX(calc(-50% - 6px)); } }
.ticker-track li { flex: none; width: 140px; }
.ticker-track a, .ticker-track button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; height: 100%;
  display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 8px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.ticker-track a:focus-visible, .ticker-track button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ticker-track img { width: 100%; height: 96px; object-fit: contain; background: #ffffff; border-radius: 10px; }
.t-label { font-size: .72rem; font-weight: 800; color: var(--muted); }
.t-se { color: #0c447c; }
.t-title {
  font-size: .85rem; font-weight: 700; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .ticker-track li[aria-hidden="true"], .ticker-pause { display: none; }
}

.company-card .actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.company-card .btn { text-decoration: none; }
