/* Same system as Supper & a Show (D4): white page, Instrument Serif headlines,
   Inter Tight everywhere else, ink outlines, sticker chips. Each color has one job:
     violet = anything you tap to act (Plan it, Let the agent shop, Approve)
     yellow = the sticker and the agent's face
     butter = the agent's voice (its bubbles)
     store colors = the brick badge for each kind of store
     green  = money that went through; red = refused, over budget, errors */
:root {
  --paper: #FFFFFF;
  --ink: #161412;
  --muted: #57524C;
  --line: #ECE9E4;
  --soft: #F7F5F2;
  --violet: #5B35D5;
  --violet-ink: #4127A3;
  --violet-soft: #EDE7FF;
  --yellow: #FFD23F;
  --butter: #FFF1C9;
  --mint: #B8E6CF;
  --ok: #1E7A4C;
  --warn: #C2321F;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  letter-spacing: -0.01em;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

.h { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.note { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.err { font-size: 14px; color: var(--warn); margin: 0; font-weight: 600; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.lbl { font-size: 14px; font-weight: 600; }
.strip { background: var(--ink); color: var(--paper); text-align: center; font-size: 13px; padding: 8px 12px; border-radius: 999px; max-width: 1100px; margin: 12px auto 0; }
.link-btn { border: 0; background: none; font-weight: 600; cursor: pointer; padding: 8px 4px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.link-btn:hover { color: var(--violet); }

.layout { max-width: 1100px; margin: 0 auto; display: grid; gap: 32px; padding-top: 28px; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: start; gap: 48px; padding-top: 48px; }
  .money-col { position: sticky; top: 16px; }
}

/* ---------- Ask ---------- */
.ask-form { position: relative; display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.sticker { position: absolute; right: -6px; top: -14px; width: 100px; height: 100px; transform: rotate(12deg); }
.ask-title { font-family: var(--serif); font-size: clamp(44px, 9vw, 64px); line-height: .95; letter-spacing: -0.03em; max-width: 8em; padding-right: 96px; }
@media (max-width: 520px) {
  .sticker { width: 74px; height: 74px; top: -22px; right: -4px; }
  .ask-title { padding-right: 72px; }
}
.ul { position: relative; white-space: nowrap; }
.ul svg { position: absolute; left: 0; right: 0; bottom: -6px; width: 100%; height: 12px; }
.ask-sub { margin: 4px 0 0; font-size: 16px; color: var(--muted); max-width: 34em; }
.ask-box { border: 2px solid var(--ink); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.ask-box textarea { border: 0; resize: vertical; font: 17px/1.45 var(--sans); letter-spacing: -0.01em; color: var(--ink); min-height: 96px; outline: none; background: transparent; }
.ask-box textarea::placeholder { color: #9A948D; }
.ask-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.real-chip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 5px 14px 5px 5px; font-weight: 600; letter-spacing: -0.02em; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1.5deg); transition: transform .15s; }
.real-chip:hover { transform: rotate(0) translateY(-1px); }
.chip-ic { width: 28px; height: 28px; flex: none; }
.go, .pay-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--violet); color: var(--paper); font-weight: 700; letter-spacing: -0.02em; cursor: pointer; }
.go { padding: 12px 20px; font-size: 16px; }
.go svg { width: 16px; height: 16px; }
.pay-btn { width: 100%; min-height: 54px; font-size: 17px; }
.go:hover, .pay-btn:hover { background: var(--violet-ink); }
[aria-busy=true] { opacity: .7; cursor: progress; }
.ghost-btn { border: 2px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 10px 16px; font-weight: 600; cursor: pointer; letter-spacing: -0.02em; }
.ghost-btn:hover { background: var(--soft); }

/* ---------- The conversation ---------- */
.chat { display: flex; flex-direction: column; gap: 16px; }
.me { align-self: flex-end; background: var(--ink); color: var(--paper); border-radius: 22px 22px 6px 22px; padding: 12px 16px; margin: 0; max-width: 85%; }
.bot { display: flex; gap: 10px; align-items: flex-end; }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 999px; background: var(--yellow); border: 2px solid var(--ink); position: relative; }
.face { background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Ccircle cx='13' cy='15' r='2' fill='%23161412'/%3E%3Ccircle cx='23' cy='15' r='2' fill='%23161412'/%3E%3Cpath d='M11 21 q7 7 14 0' fill='none' stroke='%23161412' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.bubble { background: var(--butter); border-radius: 22px 22px 22px 6px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }
.thinking { flex: 0 1 300px; flex-direction: row; align-items: center; gap: 10px; white-space: nowrap; font-size: 15px; padding: 14px 16px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--ink); opacity: .35; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: .9 } }
.cart-summary { font-family: var(--serif); font-size: 26px; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.notes li::before { content: '↪ '; font-weight: 700; }
.shield { background: var(--ink); color: var(--paper); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.shield .kicker { color: var(--yellow); }
.shield svg { width: 12px; height: 13px; }
.shield p { margin: 0; font-size: 14px; line-height: 1.45; }
.shield q { color: #CFC8BF; font-style: italic; }
.store { background: var(--paper); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.store-head { display: flex; align-items: center; gap: 10px; }
.brick { width: 26px; height: 20px; flex: none; }
.store-name { font-weight: 700; letter-spacing: -0.02em; }
.store-kind { font-size: 13px; color: var(--muted); }
.store-amt { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.items li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 15px; line-height: 1.4; }
.items .amt { font-variant-numeric: tabular-nums; color: var(--muted); }
.items .why { grid-column: 1 / -1; font-size: 14px; color: var(--muted); }
.unmet { background: var(--paper); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.unmet ul { margin: 0; padding: 0; list-style: none; font-size: 15px; }
.unmet li::before { content: '– '; }
.how { font-size: 13px; color: var(--muted); margin: 0; }

/* ---------- The money ---------- */
.sheet { border: 2px solid var(--ink); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: var(--paper); }
.total-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.total-amt { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.budget-bar { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; border: 1.5px solid var(--ink); }
.budget-bar div { height: 100%; background: var(--violet); width: 0; transition: width .5s ease; }
.caps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.caps li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.caps li:first-child { border-top: 0; }
.caps .cap { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.caps .ask-tag { font-size: 12px; font-weight: 700; color: var(--violet); background: var(--violet-soft); border-radius: 999px; padding: 2px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; letter-spacing: -0.02em; }
.chip[aria-checked=true] { background: var(--ink); color: var(--paper); }
.curve { border: 1.5px dashed #BDB6AD; border-radius: 14px; padding: 10px 14px; }
.curve summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.curve[open] summary { margin-bottom: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--violet); }

/* The run: one row per store, each with its own pass. */
.run { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.run li { border-radius: 16px; background: var(--soft); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; animation: deal-in .45s cubic-bezier(.2, .9, .3, 1.2) both; }
.run .row { display: flex; align-items: center; gap: 10px; }
.run .amt { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.run .status { font-size: 14px; color: var(--muted); }
.run .pass { font-size: 12px; font-family: ui-monospace, 'SF Mono', Menlo, monospace; color: var(--muted); letter-spacing: 0; }
.run .paid { background: #E3F4EA; }
.run .paid .status { color: var(--ok); font-weight: 600; }
.run .blocked { background: #FDE8E4; }
.run .blocked .status { color: var(--warn); font-weight: 600; }
.run .asking { background: var(--violet-soft); }
.run .refunded { background: var(--butter); }
.run .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.run .acts .go { padding: 9px 16px; font-size: 15px; }
.spin { width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--ink); border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes deal-in { from { opacity: 0; transform: translateY(12px) rotate(-1deg); } to { opacity: 1; transform: none; } }
.ledger { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--ink); padding-top: 14px; }

.foot { color: var(--muted); font-size: 12px; text-align: center; padding-block: 40px 32px; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) {
  .dots i, .spin, .run li { animation: none; }
  .budget-bar div { transition: none; }
}
