/* Collab's visual language (CollabUI/Theme.swift): near-black canvas (off-white in light mode), hairline rules
   instead of shadows, a large two-tone grotesk headline, small monospaced uppercase labels, square controls, and one
   pink accent (--accent; --accent-ink for text). Private and in-progress things are marked in neutral ink and grey
   (--peri-ink / --peri-fill, --talk / --talk-fill): the palette is pink, black and white. --peri stays only for the
   logo's offer square. */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --surface2: #efefec; --hairline: #deded9;
  --text: #0a0a0a; --text2: #55554f; --text3: #6b6b66;
  --accent: #ff3ea5; --accent-ink: #c4126e; --peri: #5b5fd6; --peri-fill: #efefec; --peri-ink: #55554f;
  --fresh: #087a45; --stale: #9c4872; --danger: #c9302c; --inverse: #0a0a0a; --on-inverse: #f7f7f5; --on-accent: #0a0a0a;
  /* States of what your agents are doing (tiles): waiting on you, agents negotiating, agreed, ended. */
  --wait: #c4126e; --wait-fill: #ffe4f1; --talk: #55554f; --talk-fill: #efefec; --done-fill: #e2f4ea; --hot: #c9302c;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}
/* Looks: Light (the base above) and Dark — the same pink accent; states: --wait pink, --talk periwinkle, --fresh green, --danger red.
   Set as data-look on <html> (Settings › Appearance; Auto follows the device). */
