/* Fridge Raiders – retro diner look (same tokens as the phone app, design_handoff 02_design_tokens.md) */
:root {
  --canvas: #EFE4C9;
  --surface: #FFFAF0;
  --ink: #2B2018;
  --sub: #8A7358;
  --primary: #D63A2F;
  --primary-ink: #FFFAF0;
  --primary-shadow: #A02419;
  --accent: #12857F;
  --gold: #F2B52C;
  --gold-ink: #171310;
  --line: #E6D5B0;
  --shadow-card: 0 10px 24px rgba(120, 80, 20, .14);
  --glow-primary: 0 7px 18px rgba(214, 58, 47, .32);
  --display: "Alfa Slab One", "Rockwell", Georgia, serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Pacifico", cursive;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
  --col: 640px;
  --tabbar: calc(66px + env(safe-area-inset-bottom));
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--canvas); }
body {
  margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--ink);
  font: 15px/1.4 var(--body); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--sub); }
.small { font-size: 13px; }
.center { text-align: center; justify-items: center; }
.error { color: var(--primary); font-weight: 700; margin: 4px 0; }
.ico { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ico svg { width: 100%; height: 100%; }
.kicker { font: 700 10px/1.3 var(--body); letter-spacing: 1.8px; color: var(--sub); text-transform: uppercase; }
.stack { display: grid; gap: 10px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.row-btns > * { flex: 1; }
.center-msg { text-align: center; color: var(--sub); padding: 36px 16px; margin: 0; }

.view { max-width: var(--col); margin: 0 auto; min-height: 100dvh; }
.page { padding: 16px; }
.view-menu .page { padding-bottom: calc(var(--tabbar) + 96px); }
.view-orders .page, .view-list .page, .view-settings .page, .view-order .page { padding-bottom: calc(var(--tabbar) + 24px); }
.view-recipe .page, .view-editor .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20; background: var(--surface);
  box-shadow: 0 5px 14px rgba(43, 32, 24, .10); padding-top: env(safe-area-inset-top);
}
.header-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; min-height: 64px; }
.wordmark { font: 26px/1.15 var(--script); color: var(--primary); text-shadow: 0 0 14px rgba(214, 58, 47, .25); }
.wordmark.big { font-size: 40px; }
.page-title { font: 22px/1.1 var(--display); margin: 0; letter-spacing: .3px; }
.app-header .kicker { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 1.2px; }
.diner-stripe { display: grid; grid-template-rows: 3px 3px 3px; }
.diner-stripe i:nth-child(1) { background: var(--primary); }
.diner-stripe i:nth-child(2) { background: var(--gold); }
.diner-stripe i:nth-child(3) { background: var(--accent); }

.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); font-size: 28px; line-height: 1; padding: 0;
}
.icon-btn .ico { width: 22px; height: 22px; }
.icon-btn.ghost { border-color: transparent; background: transparent; font-size: 26px; color: var(--sub); }
.icon-btn.red-outline { color: var(--primary); font-size: 30px; }
.icon-btn.big { width: 56px; height: 56px; border-radius: 18px; }
.icon-btn:active { transform: translateY(1px); }
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--accent); color: var(--primary-ink); font: 18px var(--display); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--line);
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; box-shadow: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center; text-decoration: none;
  border-radius: 16px; padding: 13px 16px; border: 2px solid transparent; font-weight: 700; min-height: 48px;
  transition: transform .08s, box-shadow .08s;
}
.btn.primary {
  background: var(--primary); color: var(--primary-ink); font: 16px/1.2 var(--display); letter-spacing: .3px;
  box-shadow: 0 6px 0 var(--primary-shadow), var(--glow-primary); margin-bottom: 6px;
}
.btn.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--primary-shadow); }
.btn.primary:disabled { opacity: .6; }
.btn.big { width: 100%; min-height: 56px; border-radius: 20px; font-size: 17px; }
.btn.outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.outline:active { background: var(--surface); }
.btn.danger { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn.link { background: none; border: 0; color: var(--sub); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 8px; font-weight: 700; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.btn.primary.small { font-size: 14px; }
.btn.google { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 700; }
.btn.google img { width: 20px; height: 20px; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; display: grid; gap: 12px; text-align: center; }
.auth-card .kicker { margin: -6px 0 14px; }
.auth-card h2 { font: 22px var(--display); margin: 8px 0 0; }
.auth-card p { margin: 0 0 6px; }
.auth-card form { text-align: left; }
.auth-logo img { width: 92px; height: 92px; border-radius: 26px; box-shadow: var(--shadow-card), 0 0 0 4px var(--surface); }

/* ---------- fields ---------- */
.field {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px;
  font-size: 16px; color: var(--ink); outline: none;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18, 133, 127, .15); }
textarea.field { resize: vertical; line-height: 1.5; }
.field.mono { font-family: var(--mono); font-size: 14px; }
.form-field { display: grid; gap: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ---------- menu ---------- */
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 16px; padding: 0 8px 0 14px; margin-bottom: 14px; color: var(--sub);
}
.search:focus-within { border-color: var(--accent); }
.search .ico { width: 20px; height: 20px; }
.search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 13px 0; font-size: 16px; color: var(--ink); }
.search-input::-webkit-search-cancel-button { display: none; }
.search .clear { border: 0; background: var(--line); color: var(--ink); width: 26px; height: 26px; border-radius: 50%; font-size: 12px; }

