@import url('/css/tokens.css'); /* design tokens (bl-byq.10), shared with privacy.html */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink-900); background: var(--cream); -webkit-font-smoothing: antialiased; }
h1 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
p { margin: 0; }
a { color: var(--plum-500); text-underline-offset: 3px; }
a:hover { color: var(--plum-600); }
button, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-400); }
.muted { color: var(--ink-400); font-size: 14px; }
.err { color: var(--error-500); font-size: 14px; min-height: 1em; }

/* Button / Badge / Switch, same classes and look as the design-system components. */
.cj-btn { --_pad-y: 13px; --_pad-x: 22px; --_fs: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: var(--_fs); line-height: 1; letter-spacing: -0.01em; padding: var(--_pad-y) var(--_pad-x);
  border-radius: var(--radius-md); border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease, border-color .16s ease; }
.cj-btn:focus-visible { box-shadow: var(--ring); border-radius: var(--radius-md); }
.cj-btn:disabled, .cj-btn[aria-disabled="true"] { cursor: not-allowed; opacity: .5; box-shadow: none; transform: none; pointer-events: none; }
.cj-btn--sm { --_pad-y: 9px; --_pad-x: 16px; --_fs: 14px; }
.cj-btn--primary { background: var(--plum-500); color: var(--white); box-shadow: var(--shadow-sm); }
.cj-btn--primary:hover { background: var(--plum-600); color: var(--white); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.cj-btn--secondary { background: transparent; color: var(--ink-900); border-color: var(--line-strong); }
.cj-btn--secondary:hover { background: var(--white); color: var(--ink-900); border-color: var(--ink-400); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.cj-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius-pill); line-height: 1.2; white-space: nowrap; }
.cj-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.cj-badge--sage { background: var(--sage-100); color: var(--success-ink); }
.cj-badge--neutral { background: var(--cream-deep); color: var(--ink-600); }
.cj-badge--error { background: var(--error-100); color: var(--error-ink); }
.cj-badge--warning { background: var(--warning-100); color: var(--warning-ink); }
.cj-badge--plum { background: var(--plum-100); color: var(--plum-600); }
.cj-badge--xs { font-size: 11px; padding: 1px 7px; border-radius: 6px; margin-left: 6px; }
/* bl-byq.10 (3h): two identities. A2A = someone outside drives (terracotta, square, enter glyph);
   tandem = you drive, a second agent helps (plum pill, two rings). */
.tag-a2a, .tag-tandem { display: inline-flex; align-items: center; gap: 5px; height: 22px; font-size: var(--app-fs-xs); font-weight: 600; line-height: 1; white-space: nowrap; }
.tag-a2a { padding: 0 8px; border-radius: var(--radius-xs); background: var(--terracotta-100); color: var(--a2a-ink); }
.tag-tandem { padding: 0 9px; border-radius: var(--radius-pill); background: var(--plum-100); color: var(--plum-700); }
.tag-a2a svg, .tag-tandem svg { flex: none; }
/* One input component (3h): text, search, email, password, date, select, textarea. */
.input { font: inherit; font-size: var(--app-fs-chat); color: var(--ink-900); height: var(--h-input); min-width: 0; max-width: 100%; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--white); }
.input--sm { height: var(--h-default); font-size: var(--app-fs-ui); padding: 0 10px; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--ink-400); }
.input:focus, .input:focus-visible { outline: none; border-color: var(--plum-500); box-shadow: var(--ring); border-radius: var(--radius-md); }
.input.is-error { border-color: var(--error-500); }
.input-err { font-size: var(--app-fs-xs); color: var(--error-ink); }
.input:disabled { background: var(--cream-deep); border-color: var(--line); color: var(--ink-200); cursor: not-allowed; }
.cj-switch { display: inline-flex; align-items: center; cursor: not-allowed; }
.cj-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cj-switch__track { width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--line-strong); position: relative; flex: none; }
.cj-switch__thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-sm); }
.cj-switch input:checked + .cj-switch__track { background: var(--sage-500); }
.cj-switch input:checked + .cj-switch__track .cj-switch__thumb { transform: translateX(18px); }
.cj-switch input:disabled + .cj-switch__track { opacity: .5; }
.icon-btn { width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-600); cursor: pointer; }
.icon-btn:disabled { cursor: not-allowed; opacity: .5; }
.icon-btn.primary { border: 0; background: var(--plum-500); color: var(--white); }
.icon-btn.primary:hover:not(:disabled) { background: var(--plum-600); }
.icon-btn[aria-pressed="true"] { color: var(--terracotta-600); border-color: currentColor; }
/* dictation feedback (bl-bwq.79): pulsing ring while listening, stronger while hearing speech */
.icon-btn[data-dictate].listening { animation: dictate-pulse 1.6s ease-in-out infinite; }
.icon-btn[data-dictate].hearing { background: var(--terracotta-100); animation: dictate-hearing .9s ease-in-out infinite; }
@keyframes dictate-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 106, 77, .35); } 50% { box-shadow: 0 0 0 7px rgba(201, 106, 77, 0); } }
@keyframes dictate-hearing { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 106, 77, .55); } 50% { box-shadow: 0 0 0 9px rgba(201, 106, 77, 0); } }
@media (prefers-reduced-motion: reduce) { .icon-btn[data-dictate].listening, .icon-btn[data-dictate].hearing { animation: none; } }
/* dictation status (bl-bwq.80): absolute caption under the mic, takes no row space so the mic never jumps */
.dictate-mic-wrap { position: relative; flex: none; display: inline-flex; }
.dictate-status { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  font-size: 11px; line-height: 1.4; color: var(--ink-600); white-space: nowrap; pointer-events: none; z-index: 5;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; box-shadow: var(--shadow-sm); }
.dictate-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.dictate-status.hearing { color: var(--terracotta-600); font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-200); flex: none; }
.dot.on { background: var(--success-500); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.logo { position: relative; width: 26px; height: 26px; flex: none; }
.logo::before { content: ''; position: absolute; left: 0; bottom: 0; width: 16px; height: 16px; background: var(--plum-500); border-radius: 16px 0 0 0; }
.logo::after { content: ''; position: absolute; right: 0; top: 0; width: 12px; height: 12px; background: var(--terracotta-500); border-radius: 50%; }

/* --- layout --- */
#app { display: flex; height: 100vh; }
#side-bar { display: none; flex: none; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--cream-deep); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
#side-bar .logo { width: 20px; height: 20px; }
#side { width: 272px; flex: none; background: var(--cream-deep); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 20px 14px 16px; min-height: 0; overflow-y: auto; }
/* bl-bwq.84: on a short viewport the lists keep a floor and the whole aside scrolls instead of
   squeezing #sessions to 0px; [hidden] still wins over min-height */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; background: transparent; border: 0; color: var(--ink-900); text-decoration: none; width: 100%; text-align: left; }