:root[data-look="dark"] {
  --bg: #0a0a0a; --surface: #121212; --surface2: #1a1a1a; --hairline: #262626;
  --text: #f4f4f4; --text2: #a3a3a3; --text3: #8a8a8a;
  --accent: #ff3ea5; --accent-ink: #ff6dbb; --on-accent: #0a0a0a; --peri: #a5a8f0; --peri-fill: #1a1a1a; --peri-ink: #a3a3a3; --fresh: #3ddc97; --stale: #e58bbd; --danger: #ff5a4e; --inverse: #f4f4f4; --on-inverse: #0a0a0a;
  --wait: #ff6dbb; --wait-fill: #2b0f1e; --talk: #a3a3a3; --talk-fill: #1a1a1a; --done-fill: #0b2519; --hot: #ff5a4e;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-look]) {
    --bg: #0a0a0a; --surface: #121212; --surface2: #1a1a1a; --hairline: #262626;
  --text: #f4f4f4; --text2: #a3a3a3; --text3: #8a8a8a;
  --accent: #ff3ea5; --accent-ink: #ff6dbb; --on-accent: #0a0a0a; --peri: #a5a8f0; --peri-fill: #1a1a1a; --peri-ink: #a3a3a3; --fresh: #3ddc97; --stale: #e58bbd; --danger: #ff5a4e; --inverse: #f4f4f4; --on-inverse: #0a0a0a;
  --wait: #ff6dbb; --wait-fill: #2b0f1e; --talk: #a3a3a3; --talk-fill: #1a1a1a; --done-fill: #0b2519; --hot: #ff5a4e;
  color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
/* Two quick taps on a control are two taps, never a page zoom. */
button, summary, label, .chip, [data-act] { touch-action: manipulation; }
a { color: var(--accent-ink, var(--accent)); }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* Type */
.mono, .label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); }
.label.sq::before { content: "■ "; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.brand .logo { width: 16px; height: 16px; }
.label.ink { color: var(--text); } .label.peri { color: var(--peri-ink); } .label.accent { color: var(--accent-ink, var(--accent)); } .label.stale { color: var(--stale); } .label.fresh { color: var(--fresh); }
.headline { font-size: clamp(26px, 4vw, 34px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.headline .soft { color: var(--text3); }
.title { font-size: 20px; font-weight: 600; margin: 0; }
.small { font-size: 13px; } .muted { color: var(--text2); } .faint { color: var(--text3); }

/* Controls: square, mono, uppercase */
.btn { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; padding: 9px 14px; border-radius: 3px; border: 1px solid var(--inverse); background: var(--inverse); color: var(--on-inverse); cursor: pointer; white-space: nowrap; }
.btn.compact { font-size: 11px; padding: 7px 11px; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.btn.secondary { background: var(--surface); border-color: var(--hairline); color: var(--text); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--text); }
.btn.danger { background: var(--surface); border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:not(:disabled):active { opacity: .75; }
.field { width: 100%; padding: 10px 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; outline: none; }
.field:focus { border-color: var(--text3); }
textarea.field { resize: vertical; min-height: 64px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 2px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); color: var(--text2); white-space: nowrap; }
.tag.peri { color: var(--peri-ink); background: var(--peri-fill); } .tag.wait { color: var(--wait); background: var(--wait-fill); } .tag.talk { color: var(--peri-ink); background: var(--talk-fill); } .tag.accent { color: var(--accent-ink, var(--accent)); } .tag.fresh { color: var(--fresh); } .tag.stale { color: var(--stale); } .tag.danger { color: var(--danger); } .tag.ink { color: var(--text); }
.chip { font-size: 13px; padding: 6px 10px; border-radius: 3px; border: 1px solid var(--hairline); background: var(--surface); cursor: pointer; text-align: left; }
@media (hover: hover) { .chip:hover { border-color: var(--text3); } }
.chip.on { border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
span.chip:not(.req) { cursor: default; } /* shown, not pressed */
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.dot.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 30%, transparent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .end { margin-left: auto; }
.stack { display: grid; gap: 10px; }
.hairline { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* Containers: hairline-bordered surfaces only */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card.accent { border-color: var(--accent); }
.card.peri { background: var(--peri-fill); border-color: var(--hairline); }
.card.peri .faint { color: var(--text2); }
.card.slim { padding: 10px 12px; gap: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text3); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.grid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); border: 1px solid var(--hairline); }
@media (max-width: 520px) { .grid-tiles { grid-template-columns: 1fr 1fr; } .grid-tiles .tile { min-height: 92px; padding: 12px; gap: 6px; } .grid-tiles .tile p { font-size: 14px; } }
.tile { padding: 14px; min-height: 118px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: .5px solid var(--hairline); cursor: pointer; text-align: left; }
.tile.peri { background: var(--peri-fill); }
.tile .arrow { margin-top: auto; align-self: flex-end; color: var(--text3); }
.tile p { margin: 0; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--hairline); }
.stats > div { padding: 12px 14px; border: .5px solid var(--hairline); background: var(--surface); }
.stats b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

/* Layout: sidebar + detail */
.app { display: grid; grid-template-columns: 290px 1fr; height: 100vh; height: 100dvh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.sidebar { border-right: 1px solid var(--hairline); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.sidebar header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
.sidebar .scroll { overflow-y: auto; overscroll-behavior-y: contain; padding: 14px; display: grid; gap: 18px; align-content: start; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 13px; text-align: left; }
.nav button.on { background: var(--surface2); }
.nav button .ico { width: 18px; text-align: center; color: var(--text2); }
.nav button .trail { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--text3); }
.session { display: block; width: 100%; border: 0; background: none; text-align: left; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session.on { background: var(--surface2); }
.needs { position: sticky; top: 0; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* A screen (Deals, About me…) opens beside the chat on a wide window, and in place of it on a narrow one. */
.app.split { grid-template-columns: 290px minmax(320px, 1fr) var(--panel-w, minmax(440px, 46%)); }
.panel { border-left: 1px solid var(--hairline); display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); position: relative; }
/* The divider: a wide, invisible grip on the panel's edge that shows the brand colour when it's used. */
.resizer { position: absolute; left: -5px; top: 0; bottom: 0; width: 10px; cursor: col-resize; z-index: 5; touch-action: none; }
.resizer::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, .resizer:focus-visible::after, .app.resizing .resizer::after { background: var(--accent); }
.resizer::before { content: ""; position: absolute; left: 2px; top: 50%; width: 6px; height: 36px; margin-top: -18px; border-radius: 3px; background: color-mix(in srgb, var(--text3) 45%, var(--surface)); border: 1px solid var(--surface); z-index: 1; transition: background .15s; }
.resizer:hover::before, .resizer:focus-visible::before, .app.resizing .resizer::before { background: var(--accent); }
.app.resizing { cursor: col-resize; user-select: none; }
.app.resizing iframe { pointer-events: none; }
@media (max-width: 899px), (max-height: 500px) and (pointer: coarse) { .resizer { display: none; } }
.panel .inner { max-width: none; }
.panel-top .close { margin-left: auto; }
/* Middle widths (900–1180 px): the chat stays in the middle and what's open is squeezed to the right; the menu narrows.
   Narrower than that, or a phone on its side, what's open covers the chat (one thing at a time on a tablet or phone). */
@media (max-width: 1180px) and (min-width: 900px) { .app.split { grid-template-columns: 230px minmax(320px, 1fr) var(--panel-w, minmax(340px, 44%)); } }
@media (max-width: 899px), (max-height: 500px) and (pointer: coarse) { .app.split { grid-template-columns: 290px 1fr; } .app.split .main { display: none; } .panel { border-left: 0; } }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--hairline); min-height: 49px; }
.topbar .menu { display: none; }
.content { flex: 1; overflow-y: auto; overscroll-behavior-y: contain; }
.inner { max-width: 860px; margin: 0 auto; padding: 22px 18px 40px; display: grid; gap: 16px; }

/* Chat */
.msg-user { justify-self: end; max-width: 78%; display: grid; justify-items: end; gap: 4px; }
.msg-user .bubble { background: var(--surface2); padding: 10px 14px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-agent { display: grid; gap: 10px; }
.msg-agent .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { border-top: 1px solid var(--hairline); padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer .box { max-width: 860px; margin: 0 auto; display: grid; gap: 8px; }
.composer .bar { display: flex; gap: 10px; align-items: center; padding: 6px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px; }
.composer .bar:focus-within { border-color: var(--text3); }
.composer input { flex: 1; border: 0; outline: none; background: transparent; padding: 6px; min-width: 0; }
.mic { width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--hairline); background: transparent; color: var(--text2); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.mic.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); animation: flash 1.2s ease-out infinite; }
.send { width: 34px; height: 34px; border-radius: 4px; border: 0; background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; cursor: pointer; }
.send:disabled { opacity: .35; }
.thinking .label { display: inline-block; min-width: 9ch; }
.thinking { display: flex; align-items: center; gap: 8px; }
/* The loader is the Collab mark (ui.js logo("live spinner")): the two hooks meet and the offer crosses, a little
   quicker than on the opening screen, at the size of the text beside it. */
.logo.spinner { width: 14px; height: 14px; vertical-align: -2px; }
.logo.live.spinner .you, .logo.live.spinner .them, .logo.live.spinner .offer { animation-duration: 2.4s !important; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Engagement */
.timeline { display: grid; gap: 6px; }
.ev { display: grid; grid-template-columns: 112px 1fr; gap: 10px; font-size: 13.5px; align-items: baseline; }
.ev .who { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.ev.requester_agent .who, .ev.requester .who { color: var(--accent-ink); }
.ev.provider_agent .who, .ev.provider .who { color: var(--stale); }
.ev.system { grid-template-columns: 1fr; color: var(--text3); font-size: 12.5px; }
.qa { display: grid; gap: 4px; font-size: 13.5px; }
.qa > div { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; }
.chart svg { width: 100%; height: auto; aspect-ratio: 580 / 110; display: block; }
.chart text { font-family: var(--mono); font-size: 10px; fill: var(--text3); }
.needs-card { border-color: var(--wait); box-shadow: inset 3px 0 0 var(--wait); }

/* Notices come in from the top (under the title bar), newest first. */
.toast { position: fixed; right: 16px; top: calc(60px + env(safe-area-inset-top)); display: flex; flex-direction: column-reverse; gap: 8px; z-index: 60; width: min(380px, calc(100vw - 32px)); }
/* Notices (ui.js notice): a hairline card, a coloured edge and mono label for the kind, a bar that runs out. */
.toast { pointer-events: none; }
.note { --c: var(--accent); pointer-events: auto; position: relative; overflow: hidden; display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start;
  padding: 12px 10px 13px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--hairline); border-radius: 6px;
  box-shadow: 0 1px 0 var(--hairline), 0 10px 30px -12px rgb(0 0 0 / 35%); animation: note-drop .28s cubic-bezier(.2,.8,.2,1) both; }
.note::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--c); }
.note.tappable { cursor: pointer; }
@media (hover: hover) { .note.tappable:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--hairline)); } }
.note-attention { --c: var(--wait); } .note-success { --c: var(--fresh); } .note-error { --c: var(--danger); } .note-deal { --c: var(--fresh); } .note-info { --c: var(--accent); }
.note-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; font: 700 13px/1 var(--mono); color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.note-main { display: grid; gap: 2px; min-width: 0; }
.note-kicker { font: 600 10.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.note-info .note-kicker { color: var(--accent-ink); }
.note-title { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.note-body { font-size: 13px; line-height: 1.4; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-action { margin-top: 4px; font: 600 11px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink, var(--accent)); }
.note-x { border: 0; background: none; color: var(--text3); font-size: 18px; line-height: 1; width: 26px; height: 26px; border-radius: 4px; cursor: pointer; }
@media (hover: hover) { .note-x:hover { background: var(--surface2); color: var(--text); } }
.note-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--c); opacity: .55; transform-origin: left; animation: note-life var(--life, 5s) linear forwards; }
.note.paused .note-bar { animation-play-state: paused; }
.note.leaving { animation: note-out .18s ease forwards; }
@keyframes note-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes note-drop { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes note-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .note, .note.leaving { animation: none; } .note-bar { display: none; } }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.setup { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.setup .card { width: min(520px, 100%); gap: 14px; padding: 22px; }
.btn.google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.btn.google:hover { background: #f7f8f8; }
.setup .or { display: flex; align-items: center; gap: 10px; color: var(--text3); font-size: 12px; }
.setup .or::before, .setup .or::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }

dialog { border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); color: var(--text); padding: 18px; width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / 45%); }