.import-suggest, .strip, .option, .menu-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: 18px; padding: 14px 16px;
}
.import-suggest { background: var(--accent); color: #fff; box-shadow: 0 7px 18px rgba(18, 133, 127, .3); }
.import-suggest small, .strip small, .option small { display: block; opacity: .85; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrow { font-size: 22px; line-height: 1; opacity: .9; }

.strip { margin-bottom: 10px; }
.strip .bell { font-size: 24px; }
.strip.incoming { background: var(--primary); color: var(--primary-ink); box-shadow: var(--glow-primary); }
.strip.mine { background: var(--surface); border: 2px solid var(--line); }
.strip.mine.status-accepted { border-color: var(--accent); }
.strip.mine.status-done { border-color: var(--gold); background: #FFF4D6; }
.strip.mine small { color: var(--sub); opacity: 1; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(214, 58, 47, .18), var(--glow-primary); } }

.hero {
  display: flex; align-items: center; gap: 10px; background: var(--primary); color: var(--primary-ink);
  border-radius: 16px; padding: 10px 10px 10px 14px; margin-bottom: 14px; box-shadow: var(--glow-primary); cursor: pointer;
}
.hero .star { color: var(--gold); font-size: 18px; }
.hero-kicker { font: 700 9px var(--body); letter-spacing: 1.3px; opacity: .85; }
.hero-name { font: 19px/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; gap: 8px; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 2px 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  flex: none; border: 2px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 16px;
  font: 700 13.5px var(--body); letter-spacing: .3px; color: var(--ink); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 4px 12px rgba(214, 58, 47, .3); }
.chip.dashed { border-style: dashed; color: var(--sub); }
.chip.static { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 14px; background: var(--surface); cursor: default; }
.chip.static button { border: 0; background: none; color: var(--sub); font-size: 18px; line-height: 1; padding: 0 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-card); display: flex; flex-direction: column; cursor: pointer; outline: none;
  transition: transform .12s;
}
.card:active { transform: scale(.985); }
.card:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.card-photo { position: relative; height: 108px; }
.card-photo .thumb { width: 100%; height: 100%; border-radius: 0; }
.thumb { position: relative; overflow: hidden; display: grid; place-items: center; border-radius: 12px; flex: none; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .initial { font: 44px var(--display); color: rgba(255, 250, 240, .55); text-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.thumb.sm { width: 52px; height: 52px; }
.thumb.sm .initial { font-size: 22px; }
.thumb.xs { width: 26px; height: 26px; border-radius: 8px; }
.thumb.xs .initial { font-size: 12px; }
.card-photo .heart {
  position: absolute; top: 7px; right: 7px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .4); color: #fff; font-size: 17px; line-height: 1; display: grid; place-items: center;
}
.card-photo .heart.on { color: var(--gold); }
.kcal { position: absolute; left: 7px; bottom: 7px; background: rgba(10, 6, 15, .5); color: #fff; font: 9.5px var(--mono); padding: 3px 6px; border-radius: 6px; }
.card-body { padding: 10px 10px 10px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card-body h3 { margin: 0; font: 700 14.5px/1.25 var(--body); }
.tagline { margin: 0; font-size: 11.5px; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; }
.time { font: 700 11.5px var(--body); color: var(--accent); }

/* add-to-bag control */
.add-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--primary); color: var(--primary-ink);
  font-size: 26px; line-height: 1; display: grid; place-items: center; box-shadow: 0 3px 0 var(--primary-shadow); padding: 0;
}
.add-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--primary-shadow); }
.stepper { display: inline-flex; align-items: center; background: var(--gold); border-radius: 12px; height: 38px; box-shadow: 0 3px 0 #B9861A; }
.stepper button { width: 34px; height: 38px; border: 0; background: none; font-size: 22px; font-weight: 700; color: var(--gold-ink); padding: 0; }
.stepper .n { min-width: 18px; text-align: center; font: 16px var(--display); color: var(--gold-ink); }
.add-btn.on-red { background: var(--primary-ink); color: var(--primary); box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.add-btn.wide, .stepper.wide { width: 100%; height: 56px; border-radius: 20px; font: 17px var(--display); }
.add-btn.wide { box-shadow: 0 6px 0 var(--primary-shadow), var(--glow-primary); }
.stepper.wide { justify-content: space-between; padding: 0 6px; box-shadow: 0 6px 0 #B9861A; }
.stepper.wide button { width: 48px; height: 56px; font-size: 26px; }
.stepper.wide .n { font-size: 15px; }
.add-slot { display: contents; }
.action-bar .add-slot { display: block; flex: 1; }

/* bag bar + tab bar */
#bagbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: calc(var(--tabbar) + 10px);
  max-width: var(--col); margin: 0 auto; padding: 0 16px; animation: up .25s ease-out;
}
#bagbar .btn { justify-content: space-between; }
.bag-count { background: var(--gold); color: var(--gold-ink); min-width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font: 15px var(--display); padding: 0 8px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

#tabbar {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: var(--tabbar); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center;
  box-shadow: 0 -6px 18px rgba(43, 32, 24, .07);
}
.tab {
  flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--sub); font: 700 11.5px var(--body); letter-spacing: .3px;
}
.tab-ico { position: relative; width: 52px; height: 30px; display: grid; place-items: center; border-radius: 999px; }
.tab-ico .ico { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--primary); }
.tab[aria-current="page"] .tab-ico { background: rgba(214, 58, 47, .12); }
.badge {
  position: absolute; top: -4px; right: 2px; min-width: 19px; height: 19px; border-radius: 999px; padding: 0 5px;
  background: var(--gold); color: var(--gold-ink); font: 700 11px/19px var(--body); text-align: center; box-shadow: 0 0 0 2px var(--surface);
}

