:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --paper-deep: #efede6;
  --ink: #292a25;
  --muted: #66665f;
  --hairline: #dedcd3;
  --accent: #9a5139;
  --accent-wash: #f1e3db;
  --white: #fffefa;
  --green: #5b6952;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion: 240ms var(--ease);
}
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: Inter, sans-serif; font-size: 14px; }
button, textarea { font: inherit; }
button { color: inherit; }
.app-shell { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); width: min(1440px, 100%); height: 100dvh; min-height: 600px; margin: auto; overflow: hidden; background: var(--paper); }
.chat-column { display: flex; min-width: 0; flex-direction: column; border-right: 1px solid var(--hairline); }
.topline { height: 70px; flex: 0 0 70px; padding: 0 6.5%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--hairline); }
.wordmark { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; margin-left: -8px; padding: 0 8px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: -.08em; }
.wordmark span { color: var(--accent); padding-left: 2px; }
.top-note { color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 0 9% 24px; scroll-behavior: smooth; }
.empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 3vh 0 5vh; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font: 400 clamp(68px, 10vw, 112px)/.92 'Instrument Serif', Georgia, serif; letter-spacing: -.045em; }
.empty-copy { margin: 20px 0 0; color: var(--muted); font-size: 15px; }
.chat-log { display: flex; flex-direction: column; gap: 20px; padding: 20px 0; }
.chat-log:empty { display: none; }
.user-message { max-width: 83%; align-self: flex-end; padding: 14px 17px; border: 1px solid var(--hairline); border-radius: 16px 16px 3px 16px; background: var(--white); line-height: 1.6; overflow-wrap: anywhere; }
.say-line, .error-line { max-width: 90%; color: var(--muted); line-height: 1.7; }
.say-line::before { content: 'SCOUT'; display: block; margin-bottom: 5px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.error-line { padding: 12px 15px; border-left: 2px solid var(--accent); background: var(--accent-wash); }
.card-list { display: grid; gap: 12px; width: 100%; }
.gift-card { padding: 18px 19px 15px; border: 1px solid var(--hairline); border-radius: 4px; background: var(--white); animation: rise 420ms var(--ease) both; animation-delay: calc(var(--index, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.gift-name { margin: 0; font: 400 25px/1.08 'Instrument Serif', Georgia, serif; letter-spacing: -.015em; }
.price { flex: 0 0 auto; padding: 6px 8px; border-radius: 2px; background: var(--accent-wash); color: #75452f; font-size: 11px; font-weight: 600; }
.gift-why { margin: 10px 0 13px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.because { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding-top: 11px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 10px; }
.because-seeds { color: var(--ink); }
.because-arrow { color: var(--accent); font-size: 14px; }
.because-entity { color: var(--ink); font-weight: 600; }
.affinity { display: inline-flex; align-items: center; gap: 5px; }
.affinity-label { color: var(--muted); font-size: 11px; }
.affinity-track { width: 38px; height: 3px; overflow: hidden; border-radius: 2px; background: var(--paper-deep); }
.affinity-fill { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.call-link { display: inline-flex; min-height: 44px; align-items: center; margin-left: auto; padding: 5px 3px 5px 8px; color: var(--accent); text-decoration: none; font-size: 10px; font-weight: 600; }
.call-link:hover { text-decoration: underline; }
.narrow-box { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--hairline); background: var(--white); }
.narrow-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.narrow-box button, .send-button, .example-chip, .panel-trigger, .sheet-close { cursor: pointer; }
.narrow-box button { min-height: 40px; padding: 8px 13px; border: 0; background: var(--ink); color: white; }
.composer-wrap { padding: 17px 6.5% 19px; border-top: 1px solid var(--hairline); }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.example-chip { min-height: 44px; padding: 8px 11px; border: 1px solid var(--hairline); border-radius: 99px; background: transparent; color: var(--muted); font-size: 10px; transition: background var(--motion), border-color var(--motion), color var(--motion); }
.example-chip:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
.composer { display: flex; align-items: stretch; gap: 10px; padding: 8px; border: 1px solid #c9c6bb; background: var(--white); box-shadow: 0 4px 20px #302e2510; }
.composer textarea { flex: 1; min-width: 0; min-height: 46px; max-height: 130px; resize: vertical; padding: 12px 10px; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.5; }
.composer textarea::placeholder { color: var(--muted); }
.send-button { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 8px 14px; border: 0; background: var(--ink); color: var(--white); font-size: 11px; transition: background var(--motion); }
.send-button:hover { background: var(--accent); }
.send-button span:last-child { font-size: 16px; }
.send-button:disabled { opacity: .5; cursor: wait; }
.privacy-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
.scene-panel { display: flex; min-width: 0; flex-direction: column; overflow: hidden; padding: 34px 30px 20px; background: #f2f0e9; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 21px; border-bottom: 1px solid var(--hairline); }
.panel-heading .eyebrow { margin-bottom: 8px; }
h2 { margin: 0; font: 400 31px/1 'Instrument Serif', Georgia, serif; }
.sheet-close { display: none; border: 0; background: transparent; font-size: 25px; }
.run-label { padding: 13px 0; border-bottom: 1px solid var(--hairline); color: var(--muted); font-size: 10px; }
.panel-summary { padding: 8px 0; color: var(--muted); font-size: 10px; }
.walk-panel { flex: 0 0 auto; min-width: 0; padding: 0 0 8px; color: var(--ink); }
.walk-svg { --walk-background: #f2f0e9; display: block; width: 100%; height: auto; overflow: hidden; }
.calls-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 2px 16px 0; scroll-behavior: smooth; }
.panel-empty { display: grid; min-height: 190px; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.spark-mark { width: 10px; height: 10px; border: 1px solid var(--accent); border-radius: 50%; }
.panel-empty p { max-width: 180px; margin: 10px 0 0; font: 400 17px/1.35 'Instrument Serif', Georgia, serif; }
.call-row { margin-bottom: 10px; border: 1px solid var(--hairline); background: #f9f8f3; transition: border-color var(--motion), background var(--motion); scroll-margin: 18px; }
.call-row.highlight { border-color: var(--accent); background: var(--white); }
.call-head { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 11px; }
.call-number { color: var(--accent); font-size: 10px; font-weight: 700; }
.call-tool { flex: 1; overflow-wrap: anywhere; font-size: 11px; font-weight: 600; }
.call-ms { color: var(--muted); font-size: 10px; }
.cached-badge { padding: 4px 6px; background: #e8ecdf; color: #536044; font-size: 9px; }
.call-wait { width: 28px; height: 3px; overflow: hidden; background: var(--paper-deep); }
.call-wait::after { content: ''; display: block; width: 45%; height: 100%; background: var(--accent); animation: pulse 1.1s var(--ease) infinite alternate; }
@keyframes pulse { from { transform: translateX(-10%); opacity: .4; } to { transform: translateX(140%); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .gift-card { animation: none; }
  .call-wait::after { animation: none; transform: translateX(60%); opacity: 1; }
}
.call-body { padding: 0 11px 11px; }
.call-summary { margin: 0; padding: 9px 0 0; color: var(--ink); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.call-args { margin: 0; padding: 9px 0 10px; border-top: 1px solid var(--hairline); color: var(--muted); font: 10px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-status { margin: 0 0 8px; color: var(--muted); font-size: 10px; }
.result-status.failed { color: var(--accent); }
.result-list { display: grid; gap: 9px; }
.result-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; align-items: center; }
.result-name { min-width: 0; overflow-wrap: anywhere; font-size: 10px; }
.result-type { margin-left: 5px; color: var(--muted); font-size: 9px; }
.result-score { color: var(--muted); font: 10px ui-monospace, monospace; }
.result-track { grid-column: 1 / -1; height: 2px; background: var(--paper-deep); }
.result-shares { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.result-fill { display: block; height: 100%; background: #8a9b77; }
.no-results { color: var(--muted); font-size: 10px; }
.dropped-wrap { flex: 0 0 auto; max-height: 28%; overflow: auto; padding: 12px 0; border-top: 1px solid var(--hairline); }
.dropped-wrap h3 { margin: 0 0 8px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dropped-item { margin: 0 0 8px; font-size: 10px; line-height: 1.5; }
.dropped-item strong { display: block; font-weight: 600; }
.dropped-item span { color: var(--muted); }
.usage { flex: 0 0 auto; padding-top: 12px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 10px; }
.share-button { min-height: 44px; margin-top: 12px; padding: 8px 12px; border: 1px solid var(--hairline); background: transparent; color: var(--ink); font-size: 10px; cursor: pointer; }
.share-button:hover { border-color: var(--accent); }
.panel-trigger { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Measured 26 Oct 2026 at 1500 by 1000: the one grid row grew to 2006 pixels, so the chat and the panel never scrolled
   and card 6, the Qloo off block and most Qloo calls were out of reach. The row now fits the screen and each column scrolls. */
@media (min-width: 761px) {
  .app-shell { grid-template-rows: minmax(0, 1fr); }
  .scene-panel { overflow-y: auto; }
  .calls-list { flex: none; overflow: visible; }
}
@media (min-width: 761px) { .chat-log:not(:empty) + .unused { display: none; } .chat-column:has(.chat-log:not(:empty)) .empty-state { display: none; } }
@media (max-width: 760px) {
  body { overflow: hidden; }
  .app-shell { display: block; height: 100dvh; min-height: 0; }
  .chat-column { height: 100%; border: 0; }
  .topline { height: 57px; flex-basis: 57px; padding: 0 18px; }
  .top-note { font-size: 9px; }
  .chat-scroll { padding: 0 18px 18px; }
  .empty-state { padding: 4vh 0; }
  h1 { font-size: clamp(68px, 21vw, 96px); }
  .empty-copy { max-width: 260px; font-size: 14px; }
  .composer-wrap { padding: 12px 16px 72px; }
  .examples { gap: 7px; }
  .example-chip { padding: 7px 10px; }
  .send-button { gap: 7px; padding: 8px 10px; }
  .scene-panel { position: fixed; z-index: 5; inset: auto 0 0; height: min(82dvh, 720px); padding: 22px 18px 20px; border-top: 1px solid var(--hairline); transform: translateY(calc(100% - 54px)); transition: transform var(--motion); box-shadow: 0 -10px 40px #27251c12; }
  .scene-panel.open { transform: translateY(0); }
  .panel-heading { min-height: 62px; padding-bottom: 13px; }
  h2 { font-size: 26px; }
  .sheet-close { display: block; min-width: 44px; min-height: 44px; }
  .panel-trigger { position: fixed; z-index: 6; right: 0; bottom: 0; left: 0; display: flex; min-height: 54px; align-items: center; gap: 10px; padding: 8px 20px; border: 0; border-top: 1px solid var(--hairline); background: var(--paper); text-align: left; font-size: 11px; font-weight: 600; }
  .trigger-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
  .trigger-arrow { margin-left: auto; color: var(--muted); font-size: 15px; transition: transform var(--motion); }
  .panel-trigger[aria-expanded="true"] .trigger-arrow { transform: rotate(180deg); }
  .calls-list { padding-top: 10px; }
  .chat-log { gap: 16px; }
  .gift-card { padding: 15px; }
  .gift-name { font-size: 23px; }
}
@media (max-width: 380px) {
  .composer-wrap { padding-right: 16px; padding-left: 16px; }
  .composer { gap: 4px; padding: 5px; }
  .composer textarea { padding-right: 4px; padding-left: 5px; font-size: 13px; }
  .send-button { font-size: 10px; }
  .example-chip { font-size: 9px; }
  .because { gap: 5px; }
}
.turn-mark { margin: 18px 0 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.card-list.earlier { padding: 10px; border: 1px solid var(--muted); }
.card-list.earlier::before { content: 'Earlier ideas'; color: var(--muted); font-size: 11px; font-weight: 600; }
.narrow-box { flex-wrap: wrap; }
.narrow-chip { flex-basis: 100%; text-align: left; }
.usage-line { margin: 0 0 8px; }
.start-own { display: inline-block; margin-top: 16px; text-decoration: none; }
[hidden] { display: none !important; }
.card-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.buy-button { min-height: 44px; padding: 10px 18px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); font-weight: 600; cursor: pointer; transition: background var(--motion); }
.buy-button:hover { background: var(--accent); border-color: var(--accent); }
.buy-button:disabled { opacity: .5; cursor: default; }
.pay-row .call-number { color: var(--green); }
.pay-line { margin: 0 0 6px; }
.pay-row.paid { border-color: var(--green); }
.card-actions.pay-choice { flex-wrap: wrap; align-items: center; gap: 12px; }
.pay-note { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; text-align: right; }
.buy-button.quiet { background: var(--white); color: var(--ink); }
.buy-button.quiet:hover { color: var(--white); }
.compare-actions { display: flex; justify-content: flex-start; min-width: 0; margin-top: -8px; }
.compare-button { max-width: 100%; min-height: 44px; white-space: normal; text-align: left; }
.compare-block { min-width: 0; padding: 16px; border: 1px solid var(--hairline); background: var(--white); color: var(--ink); overflow-wrap: anywhere; }
.compare-block h3 { margin: 0 0 14px; font: 400 22px/1.2 'Instrument Serif', Georgia, serif; }
.compare-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.compare-item { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 4px; padding-bottom: 11px; border-bottom: 1px solid var(--hairline); }
.compare-gift { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.compare-name { min-width: 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.compare-affinity { color: var(--ink); font-size: 12px; }
.compare-affinity .affinity-label { color: var(--muted); }
.compare-not-found { color: var(--muted); font-size: 12px; }
.compare-summary { margin: 14px 0 0; color: var(--ink); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
/* Spacing and focus fixes from the phone sweep (tools/phones.mjs, 23 Oct): every control 44 px tall and 16 px inside
   the screen, and a visible focus ring on the text boxes too. */
.composer textarea:focus-visible, .narrow-box input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.narrow-box button, .narrow-chip { min-height: 44px; }
@media (max-width: 760px) {
  .panel-trigger { right: 16px; bottom: 12px; left: 16px; border: 1px solid var(--hairline); border-radius: 999px; box-shadow: 0 6px 24px #27251c1a; }
}
.share-inline { align-self: flex-start; min-height: 44px; }
.share-inline { font-size: 13px; }
.how-button { min-height: 44px; padding: 8px 12px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: color var(--motion), border-color var(--motion); }
.how-button:hover { border-color: var(--hairline); color: var(--ink); }
.how-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border: 1px solid var(--hairline); background: var(--paper); color: var(--ink); box-shadow: 0 18px 60px color-mix(in srgb, var(--ink) 15%, transparent); }
.how-dialog::backdrop { background: color-mix(in srgb, var(--ink) 32%, transparent); }
.how-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.how-heading h2 { font: 400 32px/1 'Instrument Serif', Georgia, serif; }
.how-close { flex: 0 0 44px; min-width: 44px; min-height: 44px; padding: 8px; border: 1px solid var(--hairline); background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.how-steps { display: grid; gap: 12px; margin: 18px 0; padding-left: 28px; font-size: 14px; line-height: 1.55; }
.how-steps li { padding-left: 3px; overflow-wrap: anywhere; }
.how-steps li::marker { color: var(--accent); font-weight: 700; }
.how-credit { margin: 0; padding-top: 14px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 11px; }
.product-block { display: flex; min-width: 0; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid var(--hairline); background: var(--paper); color: var(--ink); }
.product-image { flex: 0 0 64px; width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--hairline); }
.product-details { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: center; gap: 5px 10px; overflow-wrap: anywhere; font-size: 12px; }
.product-title { flex-basis: 100%; font-weight: 600; }
.product-brand, .product-credit { color: var(--muted); }
.product-price { font-weight: 600; }
.product-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--accent); text-underline-offset: 3px; }
.product-credit { flex-basis: 100%; font-size: 10px; }
@media (max-width: 760px) {
  .how-dialog { position: fixed; inset: auto 16px 12px; width: auto; max-width: none; max-height: calc(100dvh - 32px); margin: 0; padding: 20px; border-radius: 12px 12px 4px 4px; }
  .how-heading h2 { font-size: 29px; }
}
