/* Call Helper: forest + lime design system (Inter, pill buttons, flat surfaces) */
:root {
  --forest: #163300;      /* brand dark: text, dark surfaces */
  --lime: #9fe870;        /* one accent: primary action, active state */
  --spruce: #054d28;
  --linen: #e2f6d5;       /* pale green wash */
  --signal: #0b4c72;
  --alarm: #cb272f;
  --charcoal: #454745;    /* body text */
  --obsidian: #0e0f0c;    /* headings */
  --pebble: #868685;      /* muted, input borders */
  --slate: #6a6c6a;       /* helper text */
  --fog: #e8ebe6;         /* soft surfaces */
  --paper: #ffffff;

  --bg: var(--paper);
  --surface: var(--fog);
  --surface-2: #f3f5f1;
  --text: var(--charcoal);
  --heading: var(--obsidian);
  --muted: var(--slate);
  --faint: var(--pebble);
  --hair: rgba(14, 15, 12, 0.12);
  --me-bubble: var(--forest);
  --me-text: var(--paper);
  --them-bubble: var(--fog);
  --them-text: var(--obsidian);
  --danger-soft: #fbe7e8;
  --shadow-lg: rgba(0, 0, 0, 0.08) 0 6px 20px 0;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-feature-settings: "calt"; letter-spacing: -0.006em;
  display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
b { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* buttons: pills by default */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 9999px; padding: 10px 22px; font-size: 15px; font-weight: 500;
  border: 1px solid transparent; background: transparent; transition: background .15s, border-color .15s, transform .05s;
}
.pill:active { transform: scale(.98); }
.pill.primary { background: var(--lime); color: var(--forest); font-weight: 600; }
.pill.primary:hover { background: #8fdb5f; }
.pill.outline { border-color: var(--forest); color: var(--forest); background: var(--bg); }
.pill.outline:hover { background: var(--linen); }
.pill.small { padding: 6px 14px; font-size: 13px; }
.pill.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 24px; }
.pill.end { border-color: var(--alarm); color: var(--alarm); padding: 7px 16px; font-size: 14px; font-weight: 600; }
.pill.end:hover { background: var(--danger-soft); }
.end-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--alarm); }
.text-link { background: none; border: 0; padding: 0; color: var(--forest); font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
kbd { font: 600 11px Inter, sans-serif; border-radius: 6px; padding: 1px 6px; background: var(--surface); color: var(--muted); }

/* inputs */
input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--pebble); border-radius: 10px;
  padding: 12px 16px; font-size: 16px; color: var(--heading);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
textarea { resize: vertical; }
.error { color: var(--alarm); font-size: 14px; min-height: 1em; margin: 12px 0 0; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--hair); flex: none; }
.bar-left, .bar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { display: block; border-radius: 9px; }
.title { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--heading); }
.who-chip { font-size: 14px; font-weight: 500; color: var(--text); background: var(--surface); padding: 5px 14px; border-radius: 9999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; color: var(--heading); padding: 6px 14px; background: var(--surface); border-radius: 9999px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--alarm); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.talk { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.talk b { color: var(--heading); font-variant-numeric: tabular-nums; }
.talk-track { width: 110px; height: 6px; border-radius: 9999px; background: var(--surface); overflow: hidden; }
.talk-fill { display: block; height: 100%; width: 0; background: var(--forest); border-radius: 9999px; transition: width .4s; }

/* screens */
.screen { flex: 1; min-height: 0; }
.setup, .after { display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px; overflow: auto; background: var(--surface-2); }
.card { width: 100%; max-width: 560px; background: var(--bg); border-radius: 28px; padding: 36px; box-shadow: 0 0 0 1px var(--hair); }
.card.wide { max-width: 820px; }
h1 { font-size: 40px; line-height: 1; font-weight: 900; letter-spacing: -0.04em; color: var(--heading); margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
label { display: flex; gap: 8px; align-items: baseline; font-size: 14px; font-weight: 600; color: var(--heading); margin: 24px 0 8px; }
.opt { font-weight: 500; font-size: 12px; color: var(--muted); background: var(--surface); padding: 1px 8px; border-radius: 9999px; }

.search-wrap { position: relative; }
.search-icon { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
#search { padding-left: 44px; }
.results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 8px); background: var(--bg); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--hair), var(--shadow-lg); }
.result { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.result + .result { border-top: 1px solid var(--hair); }
.result:hover { background: var(--linen); }
.r-name { font-weight: 600; font-size: 15px; color: var(--heading); }
.r-meta, .picked-meta { font-size: 13px; color: var(--muted); }
.results .empty { padding: 14px 16px; font-size: 14px; color: var(--muted); }
.picked { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 9999px; background: var(--surface); }
.picked-text { flex: 1; min-width: 0; }
.picked-name { font-weight: 600; color: var(--heading); line-height: 1.2; }
.add-new { margin-top: 12px; font-size: 14px; }
.new-person { display: grid; gap: 8px; margin-top: 12px; }
.mic-box { margin-top: 20px; font-size: 14px; color: var(--muted); border-radius: 10px; background: var(--surface); padding: 10px 16px; }
.mic-box summary { cursor: pointer; display: flex; gap: 8px; align-items: center; }
.mic-label { font-weight: 600; color: var(--heading); }
.mic-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mic-box select { margin-top: 10px; }
.steps { font-size: 13px; color: var(--muted); margin: 14px 0 0; text-align: center; }

/* avatars: round */
.avatar { width: 36px; height: 36px; border-radius: 1000px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; letter-spacing: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.them { background: var(--bg); color: var(--forest); box-shadow: inset 0 0 0 1px var(--pebble); }
.avatar.me { background: var(--forest); color: var(--lime); }

/* live layout: conversation + teleprompter */
.live { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.convo { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--hair); }
.convo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--hair); }
.convo-title { font-size: 12px; color: var(--muted); font-weight: 500; }
.speaker { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--heading); }
.talk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--pebble); transition: background .2s, box-shadow .2s; }
.talk-dot.on { background: var(--lime); box-shadow: 0 0 0 4px rgba(159, 232, 112, .3); }

.chat { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.group { display: flex; gap: 10px; max-width: 82%; animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.group.them { align-self: flex-start; }
.group.me { align-self: flex-end; flex-direction: row-reverse; }
.group-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.group.me .group-body { align-items: flex-end; }
.group-head { display: flex; gap: 8px; align-items: baseline; font-size: 12px; margin: 2px 4px 2px; }
.group-name { font-weight: 600; color: var(--heading); }
.group-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.bubble { padding: 10px 16px; border-radius: 20px; font-size: 15px; line-height: 1.45; max-width: 100%; overflow-wrap: anywhere; }
.group.them .bubble { background: var(--them-bubble); color: var(--them-text); border-top-left-radius: 6px; }
.group.me .bubble { background: var(--me-bubble); color: var(--me-text); border-top-right-radius: 6px; }
.bubble.interim { opacity: .55; }
.sys { align-self: center; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface); padding: 5px 14px; border-radius: 9999px; }
.sys::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--forest); }
.sys.warn::before { background: var(--alarm); }
.empty-chat { margin: auto; color: var(--muted); font-size: 14px; text-align: center; }

/* teleprompter: light card */
.prompter { display: flex; flex-direction: column; padding: 20px; overflow-y: auto; background: var(--surface-2); }
.prompt-card { background: var(--paper); color: var(--obsidian); border-radius: 28px; padding: 28px 32px 26px; box-shadow: 0 0 0 1px var(--hair); }
.prompter-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.prompter-head .label { font-size: 13px; font-weight: 700; color: var(--forest); }
.spacer { flex: 1; }
.state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 9999px; background: var(--fog); color: var(--slate); }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pebble); }
.state.turn { background: var(--lime); color: var(--forest); }
.state.turn .state-dot { background: var(--forest); }
.state.listen { background: #e3eef6; color: var(--signal); }
.state.listen .state-dot { background: var(--signal); animation: blink 1s infinite; }
.state.think .state-dot { background: var(--forest); animation: blink .8s infinite; }

.prompt { font-size: 26px; line-height: 1.45; font-weight: 600; letter-spacing: -0.015em; min-height: 140px; color: var(--obsidian); transition: opacity .2s; }
.prompt.wait { opacity: .4; }
.prompt.listening { opacity: .6; }
.prompt .w { border-radius: 9999px; padding: 0 4px; margin: 0 -4px; transition: color .15s, background .15s; }
.prompt .w.said { color: #b9bcb6; }
.prompt .w.next { background: var(--lime); color: var(--forest); }
.prompt.speaking .w.next { animation: cue 1.1s ease-in-out infinite; }
@keyframes cue { 50% { background: var(--linen); } }
.prompt.done .w.said { color: var(--pebble); }
.prompt-card.deep { box-shadow: inset 0 0 0 2px var(--lime), 0 0 0 1px var(--hair); }

.meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 20px; min-height: 26px; }
.badge { font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 9999px; }
.badge:empty { display: none; }
.badge.kb { background: var(--linen); color: var(--forest); }
.badge.general { background: var(--fog); color: var(--charcoal); }
.badge.unsure { background: #fdf0d5; color: #7a4d06; }
.why { font-size: 14px; color: var(--slate); }

/* AI label + explainability popover */
.ai-wrap { position: relative; }
.ai-label { font: 700 11px Inter, sans-serif; letter-spacing: .04em; padding: 3px 9px; border-radius: 9999px; background: transparent; color: var(--forest); border: 1px solid var(--forest); }
.ai-label:hover, .ai-label[aria-expanded="true"] { background: var(--linen); }
.ai-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 10; width: 300px; background: var(--bg); color: var(--text); border-radius: 10px; padding: 16px 18px; box-shadow: 0 0 0 1px var(--hair), var(--shadow-lg); }
.ai-pop-title { font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.ai-pop dl { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0; font-size: 13px; }
.ai-pop dt { color: var(--muted); }
.ai-pop dd { margin: 0; color: var(--heading); }
.ai-pop-note { font-size: 12px; color: var(--muted); margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--hair); }

.actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.latency { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* after the call: summary dashboard */
.after-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.after-head .sub { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.tile { background: var(--surface); border-radius: 10px; padding: 16px 18px; }
.tile.wide-tile { grid-column: 1 / -1; }
.tile-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--heading); margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile-value.small { font-size: 16px; font-weight: 500; letter-spacing: -0.006em; line-height: 1.45; }
.interest { display: inline-block; font-size: 16px; font-weight: 600; letter-spacing: 0; padding: 4px 14px; border-radius: 9999px; text-transform: capitalize; }
.interest.hot { background: var(--lime); color: var(--forest); }
.interest.warm { background: var(--linen); color: var(--forest); }
.interest.cold { background: var(--bg); color: var(--muted); box-shadow: inset 0 0 0 1px var(--pebble); }
.ghl-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--surface); font-size: 14px; color: var(--text); }
.ghl-status.ok { background: var(--linen); color: var(--forest); }
.ghl-status.bad { background: var(--danger-soft); color: var(--alarm); }
.ghl-status a { color: inherit; font-weight: 600; text-underline-offset: 3px; }
.notes { white-space: pre-wrap; font: 15px/1.6 Inter, -apple-system, sans-serif; color: var(--text); background: var(--bg); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair); padding: 18px; margin: 12px 0 0; max-height: 46vh; overflow: auto; }
.row { display: flex; align-items: center; gap: 20px; margin-top: 20px; }

@media (max-width: 900px) {
  .live { grid-template-columns: 1fr; grid-template-rows: auto minmax(260px, 1fr); }
  .prompter { order: -1; border-bottom: 1px solid var(--hair); }
  .convo { border-right: 0; }
  .prompt { font-size: 24px; min-height: 96px; }
  .who-chip, .talk { display: none !important; }
  .tiles { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 32px; }
  .card { padding: 24px; border-radius: 20px; }
}

