:root {
  --bg: #ffffff;
  --ink: #0c0c0d;
  --muted: #74747b;
  --faint: #a9a9b0;
  --line: #e8e8eb;
  --fill: #f3f3f4;
  --blue: #0a84ff;
  --blue-soft: #cfe5ff;
  --danger: #e5352b;
  --shadow: 0 10px 34px rgba(0, 0, 0, .1);
  --spring: cubic-bezier(.2, .9, .25, 1.05);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); overscroll-behavior: none; }
body {
  color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea {
  font: inherit; font-size: 16px; color: var(--ink); width: 100%;
  background: var(--fill); border: 1.5px solid transparent; border-radius: 14px; padding: 14px 15px;
  outline: none; -webkit-user-select: text; user-select: text; transition: border-color .15s, background .15s;
}
input:focus, textarea:focus { background: #fff; border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: none; min-height: 120px; line-height: 1.45; }
svg { display: block; }
.press { transition: transform .16s var(--spring), opacity .16s; }
.press:active { transform: scale(.96); opacity: .8; }

#app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }

/* Screens */
.screen {
  position: absolute; inset: 0; z-index: 10; background: var(--bg); display: flex; flex-direction: column;
  transition: transform .34s var(--ease);
}
.screen.enter { transform: translateX(100%); }
.screen.leave { transform: translateX(100%); }
.screen.under { transform: translateX(-22%); }
.screen.up.enter, .screen.up.leave { transform: translateY(100%); }
.body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 0 20px calc(28px + var(--bottom));
}
.tab-pane .body { padding-bottom: calc(var(--tabbar) + var(--bottom) + 24px); }

.head {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: calc(var(--top) + 10px) 14px 8px; min-height: calc(var(--top) + 56px);
}
.head .grow { flex: 1; min-width: 0; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--fill); transition: transform .16s var(--spring);
}
.icon-btn:active { transform: scale(.88); }
.icon-btn.plain { background: none; }
.large-title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 2px 0 16px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Tabs */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex;
  height: calc(var(--tabbar) + var(--bottom)); padding-bottom: var(--bottom);
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; font-weight: 700; color: var(--faint); transition: color .18s;
}
.tabbar button.on { color: var(--ink); }
.tabbar button:active svg { transform: scale(.86); }
.tabbar svg { transition: transform .18s var(--spring); }
.tab-pane { position: absolute; inset: 0; display: none; flex-direction: column; }
.tab-pane.on { display: flex; animation: fade .24s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 56px; padding: 14px 20px; border-radius: 999px; font-weight: 700; font-size: 17px;
  background: var(--ink); color: #fff; transition: transform .16s var(--spring), opacity .2s, background .2s;
}
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--fill); color: var(--ink); }
.btn.line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn[disabled] { opacity: .3; pointer-events: none; }
.foot { flex: none; padding: 10px 20px calc(14px + var(--bottom)); background: var(--bg); }