.nav:hover { background: var(--white); color: var(--ink-900); }
.nav.active { background: var(--white); color: var(--plum-600); }
.nav[aria-disabled="true"] { color: var(--ink-200); pointer-events: none; }
.nav svg { flex: none; }
#side .eyebrow { padding: 24px 10px 8px; }
/* bl-byq.23 (sidebar-v2): "Working for you": the A2A sessions an agent is working in now */
#working { margin: 14px 0 0; padding: 10px 8px 8px; border-radius: var(--radius-md); background: #FDF3EE; border: 1px solid var(--terracotta-500); display: flex; flex-direction: column; gap: 2px; }
.working__head { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; font-size: var(--app-fs-xs); color: var(--a2a-ink); }
.working__head > span { flex: 1; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.working__head a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.wrow { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-radius: var(--radius-sm); border: 0; background: transparent; cursor: pointer; text-align: left; width: 100%; font: inherit; color: var(--ink-900); }
.wrow:hover, .wrow.current { background: var(--white); box-shadow: var(--shadow-xs); }
.wrow .wic { width: 22px; height: 22px; flex: none; border-radius: var(--radius-xs); background: var(--terracotta-100); color: var(--a2a-ink); display: flex; align-items: center; justify-content: center; }
.wrow.current .wic { background: var(--terracotta-500); color: var(--white); }
.wrow .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wrow .t > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wrow .t b { font-size: var(--app-fs-meta); font-weight: 600; }
.wrow .t span { font-size: var(--app-fs-xs); color: var(--ink-600); }
.wrow .chip { flex: none; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-xs); background: var(--cream-deep); color: var(--ink-600); }
.wrow .chip.working { background: var(--sage-100); color: var(--success-ink); }
/* Sessions header with the All | Mine | Agents segmented filter */
.side-head { display: flex; align-items: center; gap: 4px; padding: 16px 8px 6px 10px; }
.side-head .eyebrow { flex: 1; }
#side .side-head .eyebrow { padding: 0; }
.seg-mini { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: rgba(60, 46, 28, 0.06); }
.seg-mini button { font: inherit; font-size: var(--app-fs-xs); padding: 2px 8px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--ink-600); cursor: pointer; }
.seg-mini button[aria-pressed="true"] { font-weight: 600; color: var(--ink-900); background: var(--white); box-shadow: var(--shadow-xs); }
/* one scrolling list: project groups with sticky headers, then No project, then Shared with me */
#sessions { flex: 1; min-height: 120px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.grp { display: flex; flex-direction: column; gap: 1px; }
.grp > .grp-row { position: sticky; top: 0; z-index: 1; background: var(--cream-deep); }
.grp-head { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font: inherit; font-size: var(--app-fs-meta); font-weight: 600; color: var(--ink-900); border-radius: var(--radius-sm); }
.grp-head:hover { background: var(--white); }
.grp-head .chev { flex: none; color: var(--ink-400); transition: transform .15s; }
.grp-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.grp-head .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-head .count { font-size: var(--app-fs-xs); font-weight: 500; color: var(--ink-400); }
.grp.archived .grp-head .t { color: var(--ink-400); }
.grp-row .grp-head { padding-right: 36px; }
.grp-row:has(.kebab.new) .grp-head { padding-right: 64px; }
.show-more { border: 0; background: transparent; color: var(--ink-400); font: inherit; font-size: var(--app-fs-xs); padding: 4px 8px 4px 26px; text-align: left; cursor: pointer; }
.show-more:hover { color: var(--ink-900); }
.sess { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 26px; border-radius: var(--radius-sm); font-size: var(--app-fs-meta); color: var(--ink-900); cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.sess:hover { background: var(--white); }
.sess.current { background: var(--white); box-shadow: var(--shadow-xs); color: var(--plum-600); font-weight: 600; }
.sess.archived .t { color: var(--ink-400); }
.sess .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* status dot: running sage, idle ink-200, needs you warning (bl-byq.8 attention) */
.sess .dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--ink-200); }
.sess .dot.working { background: var(--sage-600); }
.sess .dot.needs_you { background: var(--warning-600); }
.sess .shared-mark { flex: none; display: flex; color: var(--ink-400); }
.sess .review-out { flex: 0 1 auto; max-width: 45%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--app-fs-xs); font-weight: 400; color: var(--ink-400); }
.sess .tag-tandem { flex: none; }
.sess .tag-a2a { flex: 0 1 auto; max-width: 40%; min-width: 0; }
.sess .tag-a2a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sess-row { position: relative; display: flex; align-items: center; }
.sess-row .sess { padding-right: 36px; }
.sess-row .kebab { position: absolute; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-400); cursor: pointer; font-size: 18px; line-height: 1; opacity: 0; }
.sess-row:hover .kebab, .sess-row .kebab:focus-visible, .sess-row .kebab[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .sess-row .kebab { opacity: 1; } }
.sess-row .kebab.new { right: 32px; }
.sess-row:has(.kebab.new) .sess { padding-right: 64px; }
.sess-row .kebab:hover { background: var(--cream-deep); color: var(--ink-900); }
#sess-menu { position: fixed; z-index: 42; /* above the mobile drawer (40) */ min-width: 170px; padding: 6px; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
#sess-menu button { border: 0; background: transparent; text-align: left; padding: 8px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
#sess-menu button:hover, #sess-menu button:focus-visible { background: var(--cream-deep); box-shadow: none; }
#sess-menu .sep { border-top: 1px solid var(--line); margin: 4px 2px; }
.show-archived { border: 0; background: transparent; color: var(--ink-400); font-size: 13px; padding: 10px; text-align: left; cursor: pointer; }
.show-archived:hover { color: var(--ink-900); }
/* bl-iwf: macOS hides overlay scrollbars, so a long sidebar list shows a thin always-on scrollbar
   (Chrome/Safari) and fades its bottom edge while more rows sit below (.more-below, js/dom.js overflowHint) */
#sessions::-webkit-scrollbar { width: 6px; }
#sessions::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
#side .more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 32px), transparent); }
#proj-menu { position: fixed; z-index: 41; min-width: 170px; padding: 6px; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
#proj-menu button { border: 0; background: transparent; text-align: left; padding: 8px 12px; border-radius: 8px; font-size: 14px; cursor: pointer; }
#proj-menu button:hover, #proj-menu button:focus-visible { background: var(--cream-deep); box-shadow: none; }
.proj-new { border: 0; background: transparent; color: var(--ink-400); font-size: 13px; padding: 8px 10px; text-align: left; cursor: pointer; border-radius: 10px; }
.proj-new:hover { color: var(--ink-900); background: var(--white); }
.proj-input { width: 100%; }
.side-foot { display: flex; margin-top: auto; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; width: 100%; }
.me:hover, .me.active { background: var(--white); }
#avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sage-100); color: var(--sage-600); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
#who { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