@media (max-width: 820px), (max-height: 500px) and (pointer: coarse) {
  .app, .app.split { grid-template-columns: 1fr; }
  /* Closed, the menu is hidden from the keyboard and screen readers too, not only moved off-screen. */
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 10; transform: translateX(-100%); transition: transform .2s, visibility .2s; visibility: hidden; padding-left: env(safe-area-inset-left); }
  .app.nav-open .sidebar { transform: none; visibility: visible; }
  /* The shade behind the open menu covers the whole screen, the notch and home-indicator areas included. */
  .app.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 9; background: rgb(0 0 0 / 45%); }
  .sidebar { height: 100dvh; }
  .app.nav-open .main, .app.nav-open .panel { pointer-events: none; } /* a tap beside the menu closes it, never presses what's under the shade */
  .topbar .menu { display: inline-flex; }
  .topbar { padding-left: 8px; gap: 6px; }
  .inner { padding: 16px 16px 32px; }
  .msg-user { max-width: 92%; }
  .ev { grid-template-columns: 1fr; gap: 0; }
}
/* No animations (data-motion="off" on <html>): screens, cards, notices and panels appear in place. The one exception is
   the small loading spinner, which says something is still working. */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { animation: none !important; transition: none !important; }
/* Movement only while the agent is working: thinking, searching, looking in the background, loading — and never when
   the device asks for reduced motion (then everything stays still). */
@media (prefers-reduced-motion: no-preference) {
  :root[data-motion="off"] .splash-line::after { animation: splash-run 1.1s ease-in-out infinite !important; }
  :root[data-motion="off"] .calib-bar { animation: calib-move 1.2s linear infinite !important; }
  :root[data-motion="off"] .calib-line { animation: calib-in .5s ease forwards !important; animation-delay: calc(var(--i) * .9s - var(--t, 0s)) !important; opacity: 0; }
  :root[data-motion="off"] .thinking { animation: sweep 1.6s linear infinite !important; }
  :root[data-motion="off"] .live-dot { animation: blink 1.6s infinite !important; }
  :root[data-motion="off"] .work-line::after { animation: splash-run 1.3s ease-in-out infinite !important; }
  :root[data-motion="off"] .mic.on { animation: flash 1.2s ease-out infinite !important; }
  :root[data-motion="off"] .chip.skel { animation: skel 1.2s linear infinite !important; }
  /* The looping logo on the opening screen is a loading indicator too, so it keeps moving. */
  :root[data-motion="off"] .logo.live .you { animation: logo-you 4.8s cubic-bezier(.2,.8,.2,1) infinite !important; }
  :root[data-motion="off"] .logo.live .them { animation: logo-them 4.8s cubic-bezier(.2,.8,.2,1) infinite !important; }
  :root[data-motion="off"] .logo.live .offer { animation: logo-offer 4.8s ease-in-out infinite !important; }
}
@media (prefers-reduced-motion: reduce) { :root .calib-line { animation: none !important; opacity: 1; } }
:root[data-motion="off"] .note-bar { display: none; }

/* Cards, summary-first: who · progress · one status line · at most one action; evidence under Details. */
.eng { gap: 10px; }
.eng-head { flex-wrap: nowrap; }
.eng-who { display: grid; min-width: 0; }
.eng-who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: var(--surface2); border: 1px solid var(--hairline); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.steps li { border-top: 2px solid var(--hairline); padding-top: 4px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text3); }
.steps li.done { border-color: var(--accent); color: var(--text2); }
.steps li.now { border-color: var(--accent); color: var(--text); font-weight: 600; }
.steps.ended li.now { border-color: var(--text3); }
.status { margin: 0; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.status .spinner { flex: none; }
.keyline { margin: 0; border-left: 2px solid var(--hairline); padding-left: 10px; }
.deal { display: grid; gap: 8px; padding: 12px 12px 12px 14px; background: var(--surface); border: 1px solid var(--hairline); border-left: 3px solid var(--accent); border-radius: 6px; }
.deal-price { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
/* Amounts and counts line up in a column and keep their width as they change. */
.deal-price, .stats b, .share-stats b, .net-grid b, .co-order .end, .co-total, .price-list b, .receipt-card .breakdown .end, .rrow-side b, .pass-kv dd { font-variant-numeric: tabular-nums; }
.receipt { display: grid; gap: 6px; }
.receipt-btn { padding-left: 0; color: var(--fresh); }
details.more > summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); list-style: none; padding: 5px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more[open] { display: grid; gap: 10px; }
.field.bare { border-color: transparent; background: transparent; padding: 4px 0; }
.field.bare:hover, .field.bare:focus { border-color: var(--hairline); padding: 4px 8px; background: var(--surface); }
.title-edit { font-weight: 600; font-size: 16px; }
.linkish { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.linkish.x { color: var(--text3); margin-left: 2px; min-width: 24px; min-height: 24px; justify-content: center; }
.chip.req { display: inline-flex; align-items: center; }
.match-row { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--hairline); }
:not(.match-row) + .match-row { border-top: 0; }
.match-main { display: grid; gap: 2px; min-width: 0; }
.match-main .fits { color: var(--peri-ink); overflow-wrap: anywhere; } /* "Fits you" — from private notes, so the private colour */
.chart { display: grid; gap: 4px; }

/* QR code */
.qr-card { grid-template-columns: 132px 1fr; align-items: start; }
.qr { width: 132px; height: 132px; background: #fff; padding: 4px; border-radius: 4px; }
.qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 520px) { .qr-card { grid-template-columns: 1fr; } }
@media print { .sidebar, .topbar, .composer { display: none !important; } }

/* Sidebar: which AI runs your agent (opens Settings › AI engine). */
.engine-chip { font: 600 11px/1 var(--sans); padding: 6px 9px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface2); color: var(--accent-ink); cursor: pointer; }
.engine-chip.peri { color: var(--peri-ink); }
@media (hover: hover) { .engine-chip:hover { border-color: currentColor; } }

/* Follow-up box on a resting conversation card. */
.row.reply { gap: 10px; flex-wrap: nowrap; }
.row.reply .field { flex: 1; min-width: 0; }
.linkish.small { font-size: 12px; color: var(--text3); text-decoration: underline; }