/* who is who: customer = blue, you = forest green with your photo */
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 1000px; display: block; }
.avatar.me { box-shadow: 0 0 0 2px var(--lime); overflow: hidden; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.them { background: #e3eef6; color: var(--signal); box-shadow: none; }
.group.them .bubble { background: #eaf2f8; color: #0b2e45; border: 1px solid #cfe0ee; }
.group.them .group-name, .them-name { color: var(--signal); }
.group.me .group-name, .me-name { color: var(--forest); }
.group.me .bubble { background: var(--forest); color: var(--paper); }
.me-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding: 12px 16px 12px 12px; border-radius: 9999px; background: var(--surface); }
.me-text { flex: 1; min-width: 0; }
.me-title { font-weight: 600; color: var(--heading); font-size: 14px; }
.me-row .hint { margin: 0; }
.photo-btn { position: relative; padding: 0; border: 0; background: none; border-radius: 1000px; }
.photo-edit { position: absolute; inset: auto 0 -2px 0; margin: auto; width: max-content; font-size: 10px; font-weight: 700; background: var(--forest); color: var(--lime); padding: 1px 7px; border-radius: 9999px; }

/* microphone picker: clean select with its own arrow */
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; background: var(--bg); }
.select-wrap .chev { position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }

/* your voice playback after the call */
.voice-box { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 16px; margin-top: 16px; padding: 14px 18px; border-radius: 10px; background: var(--linen); }
.voice-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.voice-title { font-weight: 700; color: var(--forest); }
.voice-head .hint { margin: 0; }
.voice-box audio { width: 100%; height: 40px; }

/* coloured summary sections (soft, muted rainbow) */
.notes { white-space: normal; display: grid; gap: 8px; padding: 12px; }
.note-sec { border-radius: 10px; padding: 10px 14px; border-left: 4px solid; }
.note-label { font-size: 12px; font-weight: 700; letter-spacing: .02em; margin-bottom: 2px; }
.note-body { font-size: 15px; line-height: 1.55; white-space: pre-wrap; color: var(--obsidian); }
.tone-blue   { background: #eaf2fb; border-color: #7aa7d6; } .tone-blue .note-label { color: #1f4e79; }
.tone-lime   { background: #eef8e4; border-color: #9fe870; } .tone-lime .note-label { color: #2f5a10; }
.tone-amber  { background: #fdf4df; border-color: #e5b55a; } .tone-amber .note-label { color: #7a5300; }
.tone-rose   { background: #fbecef; border-color: #e391a3; } .tone-rose .note-label { color: #8a2236; }
.tone-green  { background: #e5f4e3; border-color: #6fbf73; } .tone-green .note-label { color: #1f5b25; }
.tone-violet { background: #f0ebfa; border-color: #a58bd9; } .tone-violet .note-label { color: #4b2f86; }
.tone-grey   { background: #eff1ed; border-color: #a3a7a0; } .tone-grey .note-label { color: #4a4d48; }
.tone-teal   { background: #e6f5f3; border-color: #6fbcb1; } .tone-teal .note-label { color: #135e55; }

/* full conversation */
.transcript-head { display: flex; align-items: baseline; gap: 10px; margin-top: 22px; }
.transcript-head .hint { margin: 0; }
.transcript-out { margin-top: 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair); padding: 8px 0; max-height: 50vh; overflow: auto; }
.t-row { display: grid; grid-template-columns: 110px 44px 1fr; gap: 10px; padding: 5px 16px; font-size: 14px; line-height: 1.5; }
.t-row.them { background: #f3f8fc; }
.t-who { font-weight: 700; }
.t-row.me .t-who { color: var(--forest); }
.t-row.them .t-who { color: var(--signal); }
.t-time { color: var(--faint); font-variant-numeric: tabular-nums; }
.t-text { color: var(--obsidian); }
.consent { text-align: center; margin-top: 6px; }

.notes { max-height: none; overflow: visible; }

.voice-saved { grid-column: 1 / -1; margin: 0; }

/* top tabs: Calls / Knowledge */
.tabs { display: inline-flex; gap: 2px; padding: 3px; margin-left: 8px; border-radius: 9999px; background: var(--surface); }
.tab { border: 0; background: transparent; font-size: 14px; font-weight: 500; color: var(--charcoal); padding: 6px 14px; border-radius: 9999px; }
.tab:hover { background: rgba(255,255,255,.7); }
.tab.active { background: var(--lime); color: var(--forest); font-weight: 600; }
.small-link { font-size: 13px; color: var(--slate); text-decoration: none; }
.small-link:hover { text-decoration: underline; color: var(--forest); }

/* knowledge page */
.kb-intro { margin: 0 0 18px; }
.meter-card { background: var(--surface); border-radius: 10px; padding: 14px 18px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meter-title { font-weight: 700; color: var(--forest); }
.meter-count { font-size: 13px; color: var(--slate); font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 9999px; background: var(--paper); margin: 10px 0 8px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--hair); }
.meter span { display: block; height: 100%; width: 0; background: var(--forest); border-radius: 9999px; transition: width .4s; }
.meter.search span { background: #e5b55a; }
.meter-card .hint { margin: 0; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 16px; padding: 26px 16px; border: 1.5px dashed var(--pebble); border-radius: 16px; cursor: pointer; text-align: center; transition: background .15s, border-color .15s; font-weight: 400; }
.drop:hover, .drop.over { background: var(--linen); border-color: var(--forest); }
.drop svg { width: 28px; height: 28px; fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop b { color: var(--obsidian); font-size: 15px; }
.drop span { font-size: 13px; color: var(--slate); }

.kb-list { margin-top: 14px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; }
.kb-list:empty { display: none; }
.kb-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 16px; }
.kb-row + .kb-row { border-top: 1px solid var(--hair); }
.kb-row.off .kb-name, .kb-row.off .kb-meta { opacity: .45; }
.kb-name-btn { border: 0; background: none; padding: 0; font-family: inherit; text-align: left; cursor: pointer; max-width: 100%; }
.kb-name-btn:hover { text-decoration: underline; }
.kb-preview { grid-column: 1 / -1; margin: 8px 0 0; max-height: 280px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--hair); border-radius: 10px; padding: 12px 14px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.kb-move { height: 30px; border: 1px solid var(--hair); border-radius: 8px; background: #fff; color: var(--heading); font: 600 12px/1 inherit; font-family: inherit; padding: 0 8px; cursor: pointer; }

/* Knowledge page: tab scope selector + 2-column system-prompt editor */
.kb-scope { display: inline-flex; gap: 4px; margin: 16px 0 8px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--hair); flex-wrap: wrap; }
.kb-scope .seg-btn { height: 38px; padding: 0 20px; border: 0; border-radius: 10px; background: transparent; box-shadow: none; font-size: 14.5px; font-weight: 700; color: var(--muted); }
.kb-scope .seg-btn:hover { color: var(--heading); background: #fff; }
.kb-scope .seg-btn.on { background: var(--forest); color: var(--lime); box-shadow: 0 1px 3px rgba(14, 15, 12, .18); }
.kb-scope-hint { margin: 0 0 14px; }
.kb-files-title { font-size: 15px; font-weight: 700; color: var(--heading); margin: 22px 0 10px; }
.kb-files-title span { color: var(--muted); font-weight: 600; }
.sysprompt { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; padding: 16px; border: 1px solid var(--hair); border-radius: 16px; background: var(--surface-2); margin-bottom: 6px; }
.sysprompt-left h2 { font-size: 15px; margin: 0 0 6px; color: var(--heading); }
.sysprompt-left .sub { margin: 0 0 12px; }
.sysprompt-actions { display: flex; align-items: center; gap: 12px; }
.sysprompt-status { display: block; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.sysprompt-right textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--hair); border-radius: 10px; padding: 12px 14px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--heading); background: #fff; }
#sysDelete.confirm { color: var(--alarm); font-weight: 700; }
@media (max-width: 760px) { .sysprompt { grid-template-columns: 1fr; } }
.kb-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.kb-icon.pdf { background: #fbecef; color: #8a2236; }
.kb-icon.docx { background: #eaf2fb; color: #1f4e79; }
.kb-icon.md, .kb-icon.text, .kb-icon.txt, .kb-icon.csv { background: var(--linen); color: var(--forest); }
.kb-icon.busy { background: var(--surface); color: var(--slate); }
.kb-name { font-weight: 600; color: var(--obsidian); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-meta { font-size: 13px; color: var(--slate); }
.switch { position: relative; width: 40px; height: 24px; border-radius: 9999px; border: 0; background: var(--pebble); padding: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--forest); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--lime); }
.kb-del { border: 0; background: none; color: var(--slate); font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.kb-del:hover { color: var(--alarm); background: var(--danger-soft); }
.kb-del.confirm { color: #fff; background: var(--alarm); font-weight: 600; }

.ask { margin-top: 22px; }
.ask-row { display: flex; gap: 10px; }
.ask-row .pill { flex: none; }
.ask-out { margin-top: 12px; padding: 14px 16px; border-radius: 10px; background: #eaf2fb; border-left: 4px solid #7aa7d6; }
.ask-out .a-text { color: var(--obsidian); }
.ask-out .a-meta { font-size: 12px; color: var(--slate); margin-top: 6px; }

/* longer answers fit on screen */
.prompt.long { font-size: 22px; }
.prompt.xlong { font-size: 19px; line-height: 1.55; }

/* Mac app: "understand my screen" tick box */
.see-screen { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 14px; font-weight: 400; line-height: 1.4; color: var(--text); cursor: pointer; }
.see-screen span { flex: 1; min-width: 0; }
/* tick boxes in the brand colours: lime box, dark tick */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; min-width: 20px; padding: 0; margin: 0;
  border: 1.5px solid var(--pebble); border-radius: 6px; background: var(--paper); cursor: pointer; display: inline-grid; place-content: center;
  transition: background .12s, border-color .12s;
}
input[type="checkbox"]::after { content: ""; width: 10px; height: 5px; border-left: 2.5px solid var(--forest); border-bottom: 2.5px solid var(--forest); transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s; }
input[type="checkbox"]:checked { background: var(--lime); border-color: var(--lime); }
input[type="checkbox"]:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
input[type="checkbox"]:hover { border-color: var(--forest); }
input[type="checkbox"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; box-shadow: none; }

/* second screen: code and design answers + chat. It takes the right side; the conversation stays on the left. */
.live.working { grid-template-columns: minmax(260px, .7fr) minmax(0, 1.7fr); }
.live.working > .convo { display: none; }
.live.working > .prompter { display: none; }
.work { display: flex; flex-direction: column; background: var(--bg); min-height: 0; min-width: 0; border-left: 1px solid var(--hair); }
.work-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--hair); flex-wrap: wrap; }
.work-head .spacer { flex: 1; }
.work-kind { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 9999px; background: var(--linen); color: var(--forest); }
.work-kind.design { background: #e3eef6; color: var(--signal); }
.work-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 18px; font-size: 16px; line-height: 1.55; color: var(--text); }
.work-asked { font-size: 13px; color: var(--signal); background: #e3eef6; padding: 8px 12px; border-radius: 10px; margin: 14px 0 8px; }
.work-asked:first-child { margin-top: 0; }
.work-me { margin: 14px 0 8px auto; width: fit-content; max-width: 85%; background: var(--forest); color: #fff; padding: 8px 14px; border-radius: 16px 16px 4px 16px; font-size: 15px; white-space: pre-wrap; }
.work-answer h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--heading); margin: 18px 0 6px; }
.work-answer h3:first-child { margin-top: 0; }
.work-answer p { margin: 6px 0; }
.work-answer p.say { background: var(--linen); color: var(--forest); font-weight: 500; padding: 10px 14px; border-radius: 10px; }
.work-answer ul, .work-answer ol { margin: 6px 0; padding-left: 22px; }
.work-answer li { margin: 3px 0; }
.work-answer code { font: 14px/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface); padding: 1px 6px; border-radius: 6px; color: var(--heading); }
.work-empty { color: var(--muted); }
.work-empty.wait { animation: workpulse 1.2s ease-in-out infinite; }
.work-empty.bad { color: var(--alarm); }
@keyframes workpulse { 50% { opacity: .45; } }
.code { margin: 10px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--hair); background: var(--surface-2); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--hair); }
.code-copy { border: 0; background: none; font: 600 12px Inter, sans-serif; color: var(--forest); padding: 4px 10px; border-radius: 9999px; cursor: pointer; }
.code-copy:hover { background: var(--linen); }
.code pre { margin: 0; padding: 14px; overflow: auto; outline: none; tab-size: 4; }
.code pre code { background: none; padding: 0; font: 15px/1.6 ui-monospace, "SF Mono", Menlo, monospace; color: var(--heading); white-space: pre; }
.code pre[contenteditable="true"]:focus { box-shadow: inset 0 0 0 2px var(--forest); }
.wire { margin: 10px 0; padding: 12px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); text-align: center; }
.wire { position: relative; overflow-x: auto; }
.wire-note { position: absolute; top: 18px; right: 18px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 9999px; background: var(--lime); color: var(--forest); animation: workpulse 1.2s ease-in-out infinite; }
.wire img { max-width: 100%; max-height: 72vh; min-height: 120px; background: #fff; border-radius: 6px; box-shadow: 0 0 0 1px var(--hair); }
.work-chat { display: flex; align-items: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--hair); }
.work-chat textarea { flex: 1; resize: none; font: inherit; font-size: 15px; line-height: 1.4; padding: 9px 14px; border: 1px solid var(--pebble); border-radius: 18px; color: var(--heading); background: var(--bg); max-height: 140px; }
.work-chat textarea:focus { outline: none; border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.work-foot { padding: 0 16px 8px; font-size: 12px; color: var(--muted); min-height: 22px; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .live.working { grid-template-columns: 1fr; grid-template-rows: minmax(130px, .55fr) minmax(0, 1.6fr); }
  .work { border-left: 0; border-top: 1px solid var(--hair); }
}

/* Mac app: the mouse arrow never changes shape over this window, so viewers can't tell you are pointing at something */
body.desktop, body.desktop * { cursor: default !important; }

/* model picker */
.model-wrap { position: relative; }
.model-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--pebble); border-radius: 9999px; background: var(--bg); color: var(--heading); font: 600 13px Inter, sans-serif; cursor: pointer; }
.model-btn:hover { background: var(--surface-2); }
.model-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 290px; max-height: 60vh; overflow: auto; background: var(--bg); border-radius: 12px; padding: 6px; box-shadow: 0 0 0 1px var(--hair), var(--shadow-lg); }
.model-group { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.model-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; }
.model-item:hover:not(:disabled) { background: var(--surface-2); }
.model-item[aria-selected="true"] { background: var(--linen); }
.model-item:disabled { cursor: default; opacity: .5; }
.model-name { font-size: 14px; font-weight: 600; color: var(--heading); }
.model-note { font-size: 12px; color: var(--muted); }
.model-btn:focus-visible, .model-item:focus-visible, .code-copy:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

/* chat attachments + screen status + wireframe zoom */
.attach { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--pebble); background: var(--bg); color: var(--forest); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.attach:hover { background: var(--linen); }
.work-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; }
.work-files:not(:empty) { padding-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; font-size: 12px; font-weight: 600; padding: 4px 6px 4px 12px; border-radius: 9999px; background: var(--linen); color: var(--forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 4px; }
.convo-title.seeing { color: var(--forest); font-weight: 700; }
.convo-title.seeing::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2f7d0b; margin-right: 6px; vertical-align: 1px; }
.convo-title.bad { color: var(--alarm); font-weight: 700; }
.wire { cursor: zoom-in; }
.wire.zoom { cursor: zoom-out; text-align: left; }
.wire.zoom img { max-width: none; max-height: none; height: 620px; }

/* code mode, left column: what they asked + what to say */
.saycol { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface-2); }
.say-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.say-title { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.say-feed { flex: 1; min-height: 0; overflow: auto; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.say-empty { color: var(--muted); font-size: 14px; margin: 0; }
.say-card { border-radius: 14px; padding: 12px 14px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--hair); }
.say-q { font-size: 13px; line-height: 1.4; color: var(--signal); margin-bottom: 6px; }
.say-q::before { content: "They: "; font-weight: 700; }
.say-a { font-size: 14px; line-height: 1.45; color: var(--text); }
.say-a.wait { color: var(--muted); animation: workpulse 1.2s ease-in-out infinite; }
.say-card.now { background: var(--forest); box-shadow: none; }
.say-card.now .say-q { color: var(--lime); }
.say-card.now .say-a { color: #fff; font-size: 17px; font-weight: 500; }
.say-card.now .say-a.wait { color: rgba(255,255,255,.6); }

/* Calls / Knowledge switch, inside the card under the description */
.tabs.in-card { display: flex; width: fit-content; margin: 14px 0 18px; }

/* stop button + answer kinds */
.pill.stop { border-color: var(--alarm); color: var(--alarm); background: var(--bg); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.pill.stop:hover { background: var(--danger-soft); }
.stop-sq { width: 10px; height: 10px; border-radius: 2px; background: var(--alarm); }
.work-kind.analyze { background: #fdf0d5; color: #7a4d06; }
.work-kind.screen { background: var(--forest); color: var(--lime); }

/* conversation screen: the card fills the space, tidy toolbar, ask box at the bottom */
.prompter { gap: 14px; }
.prompt-card { flex: 1; min-height: 240px; display: flex; flex-direction: column; overflow: auto; }
.prompt { flex: 1; }
.actions { margin-top: 0; flex-wrap: wrap; gap: 8px; }
.actions .pill { white-space: nowrap; padding: 9px 16px; font-size: 14px; }
.actions .latency { flex-basis: auto; }
.ask-bar { display: flex; gap: 8px; align-items: center; }
.ask-bar input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 10px 16px; border: 1px solid var(--pebble); border-radius: 9999px; color: var(--heading); background: var(--bg); }
.ask-bar input:focus { outline: none; border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.prompter .error:empty { display: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--pebble); background: var(--bg); color: var(--forest); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--linen); }

/* Agent page */
/* the task box: text on top, tools along the bottom */
.agent-box { border: 1px solid var(--pebble); border-radius: 16px; background: var(--bg); transition: border-color .12s, box-shadow .12s; }
.agent-box:focus-within { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
#agentTask { display: block; width: 100%; font: inherit; font-size: 16px; line-height: 1.5; padding: 14px 16px 6px; border: 0; border-radius: 16px 16px 0 0; color: var(--heading); background: transparent; resize: vertical; min-height: 84px; }
#agentTask:focus { outline: none; box-shadow: none; }
.agent-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px 10px; }
.agent-tools .spacer { flex: 1; }
.agent-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.agent-hint { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
.agent-hint b { color: var(--heading); }
/* pop-up menu button, in the style of a Mac pop-up button */
.pick { position: relative; }
.pick-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface-2); color: var(--heading); font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; }
.pick-btn:hover { background: var(--fog); }
.pick-btn[aria-expanded="true"] { border-color: var(--forest); background: var(--bg); }
.pick-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.pick-icon { flex: none; width: 16px; height: 16px; color: var(--forest); }
.pick-chev { flex: none; margin-left: 2px; color: var(--muted); }
.pick-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: 300px; max-height: min(420px, 60vh); overflow: auto; padding: 6px; border-radius: 14px; background: var(--bg);
  box-shadow: 0 0 0 1px var(--hair), 0 12px 32px rgba(14, 15, 12, .16); }
.pick-menu.narrow { width: 250px; }
.pick-group { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.pick-group:not(:first-child) { margin-top: 4px; border-top: 1px solid var(--hair); }
.pick-group img { width: 14px; height: 14px; }
.pick-group .pick-tag { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); font-weight: 500; letter-spacing: 0; }
.pick-item { display: grid; grid-template-columns: 1fr 18px; align-items: center; column-gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; cursor: pointer; }
.pick-item:hover, .pick-item:focus-visible { background: var(--surface-2); outline: none; }
.pick-item-name { font-size: 14px; font-weight: 600; color: var(--heading); }
.pick-item-note { grid-column: 1; font-size: 12px; color: var(--muted); }
.pick-item::after { content: ""; grid-column: 2; grid-row: 1 / span 2; width: 12px; height: 6px; border-left: 2.5px solid var(--forest); border-bottom: 2.5px solid var(--forest); transform: rotate(-45deg) translateY(-2px); opacity: 0; }
.pick-item[aria-selected="true"] { background: var(--linen); }
.pick-item[aria-selected="true"]::after { opacity: 1; }
/* the two switches under the box */
.agent-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.agent-opt { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 14px; background: var(--bg); font-weight: 400; cursor: pointer; }
.agent-opt:hover { border-color: var(--pebble); }
.agent-opt input { margin-top: 2px; }
.agent-opt b { display: block; font-size: 14px; font-weight: 600; color: var(--heading); }
.agent-opt small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.agent-opt:has(input:checked) { border-color: var(--lime); background: #f6fdf1; }
.ready { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 13px; color: var(--muted); }
.ready-title { margin-right: 4px; }
.ready-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid #f1b5b8; background: #fdecec; font: inherit; font-weight: 600; color: #a11b22; cursor: pointer; }
.ready-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--alarm); }
.ready-chip.ok { background: var(--lime); border-color: var(--lime); color: var(--forest); }
.ready-chip.ok::before { background: #0f7a2e; }
.ready-chip:hover { filter: brightness(0.97); }
.agent-bypass-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: #fdecec; color: #a11b22; font-size: 13px; line-height: 1.4; }
.agent-mem { margin: 12px 2px 0; font-size: 13px; color: var(--muted); }
.agent-forget { border: 0; background: none; padding: 0; font: inherit; color: var(--heading); text-decoration: underline; cursor: pointer; }
.agent-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 10px;
  max-width: min(760px, calc(100vw - 32px)); padding: 8px 10px 8px 14px; border-radius: 999px; background: #fff; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 6px 24px rgba(0,0,0,.14); font-size: 14px; }
.agent-bar.asking { border-radius: 16px; flex-wrap: wrap; }
.agent-bar-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #9fe870; box-shadow: 0 0 0 3px rgba(159,232,112,.35); }
.agent-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-bar.asking .agent-bar-text { white-space: normal; flex: 1 1 100%; }
.agent-bar input { flex: 1; min-width: 120px; padding: 6px 10px; border-radius: 10px; border: 1px solid rgba(0,0,0,.18); font: inherit; }
.agent-rules { margin: 18px 0 0; padding: 14px 18px 14px 34px; border-radius: 12px; background: var(--surface-2); font-size: 14px; line-height: 1.5; color: var(--text); }
.agent-rules li { margin: 2px 0; }
.agent-note { padding: 12px 16px; border-radius: 12px; background: #fdf0d5; color: #7a4d06; font-size: 14px; }
.agent-result { margin-top: 16px; padding: 14px 18px; border-radius: 12px; background: var(--linen); color: var(--forest); font-size: 15px; line-height: 1.5; white-space: pre-wrap; }
.agent-result.stopped { background: var(--danger-soft); color: var(--alarm); }
.agent-log { margin: 14px 0 0; padding: 0 0 0 26px; font-size: 14px; line-height: 1.5; color: var(--text); max-height: 280px; overflow: auto; }
.agent-log li { margin: 3px 0; }
.agent-log li.say { list-style: none; margin-left: -26px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--heading); }
.agent-log li.warn { list-style: none; margin-left: -26px; color: var(--alarm); }

.agent-ask { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: var(--forest); }
.agent-ask-text { margin: 0 0 12px; font-size: 17px; line-height: 1.45; font-weight: 500; color: #fff; }
.agent-ask input { flex: 1; min-width: 180px; font: inherit; font-size: 15px; padding: 10px 16px; border: 0; border-radius: 9999px; color: var(--heading); background: #fff; }
.agent-ask .agent-row { margin-top: 0; }

/* ---------- Costs page ---------- */
.cost-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.cost-tile { padding: 16px 18px; border-radius: 16px; background: var(--surface-2); }
.cost-tile.now { background: var(--forest); }
.cost-tile.now .cost-tile-label, .cost-tile.now .cost-tile-sub { color: #cfe9bf; }
.cost-tile.now .cost-tile-num { color: var(--lime); }
.cost-tile-label { font-size: 13px; color: var(--muted); }
.cost-tile-num { margin-top: 4px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--heading); font-variant-numeric: tabular-nums; }
.cost-tile-sub { margin-top: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cost-h { margin: 26px 0 10px; font-size: 16px; font-weight: 700; color: var(--heading); }
.cost-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cost-head .pill { margin-top: 16px; }
.cost-bar { display: grid; grid-template-columns: minmax(150px, 240px) 1fr auto; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; }
.cost-bar-name { color: var(--heading); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-bar-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cost-bar-fill { height: 100%; min-width: 3px; border-radius: 999px; background: var(--forest); }
.cost-bar-num { font-variant-numeric: tabular-nums; color: var(--heading); white-space: nowrap; }
.cost-bar-num small { color: var(--muted); font-size: 12px; }
.cost-session { border: 1px solid var(--hair); border-radius: 14px; margin-bottom: 10px; background: var(--bg); overflow: hidden; }
.cost-session[open] { border-color: var(--pebble); }
.cost-session summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.cost-session summary::-webkit-details-marker { display: none; }
.cost-kind { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--linen); color: var(--forest); white-space: nowrap; }
.cost-kind.agent { background: #e6eefc; color: #1d3f8a; }
.cost-kind.other { background: var(--surface-2); color: var(--text); }
.cost-kind.live { background: var(--lime); color: var(--forest); }
.cost-s-title { min-width: 0; }
.cost-s-name { font-size: 14px; font-weight: 600; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-s-meta { font-size: 12px; color: var(--muted); }
.cost-s-total { text-align: right; font-variant-numeric: tabular-nums; }
.cost-s-total b { display: block; font-size: 16px; color: var(--heading); }
.cost-s-total small { font-size: 12px; color: var(--muted); }
.cost-detail { padding: 4px 16px 16px; border-top: 1px solid var(--hair); }
.cost-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.cost-table th { text-align: right; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
.cost-table th:first-child, .cost-table td:first-child { text-align: left; padding-left: 0; }
.cost-table td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--surface-2); color: var(--text); vertical-align: top; }
.cost-table td:last-child, .cost-table th:last-child { padding-right: 0; }
.cost-table td b { color: var(--heading); }
.cost-table .svc { display: block; font-size: 12px; color: var(--muted); }
.cost-table tfoot td { border-bottom: 0; font-weight: 700; color: var(--heading); }
.cost-wrap { overflow-x: auto; }
.cost-steps { margin: 12px 0 0; padding: 10px 14px 10px 30px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--text); max-height: 180px; overflow: auto; }
.cost-steps-h { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--heading); }
.cost-empty { padding: 22px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 14px; text-align: center; }
.cost-rates { margin-top: 18px; font-size: 13px; color: var(--text); }
.cost-rates summary { cursor: pointer; font-weight: 600; color: var(--heading); }
.cost-line { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; color: var(--heading); font-variant-numeric: tabular-nums; }

/* accounts: real balance read from each provider */
.cost-account { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; margin-bottom: 12px; border: 1px solid var(--hair); border-radius: 16px; background: var(--bg); }
.cost-account img { width: 28px; height: 28px; }
.cost-acc-name { font-size: 15px; font-weight: 700; color: var(--heading); }
.cost-acc-plan { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--lime); color: var(--forest); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.cost-acc-meta { margin-top: 3px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cost-acc-meta b { color: var(--heading); }
.cost-acc-track { height: 8px; margin-top: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cost-acc-fill { height: 100%; border-radius: 999px; background: var(--lime); }
.cost-acc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cost-acc-num b { display: block; font-size: 22px; letter-spacing: -.01em; color: var(--heading); }
.cost-acc-num small { font-size: 12px; color: var(--muted); }
/* loading: soft moving blocks while the numbers are fetched */
@keyframes costShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.cost-skel { border-radius: 14px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--fog) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: costShimmer 1.2s ease-in-out infinite; }
.cost-skel.tile { height: 104px; }
.cost-skel.row { height: 58px; margin-bottom: 10px; }
.cost-skel.bar { height: 14px; margin: 12px 0; }
.spin { display: none; width: 12px; height: 12px; margin-right: 8px; border: 2px solid var(--pebble); border-top-color: var(--forest); border-radius: 50%; vertical-align: -1px; animation: costSpin .7s linear infinite; }
@keyframes costSpin { to { transform: rotate(360deg); } }
#costRefresh.busy .spin { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .cost-skel, .spin { animation: none; } }
#costModels .cost-table th, #costModels .cost-table td { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
#costModels .cost-table th:first-child, #costModels .cost-table td:first-child { padding-left: 0; }

/* ---------- Costs page, clean version ---------- */
#costs .card.wide { max-width: 980px; }
.cost-tiles { gap: 14px; margin: 10px 0 0; }
.cost-tile { padding: 20px 22px; border-radius: 18px; }
.cost-tile-num { font-size: 34px; }
.cost-h { margin: 34px 0 14px; }
.cost-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cost-account { display: block; margin: 0; padding: 18px 20px; border-radius: 18px; }
.cost-acc-head { display: flex; align-items: center; gap: 10px; }
.cost-acc-head img { width: 22px; height: 22px; }
.cost-acc-name { font-size: 15px; font-weight: 700; color: var(--heading); }
.cost-acc-plan { margin-left: auto; vertical-align: 0; }
.cost-acc-plan.warn { background: #ffe9b8; color: #7a4d06; }
.cost-acc-big { margin-top: 16px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--heading); font-variant-numeric: tabular-nums; }
.cost-acc-sub { margin-top: 2px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cost-acc-track { margin-top: 14px; }
.cost-acc-end { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--spruce); }
.cost-acc-end.warn { color: #9a5b00; }
.cost-acc-end::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: currentColor; }
.cost-acc-more { margin-top: 10px; font-size: 13px; color: var(--muted); }
.cost-acc-more summary { cursor: pointer; color: var(--heading); font-weight: 600; }
.cost-acc-more p { margin: 6px 0 0; line-height: 1.45; }
.cost-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 40px; }
.cost-days { position: relative; }
.cost-peak { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cost-plot { display: flex; align-items: flex-end; gap: 2px; height: 150px; margin-top: 8px; border-bottom: 1px solid var(--hair); }
.cost-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.cost-col:hover { background: var(--surface-2); }
.cost-col-bar { width: 100%; max-width: 18px; border-radius: 4px 4px 0 0; background: #5a8f3c; }
.cost-col-bar.today { background: var(--forest); }
.cost-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.cost-tip { position: absolute; top: 22px; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; background: var(--obsidian); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.cost-tip b { font-size: 13px; }
.cost-bar { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; }
.cost-bar-track { grid-column: 1 / -1; grid-row: 2; height: 8px; }
.cost-bar-fill { background: #5a8f3c; }
.cost-more { margin-top: 26px; padding: 14px 18px; border-radius: 14px; background: var(--surface-2); }
.cost-more summary { cursor: pointer; font-weight: 600; color: var(--heading); }
.cost-more .cost-table { margin-top: 12px; }
.cost-session { border-radius: 16px; margin-bottom: 12px; }
.cost-session summary { padding: 16px 18px; }
.cost-rates { margin-top: 26px; }

/* ---------- home page: two columns ---------- */
.card.roomy { max-width: 1040px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-head h1 { margin: 0; }
.where-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--linen); color: var(--forest); font-size: 14px; font-weight: 600; white-space: nowrap; }
.where-flag { font-size: 20px; line-height: 1; }
.setup-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-top: 22px; align-items: start; }
.setup-col { padding: 22px; border: 1px solid var(--hair); border-radius: 20px; background: var(--bg); }
.setup-col.tinted { background: #f6fdf1; border-color: #d6efc4; }
.setup-col > label:first-of-type { margin-top: 18px; }
.col-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: 15px; font-weight: 700; color: var(--heading); }
.col-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 13px; }
.setup-col .steps { text-align: left; }

/* ---------- Costs page: wider, with colour and boxes ---------- */
#costs .card.wide { max-width: 1240px; padding: 40px 44px; }
.cost-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cost-tile:nth-child(2) { background: var(--linen); }
.cost-tile:nth-child(3) { background: #eaf1ff; }
.cost-tile:nth-child(3) .cost-tile-num { color: #14306e; }
.cost-accounts { gap: 18px; }
.cost-account { padding: 22px 24px; border: 0; box-shadow: inset 0 0 0 1px var(--hair); }
.cost-account:nth-child(1) { background: #fff5ee; box-shadow: inset 0 0 0 1px #f6d9c6; }
.cost-account:nth-child(2) { background: #f1fbef; box-shadow: inset 0 0 0 1px #cfeac6; }
.cost-account:nth-child(3) { background: #fff9e8; box-shadow: inset 0 0 0 1px #f3e2ae; }
.cost-acc-track { background: rgba(14, 15, 12, .08); }
.cost-two { gap: 18px; margin-top: 34px; }
.cost-two > section { padding: 22px 24px 24px; border: 1px solid var(--hair); border-radius: 20px; background: var(--bg); }
.cost-two .cost-h { margin-top: 0; }
.cost-plot { height: 170px; }
.cost-session summary { padding: 18px 22px; }
.cost-detail { padding: 6px 22px 20px; }
@media (max-width: 720px) { .cost-tiles { grid-template-columns: 1fr; } #costs .card.wide { padding: 28px 22px; } }

/* menu items with the app's own icon */
.pick-icon.big { width: 20px; height: 20px; }
.pick-item.with-icon { grid-template-columns: 28px 1fr 18px; }
.pick-item.with-icon .pick-item-icon { grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 6px; }
.pick-item.with-icon .pick-item-name, .pick-item.with-icon .pick-item-note { grid-column: 2; }
.pick-item.with-icon::after { grid-column: 3; }

/* ready chips, Mac style: white, thin coloured border, dark text, a coloured dot */
.ready-chip { background: #fff; border: 1px solid #e3a3a8; color: var(--heading); font-weight: 500; padding: 5px 12px 5px 10px; box-shadow: 0 1px 1px rgba(14, 15, 12, .04); }
.ready-chip::before { background: #d92d2d; box-shadow: 0 0 0 3px rgba(217, 45, 45, .14); }
.ready-chip.ok { background: #fff; border-color: #5fbf4a; color: var(--heading); }
.ready-chip.ok::before { background: #2fa836; box-shadow: 0 0 0 3px rgba(47, 168, 54, .16); }
.ready-chip:hover { filter: none; background: var(--surface-2); }
.agent-result-title { display: block; margin-bottom: 8px; font-size: 16px; }

/* ---------- suggestion card before a task starts ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(14, 15, 12, .38); backdrop-filter: blur(6px); }
.sheet-back.hidden { display: none; }
.sheet { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 30px 32px 22px; border-radius: 26px; background: var(--bg); box-shadow: 0 24px 80px rgba(14, 15, 12, .3); animation: sheetIn .18s ease-out; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-kicker { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--linen); color: var(--forest); font-size: 13px; font-weight: 600; }
.sheet-kicker.complex { background: #eaf1ff; color: #14306e; }
.sheet-title { margin: 14px 0 0; font-size: 26px; letter-spacing: -.02em; color: var(--heading); }
.sheet-steps { margin: 14px 0 0; padding: 12px 16px 12px 36px; border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.55; color: var(--text); }
.sheet-steps li.more { list-style: none; margin-left: -20px; color: var(--muted); }
.sheet-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.sheet-option { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1.5px solid var(--hair); border-radius: 18px; background: var(--bg); text-align: left; font: inherit; cursor: pointer; transition: border-color .12s, transform .12s, box-shadow .12s; }
.sheet-option:hover, .sheet-option:focus-visible { border-color: var(--forest); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(14, 15, 12, .1); outline: none; }
.sheet-option.primary { border-color: var(--lime); background: #f6fdf1; }
.sheet-option-top { display: flex; align-items: center; gap: 8px; }
.sheet-option-top img { width: 20px; height: 20px; }
.sheet-option-name { font-size: 16px; font-weight: 700; color: var(--heading); }
.sheet-badge { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
.sheet-option.primary .sheet-badge { background: var(--lime); color: var(--forest); }
.sheet-option-why { font-size: 14px; line-height: 1.45; color: var(--text); }
.sheet-option-cost { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sheet-option-go { margin-top: 10px; align-self: flex-start; padding: 9px 16px; border-radius: 999px; background: var(--surface-2); color: var(--heading); font-size: 14px; font-weight: 600; }
.sheet-option.primary .sheet-option-go { background: var(--lime); color: var(--forest); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.sheet-note { font-size: 13px; color: var(--muted); }
/* pause / resume */
.pause-ic { display: inline-block; width: 10px; height: 11px; margin-right: 8px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; vertical-align: -1px; }
#agentPauseBtn.resume { background: var(--lime); border-color: var(--lime); color: var(--forest); }
#agentPauseBtn.resume .pause-ic { width: 0; height: 0; border: 0; border-left: 10px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* ---------- Agent: the live panel (while a job runs, and its result) ---------- */
.alv { margin-top: 10px; border: 1px solid var(--hair); border-radius: 20px; background: var(--bg); overflow: hidden; }
.alv-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--hair); background: var(--surface-2); }
.alv-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--pebble); }
.alv-dot.work { background: #2fa836; box-shadow: 0 0 0 4px rgba(47, 168, 54, .18); animation: livePulse 1.4s ease-in-out infinite; }
.alv-dot.pause { background: #e0a100; box-shadow: 0 0 0 4px rgba(224, 161, 0, .18); }
.alv-dot.ask { background: #1d5fd1; box-shadow: 0 0 0 4px rgba(29, 95, 209, .18); }
.alv-dot.done { background: var(--forest); }
.alv-dot.stop { background: var(--alarm); }
@keyframes livePulse { 50% { box-shadow: 0 0 0 7px rgba(47, 168, 54, .06); } }
@media (prefers-reduced-motion: reduce) { .alv-dot.work { animation: none; } }
.alv-title { flex: 1; min-width: 0; }
.alv-title b { display: block; font-size: 15px; color: var(--heading); }
.alv-title span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alv-time { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--muted); }
/* segmented control, in the Mac style */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(14, 15, 12, .07); }
.seg.hidden { display: none; }
.seg-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: #fff; color: var(--heading); font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(14, 15, 12, .12); }
.seg-btn:hover { background: #f7f8f5; }
.seg-btn:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.seg-btn .pause-ic { margin-right: 0; width: 8px; height: 10px; border-left-width: 3px; border-right-width: 3px; }
.seg-btn.resume { background: var(--lime); color: var(--forest); }
.seg-btn.resume .pause-ic { width: 0; height: 0; border: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.seg-btn.danger { color: #b3211f; }
.seg-btn.danger .stop-sq { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.alv-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 0; }
.alv-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; color: var(--heading); }
.alv-chip small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.alv-activity { margin: 12px 18px 0; }
.alv-activity summary { cursor: pointer; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; }
.alv-activity summary::-webkit-details-marker { display: none; }
.alv-activity summary::before { content: "▸"; display: inline-block; width: 14px; transition: transform .12s; }
.alv-activity[open] summary::before { transform: rotate(90deg); }
.alv-thread { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; padding: 4px 2px 10px; }
.alv .t-row { display: flex; gap: 10px; font-size: 14px; line-height: 1.45; }
.alv .t-text { white-space: pre-wrap; min-width: 0; overflow-wrap: anywhere; }
.alv .t-step { color: var(--text); padding: 2px 0 2px 2px; }
.alv .t-n { flex: none; width: 26px; text-align: right; color: var(--faint); font-variant-numeric: tabular-nums; }
.alv .t-say, .alv .t-ask, .alv .t-warn { align-self: flex-start; max-width: 86%; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 4px 16px 16px 16px; background: var(--surface-2); color: var(--heading); }
.alv .t-who { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.alv .t-ask { background: #eaf1ff; }
.alv .t-ask .t-who { color: #1d5fd1; }
.alv .t-warn { background: #fdecec; }
.alv .t-warn .t-who { color: #b3211f; }
.alv .t-me { align-self: flex-end; max-width: 80%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: var(--forest); color: #fff; }
.alv .agent-ask { margin: 12px 18px 0; background: #eaf1ff; border: 1px solid #c9dafc; }
.alv .agent-ask-label { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #1d5fd1; }
.alv .agent-ask-text { color: var(--heading); font-size: 16px; }
.alv .agent-ask input { border: 1px solid #c9dafc; }
.alv-chat { display: flex; gap: 10px; align-items: center; margin: 14px 18px 0; padding: 6px 6px 6px 16px; border: 1px solid var(--pebble); border-radius: 999px; background: var(--bg); }
.alv-chat.hidden { display: none; }
.alv-chat:focus-within { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.alv-chat input { flex: 1; min-width: 0; border: 0; padding: 8px 0; background: transparent; font-size: 15px; }
.alv-chat input:focus { outline: none; box-shadow: none; }
.alv .agent-hint { margin: 10px 18px 16px; min-height: 4px; }
.alv.finished .agent-hint { display: none; }
.alv.finished .alv-activity { margin-bottom: 14px; }
/* the result card */
.done { margin: 16px 18px 0; padding: 20px 22px; border-radius: 18px; background: #f6fdf1; box-shadow: inset 0 0 0 1px #d6efc4; }
.done.hidden { display: none; }
.done-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.done-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--lime); color: var(--forest); font-size: 14px; font-weight: 700; }
.done-badge::before { content: "✓"; }
.done-badge.stopped { background: #ffe9b8; color: #7a4d06; }
.done-badge.stopped::before { content: "■"; font-size: 10px; }
.done:has(.done-badge.stopped) { background: #fffaf0; box-shadow: inset 0 0 0 1px #f3e2ae; }
.done-stats { display: flex; gap: 22px; }
.done-stat small { display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.done-stat b { font-size: 17px; color: var(--heading); font-variant-numeric: tabular-nums; }
.done-body { margin-top: 16px; font-size: 15px; line-height: 1.55; color: var(--heading); overflow-wrap: anywhere; }
.done-body p { margin: 0 0 10px; }
.done-body ul, .done-body ol { margin: 0 0 10px; padding-left: 22px; }
.done .cost-line { margin-top: 12px; background: rgba(14, 15, 12, .05); font-size: 13px; color: var(--text); }

/* the model menu inside the live panel */
.alv-chips { align-items: center; }
.alv-chips-inner { display: contents; }
.pick-btn.small { height: 30px; padding: 0 8px 0 10px; border-radius: 8px; font-size: 13px; }

.seg { gap: 10px; background: none; padding: 0; }
.seg-btn { border: 1px solid var(--hair); box-shadow: 0 1px 2px rgba(14, 15, 12, .08); }
#agentPauseBtn { min-width: 104px; justify-content: center; }
.seg-btn.danger { border-color: #f1b5b8; }

/* files added for the agent */
.pick-btn.attach { gap: 6px; }
.pick-btn.attach svg { color: var(--forest); }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px; }
.file-chips:empty { display: none; }
.file-chips.in-live { margin: 12px 18px 0; padding: 0; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 5px 6px 5px 10px; border-radius: 10px; background: var(--linen); color: var(--forest); font-size: 13px; }
.file-kind { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-x { flex: none; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(22, 51, 0, .12); color: var(--forest); font-size: 14px; line-height: 1; cursor: pointer; }
.file-x:hover { background: rgba(22, 51, 0, .22); }
.chat-attach { order: -1; flex: none; display: grid; place-items: center; width: 34px; height: 34px; margin-left: -8px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--forest); cursor: pointer; }
.chat-attach:hover { background: var(--fog); }

/* the fast chat opened by itself (no call) */
.head-chat { margin-left: auto; align-self: center; }
.live.solo { grid-template-columns: 1fr; }
.live.solo > .saycol { display: none; }
.live.solo > .work { border-left: 0; width: 100%; max-width: 1100px; margin: 0 auto; }

/* the knowledge folder of the session */
.lib { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 18px 0; padding: 10px 12px; border-radius: 12px; background: #f6fdf1; box-shadow: inset 0 0 0 1px #d6efc4; }
.lib.hidden { display: none; }
.lib-title { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--spruce); margin-right: 4px; }
.lib-chip { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 10px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px #d6efc4; font-size: 13px; color: var(--heading); }
/* your own messages in the live chat: white text on the dark green bubble */
.alv .t-row.t-me, .alv .t-row.t-me .t-text { color: #fff; }
/* the Add files button keeps its own width */
.pick-btn.attach { flex: none; width: max-content; min-width: max-content; padding: 0 12px; }
.pick-btn.attach svg { flex: none; width: 16px; height: 16px; }
.pick-btn.attach span { flex: none; }

/* ---------- playbooks ---------- */
.pb { margin: 30px 0 26px; padding: 22px 24px; border: 1px solid var(--hair); border-radius: 20px; background: #f6fdf1; }
.pb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pb-title { margin: 0; font-size: 18px; color: var(--heading); }
.pb-sub { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--text); max-width: 560px; }
.pb-list { display: grid; gap: 10px; margin-top: 16px; }
.pb-empty { padding: 16px; border-radius: 12px; background: #fff; color: var(--muted); font-size: 14px; }
.pb-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px #d6efc4; }
.pb-card-text { min-width: 0; display: grid; gap: 2px; }
.pb-card-text b { font-size: 15px; color: var(--heading); }
.pb-card-text span { font-size: 13px; color: var(--text); }
.pb-card-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-form { margin-top: 16px; padding: 18px 20px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #d6efc4; }
.pb-form.hidden { display: none; }
.pb-form label { margin: 14px 0 6px; }
.pb-form label:first-of-type { margin-top: 0; }
.pb-form textarea { width: 100%; font: inherit; font-size: 15px; line-height: 1.5; padding: 12px 16px; border: 1px solid var(--pebble); border-radius: 10px; resize: vertical; }
.pb-form .file-chips { padding: 0; margin-top: 12px; }
.pb-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.pb-actions .spacer { flex: 1; }

/* ---------- the task brief ---------- */
.brief-row { display: flex; align-items: center; gap: 12px; padding: 4px 16px 10px; border-top: 1px dashed var(--hair); margin-top: 4px; }
.brief-row label { flex: none; margin: 0; font-size: 13px; font-weight: 700; color: var(--spruce); }
.brief-row input { flex: 1; min-width: 0; border: 0; border-radius: 0; padding: 8px 0; background: transparent; font-size: 15px; }
.brief-row input:focus { outline: none; box-shadow: none; }
.brief-more { margin-top: 12px; border: 1px solid var(--hair); border-radius: 14px; background: var(--bg); }
.brief-more summary { padding: 12px 16px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--heading); list-style: none; }
.brief-more summary::-webkit-details-marker { display: none; }
.brief-more summary::before { content: "+"; display: inline-block; width: 18px; color: var(--spruce); font-weight: 700; }
.brief-more[open] summary::before { content: "−"; }
.brief-more summary span { margin-left: 6px; font-weight: 400; font-size: 12px; color: var(--muted); }
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 16px; padding: 4px 16px 6px; }
.brief-field label { margin: 0 0 6px; font-size: 13px; }
.brief-field input { font-size: 14px; padding: 10px 14px; }
.brief-unsure { display: flex; align-items: center; gap: 10px; padding: 12px 16px 16px; font-size: 13px; color: var(--muted); }
.brief-unsure .seg-btn.on { background: var(--lime); border-color: var(--lime); color: var(--forest); }
/* file chips: role and note */
.file-chip { position: relative; max-width: none; }
.file-role { border: 0; padding: 3px 9px; border-radius: 8px; background: #fff; color: var(--forest); font: 600 12px/1.2 inherit; font-family: inherit; cursor: pointer; white-space: nowrap; box-shadow: 0 0 0 1px #cfe9bf; }
.file-role::after { content: " ▾"; opacity: .6; }
.file-role-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; width: 250px; padding: 6px; border-radius: 12px; background: var(--bg); box-shadow: 0 0 0 1px var(--hair), 0 12px 28px rgba(14, 15, 12, .16); display: grid; gap: 2px; }
.file-role-menu.hidden { display: none; }
.file-role-menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--heading); cursor: pointer; }
.file-role-menu button:hover { background: var(--surface-2); }
.file-role-menu button.on { background: var(--linen); font-weight: 600; }
.file-role-menu .file-note { margin-top: 4px; font-size: 13px; padding: 8px 10px; border-radius: 8px; }
/* quick actions in the chat */
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 18px 0; }
.quick.hidden { display: none; }
.quick-chip { border: 1px solid var(--hair); border-radius: 999px; padding: 6px 14px; background: var(--bg); color: var(--heading); font: 500 13px/1.2 inherit; font-family: inherit; cursor: pointer; }
.quick-chip:hover { border-color: var(--forest); background: var(--surface-2); }
.quick-chip.good { background: var(--lime); border-color: var(--lime); color: var(--forest); font-weight: 600; }
.file-role.unset { color: var(--muted); font-weight: 500; }
.file-chip { overflow: visible; }
.file-chip .file-name { max-width: 180px; }
.file-chip button.file-role { font-size: 12px; font-weight: 600; line-height: 1.2; padding: 3px 9px; }
.file-role-menu button { font-size: 14px; padding: 8px 10px; }
.file-role-menu .file-note { width: 100%; box-sizing: border-box; }
.file-chips { padding-bottom: 8px; }

/* ---------- starters, the correction box, send-when ---------- */
.starters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 12px; }
.starters > span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.starter { border: 1px solid var(--hair); border-radius: 999px; padding: 6px 13px; background: var(--bg); color: var(--heading); font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; }
.starter:hover { border-color: var(--forest); background: var(--surface-2); }
.sheet-fix-label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--heading); }
.sheet-fix { width: 100%; box-sizing: border-box; font-size: 14px; padding: 10px 14px; border-radius: 12px; resize: vertical; }
.chat-when { flex: none; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.chat-when.hidden { display: none; }
.chat-when button { border: 0; border-radius: 999px; padding: 6px 12px; background: none; color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.chat-when button.on { background: var(--bg); color: var(--forest); box-shadow: 0 0 0 1px var(--hair); }
.alv .t-row.t-step .t-text { flex: 1; min-width: 0; }

/* files are checked when added */
.file-problem { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 13px; line-height: 1.4; }
.file-problem span { flex: 1; }
.file-problem .file-x { border: 0; background: none; color: inherit; font-size: 16px; cursor: pointer; }
.file-info { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* the assistant's answers in the session thread */
.alv .t-row.t-assist { display: block; background: #fff; border: 1px solid var(--hair); border-radius: 14px; padding: 12px 16px; margin: 6px 0; max-width: 100%; }
.alv .t-row.t-assist .t-who { display: block; margin-bottom: 4px; color: var(--spruce); }
.alv .t-row.t-assist .t-text { display: block; font-size: 15px; line-height: 1.55; color: var(--heading); overflow-wrap: anywhere; }
.alv .t-pass { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--linen); color: var(--forest); font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.alv .t-row.t-you { color: var(--spruce); }

/* who gets the chat message */
.chat-to { flex: none; border: 1px solid var(--hair); border-radius: 999px; padding: 6px 12px; background: var(--bg); color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.chat-to.agent { background: var(--forest); border-color: var(--forest); color: #fff; }

/* copy and download on answers */
.ans-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ans-tools.whole { padding-top: 10px; border-top: 1px dashed var(--hair); }
.ans-btn { border: 1px solid var(--hair); border-radius: 999px; padding: 5px 12px; background: var(--bg); color: var(--forest); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: pointer; white-space: nowrap; }
.ans-btn:hover { border-color: var(--forest); background: var(--surface-2); }
.code-bar .ans-btn { border: 0; background: none; padding: 4px 10px; }
.alv .t-row.t-assist .t-text, .alv .done-body { user-select: text; -webkit-user-select: text; cursor: text; }

/* a file the assistant made */
.file-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 14px; background: var(--surface-2); }
.file-card-kind { flex: none; min-width: 52px; text-align: center; padding: 10px 8px; border-radius: 10px; font-size: 12px; font-weight: 800; letter-spacing: .03em; color: #fff; background: #555; }
.file-card-kind.k-excel { background: #1d7a46; } .file-card-kind.k-pdf { background: #c2362b; } .file-card-kind.k-word { background: #2b5fb4; }
.file-card-info { flex: 1; min-width: 160px; display: grid; gap: 2px; }
.file-card-info b { font-size: 15px; color: var(--heading); overflow-wrap: anywhere; }
.file-card-info small { font-size: 12px; color: var(--muted); }
.file-card .ans-tools { margin-top: 0; }

.chat-to.on { background: var(--lime); border-color: var(--lime); color: var(--forest); }
.chat-to.hidden { display: none; }

/* ---------- the Shelf ---------- */
.shelf-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border: 1.5px dashed var(--pebble); border-radius: 16px; background: var(--surface-2); }
.shelf-drop.over { border-color: var(--forest); background: var(--linen); }
.shelf-drop b { display: block; font-size: 15px; color: var(--heading); }
.shelf-drop small { font-size: 13px; color: var(--muted); }
.shelf-note { min-height: 20px; margin: 10px 2px; font-size: 13px; color: var(--spruce); }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.shelf-empty { grid-column: 1 / -1; padding: 24px 4px; }
.shelf-item { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--hair); border-radius: 16px; background: var(--bg); min-width: 0; }
.shelf-thumb { height: 140px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.shelf-thumb img, .shelf-thumb video { width: 100%; height: 100%; object-fit: contain; }
.shelf-thumb audio { width: 92%; }
.shelf-ext { font-size: 20px; font-weight: 800; letter-spacing: .04em; color: var(--muted); }
.shelf-info { display: grid; gap: 2px; min-width: 0; }
.shelf-info b { font-size: 14px; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-info small { font-size: 12px; color: var(--muted); }
.shelf-item .ans-tools { margin-top: 0; }
a.ans-btn { text-decoration: none; display: inline-block; }
/* ---------- the Browser tab ---------- */
.web-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.web-bar input { flex: 1; min-width: 0; font-size: 15px; padding: 10px 16px; border-radius: 999px; }
.web-btn { flex: none; width: 38px; height: 38px; border: 1px solid var(--hair); border-radius: 50%; background: var(--bg); color: var(--heading); font-size: 17px; line-height: 1; cursor: pointer; }
.web-btn:disabled { opacity: .35; cursor: default; }
.web-view { height: max(420px, calc(100vh - 330px)); border: 1px solid var(--hair); border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }

/* ---------- bigger answers: the session uses the room there is ---------- */
.card:has(#agentLive:not(.hidden)) { max-width: min(1500px, 97vw); }
.alv-thread { max-height: min(70vh, 1000px); }
.wire img { max-width: 100%; width: auto; height: auto; max-height: 340px; cursor: zoom-in; }
.work-answer img, .done-body img { cursor: zoom-in; max-width: 100%; }
.t-row.t-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 16px 6px; }

/* ---------- Activity log: clean, spaced, colour-coded cards ---------- */
/* Each entry reads cleanly for both Wrap and the user: more air, a colour per type, no wall of text. */
.alv-thread { gap: 12px; padding: 14px 14px 18px; }
.alv .t-row.t-say, .alv .t-row.t-brain, .alv .t-row.t-ask, .alv .t-row.t-warn {
  align-self: flex-start; max-width: 94%; flex-direction: column; gap: 3px;
  padding: 12px 15px 12px 16px; border-radius: 14px;
  border: 1px solid var(--hair); border-left: 4px solid var(--pebble);
  background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}
.alv .t-row.t-say .t-who, .alv .t-row.t-brain .t-who, .alv .t-row.t-ask .t-who, .alv .t-row.t-warn .t-who {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 2px;
}
.alv .t-row.t-say .t-who::before, .alv .t-row.t-brain .t-who::before, .alv .t-row.t-ask .t-who::before, .alv .t-row.t-warn .t-who::before {
  content: ""; width: 9px; height: 9px; border-radius: 3px; background: currentColor;
}
.alv .t-row.t-say { border-left-color: var(--spruce); }
.alv .t-row.t-say .t-who { color: var(--spruce); }
.alv .t-row.t-brain { border-left-color: #7c4dff; background: #f7f4ff; }
.alv .t-row.t-brain .t-who { color: #6a35e0; }
.alv .t-row.t-ask { border-left-color: #1d5fd1; background: #eef4ff; }
.alv .t-row.t-ask .t-who { color: #1d5fd1; }
.alv .t-row.t-warn { border-left-color: #e0a100; background: #fff8e8; }
.alv .t-row.t-warn .t-who { color: #b26a00; }
.alv .t-row.t-say .t-text, .alv .t-row.t-brain .t-text, .alv .t-row.t-ask .t-text, .alv .t-row.t-warn .t-text {
  font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--heading);
}
/* a step is a clean numbered line with a chip, not a bubble */
.alv .t-row.t-step { align-items: flex-start; gap: 10px; padding: 3px 2px; }
.alv .t-row.t-step .t-n { flex: none; width: 23px; height: 23px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.alv .t-row.t-step .t-text { color: var(--text); font-size: 14px; padding-top: 2px; }

.file-card-info.can-open { cursor: pointer; }
.file-card-info.can-open:hover b { text-decoration: underline; }
.ans-btn.strong { background: var(--forest); color: #fff; border-color: var(--forest); }

/* ---------- the preview column ---------- */
body.previewing { padding-right: 50vw; }
body.previewing.pv-wide { padding-right: 66vw; }
.pv { position: fixed; top: 0; right: 0; bottom: 0; width: 50vw; z-index: 60; display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--hair); box-shadow: -16px 0 40px rgba(14, 15, 12, .08); }
body.pv-wide .pv { width: 66vw; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--hair); background: var(--surface-2); }
.pv-name { flex: 1; min-width: 0; font-size: 15px; color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-kind { flex: none; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pv-head .ans-btn { text-decoration: none; }
.pv-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; background: #f4f5f1; }
.pv-wait { color: var(--muted); font-size: 14px; text-align: center; margin: 18px 0; }
.pv-img { display: block; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--hair); cursor: zoom-in; }
.pv-img.full { max-width: none; cursor: zoom-out; }
.pv-pdf { display: block; margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .16); }
.pv-page { width: 100%; height: 100%; min-height: 70vh; border: 0; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--hair); }
.pv-media { display: block; width: 100%; max-height: 80vh; border-radius: 8px; background: #000; }
.pv-pre { margin: 0; padding: 16px; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--hair); font: 13px/1.55 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--heading); user-select: text; -webkit-user-select: text; }
.pv-text { padding: 20px 24px; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--hair); user-select: text; -webkit-user-select: text; }
.pv-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pv-tabs button { border: 1px solid var(--hair); border-radius: 999px; padding: 6px 14px; background: #fff; color: var(--heading); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.pv-tabs button.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.pv-table { overflow: auto; max-height: calc(100vh - 150px); background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--hair); }
.pv-table table { border-collapse: collapse; font-size: 13px; }
.pv-table th, .pv-table td { border: 1px solid #e3e6df; padding: 5px 10px; white-space: nowrap; max-width: 380px; overflow: hidden; text-overflow: ellipsis; text-align: left; color: var(--heading); user-select: text; -webkit-user-select: text; }
.pv-table th { position: sticky; top: 0; z-index: 1; background: #f1f3ee; color: var(--muted); font-weight: 600; text-align: center; }
.pv-table th.rn { left: 0; z-index: 2; min-width: 40px; }
.pv-table tr:not(:first-child) th.rn { position: sticky; left: 0; top: auto; z-index: 1; }
.pv-table tr.first td { font-weight: 700; background: #f8faf5; }
.pv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Plan B: a big, clean chat ---------- */
.card.plan-card { max-width: min(1500px, 97vw); min-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.plan-thread { flex: 1; min-height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px 2px 18px; }
.plan-empty { margin: auto; text-align: center; display: grid; gap: 8px; justify-items: center; color: var(--muted); font-size: 15px; max-width: 640px; }
.plan-empty b { font-size: 20px; color: var(--heading); letter-spacing: -.02em; }
.plan-empty .quick { justify-content: center; margin-top: 10px; }
.plan-thread .t-row { display: block; padding: 0; font-size: 16px; }
.plan-thread .t-me { align-self: flex-end; max-width: 78%; padding: 12px 16px; border-radius: 18px 18px 4px 18px; background: var(--forest); }
.plan-thread .t-me .t-who { display: none; }
.plan-thread .t-me .t-text { color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; }
.plan-thread .t-warn { align-self: center; padding: 8px 14px; border-radius: 12px; background: var(--danger-soft); }
.plan-thread .t-warn .t-who { color: #b3211f; margin-right: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.plan-thread .t-assist { padding: 16px 20px; border: 1px solid var(--hair); border-radius: 18px; background: #fff; }
.plan-thread .t-assist .t-who { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--spruce); }
.plan-thread .t-assist .t-text { display: block; font-size: 16px; line-height: 1.6; color: var(--heading); overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; cursor: text; }
.plan-sent { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.plan-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 0; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hair); color: var(--heading); font-family: inherit; font-size: 13px; cursor: pointer; }
.plan-chip b { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-chip small { color: var(--muted); font-size: 12px; }
.plan-chip.shelf { background: #fdf6e3; }
.plan-chip.shelf small { color: #8a5a00; }
.plan-chip button { border: 0; background: none; padding: 0 2px; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; }
.plan-form { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: flex-end; padding: 10px 10px 10px 18px; border: 1px solid var(--pebble); border-radius: 24px; background: var(--bg); }
.plan-form:focus-within { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }
.plan-form .chat-attach { order: 0; margin: 0 0 2px -8px; }
.plan-form textarea { flex: 1; min-width: 0; border: 0; resize: none; padding: 8px 0; background: transparent; font: inherit; font-size: 16px; line-height: 1.5; max-height: 220px; color: var(--heading); }
.plan-form textarea:focus { outline: none; box-shadow: none; }
.plan-form .chat-to { margin-bottom: 6px; }
.plan-stop { display: inline-flex; align-items: center; gap: 8px; background: var(--alarm); border-color: var(--alarm); color: #fff; }
.plan-stop .stop-sq { background: #fff; }

/* the @agent quick button in the session chat */
.chat-pre { flex: none; border: 1px dashed var(--pebble); border-radius: 999px; padding: 6px 12px; background: var(--bg); color: var(--forest); font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.chat-pre:hover { background: var(--linen); }
.chat-pre.on { border-style: solid; border-color: var(--lime); background: var(--lime); }

/* the link to Wrapit's engine dropped: say so, quietly, until it is back */
body.link-lost::before { content: "Reconnecting to Wrapit…"; position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 8px 16px; border-radius: 999px; background: var(--obsidian); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); }

/* ===== responsive: the window can be any width (min 420px). Nothing breaks or spills. ===== */
/* the tab row never overflows: it scrolls sideways, pills never wrap or shrink */
.tabs { max-width: 100%; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.in-card { max-width: 100%; }
.tab { flex: 0 0 auto; white-space: nowrap; }

/* the preview column: side-by-side on a wide window, full-screen on a narrow one (Close brings the page back) */
@media (max-width: 860px) {
  body.previewing, body.previewing.pv-wide { padding-right: 0; }
  .pv, body.pv-wide .pv { width: 100vw; border-left: 0; }
  #pvWide { display: none; }
  .pv-table th, .pv-table td { max-width: 240px; }
}

/* narrow window polish: tighter cards, full-width big screens, wrapping chat rows, nothing cut off */
@media (max-width: 700px) {
  .page, .setup, .after { padding-left: 14px; padding-right: 14px; }
  .card { padding: 22px 16px; border-radius: 18px; }
  .card.wide, .card.roomy, .pb-card, .card:has(#agentLive:not(.hidden)) { max-width: 100%; }
  h1, .after-head h1 { font-size: 26px; }
  .alv-chat, .pb-form { flex-wrap: wrap; row-gap: 8px; }
  .alv-chat input, .pb-form textarea { flex: 1 1 100%; order: -1; min-width: 0; }
  .chat-to, .chat-pre, .chat-when { font-size: 12px; }
  .tiles, .cost-tiles { grid-template-columns: 1fr 1fr; }
  .alv-head { flex-wrap: wrap; row-gap: 8px; }
  .alv-head .alv-title { flex: 1 1 100%; order: 3; }
  .pick-menu, .model-menu, .ai-pop { max-width: calc(100vw - 32px); }
}
@media (max-width: 440px) {
  .tiles, .cost-tiles { grid-template-columns: 1fr; }
  .brief-grid, .agent-opts { grid-template-columns: 1fr; }
}

/* the conversation: a "jump to latest" button, shown only when you have scrolled up to read back */
.convo { position: relative; }
.scroll-latest { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 5; height: 34px; padding: 0 16px; border: 0; border-radius: 9999px; background: var(--forest); color: #fff; font: 600 13px/1 inherit; cursor: pointer; box-shadow: var(--shadow-lg); }
.scroll-latest:hover { background: var(--spruce); }
.scroll-latest.hidden { display: none; }
#callVoiceWrap b { color: var(--heading); font-weight: 600; }

/* the Mac permission badge in the top bar, on every page */
.mac-ready { position: relative; }
.mr-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--hair); border-radius: 9999px; background: var(--bg); color: var(--heading); font: 600 13px/1 inherit; cursor: pointer; white-space: nowrap; }
.mr-pill:hover { border-color: var(--pebble); }
.mac-ready.warn .mr-pill { border-color: #e6c15a; background: #fdf7e3; color: #7a5a00; }
.mr-ico { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #2fa836; color: #fff; font-size: 11px; font-weight: 800; }
.mac-ready.warn .mr-ico { background: #e0a100; }
.mr-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 300px; padding: 8px; background: var(--bg); border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--shadow-lg); }
.mr-menu-head { margin: 6px 10px 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.mr-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.mr-row:hover { background: var(--surface); }
.mr-row b { font-size: 14px; font-weight: 600; color: var(--heading); }
.mr-row small { grid-column: 2; font-size: 12px; color: var(--muted); }
.mr-dot { grid-row: 1 / 3; width: 9px; height: 9px; border-radius: 50%; background: var(--pebble); }
.mr-row.ok .mr-dot { background: #2fa836; }
.mr-row:not(.ok) .mr-dot { background: #e0a100; }
.mr-state { grid-row: 1 / 3; font-size: 12px; font-weight: 700; color: var(--muted); }
.mr-row.ok .mr-state { color: #2fa836; }
.mr-row:not(.ok) .mr-state { color: #b9850b; }
.mr-foot { margin: 8px 10px 4px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
@media (max-width: 560px) { .mr-pill span#macReadyText { display: none; } .mr-pill { padding: 0 8px; } .mr-menu { width: calc(100vw - 24px); } }

/* "Wrap on this call" settings on the pre-call screen */
.call-wrap-set { margin-top: 12px; padding: 14px; border: 1px solid var(--hair); border-radius: 16px; background: var(--surface-2); }
.call-wrap-set.hidden { display: none; }
.cws-title { font-size: 13px; font-weight: 700; color: var(--heading); margin-bottom: 10px; }
.cws-title span { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 6px; }
.call-wrap-set .agent-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.cws-kb { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.cws-kb button { border: none; background: none; padding: 0; font: inherit; color: var(--signal); font-weight: 700; text-decoration: underline; cursor: pointer; }
.cws-kb button:hover { color: var(--spruce); }
/* Wrapbot Live: Start-browser box in the live prompter */
.live-browser { display: flex; gap: 14px; align-items: center; margin: 6px 0 12px; }
.live-browser.hidden { display: none; }
.live-browser button { flex: none; }
.live-prep { font-size: 13px; color: var(--muted); min-height: 18px; }
.live-prep.ready { color: var(--spruce); font-weight: 700; }
.live-task { margin: 4px 0 16px; }
.live-task.hidden { display: none; }
.live-task label { display: block; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.live-task label span { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.live-task textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; font: 14px/1.5 inherit; font-family: inherit; color: var(--heading); background: #fff; margin-bottom: 6px; }
/* Bars you drag to make the two neighbouring columns wider or narrower */
.col-split { flex: none; width: 7px; cursor: col-resize; background: transparent; border-left: 1px solid var(--hair); touch-action: none; }
.col-split:hover, .col-split:active { background: var(--surface-2); border-left-color: var(--spruce); }
.col-split.hidden { display: none; }
/* Live session once the work screen is open: the chat with the LLM (big) | Wrap's activity. There is no left column. */
.live.working { grid-template-columns: minmax(0, 1fr); }
.live.working > .saycol, .live.working > #splitL { display: none; }
.live.working.has-act { grid-template-columns: minmax(0, 1fr) 7px min(var(--wr, 420px), 42vw); }
.live.working > .work { border-left: 0; }
.act-col { min-width: 0; min-height: 0; overflow: auto; padding: 10px 12px; background: var(--bg); }
.act-col.hidden { display: none; }
.act-col .alv { margin-top: 0; }
.act-col .alv-head { flex-wrap: wrap; gap: 8px; padding: 12px; }
.act-col .alv-title { flex: 1 1 100%; order: -1; } /* the state and the task get their own line; the buttons sit under it */
.act-col .alv-dot { order: -2; }
.act-col .alv-head { align-items: center; }
.act-col .alv-title { flex-basis: calc(100% - 30px); }
.act-col .alv-thread { max-height: none; }
.act-col .alv-split { display: flex; flex-direction: column; }
.act-col .alv-steps { order: -1; width: auto !important; max-width: none !important; max-height: 46vh; margin: 0 0 10px; } /* the live steps come first */
.act-col .alv-split > .col-split { display: none; }
.act-col .alv-chat, .act-col .agent-hint, .act-col .alv-chips, .act-col .quick, .act-col .quick-chip { display: none; }
/* Wrap's own panel (Wrapbot Self): the talk on the left, the live steps on the right, a bar between to drag */
.alv-split { display: flex; min-height: 0; }
.alv-split > #agentTalk { flex: 1; min-width: 0; }
.alv-split > .alv-steps { flex: none; width: var(--ws, 340px); max-width: 70%; background: var(--surface-2); border-radius: 12px; }
.alv-steps-title { position: sticky; top: 0; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); padding: 8px 2px 6px; margin-top: -4px; z-index: 1; }
.alv .t-row.t-step.now { background: #eaf6ec; border-radius: 8px; }
.alv .t-row.t-step.now .t-n { background: var(--spruce); color: #fff; }
.alv .t-row.t-step.now .t-text { color: var(--heading); font-weight: 600; }
/* What the LLM told Wrapbot: its own violet block in the activity log, with the picture it attached */
.alv .t-row.t-llm { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: #f7f4ff; border: 1px solid #ddd3ff; border-left: 4px solid #7c4dff; }
.alv .t-row.t-llm .t-who { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #6a35e0; }
.alv .t-row.t-llm .t-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--heading); max-height: 190px; overflow: auto; }
.alv .t-pic-note { font-size: 12px; font-weight: 700; color: #6a35e0; }
.alv .t-pic { width: 100%; max-height: 170px; object-fit: contain; object-position: left top; border: 1px solid var(--hair); border-radius: 8px; background: #fff; cursor: zoom-in; }
.alv .t-pic.big { max-height: none; cursor: zoom-out; }
body.wrap-docked #agentBarStop { display: none; } /* Stop lives in the activity panel: a Stop that pops up under the pointer was pressed by accident */
/* What they said and what to say, in the middle chat: a blue "They" banner and a green "Say" banner. The newest one is bigger. */
.say-turn { margin: 12px 0; max-width: 980px; }
.say-turn .work-asked { margin: 0 0 6px; }
.say-turn p.say { margin: 0; background: var(--linen); color: var(--forest); font-weight: 500; padding: 10px 14px; border-radius: 10px; }
.say-turn.now p.say { font-size: 18px; font-weight: 600; box-shadow: inset 0 0 0 2px var(--lime); }
.say-turn p.say.wait { opacity: .6; animation: workpulse 1.2s ease-in-out infinite; }
.second-window { position: fixed; inset: 0 0 auto 0; z-index: 99; padding: 12px 18px; background: #fff8e8; color: #7a4b00; font-weight: 600; text-align: center; border-bottom: 1px solid #e0a100; }
@media (max-width: 900px) {
  .live.working, .live.working.has-act { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .live.working.has-act { grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr); }
  .act-col { border-top: 1px solid var(--hair); }
  .live.working > .col-split { display: none; }
  .alv-split { display: block; }
  .alv-split > .alv-steps { width: auto; max-width: none; margin-top: 8px; }
}
body.wrap-docked #agentBar:not(.asking) { display: none; }

.pb.hidden, .quick-chip.hidden { display: none; }
.ask-sub { font-weight: 500; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.ask-row textarea { flex: 1; min-width: 0; resize: vertical; border: 1px solid var(--hair); border-radius: 12px; padding: 10px 14px; font: 15px/1.5 inherit; font-family: inherit; color: var(--heading); background: #fff; }
.ask-out .a-text { white-space: pre-wrap; }


/* =====================================================================================================
   DESIGN POLISH LAYER (21 Nov). Looks only: no behaviour lives here. One consistent set of components:
   type, cards, tabs, buttons, fields, pickers, banners; and every place where text used to break badly.
   ===================================================================================================== */
:root { --line: #d3d8cf; --ring: 0 0 0 3px rgba(159, 232, 112, .55); --wash: #f1faeb; }

/* ---- type ---- */
h1 { font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; overflow-wrap: anywhere; }
.sub { font-size: 14.5px; line-height: 1.5; text-wrap: pretty; }
.home-head { margin-bottom: 8px; }
.after-head { align-items: baseline; row-gap: 4px; margin-bottom: 6px; }
.after-head .sub { font-size: 14.5px; }
.hint, .sub, .steps, .kb-meta, .agent-opt small, .see-screen span, .cws-kb, .alv .t-text, .work-answer p, .say-turn p.say, .work-asked, .agent-hint, .drop span { overflow-wrap: anywhere; }
label { line-height: 1.35; }

/* ---- cards ---- */
.card { border-radius: 24px; box-shadow: 0 0 0 1px var(--hair), 0 1px 2px rgba(14, 15, 12, .04), 0 10px 28px rgba(14, 15, 12, .035); }
:where(#kb, #agent) .card.wide { max-width: 980px; } /* only these two pages: Plan B and a running session keep their own big size */

/* ---- tabs ---- */
.tabs.in-card { background: #eceee9; padding: 4px; gap: 2px; border-radius: 9999px; max-width: 100%; }
.tab { padding: 8px 16px; white-space: nowrap; transition: background .12s, color .12s; }
.tab.active { box-shadow: 0 1px 2px rgba(22, 51, 0, .18); }

/* ---- buttons ---- */
.pill { min-height: 40px; white-space: nowrap; line-height: 1.2; }
.pill.small { min-height: 32px; }
.pill.big { min-height: 54px; }
.pill.primary { box-shadow: inset 0 -1px 0 rgba(22, 51, 0, .12); }
.pill.primary:disabled { background: var(--fog); color: var(--slate); box-shadow: none; }
.pill:focus-visible, .tab:focus-visible, .seg-btn:focus-visible, .quick-chip:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--forest); }
.text-link { text-decoration-color: rgba(22, 51, 0, .35); }
.text-link:hover { text-decoration-color: var(--forest); }

/* ---- fields ---- */
input, select, textarea { border-color: var(--line); border-radius: 12px; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--pebble); }
input:focus, select:focus, textarea:focus { border-color: var(--forest); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #9a9d98; }
.ask-bar input { border-color: var(--line); }
.ask-bar input:focus { box-shadow: var(--ring); }
.agent-box { border-color: var(--line); }
.agent-box:focus-within { border-color: var(--forest); box-shadow: var(--ring); }
.see-screen { align-items: flex-start; }
.see-screen input { flex: none; margin-top: 1px; }

/* ---- pickers and chips ---- */
.pick-btn { border-color: var(--line); background: #fff; white-space: nowrap; }
.pick-btn:hover { background: var(--surface-2); border-color: var(--pebble); }
.pick-menu { border-radius: 16px; box-shadow: 0 0 0 1px var(--hair), 0 12px 32px rgba(14, 15, 12, .12); }
.quick-chip { white-space: nowrap; }

/* ---- Wrapbot Live home: the Task box ---- */
.live-task label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 20px; }
.live-task label span { margin-left: 0; font-size: 13px; line-height: 1.45; font-weight: 500; }
.live-prep { display: inline-block; }
.live-prep:empty { display: none; }
.live-prep.ready { background: var(--linen); color: var(--forest); padding: 6px 12px; border-radius: 9px; font-weight: 600; }
.call-wrap-set { border-color: var(--line); border-radius: 16px; background: #fff; }
.cws-title { margin-bottom: 12px; }

/* ---- Knowledge page ---- */
.meter-card { background: var(--surface-2); border: 1px solid var(--hair); border-radius: 14px; }
.kb-list { border-radius: 14px; }
.ask { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--hair); }
.ask > label { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--heading); }
.ask-sub { margin-left: 0; }
.ask-row { align-items: flex-end; }
.ask-row .pill { height: 46px; min-height: 46px; padding: 0 26px; align-self: flex-end; }
.ask-out { background: var(--wash); border-left-color: var(--spruce); border-radius: 12px; }
.sysprompt { border-color: var(--line); background: var(--surface-2); }
.sysprompt-right textarea { border-color: var(--line); }

/* ---- the live session ---- */
.live-browser { flex-direction: column; align-items: stretch; gap: 8px; }
.live-browser .pill.big { margin-top: 0; }
.live-browser .live-prep { align-self: center; }
.alv-steps-title { position: static; margin-top: 0; padding: 2px 2px 8px; }
.act-col .alv { border-radius: 16px; }
.say-turn .work-asked { font-size: 13.5px; }

/* ---- small screens: nothing may run out of its box ---- */
@media (max-width: 760px) {
  h1 { font-size: 28px; }
  .card { padding: 22px; border-radius: 20px; }
  .ask-row { flex-wrap: wrap; }
  .ask-row .pill { width: 100%; }
}

.agent-hint b, .cost-kind, .alv-chip { white-space: nowrap; }


/* ===================== Wrapit sidebar shell (forest/lime, 22 Nov 2026) =====================
   Left sidebar + main column, matching the live-call reference. Replaces the earlier centred-hero layer. */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { background: #fff; border-right: 1px solid var(--hair); padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; }
.side .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; font-weight: 800; font-size: 20px; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.side .brand svg { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 4px 14px rgba(159,232,112,.5); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.side .brand:hover svg { transform: rotate(-8deg) scale(1.06); }
.side .cta { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border: 0; border-radius: 999px; background: var(--lime); color: var(--forest); font-weight: 700; font-size: 15px; margin-bottom: 6px; cursor: pointer; box-shadow: 0 8px 22px rgba(159,232,112,.45); transition: transform .15s, box-shadow .15s; }
.side .cta:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(159,232,112,.6); } .side .cta:active { transform: translateY(0) scale(.99); }
.side .cta .ic { width: 18px; height: 18px; }
.side nav.tabs, .side .tabs { display: flex; flex-direction: column; gap: 2px; background: none; border: 0; padding: 0; margin: 0; box-shadow: none; }
.side .ng { margin: 14px 10px 5px; font-weight: 700; font-size: 10.5px; line-height: 1; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.side .tab { display: flex; align-items: center; gap: 11px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 11px; background: none; color: var(--text); font-weight: 500; font-size: 14.5px; cursor: pointer; text-align: left; justify-content: flex-start; transition: background .14s, color .14s; }
.side .tab svg, .side .tab .ic { width: 18px; height: 18px; flex: none; color: var(--muted); fill: none; stroke: currentColor; transition: color .14s, transform .3s; }
.side .tab span:not(.sdot):not(.snew) { flex: 1; }
.side .tab:hover { background: var(--soft); color: var(--ink); } .side .tab:hover svg { color: var(--ink); transform: translateX(1px); }
.side .tab.active { background: var(--forest); color: #fff; font-weight: 600; box-shadow: none; } .side .tab.active svg { color: var(--lime); } .side .tab.active .sdot { background: var(--lime); }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: none; margin-left: auto; }
.snew { margin-left: auto; font-size: 9.5px; font-weight: 700; letter-spacing: .05em; color: var(--spruce); background: var(--linen); padding: 2px 7px; border-radius: 99px; }
.side-status { margin-top: 12px; border: 1px solid var(--hair); border-radius: 13px; padding: 11px 12px; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); background: #fff; }
.side-status .ss-row { display: flex; align-items: center; gap: 8px; } .side-status .ss-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: none; }
.side .me { margin-top: 10px; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 13px; border: 1px solid var(--hair); background: #fff; cursor: pointer; }
.side .me .av { width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side .me .me-id { display: flex; flex-direction: column; line-height: 1.25; } .side .me b { color: var(--ink); font-size: 13.5px; } .side .me small { color: var(--muted); font-size: 12px; }

.main { min-width: 0; padding: 16px 22px 40px; display: flex; flex-direction: column; }
.wp-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.wp-top .search { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 15px; border-radius: 999px; background: #fff; border: 1px solid var(--hair); color: var(--faint); font-size: 14px; }
.wp-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* compact section layout: left-aligned small heading, 2–3 column grids, no long single-column scroll */
.page { width: 100%; max-width: 1180px; margin: 0; padding: 0; }
.headline { max-width: none; margin: 0 0 18px; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.headline h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.03em; font-weight: 800; color: var(--ink); margin: 0; }
.headline .sub, .headline p { font-size: 15px; color: var(--muted); margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; align-items: start; }
.setup-cols { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 0; }
@media (max-width: 1040px){ .app { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; } .side nav.tabs { flex-direction: row; flex-wrap: wrap; } .side .ng, .side-status, .side .me { display: none; } .grid3, .grid2, .setup-cols { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce){ .side .cta, .side .brand svg, .side .tab, .side .tab svg { transition: none; } }

/* sidebar group headers via CSS (tabs are re-sorted by app.js, so labels can't be DOM siblings) */
.side .tab { position: relative; }
.side .tab[data-view="setup"], .side .tab[data-view="agent"], .side .tab[data-view="kb"] { margin-top: 24px; }
.side .tab[data-view="setup"]::before { content: "Calls"; }
.side .tab[data-view="agent"]::before { content: "Work"; }
.side .tab[data-view="kb"]::before { content: "Account"; }
.side .tab[data-view="setup"]::before, .side .tab[data-view="agent"]::before, .side .tab[data-view="kb"]::before { position: absolute; top: -17px; left: 12px; font: 700 10.5px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); pointer-events: none; }

/* collapse toggle + responsive rails + internal card scroll (no whole-page long scroll) */
.wp-collapse { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid var(--hair); border-radius: 11px; background: #fff; color: var(--ink); cursor: pointer; }
.wp-collapse:hover { background: var(--soft); }
.app.nav-collapsed { grid-template-columns: 66px 1fr; }
.nav-collapsed .side { padding: 16px 10px; align-items: center; }
.nav-collapsed .side .brand span, .nav-collapsed .side .cta span, .nav-collapsed .side .tab span:not(.sdot):not(.snew), .nav-collapsed .side .tab .snew, .nav-collapsed .side-status, .nav-collapsed .side .me .me-id, .nav-collapsed .side .me svg, .nav-collapsed .side .tab::before { display: none; }
.nav-collapsed .side .cta { width: 44px; padding: 0; } .nav-collapsed .side .tab { justify-content: center; padding: 0; width: 44px; margin-left: auto; margin-right: auto; }
.nav-collapsed .side .tab[data-view="setup"], .nav-collapsed .side .tab[data-view="agent"], .nav-collapsed .side .tab[data-view="kb"] { margin-top: 10px; }
.nav-collapsed .side .me { justify-content: center; padding: 9px; } .nav-collapsed .side .brand { justify-content: center; padding: 6px 0 14px; }
.nav-collapsed .side .tab .sdot { position: absolute; top: 6px; right: 6px; margin: 0; }

/* every view: let flex/grid children shrink and scroll inside their own card */
.main .card, .main .panel, .main .setup-col { min-width: 0; }
.main .card .convo, .main .card .scrolls, .main [data-scroll] { min-height: 0; overflow: auto; }

/* reflow all multi-column grids to one column on narrow windows */
@media (max-width: 900px) {
  .app { grid-template-columns: 66px 1fr; }
  .side { padding: 16px 10px; align-items: center; }
  .side .brand span, .side .cta span, .side .tab span:not(.sdot):not(.snew), .side .tab .snew, .side-status, .side .me .me-id, .side .me svg, .side .tab::before { display: none; }
  .side .cta { width: 44px; padding: 0; } .side .tab { justify-content: center; padding: 0; width: 44px; margin: 2px auto; }
  .side .tab[data-view="setup"], .side .tab[data-view="agent"], .side .tab[data-view="kb"] { margin-top: 10px; }
  .side .brand { justify-content: center; padding: 6px 0 14px; } .side .me { justify-content: center; padding: 9px; }
  .grid2, .grid3, .setup-cols { grid-template-columns: 1fr; }
  .wp-collapse { display: none; }
}
@media (max-width: 560px) { .app { grid-template-columns: 1fr; } .side { display: none; } }

/* robust rail: hide ALL sidebar text (including direct text nodes like the injected Live Coach tab) via font-size:0 */
.app.nav-collapsed .side .brand, .app.nav-collapsed .side .cta, .app.nav-collapsed .side .tab { font-size: 0; }
.app.nav-collapsed .side .brand svg, .app.nav-collapsed .side .cta .ic, .app.nav-collapsed .side .tab svg { font-size: 16px; }
@media (max-width: 900px) {
  .side .brand, .side .cta, .side .tab { font-size: 0; }
  .side .brand svg, .side .cta .ic, .side .tab svg { font-size: 16px; }
  .side .cta { width: 44px; } .wp-top { gap: 10px; }
}

/* ---- Sidebar, clean single source of truth (replaces all earlier overrides) ---- */
.side { background: #fff !important; backdrop-filter: none; display: flex; flex-direction: column; }
.side, .side *, .side *::before, .side *::after { box-shadow: none !important; filter: none !important; }  /* no stray glows */
.side .brand { flex: none; }
.side .brand svg { box-shadow: none !important; }
.side nav.tabs, .side .tabs { flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; overflow: visible; }  /* tight, content height — no stretch, no spreading gaps */
.side-status, .side .me { flex: none; }
.side-status { margin-top: auto; }  /* pushes status + chip to the bottom, nav stays tight at the top */
/* active row: crisp solid forest pill (dark green used here, per Wise — nav weight) */
.side .tab::before { box-shadow: none !important; }
.side .tab.active { background: var(--forest) !important; color: #fff !important; border-radius: 11px !important; box-shadow: none !important; }
.side .tab.active svg { color: var(--lime) !important; }
.side .tab.active .sdot { background: var(--lime); }
/* collapsed / narrow rail: icons centered, tight even spacing, group gap small */
.app.nav-collapsed .side .brand, .app.nav-collapsed .side .cta, .app.nav-collapsed .side .tab { font-size: 0 !important; color: transparent !important; overflow: hidden; white-space: nowrap; }
.app.nav-collapsed .side .tab svg, .app.nav-collapsed .side .cta .ic, .app.nav-collapsed .side .brand svg { color: initial; font-size: 16px; }
.app.nav-collapsed .side .tab { justify-content: center; padding: 0 !important; width: 44px; height: 40px; margin: 2px auto !important; }
.app.nav-collapsed .side .tab[data-view="setup"], .app.nav-collapsed .side .tab[data-view="agent"], .app.nav-collapsed .side .tab[data-view="kb"] { margin-top: 12px !important; }
@media (max-width: 900px) {
  .side .brand, .side .cta, .side .tab { font-size: 0 !important; color: transparent !important; overflow: hidden; white-space: nowrap; }
  .side .brand svg, .side .cta .ic, .side .tab svg { color: initial; font-size: 16px; }
  .side .tab { justify-content: center; padding: 0 !important; width: 44px; height: 40px; margin: 2px auto !important; }
  .side .tab[data-view="setup"], .side .tab[data-view="agent"], .side .tab[data-view="kb"] { margin-top: 12px !important; }
  .side .tab::before { display: none !important; }
}

/* Browser (#web) toolbar — forest/lime */
#web .web-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
#web .web-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid var(--hair); border-radius: 11px; background: #fff; color: var(--ink); cursor: pointer; transition: background .14s; }
#web .web-btn:hover { background: var(--soft); }
#web #webUrl { flex: 1; height: 42px; border-radius: 999px; border: 1px solid var(--hair); padding: 0 16px; background: #fff; }
#web .web-view { flex: 1; min-height: 360px; border: 1px solid var(--hair); border-radius: var(--r); background: #fff; display: grid; place-items: center; box-shadow: var(--sh); overflow: hidden; }
#web .page.web-card { display: flex; flex-direction: column; height: calc(100vh - 110px); }

/* ============ View layouts: real 2–3 columns, fill height, no empty voids ============ */
.main .page { flex: 1 1 auto; min-height: 0; }

/* Plan B — chat fills, composer pinned to the bottom */
#planb .page { display: flex; flex-direction: column; gap: 14px; height: 100%; }
#planb .plan-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
#planb .plan-empty { margin: auto; max-width: 620px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#planb .plan-empty .quick { justify-content: center; }
#planb .plan-form { flex: none; }

/* Wrapbot Self (#agent) — thread fills, composer at the bottom */
#agent .page { display: flex; flex-direction: column; gap: 14px; height: 100%; }
#agent .alv-live, #agent .alv-cols, #agent .chat, #agent .work-chat-wrap { min-height: 0; }
#agent .chat, #agent .alv-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
#agent .work-chat, #agent .composer { flex: none; }

/* Knowledge — each section is a clean 2-column block, textarea fills, no long single column */
#kb .page { display: flex; flex-direction: column; gap: 22px; }
#kb .sysprompt { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: stretch; }
#kb .sysprompt-left { align-self: start; }
#kb .sysprompt-right { display: flex; }
#kb .sysprompt-right textarea { width: 100%; min-height: 320px; resize: vertical; }
#kb .kb-band { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
#kb .kb-band .meter-card { grid-column: 1 / -1; }
#kb .kb-band .drop { grid-column: 1; margin: 0; }
#kb .kb-band #kbError, #kb .kb-band .kb-list { grid-column: 2; margin-top: 0; }
#kb .kb-band .kb-list:empty::after { content: "No files yet for this tab."; color: var(--muted); font-size: 14px; }
#kb .ask .ask-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }

/* Costs — stat tiles grid + two-column detail, already close; just ensure fill + no void */
#costs .page { display: flex; flex-direction: column; gap: 18px; }
#costs .cost-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Shelf — responsive card grid */
#shelf .shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

/* Reflow every view to one column on narrow windows */
@media (max-width: 900px) {
  #kb .sysprompt, #kb .kb-band, #costs .cost-two, #kb .ask .ask-row { grid-template-columns: 1fr; }
  #kb .kb-band .drop, #kb .kb-band #kbError, #kb .kb-band .kb-list { grid-column: 1; }
}

/* ---- refinements: flex-fill only chat pages; data pages size naturally (no stretch voids) ---- */
.main .page { flex: 0 0 auto; }                 /* default: natural height, no stretched void */
#planb .page, #agent .page { flex: 1 1 auto; min-height: 0; }   /* chat pages fill so composer pins to bottom */
/* Plan B — thread + card full width */
#planb .page.plan-card { max-width: none; width: 100%; min-height: 0; }
#planb .plan-thread { width: 100%; max-width: none; align-self: stretch; }
/* empty data containers must not reserve big height */
#costs .cost-accounts:empty, #costs #costDays:empty, #costs #costBars:empty, #costs #costSessions:empty, #costs #costTiles:empty { display: none; }
#costs .cost-accounts:empty::after { content: none; }
/* Wrapbot Self message (browser-only state) shouldn't float in a void */
#agent .alv-note, #agent .only-mac, #agent .browser-only { margin-top: 4px; }

/* Knowledge: whole page is 2 columns (System prompt | Knowledge files), not stacked */
#kb .page { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-content: start; }
#kb .page > .headline, #kb .page > #kbScope, #kb .page > .kb-scope, #kb .page > .kb-scope-hint, #kb .page > p.sub { grid-column: 1 / -1; }
#kb .sysprompt.sec { grid-column: 1; display: flex !important; flex-direction: column; gap: 14px; }
#kb .sysprompt.sec .sysprompt-left, #kb .sysprompt.sec .sysprompt-right { width: auto; max-width: none; }
#kb .sysprompt.sec .sysprompt-right { flex: 1; }
#kb .sysprompt.sec .sysprompt-right textarea { height: 100%; min-height: 300px; }
#kb .sec:not(.sysprompt) { grid-column: 2; }
@media (max-width: 900px){ #kb .page { grid-template-columns: 1fr; } #kb .sysprompt.sec, #kb .sec:not(.sysprompt) { grid-column: 1; } }

/* Conversation page — clean, standard spacing (no huge gaps) */

/* Conversation page — standard form spacing, no huge gaps (24px between groups, tight label/field pairs) */
#setup .setup-col { display: block; padding: 24px; }
#setup .setup-col > * { margin: 0; }
#setup .setup-col .col-title { margin-bottom: 20px; }
#setup .setup-col .me-row { margin: 0 0 24px; }
#setup .setup-col > label, #setup .setup-col label[for="mic"], #setup .setup-col label[for="notes"] { display: block; font-weight: 600; color: var(--heading); margin: 0 0 8px; }
#setup .setup-col .search-wrap, #setup .setup-col .select-wrap, #setup .setup-col > input, #setup .setup-col > textarea, #setup .setup-col #notes { margin: 0; }
#setup .setup-col .hint, #setup .setup-col .steps { margin: 8px 0 0; }
#setup .setup-col .add-new { margin: 16px 0 0; align-self: flex-start; }
#setup .setup-col label[for="notes"] { margin-top: 24px; }
#setup .setup-col #startBtn { margin-top: 24px; width: 100%; }
#setup .setup-col .see-screen { margin-top: 16px; }
#setup .headline .purpose { max-width: 70ch; color: var(--muted); font-size: 15px; line-height: 1.55; margin-top: 6px; }
#setup .headline .kb-meta:empty { display: none; }
/* group label+field as a tight pair */
#setup .setup-col .field-group { display: flex; flex-direction: column; gap: 8px; }

/* ===== Sidebar rail (collapsed toggle OR narrow ≤900px): one clean centred column ===== */
/* every item is a 44x44 centred button; the status dot becomes a small badge on the icon */
.app.nav-collapsed .side .tab, .app.nav-collapsed .side .cta {
  width: 44px !important; height: 44px !important; padding: 0 !important; margin: 4px auto !important;
  display: flex !important; align-items: center !important; justify-content: center !important; border-radius: 13px !important; position: relative;
}
.app.nav-collapsed .side .tab .sdot { position: absolute !important; top: 6px; right: 6px; margin: 0 !important; width: 7px; height: 7px; }
.app.nav-collapsed .side .tab .snew { display: none !important; }
.app.nav-collapsed .side .tab svg, .app.nav-collapsed .side .cta .ic { margin: 0 !important; }
.app.nav-collapsed .side .brand { justify-content: center !important; padding: 6px 0 14px !important; }
.app.nav-collapsed .side .tab[data-view="setup"], .app.nav-collapsed .side .tab[data-view="agent"], .app.nav-collapsed .side .tab[data-view="kb"] { margin-top: 14px !important; }
@media (max-width: 900px) {
  .side .tab, .side .cta {
    width: 44px !important; height: 44px !important; padding: 0 !important; margin: 4px auto !important;
    display: flex !important; align-items: center !important; justify-content: center !important; border-radius: 13px !important; position: relative;
  }
  .side .tab .sdot { position: absolute !important; top: 6px; right: 6px; margin: 0 !important; width: 7px; height: 7px; }
  .side .tab .snew { display: none !important; }
  .side .tab svg, .side .cta .ic { margin: 0 !important; }
  .side .brand { justify-content: center !important; padding: 6px 0 14px !important; }
  .side .tab[data-view="setup"], .side .tab[data-view="agent"], .side .tab[data-view="kb"] { margin-top: 14px !important; }
}
/* content always fits: cards shrink, grids reflow, side gutter kept */
.main { min-width: 0; }
.main .card, .main .panel, .main .setup-col { min-width: 0; max-width: 100%; }
@media (max-width: 900px) { .grid2, .grid3, .setup-cols, #kb .page { grid-template-columns: 1fr !important; } }
@media (max-width: 560px) { .app { grid-template-columns: 1fr !important; } .side { display: none; } .main { padding: 14px 16px 32px; } }

/* Live Coach renders INSIDE the main area (keeps the shell sidebar), not a full-window takeover */
#coach:not(.hidden) { position: relative; flex: 1 1 auto; min-height: 0; padding: 0; display: block; }
