:root {
  --brand: #ee4f8b;
  --brand-tint: #fff0f6;
  --brand-strong: #c92a68;   /* white text on it passes AA */
  --canvas: #f9f5f7;
  --surface: #ffffff;
  --title: rgba(0, 0, 0, .82);
  --text: rgba(0, 0, 0, .64);
  --muted: rgba(0, 0, 0, .58);
  --faint: rgba(0, 0, 0, .27);
  --fill1: rgba(48, 48, 52, .05);
  --fill2: rgba(48, 48, 52, .10);
  --fill3: rgba(48, 48, 52, .18);
  --line: rgba(0, 0, 0, .08);
  --ok: #0b6b30;
  --ok-tint: #eaf6ee;
  --warn: #9a5b00;
  --warn-tint: #fff5e5;
  --r-card: 12px;
  --r-big: 16px;
  --font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --tab-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--title); background: var(--canvas); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--title); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.ico { width: 22px; height: 22px; flex: none; }
.ico-s { width: 18px; height: 18px; flex: none; }

/* ---------- shell ---------- */
.app { min-height: 100dvh; padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
.page { max-width: 1200px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 56px; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.topbar .side { min-width: 44px; display: flex; align-items: center; }
.topbar .side:last-child { justify-content: flex-end; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--title); }
.icon-btn:active { background: var(--fill2); }
.wordmark { font-size: 20px; font-weight: 600; letter-spacing: -.3px; display: flex; align-items: center; gap: 6px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); height: calc(var(--tab-h) + var(--safe-b)); }
.tabbar a { display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; color: var(--muted); min-height: 44px; position: relative; }
.tabbar a[aria-current="page"] { color: var(--title); font-weight: 500; }
.tabbar a[aria-current="page"] .ico { color: var(--brand); }
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--title); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }

/* ---------- common ---------- */
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; background: var(--canvas); border-radius: 20px; color: var(--muted); flex: 1; min-width: 0; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--title); height: 100%; }
.search input::placeholder { color: var(--faint); }
.section { padding: 16px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-h h2 { font-size: 17px; font-weight: 600; }
.section-h a, .link { color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--fill2); color: var(--text); font-size: 13px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--title); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px; margin: 0 -16px; }
.chips::-webkit-scrollbar { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 22px; font-weight: 500; white-space: nowrap; }
.btn-primary { background: var(--brand-strong); color: #fff; }
.btn-primary:active { filter: brightness(.94); }
.btn-dark { background: var(--title); color: #fff; }
.btn-soft { background: var(--fill2); color: var(--title); }
.btn-line { background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill3); color: var(--title); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty h3 { color: var(--title); font-size: 16px; font-weight: 500; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 11px; background: var(--fill2); color: var(--text); white-space: nowrap; }
.tag-ok { background: var(--ok-tint); color: var(--ok); }
.tag-warn { background: var(--warn-tint); color: var(--warn); }
.skeleton { background: linear-gradient(90deg, var(--fill1), var(--fill2), var(--fill1)); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 24px + var(--safe-b)); transform: translateX(-50%); background: rgba(0, 0, 0, .82); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 80; max-width: calc(100% - 48px); text-align: center; }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 8px; }
.card { background: var(--surface); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; }
.card .pic { aspect-ratio: 1; background: #fafafa; position: relative; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; }
.card .pic .tag { position: absolute; left: 8px; top: 8px; background: rgba(255, 255, 255, .92); }
.card .body { padding: 8px 10px 10px; display: grid; gap: 4px; }
.card .t { font-size: 13px; line-height: 18px; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.price small { font-size: .72em; font-weight: 500; margin-right: 1px; }
.card .price { font-size: 17px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 12px; background: var(--fill1); }
.more { display: flex; justify-content: center; padding: 16px; }

/* ---------- home ---------- */
.home-head { background: var(--surface); padding: 8px 16px 12px; display: grid; gap: 12px; }
.home-head .row { display: flex; align-items: center; gap: 12px; }
.ask { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-card); background: var(--canvas); }
.ask .mark { width: 40px; height: 44px; flex: none; }
.ask b { font-weight: 500; display: block; }
.ask span { font-size: 12px; color: var(--muted); }
.ask .ico { margin-left: auto; color: var(--muted); }
.cats { display: grid; grid-auto-flow: column; grid-auto-columns: 64px; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 4px 16px 12px; background: var(--surface); }
.cats::-webkit-scrollbar { display: none; }
.cats a { display: grid; gap: 6px; justify-items: center; font-size: 12px; color: var(--text); text-align: center; line-height: 1.3; }
.cats .c-pic { width: 52px; height: 52px; border-radius: 50%; background: var(--canvas); overflow: hidden; }
.cats .c-pic img { width: 100%; height: 100%; object-fit: contain; }
.tabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { height: 44px; color: var(--muted); white-space: nowrap; position: relative; }
.tabs button[aria-selected="true"] { color: var(--title); font-weight: 600; }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 6px; height: 2px; border-radius: 1px; background: var(--title); }
.feed { padding-top: 8px; }