/* Google Pay (TEST) button: Google's dark button style. */
.btn.gpay { background: #000; color: #fff; border: 1px solid #3c4043; text-transform: none; letter-spacing: 0; }
.btn.gpay b { font-family: "Product Sans", var(--sans); font-weight: 700; margin-right: 2px; }
.engine-chip.offline { color: var(--stale); }

/* First-run intro card and Activity numbers. */
.card.intro { border-color: var(--accent); }
.steps-plain { display: grid; gap: 8px; }
.steps-plain > div { display: flex; gap: 10px; align-items: flex-start; }
.steps-plain b { flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }

/* Fair-price results: one line per source, price on the right. */
.price-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.price-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; }
.price-list li a { grid-column: 1 / -1; }

/* Someone's card: each offering with what can be done right there. */
.shop-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); }
.shop-item + .shop-item { margin-top: 8px; }
.item-photo { width: 100%; aspect-ratio: 4 / 3; height: auto; max-height: 220px; object-fit: cover; border-radius: 6px; background: var(--hairline); display: block; }
label.mic { cursor: pointer; }
.shop-item .qs .chip { font-size: 12px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--hairline); border-radius: 4px; }
.stepper .btn { border: 0; min-width: 32px; font-size: 14px; }
.stepper .qty { width: 44px; text-align: center; border: 0; background: transparent; color: inherit; font: inherit; -moz-appearance: textfield; }
.stepper .qty::-webkit-outer-spin-button, .stepper .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.slots { gap: 6px; }
.field.compact { max-width: 180px; padding: 6px 8px; font-size: 13px; }
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / 45%); display: grid; place-items: center; padding: 16px; z-index: 50; }
.overlay .sheet { width: min(560px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 10px; background: var(--bg); padding: 12px; border-radius: 8px; }

/* My shop › Insights: what to do first (a short list, marked Gemini's when it wrote it), then the numbers behind it in
   small tiles with a coloured edge and a faint wash of the same colour — wait for demand you missed, accent for demand
   you could meet, talk for what people ask and what's coming, fresh for deals done. Two columns on phones; a long
   item name drops its numbers to the next line instead of pushing them out. */
.ins-say { display: grid; gap: 4px; justify-items: start; padding-left: 10px; box-shadow: inset 2px 0 0 var(--accent); }
.ins-say p { margin: 0; font-size: 14px; font-weight: 500; }
.ins-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); grid-auto-flow: dense; gap: 8px; }
@media (max-width: 520px) { .ins-tiles { grid-template-columns: 1fr 1fr; } }
.ins-tile { --edge: var(--text3); display: grid; gap: 4px; align-content: start; min-width: 0; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 4px;
  background: color-mix(in srgb, var(--edge) 6%, var(--surface)); box-shadow: inset 3px 0 0 var(--edge); }
