/* ==========================================================================
   Sparegryta — designsystem
   Alle farger, avstander, radier og skriftstørrelser hentes fra tokens under.
   Endre aksentfargen ett sted: --accent (og varianten i mørk modus).
   ========================================================================== */

:root {
  /* Farger — lys */
  --bg:            #f7f7f5;
  --surface:       #ffffff;
  --surface-2:     #f0f0ed;
  --border:        #e2e2de;
  --border-strong: #c9c9c3;
  --text:          #1b1d1f;
  --text-2:        #565c64;   /* sekundær tekst, 6,6:1 mot hvit */
  --accent:        #1b7a4b;   /* eneste aksentfarge: handlinger og «på tilbud» */
  --accent-hover:  #15653d;
  --accent-fg:     #ffffff;
  --accent-soft:   #e5f1ea;
  --accent-text:   #135c37;   /* aksent som tekst på --accent-soft */
  --danger:        #b42318;
  --focus:         #1b7a4b;
  --shadow-pop:    0 12px 40px rgba(16, 24, 20, .18);

  /* Typografi */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-sm:  0.875rem;  /* 14 */
  --fs-md:  1rem;      /* 16 */
  --fs-lg:  1.125rem;  /* 18 */
  --fs-xl:  1.375rem;  /* 22 */
  --fs-2xl: clamp(1.625rem, 1.2rem + 1.6vw, 2.125rem); /* 26–34 */
  --lh-tight: 1.2;
  --lh: 1.5;

  /* Avstand (4-punkts skala) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* Radius. Indre radius = ytre radius − innvendig avstand (punkt 14). */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;
  --pad-tight: 3px;                                  /* innrykk i segmentkontroller */
  --r-inner: calc(var(--r-md) - var(--pad-tight));   /* = 7px */

  --header-h: 60px;
  --page-max: 1200px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg:            #111315;
  --surface:       #1a1d20;
  --surface-2:     #24282c;
  --border:        #2f3439;
  --border-strong: #454b52;
  --text:          #eceeef;
  --text-2:        #a7adb4;
  --accent:        #52c48a;
  --accent-hover:  #6bd29e;
  --accent-fg:     #0a2618;
  --accent-soft:   #173a29;
  --accent-text:   #86dcae;
  --danger:        #f97066;
  --focus:         #6bd29e;
  --shadow-pop:    0 12px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Navn som admin-siden bruker fra før */
:root {
  --bg-card: var(--surface);
  --bg-item: var(--surface-2);
  --text-head: var(--text);
  --text-muted: var(--text-2);
}

/* ---------- Grunnlag ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { line-height: var(--lh-tight); text-wrap: balance; font-weight: 650; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
  min-height: var(--header-h);
}
.header-inner {
  max-width: var(--page-max); margin: 0 auto; height: var(--header-h);
  padding: 0 var(--s-4);
  display: flex; align-items: center; gap: var(--s-5);
}
.brand { font-weight: 700; font-size: var(--fs-lg); text-decoration: none; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: var(--s-2); }
.brand-mark { width: 22px; height: 22px; color: var(--accent); }
.nav { display: flex; gap: var(--s-1); }
.nav a {
  text-decoration: none; color: var(--text-2); font-weight: 500;
  padding: var(--s-2) var(--s-3); border-radius: var(--r-md);
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }
.header-user { font-size: var(--fs-sm); color: var(--text-2); }
.header-account { gap: var(--s-2); padding-inline: var(--s-2); }
.account-who { margin-bottom: var(--s-5); }
.group > .note + div, .group > div + .note { margin-top: var(--s-2); }

@media (max-width: 720px) {
  .site-header { min-height: calc(var(--header-h) + 44px); }
  .header-inner { flex-wrap: wrap; height: auto; padding-top: var(--s-2); gap: 0 var(--s-3); }
  .header-inner .brand { height: 44px; display: flex; align-items: center; }
  .nav { order: 3; width: 100%; justify-content: space-between; padding-bottom: var(--s-1); }
  .nav a { flex: 1; text-align: center; padding: var(--s-2) var(--s-1); font-size: var(--fs-sm); }
  .header-user { display: none; }
}

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4);
  border-radius: var(--r-md); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-text); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { min-height: 48px; font-size: var(--fs-md); padding: 0 var(--s-5); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  border: 0; background: transparent; color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn.fav[aria-pressed="true"] svg { fill: currentColor; }
.icon-btn-sm { width: 32px; height: 32px; border-radius: var(--r-sm); }

.count-badge {
  position: absolute; top: 3px; right: 1px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full);
  background: var(--accent); color: var(--accent-fg);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.count-badge[hidden] { display: none; }
.bump { animation: bump .35s var(--ease); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- Skjema ---------- */
.input, .select {
  min-height: 40px; width: 100%;
  padding: 0 var(--s-3); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface);
}
.input::placeholder { color: var(--text-2); opacity: .85; }
.select { padding-right: var(--s-6); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767c84' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input:focus, .select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--text-2); pointer-events: none; }
.search .input { padding-left: 38px; }
.field { display: grid; gap: var(--s-1); }
.field label { font-size: var(--fs-sm); font-weight: 600; }

/* Segmentkontroll: ytre radius 10, innrykk 3, indre radius 7 */
.seg {
  display: inline-flex; padding: var(--pad-tight); gap: 2px;
  background: var(--surface-2); border-radius: var(--r-md);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 6px var(--s-3); border-radius: var(--r-inner);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Filterbrikker og butikkvelger */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 36px; padding: 0 var(--s-3);
  border-radius: var(--r-full); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.chip:hover { border-color: var(--text-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip .count { color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .count { color: var(--accent-text); }
.chip .icon { width: 16px; height: 16px; }
.store-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--dot, var(--text-2)); }
.chip-skeleton { width: 96px; border-color: transparent; background: var(--surface-2); }

/* ---------- Sideoppsett ---------- */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-8); }
.page-head { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); max-width: 760px; }
.page-head h1 { font-size: var(--fs-2xl); }
.lede { color: var(--text-2); font-size: var(--fs-md); }
.lede a { color: var(--accent-text); font-weight: 600; text-underline-offset: 3px; }
:root[data-theme="dark"] .lede a { color: var(--accent); }
.section { margin-top: var(--s-6); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.section-head h2 { font-size: var(--fs-lg); }
.stack-2 > * + * { margin-top: var(--s-2); }
.stack-3 > * + * { margin-top: var(--s-3); }

.toolbar { display: grid; gap: var(--s-3); margin: var(--s-5) 0 var(--s-5); }
.toolbar-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.toolbar-row .search { flex: 1 1 260px; }
.toolbar-row .select { width: auto; flex: 0 0 auto; }
.toolbar-row .spacer { flex: 1; }

.empty {
  text-align: center; padding: var(--s-7) var(--s-4);
  color: var(--text-2); border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
}
.empty strong { display: block; color: var(--text); font-size: var(--fs-lg); margin-bottom: var(--s-1); }
.empty .btn { margin-top: var(--s-4); }

/* ---------- Oppskriftskort ---------- */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--s-4); }
.recipe-grid[aria-busy="true"] { opacity: .55; transition: opacity .2s; }
.recipe {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
}
.recipe-top { display: flex; align-items: flex-start; gap: var(--s-2); }
.recipe-title { flex: 1; font-size: var(--fs-lg); }
.recipe-title button {
  border: 0; background: none; padding: 0; text-align: left; font-weight: inherit; line-height: inherit;
}
.recipe-title button:hover { text-decoration: underline; text-underline-offset: 3px; }
.recipe-top .icon-btn { margin: -8px -8px 0 0; } /* optisk: hjertet flukter med kortets kant */
.recipe-meta { font-size: var(--fs-sm); color: var(--text-2); margin-top: calc(var(--s-3) * -1 + 2px); }