/* ---------- category list ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.cat-grid a { background: var(--surface); border-radius: var(--r-card); padding: 12px 8px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.cat-grid .c-pic { width: 64px; height: 64px; }
.cat-grid .c-pic img { width: 100%; height: 100%; object-fit: contain; }
.cat-grid small { color: var(--muted); font-size: 11px; }

/* ---------- search ---------- */
.filters { background: var(--surface); padding: 8px 16px 10px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.sortbar { display: flex; gap: 20px; font-size: 13px; color: var(--muted); }
.sortbar button { min-height: 32px; }
.sortbar button[aria-pressed="true"] { color: var(--title); font-weight: 600; }
.need-hint { margin: 8px; padding: 12px; background: var(--surface); border-radius: var(--r-card); display: flex; align-items: center; gap: 12px; }
.need-hint p { flex: 1; font-size: 13px; }

/* ---------- product detail ---------- */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #fafafa; scrollbar-width: none; position: relative; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: start; }
.gallery-wrap { position: relative; background: #fafafa; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.pd { background: var(--surface); padding: 16px; display: grid; gap: 8px; }
.pd .price { font-size: 26px; }
.pd .price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pd h2 { font-size: 17px; font-weight: 500; line-height: 1.45; }
.pd-block { background: var(--surface); margin-top: 8px; padding: 16px; }
.pd-block h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.hl { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hl li { display: flex; gap: 8px; color: var(--text); }
.hl li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--faint); margin-top: 9px; flex: none; }
.specs { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs th { text-align: left; color: var(--muted); font-weight: 400; width: 34%; padding: 8px 8px 8px 0; vertical-align: top; }
.specs td { padding: 8px 0; color: var(--title); }
.specs tr + tr { border-top: 1px solid var(--line); }
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + var(--safe-b)); display: flex; gap: 8px; align-items: center; }
.buybar .icon-col { display: grid; justify-items: center; font-size: 10px; color: var(--muted); min-width: 44px; min-height: 44px; align-content: center; }
.buybar .icon-col[aria-pressed="true"] { color: var(--title); }
.buybar .icon-col[aria-pressed="true"] svg { fill: currentColor; }
.buybar .btn { flex: 1; padding: 0 10px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .card { background: var(--canvas); }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - 56px - var(--tab-h)); }
.msgs { flex: 1; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 12px; }
.u-msg { align-self: flex-end; max-width: 82%; background: var(--brand-tint); color: var(--title); padding: 10px 14px; border-radius: 16px 4px 16px 16px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.a-msg { align-self: stretch; background: var(--surface); border-radius: 4px 16px 16px 16px; padding: 14px; display: grid; gap: 12px; font-size: 15px; line-height: 1.7; }
.a-msg p { color: var(--title); }
.a-msg .note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.a-msg .warn { font-size: 13px; color: var(--warn); background: var(--warn-tint); padding: 8px 10px; border-radius: 8px; line-height: 1.6; }
.planbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--canvas); font-size: 13px; }
.planbar .price { font-size: 17px; }
.planbar .st { flex: 1; min-width: 0; color: var(--text); }
.planbar.ok .st { color: var(--ok); }
.planbar.pending .st { color: var(--warn); }
.tips h4 { font-size: 15px; font-weight: 600; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.tips ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tips li { padding-left: 14px; position: relative; color: var(--text); }
.tips li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--title); }
.tips li b { color: var(--title); font-weight: 600; }
.tips .caution { margin-top: 8px; color: var(--text); }
.tips .caution b { color: var(--title); }
.tips.collapsed ul li:nth-child(n+3) { display: none; }
.tips .toggle { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 32px; }
.pick h4 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.pick .why { color: var(--text); font-size: 14px; }
.line { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; border-radius: var(--r-card); background: var(--canvas); align-items: start; }
.line .pic { width: 96px; height: 96px; border-radius: 10px; background: #fff; overflow: hidden; }
.line .pic img { width: 100%; height: 100%; object-fit: contain; }
.line .info { display: grid; gap: 4px; min-width: 0; }
.line .t { font-size: 14px; line-height: 1.45; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.line .facts { font-size: 12px; color: var(--muted); }
.line .row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.line .price { font-size: 18px; }
.lines { display: grid; gap: 8px; }
.alts h5 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 8px; }
.alt { background: var(--canvas); border-radius: 10px; overflow: hidden; display: grid; }
.alt .pic { aspect-ratio: 1; background: #fff; }
.alt .pic img { width: 100%; height: 100%; object-fit: contain; }
.alt .b { padding: 6px 8px 8px; display: grid; gap: 2px; font-size: 12px; }
.alt .b .t { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--title); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .chip { height: 36px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill3); color: var(--title); }
.composer { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); background: var(--canvas); padding: 8px 12px 10px; display: grid; gap: 8px; }
.composer form { display: flex; align-items: flex-end; gap: 8px; background: var(--surface); border-radius: 22px; padding: 4px 4px 4px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; min-height: 36px; max-height: 120px; padding: 8px 0; background: transparent; line-height: 20px; }
.composer textarea::placeholder { color: var(--faint); }
.send { width: 40px; height: 40px; min-width: 44px; min-height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.send[disabled] { background: var(--fill3); }
.typing { align-self: flex-start; background: var(--surface); border-radius: 4px 16px 16px 16px; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.chat-empty { padding: 24px 16px; display: grid; gap: 16px; }
.chat-empty h2 { font-size: 20px; font-weight: 600; }
.chat-empty .sugs { display: grid; gap: 8px; }
.chat-empty .sugs button { text-align: left; background: var(--surface); border-radius: var(--r-card); padding: 12px 14px; color: var(--title); min-height: 44px; }
.chat-layout { display: block; }
.side-plan { display: none; }

/* ---------- plan ---------- */
.plan-head { background: var(--surface); padding: 16px; display: grid; gap: 10px; }
.budget-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.budget-row .label { color: var(--muted); font-size: 13px; }
.budget-row .price { font-size: 22px; }
.budget-edit { display: flex; gap: 8px; align-items: center; }
.budget-edit input { width: 120px; height: 40px; border-radius: 20px; border: 0; background: var(--canvas); padding: 0 14px; font-variant-numeric: tabular-nums; }
meter { width: 100%; height: 6px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--canvas); color: var(--text); }
.status.ok { background: var(--ok-tint); color: var(--ok); }
.status.pending { background: var(--warn-tint); color: var(--warn); }
.status.bad { background: var(--fill2); color: var(--title); }
.seg { display: inline-flex; background: var(--fill2); border-radius: 18px; padding: 2px; }
.seg button { height: 32px; padding: 0 14px; border-radius: 16px; color: var(--text); font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--title); font-weight: 500; }
.items { padding: 8px; display: grid; gap: 8px; }
.item { background: var(--surface); border-radius: var(--r-card); padding: 12px; display: grid; gap: 10px; }
.item .top { display: grid; grid-template-columns: 88px 1fr; gap: 12px; }
.item .pic { width: 88px; height: 88px; border-radius: 10px; background: #fafafa; overflow: hidden; }
.item .pic img { width: 100%; height: 100%; object-fit: contain; }
.item .cat { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item .t { font-size: 14px; font-weight: 500; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item .bottom .grow { flex: 1; }
.stepper { display: inline-flex; align-items: center; background: var(--canvas); border-radius: 18px; }
.stepper button { width: 36px; height: 36px; min-width: 44px; display: grid; place-items: center; }
.stepper span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.mini { min-height: 36px; padding: 0 12px; border-radius: 18px; background: var(--canvas); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.mini[aria-pressed="true"] { background: var(--title); color: #fff; }
.extlink { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.extlink:hover { color: var(--title); }

/* ---------- sheet ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 60; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--surface); border-radius: 16px 16px 0 0; max-height: 82dvh; overflow: auto; padding: 8px 16px calc(16px + var(--safe-b)); }
.sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: #e0e0e0; margin: 0 auto 12px; }
.sheet h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.sheet .sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.opt { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.opt .pic { width: 64px; height: 64px; border-radius: 8px; background: #fafafa; overflow: hidden; }
.opt .pic img { width: 100%; height: 100%; object-fit: contain; }
.opt .t { font-size: 13px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- me & forms ---------- */
.me-head { background: var(--surface); padding: 24px 16px; display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--title); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; flex: none; }
.me-head .who { flex: 1; min-width: 0; }
.me-head .who b { display: block; font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list { background: var(--surface); margin-top: 8px; }
.list a, .list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; text-align: left; }
.list a + a, .list a + button, .list button + a, .list button + button { border-top: 1px solid var(--line); }
.list .grow { flex: 1; }
.list .val { color: var(--muted); font-size: 13px; }
.list .chev { color: var(--faint); }
.danger { color: #c4311b; }
.auth { max-width: 400px; margin: 0 auto; padding: 32px 24px 48px; display: grid; gap: 20px; }
.auth h2 { font-size: 24px; font-weight: 600; }
.auth .sub { color: var(--muted); margin-top: 4px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text); }
.inp { display: flex; align-items: center; background: var(--surface); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); padding: 0 4px 0 14px; min-height: 48px; }
.inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--title); }
.inp input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 46px; min-width: 0; }
.field .err { color: #c4311b; font-size: 12px; }
.field .hint { color: var(--muted); font-size: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--title); }
.form-err { background: #fdecea; color: #a8261a; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.alt-link { text-align: center; color: var(--muted); font-size: 13px; }
.alt-link a { color: var(--title); font-weight: 500; }
.doc { background: var(--surface); padding: 20px 16px 40px; line-height: 1.8; color: var(--text); }
.doc h2 { color: var(--title); font-size: 18px; margin-bottom: 8px; }
.doc h3 { color: var(--title); font-size: 15px; margin: 16px 0 4px; }

/* ---------- desktop ---------- */
@media (min-width: 1024px) {
  .app { padding-bottom: 0; }
  .tabbar { position: sticky; top: 0; bottom: auto; height: 60px; padding: 0 max(16px, calc((100vw - 1200px) / 2)); display: flex; gap: 8px; align-items: stretch; border-top: 0; border-bottom: 1px solid var(--line); }
  .tabbar::before { content: "知选"; font-size: 20px; font-weight: 600; display: flex; align-items: center; padding: 0 32px 0 16px; }
  .tabbar a { display: flex; align-items: center; padding: 0 14px; font-size: 15px; }
  .tabbar a .ico { display: none; }
  .tabbar a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--title); }
  .tabbar .badge { position: static; margin-left: 4px; }
  .topbar { top: 60px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
  .cat-grid { grid-template-columns: repeat(7, 1fr); }
  .home-head { padding: 20px 16px; grid-template-columns: 1fr 1fr; align-items: center; }
  .home-head .row .wordmark { display: none; }
  .pd-wrap { display: grid; grid-template-columns: 520px 1fr; gap: 24px; padding: 24px 16px; align-items: start; }
  .pd-wrap .gallery-wrap { border-radius: var(--r-big); overflow: hidden; position: sticky; top: 80px; }
  .pd-wrap .pd, .pd-wrap .pd-block { border-radius: var(--r-card); }
  .buybar { position: static; border: 0; padding: 16px 0 0; background: transparent; }
  .chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; padding: 16px; align-items: start; }
  .chat { min-height: calc(100dvh - 60px - 56px - 32px); background: var(--canvas); }
  .side-plan { display: block; position: sticky; top: 132px; background: var(--surface); border-radius: var(--r-big); max-height: calc(100dvh - 150px); overflow: auto; }
  .side-plan .items { padding: 8px 12px 12px; }
  .side-plan .item { background: var(--canvas); }
  .composer { bottom: 0; }
  .toast { bottom: 32px; }
  .scrim + .sheet { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%); width: 520px; border-radius: var(--r-big); }
  .items { grid-template-columns: 1fr 1fr; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.sk-line { height: 14px; }
.sk-short { width: 50%; }

.item .top { position: relative; padding-right: 36px; }
.item .rm { position: absolute; right: -8px; top: -8px; color: var(--muted); }
.mini[disabled], .stepper button[disabled] { opacity: .35; cursor: default; }
meter { accent-color: var(--title); }
meter::-webkit-meter-optimum-value { background: var(--title); }
meter::-webkit-meter-bar { background: var(--fill2); border: 0; border-radius: 3px; }
.pd-wrap > * { min-width: 0; }
.field .err:empty { display: none; }
.check a, .doc a { text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 1024px) { .side-plan .items { grid-template-columns: 1fr; } }

/* review fixes */
.a-msg { grid-template-columns: minmax(0, 1fr); }
.a-msg > * { min-width: 0; }
.a-msg, .u-msg, .send-err { scroll-margin-top: 72px; }
.mini, .seg button, .actions .chip, .chips .chip, .sortbar button, .tips .toggle, .extlink, .section-h a { min-height: 44px; }
.seg button { padding: 0 16px; border-radius: 22px; }
.seg { border-radius: 24px; }
.stepper button { height: 44px; }
.alt-link a, .check a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.gallery .noimg { flex: none; width: 100%; aspect-ratio: 1; }
.pd-skel { display: grid; gap: 12px; padding: 16px; background: var(--surface); }
.pd-skel .sk-pic { aspect-ratio: 1; border-radius: 0; margin: -16px -16px 0; }
.pd-skel .sk-price { height: 28px; width: 40%; }
.send-err { align-self: flex-end; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a8261a; }
.send-err button { min-height: 44px; padding: 0 12px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--fill3); color: var(--title); }
.toast { bottom: calc(var(--tab-h) + 96px + var(--safe-b)); }
.g-nav { display: none; }
@media (min-width: 1024px) {
  .a-msg, .u-msg, .send-err { scroll-margin-top: 136px; }
  .toast { top: 84px; bottom: auto; }
  .g-nav { display: grid; place-items: center; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.12); color: var(--title); }
  .g-prev { left: 12px; } .g-next { right: 12px; }
  .g-prev .ico { transform: rotate(0deg); }
}
.g-nav { z-index: 2; }
.sortbar button { padding: 0 8px; min-width: 44px; }