.ins-tile.wait { --edge: var(--wait); } .ins-tile.talk { --edge: var(--talk); } .ins-tile.fresh { --edge: var(--fresh); } .ins-tile.accent { --edge: var(--accent); } .ins-tile.peri { --edge: var(--peri-ink); }
.ins-tile.wide { grid-column: 1 / -1; }
.ins-note { font-size: 11px; margin-top: -3px; }
.ins-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; font-size: 13px; min-width: 0; }
.ins-row .grow { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-row .grow.q { flex: 1 1 0; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ins-row b { margin-left: auto; font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

/* The receipt: parties and service, the price breakdown, terms. */
.receipt-card { display: grid; gap: 10px; }
.receipt-card .breakdown { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); }
.receipt-card .breakdown .row:nth-last-child(2) { border-top: 1px solid var(--hairline); padding-top: 6px; }
.privacy-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.privacy-split > div { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 6px; }
@media (max-width: 520px) { .privacy-split { grid-template-columns: 1fr; } }
.match-actions { gap: 6px; margin-top: 4px; }
.seller-req { display: grid; gap: 6px; border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* What your agents are doing, by state: tiles with a coloured edge — waiting on you, negotiating, agreed, ended. */
.attention { display: flex; align-items: center; gap: 8px; background: var(--surface); }
.attention.wait { background: var(--wait-fill); border-color: var(--wait); }
.label.wait { color: var(--wait); } .label.talk { color: var(--peri-ink); }
.eng-row { border: 1px solid var(--hairline); border-radius: 6px; padding: 10px 12px; box-shadow: inset 3px 0 0 var(--talk); background: var(--surface); margin: 0 0 8px; }
.eng-row > summary { cursor: pointer; font-size: 14px; list-style: none; }
.eng-row > summary::-webkit-details-marker { display: none; }
.eng-row[open] > summary { margin-bottom: 10px; }
.eng-row.ended { box-shadow: inset 3px 0 0 var(--text3); }
.tile-agreed { box-shadow: inset 3px 0 0 var(--fresh); }

.deal-chat { border-top: 1px solid var(--hairline); padding-top: 8px; }
.chat-line { padding: 6px 8px; border-radius: 6px; background: var(--surface2); max-width: 90%; min-width: 0; overflow-wrap: anywhere; }
.chat-line.me { justify-self: end; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* Phones: the five-step bar keeps only the current step's name; label/value lists stack; a radio stays by its label. */
@media (max-width: 520px) {
  .steps li span { display: none; }
  .steps li.now span { display: inline; white-space: nowrap; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .kv dd label.row { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 8px; }
  .kv dd label.row .faint { grid-column: 2; }
  .row { flex-wrap: wrap; }
}



/* Animations: something new rises in, something changed flashes once, a screen opens in a short stagger. */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--wait) 65%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes sweep { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.enter { animation: rise .3s cubic-bezier(.2,.8,.2,1) both; }
.flash { animation: flash .9s ease-out 1; }
.screen-enter .inner > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.screen-enter .inner > *:nth-child(2) { animation-delay: .04s; } .screen-enter .inner > *:nth-child(3) { animation-delay: .08s; }
.screen-enter .inner > *:nth-child(4) { animation-delay: .12s; } .screen-enter .inner > *:nth-child(5) { animation-delay: .16s; }
.screen-enter .inner > *:nth-child(n+6) { animation-delay: .2s; }
.btn, .chip { transition: transform .08s ease, background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn:not(:disabled):active, .chip:active { opacity: .78; }
.disc-row:not(.as-div):active, .rrow-main:active, .session:active, .nav button:active, .tile:active, .radar button:active, .seg button:active, .send:not(:disabled):active, .mic:active, .deal-row.deal-jump:active, .linkish:active, details > summary:active { opacity: .78; }
.thinking { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--talk) 18%, transparent), transparent) 0 0 / 200% 100% no-repeat; animation: sweep 1.6s linear infinite; border-radius: 4px; }
.needs-card { animation: none; }
.attention.wait .label, .attention.wait b { color: var(--wait); }

/* Phones and touch (from the UX review): no zoom on focus, room to tap, toasts above the composer, titles on one line. */
.topbar > .label, .topbar > span:first-of-type { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar { padding-top: max(12px, env(safe-area-inset-top)); }
/* Where the page runs under the status bar, a notch or the Dynamic Island (viewport-fit=cover), the menu's header and its
   foot stay clear of them and of the home indicator. */
.sidebar header { padding-top: max(12px, env(safe-area-inset-top)); }

.kv dd label.row { display: grid; grid-template-columns: auto 1fr; align-items: start; column-gap: 8px; }
.kv dd label.row .faint { grid-column: 2; }
@media (max-width: 820px) {
  body { font-size: 16px; }
  .toast { left: 12px; right: 12px; top: calc(56px + env(safe-area-inset-top)); width: auto; }
}
@media (max-width: 520px) {
  .row[style*="nowrap"] { flex-wrap: wrap !important; }
  .row[style*="nowrap"] > span[style*="min-width"] { min-width: 0 !important; flex-basis: 100%; }
  .topbar .end .handle { display: none; }
}
/* Touch: every control is at least 44 px tall (Apple's minimum), small text stays readable. */
@media (pointer: coarse) { .btn, .chip, .btn.compact, .nav button, .seg button, .note-x, .disc-row { min-height: 44px; } .linkish { min-height: 44px; display: inline-flex; align-items: center; } .label { font-size: 12px; } }

/* The pass (pickup, booking, handover): a ticket — the code to scan, what changes hands, and its state. */
.pass { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); box-shadow: inset 0 3px 0 var(--accent); }
.pass.is-done { box-shadow: inset 0 3px 0 var(--fresh); }
.pass-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pass-state { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--accent-ink, var(--accent)); }
.pass-state.done { color: var(--fresh); }
.pass-qr { width: min(240px, 70vw); aspect-ratio: 1; justify-self: center; background: #fff; padding: 8px; border-radius: 6px; }
.pass-qr svg { width: 100%; height: 100%; display: block; }
.pass-item { display: flex; align-items: baseline; gap: 10px; border-top: 1px dashed var(--hairline); padding-top: 12px; }
.pass-item b { font-size: 17px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pass-amount { font-family: var(--mono); font-size: 17px; font-weight: 600; white-space: nowrap; }
.pass-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.pass-kv dt { color: var(--text3); } .pass-kv dd { margin: 0; overflow-wrap: anywhere; }
.pass .btn.accent { width: 100%; }

/* Your deals: one line each (sold or bought, what, for how much), then who and where it stands; opens to the deal. */
details.more.deal-row, .deal-row.deal-jump { border: 1px solid var(--hairline); background: var(--surface); border-radius: 6px; }
.deal-row.deal-jump { display: grid; gap: 4px; width: 100%; padding: 10px 12px; text-align: left; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
@media (hover: hover) { .deal-row.deal-jump:hover { border-color: var(--text3); } }
details.more.deal-row > summary { display: grid; gap: 4px; padding: 10px 12px; font-family: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--text); }
details.more.deal-row > summary::before { content: none; }
details.more.deal-row[open] { padding-bottom: 8px; }
details.more.deal-row[open] > .card { margin: 0 8px; }
.deal-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.deal-line .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-line .tag:last-child { margin-left: auto; }
.deal-amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.deals-sum { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.match-actions { align-items: center; }
details.more.match-more { display: inline-block; }
details.more.match-more > summary { padding: 6px 4px; }
details.more.match-more[open] { display: inline-grid; }

/* Improve your listing: one card per part — title, what it says now, and its editor when opened (several at once). */
.improve-list { display: grid; gap: 6px; }
details.improve { border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); }
details.improve.done { border-color: color-mix(in srgb, var(--fresh) 45%, var(--hairline)); }
details.improve > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; padding: 10px 12px; min-height: 44px; }
details.improve > summary::-webkit-details-marker { display: none; }
details.improve > summary::after { content: "▸"; position: absolute; right: 12px; color: var(--text3); }
details.improve > summary { position: relative; padding-right: 32px; }
details.improve[open] > summary::after { content: "▾"; }
.improve-title { font-size: 14px; font-weight: 600; }
details.improve.done .improve-title { color: var(--fresh); }
.improve-status { font-size: 12px; color: var(--text3); }
.improve-body { padding: 0 12px 12px; display: grid; gap: 8px; }

/* Terms on a phone: the name on its own line, the full sentence wrapped below it — nothing cut off. */
.term-edit { display: grid; gap: 4px; }
.term-edit .term-label { font-weight: 600; }
.term-edit .term-text { resize: vertical; min-height: 56px; font: inherit; }

.chip.suggested { border-style: dashed; border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
/* Common-question options wrap two per row on a phone instead of a long ragged line. */
@media (max-width: 520px) { .improve-body .row:has(> .chip) { display: grid; grid-template-columns: 1fr 1fr; } .improve-body .chip { text-align: center; } }

/* Opening: the mark, the name, a thin line that fills — calm, centred, gone as soon as the app is ready. */
.splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--bg); }
.splash .logo { width: 64px; height: 64px; }
.splash-name { font-size: 22px; font-weight: 650; letter-spacing: -.02em; color: var(--text); }
@keyframes splash-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.app { animation: app-in .4s ease-out both; }
@keyframes app-in { from { opacity: 0; } to { opacity: 1; } }

/* Settings: grouped cards, a profile header, labelled fields, segmented controls. */
.set-card { display: grid; gap: 14px; }
.set-head { display: flex; align-items: center; gap: 12px; }
.set-head b { display: block; font-size: 17px; }
.set-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--on-accent, #fff); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.set-field { display: grid; gap: 4px; }
.set-field > span { font-size: 12px; color: var(--text3); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-row > div:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.set-row b { font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: 8px; padding: 2px; background: var(--surface2, var(--surface)); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text2); font: inherit; font-size: 13px; padding: 7px 12px; border-radius: 6px; cursor: pointer; min-height: 34px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); font-weight: 600; }
.seg.wide { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
@media (max-width: 520px) { .seg.wide { grid-template-columns: 1fr 1fr; } }

/* Insights board (as on the landing page): an accent "what to do next", then visual panels. */
.insights { gap: 14px; }
.ins-say { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border-radius: 8px; box-shadow: none; }
.ins-say .label { color: var(--accent-ink, var(--accent)); }
.ins-say ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.ins-say li { position: relative; padding-left: 18px; font-size: 14px; }
.ins-say li::before { content: "→"; position: absolute; left: 0; color: var(--accent-ink, var(--accent)); }
.ins-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.ins-panel { border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; box-shadow: inset 0 2px 0 var(--edge, var(--hairline)); }
.ins-panel.wait { --edge: var(--wait); } .ins-panel.fresh { --edge: var(--fresh); } .ins-panel.talk { --edge: var(--talk); } .ins-panel.accent { --edge: var(--accent); }
.ins-sub { font-size: 12px; color: var(--text3); margin-top: -6px; }
.ins-bar { display: grid; gap: 5px; }
.ins-bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.ins-bar-top span:last-child { font-family: var(--mono); font-size: 11.5px; color: var(--text2); white-space: nowrap; }
.ins-track { height: 10px; background: var(--surface2, var(--hairline)); border-radius: 0 4px 4px 0; position: relative; overflow: hidden; }
.ins-track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; }
.ins-track i.had { background: var(--text3); z-index: 1; border-right: 2px solid var(--surface); }
.ins-dot { display: grid; grid-template-columns: 1fr; gap: 4px; font-size: 13px; }
.ins-line { position: relative; height: 18px; }
.ins-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--hairline); }
.ins-line .seg { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--text3); opacity: .5; }
.ins-line .pt { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }
.ins-line .pt.listed { background: var(--surface); box-shadow: inset 0 0 0 2px var(--text3), 0 0 0 2px var(--surface); } .ins-line .pt.agreed { background: var(--accent); }
.ins-vals { font-family: var(--mono); font-size: 11.5px; }
.ins-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hairline); border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; }
.ins-nums div { background: var(--surface); padding: 10px; display: grid; gap: 2px; }
.ins-nums b { font-size: 24px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ins-nums span { font-size: 12px; color: var(--text3); }
.ins-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.ins-pills span { font-size: 13px; padding: 6px 10px; border: 1px solid var(--hairline); border-radius: 999px; color: var(--text2); }
.ins-pills b { font-family: var(--mono); font-size: 11px; color: var(--text); margin-left: 6px; }
.ins-qs { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13px; }
.ins-qs li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--hairline); padding-bottom: 6px; }
.ins-qs li:last-child { border-bottom: 0; }
.ins-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ins-big b { font-size: 40px; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.ins-big span { color: var(--text2); font-size: 13px; }

/* Side panel: beside the main view on a desktop (the view narrows), over it on a phone. */
.panel-body { display: grid; gap: 12px; align-content: start; }
.panel-body .pass { box-shadow: inset 0 3px 0 var(--accent); }
.panel pre { margin: 0; padding: 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; font: 12px/1.5 var(--mono); overflow: auto; max-height: 60vh; }

/* Radar: four counts, each a filter; rows with the decision on them. */
.radar { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; background: var(--surface); }
.radar button { border: 0; border-right: 1px solid var(--hairline); background: transparent; padding: 12px 6px; display: grid; gap: 2px; justify-items: center; cursor: pointer; color: var(--text3); font: inherit; min-height: 64px; }
.radar button:last-child { border-right: 0; }
.radar button b { font-size: 24px; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text3); }
.radar button span { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.radar button.on { color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.radar button.on b { color: var(--text); }
.radar button.need.hot b { color: var(--wait); } /* only while something is waiting on you */
.rlist { display: grid; gap: 8px; }
.rrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); }
.rrow.needs { border-color: var(--wait); box-shadow: inset 3px 0 0 var(--wait); }
.rrow-main { display: flex; align-items: center; gap: 10px; flex: 1 1 240px; min-width: 0; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.rrow-text { display: grid; gap: 2px; min-width: 0; }
.rrow-text b { font-size: 15px; }
.rrow-text .small { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rrow-side { display: grid; gap: 6px; justify-items: end; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fresh); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fresh) 25%, transparent); animation: blink 1.6s infinite; flex: none; }
@keyframes blink { 50% { opacity: .35; } }
/* Agent log stream */
.lg-stream { display: grid; gap: 10px; font-family: var(--mono); font-size: 12px; }
.lg { display: grid; grid-template-columns: 62px 1fr; gap: 2px 10px; }
.lg-t { color: var(--text3); }
.lg-who { color: var(--text2); }
.lg-name { display: inline-block; border: 1px solid var(--hairline); padding: 0 6px; border-radius: 3px; }
.lg-kind { padding: 1px 6px; border-radius: 2px; text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }
.lg-kind.propose { background: var(--inverse); color: var(--on-inverse); } .lg-kind.accept { background: var(--done-fill); color: var(--fresh); } .lg-kind.decline { color: var(--danger); border: 1px solid var(--danger); } .lg-kind.say { border: 1px solid var(--hairline); }
.lg-text { grid-column: 2; color: var(--text); font-family: var(--sans); font-size: 13.5px; }
.lg.sys .lg-text { color: var(--text3); font-style: italic; }