#order-banner {
  position: fixed; z-index: 60; top: calc(env(safe-area-inset-top) + 10px); left: 12px; right: 12px; max-width: calc(var(--col) - 24px); margin: 0 auto;
  display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-radius: 18px; padding: 14px 16px;
  background: var(--primary); color: var(--primary-ink); box-shadow: 0 12px 30px rgba(160, 36, 25, .45); animation: drop .35s cubic-bezier(.2, 1.4, .4, 1);
}
#order-banner .bell { font-size: 28px; animation: ring .9s ease-in-out 2; }
#order-banner small { display: block; opacity: .9; }
@keyframes drop { from { transform: translateY(-120%); } }
@keyframes ring { 20% { transform: rotate(-18deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }

#toast {
  position: fixed; z-index: 70; left: 16px; right: 16px; bottom: calc(var(--tabbar) + 16px); max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 16px;
  background: var(--ink); color: var(--surface); font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: up .2s ease-out;
}
#toast span:not(.spinner) { flex: 1; }
#toast.bad { background: var(--primary); }
#toast button { border: 0; background: none; color: var(--gold); font-weight: 700; padding: 4px 6px; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }

/* ---------- sheets ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: var(--col); max-height: min(90dvh, var(--vvh, 100dvh));
  background: var(--canvas); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
  animation: up .22s ease-out;
}
dialog.sheet::backdrop { background: rgba(43, 32, 24, .45); }
.sheet-inner { padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet-inner::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line); justify-self: center; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-head h2 { flex: 1; margin: 0; font: 20px/1.2 var(--display); }
.sheet-text { margin: 0; color: var(--sub); }
.sheet-actions { margin-top: 4px; }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; border-radius: 24px; max-width: 520px; }
  dialog.sheet.small { max-width: 420px; }
}

.bag-rows { display: grid; gap: 8px; }
.bag-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 8px; }
.bag-row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bag-row small { color: var(--accent); font-weight: 700; font-size: 12px; }

.options { display: grid; gap: 8px; }
.option { background: var(--surface); border: 1px solid var(--line); }
.option .ico { width: 26px; height: 26px; color: var(--primary); }
.option small { color: var(--sub); }
.menu-list { display: grid; gap: 6px; }
.menu-item { background: var(--surface); border: 1px solid var(--line); font-weight: 700; padding: 15px 16px; }
.menu-item.danger { color: var(--primary); }

/* ---------- recipe detail ---------- */
.detail-hero { position: relative; height: min(42vh, 320px); overflow: hidden; }
.detail-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28), transparent 35%, transparent 70%, rgba(0,0,0,.12)); pointer-events: none; }
.round-btn {
  position: relative; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .42);
  color: #fff; font-size: 26px; line-height: 1; display: grid; place-items: center; padding: 0; backdrop-filter: blur(6px);
}
.round-btn .ico { width: 20px; height: 20px; }
.round-btn.back { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 12px; font-size: 32px; padding-bottom: 4px; }
.round-btn.heart.on { color: var(--gold); }
.hero-actions { position: absolute; z-index: 2; top: calc(env(safe-area-inset-top) + 12px); right: 12px; display: flex; gap: 8px; }
.detail { background: var(--canvas); border-radius: 24px 24px 0 0; margin-top: -24px; position: relative; z-index: 3; padding-top: 22px; }
.detail-title { font: 28px/1.08 var(--display); margin: 4px 0 6px; }
.detail-title.small { font-size: 22px; margin: 0; }
.detail > .muted { margin: 0 0 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; font-weight: 700; font-size: 13.5px; }
.section { font: 17px var(--display); letter-spacing: .3px; margin: 26px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.section small { font: 700 12px var(--body); color: var(--sub); }
.ingredients { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.ingredients li { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px dashed var(--line); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients small { color: var(--sub); }
.qty { font: 13px var(--mono); color: var(--sub); white-space: nowrap; align-self: center; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; }
.steps .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font: 13px var(--display); }
.steps p { margin: 3px 0 0; line-height: 1.5; }
.source { display: inline-flex; align-items: center; gap: 6px; margin-top: 24px; color: var(--accent); font-weight: 700; text-decoration: none; }
.source .ico { width: 18px; height: 18px; }

.action-bar {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; max-width: var(--col); margin: 0 auto;
  display: flex; gap: 10px; align-items: center; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--canvas) 30%);
}
.action-bar > .btn.big { margin-bottom: 6px; }
.action-bar .icon-btn.big { margin-bottom: 6px; color: var(--accent); }

