/* Korbonaut app prototype. Tokens follow DESIGN.md ("Korbonaut additions"); light mode only. */
:root {
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --hairline: #d2d2d7;
  --divider: #e8e8ed;
  --primary: #0071e3;
  --link: #0066cc;
  --primary-tint: #e8f2fd;
  --green: #008009;
  --green-tint: #e6f4e8;
  --red: #e30000;
  --red-tint: #fff2f4;
  --r-card: 18px;
  --r-ctl: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 17px; line-height: 1.35; color: var(--ink); background: var(--parchment);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: left; }
input { font: inherit; color: inherit; }
.ic { display: block; flex: none; }
.faint { color: var(--faint); }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- page around the phone ---------- */
.stage { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 56px; padding: 32px 24px; }
.about { width: 600px; flex: 0 1 600px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.about .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.about h1 { font-size: 21px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.about h2 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 20px 0 4px; }
.about ol { padding-left: 18px; margin: 0; }
.about li { margin: 5px 0; }
.about b { color: var(--ink); font-weight: 600; }
.about a { color: var(--link); }
.about .today { display: flex; gap: 8px; align-items: center; }
.about .today input { font-size: 14px; padding: 4px 6px; border: 1px solid var(--hairline); border-radius: 8px; background: #fff; }
.about .today button { color: var(--link); }
.about .link-btn { color: var(--link); }
.about .reset { margin-top: 12px; color: var(--link); }
.phone {
  position: relative; flex: none; width: 390px; height: 844px; overflow: hidden;
  background: var(--canvas); border: 10px solid #1d1d1f; border-radius: 54px;
}
#app { position: absolute; inset: 0; overflow: hidden; }

/* ---------- screen frame ---------- */
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 14px; }
.nav { height: 48px; flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 6px; }
.nav > :first-child { justify-self: start; }
.nav > :last-child { justify-self: end; }
.nav-right { display: flex; align-items: center; }
.share-btn { display: flex; align-items: center; min-height: 44px; padding: 0 4px; }
.avatars { display: inline-flex; align-items: center; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: var(--s, 26px); height: var(--s, 26px); border-radius: 50%;
  background: var(--c); color: #fff; font-size: 11px; font-weight: 600; box-shadow: 0 0 0 2px #fff;
}
.avatars .avatar + .avatar { margin-left: -6px; }
.more-n { margin-left: 4px; font-size: 12px; color: var(--muted); }
.mark { justify-self: center; display: block; height: 30px; width: auto; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; color: var(--primary); border-radius: 22px; }
.icon-btn:active { background: var(--parchment); }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.pad { padding: 4px 16px 120px; }
.h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 4px 0 16px; }
.h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 980px; font-size: 17px; text-align: center; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { filter: brightness(0.92); }
.btn.secondary { background: var(--pearl); border: 1px solid var(--hairline); color: var(--ink); }
.btn.wide { width: 100%; }
.btn.gap { margin-top: 16px; }
.link { color: var(--link); font-size: inherit; }

