/* ── The Excel model analyst (owner, 2026-12-04: "Mock-up looks good."; docs/excel-model-mockup/, three screens) ──
   The button under the prompt bar, the bar in its mode, and the model view outside the chat. The look is the mockup's,
   its classes given an xm- prefix; kilby-excel.js draws it. */

/* 1. Kilby Agents under the prompt bar (owner, Dec 4: "THE HOPE PAGE NEEDS A MODEN LOOK FOR THE AGENT"; mockup
   docs/agents-home-mockup/): a heading, three cards, and the shortcuts in one list; the three menus' own buttons put
   away (their chips live on, in the list). kilby-agents.js. */
#chatStarters > .starter-group { display: none; }
.kilby-agents { flex: 0 0 calc(100% + 6px); width: calc(100% + 6px); margin: 14px 0 2px -6px; }   /* the cards edge to edge with the bar (owner, 2026-12-04: "outer edges to outer edges") */
.ka-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 10px; }   /* the K on the cards' and the bar's left edge (owner, 2026-12-04) */
.ka-title h2 { margin: 0; font-size: 17px; font-weight: 700; color: var(--kilby-white); letter-spacing: -.01em; }
.ka-pop { position: absolute; left: 0; top: calc(100% + 8px); z-index: 40; width: 260px; padding: 8px; box-sizing: border-box;
  background: var(--kilby-black); border: 1px solid var(--kilby-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14); }
.ka-pop[hidden] { display: none; }
/* Shortcuts beside the top-right menu (docs/shortcuts-menu-mockup/): at the Shortcuts item's height, to its left. */
#shortcutsMenu.kebab-fly { left: auto; right: calc(100% + 8px); top: var(--fly-top, 0px); width: 270px; max-height: 70vh;
  overflow-y: auto; text-align: left; }
.kebab-item.kebab-shortcuts::after { content: '›'; margin-left: auto; padding-left: 16px; }   /* drawn, so the item reads "Shortcuts" */
.kebab-item.kebab-shortcuts[aria-expanded="true"] { background: var(--kilby-panel); color: var(--kilby-white); }
@media (max-width: 720px) {   /* a phone: the list opens inside the menu, under Shortcuts */
  #shortcutsMenu.kebab-fly { position: static; width: auto; max-height: 50vh; margin: 0 8px 4px; box-shadow: none; }
  #kebabMenu:has(#shortcutsMenu:not([hidden])) { min-width: 270px; }
  /* A phone's company list: each company a row of its own, ticker over name, with room between rows (Kilby Review). */
  .cmd-palette-companies .cmd-palette-item { height: auto; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px; }
  .cmd-palette-companies .cmd-palette-item + .cmd-palette-item { margin-top: 2px; }
}
.ka-grp { padding: 8px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--kilby-white); }
.ka-pop .starter-chip { display: flex; width: 100%; justify-content: flex-start; margin: 0; }
.ka-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* The cards (owner, 2026-12-04: "too loud and is in complete conflict with the rest of the UI"; "they should be smaller";
   "They should have kinetic energy"; approved mockup docs/agent-cards-calm-mockup/): white, Kilby's hairline and a soft
   lift, a breath of each agent's color from its icon's corner; under the pointer it lifts and takes its color. */
.ka-card { --tint: 31,138,87; --ink2: #1f8a57; --bg: #e7f6ee;
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; padding: 14px 14px 13px;
  /* Its outline drawn as the bar's is, a 1px line inside its edge in the bar's gray, so the two lines meet on the same
     pixel at every screen scale (owner, 2026-12-04: "u lined up with the fucken prompt bar glow instead of the fucken edge
     of the bar"; Kilby Review measured the old ring 1px outside, lighter than the bar's line). */
  text-align: left; box-sizing: border-box; border: 1px solid #e4e4e8; border-radius: 14px; background: #fff; cursor: pointer; overflow: hidden;
  font-family: 'DM Sans', sans-serif; color: #111113; box-shadow: 0 1px 2px rgba(17,17,19,.04), 0 6px 16px -8px rgba(17,17,19,.12);
  transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease, opacity .15s ease; }