/* ---------- assistant (知选 | 商品 | 攻略) ---------- */
.logo-s { width: 22px; height: 22px; flex: none; }
.agent-top { gap: 8px; }
.seg-tabs { flex: 1; display: flex; justify-content: center; align-items: center; gap: 4px; }
.seg-tabs button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; font-size: 15px; color: var(--muted); position: relative; }
.seg-tabs button[aria-selected="true"] { color: var(--title); font-weight: 600; }
.seg-tabs button[aria-selected="true"]:not(:first-child)::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 6px; height: 2px; border-radius: 1px; background: var(--title); }
.seg-tabs i { width: 1px; height: 14px; background: var(--fill3); }
.pane { min-height: calc(100dvh - 56px - var(--tab-h)); background: var(--canvas); }
.subtabs { display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 5; }
.subtabs button { min-height: 44px; white-space: nowrap; color: var(--muted); font-size: 15px; position: relative; }
.subtabs button[aria-selected="true"] { color: var(--title); font-weight: 600; }
.subtabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 6px; height: 2px; background: var(--title); border-radius: 1px; }
.subtabs.topics { top: 100px; }
.guide { padding: 16px; display: grid; gap: 18px; background: var(--surface); }
.guide h2 { font-size: 18px; font-weight: 600; }
.guide section { scroll-margin-top: 150px; }
.guide h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.guide p { color: var(--text); font-size: 15px; line-height: 1.8; }

