/* Inköpet – samma formspråk som Receptet. Typsnitt laddas i views/partials/head.ejs. */

:root{
  color-scheme: light;
  --bg: #F5F6F1;
  --card: #FFFFFF;
  --ink: #1B221D;
  --ink-soft: #3F4A42;
  --muted: #66716A;
  --line: #E6EAE2;
  --accent: #1A4D2F;
  --accent-2: #2F7D4C;
  --accent-ink: #1A4D2F;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --tint: #E3EEDD;
  --danger: #B3261E;
  --ok: #1F6F4A;
  --shadow: 0 6px 18px -8px rgba(20,45,28,.22);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --nav-h: 76px;
  --logo-green: #1A4D2F;
  --line-strong: #D5DCCF;
  --err-bg: #FDECEA;
  --ok-bg: #E8F4EC;
  --sel: #CFE3C4;
}

/* Mörkt läge: följer systemet tills man valt själv med temaknappen (data-theme på <html>). */
@media (prefers-color-scheme: dark){
  :root:not([data-theme]){
    color-scheme: dark;
    --bg: #111612;
    --card: #1A211C;
    --ink: #EEF3EC;
    --ink-soft: #CFD9CF;
    --muted: #9AA79C;
    --line: #2A352C;
    --line-strong: #3B493D;
    --accent: #25683D;
    --accent-2: #348252;
    --accent-ink: #9BD8AE;
    --tint: #1E3727;
    --danger: #FFB4AB;
    --ok: #8FD6A8;
    --err-bg: #3A1D1A;
    --ok-bg: #173022;
    --sel: #2F5A3D;
    --shadow: 0 6px 18px -8px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --bg: #111612;
  --card: #1A211C;
  --ink: #EEF3EC;
  --ink-soft: #CFD9CF;
  --muted: #9AA79C;
  --line: #2A352C;
  --line-strong: #3B493D;
  --accent: #25683D;
  --accent-2: #348252;
  --accent-ink: #9BD8AE;
  --tint: #1E3727;
  --danger: #FFB4AB;
  --ok: #8FD6A8;
  --err-bg: #3A1D1A;
  --ok-bg: #173022;
  --sel: #2F5A3D;
  --shadow: 0 6px 18px -8px rgba(0,0,0,.6);
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.45;
}
a{ color: var(--accent-ink); }
img{ max-width: 100%; }
:focus-visible{ outline: 3px solid var(--ink); outline-offset: 2px; }
::selection{ background: var(--sel); }
h1,h2,h3{ font-family: var(--serif); }

.only-mobile{ display: none !important; }

/* ---------- Gemensamma byggstenar ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 16px; line-height: 1;
  min-height: 48px; padding: 0 22px; border-radius: 16px; border: 2px solid transparent;
  background: var(--grad); color: #fff; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 20px -10px rgba(26,77,47,.7);
}
.btn:hover{ filter: brightness(1.05); }
.btn:active{ transform: translateY(1px); }
.btn.sm{ min-height: 42px; padding: 0 18px; font-size: 15px; border-radius: 14px; }
.btn.block{ width: 100%; }
.btn.secondary{ background: var(--card); color: var(--accent-ink); border-color: var(--line); box-shadow: none; }
.btn:disabled{ opacity: .55; cursor: not-allowed; }

.circle{
  width: 42px; height: 42px; border-radius: 50%; background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  box-shadow: var(--shadow); border: 0; cursor: pointer; text-decoration: none; padding: 0;
}
.circle svg{ width: 20px; height: 20px; }
.circle.accent{ color: var(--accent-ink); }
.circle.solid{ background: var(--grad); color: #fff; }

.alert{ border-radius: 14px; padding: 12px 16px; font-size: 14.5px; margin-bottom: 16px; font-weight: 500; }
.alert.error{ background: var(--err-bg); color: var(--danger); }
.alert.notice{ background: var(--ok-bg); color: var(--ok); }

.card{ background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 24px; }

.field{ margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label, .lab{ font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin: 0 2px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=search],
.field select, .field textarea{
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid transparent;
  background: var(--card); box-shadow: var(--shadow); width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus{ outline: none; border-color: var(--accent); }
.field textarea{ resize: vertical; min-height: 120px; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder{ color: #9AA39B; }

.review-note{ font-size: 14px; color: var(--muted); margin: 0 2px 16px; line-height: 1.5; }
.review-note a{ font-weight: 600; }

.container{ max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }
.container.narrow{ max-width: 560px; }
h1.page-title{ font-weight: 700; font-size: 30px; line-height: 1.15; margin: 4px 0 18px; }

/* ---------- Toppfält, kontomeny, bottenmeny ---------- */
.topbar{
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 68px; padding: 10px 28px; background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.brand{ display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 24px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.top-actions{ display: flex; align-items: center; gap: 12px; }
.avatar{
  width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--tint); color: var(--accent-ink); font: 700 16px var(--sans);
  display: inline-flex; align-items: center; justify-content: center;
}

.account-sheet{ position: fixed; inset: 0; z-index: 40; background: rgba(12,24,15,.3); display: flex; justify-content: flex-end; align-items: flex-start; padding: 64px 24px 0; }
.account-sheet[hidden]{ display: none; }
.account-card{ background: var(--card); border-radius: 20px; box-shadow: 0 24px 50px -20px rgba(20,45,28,.45); min-width: 240px; padding: 8px; }
.account-who{ padding: 12px 14px 10px; font-size: 14px; color: var(--muted); word-break: break-all; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-card a, .account-card button{
  display: block; width: 100%; text-align: left; padding: 13px 14px; border-radius: 12px; border: 0; background: none;
  font: 600 16px var(--sans); color: var(--ink); text-decoration: none; cursor: pointer;
}
.account-card a:hover, .account-card button:hover{ background: var(--tint); }
.account-card form{ margin: 0; }

.bottom-nav{
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); z-index: 30;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 14px calc(6px + env(safe-area-inset-bottom));
  display: flex; gap: 6px;
}
.bottom-nav a, .bottom-nav button{
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 600 12.5px var(--sans); color: var(--muted); border-radius: 14px; border: 0; background: none;
  text-decoration: none; cursor: pointer;
}
.bottom-nav svg{ width: 23px; height: 23px; }
.bottom-nav .on{ color: var(--accent-ink); background: var(--tint); }

/* ---------- Inloggning ---------- */
.login-wrap{ min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.brand-mark{ width: 34px; height: 34px; border-radius: 10px; flex: none; }
.sr-only{ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.error-card{ padding: 32px 26px; text-align: center; max-width: 420px; width: 100%; }
.error-card p{ margin: 0 0 18px; font-size: 17px; }

/* ---------- Startsida / inloggning: gröna fältet ---------- */
.welcome{ min-height: 100vh; display: flex; flex-direction: column; background: var(--logo-green); }
.welcome-field{ flex: 1; padding: 20px 26px; text-align: center; color: #EEF3E6; display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* Logotypens egen gröna bakgrund är sidans bakgrund; kanterna tonas ut så att fyrkanten inte syns. */
.welcome-logo{
  width: min(228px, 60vw, 27vh); height: auto; display: block;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.welcome-head{ text-wrap: balance; font-family: var(--serif); font-weight: 700; font-size: 25px; line-height: 1.2; max-width: 19ch; margin: 8px 0; color: #F4F7EE; }
.welcome-sub{ text-wrap: balance; font-size: 15px; line-height: 1.45; max-width: 34ch; margin: 0 0 14px; color: #D3E2CA; }
.welcome-ways{ list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.welcome-ways li{ font-size: 12.5px; font-weight: 600; padding: 6px 13px; border: 1px solid rgba(238,243,230,.35); border-radius: 20px; color: #EEF3E6; }
.welcome-share{ display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 15px; border-radius: 20px; background: #A9D06B; color: #143A22; font-size: 13.5px; font-weight: 700; }
.welcome-share svg{ width: 16px; height: 16px; flex: none; }
.welcome-sheet{ background: var(--bg); border-radius: 30px 30px 0 0; padding: 22px 24px 26px; }
.welcome-sheet .field{ margin-bottom: 12px; }
.welcome-sheet .hint{ text-align: center; font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }
@media (min-width: 900px){
  .welcome{ flex-direction: row; }
  .welcome-field{ flex: 1.15; padding: 40px; }
  .welcome-logo{ width: min(380px, 30vw, 46vh); }
  .welcome-head{ font-size: 36px; max-width: 18ch; margin: 14px 0 12px; }
  .welcome-sub{ font-size: 18px; max-width: 34ch; margin-bottom: 20px; }
  .welcome-ways li{ font-size: 14px; padding: 7px 16px; }
  .welcome-share{ font-size: 15px; padding: 10px 18px; margin-top: 16px; }
  .welcome-sheet{ flex: 1; border-radius: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 8vw; }
  .welcome-sheet form{ max-width: 380px; width: 100%; }
}

/* ---------- Bläddra bland recept ---------- */
.app{ display: grid; grid-template-columns: 276px minmax(0, 1fr); align-items: start; }
.sidebar, .main{ min-width: 0; }
.sidebar{ position: sticky; top: 68px; max-height: calc(100vh - 68px); overflow-y: auto; padding: 8px 14px 24px 28px; display: flex; flex-direction: column; gap: 16px; }
.search-wrap{ position: relative; }
.search-wrap input{
  width: 100%; height: 50px; font: 500 15.5px var(--sans); color: var(--ink); background: var(--card);
  border: 1.5px solid transparent; border-radius: 25px; padding: 0 14px 0 44px; box-shadow: var(--shadow);
}
.search-wrap input:focus{ outline: none; border-color: var(--accent); }
.search-wrap input::placeholder{ color: #8A948C; }
.search-wrap svg{ position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }

.cat-list{ display: flex; flex-direction: column; gap: 2px; }
.cat-btn{
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  min-height: 42px; padding: 0 14px; border-radius: 13px; border: 0; background: transparent;
  color: var(--ink-soft); font: 500 15.5px var(--sans); cursor: pointer;
}
.cat-btn:hover{ background: var(--card); }
.cat-btn .name{ flex: 1; }
.cat-btn .count{ font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cat-btn[aria-pressed="true"]{ background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 8px 16px -8px rgba(26,77,47,.8); }
.cat-btn[aria-pressed="true"] .count{ color: rgba(255,255,255,.9); }

.main{ padding: 8px 28px 60px 14px; min-width: 0; }
.main-header{ display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.main-header h1{ font-weight: 700; font-size: 32px; line-height: 1.1; margin: 0; }
.result-count{ font-size: 14px; color: var(--muted); }

.grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.rcard{
  background: var(--card); border: 0; border-radius: 22px; padding: 8px; text-align: left; cursor: pointer;
  box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--ink); min-width: 0; font: inherit;
}
.rcard:hover{ transform: translateY(-2px); }
.rcard h3{ font-weight: 600; font-size: 17px; line-height: 1.22; margin: 12px 6px 8px; min-height: 42px; overflow-wrap: anywhere; }
.rcard .meta{ display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 6px 8px; font-size: 12.5px; color: var(--muted); }
.rcard .meta b{ flex: none; font-weight: 600; color: var(--accent-ink); background: var(--tint); border-radius: 10px; padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.rcard .meta em{ font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shared-by{ display: block; margin: -2px 6px 8px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tile{ position: relative; border-radius: 16px; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--tile-bg, var(--t, #FFE8C7)); }
.tile::before{ content: ""; position: absolute; width: 120%; height: 120%; left: -10%; top: -30%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.65), rgba(255,255,255,0) 55%); }
.tile::after{ content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -50px; bottom: -60px; background: rgba(255,255,255,.35); }
.tile span{ position: relative; z-index: 1; font-size: 52px; line-height: 1; filter: drop-shadow(0 6px 6px rgba(25,45,28,.22)); }

.empty{ padding: 60px 20px; text-align: center; color: var(--muted); }
.empty .big{ font-family: var(--serif); font-size: 22px; color: var(--ink); margin-bottom: 6px; }

/* ---------- Receptvy (ruta över listan) ---------- */
.overlay{ position: fixed; inset: 0; background: rgba(12,24,15,.5); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.overlay[hidden]{ display: none; }
.detail{ background: var(--bg); border-radius: 28px; max-width: 640px; width: 100%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); position: relative; overflow: hidden; outline: none; }
/* Egna bilder på recept */
.tile.has-photo::before, .tile.has-photo::after{ display: none; }
.tile.has-photo img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-actions{ display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; }
.photo-actions .btn svg{ width: 18px; height: 18px; flex: none; }
.photo-status{ font-size: 13.5px; color: var(--muted); }
.detail .dhero .tile{ aspect-ratio: auto; height: 230px; border-radius: 0; }
.detail .dhero .tile span{ font-size: 104px; margin-top: -8px; }
.detail-actions{ position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; z-index: 3; }
.detail-actions-right{ display: flex; gap: 10px; }
.detail-body{ position: relative; z-index: 2; margin-top: -28px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 26px 24px 32px; }
.detail h2{ font-weight: 700; font-size: 30px; line-height: 1.12; margin: 0 0 12px; overflow-wrap: anywhere; }
.pills{ display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.pill{ height: 32px; padding: 0 13px; border-radius: 16px; background: var(--tint); color: var(--accent-ink); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; }
.pill.plain{ background: var(--card); color: var(--ink-soft); box-shadow: 0 2px 8px -4px rgba(20,45,28,.25); }
.detail h4{ font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 0 0 10px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.ing-list{ background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 4px 18px; margin-bottom: 24px; }
.ing-list div{ padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.ing-list div:last-child{ border-bottom: 0; }
.steps{ margin-bottom: 8px; }
.step{ display: flex; gap: 12px; margin-bottom: 16px; font-size: 16px; line-height: 1.6; }
.step i{ flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; font-style: normal; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.step-plain{ font-size: 16px; line-height: 1.65; white-space: pre-wrap; }
.kalla a{ overflow-wrap: anywhere; }
.anteckning{ margin-top: 18px; font-size: 14.5px; line-height: 1.55; color: var(--muted); background: var(--card); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); }

/* ---------- Lägg till / redigera recept ---------- */
.mode-tabs{ display: flex; gap: 4px; background: var(--card); border-radius: 24px; padding: 4px; box-shadow: var(--shadow); margin-bottom: 18px; }
.mode-tab{
  flex: 1; min-height: 42px; border-radius: 20px; border: 0; background: transparent; color: var(--ink-soft);
  font: 600 14.5px var(--sans); cursor: pointer; padding: 0 8px;
}
.mode-tab[aria-selected="true"]{ background: var(--grad); color: #fff; box-shadow: 0 6px 12px -6px rgba(26,77,47,.8); }
.mode-panel[hidden]{ display: none; }
.panel{ margin-bottom: 20px; }

.record-btn{ display: inline-flex; align-items: center; gap: 10px; }
.record-btn .dot{ width: 10px; height: 10px; border-radius: 50%; background: var(--danger); display: none; }
.record-btn.recording .dot{ display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse{ 0%,100%{ opacity: 1; } 50%{ opacity: .25; } }

.photo-drop{ display: block; border: 2px dashed var(--line-strong); border-radius: 18px; padding: 28px 18px; text-align: center; color: var(--muted); font-size: 15px; cursor: pointer; background: var(--card); }
.photo-drop img{ max-height: 260px; border-radius: 12px; margin-top: 10px; }

.spinner{ width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin{ to{ transform: rotate(360deg); } }

.kchips{ display: flex; flex-wrap: wrap; gap: 8px; }
.kchip{ position: relative; }
.kchip input{ position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.kchip span{ display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 20px; background: var(--card); color: var(--ink-soft); font-weight: 600; font-size: 14.5px; box-shadow: 0 2px 8px -4px rgba(20,45,28,.25); }
.kchip input:checked + span{ background: var(--grad); color: #fff; box-shadow: 0 8px 16px -8px rgba(26,77,47,.8); }
.kchip input:focus-visible + span{ outline: 3px solid var(--ink); outline-offset: 2px; }
.field-group{ margin-bottom: 18px; }
.form-actions{ display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
#parseStatus:empty{ display: none; }
#parseStatus{ margin-top: 14px; }
#parseStatus .alert{ margin-bottom: 0; }

/* ---------- Tidigare versioner ---------- */
.version{ margin-bottom: 16px; }
.version h4{ font-family: var(--serif); font-size: 18px; margin: 16px 0 6px; font-weight: 600; }
.version .when{ font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.version .body{ white-space: pre-wrap; font-size: 15.5px; line-height: 1.6; }

/* ---------- Användare (admin) ---------- */
table.users{ width: 100%; border-collapse: collapse; font-size: 15px; }
table.users th, table.users td{ text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
table.users th{ color: var(--muted); font-weight: 600; font-size: 13px; }
table.users td{ overflow-wrap: anywhere; }
.role-pill{ font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--card); box-shadow: 0 2px 8px -4px rgba(20,45,28,.25); color: var(--ink-soft); }
.role-pill.admin{ background: var(--tint); color: var(--accent-ink); }
.section-title{ font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 0 0 8px; }

/* ---------- Användare och delning ---------- */
.stack{ display: flex; flex-direction: column; gap: 12px; }
.user-row{ display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; }
.user-main{ min-width: 0; flex: 1 1 200px; }
.user-email{ font-weight: 600; overflow-wrap: anywhere; }
.user-meta{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.user-actions{ display: flex; gap: 8px; align-items: center; }
.user-actions form{ margin: 0; }
.btn.danger{ background: transparent; color: var(--danger); border-color: var(--danger); box-shadow: none; }
.btn.danger:hover{ background: var(--err-bg); filter: none; }

.check-list{ display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.check-row{ display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 14px; background: var(--bg); border-radius: 14px; cursor: pointer; }
.check-row input{ width: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.check-row span{ overflow-wrap: anywhere; font-weight: 500; }
.check-row small{ display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.plain-list{ margin: 0; padding-left: 20px; }
.plain-list li{ margin-bottom: 4px; overflow-wrap: anywhere; }
code{ font-family: ui-monospace, Menlo, monospace; font-size: .92em; background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* ---------- Mobil ---------- */
@media (max-width: 860px){
  .only-desktop{ display: none !important; }
  .only-mobile{ display: flex !important; }
  body{ padding-bottom: calc(var(--nav-h) + 12px); }

  .topbar{ padding: 8px 18px; min-height: 60px; }
  .brand{ font-size: 23px; }
  .account-sheet{ align-items: flex-end; justify-content: center; padding: 0 12px calc(var(--nav-h) + 8px); }
  .account-card{ width: 100%; }

  .app{ grid-template-columns: minmax(0, 1fr); }
  .sidebar{ position: static; max-height: none; overflow: visible; padding: 4px 18px 6px; gap: 14px; }
  .cat-list{ flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 8px; margin: 0 -18px; padding: 2px 18px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .cat-list::-webkit-scrollbar{ display: none; }
  .cat-btn{ width: auto; flex: none; white-space: nowrap; min-height: 40px; padding: 0 16px; border-radius: 20px; background: var(--card); box-shadow: 0 2px 8px -4px rgba(20,45,28,.25); font-weight: 600; font-size: 14.5px; }
  .cat-btn .count{ display: none; }
  .main{ padding: 8px 18px 24px; }
  .main-header h1{ font-size: 26px; }
  .grid{ grid-template-columns: 1fr 1fr; gap: 12px; }
  .rcard h3{ font-size: 15.5px; margin: 10px 4px 6px; min-height: 38px; }
  .rcard .meta{ margin: 0 4px 6px; flex-wrap: wrap; row-gap: 4px; }
  .tile span{ font-size: 46px; }

  .container{ padding: 8px 18px 28px; }
  h1.page-title{ font-size: 26px; }
  .card{ padding: 20px; border-radius: 20px; }

  .overlay{ padding: 0; }
  .detail{ border-radius: 0; min-height: 100vh; max-width: none; }
  .detail-actions{ position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 14px; right: 14px; }
  .detail-body{ padding: 24px 18px 36px; }
  .detail h2{ font-size: 27px; }

}

@media (max-width: 380px){
  .mode-tab{ font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rcard:hover{ transform: none; }
}
.ing-list .sub{ font-family: var(--serif); font-weight: 600; font-size: 16.5px; padding-top: 16px; }

/* ---------- Mörkt läge: överskrivningar (måste ligga efter basreglerna) ---------- */
@media (prefers-color-scheme: dark){
  :root:not([data-theme]) .tile{ --tile-bg: var(--td, #4A3F37); }
  :root:not([data-theme]) .tile::before{ background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,255,255,0) 55%); }
  :root:not([data-theme]) .tile::after{ background: rgba(255,255,255,.08); }
  :root:not([data-theme]) .account-card{ box-shadow: 0 24px 50px -20px rgba(0,0,0,.8); }
  :root:not([data-theme]) .overlay, :root:not([data-theme]) .account-sheet{ background: rgba(0,0,0,.6); }
}
:root[data-theme="dark"] .tile{ --tile-bg: var(--td, #4A3F37); }
:root[data-theme="dark"] .tile::before{ background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,255,255,0) 55%); }
:root[data-theme="dark"] .tile::after{ background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .account-card{ box-shadow: 0 24px 50px -20px rgba(0,0,0,.8); }
:root[data-theme="dark"] .overlay, :root[data-theme="dark"] .account-sheet{ background: rgba(0,0,0,.6); }

/* ---------- Inställning: mörkt läge (switch i kontomenyn) ---------- */
.account-card .setting{ display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.switch{ position: relative; flex: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line-strong); transition: background .2s; }
.switch .knob{ position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.3); transition: transform .2s; }
.setting[aria-checked="true"] .switch{ background: var(--grad); }
.setting[aria-checked="true"] .switch .knob{ transform: translateX(20px); }
.setting:focus-visible .switch{ outline: 3px solid var(--ink); outline-offset: 2px; }
.account-card .setting[hidden]{ display: none; }
.account-card .setting-note{ margin: 2px 14px 10px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.account-card .setting-note[hidden]{ display: none; }

/* Inköpslista */
.ing-head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.ing-head h4{ margin: 0; }
.shop-bar{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.shop-count{ font-size: 14px; color: var(--muted); }
.check-head{ font-family: var(--serif); font-weight: 600; font-size: 16.5px; padding: 10px 4px 0; }

/* Väntevisning och felmeddelande vid AI-tolkning */
.wait, .fail{ display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-radius: 18px; padding: 18px 20px; }
.wait{ position: relative; overflow: hidden; background: var(--ok-bg); color: var(--ok); padding-bottom: 24px; }
.wait-ring{ flex: none; width: 40px; height: 40px; border-radius: 50%; border: 4px solid currentColor; border-top-color: transparent; opacity: .85; animation: spin 1s linear infinite; }
.wait-text, .fail-text{ display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 220px; }
.wait-text strong, .fail-text strong{ font-size: 16.5px; font-weight: 700; }
.wait-hint, .fail-msg, .fail-hint{ font-size: 14.5px; line-height: 1.45; font-weight: 500; }
.wait-time{ font-size: 13px; font-weight: 500; opacity: .8; font-variant-numeric: tabular-nums; }
.wait-bar{ position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(0,0,0,.08); }
.wait-bar i{ position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 3px; background: currentColor; opacity: .75; animation: wait-slide 1.4s ease-in-out infinite; }
@keyframes wait-slide{ 0%{ left: -40%; } 100%{ left: 102%; } }
.fail{ background: var(--err-bg); color: var(--danger); border: 2px solid var(--danger); }
.fail-icon{ flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--danger); color: var(--err-bg); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }
.fail-hint{ opacity: .85; }
.fail-retry{ flex: none; }
@media (prefers-reduced-motion: reduce){
  .wait-ring{ animation-duration: 3s; }
  .wait-bar i{ animation: none; left: 0; width: 100%; opacity: .35; }
}

/* =================================================================
   Inköpet
   ================================================================= */
.top-nav{ display: flex; gap: 4px; }
.top-nav a{ font: 600 15px var(--sans); color: var(--ink-soft); text-decoration: none; padding: 10px 14px; border-radius: 12px; }
.top-nav a.on{ background: var(--tint); color: var(--accent-ink); }
.welcome-logo.plain{ -webkit-mask-image: none; mask-image: none; border-radius: 36px; margin-bottom: 8px; }
.link-btn{ border: 0; background: none; padding: 6px 4px; font: 600 14.5px var(--sans); color: var(--accent-ink); cursor: pointer; }
.link-btn.danger{ color: var(--danger); }
.back-link{ display: inline-block; font-weight: 600; text-decoration: none; margin: 4px 0 6px; }
.loading{ color: var(--muted); text-align: center; padding: 30px 0; }

/* Listöversikt */
.list-card{ display: flex; align-items: center; gap: 14px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.list-card:hover{ transform: translateY(-1px); }
.list-card-main{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-card-name{ font: 700 18px var(--sans); overflow-wrap: anywhere; }
.list-card-meta{ font-size: 13.5px; color: var(--muted); }
.list-card-count{ flex: none; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; background: var(--tint); color: var(--accent-ink); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.chev{ font-size: 26px; color: var(--muted); }
.new-list{ margin-top: 26px; display: flex; gap: 10px; align-items: flex-end; }
.new-list .field{ flex: 1; margin: 0; }

/* Listvy */
.list-head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.list-title{ border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; min-width: 0; }
.list-title .page-title{ margin: 4px 0; overflow-wrap: anywhere; }
.list-actions{ display: flex; gap: 10px; align-items: center; flex: none; }
.list-actions .btn svg{ width: 19px; height: 19px; }

.add-form{ position: sticky; top: 68px; z-index: 15; padding: 6px 0 12px; background: var(--bg); }
.add-wrap{ display: flex; gap: 10px; align-items: center; }
.add-wrap input{
  flex: 1; min-width: 0; height: 52px; font: 500 16px var(--sans); color: var(--ink); background: var(--card);
  border: 1.5px solid transparent; border-radius: 26px; padding: 0 20px; box-shadow: var(--shadow);
}
.add-wrap input:focus{ outline: none; border-color: var(--accent); }
.add-wrap .circle{ width: 52px; height: 52px; }
.suggest{ list-style: none; margin: 8px 0 0; padding: 6px; background: var(--card); border-radius: 18px; box-shadow: 0 18px 40px -18px rgba(20,45,28,.45); position: absolute; left: 0; right: 62px; z-index: 16; }
.suggest li{ display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 12px; cursor: pointer; font-weight: 500; }
.suggest li[aria-selected=true], .suggest li[role=option]:hover{ background: var(--tint); }
.suggest .suggest-head{ font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 12px 4px; cursor: default; }
.suggest .suggest-head:hover{ background: none; }

.sync-note{ font-size: 14px; font-weight: 500; color: var(--ok); background: var(--ok-bg); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.sync-note.error{ color: var(--danger); background: var(--err-bg); }

.item-group{ margin-bottom: 14px; }
.group-head{ display: flex; align-items: center; gap: 8px; font: 700 13px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 4px 8px; }
.group-emoji{ font-size: 16px; }
.item{ display: flex; align-items: stretch; background: var(--card); border-radius: 16px; box-shadow: 0 3px 10px -6px rgba(20,45,28,.3); margin-bottom: 8px; transition: opacity .25s, transform .25s; }
.item.leaving{ opacity: 0; transform: translateX(14px); }
.check{ flex: none; width: 56px; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 16px 0 0 16px; }
.check-mark{ width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-strong); display: block; position: relative; transition: background .15s, border-color .15s; }
.item.checked .check-mark{ background: var(--grad); border-color: transparent; }
.item.checked .check-mark::after{ content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.item-body{ flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 12px 16px 12px 0; cursor: pointer; color: var(--ink); font: inherit; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; }
.item-line{ display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.item-name{ font-weight: 600; font-size: 16.5px; overflow-wrap: anywhere; }
.item-qty{ flex: none; font-size: 14.5px; font-weight: 600; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.item-meta{ font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.item.checked{ box-shadow: none; background: transparent; }
.item.checked .item-name{ text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item.checked .item-qty{ color: var(--muted); }

.done-section{ margin-top: 22px; border-top: 1px solid var(--line); padding-top: 10px; }
.done-head{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

/* Handla-läge: större träffytor och butiksraden överst */
.shop-bar-live{ display: flex; align-items: center; gap: 10px; background: var(--tint); border-radius: 18px; padding: 10px 10px 10px 14px; margin-bottom: 10px; }
.shop-bar-live[hidden]{ display: none; }
.store-chip{ flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--accent-ink); }
.store-chip svg{ width: 22px; height: 22px; flex: none; }
.store-chip-text{ min-width: 0; display: flex; flex-direction: column; }
.store-chip-text strong{ font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-chip-text small{ font-size: 12.5px; color: var(--ink-soft); }
body.shopping .item-body{ min-height: 66px; }
body.shopping .item-name{ font-size: 18px; }
body.shopping .check{ width: 66px; }
body.shopping .check-mark{ width: 30px; height: 30px; }
body.shopping .item.checked .check-mark::after{ left: 9px; top: 4px; width: 7px; height: 14px; }
body.shopping #shopBtn{ display: none; }

/* Dialoger som ark nerifrån på mobil */
dialog.sheet{ border: 0; padding: 22px 22px 18px; border-radius: 24px; background: var(--bg); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
dialog.sheet::backdrop{ background: rgba(12,24,15,.45); }
.sheet-title{ font-size: 22px; margin: 0 0 14px; }
.sheet-note{ font-size: 14px; color: var(--muted); margin: -4px 0 14px; }
.sheet-note:empty{ display: none; }
.field-row{ display: flex; gap: 12px; }
.field-row .field{ flex: 1; min-width: 0; }
.store-choice{ display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; color: var(--ink); font: inherit; }
.store-choice:hover{ outline: 2px solid var(--accent); }
.store-choice-name{ font-weight: 700; }
.store-choice-meta{ font-size: 13px; color: var(--muted); }
.custom-store{ margin-top: 16px; }
.custom-store[hidden]{ display: none; }
.custom-store .add-wrap input{ height: 46px; }

/* Delning */
.member-row{ display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-row:last-of-type{ border-bottom: 0; }
.member-row form{ margin: 0; }
.share-form{ margin-top: 16px; }

/* Import från recept */
.import-items{ margin-top: 16px; padding: 8px 16px; }
.import-row{ display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.import-row:last-child{ border-bottom: 0; }
.import-row > input[type=checkbox]{ width: 22px; height: 22px; accent-color: var(--accent); margin-top: 12px; flex: none; }
.import-row.off .import-fields{ opacity: .45; }
.import-fields{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.import-fields input[type=text], .import-fields select{ font: 500 15.5px var(--sans); color: var(--ink); background: var(--bg); border: 1.5px solid transparent; border-radius: 12px; padding: 9px 12px; min-width: 0; }
.import-fields input:focus, .import-fields select:focus{ outline: none; border-color: var(--accent); }
.import-name{ font-weight: 600 !important; }
.import-sub{ display: flex; gap: 8px; }
.import-qty{ width: 110px; flex: none; }
.import-sub select{ flex: 1; }
.import-raw{ font-size: 12.5px; color: var(--muted); }
.sticky-actions{ position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; margin-top: 12px; }

/* Butikens ordning */
.order-list{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.order-row{ display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 8px 10px 8px 16px; box-shadow: 0 3px 10px -6px rgba(20,45,28,.3); }
.order-emoji{ font-size: 22px; }
.order-name{ flex: 1; min-width: 0; font-weight: 600; display: flex; flex-direction: column; }
.order-name small{ font-weight: 500; font-size: 12.5px; color: var(--muted); }
.order-row[data-source=store] .order-name small{ color: var(--ok); }
.order-btns{ display: flex; gap: 6px; }
.order-btns .circle{ width: 38px; height: 38px; box-shadow: none; background: var(--bg); font-size: 17px; font-weight: 700; }

@media (max-width: 860px){
  .add-form{ top: 60px; }
  .new-list{ flex-direction: column; align-items: stretch; }
  dialog.sheet{ margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .sticky-actions{ bottom: var(--nav-h); }
}
@media (prefers-reduced-motion: reduce){
  .item, .item.leaving{ transition: none; }
}

/* =================================================================
   Designöverlämningen "Inköpslistan": Hem och Lägg till.
   Layout och beteende från designen, färger och typsnitt från Receptet.
   ================================================================= */
.ph-duotone{ line-height: 1; }
.btn .ph-duotone{ font-size: 19px; }
.circle .ph-duotone{ font-size: 21px; }
.bottom-nav .ph-duotone{ font-size: 24px; }
.bottom-nav a, .bottom-nav button{ font-size: 11px; }
.bottom-nav .on{ font-weight: 700; }

.btn-ghost{
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 14px;
  background: transparent; color: var(--accent-ink); font: 700 16px var(--sans); cursor: pointer; text-decoration: none;
}
.btn-ghost:hover{ background: var(--tint); }
.btn-ghost:active{ background: var(--sel); }
.btn-ghost .ph-duotone{ font-size: 20px; }
.btn-icon{ width: 44px; padding: 0; justify-content: center; flex: none; }
.btn-icon .ph-duotone{ font-size: 22px; }

/* Hem */
.home{ padding-top: 28px; }
.greeting{ margin: 0; font-size: 14px; font-style: italic; color: var(--muted); }
.home-title{ margin: 4px 0 0; font-size: 40px; font-weight: 600; line-height: 1.1; text-wrap: pretty; }
.home-lists{ margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.home-lists .btn-ghost{ align-self: flex-start; margin-top: 6px; }
.home-empty{ color: var(--muted); margin: 0 2px; }
.list-card{ gap: 14px; padding: 16px 16px 16px 18px; }
.list-card-icon{ font-size: 28px; color: var(--accent-ink); flex: none; }
.list-card-count{ background: none; min-width: 0; height: auto; padding: 0; font-size: 24px; font-weight: 600; color: var(--ink); }
.list-card-caret{ font-size: 18px; color: var(--muted); flex: none; }
.icon-pick{ border: 0; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick legend{ margin-bottom: 8px; padding: 0; }
.icon-opt{ position: relative; }
.icon-opt input{ position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.icon-opt i{ width: 48px; height: 48px; border-radius: 14px; background: var(--card); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 2px 8px -4px rgba(20,45,28,.25); }
.icon-opt input:checked + i{ background: var(--grad); color: #fff; }
.icon-opt input:focus-visible + i{ outline: 3px solid var(--ink); outline-offset: 2px; }

/* Listvyn */
.list-head{ gap: 6px; }
.list-title{ display: flex; align-items: center; gap: 10px; flex: 1; }
.list-title-icon{ font-size: 28px; color: var(--accent-ink); flex: none; }
.browse-btn{ margin-bottom: 10px; }
.group-head .ph-duotone{ font-size: 18px; color: var(--accent-ink); }
.suggest li .ph-duotone{ font-size: 18px; color: var(--accent-ink); }
.order-icon{ font-size: 24px; color: var(--accent-ink); }

/* Lägg till */
.add-page{ padding-bottom: 0 !important; }
.add-shell{ max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.add-top{ position: sticky; top: 0; z-index: 10; background: var(--bg); }
.add-head{ display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; padding-top: calc(14px + env(safe-area-inset-top)); }
.add-head-title{ flex: 1; min-width: 0; }
.overline{ font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); font-weight: 700; }
.add-list-name{ font-size: 18px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-done{ min-height: 44px; padding: 0 18px; flex: none; font-variant-numeric: tabular-nums; }
.add-search{ position: relative; padding: 16px 16px 0; }
.add-search .ph-duotone{ position: absolute; left: 32px; top: 50%; margin-top: 8px; transform: translateY(-50%); font-size: 18px; color: var(--accent-ink); pointer-events: none; }
.add-search input{
  width: 100%; min-height: 48px; padding: 0 14px 0 42px; font: 500 16px var(--sans); color: var(--ink);
  background: var(--card); border: 1.5px solid transparent; border-radius: 24px; box-shadow: var(--shadow);
}
.add-search input:focus{ outline: none; border-color: var(--accent); }
.dept-tabs{ display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dept-tabs::-webkit-scrollbar{ display: none; }
.dept-tab{ flex: none; border: 0; cursor: pointer; font: 600 13.5px var(--sans); padding: 8px 14px; border-radius: 16px; background: var(--card); color: var(--ink); min-height: 36px; }
.dept-tab:hover{ background: var(--tint); }
.dept-tab[aria-selected=true]{ background: var(--ink); color: var(--bg); }
.add-shell #addNote{ margin: 0 16px; }
.catalog{ flex: 1; padding: 0 16px 28px; }
.cat-group{ margin-top: 14px; }
.cat-title{ font-size: 20px; font-weight: 600; margin: 0 0 10px; }
.tile-grid{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile-btn{
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px; border: 0; border-radius: 16px; background: var(--card); color: var(--ink); text-align: center;
  cursor: pointer; font: inherit; box-shadow: 0 3px 10px -6px rgba(20,45,28,.3); user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.tile-btn:hover{ background: var(--tint); }
.tile-btn > .ph-duotone{ font-size: 30px; color: var(--accent-ink); }
.tile-name{ font-size: 13.5px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.tile-btn.on{ background: var(--grad); color: #fff; box-shadow: 0 8px 16px -8px rgba(26,77,47,.8); }
.tile-btn.on:hover{ filter: brightness(1.05); }
.tile-btn.on > .ph-duotone{ font-size: 24px; color: #fff; }
.tile-btn.custom{ border: 2px dashed var(--line-strong); box-shadow: none; background: transparent; }
.stepper{ display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.step-btn{
  position: relative; width: 28px; height: 28px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--bg); color: var(--accent-ink); display: grid; place-items: center;
}
.step-btn::after{ content: ""; position: absolute; inset: -8px; } /* större träffyta än det synliga */
.step-btn .ph-duotone{ font-size: 14px; }
.step-btn:active{ background: var(--sel); }
.step-qty{ font-size: 12.5px; font-style: italic; min-width: 40px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px){
  .home{ padding-top: 22px; }
  .home-title{ font-size: 36px; }
}
@media (max-width: 360px){
  .tile-grid{ gap: 8px; }
  .step-qty{ min-width: 32px; font-size: 11.5px; }
}
.list-title{ overflow: hidden; }
.list-title .page-title{ overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 860px){
  .list-head .page-title{ font-size: 24px; }
  .list-head .btn.sm{ padding: 0 14px; }
}
@media (max-width: 400px){
  .list-title-icon{ display: none; }
}