/* Start of a chat */
.start { display: grid; gap: 12px; }
.start .headline { margin: 0; }
.start-who { gap: 10px; }
.start-ideas { display: flex; flex-wrap: wrap; gap: 8px; }
.start-ideas .chip { font-size: 14px; padding: 10px 14px; }
/* Calibrating: the agent's steps light up one by one */
.calib { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); max-width: 420px; }
.calib-bar { height: 6px; background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, transparent 8px 16px); background-size: 200% 100%; animation: calib-move 1.2s linear infinite; border-radius: 2px; opacity: .85; }
@keyframes calib-move { to { background-position: -32px 0; } }
.calib-line { color: var(--text3); opacity: 0; animation: calib-in .5s ease forwards; animation-delay: calc(var(--i) * .9s - var(--t, 0s)); padding-left: calc(var(--i) * 12px); }
.calib-line:last-child { color: var(--text); font-weight: 600; }
@keyframes calib-in { to { opacity: 1; } }

/* Danger zone */
.danger-zone > summary { color: var(--danger); }
.danger-card { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.danger-card b { color: var(--danger); font-family: var(--mono); }

/* About me › answers your agent remembers */
.memory summary { cursor: pointer; list-style: none; }
.mem-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hairline); }
.mem-row:first-of-type { border-top: 0; }
.seg.compact button { padding: 4px 9px; min-height: 28px; font-size: 12px; }
@media (max-width: 520px) { .mem-row { flex-wrap: wrap; } }
.chip.skel { height: 34px; border-color: transparent; background: linear-gradient(90deg, var(--surface) 0%, var(--hairline) 50%, var(--surface) 100%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .chip.skel { animation: none; } }

/* My card: the share card (who, what's on offer, record from receipts, the QR) — centred, full width, even buttons. */
.share-card { display: grid; gap: 16px; justify-items: center; text-align: center; }
.share-top { display: grid; gap: 4px; justify-items: center; }
.share-name { font-size: 22px; letter-spacing: -0.01em; margin-top: 6px; }
.share-stats { width: 100%; max-width: 420px; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--hairline); border-radius: 6px; overflow: hidden; }
.share-stats > div { display: grid; gap: 2px; padding: 10px 8px; text-align: center; }
.share-stats > div + div { border-left: 1px solid var(--hairline); }
.share-stats b { font-size: 20px; }
.share-stats span { font-size: 12px; color: var(--text2); }
.share-card .qr { width: 200px; height: 200px; padding: 10px; border-radius: 6px; }
.share-grid { width: 100%; max-width: 420px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.share-grid .btn { width: 100%; justify-content: center; text-align: center; text-decoration: none; min-height: 40px; white-space: normal; }
.share-grid.quiet .btn { min-height: 34px; }
@media (max-width: 380px) { .share-grid { grid-template-columns: 1fr; } }

/* The agent card, readable */
.ac-head { display: flex; gap: 12px; align-items: center; }
.ac-caps { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-caps span { font-size: 12px; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); }
.ac-offer { display: flex; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--hairline); }
.ac-offer:first-child { border-top: 0; }
.ac-offer b { flex: 1; min-width: 0; }