/* ---------- home ---------- */
.tpl-card { background: var(--parchment); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tpl-preview {
  height: 132px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 70%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 70%, transparent);
}
.tpl-roll { list-style: none; margin: 0; padding: 0; animation: tpl-roll calc(var(--n) * 3.2s) linear infinite; }
.tpl-roll li { position: relative; height: 30px; line-height: 30px; padding-left: 15px; font-size: 16px; }
.tpl-roll li::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: var(--faint); }
@keyframes tpl-roll { to { transform: translateY(-50%); } }
.home .or { margin: 20px 0 4px; }
.blank-tile { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: var(--primary); }
.tile { width: 44px; height: 44px; border-radius: var(--r-ctl); background: var(--parchment); display: grid; place-items: center; }
.list-card { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 16px 18px; margin-bottom: 12px; background: var(--parchment); border-radius: var(--r-card); }
.list-card:active { background: #ececf0; }
.lc-title { font-size: 19px; font-weight: 600; }
.lc-mid { font-size: 15px; }
.lc-mid b { font-weight: 600; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.logos { display: inline-flex; align-items: center; gap: 4px; min-height: 18px; }
.logo { display: block; height: 18px; width: auto; max-width: 44px; border-radius: 3px; }
.fab {
  position: absolute; right: 20px; bottom: 28px; z-index: 4; width: 52px; height: 52px; border-radius: 26px;
  display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

/* ---------- list: day and total bar ---------- */
.daybar {
  position: sticky; top: 0; z-index: 3; padding: 2px 16px 8px;
  background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
}
.db-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.db-date { display: flex; flex-direction: column; align-items: flex-start; min-height: 40px; font-size: 15px; font-weight: 600; }
.db-val { display: flex; align-items: center; gap: 4px; }
.db-label { display: block; font-size: 11px; font-weight: 500; line-height: 1.2; color: var(--muted); }
.db-total { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-height: 40px; }
.tline { display: flex; align-items: center; gap: 6px; }
.tot { font-size: 17px; font-weight: 600; }
.without { font-size: 12px; color: var(--muted); }
.day-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; margin-top: 4px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.day-hint.cheaper { padding: 0 0 0 12px; background: var(--green-tint); color: var(--green); }
.dh-go { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; color: inherit; }
.dh-go b { font-weight: 600; }
.dh-x { width: 40px; height: 36px; display: grid; place-items: center; color: var(--green); opacity: 0.7; }
.day-hint.best { min-height: 0; padding: 2px 0; font-size: 12px; color: var(--muted); }
.tick { margin-top: 4px; text-align: right; font-size: 12px; font-weight: 600; color: var(--muted); animation: tick 3s ease-out var(--age, 0ms) both; }
@keyframes tick { 0% { opacity: 0; } 8%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- list: title and rows ---------- */
.lpad { padding: 0 16px 280px; }
.title-input { display: block; width: 100%; padding: 14px 0 6px; border: 0; outline: 0; background: none; font-size: 28px; font-weight: 600; letter-spacing: -0.01em; }
.title-input::placeholder { color: var(--faint); }
.status-line { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.items { display: flex; flex-direction: column; }
.swipe { position: relative; margin: 0 -8px; border-radius: 10px; overflow: hidden; }
.swipe-bg { position: absolute; inset: 0; display: none; align-items: center; justify-content: flex-end; padding-right: 20px; background: #f2b8bd; color: #fff; font-size: 15px; font-weight: 600; }
.swiping .swipe-bg { display: flex; }
.swipe.armed .swipe-bg { background: var(--red); }
.row { position: relative; display: flex; align-items: flex-start; gap: 4px; padding: 4px 8px; border-radius: 10px; background: var(--canvas); touch-action: pan-y; }
.check { flex: none; width: 36px; height: 44px; margin-left: -6px; display: grid; place-items: center; }
.box { width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--faint); display: grid; place-items: center; color: #fff; transition: background 0.15s, border-color 0.15s; }
.box.on { background: var(--primary); border-color: var(--primary); }
.txt { flex: 1; min-width: 0; padding: 10px 0 6px; }
.name { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; cursor: text; }
.name-input { display: block; width: 100%; padding: 0; border: 0; outline: 0; background: none; font-size: 17px; line-height: 1.3; }
.sub { display: block; width: 100%; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.sub.blue { color: var(--primary); }
.sub.faint { color: var(--faint); }
.price { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-height: 44px; padding: 10px 0 6px 8px; }
.pl { display: flex; align-items: center; gap: 6px; }
.val { font-size: 15px; font-weight: 600; }
.val.none { font-weight: 400; color: var(--faint); }
.unit { font-size: 12px; color: var(--muted); }
.was { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.qchip { flex: none; min-width: 36px; height: 28px; margin-top: 8px; border-radius: 980px; background: var(--primary-tint); color: var(--primary); font-weight: 600; text-align: center; }
.row.checked .name { text-decoration: line-through; color: var(--faint); }
.row.checked .sub, .row.checked .price { opacity: 0.5; }

.flash-new { animation: flash-new 1.6s ease-out var(--age, 0ms) both; }
.flash-new .pl { animation: price-in 0.5s ease-out var(--age, 0ms) both; }
.flash-change { animation: flash-change 3s ease-out var(--age, 0ms) both; }
@keyframes flash-new { 0% { background: var(--green-tint); } 100% { background: var(--canvas); } }
@keyframes flash-change { 0%, 50% { background: var(--primary-tint); } 100% { background: var(--canvas); } }
@keyframes price-in { from { opacity: 0; transform: translateY(3px); } }

.add-wrap { position: relative; }
.add { display: flex; align-items: center; gap: 10px; min-height: 48px; padding-left: 2px; }
.add-input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: none; font-size: 17px; }
.add-input::placeholder { color: var(--faint); }
.suggest {
  position: absolute; left: -4px; right: -4px; top: 100%; z-index: 5; padding: 4px 0;
  background: #fff; border: 1px solid var(--divider); border-radius: var(--r-ctl); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.sug { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 14px; }
.sug.on, .sug:hover { background: var(--parchment); }
.nm { flex: 1; min-width: 0; font-size: 15px; }
.nm small { display: block; font-size: 12px; color: var(--muted); }
.pr { font-size: 13px; color: var(--muted); }
.sug-hint { padding: 8px 14px 6px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--faint); }
.hint { padding-left: 32px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.hint p { margin: 0 0 6px; }
.done-toggle { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 8px; border-top: 1px solid var(--divider); font-size: 15px; color: var(--muted); }

/* ---------- sheets ---------- */
.backdrop { position: absolute; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.28); }
.backdrop.enter { animation: fade 0.2s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 11; max-height: 86%; overflow-y: auto;
  padding: 6px 20px 32px; background: #fff; border-radius: var(--r-card) var(--r-card) 0 0;
}
.sheet.enter { animation: sheet-up 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.grabber { display: block; position: relative; width: 60px; height: 22px; margin: 0 auto 2px; }
.grabber::before { content: ""; position: absolute; left: 12px; right: 12px; top: 6px; height: 5px; border-radius: 3px; background: var(--hairline); }
.sh-title { margin: 2px 0 4px; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sec-title { margin: 20px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fine { margin: 12px 0; font-size: 12px; line-height: 1.45; color: var(--faint); }
.menu-item { display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--divider); color: var(--primary); }
.menu-item small { font-size: 13px; color: var(--muted); }
.menu-item.danger { color: var(--red); }
.menu-item:last-child { border-bottom: 0; }

.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.stepper { display: flex; align-items: center; background: var(--parchment); border-radius: 980px; }
.stepper button { width: 44px; height: 40px; display: grid; place-items: center; color: var(--primary); }
.stepper span { min-width: 64px; text-align: center; font-weight: 600; font-size: 15px; }
.srow { display: flex; align-items: center; gap: 10px; margin: 0 -10px; padding: 10px; border-radius: var(--r-ctl); }
.srow.chosen { background: var(--green-tint); }
.srow.pickable { cursor: pointer; }
.srow.pickable:hover { background: var(--parchment); }
.srow .mid { flex: 1; min-width: 0; font-size: 14px; }
.srow .mid b { font-weight: 600; }
.srow small, .prow small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.srow .amt { font-size: 15px; font-weight: 600; }
.srow.off .amt, .srow.off .mid { color: var(--faint); }
.srow.off .amt { font-weight: 400; }
.thumb-btn { flex: none; }
.thumb { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--divider); }
.crop-big { display: block; width: 100%; margin-top: 8px; border-radius: var(--r-ctl); border: 1px solid var(--divider); }

.quote { margin: 4px 0 14px; font-size: 17px; }
.quote small { display: block; font-size: 12px; color: var(--muted); }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-bottom: 8px; padding: 8px 14px; border: 1px solid var(--hairline); border-radius: var(--r-ctl); }
.opt:active, .opt:hover { border-color: var(--primary); }
.clar-search { display: block; width: 100%; height: 44px; margin: 10px 0 8px; padding: 0 14px; border: 1px solid var(--hairline); border-radius: var(--r-ctl); outline: 0; background: #fff; }
.clar-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.clar-results:empty { display: none; }

.prow { display: flex; align-items: center; gap: 10px; width: calc(100% + 24px); margin: 0 -12px 4px; padding: 12px; border-radius: var(--r-ctl); }
.prow.cur { background: var(--green-tint); }
.prow .mid { flex: 1; min-width: 0; font-size: 15px; }
.prow .mid b { font-weight: 600; }
.prow .amt { font-weight: 600; }
.ok { color: var(--green); }
.pgroup { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--divider); }
.pg-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pg-head b { font-weight: 600; }
.pg-head span { margin-left: auto; font-size: 14px; color: var(--muted); }
.pg-item { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0 3px 26px; font-size: 14px; }
.pg-item.np { flex-direction: column; gap: 0; padding-left: 0; }
.pg-item small { font-size: 12px; color: var(--muted); }

.wrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: calc(100% + 24px); margin: 0 -12px; padding: 12px; border-radius: var(--r-ctl); }
.wrow { margin-bottom: 4px; }
.wrow.cur { box-shadow: inset 0 0 0 1.5px var(--hairline); }
.wrow.cheap { background: #f0f8f1; }
.wrow.dear { background: #fff5f6; }
.wrow.cheap .delta { color: var(--green); }
.wrow.dear .delta { color: var(--red); }
.wrow .d { font-weight: 600; font-size: 15px; }
.wrow em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--green); margin-left: 4px; }
.wrow .amt { font-weight: 600; text-align: right; }
.wrow .muted { font-size: 12px; }
.wrow .delta { font-size: 13px; font-weight: 600; text-align: right; color: var(--muted); }

.set-row { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--divider); }
.set-row > span:not(.avatar) { flex: 1; }
.set-row .b-txt small { display: block; font-size: 12px; color: var(--muted); }
.set-row .link { font-size: 14px; }
.pill-btn { min-height: 32px; padding: 0 14px; border-radius: 980px; background: var(--primary-tint); color: var(--primary); font-size: 14px; font-weight: 600; }
.add-buddy { display: flex; align-items: center; gap: 8px; min-height: 48px; color: var(--primary); }
.fine.tight { margin: 0 0 4px; }
.bform { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; padding: 12px; border-radius: var(--r-ctl); background: var(--parchment); }
.bform .set-row { border-bottom: 0; min-height: 44px; font-size: 15px; }
.field { display: block; width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--hairline); border-radius: var(--r-ctl); outline: 0; background: #fff; }
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.bform-actions { display: flex; gap: 8px; justify-content: flex-end; }
.mi-row { display: flex; align-items: center; gap: 8px; }
.switch { position: relative; flex: none; width: 51px; height: 31px; border-radius: 16px; background: var(--hairline); transition: background 0.2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s; }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.seg { display: flex; gap: 8px; }
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.slider-row input { flex: 1; accent-color: var(--primary); }
.slider-row b { min-width: 44px; text-align: right; font-weight: 600; }
.seg button { flex: 1; height: 44px; border: 1px solid var(--hairline); border-radius: var(--r-ctl); text-align: center; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.radio-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; border-bottom: 1px solid var(--divider); font-size: 16px; }
.radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--faint); }
.radio-row[aria-checked="true"] .radio { border: 7px solid var(--primary); }
.price-field { display: flex; align-items: center; gap: 8px; padding: 10px 0 12px 34px; font-size: 15px; color: var(--muted); }
.price-field .field { width: 110px; height: 40px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.seg button[aria-pressed="true"] { border: 2px solid var(--primary); color: var(--primary); font-weight: 600; }

/* ---------- message at the bottom ---------- */
.toast {
  position: absolute; left: 16px; right: 16px; bottom: 28px; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-ctl); background: var(--ink); color: #fff; font-size: 14px;
  animation: toast-in 0.25s ease-out var(--age, 0ms) both;
}
.toast.top { top: 60px; bottom: auto; }
.toast span { flex: 1; }
.toast button { min-height: 32px; color: #2997ff; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- phone-sized screens: the prototype fills the screen ---------- */
@media (max-width: 1100px) { .about .cols { grid-template-columns: 1fr; } .about { flex-basis: 320px; } }
@media (max-width: 500px) {
  .stage { display: block; padding: 0; }
  .about { display: none; }
  .phone { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .screen { padding-top: env(safe-area-inset-top); }
}
@media (prefers-reduced-motion: reduce) {
  .tpl-roll { animation: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- onboarding and settings screens ---------- */
.page .pad { padding-bottom: 32px; }
.foot { flex: none; padding: 12px 20px 30px; border-top: 1px solid var(--divider); background: var(--canvas); }
.fine.center, .center { text-align: center; }
.blue { color: var(--primary); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.gap-s { margin-top: 8px; }
.link.small { font-size: 15px; margin-top: 16px; min-height: 44px; }
.field.big { margin-top: 20px; height: 48px; font-size: 17px; }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
.center-block { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding-top: 40px; }
.center-block .h1 { margin: 12px 0 4px; }

.welcome { justify-content: space-between; }
.welcome-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 32px; }
.mark-big { width: 112px; height: auto; margin-bottom: 20px; }
.welcome .h1 { font-size: 34px; margin: 0; }
.tagline { margin: 6px 0 28px; font-size: 19px; color: var(--muted); }
.questions { margin: 0; font-size: 17px; line-height: 1.7; color: var(--ink); }
.welcome .foot { border-top: 0; }

.setup-sec { padding: 18px 0; border-bottom: 1px solid var(--divider); }
.ss-head { display: flex; align-items: center; gap: 12px; }
.ss-status { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--parchment); color: var(--muted); flex: none; }
.ss-status.done { background: var(--primary-tint); color: var(--primary); }
.setup-sec .muted { margin: 6px 0 10px; }
.ss-value { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.ss-value small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.btn-pearl { flex: none; padding: 7px 14px; border-radius: 11px; background: var(--pearl); border: 2px solid var(--divider); font-size: 14px; }
.btn-pearl:disabled { opacity: 0.4; cursor: default; }
.household { border-bottom: 1px solid var(--divider); padding: 8px 0; }
.household b { display: block; font-weight: 400; font-size: 17px; }
.household small { display: block; font-size: 13px; color: var(--muted); }

.pin { width: 96px; height: 96px; margin: 20px auto; border-radius: 50%; display: grid; place-items: center; background: var(--primary-tint); color: var(--primary); }
.place { font-size: 28px; font-weight: 600; margin: 2px 0 16px; letter-spacing: -0.01em; }
.search-wrap { position: relative; }
.search-ic { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.field.with-ic { padding-left: 40px; }
.place-list { margin-top: 6px; border: 1px solid var(--divider); border-radius: var(--r-ctl); overflow: hidden; }
.place-opt { display: flex; justify-content: space-between; width: 100%; min-height: 44px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--divider); }
.place-opt:last-child { border-bottom: 0; }
.place-opt small { font-size: 12px; color: var(--muted); }
.link-row { display: flex; align-items: center; gap: 6px; min-height: 44px; color: var(--primary); font-size: 15px; }
.set-row.soon { opacity: 0.45; }
.logo-blank { width: 18px; height: 18px; border-radius: 3px; background: var(--parchment); flex: none !important; }
.notice { margin-top: 20px; padding: 14px; border-radius: var(--r-ctl); background: var(--parchment); font-size: 14px; display: flex; flex-direction: column; gap: 10px; }

.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.shop-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 96px; border-radius: var(--r-ctl); border: 1px solid var(--hairline); font-size: 14px; text-align: center; }
.shop-chip img { height: 32px; width: auto; }
.shop-chip[aria-pressed="true"] { border: 2px solid var(--primary); }
.title-row { display: flex; justify-content: space-between; align-items: baseline; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.love-row { display: flex; align-items: center; gap: 8px; margin: 4px -16px 8px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.love-row::-webkit-scrollbar { display: none; }
.love-row > * { flex: 0 0 auto; }
.love-search { width: 112px; min-height: 32px; padding: 0 12px; border: 1px solid var(--hairline); border-radius: 980px; background: var(--canvas); font: inherit; font-size: 14px; outline: none; }
.love-search:focus { border-color: var(--primary); }
.pill-btn.love { background: none; border: 1px solid var(--hairline); color: inherit; font-weight: 500; }
.pill-btn.love[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.heart { margin-right: 4px; color: var(--primary); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 980px; background: var(--green-tint); color: var(--green); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.shop-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.shop-pill { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 8px; border: 1px solid var(--hairline); border-radius: 980px; font-size: 14px; font-weight: 500; }
.shop-pill[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.shop-pill:disabled { opacity: 0.6; }
.list-card { -webkit-touch-callout: none; user-select: none; }
.sec-title small { font-weight: 400; color: var(--muted); }
.pchip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 980px; background: var(--parchment); font-size: 15px; }
.pchip[aria-pressed="true"] { background: var(--primary-tint); color: var(--primary); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--primary); }

.nav-row { width: 100%; text-align: left; }
.buddy-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0 4px; text-align: center; }
.buddy-head .avatar { font-size: 24px; }
.buddy-head .h1 { margin: 8px 0 0; }
.count-line { margin: -2px 0 6px; font-size: 12px; color: var(--muted); }

.search-wrap.sticky { position: sticky; top: 0; z-index: 2; margin: 0 -16px; padding: 8px 16px; background: var(--canvas); }
.search-wrap.sticky .search-ic { left: 30px; top: 21px; }
.pchip .ic { opacity: 0.55; }
.pchip[aria-pressed="true"] { font-weight: 400; }
.pchip[aria-pressed="true"] .ic { opacity: 1; }

.stepper button:disabled { color: var(--hairline); cursor: default; }

/* ---------- public site: only the app, full screen on phones, a centred column on wider screens ---------- */
.bare { background: var(--canvas); }
.bare .stage { display: block; padding: 0; min-height: 0; }
.bare .phone { position: fixed; inset: 0; width: 100%; max-width: 480px; height: auto; margin: 0 auto; border: 0; border-radius: 0; }
.bare .screen { padding-top: max(14px, env(safe-area-inset-top)); }
.bare .foot, .bare .fab { margin-bottom: env(safe-area-inset-bottom); }
@media (min-width: 520px) { .bare { background: var(--parchment); } .bare .phone { box-shadow: 0 0 0 1px var(--divider); } }

/* home: what the weekly list costs, and the hint under the empty list */
.tpl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tpl-total { text-align: right; }
.tpl-total small { display: block; font-size: 12px; color: var(--muted); }
.tpl-total b { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.bt-txt { display: flex; flex-direction: column; }
.bt-txt small { font-size: 13px; color: var(--muted); }
/* steppers keep their own width inside rows */
.set-row > span.stepper { flex: none; }
.household .stepper span { min-width: 32px; }

.my-brand { border-bottom: 1px solid var(--divider); }
.my-brand .set-row { border-bottom: 0; }
.set-row.sub-row { min-height: 44px; padding-left: 14px; font-size: 14px; }
.set-row.sub-row .pill-btn { min-height: 28px; font-size: 13px; font-weight: 500; }