/* ---------- editor ---------- */
.editor { display: grid; gap: 16px; }
.note { background: #E3F3F1; border: 1.5px solid var(--accent); color: #0B5753; border-radius: 14px; padding: 11px 14px; font-weight: 500; }
.photo-pick { position: relative; height: 170px; border-radius: 20px; overflow: hidden; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-card); }
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-hint { display: grid; justify-items: center; gap: 6px; color: #fff; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.25); }
.photo-hint .ico { width: 34px; height: 34px; }
.round-btn.remove { position: absolute; top: 10px; right: 10px; }

/* ---------- orders ---------- */
.section-kicker { margin: 18px 2px 8px; }
.section-kicker:first-child { margin-top: 2px; }
.section-kicker.row { display: flex; align-items: center; }
.order-card {
  width: 100%; text-align: left; display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-card);
}
.order-card.status-new { border: 2px solid var(--primary); }
.order-card.status-done { opacity: .7; box-shadow: none; }
.order-card.fresh { animation: pulse 1.6s ease-in-out 3; }
.order-top { display: flex; align-items: center; gap: 10px; }
.order-top small { color: var(--sub); }
.when { background: var(--accent); color: #fff; font: 700 11px var(--body); letter-spacing: .5px; padding: 4px 9px; border-radius: 999px; text-transform: uppercase; }
.order-dishes { display: flex; flex-wrap: wrap; gap: 6px; }
.dish { display: inline-flex; align-items: center; gap: 6px; background: var(--canvas); border-radius: 10px; padding: 3px 10px 3px 3px; font-weight: 700; font-size: 14px; }
.order-note { margin: 0; color: var(--ink); font-style: italic; }
.order-status { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 10px; font: 700 12px var(--body); background: var(--canvas); color: var(--ink); }
.pill.status-new { background: var(--primary); color: #fff; }
.pill.status-seen { background: var(--gold); color: var(--gold-ink); }
.pill.status-accepted { background: var(--accent); color: #fff; }
.pill.soft { background: #E3F3F1; color: #0B5753; }

.order-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.order-head .avatar { box-shadow: none; }
.bubble { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; padding: 12px 14px; margin: 0 0 14px 56px; font-size: 15.5px; }
.progress { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 6px 0 18px; padding: 0; }
.progress li { position: relative; display: grid; justify-items: center; gap: 6px; font: 700 11.5px var(--body); color: var(--sub); }
.progress li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress .dot { position: relative; z-index: 1; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line); }
.progress li.done { color: var(--accent); }
.progress li.done .dot { background: var(--accent); border-color: var(--accent); }
.progress li.done::before { background: var(--accent); }
.order-dishes.big { display: grid; gap: 8px; }
.dish-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px 8px 8px; text-decoration: none; }
.dish-row b { display: block; font-size: 16px; }
.dish-row small { color: var(--accent); font-weight: 700; }
.order-list, .shop-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.order-list li, .shop-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px dashed var(--line); cursor: pointer; min-height: 52px; user-select: none; }
.order-list li:last-child, .shop-list li:last-child { border-bottom: 0; }
.order-list li.off .grow { color: var(--sub); text-decoration: line-through; }
.order-list small { color: var(--sub); font-size: 12px; text-decoration: none; display: inline-block; margin-left: 6px; }
.order-list .on-list { color: var(--accent); font-weight: 700; }
.check { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; transition: background .12s; }
.check.on { background: var(--accent); border-color: var(--accent); }
.order-actions { margin-top: 20px; }

/* ---------- shopping list (butikkmodus: as many items on screen as possible) ---------- */
.list-header .header-row { min-height: 0; padding: 10px 12px; gap: 8px; }
.list-add {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 5px 0 12px;
  background: var(--canvas); border: 1.5px solid transparent; border-radius: 12px;
}
.list-add:focus-within { border-color: var(--accent); background: var(--surface); }
.list-add .plus { color: var(--primary); font: 24px/1 var(--display); }
.list-add-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 16px; color: var(--ink); padding: 0; }
.list-add-btn { flex: none; border: 0; border-radius: 9px; padding: 7px 11px; background: var(--primary); color: var(--primary-ink); font: 700 14px var(--body); }
.list-count { flex: none; font: 700 12px var(--body); color: var(--sub); white-space: nowrap; }
.list-header .icon-btn { width: 40px; height: 40px; border-radius: 12px; }
.view-list .list-page { padding: 0 0 calc(var(--tabbar) + 24px); }
.view-list .list-page > .empty, .view-list .list-page > .center-msg { padding-left: 16px; padding-right: 16px; }
.aisle-band {
  position: sticky; top: var(--list-top, 64px); z-index: 5; display: flex; align-items: center; min-height: 26px; padding: 0 16px;
  background: var(--canvas); color: var(--sub); font: 700 10px var(--body); letter-spacing: 1.4px; text-transform: uppercase;
}
.aisle-band.done-band { min-height: 40px; margin-top: 12px; }
.aisle-band .btn.link { letter-spacing: 0; text-transform: none; min-height: 36px; padding: 4px 0 4px 8px; }
.list-page .shop-list { border: 0; border-radius: 0; background: var(--surface); }
.list-page .shop-list li { min-height: 40px; padding: 4px 16px; gap: 12px; border-bottom: 1px solid #F1E7D2; }
.list-page .shop-list li:last-child { border-bottom: 0; }
.list-page .check { width: 22px; height: 22px; border-radius: 7px; font-size: 13px; }
.shop-list .name { font-size: 16px; }
.shop-list small { margin-left: 6px; color: var(--sub); font-size: 12px; }
.shop-list li.checked .name { color: var(--sub); text-decoration: line-through; }
.shop-list.done { opacity: .75; }
.qty-btn { flex: none; border: 0; background: none; padding: 6px 0 6px 10px; min-height: 32px; font: 13px var(--mono); color: var(--sub); }

/* ---------- settings ---------- */
.settings .section:first-child { margin-top: 4px; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 12px; }
.card-box p { margin: 0; }
.toggle-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-row small { display: block; color: var(--sub); font-size: 12.5px; }
input[role="switch"] {
  appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0;
}
input[role="switch"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
input[role="switch"]:checked { background: var(--accent); }
input[role="switch"]:checked::after { transform: translateX(20px); }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.topic { background: var(--canvas); padding: 2px 6px; border-radius: 6px; font: 13px var(--mono); cursor: pointer; word-break: break-all; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.members li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.members small { display: block; color: var(--sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.bell-btn { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--line); background: none; color: var(--line); display: grid; place-items: center; padding: 0; }
.bell-btn .ico { width: 20px; height: 20px; }
.bell-btn.on { border-color: var(--gold); background: #FFF4D6; color: #B9861A; }
.add-member { border-top: 1px dashed var(--line); padding-top: 12px; }

/* ---------- empty states / misc ---------- */
.empty { text-align: center; display: grid; justify-items: center; gap: 10px; padding: 34px 12px; }
.empty h2 { font: 22px var(--display); margin: 0; }
.empty p { margin: 0 0 8px; color: var(--sub); max-width: 340px; }
.empty .btn { width: 100%; max-width: 320px; }
.empty-ico { font-size: 52px; filter: drop-shadow(0 6px 10px rgba(120, 80, 20, .2)); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 30px auto; }
.spinner.small { width: 18px; height: 18px; border-width: 3px; margin: 0; border-color: rgba(255,255,255,.3); border-top-color: var(--gold); flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- matlagingsmodus (cooking mode) ---------- */
.round-btn.cook-start { width: auto; padding: 0 14px; border-radius: 999px; font: 700 13px var(--body); white-space: nowrap; }
.cook-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--surface);
  box-shadow: 0 5px 14px rgba(43, 32, 24, .10); border-bottom: 3px solid var(--primary);
}
.cook-title { font: 22px/1.1 var(--display); margin: 2px 0 0; }
.cook-exit {
  flex: none; border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px;
  background: var(--primary); color: var(--primary-ink); font: 700 14px var(--body); box-shadow: 0 3px 0 var(--primary-shadow);
}
.view-recipe.cooking .page { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.cook-meta { margin: 0 0 4px; font-weight: 700; }
.cook-ingredients { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.cook-ingredients li {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 58px; font-size: 18px;
  border-bottom: 1px dashed var(--line); cursor: pointer; user-select: none;
}
.cook-ingredients li:last-child { border-bottom: 0; }
.cook-ingredients small { color: var(--sub); font-size: 14px; }
.cook-ingredients .qty { font-size: 15px; color: var(--ink); }
.cook-ingredients li.done .grow, .cook-ingredients li.done .qty { color: var(--sub); text-decoration: line-through; }
.cook-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cook-steps li {
  display: flex; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line);
  cursor: pointer; user-select: none; transition: opacity .15s, border-color .15s;
}
.cook-steps .num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--sub); color: var(--primary-ink);
  display: grid; place-items: center; font: 15px var(--display);
}
.cook-steps p { margin: 2px 0 0; font-size: 19px; line-height: 1.55; }
.cook-steps li.current { border-color: var(--primary); box-shadow: var(--glow-primary); }
.cook-steps li.current .num { background: var(--primary); }
.cook-steps li.done { opacity: .5; }
.cook-steps li.done .num { background: var(--accent); }
.cook-done { display: grid; justify-items: center; gap: 10px; padding: 28px 12px 8px; text-align: center; }
.cook-done h2 { font: 24px var(--display); margin: 0; }

/* Recipe page keeps the bottom bar: its own buttons sit just above it (not in matlagingsmodus). */
.view-recipe:not(.cooking) .page { padding-bottom: calc(var(--tabbar) + 100px); }
.view-recipe:not(.cooking) .action-bar { bottom: var(--tabbar); padding-bottom: 12px; }
#view.view-recipe:not(.cooking) ~ #toast { bottom: calc(var(--tabbar) + 92px); }

/* Tap-to-tick rows (tickRow in app.js): no text selection or long-press callout, keyboard focus ring only. */
[role="checkbox"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[role="checkbox"]:focus { outline: none; }
[role="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