/* Checkout (side panel) */
.co-order, .co-pay { display: grid; gap: 10px; }
.co-lines { display: grid; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--hairline); }
.co-total { font-size: 17px; padding-top: 6px; border-top: 1px solid var(--hairline); }
.btn.gpay.co-gpay { width: 100%; min-height: 48px; font-size: 17px; border-radius: 10px; }
.co-pay .btn.secondary { width: 100%; min-height: 44px; }
.co-next { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.co-done { justify-items: center; text-align: center; gap: 8px; padding: 22px 16px; }
.co-tick { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: var(--surface); background: var(--fresh); animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }

/* Receipts: what they do for the network */
.net-card { display: grid; gap: 10px; }
.net-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.net-grid > div { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 6px; }
.net-grid b { font-size: 22px; }
.net-grid span { font-size: 12px; color: var(--text2); line-height: 1.4; }
@media (max-width: 520px) { .net-grid { grid-template-columns: 1fr; } }

/* Discovery: one request, several agents at once */
.disc { display: grid; gap: 10px; }
.disc-list { display: grid; gap: 6px; }
.disc-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
@media (hover: hover) { .disc-row:hover { border-color: var(--accent); } }
.disc-row.needs { border-color: var(--wait); box-shadow: inset 3px 0 0 var(--wait); background: color-mix(in srgb, var(--wait-fill) 55%, var(--surface)); }
.disc-text .live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; vertical-align: 1px; box-shadow: none; }
/* While any agent in the list is still working: a thin bar that runs (agent activity — it moves). */
.work-line { height: 2px; background: var(--hairline); border-radius: 2px; overflow: hidden; position: relative; }
.work-line::after { content: ""; position: absolute; inset: 0; width: 30%; background: var(--accent); border-radius: 2px; animation: splash-run 1.3s ease-in-out infinite; }
.disc-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.disc-text .muted { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.disc-side { display: grid; justify-items: end; gap: 4px; }
/* The app's own confirmation (ui.js ask): in the page, never a browser pop-up. The --stale tone marks a decision made for a demo person. */
dialog.ask { border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); color: var(--text); padding: 0; width: min(420px, calc(100vw - 32px)); }
dialog.ask::backdrop { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(2px); }
.ask-body { display: grid; gap: 12px; padding: 18px; margin: 0; }
.ask-as { justify-self: start; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--stale); border: 1px solid color-mix(in srgb, var(--stale) 45%, transparent); border-radius: 2px; padding: 4px 8px; }
.ask-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35; text-wrap: balance; }
.ask-detail { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text2); }
.ask-field { display: grid; gap: 6px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.search-entry { width: 100%; border: 0; height: 64px; }
.disc-row.as-div { cursor: default; }
/* A screen's frame while its data loads (no movement — just where things will be). */
.skel-card { background: var(--surface2); border-color: transparent; }
.skel-line { background: var(--surface2); border-radius: 4px; }

.saved-line { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }

/* The Collab mark: two square hooks holding each other across a gap. Yours is brand pink in both themes; theirs is
   drawn in the text colour, so it is ink on light and white on dark. The small square is an offer crossing the gap.
   .live loops it (4.8 s), .intro plays it once and stays engaged. */
:root { --brand: #ff3ea5; }
.logo { display: inline-block; width: 18px; height: 18px; flex: none; overflow: visible; vertical-align: -3px; }
.logo .you { stroke: var(--brand); }
.logo .them { stroke: currentColor; }
.logo .offer { fill: var(--peri); opacity: 0; }
.logo.live .you { animation: logo-you 4.8s cubic-bezier(.2,.8,.2,1) infinite; }
.logo.live .them { animation: logo-them 4.8s cubic-bezier(.2,.8,.2,1) infinite; }
.logo.live .offer { animation: logo-offer 4.8s ease-in-out infinite; }
.logo.intro .you { animation: logo-you-in 1.6s cubic-bezier(.2,.8,.2,1) both; }
.logo.intro .them { animation: logo-them-in 1.6s cubic-bezier(.2,.8,.2,1) both; }
.logo.intro .offer { animation: logo-offer-in 1.6s ease-in-out both; }
@keyframes logo-you { 0% { transform: translate(-12px,-12px); opacity: 0 } 12% { opacity: 1 } 32%, 84% { transform: none; opacity: 1 } 100% { transform: translate(-12px,-12px); opacity: 0 } }
@keyframes logo-them { 0% { transform: translate(12px,12px); opacity: 0 } 12% { opacity: 1 } 32%, 84% { transform: none; opacity: 1 } 100% { transform: translate(12px,12px); opacity: 0 } }
@keyframes logo-offer { 0%, 38% { transform: none; opacity: 0 } 42% { opacity: 1 } 62% { transform: translateX(24px); opacity: 1 } 68%, 100% { transform: translateX(24px); opacity: 0 } }
@keyframes logo-you-in { from { transform: translate(-12px,-12px); opacity: 0 } 45%, to { transform: none; opacity: 1 } }
@keyframes logo-them-in { from { transform: translate(12px,12px); opacity: 0 } 45%, to { transform: none; opacity: 1 } }
@keyframes logo-offer-in { 0%, 50% { transform: none; opacity: 0 } 58% { opacity: 1 } 88% { transform: translateX(24px); opacity: 1 } to { transform: translateX(24px); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { html:root .logo .you, html:root .logo .them, html:root .logo .offer { animation: none !important; } html:root .logo .offer { opacity: 0; } }

/* Keyboard focus is always visible (in the brand colour), never removed. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.icon { flex: none; display: inline-block; vertical-align: middle; }
.nav .ico .icon { width: 18px; height: 18px; }

/* Loading dots: three pulses while something loads or the agent works (they move even with animations off). */
.dots { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; vertical-align: middle; color: var(--accent); }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .25; animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: no-preference) {
  :root[data-motion="off"] .dots i { animation: dot 1.2s ease-in-out infinite !important; }
  :root[data-motion="off"] .dots i:nth-child(2) { animation-delay: .15s !important; } :root[data-motion="off"] .dots i:nth-child(3) { animation-delay: .3s !important; }
}
@media (prefers-reduced-motion: reduce) { .dots i { animation: none !important; opacity: .6; } }
.splash .dots { margin: 0; }

/* A question your agent asks before searching: the theme's surface with the brand edge (periwinkle is for on-device). */
.ask-box { display: grid; gap: 10px; background: var(--surface2); border-color: var(--hairline); box-shadow: inset 3px 0 0 var(--accent); }
.ask-box .chip { background: var(--surface); }
/* Text fields show focus with their own border, not a second ring around them. */
.field:focus-visible { outline: none; border-color: var(--accent); }

/* The menu reads the same on a phone and a computer: one row height (44 px), one icon size, one gap. */
.nav button { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 6px; font-size: 15px; }
.nav .ico { width: 20px; display: inline-grid; place-items: center; color: var(--text2); }
.nav button.on .ico { color: var(--accent); }
.nav .trail { margin-left: auto; }
/* Install Collab: the device's own steps */
.install-card { display: grid; gap: 14px; }
.install-card .logo { width: 40px; height: 40px; }
.install-steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; }
.install-steps .icon { vertical-align: -3px; color: var(--accent); }
.note-ico .logo { width: 16px; height: 16px; } .note-ico .icon { color: var(--c); }
/* Privacy & AI in three plain sentences */
.plain-facts { display: grid; gap: 12px; }
.plain-facts > div { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.5; }
.plain-facts .icon { color: var(--accent); margin-top: 2px; }

/* The menu: pages first, then recent chats (they scroll), then your agent's address, account and install. */
.sidebar .scroll { flex: 1; }
.side-foot { display: grid; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hairline); background: var(--bg); }
.side-foot .btn { width: 100%; }
.sidebar .nav { display: grid; gap: 2px; }

/* After the rules they override. Phones and touch: no field under 16 px, so iOS never zooms in on focus. */
@media (max-width: 899px), (pointer: coarse) { .field, .field.compact, .stepper .qty, .term-edit .term-text, select, textarea, .composer input, .composer textarea { font-size: 16px; } }
/* Touch: 44 px targets for the composer, icon buttons, recent chats, small toggles, steppers, compact fields and
   disclosures; a chip that's only shown isn't a target; small mono labels one readable size. */
@media (pointer: coarse) {
  .mic, .send { width: 44px; height: 44px; }
  .topbar .menu, .panel-top .close { min-width: 44px; justify-content: center; }
  .session { min-height: 44px; padding-block: 12px; }
  .engine-chip { position: relative; } .engine-chip::after { content: ""; position: absolute; inset: -10px -4px; }
  .note-x { width: 44px; }
  .stepper .btn { min-width: 44px; }
  .seg.compact button { min-height: 44px; padding: 4px 12px; }
  .field.compact, .stepper .qty { min-height: 44px; }
  details.more > summary, details.more.match-more > summary { padding-block: 14px; }
  span.chip:not(.req):not(.skel) { min-height: 0; }
  .tag, .steps li, .ev .who, .nav button .trail, .radar button span, .lg-kind, details.more > summary, .note-kicker { font-size: 11px; }
}

/* Trip map, progress and date tiles (communities, goals) */
.trip-map { height: 180px; border: 1px solid var(--hairline); border-radius: 6px; } .trip-map.off { display: none; }
.trip-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot-from, .dot-to { width: 8px; height: 8px; flex: none; display: inline-block; } .dot-from { border-radius: 50%; border: 2px solid var(--talk); } .dot-to { background: var(--accent); }
.progress { height: 4px; background: var(--hairline); border-radius: 2px; overflow: hidden; } .progress > span { display: block; height: 100%; background: var(--accent); }
.date-tile { display: grid; place-items: center; min-width: 52px; padding: 6px 8px; border: 1px solid var(--hairline); border-radius: 6px; }
.date-tile span { font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text3); } .date-tile b { font-size: 22px; line-height: 1.1; }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.landed { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-look="dark"] .avatar .av-bg { fill: hsl(var(--h) 30% 24%); } :root[data-look="dark"] .avatar .av-ink { fill: hsl(var(--h) 60% 85%); }
@media (prefers-color-scheme: dark) { :root:not([data-look]) .avatar .av-bg { fill: hsl(var(--h) 30% 24%); } :root:not([data-look]) .avatar .av-ink { fill: hsl(var(--h) 60% 85%); } }
/* Developer JSON and any preformatted text wrap inside their card (no sideways scroll on phones). */
pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; max-height: 360px; overflow: auto; font: 12px/1.5 var(--mono); background: var(--surface2); border-radius: 6px; padding: 10px; }
.panel .content > *, .main .content > * { min-width: 0; }
@media (pointer: coarse) { .linkish.x { min-width: 44px; min-height: 44px; } }