.ka-card[data-agent="earnings"] { --tint: 116,69,201; --ink2: #7445c9; --bg: #f1ebfd; }
.ka-card[data-agent="watchlist"] { --tint: 47,95,208; --ink2: #2f5fd0; --bg: #e8effd; }
.ka-card::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(120% 90% at 0% 0%, rgba(var(--tint), .07), transparent 60%); }
.ka-card:hover, .ka-card:focus-visible, .ka-card.armed { transform: translateY(-2px); outline: none;
  border-color: rgba(var(--tint), .38); box-shadow: 0 2px 4px rgba(17,17,19,.04), 0 14px 28px -12px rgba(var(--tint), .45); }
.ka-card:hover::before, .ka-card.armed::before { background: radial-gradient(120% 90% at 0% 0%, rgba(var(--tint), .12), transparent 62%); }
.ka-top { position: relative; display: flex; align-items: center; gap: 10px; }
.ka-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--bg); }
.ka-t { font-size: 15px; font-weight: 700; line-height: 1.2; color: #111113; }   /* a narrower window: two lines, never cut */
.ka-d { position: relative; font-size: 13.5px; font-weight: 500; line-height: 1.35; color: #111113; text-wrap: balance; }
.ka-card { container-type: inline-size; }
@container (max-width: 165px) {   /* a truly narrow card (both side columns open at 1536 and less), not 1920, 1280 or 1024 */
  .ka-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ka-t { text-wrap: balance; }   /* whole on one line where it fits, on two rather than cut where it doesn't */
  .ka-d { font-size: 13px; }
}
.ka-m { position: relative; display: flex; align-items: center; margin-top: auto; font-size: 12px; font-weight: 600; color: var(--ink2); letter-spacing: .01em; }
.ka-time { white-space: nowrap; }   /* the time whole; a narrow card breaks at the · */
.ka-m { flex-wrap: wrap; column-gap: .25em; }   /* space only between parts on one line (Kilby Review) */
.ka-go { margin-left: auto; width: 16px; height: 16px; opacity: 0; transform: translateX(-4px); transition: opacity .18s ease, transform .18s ease; }
.ka-go path { fill: none; stroke: var(--ink2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ka-card:hover .ka-go, .ka-card:focus-visible .ka-go { opacity: 1; transform: none; }
/* Each icon looks like its file and moves once as the page opens, then when the pointer arrives (kilby-agents.js). */
.ka-grid { display: grid; grid-template-columns: repeat(3, 5px); grid-auto-rows: 5px; gap: 2px; }
.ka-grid i { border-radius: 1px; background: #fbe9a6; } .ka-grid i.h { background: #1f8a57; } .ka-grid i.g { background: #9fe0bb; }
.ka-play .ka-grid i.y { animation: ka-fill-y 1.6s ease-in-out var(--d, 0s) both; }
.ka-play .ka-grid i.g { animation: ka-fill-g 1.6s ease-in-out var(--d, 0s) both; }
@keyframes ka-fill-y { 0%, 100% { background: #fbe9a6; } 40%, 70% { background: #f2b705; } }
@keyframes ka-fill-g { 0%, 100% { background: #9fe0bb; } 40%, 70% { background: #1f8a57; } }
.ka-voice { display: flex; align-items: center; gap: 2px; height: 16px; }
.ka-voice b { width: 2.5px; height: var(--h, 50%); border-radius: 2px; background: #7445c9; }
.ka-play .ka-voice b { animation: ka-talk .9s ease-in-out var(--d, 0s) 2 both; }
@keyframes ka-talk { 0%, 100% { height: var(--h, 50%); } 50% { height: 100%; } 75% { height: 25%; } }
.ka-line { width: 20px; height: 16px; overflow: visible; }
.ka-line .px { fill: none; stroke: #2f5fd0; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; }
.ka-line .area { fill: rgba(47,95,208,.16); stroke: none; } .ka-line .now { fill: #2f5fd0; }
.ka-play .ka-line .px { animation: ka-draw 1.3s cubic-bezier(.4,.1,.3,1) both; }
.ka-play .ka-line .area { animation: ka-fade 1.3s ease both; }
.ka-play .ka-line .now { animation: ka-pop 1.3s ease both; transform-origin: 19px 2px; }
@keyframes ka-draw { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 0; } }
@keyframes ka-fade { 0%, 50% { opacity: 0; } 100% { opacity: 1; } }
@keyframes ka-pop { 0%, 75% { transform: scale(0); } 88% { transform: scale(1.6); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ka-play * { animation: none !important; } .ka-card, .ka-go { transition: none; } }
/* "K Agents": Kilby's own header logo, no shadow, at the heading's height (read aloud "Kilby Agents"). */
.ka-title h2 { display: flex; align-items: center; gap: 7px; }
.ka-title h2 .ka-k { width: 22px; height: 22px; border-radius: 6px; display: block; }
@media (max-width: 720px) {
  .ka-row { grid-template-columns: 1fr; gap: 8px; }
}
.starter-agent-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 6px; margin-left: 6px;
  border: 1px solid var(--kilby-border); border-radius: 10px; background: var(--kilby-black); color: var(--kilby-white);
  font: 600 13px 'DM Sans', sans-serif; cursor: pointer; padding-left: 7px; }
.starter-agent-btn:hover, .starter-agent-btn.armed, .starter-agent-btn:focus-visible { border-color: var(--kilby-white); outline: none; }
.starter-agent-btn .xm-xlsx, .xm-file-top .xm-xlsx { flex: none; padding: 3px 5px; border-radius: 5px; background: #30a46c;
  color: var(--kilby-on-accent); font-size: 9.5px; font-weight: 700; letter-spacing: .04em; line-height: 1; }

/* The home page held still (owner, Dec 4: "things shift around, looks clunky"). The welcome screen centers its column,
   so anything that appeared under the bar used to push the greeting and the bar up; and the company chips hid the cards.
   - The column keeps one height in every state, so nothing re-centers.
   - A lane under the bar, kept whether empty or not, holds the company chips (kilby-picks.js lays them over it) and,
     at its right, the line saying what Send does; the cards stay where they are and stay in sight.
   - The card in use is outlined, the other two step back. */
.ws-chat-empty .composer:has(#kilbyAgents) { min-height: 340px; }
.ws-chat-empty .composer:has(#kilbyAgents) #chatStarters { position: relative; margin-top: 10px; }
.ws-chat-empty .composer:has(#kilbyAgents) .kilby-agents { margin-top: 0; }   /* the line starts where the chips do */
/* The line right under the bar: Shortcuts at the left, today's question at the right; a company's chips or an agent's
   line take it while they show. */
.ka-lane { display: flex; align-items: center; justify-content: flex-start; gap: 16px; min-height: 28px; margin: 0 0 22px; }
.ka-lane .chat-nudge.chat-nudge { margin-left: -8px; }   /* its calendar mark on the same left edge; its hover ground reaches past it */
.ka-lane .chat-nudge { padding-left: 0; margin-left: 0; flex: 0 1 auto; min-width: 0; }
/* The chat floating over the Watchlist (kilby-floating-chat.js) is too narrow for the cards: its line under the bar only. */
body.chat-floating .kilby-agents .ka-head, body.chat-floating .kilby-agents .ka-row { display: none; }
body.chat-floating .ka-lane { margin-bottom: 0; }
body.chat-floating .ws-chat-empty .composer:has(#kilbyAgents) { min-height: 0; }
.ka-lane .chat-nudge .starter-chip { padding: 4px 8px; }
.composer.has-company-picks .ka-lane, .kilby-agents:has(.ka-card.armed) .ka-lane,
.composer:has(#composerInstruction.visible) .ka-lane { visibility: hidden; }
.ws-chat-empty .composer.has-company-picks .ws-chat-starters:has(#kilbyAgents) { visibility: visible; }
.ws-chat-empty .composer:has(#kilbyAgents) #composerInstruction.visible { position: absolute; right: 8px;
  top: var(--ka-lane-top, 0px); margin: 5px 0 0; max-width: 62%; text-align: right; color: var(--kilby-white); font-size: 13px;
  line-height: 1.35; white-space: normal; }
.ws-chat-empty .composer:has(#kilbyAgents) #composerInstruction.visible { display: block; }   /* two lines when it must, never cut */
.ws-chat-empty .composer:has(#kilbyAgents).has-company-picks #composerInstruction.visible { max-width: 80%; }
/* An agent asking for a company: its chip is the ticker alone, since the line beside it names the company. */
.composer:has(.composer-intent-chip[data-kind="excel-model"]) .company-picks .company-pick > span { display: none; }
.ws-chat-empty .composer:has(#kilbyAgents) .cmd-palette.cmd-palette-companies.cmd-palette-below {
  top: var(--ka-lane-top, calc(100% - 8px)); }   /* right under the bar, over the lane and the cards */
/* Watchlist analysis for someone with several portfolios: each one a chip in the line under the bar (kilby-agents.js). */
/* Today's question under the bar, in readable ink with a calendar mark and its day (approved mockup
   docs/agent-cards-calm-mockup/); its words are its own. */
.ka-lane .chat-nudge .starter-chip { display: inline-flex; align-items: center; gap: 7px; color: #111113; font-size: 13.5px; font-weight: 500;
  border-radius: 9px; transition: background .15s ease; }
.ka-lane .chat-nudge .starter-chip::before { content: ''; flex: none; width: 15px; height: 15px; margin-left: -1.6px;   /* its drawn line, not its box, on the edge */
   background: center / 15px 15px no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352525b' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='2.5'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ka-lane .chat-nudge .chat-nudge-fact { color: #52525b; }
.ka-lane .chat-nudge .starter-chip:hover, .ka-lane .chat-nudge .starter-chip:focus-visible { background: #f4f4f6; color: #111113; }
/* In an agent's mode the bar's words are its instruction: darker than the usual hint (owner, Dec 4: "is ... too faint?"). */
/* Earnings debrief (docs/debrief-flow-mockup/v2.html): the company first, then its transcript. Nothing under the bar
   but the company and the file; the + lights up when it's the transcript's turn; the transcript sits beside the company
   so the bar never moves. */
.composer.ka-ask #composerInstruction, .composer.ka-transcript #composerInstruction { display: none !important; }
/* The + lit: the agent's purple on a small round tint the size of the + itself (any button size), breathing gently. */
.composer.ka-glow #attachBtn { color: #7445c9; background: radial-gradient(circle at center, #f1ebfd 0 15px, transparent 15.5px); }
.composer.ka-glow #attachBtn svg { animation: ka-breathe 1.6s ease-in-out infinite; }
@keyframes ka-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .composer.ka-glow #attachBtn svg { animation: none; } }
.ka-co { position: absolute; left: 0;   /* on the bar's left edge, as the K (owner, 2026-12-04) */ top: var(--ka-lane-top, 0px); z-index: 3; }
.composer:has(#kaWhy) .ka-head { visibility: hidden; }   /* a long reason may take three lines (Kilby Review) */
.ka-why { position: absolute; left: var(--ka-att-left, 0px); right: 0; top: var(--ka-lane-top, 0px); margin-top: 5px; z-index: 3;
  font: 500 13px/1.35 'DM Sans', sans-serif; color: #b42318; }   /* two lines when it must, never cut */
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip.visible { position: absolute; left: var(--ka-att-left, 0px); right: 0;
  top: var(--ka-lane-top, 0px); padding: 0; z-index: 3; }
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .attachment-card { display: inline-flex; flex-direction: row;
  align-items: center; gap: 8px; width: auto; height: 28px; min-height: 0; padding: 0 6px 0 4px; border-radius: 999px; }
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .attachment-file-size,
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .attachment-status { display: none; }
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .attachment-card { height: 26px; border: 1px solid var(--card-line);
  background: var(--kilby-panel); padding: 0 4px 0 4px; box-sizing: border-box; }
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .doc-chip-type { position: static; margin: 0; align-self: center;
  font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 6px; }
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .attachment-file-name { max-width: none; width: auto; white-space: nowrap;
  overflow: visible; font: 500 13px 'DM Sans', sans-serif; color: #111113; }
.ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip .attachment-remove { position: static; margin-left: 2px; }
.kilby-agents:has(.ka-card.armed) .ka-card:not(.armed) { opacity: .45; }
.ka-pop { max-height: min(60vh, 420px); overflow-y: auto; }
@media (max-width: 720px) {
  .ws-chat-empty .composer:has(#kilbyAgents) { min-height: 0; }
  /* A phone: the line under the bar too, the full width, left to right. */
  .ws-chat-empty .composer:has(#kilbyAgents) #composerInstruction.visible { left: 8px; right: 8px; max-width: none; text-align: left; }
  .ws-chat-empty .composer:has(#kilbyAgents).has-company-picks #composerInstruction.visible { top: calc(var(--ka-lane-top, 0px) + 30px); }
}

/* 2. The bar in its mode: no model picker (the model that sets the assumptions isn't the person's pick). */

/* 3. The model view: in the chat's place, the chat and the company page put away. */
.excel-model-view { display: none; }
body.excel-model-on .excel-model-view { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0;
  overflow-y: auto; box-sizing: border-box; }
body.excel-model-on .ws-chat, body.excel-model-on .company-view, body.excel-model-on .home-wl,
body.excel-model-on .home-feed, body.excel-model-on .home-tray, body.excel-model-on .home-divider,
body.excel-model-on .cv-divider { display: none !important; }   /* the whole page is the model's, as in the mockup */
.xm-bar { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 0 24px; flex: none;
  border-bottom: 1px solid rgba(var(--kilby-tint), 0.07); }
.xm-ttl { font-size: 15px; font-weight: 600; color: var(--kilby-white); }
.xm-sub { font-size: 13px; color: var(--kilby-secondary); }
.xm-mk { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--kilby-panel); border: 1px solid var(--kilby-border); color: var(--kilby-white); }
.xm-body { padding: 28px 0 48px; }
.xm-col { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.xm-wide { width: 1000px; max-width: calc(100% - 48px); margin: 0 auto; }   /* the first eight columns in sight */
.xm-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--kilby-secondary); margin: 0 0 12px; }
.xm-step { display: inline-flex; align-items: center; gap: 7px; }
.xm-step svg { width: 16px; height: 16px; }
.xm-step i { width: 12px; height: 12px; margin: 2px; border-radius: 50%; border: 2px solid var(--kilby-border); box-sizing: border-box; }
.xm-step.now { color: var(--kilby-white); }
.xm-step.now i { border-color: var(--kilby-white) transparent var(--kilby-white) var(--kilby-white); animation: xm-turn .8s linear infinite; }
.xm-step.later { opacity: .55; }
.xm-step.failed i { border-color: var(--kilby-red); }
@keyframes xm-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .xm-step.now i { animation: none; } }
.xm-ready { font-size: 15px; line-height: 1.5; margin: 0 0 14px; color: var(--kilby-white); }
.xm-error { font-size: 15px; line-height: 1.5; margin: 4px 0 0; color: var(--kilby-white); }
.xm-note { font-size: 14px; color: var(--kilby-secondary); margin: 14px 0 0; line-height: 1.45; }

/* The file and its sheet */
.xm-file { border: 1px solid var(--kilby-border); border-radius: 12px; overflow: hidden; background: var(--kilby-black); }
.xm-file-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.xm-nm { font-size: 15px; font-weight: 600; color: var(--kilby-white); }
.xm-mt { font-size: 13px; color: var(--kilby-secondary); }
.xm-acts { margin-left: auto; display: flex; gap: 8px; }
.xm-dl, .xm-ghost { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: 18px;
  font: 600 14px 'DM Sans', sans-serif; cursor: pointer; text-decoration: none; box-sizing: border-box; white-space: nowrap; }
.xm-dl { border: 0; background: var(--kilby-white); color: var(--kilby-black); }
.xm-dl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.xm-ghost { border: 1px solid var(--kilby-border); background: var(--kilby-black); color: var(--kilby-white); }
.xm-ghost:hover, .xm-dl:hover { opacity: .85; }
.xm-fx { display: flex; gap: 10px; align-items: center; height: 32px; padding: 0 12px; border-top: 1px solid var(--kilby-border);
  font: 13px Consolas, 'Courier New', monospace; color: var(--kilby-white); }
.xm-fx i { font: italic 600 14px Georgia, serif; color: var(--kilby-secondary); }
.xm-fx .xm-ref { width: 44px; color: var(--kilby-secondary); border-right: 1px solid var(--kilby-border); }
.xm-grid { max-height: 620px; overflow: auto; border-top: 1px solid var(--kilby-border); }
table.xm-sh { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.xm-sh th, .xm-sh td { height: 28px; padding: 0 10px; border-bottom: 1px solid rgba(var(--kilby-tint), 0.06); text-align: right;
  white-space: nowrap; color: var(--kilby-white); }
.xm-sh thead th { position: sticky; top: 0; z-index: 1; height: 22px; background: var(--kilby-panel); color: var(--kilby-secondary);
  font: 500 12px 'DM Sans', sans-serif; text-align: center; }
.xm-sh .rn { position: sticky; left: 0; width: 30px; padding: 0; text-align: center; background: var(--kilby-panel);
  color: var(--kilby-secondary); font-size: 12px; border-right: 1px solid var(--kilby-border); }
.xm-sh thead th.rn { z-index: 2; }
.xm-sh th.colA, .xm-sh td.lab { min-width: 250px; text-align: left; }
.xm-sh td.lab { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.xm-sh td.lab.in { padding-left: 24px; color: var(--kilby-secondary); }
.xm-sh tr.hr td { font-weight: 600; color: var(--kilby-secondary); }
.xm-sh tr.hr td.e { color: var(--kilby-white); }
.xm-sh tr.sec td.lab { font-weight: 600; }
.xm-sh tr.tot td { font-weight: 700; }
.xm-sh .e { background: rgba(var(--kilby-tint), 0.035); }
.xm-sh .gap { border-left: 1px solid var(--kilby-border); }
.xm-sh td.y { background: #FFF2CC; color: #1f2937; }
.xm-sh td.yg { background: #C6E0B4; color: #1f2937; font-weight: 600; }   /* the file's guidance is bold too */
.xm-sh td.v { cursor: cell; }
.xm-sh td.sel { box-shadow: inset 0 0 0 2px var(--kilby-white); }
.xm-tabs { display: flex; padding: 0 8px; background: var(--kilby-panel); border-top: 1px solid var(--kilby-border); font-size: 13px; }
.xm-tabs button { padding: 8px 14px; border: 0; background: none; color: var(--kilby-secondary); font: 13px 'DM Sans', sans-serif; cursor: pointer; }
.xm-tabs button.on { background: var(--kilby-black); color: var(--kilby-white); font-weight: 600;
  border-left: 1px solid var(--kilby-border); border-right: 1px solid var(--kilby-border); }
.xm-src-rows { padding: 8px 14px; }
.xm-src-row { display: flex; gap: 14px; justify-content: space-between; padding: 5px 0; font-size: 13px; line-height: 1.45; color: var(--kilby-white); }
.xm-src-row.head { font-weight: 700; padding-top: 12px; }
.xm-src-row a { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--kilby-link); }

/* A phone: the sheet scrolls sideways in its frame, the buttons wrap under the file's name. */
@media (max-width: 720px) {
  .xm-file-top { flex-wrap: wrap; }
  .xm-acts { margin-left: 0; width: 100%; }
  .xm-wide { max-width: calc(100% - 24px); }
  .xm-sh th.colA, .xm-sh td.lab { min-width: 160px; max-width: 200px; }
}

/* While the company list is open under the bar, it is the one thing there: the heading steps out of sight, the cards
   fade back, so its edge never crowds them (owner, 2026-12-04: "it is crowding the logo"). Nothing moves. */
.ka-head, .ka-row { transition: opacity .15s ease; }
.composer:has(.cmd-palette-companies.cmd-palette-below[style*="block"]) .ka-head,
.composer:has(.cmd-palette-companies.cmd-palette-below[style*="block"]) .ka-lane { visibility: hidden; }
.composer:has(.cmd-palette-companies.cmd-palette-below[style*="block"]) .ka-row { opacity: 0; visibility: hidden; pointer-events: none; }

/* The agent's chip in the bar: its own color and icon, a plain × (approved mockup docs/dropdown-chip-mockup/; owner, 2026-12-04: "that excel model chip with the little "x" is
   annoying looking"). */
.composer-intent-chip[data-kind] { gap: 6px; min-height: 26px; padding: 3px 3px 3px 8px; border: 0; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; }
.composer-intent-chip[data-kind]::before { content: ''; flex: none; width: 12px; height: 12px; background: center / 12px 12px no-repeat; }
.composer-intent-chip[data-kind="excel-model"] { background: #e7f6ee; color: #17784a; }
.composer-intent-chip[data-kind="excel-model"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Crect x='0' y='0' width='12' height='3' rx='1' fill='%231f8a57'/%3E%3Cg fill='%23f2c14e'%3E%3Crect x='0' y='4.5' width='3.4' height='3' rx='.6'/%3E%3Crect x='4.3' y='4.5' width='3.4' height='3' rx='.6'/%3E%3Crect x='0' y='9' width='3.4' height='3' rx='.6'/%3E%3Crect x='4.3' y='9' width='3.4' height='3' rx='.6'/%3E%3Crect x='8.6' y='9' width='3.4' height='3' rx='.6'/%3E%3C/g%3E%3Crect x='8.6' y='4.5' width='3.4' height='3' rx='.6' fill='%2364cf92'/%3E%3C/svg%3E"); }
.composer-intent-chip[data-kind="debrief"] { background: #f1ebfd; color: #6a3cbd; }
.composer-intent-chip[data-kind="debrief"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%237445c9'%3E%3Crect x='0' y='4' width='2' height='4' rx='1'/%3E%3Crect x='3.3' y='1' width='2' height='10' rx='1'/%3E%3Crect x='6.6' y='3' width='2' height='6' rx='1'/%3E%3Crect x='10' y='4.5' width='2' height='3' rx='1'/%3E%3C/svg%3E"); }
.composer-intent-chip[data-kind="watchlist"] { background: #e8effd; color: #2557c4; }
.composer-intent-chip[data-kind="watchlist"]::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 10 L4 6.5 L6.5 8 L11 2.5' fill='none' stroke='%232f5fd0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.composer-intent-chip[data-kind] .composer-intent-remove { width: 20px; height: 20px; border-radius: 6px; background: transparent; color: inherit;
  opacity: .55; font-size: 15px; line-height: 20px; transition: opacity .15s ease, background .15s ease; }
.composer-intent-chip[data-kind] .composer-intent-remove:hover, .composer-intent-chip[data-kind] .composer-intent-remove:focus-visible {
  opacity: 1; background: rgba(17,17,19,.07); }

/* Every agent's mode, the same (owner, 2026-12-04: "check your css to make sure evertyhing is uniform and locked in for
   each of the three agents"): the agent's chip, its instruction in the bar in the darker ink, no model picker (the agent
   picks its model), and the + out of sight unless the agent is asking for a file right now (the debrief's transcript),
   when it lights up in the agent's color. A bar in no agent's mode is unchanged. */
.input-area:has(.composer-intent-chip[data-kind]) .model-choice { display: none; }
.composer:has(.composer-intent-chip[data-kind]) #composerInstruction { display: none !important; }   /* no line under the bar */
.input-area:has(.composer-intent-chip[data-kind]) textarea::placeholder { color: #3f3f46; font-weight: 500; }
.input-area:has(.composer-intent-chip[data-kind]:not([data-kind="debrief"])) #attachBtn { display: none; }
/* A phone: the debrief's reason under its company, two lines if it must; the heading steps aside for it. */
@media (max-width: 720px) {
  .ka-why { left: 0; top: calc(var(--ka-lane-top, 0px) + 32px); height: auto; white-space: normal; font-size: 12.5px; line-height: 1.3; }
  /* Today's question reads as one sentence, its day right after it, the calendar mark before it. */
  .ka-lane .chat-nudge .starter-chip { display: inline-block; text-align: left; }
  .ka-lane .chat-nudge .starter-chip::before { display: inline-block; vertical-align: -2px; margin-right: 7px; }
  .ka-lane .chat-nudge .chat-nudge-text, .ka-lane .chat-nudge .chat-nudge-fact { display: inline; }
  /* The line under the bar folds away while an agent has nothing to show in it (owner, 2026-12-04: "make it collapse
     unto itself in mobile view"); it keeps its room while the company, the transcript or the reason is there. */
  .kilby-agents:has(.ka-card.armed) .ka-lane { display: none; }
  .composer:has(#kaCo) .kilby-agents .ka-lane, .composer.has-company-picks .kilby-agents .ka-lane { display: flex; }
  /* The transcript on its own row under the company; the heading steps aside for it. */
  .ws-chat-empty .composer.ka-transcript:has(#kilbyAgents) #attachmentStrip.visible { left: 0; top: calc(var(--ka-lane-top, 0px) + 32px); }
  .composer.ka-transcript:has(#attachmentStrip.visible) .ka-head { visibility: hidden; }
  /* The agent's words in the bar follow the bar's rule: one line, "…" when the phone is too narrow (owner, 2026-10-21). */
  /* The welcome column starts at a set height, so the bar holds still when an agent's chip takes its own row. */
  .ws-chat.ws-chat-empty:has(#kilbyAgents) { justify-content: flex-start; padding-top: max(12vh, 56px); }
}

/* Excel's company chips on the home page start on the bar's left edge, as the K and the cards (owner, 2026-12-04);
   chat's own chips stay as they are. */
.ws-chat-empty .composer:has(#kilbyAgents) .company-picks { margin-left: 0; margin-right: 0; width: 100%; }

/* Watchlist analysis: the portfolios under the bar, each list in its own column, its portfolios as cards under its name;
   the counts in plain ink (owner, 2026-12-04: "Too easy to mix the 4 cards up."; "I dont need that fucking color.";
   approved mockup docs/agents-show/watchlist2.html). While they show, they're the only thing under the bar. */
.composer:has(#kaPortfolios) .ka-row, .composer:has(#kaPortfolios) .ka-head, .composer:has(#kaPortfolios) .ka-lane { visibility: hidden; }
.wp-panel { position: absolute; left: 0; right: 0; top: var(--ka-lane-top, 0px); z-index: 30; box-sizing: border-box; padding: 12px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; max-height: min(62vh, 560px); overflow-y: auto;
  background: #fff; border: 1px solid #e4e4e8; border-radius: 16px; box-shadow: 0 18px 40px -12px rgba(17,17,19,.22); }   /* its line as the bar's */
.wp-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wp-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 4px; border-bottom: 1px solid #ececf0;
  font: 700 14px 'DM Sans', sans-serif; color: #111113; }
.wp-head svg { flex: none; width: 16px; height: 16px; fill: none; stroke: #111113; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wp-card { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 10px 12px; border-radius: 12px;
  background: #fff; text-align: left; cursor: pointer; font-family: 'DM Sans', sans-serif; color: #111113;
  box-sizing: border-box; border: 1px solid #e4e4e8; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease; }
.wp-card:hover, .wp-card:focus-visible { outline: none; transform: translateY(-1px);
  border-color: rgba(47,95,208,.42); box-shadow: 0 10px 22px -12px rgba(47,95,208,.45); }
.wp-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.wp-name { min-width: 0; font: 700 15px 'DM Sans', sans-serif; color: #111113; overflow-wrap: anywhere; }
.wp-count { flex: none; margin-left: auto; font: 500 12.5px 'DM Sans', sans-serif; color: #3f3f46; white-space: nowrap; }
.wp-top { display: block; min-width: 0; overflow: hidden; white-space: nowrap; font: 500 12.5px 'DM Sans', sans-serif; color: #111113; }
.wp-top b { font-weight: 700; }
.wp-top i { font-style: normal; color: #52525b; }
@media (prefers-reduced-motion: reduce) { .wp-card { transition: none; } .wp-card:hover, .wp-card:focus-visible { transform: none; } }
@media (max-width: 720px) { .wp-panel { padding: 10px; gap: 12px; } }