/* home (1a) */
#view-home { align-items: center; justify-content: safe center; padding: 48px; gap: 28px; overflow: auto; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.hero h1 { font-size: 48px; }
.hero h1 em { color: var(--plum-500); }
.hero p { font-size: 17px; color: var(--ink-600); }
.composer { width: 100%; max-width: 760px; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: flex; flex-direction: column; }
.composer textarea { border: 0; resize: none; background: transparent; padding: 20px 22px 8px; font-size: 17px; min-height: 64px; max-height: 30vh; outline: none; }
.composer textarea::placeholder { color: var(--ink-400); }
.composer .bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px 14px; }
.composer textarea:focus-visible { box-shadow: none; }
#attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 10px; }
#attachments[hidden] { display: none; }
#attachments .att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; background: var(--cream-deep); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
#attachments .att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
#attachments .att button { border: 0; background: transparent; color: var(--ink-600); cursor: pointer; border-radius: 50%; width: 22px; height: 22px; line-height: 1; font-size: 14px; }
#attachments .att button:hover { background: var(--white); color: var(--ink-900); }
.runner-pick { position: relative; background: var(--cream-deep); color: var(--ink-900); }
.runner-pick select { appearance: none; border: 0; background: transparent; font-size: 14px; padding-right: 18px; cursor: pointer; outline: none; max-width: 220px; min-width: 0; text-overflow: ellipsis; }
.runner-pick { min-width: 0; }
.runner-pick .chev { position: absolute; right: 10px; pointer-events: none; }
.talk { border: 1px solid var(--line); background: transparent; font-weight: 500; color: var(--ink-900); cursor: pointer; padding: 0 14px; }
.talk:hover { background: var(--white); border-color: var(--line-strong); }
.talk.live { background: var(--plum-100); border-color: var(--plum-300); color: var(--plum-600); }
.grow { flex: 1; }
.tiles { width: 100%; max-width: 760px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile { padding: 20px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink-900); cursor: pointer; text-align: left; font: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); color: var(--ink-900); }
.tile[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.tile .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
/* icon tints (bl-byq.10: classes instead of inline style= on the home tiles and settings sections) */
.ic--sage { background: var(--sage-100); color: var(--sage-600); }
.ic--terracotta { background: var(--terracotta-100); color: var(--terracotta-600); }
.ic--plum { background: var(--plum-100); color: var(--plum-600); }
.ic--plum-solid { background: var(--plum-500); color: var(--white); }
.tile b { font-size: 16px; font-weight: 600; display: block; color: var(--ink-900); }
.tile span { font-size: 14px; line-height: 1.45; color: var(--ink-600); }

/* bl-44q.2: Recent work cards, compact rows under the composer */
.home-cards { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 8px; }
.hcard { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); cursor: pointer; text-align: left; font: inherit; color: var(--ink-900); min-width: 0; }
.hcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.hcard .ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--cream-deep); color: var(--ink-600); }
.hcard.review .ic { background: var(--plum-100); color: var(--plum-600); }
.hcard.skill .ic { background: var(--sage-100); color: var(--sage-600); }
.hcard.open .ic svg { transform: rotate(-90deg); } /* the down chevron, pointing forward */
.hcard .t { display: flex; flex-direction: column; min-width: 0; }
.hcard b { font-size: 15px; font-weight: 600; }
.hcard small { font-size: 13px; color: var(--ink-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* session (1b) */
/* bl-byq.19 (3d): identity on the left (it truncates, never wraps), controls on the right */
.sess-head { min-height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 24px; border-bottom: 1px solid var(--line); }
.sess-head .ttl { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sess-head > :not(.ttl) { flex: none; }
.ttl-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ttl-row .input { flex: 1; }
#sess-tag { flex: none; max-width: 40%; min-width: 0; }
#sess-tag > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#shared-badge { align-self: flex-start; max-width: 100%; white-space: normal; } /* bl-hym: a badge, not a bar that ends mid-header */
.sess-head .ttl #sess-title { font: inherit; font-size: var(--app-fs-chat); font-weight: 600; color: inherit; text-align: left; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; background: none; padding: 0; }
.sess-head .ttl #sess-title:enabled { cursor: pointer; }
.sess-head .ttl #sess-title:enabled:hover { text-decoration: underline; }
#sess-meta { font-size: var(--app-fs-xs); color: var(--ink-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-head .seg button { padding: 5px 12px; font-size: var(--app-fs-meta); }
.head-icon { width: 32px; height: 32px; flex: none; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-600); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.head-icon:hover, .head-icon[aria-expanded="true"] { background: var(--cream-deep); color: var(--ink-900); }
#sess-menu button.danger { color: var(--error-ink); font-weight: 500; }
#sess-menu button.danger:hover, #sess-menu button.danger:focus-visible { background: var(--error-100); }
#sess-menu .menu-note { max-width: 240px; font-size: var(--app-fs-xs); line-height: 1.45; color: var(--ink-400); padding: 6px 10px 4px; }
#head-err { font-size: 12px; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--cream-deep); gap: 2px; }
.seg button { padding: 6px 14px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-600); cursor: pointer; }
.seg button.on { background: var(--white); color: var(--ink-900); box-shadow: var(--shadow-xs); }
.seg button:focus-visible { box-shadow: var(--ring); }
#term-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* bl-hym: #chat-msgs spans the whole main area (scrollbar at the window edge, wheel works anywhere);
   the 760px message column is its padding, the rest of #chat is the same centered column */
#chat-wrap { flex: 1; min-height: 0; overflow: hidden; padding: 24px 0 16px; display: flex; flex-direction: column; }
#chat { width: 100%; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
#chat > :not(#chat-msgs) { width: calc(100% - 56px); max-width: 760px; align-self: center; }
#chat-msgs { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 max(28px, calc((100% - 760px) / 2)); }
.chat-hint { font-size: 13px; text-align: center; margin: 0 0 4px; }
#chat-form { flex: none; display: flex; gap: 8px; align-items: flex-end; background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 10px; }
#chat-input { flex: 1; min-width: 0; border: 0; resize: none; background: transparent; font: inherit; font-size: 15px; line-height: 1.5; max-height: 30vh; padding: 6px 8px; outline: none; }
#chat-input:disabled { opacity: .5; }
/* bl-yqw: the expand button gives long messages about half the viewport; #chat-msgs shrinks above */
/* the form asks for 55vh but shrinks to what the column has left (curator proposals, short screens) */
#chat-form.expanded { flex: 0 1 55vh; min-height: 96px; }
#chat-form.expanded #chat-input { align-self: stretch; max-height: none; }
#chat-expand .min, #chat-expand[aria-pressed="true"] .max { display: none; }
#chat-expand[aria-pressed="true"] .min { display: block; }
#chat-send { flex: none; }
.bubble.pending { opacity: .65; }
.bubble.flash { outline: 3px solid var(--plum-300); outline-offset: 2px; }
/* bl-j46: per-message "Copy link", in the empty side gap next to the bubble (bubbles are max 85% wide) */
.bubble { position: relative; }
.bubble .msg-link { position: absolute; top: 2px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-400); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; }
.bubble.user .msg-link { right: calc(100% + 4px); }
.bubble.assistant .msg-link, .bubble.tandem .msg-link { left: calc(100% + 4px); }
.bubble:hover .msg-link, .bubble .msg-link:focus-visible { opacity: 1; }
@media (hover: none) { .bubble .msg-link { opacity: .7; } }
.bubble .msg-link:hover { background: var(--cream-deep); color: var(--ink-900); }
/* bl-byq.11 (3g): one toast region, inline button flash, list states */
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: calc(100vw - 32px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 360px; max-width: 100%; box-sizing: border-box; padding: 12px 14px; border-radius: var(--radius-md); background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-md); font-size: 14px; color: var(--ink-900); }
.toast--error { border-color: var(--error-100); }
.toast-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.toast--success .toast-icon { background: var(--success-100); color: var(--success-ink); }
.toast--error .toast-icon { background: var(--error-100); color: var(--error-ink); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-action, .toast-close { flex: none; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }
.toast-action { font-size: 13px; font-weight: 600; color: var(--plum-600); }
.toast-close { color: var(--ink-400); display: flex; }
.toast-action:focus-visible, .toast-close:focus-visible { box-shadow: var(--ring); border-radius: var(--radius-xs); }
[data-flash] { gap: 6px; }
[data-flash="success"] { background: var(--success-100); color: var(--success-ink); border-color: transparent; }
[data-flash="error"] { background: var(--error-100); color: var(--error-ink); border-color: transparent; }
[data-flash="busy"] { background: var(--cream); color: var(--ink-400); pointer-events: none; }
.spinner { width: 12px; height: 12px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink-600); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.list-state { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.list-state .t { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-600); }
.list-state .t b { font-size: 15px; color: var(--ink-900); }
.list-state--empty { align-items: flex-start; padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); }
.list-state--error { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--error-100); border-radius: var(--radius-md); }
.list-state--error .t { flex: 1; }
.list-state--error .t b { font-size: 14px; color: var(--error-ink); }
.skeleton { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--white); }
.skeleton span { height: 10px; width: 72%; border-radius: 6px; background: var(--cream-deep); }
.skeleton span:first-child { height: 12px; width: 48%; }
.prop-ev { display: flex; flex-direction: column; gap: 4px; }
.prop-ev-item { font-size: 13px; }
#chat-activity { flex: none; margin: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-600); }
#chat-activity[hidden] { display: none; }
.chat-warn { align-self: stretch; margin: 0; background: var(--warning-100); color: var(--ink-900); padding: 8px 12px; border-radius: var(--radius-md); font-size: 14px; }
.chat-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.chat-setup b { flex-basis: 100%; }
.chat-setup span { flex: 1 1 240px; }
/* bl-63w.3: the sign-in bar, on the Chat card and above the terminal */
.signin-bar .signin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.signin-bar input[type="text"] { flex: 1 1 200px; min-width: 0; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink-900); }
.signin-bar .signin-manual { flex-basis: 100%; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12px; }
#term-pane > .signin-bar { flex: none; margin: 12px 28px 0; }
#term-pane > .signin-bar .signin-term { display: none; } /* already on the Terminal */
@media (max-width: 759px) { #term-pane > .signin-bar { margin: 12px 16px 0; } }
#chat-activity.wait { background: var(--warning-100); color: var(--ink-900); padding: 8px 12px; border-radius: var(--radius-md); flex-wrap: wrap; }
#chat-activity .chat-question { flex-basis: 100%; white-space: pre-line; max-height: 40vh; overflow: auto; }
/* bl-xl2.2: AskUserQuestion answered from Chat */
.chat-ask { flex-basis: 100%; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow: auto; }
.chat-ask fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-ask legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.chat-ask label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.chat-ask label small { flex-basis: 100%; padding-left: 22px; }
.chat-ask input[type="text"] { flex: 1 1 160px; min-width: 0; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink-900); }
.chat-ask > button { align-self: flex-start; }
.chat-plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#chat-activity.busy .cj-btn { margin-left: auto; }
#chat-activity.busy::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--plum-500); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .25; transform: scale(.7); } to { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { #chat-activity.busy::before { animation: none; } }
/* bl-byq.19 (3d): the session body is the chat/terminal column plus the right pane (js/pane.js) */
.sess-body { flex: 1; min-height: 0; display: flex; position: relative; }
.sess-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
/* bl-byq.18 (3a/3b): the A2A banner above the chat: terracotta while the agent drives, plum after a takeover */
.a2a-banner { flex: none; margin: 14px 24px 0; padding: 12px 14px; border-radius: var(--radius-md); background: #FDF3EE; border: 1px solid var(--terracotta-500); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.a2a-banner.you { background: var(--plum-050); border-color: var(--plum-100); }
.a2a-banner.quiet { margin: 10px 24px 0; padding: 0; border: 0; background: none; font-size: var(--app-fs-meta); color: var(--ink-400); }
.a2a-banner .a2a-ic { width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm); background: var(--terracotta-500); color: var(--white); display: flex; align-items: center; justify-content: center; }
.a2a-banner.you .a2a-ic { border-radius: 50%; background: var(--sage-100); color: var(--sage-600); }
.a2a-banner .a2a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.a2a-banner .a2a-who { display: flex; align-items: center; gap: 8px; font-size: var(--app-fs-ui); font-weight: 600; }
.a2a-banner .a2a-who .cj-badge { font-size: var(--app-fs-xs); padding: 2px 8px; border-radius: var(--radius-xs); }
.a2a-banner .a2a-sub { font-size: var(--app-fs-meta); color: var(--ink-600); }
.a2a-banner .a2a-sub.task { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 759px) { .a2a-banner, .a2a-banner.quiet { margin-left: 16px; margin-right: 16px; } }
#pane { width: var(--w-pane); flex: none; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--white); }
.pane-tabs { flex: none; display: flex; align-items: center; gap: 2px; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.pane-tabs [role="tab"] { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: inherit; font-size: var(--app-fs-meta); padding: 6px 10px; border-radius: var(--radius-sm); color: var(--ink-600); cursor: pointer; white-space: nowrap; }
.pane-tabs [role="tab"]:hover { color: var(--ink-900); }
.pane-tabs [role="tab"][aria-selected="true"] { font-weight: 600; background: var(--plum-050); color: var(--plum-700); }
#pane-tab-task[aria-selected="true"] { background: var(--terracotta-100); color: var(--a2a-ink); }
.pane-tabs .count { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--plum-100); color: var(--plum-700); }
/* Voice gets a live dot while a call runs (voice.js marks every Talk button .live) */
.live-dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: var(--success-500); }
#pane:has([data-talk].live) .live-dot { display: inline-block; }
.pane-close { display: none; margin-left: auto; width: 28px; height: 28px; flex: none; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-600); font-size: 20px; line-height: 1; cursor: pointer; }
.pane-close:hover { background: var(--cream-deep); color: var(--ink-900); }
.pane-panel { flex: 1; min-height: 0; overflow: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; }
.pane-cap { font-size: var(--app-fs-xs); color: var(--ink-400); padding: 0 4px 6px; }
.pane-empty { align-items: center; text-align: center; gap: 12px; padding: 32px 24px; }
.pane-empty .ic { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.pane-empty b { font-size: 16px; font-weight: 600; }
.pane-empty .muted { font-size: var(--app-fs-meta); line-height: 1.5; color: var(--ink-600); }
.pane-task-text { font-size: var(--app-fs-ui); line-height: 1.5; padding: 0 4px; white-space: pre-line; overflow-wrap: anywhere; }
#pane .muted { padding: 0 4px; }
/* bl-byq.21 (3a/3b): the Task tab (js/pane.js renderTask) */
#pane-task { padding: 18px; gap: 18px; }
.tl-head { display: flex; align-items: center; gap: 8px; }
.tl-head > span:first-child { flex: 1; font-size: 17px; font-weight: 600; }
.tl { display: flex; flex-direction: column; }
.tl-cap { display: flex; align-items: center; gap: 8px; padding: 2px 0 8px; }
.tl-cap:not(:first-child) { margin-top: 16px; }
.tl-cap > span:first-child, .tl-eyebrow { flex: 1; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-400); }
.cj-badge.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; padding: 1px 7px; border-radius: var(--radius-xs); }
.tl-step { display: flex; gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--sage-100); color: var(--success-ink); display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; }
.tl-step.you .tl-dot { color: var(--sage-600); }
.tl-step.fail .tl-dot { background: var(--error-100); color: var(--error-ink); }
.tl-step.now .tl-dot { background: var(--plum-500); box-shadow: 0 0 0 4px var(--plum-100); }
.tl-line { width: 2px; flex: 1; min-height: 12px; background: var(--line); }
.tl-body { display: flex; flex-direction: column; min-width: 0; padding-bottom: 8px; }
.tl-body .t { font-size: 14px; overflow-wrap: anywhere; }
.tl-step.now .t, .tl-step.you .t { font-weight: 600; }
.tl-body small, .tl-sees small { font-size: 12px; color: var(--ink-400); line-height: 1.45; }
.tl-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-md); background: var(--cream); border: 1px solid var(--line); }
.tl-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.tl-grid > :nth-child(odd) { color: var(--ink-400); }
.tl-grid > :nth-child(even) { overflow-wrap: anywhere; }
.tl-card a { font-size: 13px; font-weight: 600; }
.tl-sees { display: flex; flex-direction: column; gap: 6px; }
.tl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.5; color: var(--ink-600); padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); overflow-wrap: anywhere; }
/* Docs tab: title + "created 10:41" + draft badge, no collection name */
.chat-docs-item { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius-sm); }
.chat-docs-item:hover, #chat-docs-kb:hover { background: var(--cream); }
.doc-ic { width: 30px; height: 30px; flex: none; border-radius: var(--radius-sm); background: var(--cream-deep); color: var(--ink-600); display: flex; align-items: center; justify-content: center; }
.chat-docs-item.created .doc-ic { background: var(--sage-100); color: var(--success-ink); }
.doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-main a, .doc-main .t { font-size: var(--app-fs-ui); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-900); text-decoration: none; }
.doc-main a:hover { color: var(--plum-600); }
.doc-when { font-size: var(--app-fs-xs); color: var(--ink-400); }
.chat-docs-item .draft { flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-xs); background: var(--success-100); color: var(--success-ink); }
#chat-docs-kb { margin-top: 6px; padding: 8px 6px; font-size: var(--app-fs-meta); color: var(--ink-600); text-decoration: none; border-radius: var(--radius-sm); }
#chat-docs-kb[aria-disabled="true"] { color: var(--ink-200); pointer-events: none; }
/* Usage tab: the total, the per-agent split on a tandem, the context meter */
#pane-usage { padding: 18px; gap: 16px; }
.usage-total { display: flex; flex-direction: column; gap: 2px; }
.usage-total b { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.usage-total span { font-size: var(--app-fs-meta); color: var(--ink-600); }
.usage-split, .usage-ctx-bar { display: flex; border-radius: var(--radius-pill); overflow: hidden; background: var(--cream-deep); }
.usage-split { height: 8px; }
.usage-split span:nth-child(1), .usage-agent:nth-child(1) i { background: var(--plum-500); }
.usage-split span:nth-child(2), .usage-agent:nth-child(2) i { background: var(--plum-300); }
.usage-agents { display: flex; flex-direction: column; gap: 8px; font-size: var(--app-fs-ui); }
.usage-agent { display: flex; align-items: center; gap: 8px; }
.usage-agent i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.usage-agent span { flex: 1; }
.usage-agent b { font-weight: 600; font-variant-numeric: tabular-nums; }
.usage-note { font-size: var(--app-fs-xs); }
.usage-ctx { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.usage-ctx > div:first-child { display: flex; font-size: var(--app-fs-ui); }
.usage-ctx > div:first-child span { flex: 1; }
.usage-ctx-bar { height: 6px; }
.usage-ctx-bar span { border-radius: var(--radius-pill); background: var(--sage-600); }
/* Below 1200px the pane is a sheet over the chat from the right; under 760px a bottom sheet */
@media (max-width: 1199px) {
  #pane { position: absolute; top: 0; right: 0; bottom: 0; z-index: 15; max-width: 100%; box-shadow: var(--shadow-hover); }
  .pane-close { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 759px) {
  #pane { position: fixed; top: auto; left: 0; width: auto; max-height: 70vh; border-left: 0; border-top: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
.bubble { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--plum-100); color: var(--ink-900); }
/* bl-byq.5 (3a): a prompt an A2A task typed, under its "<token> · via A2A" tag (js/chat.js viaLine) */
.chat-via { align-self: flex-end; max-width: 85%; margin-bottom: -6px; }
.chat-via > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bubble.user.via { background: var(--terracotta-100); }
.bubble.assistant { align-self: flex-start; background: var(--white); border: 1px solid var(--line); }
/* bl-3tv.6: one tandem exchange (primary asks, secondary replies) */
.bubble.tandem { align-self: flex-start; background: var(--cream); border: 1px dashed var(--line-strong); }
.bubble.tandem .tandem-head, .bubble.tandem .tandem-a > summary { font-size: 13px; font-weight: 600; color: var(--ink-600); margin-bottom: 4px; }
/* bl-byq.22 (3c): "Claude · primary" on answers, "Codex · consulted by Claude · view only" on the consult card */
.bubble-head { display: flex; align-items: center; margin-bottom: 6px; font-size: var(--app-fs-xs); }
.bubble.tandem .tandem-head { display: flex; align-items: center; flex-wrap: wrap; }
.bubble.tandem .tandem-head b { color: var(--plum-700); }
.bubble.tandem .tandem-ro { margin-left: 8px; font-size: var(--app-fs-xs); font-weight: 400; color: var(--ink-400); }
.bubble.tandem .tandem-a { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.bubble.tandem .tandem-a > summary { cursor: pointer; }
.bubble.tandem[data-state="error"] .tandem-a > summary { color: var(--terracotta-600); }
.bubble p { margin: 0 0 8px; }
.bubble pre { margin: 0 0 8px; padding: 10px 12px; background: var(--cream); border-radius: 8px; overflow-x: auto; max-height: 320px; overflow-y: auto; font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; }
.bubble pre code { background: none; padding: 0; border-radius: 0; }
.bubble code { font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; background: var(--cream); padding: 1px 5px; border-radius: 6px; }
.bubble ul, .bubble ol { margin: 0 0 8px; padding-left: 22px; }
.bubble li { margin: 2px 0; }
.bubble li > p { margin: 0 0 4px; }
.bubble blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--line-strong); background: var(--cream); border-radius: 0 8px 8px 0; color: var(--ink-600); }
.bubble blockquote > :last-child { margin-bottom: 0; }
.bubble table { border-collapse: collapse; margin: 0 0 8px; font-size: 14px; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.bubble th { background: var(--cream); font-weight: 600; }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 { margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.bubble h1 { font-size: 19px; } .bubble h2 { font-size: 18px; } .bubble h3 { font-size: 16px; } .bubble h4 { font-size: 15px; }
.bubble > :last-child { margin-bottom: 0; }
/* bl-byq.21 (3a/3b): A2A events between chat messages (js/chat.js divider) */
.chat-divider { align-self: stretch; display: flex; align-items: center; gap: 10px; font-size: var(--app-fs-xs); color: var(--ink-400); }
.chat-divider.line::before, .chat-divider.line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.chat-divider.a2a, .chat-divider.you { color: var(--a2a-ink); font-weight: 600; }
.chat-divider.a2a::before, .chat-divider.a2a::after, .chat-divider.you::before, .chat-divider.you::after { background: var(--terracotta-500); opacity: .45; }
.chat-divider .av { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--sage-100); color: var(--sage-600); font-size: 8px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.chat-divider.allow, .chat-divider.deny { gap: 8px; padding: 8px 12px; border-radius: var(--radius-md); background: var(--cream-deep); font-size: 13px; color: var(--ink-600); }
.chat-divider.allow svg, .chat-divider.deny svg { flex: none; }
.chat-skill { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--plum-100); color: var(--plum-700); font-size: 13px; font-weight: 600; }
.chat-tools { align-self: flex-start; max-width: 85%; font-size: 13px; color: var(--ink-600); }
.chat-tools summary { cursor: pointer; }
.chat-tool { padding: 2px 0 0 16px; font: 12px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; overflow-wrap: anywhere; }
.term-wrap { flex: 1; min-height: 0; display: flex; padding: 24px 28px; }
/* bl-byq.26 (3g): the end-of-session bar, in place of the composer (Chat) or above the terminal */
.ended-bar { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-md); box-shadow: var(--shadow-xs); }
#term-pane > .ended-bar { margin: 24px 28px 0; }
.ended-bar .ended-top { display: flex; align-items: center; gap: 8px; font-size: var(--app-fs-ui); }
.ended-bar .ended-top b { flex: 1; font-weight: 600; }
.ended-bar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ended-bar #ended-note { margin: 0; font-size: var(--app-fs-xs); color: var(--ink-400); }
.ended-link { border: 0; background: none; padding: 0; font: inherit; font-size: var(--app-fs-meta); font-weight: 500; color: var(--plum-600); cursor: pointer; }
.ended-link:hover { text-decoration: underline; }
/* bl-byq.26 (3g): the connection's state line under the header */
.state-line { flex: none; margin: 14px 24px 0; padding: 10px 14px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px; font-size: var(--app-fs-meta); background: var(--plum-050); color: var(--plum-700); }
.state-line > span { flex: 1; min-width: 0; }
.state-line.warn { background: var(--warning-100); color: var(--warning-ink); }
.state-line.warn::before { content: ''; width: 12px; height: 12px; flex: none; box-sizing: border-box; border-radius: 50%; border: 2px solid #EBCB8F; border-top-color: var(--warning-ink); animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .state-line.warn::before { animation: none; } }
.state-act { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; }
.state-line.warn .state-act { text-decoration: underline; text-underline-offset: 2px; }
.state-act:focus-visible { box-shadow: var(--ring); border-radius: var(--radius-xs); }
@media (max-width: 759px) { .state-line { margin-left: 16px; margin-right: 16px; } #term-pane > .ended-bar { margin: 16px 16px 0; } }
#term { flex: 1; min-width: 0; min-height: 0; padding: 12px; background: var(--ink-900); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }

/* settings (1d); getting started (bl-9uv.1) reuses the same page layout */
#view-guide { overflow: auto; padding: 36px 48px; align-items: center; }
.page { width: 100%; max-width: 880px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 36px; }
.section { padding: 24px 26px; display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; align-items: flex-start; gap: 16px; }
.section-head .ic { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.section-head .txt { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.section-head .txt b { font-size: 18px; font-weight: 600; }
.section-head .txt span { font-size: 15px; line-height: 1.55; color: var(--ink-600); }
.rows { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row .t b { font-size: 15px; font-weight: 500; }
.row .t small { font-size: 13px; color: var(--ink-400); }
/* Settings › Agent tokens (3e): list + detail; the detail moves under its row below 900px (agents.js place) */
.settings__sec.tok-sec { max-width: 1200px; }
.tok-top { display: flex; align-items: flex-start; gap: var(--space-4); }
.tok-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tok-top p { margin: 0; max-width: 560px; font-size: var(--app-fs-ui); line-height: 1.5; color: var(--ink-600); }
.tok-page { display: flex; gap: 20px; align-items: flex-start; }
.tok-list { width: 380px; flex: none; display: flex; flex-direction: column; gap: 8px; }
#agent-tokens { display: flex; flex-direction: column; gap: 6px; }
.tok-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tok-chip { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: transparent; color: var(--ink-600); cursor: pointer; }
.tok-chip[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: var(--white); font-weight: 600; }
.tok-row { font: inherit; text-align: left; color: var(--ink-900); display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--white); border: 1px solid var(--line); cursor: pointer; }
.tok-row:hover { box-shadow: var(--shadow-xs); }
.tok-row[aria-expanded="true"] { border: 1.5px solid var(--plum-500); padding: 13.5px; box-shadow: var(--shadow-sm); }
.tok-row__head { display: flex; align-items: center; gap: 10px; }
.tok-row__head b { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.tok-row .cj-badge--xs { margin-left: 0; }
.tok-ic { width: 28px; height: 28px; flex: none; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--terracotta-100); color: var(--a2a-ink); }
.tok-row.is-off .tok-ic { background: var(--cream-deep); color: var(--ink-400); }
.tok-row.is-off b { color: var(--ink-600); }
.tok-meta { font-size: 13px; color: var(--ink-600); }
.tok-row.is-off .tok-meta, .tok-row.is-off .tok-use { color: var(--ink-400); }
.tok-use { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-600); }
.tok-use.is-live { color: var(--success-ink); }
.tok-use.is-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--sage-600); flex: none; }
.tok-err { font-size: 12px; line-height: 1.45; color: var(--error-ink); }
.tok-none { margin: 8px 2px; }
.tok-side { flex: 1; min-width: 0; }
.tok-pick { margin: 0; padding: 22px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--ink-400); font-size: var(--app-fs-ui); }
.tok-detail:not([hidden]) + .tok-pick, .tok-page:has(#agent-tokens > .list-state) .tok-side { display: none; }
.tok-detail { background: var(--white); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: hidden; }
.tok-detail__top { padding: 20px 22px 16px; display: flex; flex-direction: column; gap: 14px; border-bottom: 1px solid var(--line); }
.tok-detail__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tok-detail__head h3 { flex: 1; min-width: 0; margin: 0; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.tok-revoke { color: var(--error-ink); border-color: var(--error-100); }
.tok-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; font-size: 13px; }
.tok-facts div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tok-facts dt { font-size: 12px; color: var(--ink-400); }
.tok-facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.tok-activity { padding: 12px 22px 16px; display: flex; flex-direction: column; }
.act-title-row { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.act-title-row b { flex: 1; font-size: 15px; font-weight: 600; }
.act-title-row small { font-size: 12px; color: var(--ink-400); }
.act { display: flex; flex-direction: column; gap: 4px; padding: 7px 2px; }
.act + .act { border-top: 1px solid var(--line); }
.act-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.act-head .act-state { margin-left: 0; font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.act-head .act-state .cj-badge__dot { display: none; }
.act-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-title.muted { color: var(--ink-600); }
.act-head small { font-size: 12px; color: var(--ink-400); white-space: nowrap; }
.act-msg { margin: 0; font-size: 13px; color: var(--ink-600); overflow-wrap: anywhere; }
.act-events { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--ink-600); }
.ev { padding: 2px 8px; border-radius: 6px; background: var(--cream); border: 1px solid var(--line); overflow-wrap: anywhere; }
.ev--plum { background: var(--plum-050); border-color: var(--plum-100); color: var(--plum-700); }
.ev--error { background: var(--error-100); border-color: var(--error-100); color: var(--error-ink); }
.ev--doc { background: var(--sage-100); border-color: var(--sage-100); color: var(--success-ink); }
@media (max-width: 900px) {
  .tok-page { flex-direction: column; }
  .tok-list { width: 100%; }
  .tok-side { display: none; }
  .tok-top { flex-wrap: wrap; }
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stats div { background: var(--cream); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.stats span { font-size: 13px; color: var(--ink-400); }
.toggle { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#add-dlg pre { margin: 0; padding: 12px 14px; background: var(--ink-900); color: #F3EDE2; border-radius: 12px; font: var(--app-fs-xs)/1.6 ui-monospace, 'SF Mono', Menlo, monospace; white-space: pre-wrap; word-break: break-all; }

/* Voice assistant tab (bl-byq.20, 3c): live call card above the transcript */
#pane-voice { padding: 0; gap: 0; }
#voice-idle { display: flex; flex-direction: column; }
#voice-float { position: fixed; top: 16px; right: 16px; z-index: 900; width: 340px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.vp-main { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 18px; border-bottom: 1px solid var(--line); text-align: center; }
.vp-head { width: 100%; display: flex; align-items: center; gap: 10px; }
.vp-head > span:first-child { flex: 1; font-size: var(--app-fs-xs); color: var(--ink-400); text-align: left; }
.vp-status { display: flex; flex-direction: column; gap: 2px; }
.orb { width: 104px; height: 104px; border-radius: 50%; background: var(--plum-050); display: flex; align-items: center; justify-content: center; }
.orb > div { width: 72px; height: 72px; border-radius: 50%; background: var(--plum-100); display: flex; align-items: center; justify-content: center; gap: 4px; }
.orb i { width: 4px; height: 24px; border-radius: 2px; background: var(--plum-500); transform: scaleY(.3); transform-origin: center; }
.orb.active i { animation: bar 1s ease-in-out infinite alternate; }
.orb.active i:nth-child(2n) { animation-delay: -.4s; } .orb.active i:nth-child(3n) { animation-delay: -.7s; }
@keyframes bar { from { transform: scaleY(.3); } to { transform: scaleY(1.2); } }
#voice-status { font-size: 16px; font-weight: 600; }
#transcript { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
#transcript div { display: flex; flex-direction: column; gap: 2px; }
#transcript b { font-size: 12px; font-weight: 600; color: var(--ink-400); }
#transcript b.ai { color: var(--plum-600); }
#transcript span { font-size: 14px; line-height: 1.5; }

/* curator: session picker and the proposals above the chat box */
#curator-list { max-height: 50vh; overflow: auto; }
#curator-list label { cursor: pointer; }
#curator-list input[type="checkbox"] { accent-color: var(--plum-500); }
#curator-filters { font-size: var(--app-fs-xs); color: var(--ink-400); }
#curator-filters > label { flex: 1 1 150px; display: flex; align-items: center; gap: 8px; }
#curator-machine { flex: 1.2 1 150px; }
#curator-list .row { padding: 9px 12px; gap: 10px; font-size: var(--app-fs-meta); }
#curator-list .row .muted { font-size: inherit; }
#curator-list .row .t b { font-size: var(--app-fs-meta); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#curator-props { flex: none; max-height: 45%; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
#curator-props[hidden] { display: none; }
.prop { border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--white); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.prop pre { margin: 0; padding: 8px 10px; background: var(--cream); border-radius: 8px; max-height: 240px; overflow: auto; font: 12px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; }
.prop .actions { display: flex; gap: 8px; align-items: center; }
.prop input { flex: 1; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
/* bl-byq.12 (3f): one dialog system. Header (title, one-line description) · body · optional danger zone ·
   footer on cream with the actions right-aligned. 440 confirm · 520 form · 640 lists; at 85vh only the body scrolls. */
.dlg { width: min(520px, calc(100vw - 32px)); max-height: 85vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--white); box-shadow: var(--shadow-hover); color: var(--ink-900); overflow: hidden; }
.dlg[open] { display: flex; flex-direction: column; }
.dlg--confirm { width: min(440px, calc(100vw - 32px)); }
/* bl-xll.2: the erase confirm's Goes / Stays / Note blocks; a short viewport scrolls the text, the buttons stay */
.dlg--confirm .dlg__head { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
.dlg__desc .erase-blk { display: block; }
.dlg__desc .erase-blk + .erase-blk { margin-top: 10px; }
.dlg__desc .erase-line { display: block; margin-top: 6px; }
.dlg__desc a { color: var(--plum-600); }
#view-session.erased #pane { display: none !important; }
.dlg--list { width: min(640px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgb(28 26 23 / .35); }
/* bl-byq.25 (3j): the ⌘K palette, top-aligned */
.kbd { font: inherit; font-size: var(--app-fs-xs); color: var(--ink-400); border: 1px solid var(--line-strong); border-radius: 6px; padding: 1px 6px; }
.dlg--palette { width: min(640px, calc(100vw - 32px)); margin: min(120px, 10vh) auto auto; max-height: calc(100vh - min(120px, 10vh) - 24px); }
.pal-bar { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--ink-400); }
.pal-bar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink-900); }
.pal-bar input::-webkit-search-cancel-button { display: none; }
.pal-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.pal-list:empty { display: none; }
.pal-group { display: flex; flex-direction: column; gap: 2px; }
.pal-cap { font-size: var(--app-fs-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-400); padding: 10px 12px 6px; }
.pal-group:first-child .pal-cap { padding-top: 6px; }
.pal-row { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-row[aria-selected="true"] { background: var(--plum-050); }
.pal-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pal-head { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.pal-head b { font-size: var(--app-fs-ui); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-head small { flex: none; font-size: var(--app-fs-xs); color: var(--ink-400); }
.pal-snip { font-size: var(--app-fs-meta); line-height: 1.45; color: var(--ink-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-row mark { background: var(--warning-100); color: var(--ink-900); border-radius: 3px; padding: 0 2px; }
.pal-open { flex: none; align-self: center; font-size: var(--app-fs-xs); font-weight: 500; color: var(--plum-600); visibility: hidden; }
.pal-row[aria-selected="true"] .pal-open { visibility: visible; }
.pal-empty { padding: 10px 12px; margin: 0; }
.pal-foot { flex: none; display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--cream); font-size: var(--app-fs-xs); color: var(--ink-400); }
@media (max-width: 600px) { .pal-foot span:last-child { display: none; } }
.dlg__head { flex: none; display: flex; gap: 14px; padding: 20px 22px; }
.dlg__head:has(+ .dlg__body:not([hidden])) { padding-bottom: 0; }
.dlg__head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dlg__title { font-size: var(--app-fs-dlg); font-weight: 600; line-height: 1.3; }
.dlg__desc { margin: 0; font-size: var(--app-fs-ui); line-height: 1.5; color: var(--ink-600); text-wrap: pretty; }
.dlg__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg__body:first-child { padding-top: 22px; }
.dlg__body > * { flex-shrink: 0; } /* the body scrolls; a box with overflow hidden must not shrink and clip */
/* bl-efd.1: the sign-in notice */
.notice-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: var(--app-fs-ui); line-height: 1.5; color: var(--ink-600); }
.dlg__body > .err:empty { display: none; }
.dlg__danger { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius-md); border: 1px solid #E9B8AA; background: #FDF6F3; font-size: var(--app-fs-meta); }
.dlg__danger .row { padding: 0; border: 0; }
.row .t b.env { font: 600 13px/1.4 ui-monospace, 'SF Mono', Menlo, monospace; }
.dlg__foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: var(--cream); border-top: 1px solid var(--line); }
.dlg__field { display: flex; flex-direction: column; gap: 6px; font-size: var(--app-fs-meta); font-weight: 600; }
.dlg__field code { font-weight: 500; padding: 1px 5px; border-radius: var(--radius-xs); background: var(--cream-deep); }
/* bl-byq.13 (3f): form fields, two per row on wide screens; hints and errors under the field */
.dlg__field .input, .dlg__hint, .dlg__field .input-err { font-weight: 400; }
.dlg__hint { font-size: var(--app-fs-xs); line-height: 1.45; color: var(--ink-400); }
#curator-excluded { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); } /* bl-efd.2 */
.dlg__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .dlg__row { grid-template-columns: 1fr; } }
.dlg__icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
/* the collapsible warning: the first sentence always shows, the bullets on Show details */
.dlg__warn { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--warning-100); color: var(--warning-ink); font-size: var(--app-fs-meta); line-height: 1.5; }
.dlg__warn-head { display: flex; gap: 10px; align-items: flex-start; }
.dlg__warn-head svg { flex: none; margin-top: 2px; }
.dlg__warn-toggle { flex: none; border: 0; padding: 0; background: none; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; cursor: pointer; }
.dlg__warn ul { margin: 0; padding: 0 0 0 42px; display: flex; flex-direction: column; gap: 4px; }
.dlg__warn ul[hidden] { display: none; }
/* secret shown once: prefix muted, the rest monospace and middle-ellipsised (the tail stays visible; the DOM holds it all) */
.secret-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 12px; background: var(--cream); border: 1px solid var(--line-strong); }
#agent-token { flex: 1; min-width: 0; display: flex; font: 13px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; white-space: nowrap; }
#agent-token .tok-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#agent-token .tok-tail { flex: none; }
#agent-token .tok-pre { color: var(--ink-400); }
.secret-meta { display: grid; grid-template-columns: 96px minmax(0, 1fr); row-gap: 6px; align-items: center; font-size: var(--app-fs-meta); }
.secret-meta .muted { font-size: inherit; }
.secret-endpoint { display: flex; align-items: center; gap: 8px; min-width: 0; }
.secret-endpoint code { min-width: 0; overflow-wrap: anywhere; font: 12px/1.5 ui-monospace, 'SF Mono', Menlo, monospace; }
.check { display: flex; align-items: center; gap: 10px; font-size: var(--app-fs-ui); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--plum-500); }
/* bl-byq.14 (3f): a field's one-line hint, a row of controls, a cream inset box, a text button */
.dlg__hint code, .dlg__desc code { font: var(--app-fs-meta) ui-monospace, 'SF Mono', Menlo, monospace; }
.dlg__line { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
#curator-filters, #add-cloud { align-items: center; }
.dlg__line > .input { min-width: 120px; }
.dlg__box { padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--cream); }
.dlg__box summary { cursor: pointer; font-size: var(--app-fs-ui); font-weight: 600; }
.dlg__box > * + * { display: block; margin-top: 12px; }
.dlg__box > .dlg__line { display: flex; }
.dlg__link { font: inherit; font-weight: 500; color: var(--plum-600); background: none; border: 0; padding: 0; cursor: pointer; }
.dlg__link:hover { color: var(--plum-700); text-decoration: underline; }
.rows__head { padding: 9px 12px; background: var(--cream); font-size: var(--app-fs-meta); }
.rows__head .t { font-weight: 600; }
/* destructive replaces the primary; Cancel stays secondary */
.cj-btn--danger { background: var(--error-500); color: var(--white); box-shadow: var(--shadow-sm); }
.cj-btn--danger:hover { background: var(--error-ink); color: var(--white); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
/* secondary + danger = the outline variant (3i Log out): red text and border, white fill */
.cj-btn--secondary.cj-btn--danger { background: var(--white); border-color: #E9B8AA; color: var(--error-ink); box-shadow: none; }
.cj-btn--secondary.cj-btn--danger:hover { background: var(--error-100); border-color: var(--error-500); color: var(--error-ink); box-shadow: var(--shadow-sm); }
#share-list { display: flex; flex-direction: column; gap: 6px; }
#share-list .row { padding: 8px 12px; }
#ps-creds .row { padding: 8px 12px; flex-wrap: wrap; }
#share-fallback, #share-docs-wrap, #ps-sf-wrap { display: flex; flex-direction: column; gap: 8px; }
#ps-sf-wrap .row { padding: 8px 12px; }
/* the recipient filter sits on top of the picker, one bordered box */
#share-picker-wrap { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
#share-picker-wrap #share-filter { border: 0; border-radius: 0; background: var(--cream); }
#share-picker-wrap .rows { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
#share-picker-wrap .rows:empty { display: none; }
#share-filter, #share-email { width: 100%; }
#skills-summary { cursor: pointer; font-size: 15px; font-weight: 500; padding: 4px 0; }
#skills-details[open] > #skills-summary { margin-bottom: 8px; }
#skills-filter { width: 100%; margin-bottom: 8px; }
#share-picker, #share-docs { max-height: 30vh; overflow: auto; }
#share-picker label { cursor: pointer; }
#share-picker input[type="checkbox"], #share-docs input[type="checkbox"] { accent-color: var(--plum-500); }
#share-picker .row, #share-docs .row { padding: 8px 12px; }
#share-docs .row { gap: 10px; }
#share-docs .row .t b, #share-docs .row .t a { font-size: var(--app-fs-ui); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#share-docs select { flex: none; width: auto; }
.share-doc-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 3px; }
.share-doc-tags .cj-badge--xs { margin-left: 0; }
#share-outcome { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
#share-outcome:empty { display: none; }
#add-status { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px; border-radius: var(--radius-md); background: var(--plum-050); font-size: var(--app-fs-meta); color: var(--plum-700); }
#add-status:empty { display: none; }
#add-status.is-waiting::before { content: ''; flex: none; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%; border: 2px solid var(--plum-100); border-top-color: var(--plum-500); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #add-status.is-waiting::before { animation: none; } }
#add-cloud { font-size: var(--app-fs-meta); color: var(--ink-600); }
#add-dl { height: var(--h-input); --_pad-y: 0px; --_pad-x: 14px; --_fs: 14px; }
/* Import: a native file input stretched over the drop zone takes both the click and the drop */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px; border-radius: var(--radius-md); border: 1.5px dashed var(--line-strong); background: var(--cream); font-size: var(--app-fs-ui); text-align: center; cursor: pointer; }
.drop:hover, .drop:focus-within { border-color: var(--plum-500); }
.drop:focus-within { box-shadow: var(--ring); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop small { font-size: var(--app-fs-xs); color: var(--ink-400); }
.drop__link { color: var(--plum-600); }
#import-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: var(--app-fs-meta); }
#import-list:empty { display: none; }
#import-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; justify-content: space-between; }
#import-list li > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#import-list li > span:nth-child(2):not(.err) { color: var(--ink-400); }
#import-list li > a { color: var(--success-ink); font-weight: 600; }
#import-list li > .err { color: var(--error-ink); }
#import-list progress { flex: 1 1 100%; height: 4px; border: 0; border-radius: var(--radius-pill); background: var(--cream-deep); accent-color: var(--plum-500); }
#import-list progress::-webkit-progress-bar { background: var(--cream-deep); border-radius: var(--radius-pill); }
#import-list progress::-webkit-progress-value { background: var(--plum-500); border-radius: var(--radius-pill); }
#import-list progress::-moz-progress-bar { background: var(--plum-500); border-radius: var(--radius-pill); }

/* login */
#login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 48px 16px; }

/* getting started (bl-9uv.1): step number badge; everything else reuses the settings classes */
.guide-num { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  flex: none; background: var(--plum-100); color: var(--plum-600); font-size: 20px; font-weight: 600; }

/* product tour (bl-9uv.2): dim box plus tooltip card, both positioned from JS */
#tour-box { position: fixed; z-index: 90; pointer-events: none; border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(28, 26, 23, .5); transition: all .2s; }
#tour-tip { position: fixed; z-index: 91; width: 320px; max-width: calc(100vw - 32px);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; }
#tour-tip p { margin: 0; }
#tour-btns { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
#tour-count { flex: 1; white-space: nowrap; }

@media (max-height: 700px) { #side .eyebrow { padding-top: 14px; } }
@media (max-width: 900px) {
  /* bl-byq.24 (3d): the content is the first screen; the sidebar is an off-canvas drawer (js/app.js setDrawer).
     #app keeps its fixed height: the chat and the terminal fit rely on the flex column (bl-hym). */
  #app { flex-direction: column; height: 100dvh; }
  #side-bar { display: flex; }
  #side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 288px; max-width: 85vw; box-sizing: border-box; transform: translateX(-100%); transition: transform .2s ease; }
  #side.open { transform: none; box-shadow: var(--shadow-hover); } /* none, not translateX(0): the fixed menus inside position from the viewport */
  #side-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(28, 26, 23, .4); }
  #view-home, #view-guide { padding: 32px 16px; }
  .hero h1 { font-size: 34px; }
  .tiles, .stats { grid-template-columns: 1fr; }
  .composer .bar { flex-wrap: wrap; } /* dictation controls (bl-bwq.79) wrap instead of squeezing */
  /* bl-yqw: the chat box takes its own row so the controls never squeeze it to nothing */
  #chat-form { flex-wrap: wrap; justify-content: flex-end; }
  #chat-input { flex-basis: 100%; }
  #chat-form.expanded { flex: none; }
  #chat-form.expanded #chat-input { height: 55vh; }
  /* bl-bwq.80: dictate-status is an absolute caption under the mic, so it never squeezes the chat input */
  .sess-head { height: auto; padding: 12px 16px; flex-wrap: wrap; }
  .sess-head .ttl { flex-basis: 100%; }
  .term-wrap { padding: 12px 16px; }
  .page-head h1 { font-size: 28px; }
}
@media (max-width: 900px) {
  /* product tour (bl-9uv.2): the tip becomes a bottom sheet; the box still tracks the anchor */
  #tour-tip { left: 16px; right: 16px; bottom: 16px; top: auto; width: auto; }
}

/* settings rail (bl-byq.16, 3e/3i): rail + one section; below 900px the rail is a scrollable tab strip */
#view-settings { flex-direction: row; overflow: auto; }
.settings__rail { width: var(--w-settings-rail); flex: none; border-right: 1px solid var(--line); padding: var(--space-5) var(--space-3); display: flex; flex-direction: column; gap: 18px; }
.settings__rail > b { font-size: var(--app-fs-h); font-weight: 600; letter-spacing: -0.01em; padding: 0 10px; }
.settings__group { display: flex; flex-direction: column; gap: 2px; }
.settings__group > span { font-size: var(--app-fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-400); padding: 0 10px 6px; }
.settings__rail a { display: flex; align-items: center; gap: var(--space-2); font-size: var(--app-fs-ui); padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-600); text-decoration: none; white-space: nowrap; }
.settings__rail a:hover { color: var(--ink-900); }
.settings__rail a.active { font-weight: 600; color: var(--ink-900); background: var(--white); box-shadow: var(--shadow-xs); }
.settings__rail a > span:first-child { flex: 1; }
/* Notifications / Session replay exist only when their card does (push.js, app.js initAnalytics) */
#view-settings:has(#push-card[hidden]) a[data-card="push-card"], #view-settings:has(#analytics-card[hidden]) a[data-card="analytics-card"] { display: none; }
.rail-count { color: var(--ink-400); }
.rail-live { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--radius-xs); background: var(--terracotta-100); color: var(--a2a-ink); }
.settings__main { flex: 1; min-width: 0; padding: 28px var(--space-6); }
.settings__sec { max-width: 880px; display: flex; flex-direction: column; gap: 20px; }
.settings__title { margin: 0; font-size: var(--app-fs-title); font-weight: 600; letter-spacing: -0.02em; }
.profile { max-width: 640px; overflow: hidden; }
.profile__who, .profile__row { display: flex; align-items: center; gap: var(--space-4); padding: 18px 20px; }
.profile__who { gap: 14px; padding: 20px; }
.profile__row { border-top: 1px solid var(--line); }
.profile__who > div, .profile__row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile__who small { font-size: var(--app-fs-meta); color: var(--ink-400); }
.profile__who b { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.profile__row b { font-size: var(--app-fs-chat); font-weight: 600; }
.profile__row small { font-size: var(--app-fs-meta); color: var(--ink-600); }
.profile__avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--sage-100); color: var(--sage-600); font-size: var(--app-fs-chat); font-weight: 600; display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) {
  #view-settings { flex-direction: column; }
  .settings__rail { width: auto; flex-direction: row; gap: 2px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--space-2) var(--space-4); }
  .settings__rail > b, .settings__group > span { display: none; }
  .settings__group { flex-direction: row; gap: 2px; }
  .settings__main { padding: 20px var(--space-4) var(--space-6); }
}