.match { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-3); align-items: center; }
.match-bar { height: 6px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.match-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s var(--ease); }
.match-text { font-size: var(--fs-sm); font-weight: 600; color: var(--accent-text); }
:root[data-theme="dark"] .match-text { color: var(--accent); }
.match.none .match-text { color: var(--text-2); font-weight: 500; }

.sale-list { list-style: none; padding: 0; display: grid; gap: 2px; }
.sale-list li {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: var(--s-3);
  font-size: var(--fs-sm); padding: 5px 0; border-bottom: 1px solid var(--border);
}
.sale-list li:last-child { border-bottom: 0; }
.sale-list .ing { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.sale-list .ing span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rest { font-size: var(--fs-sm); color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recipe-actions { margin-top: auto; display: flex; gap: var(--s-2); }
.recipe-actions .btn { flex: 1; }
/* Kortknappen er sekundær; hovedhandlingen er i oppskriftsvisningen og handlelisten */
.btn-add .icon { color: var(--accent); }
.btn-add[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-text); }
.btn-add[aria-pressed="true"] .icon { color: inherit; }
.pantry-badge { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.pantry-badge.full { color: var(--accent-text); }

.more-row { display: flex; justify-content: center; margin-top: var(--s-5); }

/* Skjelett (lastetilstand) */
.skeleton { background: var(--surface-2); border-radius: var(--r-sm); }
.recipe.is-skeleton .skeleton { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* ---------- Dialog (oppskrift, handleliste, velgere) ---------- */
dialog.sheet {
  padding: 0; border: 0; color: var(--text); background: var(--surface);
  width: min(560px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh;
  margin: 0 0 0 auto; border-radius: var(--r-lg) 0 0 var(--r-lg);
  box-shadow: var(--shadow-pop);
}
dialog.sheet.center { margin: auto; height: auto; max-height: min(86dvh, 760px); border-radius: var(--r-lg); width: min(640px, calc(100vw - 32px)); }
dialog.sheet::backdrop { background: rgba(10, 12, 14, .45); }
dialog.sheet[open] { animation: sheet-in .22s var(--ease); }
dialog.sheet.center[open] { animation: pop-in .18s var(--ease); }
@keyframes sheet-in { from { transform: translateX(24px); opacity: 0; } }
@keyframes pop-in { from { transform: translateY(8px); opacity: 0; } }
.sheet-inner { display: flex; flex-direction: column; height: 100%; max-height: inherit; }
.sheet-head {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--border);
}
.sheet-head h2 { flex: 1; font-size: var(--fs-xl); padding-top: 6px; }
.sheet-head .icon-btn { margin-right: -4px; }
.sheet-body { flex: 1; overflow-y: auto; padding: var(--s-4) var(--s-5) var(--s-5); }
.sheet-foot { padding: var(--s-3) var(--s-5) var(--s-4); border-top: 1px solid var(--border); display: grid; gap: var(--s-2); }
@media (max-width: 640px) {
  dialog.sheet, dialog.sheet.center {
    width: 100vw; margin: auto 0 0; height: auto; max-height: 92dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  dialog.sheet[open], dialog.sheet.center[open] { animation: sheet-up .22s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
}

.group + .group { margin-top: var(--s-5); }
.group-title {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-sm); font-weight: 700; margin-bottom: var(--s-2);
}
.group-title .sum { margin-left: auto; font-variant-numeric: tabular-nums; }
.rows { list-style: none; padding: 0; }
.rows li {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-3); align-items: center;
  padding: var(--s-2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
}
.rows li:last-child { border-bottom: 0; }
.rows .sub { grid-column: 1; color: var(--text-2); font-size: 13px; }
.rows .end { display: flex; align-items: center; gap: var(--s-1); justify-content: flex-end; }

.stepper { display: inline-flex; align-items: center; gap: 2px; padding: var(--pad-tight); border-radius: var(--r-md); background: var(--surface-2); }
.stepper button { width: 28px; height: 28px; border: 0; border-radius: var(--r-inner); background: transparent; display: grid; place-items: center; color: var(--text); }
.stepper button:hover { background: var(--surface); }
.stepper output { min-width: 4.5ch; text-align: center; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-3); font-size: var(--fs-sm); }
.totals .grand { font-size: var(--fs-md); font-weight: 700; }
.note { font-size: 13px; color: var(--text-2); }
.btn-row { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

.recipe-detail .meta-row { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--s-4); }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.detail-section + .detail-section { margin-top: var(--s-5); }
.detail-section h3 { font-size: var(--fs-md); margin-bottom: var(--s-2); display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.ing-rows li.on-sale .name { font-weight: 600; }
.steps { padding-left: 1.25em; display: grid; gap: var(--s-2); }
.steps li { padding-left: var(--s-1); }
.steps li::marker { color: var(--text-2); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 600; color: var(--text-2); padding: var(--s-2) var(--s-2); border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.table td { padding: var(--s-2); border-bottom: 1px solid var(--border); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 700; border-bottom: 0; }
.best { color: var(--accent-text); font-weight: 700; }
:root[data-theme="dark"] .best { color: var(--accent); }

/* ---------- Tilbudsside ---------- */
.offer-store + .offer-store { margin-top: var(--s-6); }
.offer-store-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.offer-store-head h2 { font-size: var(--fs-lg); }
.offer-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 var(--s-6); }
.offer-list li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--s-3);
  padding: var(--s-2) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
}
.offer-list .name { min-width: 0; }
.offer-list .unit { color: var(--text-2); font-weight: 400; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ---------- Ukesmeny ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-2); }
@media (max-width: 1000px) { .week { grid-template-columns: 1fr; gap: 0; } }
.day { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); min-height: 150px; }
@media (max-width: 1000px) {
  .day { min-height: 0; border-radius: 0; border-width: 0 0 1px; background: transparent; padding: var(--s-3) 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .day-label { width: 84px; }
  .day .meals { flex: 1; }
}
.day-label { font-size: var(--fs-sm); font-weight: 700; }
.meals { display: grid; gap: var(--s-2); }
.meal { display: grid; gap: var(--s-1); padding: var(--s-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.day, .meal { min-width: 0; }
.meal-name { flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; text-align: left; border: 0; background: none; padding: 0; overflow-wrap: anywhere; }
.meal-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.meal-row { display: flex; align-items: flex-start; gap: var(--s-1); justify-content: space-between; }
.meal-row .icon-btn { margin: -6px -6px 0 0; }
.meal .stepper { justify-self: start; }
.meal .stepper button { width: 24px; height: 24px; }
.meal .stepper output { min-width: 5ch; font-size: 13px; }
.meal .match-text { font-size: 13px; }
.day .add { margin-top: auto; }
@media (max-width: 1000px) { .day .add { margin-top: 0; } }
.add-btn { width: 100%; min-height: 34px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.add-btn:hover { color: var(--text); border-color: var(--text-2); }
.picker-item { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s-3); width: 100%; text-align: left; padding: var(--s-3); border: 0; border-bottom: 1px solid var(--border); background: transparent; }
.picker-item:hover { background: var(--surface-2); }
.picker-item .sub { font-size: 13px; color: var(--text-2); }

/* ---------- Innlogging ---------- */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: var(--s-6) var(--s-4); }
.auth-card { width: min(400px, 100%); }
.auth-card h1 { font-size: var(--fs-2xl); margin-bottom: var(--s-2); }
.auth-card .seg { width: 100%; margin: var(--s-5) 0; }
.auth-card .seg button { flex: 1; }
.form { display: grid; gap: var(--s-4); }
.alert { padding: var(--s-3); border-radius: var(--r-md); font-size: var(--fs-sm); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); color: var(--danger); }

/* ---------- Varsel (toast) ---------- */
.toast-host { position: fixed; left: 50%; bottom: var(--s-5); translate: -50% 0; z-index: 100; display: grid; justify-items: center; gap: var(--s-2); pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--text); color: var(--bg); font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-pop); animation: toast-in .2s var(--ease);
}
.toast.error { background: var(--danger); color: #fff; }
.toast button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 0; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Lengre tekst (personvern) ---------- */
.prose { max-width: 760px; }
.prose section { display: grid; gap: var(--s-2); margin-bottom: var(--s-6); }
.prose h2 { font-size: var(--fs-xl); text-wrap: balance; }
.prose p, .prose li { line-height: 1.6; color: var(--text); }
.prose ul { padding-left: 1.25em; display: grid; gap: var(--s-1); }