/* The menu button: a full-size target with a drawn icon, centred on the title row. */
.topbar .menu { width: 44px; height: 44px; min-width: 44px; padding: 0; align-items: center; justify-content: center; flex: none; border-radius: 8px; color: var(--text); }
.topbar .menu .icon { width: 22px; height: 22px; }
/* Close buttons: a full-size target everywhere (the ✕ glyph or icon stays small inside it). */
.panel-top .close, .note-x, .modal .close, .sheet .close { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
@media (pointer: coarse) { .panel-top .close, .note-x, .modal .close, .sheet .close { min-width: 44px; min-height: 44px; } }
.panel-top .close, .note-x { font-size: 18px; line-height: 1; letter-spacing: 0; }
.panel-top .close .icon { width: 20px; height: 20px; }
/* A chat in the menu, with its delete button: shown on hover or focus with a mouse, always on touch screens. */
.session-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.session-row .session { flex: 1; min-width: 0; }
.session-del { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: var(--text3); cursor: pointer; opacity: 0; }
.session-row:hover .session-del, .session-row:focus-within .session-del, .session-del:focus-visible { opacity: 1; }
.session-del:hover { color: var(--danger); background: var(--surface2); }
@media (pointer: coarse) { .session-del { opacity: 1; width: 44px; height: 44px; } }
@media (pointer: coarse) { .resizer { width: 24px; left: -12px; } .resizer::after { left: 11px; } .resizer::before { left: 9px; } }
/* The open screen's title row: menu (or Back), title and close share one centre line. */
#panel-title { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
#panel-title .label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The agent asking one thing at a time (a request's questions, a listing's private lowest): a conversation turn, not a form. */
.agent-ask { border-left: 3px solid var(--accent); gap: 10px; }
.agent-ask .ask-q { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }
.agent-ask .row .field { flex: 1; min-width: 140px; }
.brief-title { font-size: 16px; }
/* The logo in a notice keeps its own colours — pink "you" hook, ink "them" hook — on a neutral tile (the notice's own
   colour tints only icon badges). */
.note-ico .logo { color: var(--text); }
.note-ico:has(.logo) { background: var(--surface2); }
/* A conversation names the chat it came from (tap to see it, at the card it started from). */
.from-chat { display: inline-flex; gap: 4px; align-items: center; margin-bottom: 6px; color: var(--text2); }
.from-chat b { color: var(--text); font-weight: 600; max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* In-app QR scanner over the chat */
.scan-overlay { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--bg) 92%, transparent); display: grid; place-items: center; padding: 16px; }
.scan-overlay .scan-card { width: min(440px, 100%); display: grid; gap: 10px; }