.intro { padding: 32px 16px 16px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.intro .hero { width: 104px; height: auto; }
.intro h2 { font-size: 20px; font-weight: 600; }
.intro > p { max-width: 30em; }
.likes { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.likes button { background: var(--surface); border-radius: var(--r-card); padding: 12px 10px; display: grid; gap: 4px; text-align: left; min-height: 44px; }
.likes b { font-size: 14px; }
.likes span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.intro .guess { width: 100%; text-align: left; }

.steps { background: var(--canvas); border-radius: var(--r-card); }
.steps summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; font-weight: 600; font-size: 14px; cursor: pointer; }
.steps summary::-webkit-details-marker { display: none; }
.steps .chev { margin-left: auto; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.steps[open] .chev { transform: rotate(-90deg); }
.steps ol { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 10px; }
.steps li { display: flex; gap: 8px; font-size: 13px; }
.steps li .ico-s { color: var(--ok); margin-top: 2px; }
.steps li div { display: grid; }
.steps li span { color: var(--muted); }

.sec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; } /* wide tables and strips scroll inside, they must not widen the reply */
.sec h3 { font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.sec h3 .num { font-size: 13px; font-weight: 400; color: var(--muted); }
.sec .lead, .sec .why { color: var(--text); font-size: 14px; }
.prow { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px; border-radius: var(--r-card); background: var(--canvas); }
.prow .pic { width: 96px; height: 96px; border-radius: 10px; background: #fff; overflow: hidden; }
.prow .pic img { width: 100%; height: 100%; object-fit: contain; }
.prow .fav { position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, .86); display: grid; place-items: center; color: var(--muted); }
.prow .fav[aria-pressed="true"] { color: var(--brand); }
.prow .info { display: grid; gap: 4px; min-width: 0; align-content: start; }
.prow .t { font-size: 14px; line-height: 1.45; font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prow .src { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 4px; margin-right: 4px; border-radius: 3px; background: var(--title); color: #fff; vertical-align: 1px; font-weight: 500; }
.prow .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag-best { background: var(--brand-tint); color: var(--brand-strong); }
.prow .buy { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prow .price { font-size: 18px; }
.prow .ops { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.prow .add { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--fill3); }
.prow .go { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--title); color: #fff; font-size: 13px; display: inline-flex; align-items: center; }
.a-msg .all { min-height: 44px; border-radius: var(--r-card); background: var(--canvas); color: var(--title); font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 4px; }
.gcards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gcards button { background: var(--canvas); border-radius: var(--r-card); padding: 12px; display: grid; gap: 4px; text-align: left; min-height: 72px; }
.gcards b { font-size: 14px; }
.gcards span { font-size: 12px; color: var(--muted); line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.filter { background: var(--canvas); border-radius: var(--r-card); padding: 12px; display: grid; gap: 10px; }
.filter h3 { font-size: 15px; font-weight: 600; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fgrid button, .filter .skip { min-height: 44px; border-radius: 10px; background: var(--surface); color: var(--title); font-size: 14px; padding: 0 8px; }
.filter .skip { color: var(--muted); }
details.more { margin-top: 8px; }
details.more > summary { display: flex; align-items: center; gap: 4px; min-height: 40px; color: var(--muted); font-size: 13px; cursor: pointer; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary .chev { transform: rotate(180deg); }
.a-msg .confirm { width: 100%; margin-top: 4px; min-height: 44px; }
.pending-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px; }
.fb [aria-pressed="true"] { color: var(--brand-strong); }
.fb-why { flex-wrap: wrap; margin: 12px 0; }
.fb-why [aria-pressed="true"] { color: var(--brand-strong); background: var(--brand-tint); }
.fb-note { display: grid; gap: 6px; margin-bottom: 12px; }
.fb-note textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.fb { display: flex; gap: 4px; margin: -4px 0 -8px -10px; color: var(--muted); }
.guess { display: grid; gap: 8px; justify-items: start; }
.guess h4 { font-size: 13px; font-weight: 400; color: var(--muted); margin: 4px 0 0; }
.guess button { background: var(--surface); border-radius: 20px; padding: 10px 14px; min-height: 44px; text-align: left; color: var(--title); }
.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.quick .chip { flex: none; height: 36px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--title); }
.disclaim { font-size: 11px; color: var(--faint); text-align: center; margin-top: -2px; }
.typing { display: flex; align-items: center; gap: 8px; }
@media (min-width: 1024px) { .subtabs { top: 116px; } .subtabs.topics { top: 160px; } .pane { grid-column: 1; } .tabbar::before { content: ""; width: 44px; background: url(/logo.svg) center / 32px no-repeat; padding: 0 8px; } .tabbar::after { content: none; } }
.ask-fab { display: none; position: fixed; right: 12px; bottom: calc(var(--tab-h) + var(--safe-b) + 20px); z-index: 25; width: 64px; height: 64px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 12px rgba(0, 0, 0, .14); place-items: center; align-content: center; }
.ask-fab img { width: 34px; height: 34px; }
.ask-fab span { font-size: 11px; color: var(--title); line-height: 1.2; }
.has-fab .ask-fab { display: grid; }
@media (min-width: 1024px) { .ask-fab { bottom: 32px; right: 32px; } }
.bundle-h { font-size: 16px; font-weight: 600; }
.tab-logo { width: 26px; height: 26px; }
.posts { padding: 12px; display: grid; gap: 8px; }
.post { display: grid; gap: 6px; padding: 12px; border-radius: var(--r-card); background: var(--surface); }
.a-msg .post { background: var(--canvas); }
.post b { font-size: 15px; line-height: 1.45; }
.post p { font-size: 13px; color: var(--text); line-height: 1.6; }
.post .pm { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.post .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-tabs button { padding: 0 8px; }
.u-prod { align-self: flex-end; display: grid; justify-items: end; gap: 4px; margin-top: -4px; }
.u-prod .pic { position: relative; width: 88px; height: 88px; border-radius: 10px; background: #fff; overflow: hidden; }
.u-prod .pic img { width: 100%; height: 100%; object-fit: contain; }
.u-prod .pic .num { position: absolute; left: 4px; bottom: 4px; font-size: 11px; color: #fff; background: rgba(0, 0, 0, .55); padding: 0 6px; border-radius: 8px; }
.cmp-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cmp-h { display: flex; gap: 8px; align-items: center; min-width: 0; }
.cmp-h .pic { width: 44px; height: 44px; border-radius: 8px; background: var(--canvas); overflow: hidden; flex: none; }
.cmp-h .pic img, .cmp td .pic img { width: 100%; height: 100%; object-fit: contain; }
.cmp-h .t { font-size: 13px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cmp-h em { font-style: normal; color: var(--brand-strong); margin-right: 4px; }
.cmp-wrap { overflow-x: auto; border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); }
.cmp { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.cmp th, .cmp td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; word-break: break-word; white-space: pre-line; }
.cmp th[scope="row"], .cmp thead th:first-child { width: 76px; color: var(--muted); font-weight: 400; }
.cmp thead th { font-weight: 600; background: var(--canvas); }
.cmp td .pic { display: block; width: 72px; height: 72px; border-radius: 8px; background: var(--canvas); overflow: hidden; }
.cmp td.cmp-price { color: var(--brand-strong); font-weight: 600; font-size: 15px; }
.cmp tr:last-child th, .cmp tr:last-child td { border-bottom: 0; }
.pts { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.pts li { padding-left: 14px; position: relative; color: var(--text); }
.pts li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--title); }
.pts li b { color: var(--title); }
.a-msg .tip { display: flex; gap: 6px; color: var(--text); font-size: 14px; }
.a-msg .tip .ico-s { margin-top: 3px; color: var(--warn); }
.a-msg .ask b { font-weight: 600; }
.pd-ask h3 { display: flex; align-items: center; gap: 6px; }
.pd-ask .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-fit { background: var(--ok-tint); color: var(--ok); }

/* ---------- live thinking ---------- */
.thinking { gap: 10px; }
.th-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.th-head .th-time { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }
.th-list, .trace ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.th-list::before, .trace ol::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.th-list li, .trace li { display: flex; gap: 10px; font-size: 13px; position: relative; }
.th-list li { animation: step-in .24s ease-out; }
.th-list .dot, .trace .dot { width: 17px; height: 17px; flex: none; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--ok); margin-top: 1px; }
.th-list li.run .dot { border: 2px solid var(--fill2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.th-list li div, .trace li div { display: grid; gap: 2px; min-width: 0; }
.th-list .det, .trace .det { color: var(--muted); white-space: pre-line; line-height: 1.6; word-break: break-word; }
.th-list li.run b::after { content: "…"; }
.trace { background: var(--canvas); }
.trace ol { padding: 0 12px 12px; }
@keyframes step-in { from { transform: translateY(6px); } to { transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .th-list li, .trace li { animation: none; } .th-list li.run .dot { animation: none; } }

/* ---------- assistant panes: one top-bar height, one gutter, animated tabs ---------- */
:root { --gut: 12px; --agent-top: 56px; --subtab-h: 44px; }
.agent-top { height: var(--agent-top); min-height: 0; padding: 0 4px; }
.subtabs { top: var(--agent-top); padding: 0 var(--gut); height: var(--subtab-h); align-items: stretch; }
.subtabs button { min-height: 0; }
.subtabs.topics { top: calc(var(--agent-top) + var(--subtab-h)); }
.subtabs button::after, .seg-tabs button:not(:first-child)::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 6px; height: 2px; border-radius: 1px; background: var(--title); transform: scaleX(0); transition: transform .2s ease; }
.subtabs button[aria-selected="true"]::after, .seg-tabs button[aria-selected="true"]:not(:first-child)::after { transform: scaleX(1); }
.subtabs button, .seg-tabs button { transition: color .15s ease; }
.pane .feed { padding: var(--gut); }
.pane .feed .grid { padding: 0; gap: 8px; }
.posts { padding: var(--gut); }
.guide { margin: var(--gut); border-radius: var(--r-card); padding: 16px; }
.guide section { scroll-margin-top: calc(var(--agent-top) + var(--subtab-h) * 2 + 8px); }
@media (min-width: 1024px) {
  .subtabs { top: calc(60px + var(--agent-top)); }
  .subtabs.topics { top: calc(60px + var(--agent-top) + var(--subtab-h)); }
}

.guide h4 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 2px; }
.g-trace { margin: var(--gut) var(--gut) 0; }
[data-guide-body] > .thinking { margin: var(--gut); }
.g-scenes { display: grid; gap: 10px; margin: 0; }
.g-scenes > div { background: var(--canvas); border-radius: var(--r-card); padding: 12px; }
.g-scenes dt { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.g-scenes dd { margin: 0; font-size: 14px; line-height: 1.7; color: var(--text); }
.g-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; line-height: 1.7; color: var(--text); }
.g-facts { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-facts th { text-align: left; font-weight: 400; color: var(--muted); padding: 8px 12px 8px 0; white-space: nowrap; vertical-align: top; }
.g-facts td { padding: 8px 0; color: var(--title); }
.g-facts tr + tr { border-top: 1px solid var(--line); }
.guide .actions .chip { height: auto; min-height: 36px; padding: 8px 12px; text-align: left; white-space: normal; line-height: 1.4; }

/* ---------- guide: cards nested in the answer ---------- */
.guide > p { margin: 0; }
.g-card { border-radius: var(--r-card); padding: 14px; background: var(--canvas); }
.g-point { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 8px; }
.g-point h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.g-no { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-strong); font-size: 13px; font-weight: 600; display: grid; place-items: center; }
.g-sub { border-radius: 8px; padding: 10px 12px; }
.g-sub h4 { margin: 0 0 2px; font-size: 13px; font-weight: 600; }
.g-sub p { font-size: 14px; line-height: 1.7; }
.g-how, .g-pick { background: var(--canvas); } .g-how h4, .g-pick h4 { color: var(--title); }
.g-trap, .g-warn { background: var(--warn-tint); } .g-trap h4, .g-warn h3 { color: var(--warn); }

/* ---------- cart: grouped by store, choose, then go to each store ---------- */
.store { background: var(--surface); border-radius: var(--r-card); padding: 4px 0 8px; }
.store .item { padding: 8px 12px; background: none; }
.store-h { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--title); }
.item .top.pickable { grid-template-columns: 24px 80px 1fr; gap: 10px; align-items: center; }
.pick { display: flex; align-items: center; justify-content: center; min-height: 44px; }
.round { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border-radius: 50%; border: 1.5px solid var(--fill3); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.round:checked { background: var(--brand-strong); border-color: var(--brand-strong); }
.round:checked::after { content: ""; width: 10px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.checkout { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 25; display: flex; align-items: center; gap: 12px; background: var(--surface); border-top: 1px solid var(--line); padding: 8px 12px; }
.checkout label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--title); min-height: 44px; white-space: nowrap; }
.checkout .sum { flex: 1; min-width: 0; text-align: right; display: grid; font-size: 11px; color: var(--muted); }
.checkout .sum b { font-size: 18px; color: var(--brand-strong); }
.checkout .btn { flex: none; white-space: nowrap; }
.cart-likes { display: block; padding-bottom: 72px; }
.cart-likes-h { font-size: 16px; font-weight: 600; color: var(--title); text-align: center; padding: 16px 0 8px; margin: 0; }
.go-list { display: grid; gap: 8px; margin-top: 12px; }
.go-list > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.go-list .t { color: var(--title); font-size: 14px; }
@media (min-width: 1024px) { .checkout { bottom: 0; padding: 8px max(16px, calc((100vw - 1200px) / 2)); } }

/* ---------- other options in sight; side-by-side tables ---------- */
.alts { margin-top: 10px; min-width: 0; }
.alts-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--title); min-height: 32px; }
.link { color: var(--brand-strong); font-size: 13px; min-height: 44px; padding: 0 4px; }
.alts-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
.alts-row::-webkit-scrollbar { display: none; }
.alt-c { flex: 0 0 124px; scroll-snap-align: start; background: var(--canvas); border-radius: var(--r-card); padding: 8px; display: grid; gap: 4px; align-content: start; font-size: 12px; }
.alt-c a { display: grid; gap: 4px; color: var(--title); }
.alt-c .pic { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface); }
.alt-c .pic img { width: 100%; height: 100%; object-fit: contain; }
.alt-c .t { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.alt-c .mini { min-height: 36px; justify-content: center; }
.cmp-n3 { min-width: 400px; } .cmp-n4 { min-width: 520px; }
.cmp-combo.cmp-n2 { min-width: 340px; } .cmp-combo.cmp-n3 { min-width: 480px; } .cmp-combo.cmp-n4 { min-width: 620px; }
.cmp-combo .pic { display: block; width: 56px; height: 56px; margin-bottom: 4px; }
.cmp-combo a { color: var(--title); display: block; line-height: 1.4; }
.cmp-diff { background: var(--brand-tint); }

/* ---------- home: zones and the staggered feed ---------- */
.zones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; background: var(--surface); }
.zone { background: var(--canvas); border-radius: var(--r-card); padding: 8px 8px 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 64px; }
.z-t { display: grid; gap: 2px; min-width: 0; }
.z-t b { font-size: 15px; font-weight: 600; color: var(--title); }
.z-t small { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.z-pic { flex: none; width: 48px; height: 48px; background: var(--surface); border-radius: 8px; overflow: hidden; }
.z-pic img { width: 100%; height: 100%; object-fit: contain; }
.card .pic.r45 { aspect-ratio: 4 / 5; }
.card .pic.r34 { aspect-ratio: 3 / 4; }
.card .pic.r56 { aspect-ratio: 5 / 6; }
.masonry { display: flex; align-items: flex-start; gap: 8px; padding: 0 8px; }
.mcol { flex: 1 1 0; min-width: 0; display: grid; gap: 8px; }
.mcol:nth-child(even) { margin-top: 16px; }
@media (min-width: 1024px) { .zones { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 16px; } .masonry { padding: 0 16px; gap: 12px; } .mcol { gap: 12px; } }

/* ---------- on-screen keyboard (--kb is set in main.js): what sits at the bottom follows it up ---------- */
@media (max-width: 1023px) {
  .kb-open .tabbar, .kb-open .ask-fab, .kb-open .buybar, .kb-open .checkout, .kb-open .composer .disclaim { display: none; }
  .kb-open .app { padding-bottom: var(--kb, 0px); }
  .kb-open .composer { bottom: var(--kb, 0px); padding-bottom: 8px; }
}

/* ---------- color roles ----------
   Pink means: Zhixuan is speaking, or this is your next step. Brand, price, primary button, selected mark, AI entry.
   At most one large pink block per screen and one solid pink per card; price is data and does not count.
   Shelf colors exist for browsing only: home zones and the opening cards. Each is bound to what it labels, never to a position.
   Decision surfaces (replies, comparisons, cart, guide) stay neutral + pink + semantic ok/warn. */
:root {
  --apricot: #b4541a; --apricot-tint: #fff3e8; --sky: #1f6fb2; --sky-tint: #e9f4ff; --lilac: #5b3fb0; --lilac-tint: #f3f0ff;
}
:focus-visible { outline-color: var(--brand-strong); }
.wordmark, .price { color: var(--brand-strong); }
.budget-row .price { color: var(--title); }
.btn-dark, .go { background: var(--brand-strong) !important; color: #fff !important; }
meter { accent-color: var(--brand-strong); }
meter::-webkit-meter-optimum-value { background: var(--brand-strong); }
.tabbar a[aria-current="page"], .tabbar a[aria-current="page"] .ico { color: var(--brand-strong); }
.avatar { background: var(--brand-tint); color: var(--brand-strong); }
.tag-best { background: var(--brand-tint); color: var(--brand-strong); }

/* selected tabs: dark text, pink underline. Specific enough to beat the base rules. */
.tabs button[aria-selected="true"]::after, .subtabs button[aria-selected="true"]::after, .seg-tabs button[aria-selected="true"]:not(:first-child)::after { background: var(--brand-strong); }

/* the AI entry is the one large pink block on the home page */
.ask { background: var(--brand-tint); }
.ask b { color: var(--brand-strong); font-weight: 600; }
.need-hint { background: var(--brand-tint); }
.pd-ask .chip { background: var(--brand-tint); color: var(--brand-strong); }

/* browsing: colors bound to what they label */
.zone-quality, .likes .mode-one { background: var(--brand-tint); }
.zone-under100, .likes .mode-set { background: var(--apricot-tint); }
.zone-travel, .likes .mode-browse { background: var(--sky-tint); }
.zone-digital { background: var(--lilac-tint); }
.zone-quality b, .mode-one b { color: var(--brand-strong); }
.zone-under100 b, .mode-set b { color: var(--apricot); }
.zone-travel b, .mode-browse b { color: var(--sky); }
.zone-digital b { color: var(--lilac); }
.z-t small, .likes span { color: var(--text); }
.z-pic { background: var(--surface); }

/* decision surfaces: facts are neutral */
.prow .tags .tag:not(.tag-best) { background: var(--fill1); color: var(--text); }
.prow .src { background: none; color: var(--muted); padding: 0; }
.guess button { box-shadow: inset 0 0 0 1px var(--line); }
.pending-plan { background: var(--canvas); color: var(--title); }