.big-choice {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 22px 20px; margin-bottom: 12px;
  border-radius: 22px; background: var(--fill); text-align: left; transition: transform .18s var(--spring);
}
.big-choice:active { transform: scale(.975); }
.big-choice.dark { background: var(--ink); color: #fff; }
.big-choice .t { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.big-choice .s { font-size: 13px; opacity: .62; margin-top: 2px; }

/* Rows */
.row {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 10px; margin: 0 -10px 4px;
  border-radius: 18px; background: var(--bg); transition: transform .2s var(--spring), background .18s, box-shadow .2s;
  animation: rise .3s var(--ease) both;
}
.row:active { background: var(--fill); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.row .thumb { width: 74px; height: 74px; flex: none; border-radius: 14px; overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 30px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row .txt { min-width: 0; flex: 1; }
.row .title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.row .meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.row .date { font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.row .stack { position: relative; }
.row.is-group .thumb { box-shadow: 5px -5px 0 -1px #fff, 5px -5px 0 0 var(--line); margin: 5px 5px 0 0; width: 69px; height: 69px; }
.row.lifted { background: #fff; box-shadow: var(--shadow); transform: scale(1.03); z-index: 41; }
.row.drop-target { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--blue); transform: scale(1.02); }
.row.moving { opacity: .25; }
.row.mover { position: fixed; z-index: 60; margin: 0; background: #fff; box-shadow: var(--shadow); transform: scale(1.04) rotate(-.8deg); pointer-events: none; animation: none; }
.move-line { height: 3px; background: var(--blue); border-radius: 3px; margin: 2px 0; animation: fade .15s; }
.move-mode .row { touch-action: none; }
.move-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); font-size: 14px; font-weight: 600; animation: rise .25s var(--ease); }
.move-banner button { margin-left: auto; font-weight: 800; }
.drop-out { padding: 14px; margin-bottom: 10px; border: 2px dashed var(--line); border-radius: 14px; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); transition: background .15s, border-color .15s; }
.drop-out.drop-target { background: var(--blue-soft); border-color: var(--blue); color: var(--ink); }

.dot { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); margin: -6px; padding: 0; box-sizing: content-box; background-clip: padding-box; transition: all .18s var(--spring); }
.dot-hit { width: 44px; height: 44px; flex: none; display: grid; place-items: center; margin: -8px -6px -8px -8px; }
.dot-hit .dot { width: 24px; height: 24px; margin: 0; box-sizing: border-box; }
.dot.on { background: var(--blue); border-color: var(--blue); transform: scale(1.08); color: #fff; }

.empty { text-align: center; padding: 70px 24px; color: var(--muted); animation: fade .3s; }
.empty .big { font-size: 48px; margin-bottom: 10px; }
.empty .t { font-size: 19px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }

/* Sheets and dialogs */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .24s; }
.scrim.on { opacity: 1; }
.scrim.blur { background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #fff; border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(20px + var(--bottom)); transform: translateY(105%); transition: transform .34s var(--ease);
  max-height: 88%; overflow-y: auto;
}
.sheet.on { transform: none; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { margin: 4px 0 14px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.alert {
  position: fixed; left: 50%; top: 50%; z-index: 70; width: min(320px, calc(100% - 48px)); padding: 22px 20px 16px;
  background: #fff; border-radius: 24px; box-shadow: var(--shadow); text-align: center;
  transform: translate(-50%, -50%) scale(.9); opacity: 0; transition: transform .24s var(--spring), opacity .18s;
}
.alert.on { transform: translate(-50%, -50%); opacity: 1; }
.alert h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.alert p { margin: 0 0 16px; font-size: 15px; color: var(--muted); }
.alert .btn { min-height: 48px; margin-top: 8px; font-size: 16px; }
.alert .btn.danger { background: var(--danger); color: #fff; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--bottom) + 18px); z-index: 80; max-width: calc(100% - 40px);
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  transform: translate(-50%, 20px); opacity: 0; transition: transform .28s var(--spring), opacity .2s; text-align: center;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

.context-bar {
  position: fixed; z-index: 45; display: flex; padding: 5px; gap: 2px; border-radius: 18px; background: var(--ink);
  box-shadow: var(--shadow); transform: scale(.7); opacity: 0; transition: transform .24s var(--spring), opacity .16s;
}
.context-bar.on { transform: none; opacity: 1; }
.context-bar button { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 13px; color: #fff; font-size: 14px; font-weight: 700; }
.context-bar button:active { background: rgba(255, 255, 255, .16); }
.context-bar button.danger { color: #ff7a72; }

/* Forms */
.name-line { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.photo-box {
  position: relative; width: 84px; height: 84px; flex: none; border-radius: 18px; overflow: hidden;
  background: #d9d9dc; color: #fff; display: grid; place-items: center; transition: transform .16s var(--spring);
}
.photo-box:active { transform: scale(.94); }
.photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.field-label { display: block; margin: 18px 0 7px; }
.choice-row { display: flex; gap: 10px; }
.choice-row .big-choice { flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment { display: flex; align-items: center; gap: 6px; max-width: 100%; padding: 7px 9px 7px 12px; border-radius: 999px; background: var(--fill); font-size: 13px; font-weight: 600; animation: rise .2s var(--ease); }
.attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-row { display: flex; gap: 10px; margin-top: 12px; }
.tool { display: flex; align-items: center; gap: 7px; padding: 10px 15px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 700; transition: transform .16s var(--spring); }
.tool:active { transform: scale(.94); }

/* Recipe page */
.recipe-top { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 24px; }
.recipe-top .thumb { width: 104px; height: 104px; flex: none; border-radius: 20px; overflow: hidden; background: var(--fill); display: grid; place-items: center; font-size: 42px; }
.recipe-top h1 { flex: 1; min-width: 0; margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.section-title { font-size: 25px; font-weight: 800; letter-spacing: -.025em; margin: 26px 0 14px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); }
.stepper button { width: 46px; height: 46px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; touch-action: none; transition: transform .14s var(--spring), background .14s; }
.stepper button:active { transform: scale(.88); background: var(--line); }
.stepper .val { min-width: 54px; padding: 0 6px; text-align: center; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stepper.big { padding: 7px; }
.stepper.big button { width: 62px; height: 62px; }
.stepper.big .val { min-width: 120px; font-size: 32px; letter-spacing: -.02em; }
.serves { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--ink); }
.ing { display: flex; align-items: center; gap: 14px; padding: 7px 0; font-size: 17px; }
.ing-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 28px; }
.ing-icon img { width: 100%; height: 100%; object-fit: contain; }
.ing b { font-weight: 700; }
.num { transition: opacity .15s; }
.step { display: flex; gap: 14px; padding: 11px 0; font-size: 17px; line-height: 1.45; -webkit-user-select: text; user-select: text; }
.step .n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center; margin-top: 1px; }
.step b { font-weight: 700; }
.times { display: flex; gap: 10px; margin-top: 22px; }
.time-card { flex: 1; padding: 14px 16px; border-radius: 18px; background: var(--fill); }
.time-card .v { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.source-note { margin-top: 18px; font-size: 13px; color: var(--muted); }
.share-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; }

/* Quiz */
.quiz-bar { height: 4px; border-radius: 4px; flex: 1; background: var(--fill); overflow: hidden; }
.quiz-bar i { display: block; height: 100%; border-radius: 4px; background: var(--ink); transition: width .34s var(--ease); }
.quiz-step { animation: slideIn .32s var(--ease); }
.quiz-step.back { animation-name: slideBack; }
@keyframes slideIn { from { opacity: 0; transform: translateX(26px); } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-26px); } }
.q { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; margin: 10px 0 8px; }
.q-sub { color: var(--muted); margin: 0 0 20px; }
.center-stage { display: flex; flex-direction: column; align-items: center; padding-top: 44px; gap: 12px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 18px; min-height: 96px;
  box-shadow: inset 0 0 0 1.5px var(--line); font-size: 13px; font-weight: 700; text-align: center; line-height: 1.15;
  transition: transform .18s var(--spring), box-shadow .15s, background .15s;
}
.tile:active { transform: scale(.94); }
.tile .ic { width: 44px; height: 44px; display: grid; place-items: center; font-size: 30px; }
.tile .ic img { width: 100%; height: 100%; object-fit: contain; }
.tile.on { background: var(--ink); color: #fff; box-shadow: none; transform: scale(1.02); }
.search { position: relative; margin-bottom: 14px; }
.search svg { position: absolute; left: 14px; top: 15px; color: var(--faint); }
.search input { padding-left: 42px; }
.store {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; margin-bottom: 8px; border-radius: 16px; text-align: left;
  box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700; transition: transform .16s var(--spring), background .15s, color .15s;
}
.store:active { transform: scale(.975); }
.store.on { background: var(--ink); color: #fff; box-shadow: none; }
.store small { display: block; font-weight: 500; opacity: .6; font-size: 13px; }
.rank { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.sort-row { touch-action: none; background: #fff; }
.sort-row.dragging { z-index: 20; position: relative; box-shadow: var(--shadow); transform: scale(1.03); transition: box-shadow .15s; }
.sort-row .grip { margin-left: auto; color: var(--faint); }
.slider-wrap { padding: 30px 4px 8px; }
.slider-val { text-align: center; font-size: 66px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; padding: 0; background: none; border: 0; margin-top: 16px; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 32px; height: 32px; margin-top: -13px; border-radius: 50%; background: var(--ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .22); }
.ticks { display: flex; justify-content: space-between; padding: 0 10px; font-size: 13px; font-weight: 700; color: var(--faint); }
.week-of { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 26px; }
.week-of .label { font-size: 10px; }
.date-btn { padding: 12px 22px; border-radius: 999px; background: var(--fill); font-weight: 800; transition: transform .16s var(--spring); }
.date-btn:active { transform: scale(.94); }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 800; font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; touch-action: none; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--faint); padding-bottom: 4px; }
.cal-day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; font-weight: 600; font-size: 15px; transition: transform .16s var(--spring), background .15s, color .15s; }
.cal-day.past { color: var(--line); }
.cal-day.meal { background: var(--blue-soft); }
.cal-day.start { background: var(--blue); color: #fff; font-weight: 800; }
.cal-day.lifted { transform: scale(1.18); box-shadow: 0 0 0 2.5px var(--ink); }
.cal-day.hover { box-shadow: inset 0 0 0 2px var(--blue); }
.cal-hint { margin-top: 12px; text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }

/* Working screens */
.working { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.flip-cal { width: 168px; height: 184px; perspective: 700px; margin-bottom: 32px; position: relative; }
.flip-page {
  position: absolute; inset: 0; border-radius: 22px; background: #fff; box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); overflow: hidden;
  display: flex; flex-direction: column; transform-origin: top center; backface-visibility: hidden;
}
.flip-page .m { padding: 9px 0; background: var(--ink); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.flip-page .d { flex: 1; display: grid; place-items: center; font-size: 76px; font-weight: 800; letter-spacing: -.04em; }
.flip-page .w { padding-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.flip-page.turn { animation: flip .62s var(--ease) forwards; z-index: 2; }
@keyframes flip { to { transform: rotateX(-105deg); opacity: 0; } }
.work-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.work-stage { min-height: 22px; margin-top: 4px; color: var(--muted); font-size: 15px; animation: fade .3s; }
.progress { width: 100%; max-width: 280px; height: 8px; margin: 22px 0 8px; border-radius: 8px; background: var(--fill); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--ink); transition: width .5s var(--ease); }
.spinner-pot { width: 78px; height: 78px; margin-bottom: 26px; border-radius: 50%; border: 5px solid var(--fill); border-top-color: var(--ink); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Cropper */
.crop { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; display: flex; flex-direction: column; animation: fade .2s; }
.crop-stage { flex: 1; display: grid; place-items: center; touch-action: none; overflow: hidden; }
.crop-frame { position: relative; width: min(100vw, 62vh); aspect-ratio: 1; background: #000; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.crop-frame img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; pointer-events: none; }
.crop-actions { padding: 12px 20px calc(16px + var(--bottom)); }
.crop-actions .hint { text-align: center; font-size: 13px; opacity: .65; margin-bottom: 4px; }
.crop-actions input[type=range]::-webkit-slider-runnable-track { background: rgba(255, 255, 255, .25); }
.crop-actions input[type=range]::-webkit-slider-thumb { background: #fff; }
.crop-buttons { display: flex; gap: 10px; margin-top: 6px; }
.crop-buttons .btn { background: #fff; color: #000; }
.crop-buttons .btn.ghost { background: rgba(255, 255, 255, .15); color: #fff; }

/* Settings */
.pref { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pref-head { display: flex; align-items: center; gap: 12px; }
.pref-head .t { flex: 1; font-weight: 800; font-size: 17px; }
.pref-value { margin-top: 6px; color: var(--muted); font-size: 14px; transition: opacity .2s; }
.pref.off .pref-value { opacity: .35; text-decoration: line-through; }
.pref .edit { margin-top: 10px; display: inline-block; font-weight: 700; font-size: 14px; color: var(--blue); }
.switch { position: relative; width: 52px; height: 32px; flex: none; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch i { position: absolute; left: 2px; top: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); transition: transform .24s var(--spring); }
.switch.on { background: var(--ink); }
.switch.on i { transform: translateX(20px); }

@media (min-width: 620px) {
  #app { left: 50%; right: auto; width: 430px; margin-left: -215px; box-shadow: 0 0 0 1px var(--line); }
}

/* Store logos */
.mark { width: 100%; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; }
.mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.mark-name { font-size: 13px; font-weight: 700; line-height: 1.15; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mark.small { width: 46px; height: 24px; flex: none; }
.mark.small .mark-name { font-size: 10px; font-weight: 600; color: var(--muted); }
.store-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.store-tile { position: relative; height: 88px; overflow: hidden; padding: 12px 10px 8px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--ink); font: inherit; transition: transform .18s var(--spring), box-shadow .18s var(--ease); }
.store-tile:active { transform: scale(.94); }
.store-tile.on { box-shadow: inset 0 0 0 2.5px var(--blue); transform: scale(1.02); }
.store-tile small { font-size: 11px; color: var(--muted); }
.store-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; animation: rise .18s var(--spring); }
.sort-row .mark { width: 96px; height: 34px; justify-content: flex-start; }
.sort-row .mark img { object-position: left center; }
.logo-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.logo-row .mark { width: 64px; height: 30px; }

/* Ingredients */
.ing-text { flex: 1; min-width: 0; }
.ing-product { font-size: 13px; color: var(--muted); margin-top: 1px; }
.add-list { margin-top: 12px; gap: 8px; }

/* Shopping list */
.text-btn { border: 0; background: none; padding: 8px 10px; font: inherit; font-size: 16px; font-weight: 700; color: var(--blue); }
.text-btn:active { opacity: .5; }
.sl-body { padding-bottom: calc(var(--tabbar) + var(--bottom) + 96px); }
.sl-empty { color: var(--muted); margin: 4px 0 10px; }
.sl-row { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 6px 0; overflow: hidden; border-bottom: 1px solid var(--line); transition: height .22s var(--ease), min-height .22s var(--ease), padding .22s var(--ease), opacity .18s, transform .22s var(--ease); animation: rise .22s var(--ease); }
.sl-row.gone { height: 0 !important; min-height: 0; padding: 0; opacity: 0; transform: translateX(-24px); border-bottom-width: 0; }
.sl-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; color: var(--muted); transition: opacity .2s; }
.sl-icon img { width: 100%; height: 100%; object-fit: contain; }
.sl-txt { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.sl-name { background: linear-gradient(currentColor, currentColor) 0 56% / 0 1.5px no-repeat; transition: background-size .26s var(--ease), color .2s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sl-sub { font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.sl-row.done .sl-name { background-size: 100% 1.5px; color: var(--faint); }
.sl-row.done .sl-icon, .sl-row.done .mark { opacity: .45; }
.sl-minus { width: 26px; height: 26px; flex: none; margin: 0 3px 0 3px; padding: 0; border: 0; border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; animation: rise .18s var(--spring); }
.sl-minus:active { transform: scale(.88); }
.sl-add { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 0 2px; border: 0; background: none; font: inherit; font-size: 17px; font-weight: 700; color: var(--blue); }
.sl-add:active { opacity: .5; }
input.sl-input { margin-top: 8px; }
.sl-trash { position: absolute; right: 20px; bottom: calc(var(--tabbar) + var(--bottom) + 16px); width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); transition: transform .18s var(--spring); }
.sl-trash:active { transform: scale(.9); }

.sl-link { width: 40px; height: 40px; flex: none; margin-right: -8px; padding: 0; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.sl-link:active { color: var(--blue); transform: scale(.88); }
.sl-stores { margin-top: 6px; }
.sl-store { display: flex; align-items: center; gap: 14px; min-height: 60px; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.sl-store:last-child { border-bottom: 0; }
.sl-store:active { opacity: .55; }
.sl-store .mark { width: 72px; height: 36px; flex: none; }
.sl-store .grow { flex: 1; min-width: 0; }
.sl-store svg { color: var(--faint); }
.ing-product.missing { color: var(--danger); }
.zip-row { display: flex; gap: 10px; margin-top: 10px; }
.zip-row input { flex: 1; min-width: 0; margin: 0; }
.zip-row .btn { width: auto; padding: 0 20px; flex: none; }

/* Recipe being built */
.work-bar { position: absolute; top: calc(var(--top) + 14px); left: 20px; right: 20px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.work-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width .5s var(--ease); }
.working { position: relative; }
.build { display: none; width: 100%; flex: 1; min-height: 0; overflow-y: auto; text-align: left; margin-top: 10px; }
.build .section-title { display: none; font-size: 21px; margin: 16px 0 8px; }
.build .section-title.on { display: block; animation: rise .25s var(--ease); }
.build .ing, .build .step { animation: rise .28s var(--ease); }
.working.live { justify-content: flex-start; padding-top: calc(var(--top) + 40px); padding-bottom: calc(var(--bottom) + 10px); text-align: left; align-items: stretch; }
.working.live .spinner-pot { display: none; }
.working.live .build { display: block; }
.working.live .work-title { font-size: 26px; line-height: 1.15; animation: rise .25s var(--ease); }
