/* The header's breadcrumb and Progress pill, and the Progress drawer
   (panel-header.js, panel-progress.js). FLINT only: ink, bone, rim; Newsreader
   for titles, Alegreya Sans for body, IBM Plex Mono for labels, meta and
   timers; 16px card radius. The active step's dot is rim (no FLINT accent
   token exists beyond it). Motion is at most 180ms, none when reduced. */

/* ---- breadcrumb ----------------------------------------------------------- */
/* The project crumb (074): mark and name (opens its home), its chevron (the
   project menu), then the slash. It yields first in a narrow panel: the name
   ellipsises before the conversation's does. */
.chat-project {
  flex: 0 1 auto; min-width: 0; max-width: 42%;
  display: inline-flex; align-items: center; gap: 2px;
  white-space: nowrap;
  font: 400 var(--fs-lg)/1.4 var(--sans);
  color: var(--t-secondary);
}
.chat-project[hidden] { display: none; }
.chat-project-open {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  padding: 2px 6px 2px 4px; border: 0; border-radius: var(--r-ctl-sm);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.chat-project-open:hover, .chat-project-open:focus-visible { background: var(--s-inter); color: var(--t-primary); }
.chat-project-open:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }
.chat-project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-project-glyph.proj-glyph { width: auto; height: auto; background: none; border-radius: 0; }
.chat-project-glyph svg { width: 14px; height: 14px; stroke: currentColor; }
.chat-project-menu { margin-left: -4px; }
.chat-project-sep { margin: 0 4px 0 2px; color: var(--t-faint); }
.main-top .chat-name { flex: 0 1 auto; }
.chat-menu {
  flex: none; display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-left: -6px; padding: 0;
  border: 0; border-radius: var(--r-ctl-sm);
  background: transparent; color: var(--t-faint); cursor: pointer;
}
.chat-menu svg { width: 14px; height: 14px; }
.chat-menu:hover, .chat-menu:focus-visible { background: var(--s-inter); color: var(--t-primary); }
.chat-menu[hidden] { display: none; }

/* With the pill on, the observing line ("Reading along: <tab>") sits on the
   title's row, centred in the space between the title and the pill (Godric,
   2026-11-16). It takes that space and ellipsises inside it, so the title and
   the pill keep their own widths. */
.main-top:has(.px-progress-pill) .observing { flex: 1 1 0; max-width: none; margin-left: 0; justify-content: center; }

/* ---- the pill ----------------------------------------------------------------- */
.px-progress-pill {
  position: relative;
  flex: none; margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 30px; height: 30px; padding: 0;
  border: none; background: transparent; cursor: pointer;
  color: var(--t-meta);
  font: 400 var(--fs-sm)/1 var(--mono); letter-spacing: .02em; white-space: nowrap;
}
/* The same bare glyph as the rail's toggle (.collapse-btn), on the other side:
   no plate, so hover is said by the stroke. */
.px-progress-pill svg { width: 18px; height: 18px; flex: none; }
.px-progress-pill:hover, .px-progress-pill:focus-visible, .px-progress-pill[aria-expanded="true"] { color: var(--bone); }
.px-progress-pill.has-steps { padding: 0 4px; }
.px-progress-pill:not(.has-steps) .px-progress-pill-text { display: none; }
.px-progress-pill-dot {
  position: absolute; top: -2px; right: -2px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rim); box-shadow: 0 0 0 2px var(--ink);
}
.px-progress-pill-dot[hidden] { display: none; }

/* ---- the drawer ----------------------------------------------------------------- */
.px-progress {
  display: flex; flex-direction: column;
  width: min(340px, 100vw); box-sizing: border-box;
  background: var(--ink); color: var(--t-body);
  border-left: 1px solid var(--hair);
  z-index: var(--z-rail);
}
.px-progress[hidden] { display: none; }
.px-progress.is-overlay {
  position: fixed; top: 0; right: 0; bottom: 0;
  box-shadow: -12px 0 32px rgba(0, 0, 0, calc(.28 * var(--shadow-k)));
  animation: px-progress-in var(--dur-2) ease-out;
}
.app.px-progress-docked > .px-progress { position: relative; flex: none; height: 100vh; }
@keyframes px-progress-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.px-progress-scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-rail) - 1);
  background: rgba(var(--ink-rgb, 8, 9, 10), .42);
  animation: px-progress-fade var(--dur-2) ease-out;
}
.px-progress-scrim[hidden] { display: none; }
@keyframes px-progress-fade { from { opacity: 0; } to { opacity: 1; } }

.px-progress-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 66px; padding: 18px 18px 12px 22px; box-sizing: border-box;
}
.px-progress-title { margin: 0; font: 400 var(--fs-2xl)/1.2 var(--serif); color: var(--t-primary); }
/* The title is the plan's fold: › when folded or empty, ⌄ when the steps show. */
.px-progress-fold {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 0 -6px; padding: 2px 6px; border: 0; border-radius: var(--r-ctl);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.px-progress-fold:disabled { cursor: default; }
.px-progress-fold:not(:disabled):hover, .px-progress-fold:focus-visible { background: var(--s-quiet); }
.px-progress-fold svg { width: 14px; height: 14px; color: var(--t-faint); transition: transform var(--dur-1) ease-out; }
.px-progress-fold[aria-expanded="true"] svg { transform: rotate(90deg); }
.px-progress-steps[hidden] { display: none; }
.px-progress-close {
  width: var(--ctl-h); height: var(--ctl-h);
  border: 0; border-radius: var(--r-ctl); background: transparent;
  color: var(--t-meta); font: 400 var(--fs-lg)/1 var(--sans); cursor: pointer;
}
.px-progress-close:hover, .px-progress-close:focus-visible { background: var(--s-inter); color: var(--t-primary); }
.px-progress-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: var(--scroll-pad) 22px 28px; }

/* ---- steps ------------------------------------------------------------------------ */
.px-progress-earlier {
  position: relative;
  display: block; width: 100%; margin: 0; padding: 4px 0 10px 22px;
  border: 0; background: transparent; text-align: left;
  font: 400 var(--fs-sm)/1.4 var(--mono); color: var(--t-faint); cursor: pointer;
}
.px-progress-earlier::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0;
  border-left: 1px dashed rgba(var(--rim-rgb), .35);
}
.px-progress-earlier:hover, .px-progress-earlier:focus-visible { color: var(--t-secondary); }
.px-progress-earlier[hidden] { display: none; }

.px-progress-line { list-style: none; margin: 0 0 22px; padding: 0; position: relative; }
.px-step {
  position: relative;
  display: flex; align-items: baseline; gap: 8px;
  min-height: 30px; padding: 5px 0 5px 22px; box-sizing: border-box;
  font: 400 var(--fs-lg)/1.4 var(--sans);
}
/* The line, one segment per step so a failed step's segment can go dashed. */
.px-step::before {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0;
  border-left: 1px solid rgba(var(--rim-rgb), .28);
}
.px-step:first-child::before { top: 14px; }
.px-step:last-child::before { bottom: calc(100% - 14px); }
.px-step[data-status="failed"]::before, .px-step[data-status="stopped"]::before { border-left-style: dashed; }
.px-step-label { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.px-step[data-status="done"] .px-step-label,
.px-step[data-status="skipped"] .px-step-label { color: var(--t-meta); }
.px-step[data-status="failed"] .px-step-label,
.px-step[data-status="stopped"] .px-step-label { color: var(--t-meta); }
.px-step[data-status="active"] .px-step-label { color: var(--t-primary); }
.px-step[data-status="pending"] .px-step-label { color: var(--t-faint); }
.px-step.is-fade { -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent); mask-image: linear-gradient(to bottom, #000 20%, transparent); }
.px-step-dot { display: none; }
.px-step[data-status="active"] .px-step-dot {
  display: block; position: absolute; left: 0; top: 11px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--rim);
  box-shadow: 0 0 0 3px var(--ink);
  animation: px-step-pulse 1.8s ease-in-out infinite;
}
@keyframes px-step-pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--ink), 0 0 0 3px rgba(var(--rim-rgb), 0); } 50% { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px rgba(var(--rim-rgb), .22); } }
.px-step-time, .px-step-tag {
  flex: none; font: 400 var(--fs-xs)/1.4 var(--mono); color: var(--t-faint);
  font-variant-numeric: tabular-nums;
}
.px-step-tag {
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--hair); border-radius: var(--r-ctl-sm); padding: 1px 4px;
}
.px-step[data-status="failed"] .px-step-tag { color: rgba(var(--danger-rgb), .9); border-color: rgba(var(--danger-rgb), .35); }

/* ---- outputs and used ------------------------------------------------------------- */
.px-progress-sec { margin: 0 0 8px; font: 400 var(--fs-body)/1.3 var(--serif); color: var(--t-primary); }
.px-progress-outputs, .px-progress-used { margin-bottom: 22px; }
.px-progress-outputs[hidden], .px-progress-used[hidden] { display: none; }
.px-progress-out-list {
  /* The shared edge fade (pxScrollEdges), which lifts once the end is
     reached; this used to be its own permanent 18px mask. */
  max-height: 220px; overflow-y: auto;
  padding-block: var(--scroll-pad);
}
.px-out-row, .px-used-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 32px; padding: 4px 6px; box-sizing: border-box;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  text-align: left; color: var(--t-body); font: 400 var(--fs-base)/1.3 var(--sans); cursor: pointer;
}
.px-out-row:hover, .px-out-row:focus-visible, .px-used-row:hover, .px-used-row:focus-visible { background: var(--s-quiet); }
.px-out-icon { flex: none; width: 16px; height: 16px; color: var(--t-faint); }
.px-out-icon svg { width: 16px; height: 16px; display: block; }
.px-out-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-out-tag {
  flex: none; font: 500 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--t-meta);
}
.px-used-icon { flex: none; width: 16px; height: 16px; color: var(--t-faint); }
.px-used-icon svg { width: 16px; height: 16px; display: block; }
.px-out-icon .cn-logo, .px-used-logo .cn-logo { margin-right: 0; }
.px-out-ext { color: var(--t-faint); }
.px-used-label { flex: none; white-space: nowrap; }
.px-used-meta {
  flex: 1 1 auto; justify-content: flex-end; min-width: 0; display: inline-flex; align-items: center; gap: 6px;
  font: 400 var(--fs-sm)/1.3 var(--mono); color: var(--t-meta);
  overflow: hidden; white-space: nowrap;
}
.px-used-first { min-width: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.px-used-first.px-used-wide { max-width: 200px; }
.px-used-more { flex: none; color: var(--t-faint); }
.px-used-stack { display: inline-flex; }
.px-used-fav {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin-left: -5px; border-radius: 50%;
  background: var(--s-inter); border: 1px solid rgba(var(--rim-rgb), .4); box-shadow: 0 0 0 2px var(--ink);
  font: 500 var(--fs-2xs)/1 var(--mono); color: var(--t-secondary);
}
.px-used-fav:first-child { margin-left: 0; }
.px-used-fav.has-img { background: var(--bone); overflow: hidden; }
.px-used-fav img { width: 12px; height: 12px; display: block; }
.px-used-logo { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; font: 500 var(--fs-2xs)/1 var(--mono); }
.px-used-logo:first-child { margin-left: 0; }
.px-used-items { list-style: none; margin: 2px 0 8px; padding: 0 6px 0 32px; }
.px-used-items[hidden] { display: none; }
.px-used-items li {
  display: flex; gap: 6px; align-items: baseline; min-width: 0;
  padding: 3px 0; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-secondary);
}
.px-used-items a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rim); text-decoration: none; }
.px-used-items a:hover { text-decoration: underline; }
.px-used-host { flex: none; font: 400 var(--fs-xs)/1.4 var(--mono); color: var(--t-faint); }
.px-used-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-used-items .px-used-logo { flex: none; align-self: center; margin-left: 0; }

/* ---- the rail: a chat that made a document (panel-sidebar.js buildTabRow),
   in the trailing slot .tab-row::after reserves, as the incognito eye is. */
.tab-row.has-doc::after { content: none; }
.tab-doc-mark {
  flex: 0 0 var(--rail-tail); margin-left: var(--rail-tail-pull);
  display: flex; align-items: center; justify-content: center;
  color: var(--t-faint);
}
.tab-doc-mark svg { width: 13px; height: 13px; display: block; }
.tab-row.active-session .tab-doc-mark { color: var(--t-primary); }

/* The account menu's session line (panel-settings-menu.js pxPaintMenuUsage). */
.pxsm-usage {
  padding: 2px 14px 8px;
  font: 400 var(--fs-xs)/1.4 var(--mono); letter-spacing: .02em;
  color: var(--t-meta);
}
.pxsm-usage[hidden] { display: none; }

/* A card the drawer scrolled to. */
.px-flash { animation: px-flash 1.2s ease-out; }
@keyframes px-flash { 0% { box-shadow: 0 0 0 2px rgba(var(--rim-rgb), .7); } 100% { box-shadow: 0 0 0 2px rgba(var(--rim-rgb), 0); } }

@media (prefers-reduced-motion: reduce) {
  .px-progress.is-overlay, .px-progress-scrim, .px-flash { animation: none; }
  .px-progress-fold svg { transition: none; }
  .px-step[data-status="active"] .px-step-dot { animation: none; }
}

/* ---- nothing yet: the drawer opens from the corner icon with no work to show ---- */
.px-progress-empty { padding: 48px 24px 0; text-align: center; }
.px-progress-empty[hidden] { display: none; }
.px-progress-empty-title { margin: 0 0 8px; font: 400 var(--fs-body)/1.3 var(--serif, "Newsreader", serif); color: var(--t-secondary); }
.px-progress-empty-note { margin: 0; font: 400 var(--fs-md)/1.5 var(--mono); color: var(--t-faint); }

/* ---- the drawer's modes: Progress, Threads, Connectors, Files ------------------------
   The strip is panel-progress.js's; Threads, Connectors and Files are painted by
   panel-drawer-modes.js into .px-drawer-mode, which scrolls as .px-progress-scroll does. */
.px-progress-title { flex: 1 1 auto; min-width: 0; }
.px-progress-fold[hidden], .px-drawer-title[hidden] { display: none; }
.px-drawer-title { display: inline-block; padding: 2px 0; }
.px-drawer-tools { flex: none; display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; }
.px-drawer-tool {
  display: inline-grid; place-items: center;
  width: var(--ctl-h); height: var(--ctl-h); padding: 0;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  color: var(--t-meta); cursor: pointer;
}
.px-drawer-tool svg { width: 16px; height: 16px; }
.px-drawer-tool:hover, .px-drawer-tool:focus-visible, .px-drawer-tool.is-on { background: var(--s-inter); color: var(--t-primary); }
.px-drawer-tool:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }

.px-drawer-tabs {
  flex: none; display: flex; gap: 2px;
  margin: 0 18px 4px 18px; padding: 3px;
  border: 1px solid var(--hair); border-radius: var(--r-ctl);
}
.px-drawer-tab {
  flex: 1 1 0; min-width: 0; height: 28px; padding: 0 4px;
  border: 0; border-radius: var(--r-ctl-sm); background: transparent;
  font: 400 var(--fs-md)/1 var(--sans); color: var(--t-meta);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.px-drawer-tab:hover { color: var(--t-primary); }
.px-drawer-tab[aria-selected="true"] { background: var(--s-inter); color: var(--t-primary); }
.px-drawer-tab:focus-visible { outline: var(--focus-ring); outline-offset: -1px; }
.px-progress-scroll[hidden], .px-drawer-mode[hidden] { display: none; }
.px-drawer-mode { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: var(--scroll-pad) 22px 28px; }

.px-drawer-search { flex: none; padding: 6px 18px 2px; }
.px-drawer-search[hidden] { display: none; }
.px-drawer-search-input {
  width: 100%; box-sizing: border-box; height: var(--ctl-h); padding: 0 10px;
  border: 1px solid var(--hair); border-radius: var(--r-ctl);
  background: transparent; color: var(--t-primary); font: 400 var(--fs-base)/1 var(--sans);
}
.px-drawer-search-input:focus-visible { outline: var(--focus-ring); outline-offset: 0; }

.px-drawer-sec { margin: 14px 0 6px; font: 400 var(--fs-body)/1.3 var(--serif); color: var(--t-primary); }
.px-drawer-mode > :first-child .px-drawer-sec:first-child, .px-drawer-mode > .px-drawer-sec:first-child { margin-top: 4px; }
.px-drawer-scope { margin: 0 0 4px; font: 400 var(--fs-xs)/1.4 var(--mono); letter-spacing: .04em; color: var(--t-faint); }
.px-drawer-note { margin: 4px 0 10px; font: 400 var(--fs-md)/1.5 var(--sans); color: var(--t-meta); }
.px-drawer-error { margin: 6px 0; font: 400 var(--fs-md)/1.5 var(--sans); color: rgba(var(--danger-rgb), .9); }
.px-drawer-empty { padding: 72px 12px 0; text-align: center; }
.px-drawer-empty-title { margin: 0 0 8px; font: 400 var(--fs-body)/1.3 var(--serif); color: var(--t-secondary); }
.px-drawer-empty-note { margin: 0; font: 400 var(--fs-md)/1.5 var(--sans); color: var(--t-faint); }

/* Threads */
.px-thread-list { display: flex; flex-direction: column; }
.px-thread-row, .px-file-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 36px; padding: 5px 6px; box-sizing: border-box;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  text-align: left; color: var(--t-body); text-decoration: none; cursor: pointer;
}
.px-thread-row:hover, .px-thread-row:focus-visible, a.px-file-row:hover, a.px-file-row:focus-visible { background: var(--s-quiet); }
.px-thread-row:focus-visible, .px-file-row:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.px-thread-row.is-active .px-thread-title { color: var(--t-primary); }
.px-thread-icon, .px-file-icon { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; color: var(--t-faint); }
.px-thread-icon svg, .px-file-icon svg { width: 16px; height: 16px; display: block; }
.px-thread-icon.is-live::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rim);
  animation: px-step-pulse 1.8s ease-in-out infinite;
}
.px-thread-words, .px-file-words { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.px-thread-title, .px-file-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 var(--fs-base)/1.3 var(--sans); color: var(--t-strong, var(--t-body));
}
.px-thread-meta, .px-file-meta {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 var(--fs-xs)/1.4 var(--mono); color: var(--t-faint);
}

/* Connectors: Settings' own list (panel-settings-menu.css .cn-*), at drawer width. */
.px-drawer-conn .cn-row { padding: 8px 4px; }
.px-drawer-conn .cn-heading { margin-top: 18px; }

/* Files */
.px-files-sec + .px-files-sec { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--hair); }
.px-file-list { display: flex; flex-direction: column; }
.px-file-row { cursor: default; }
a.px-file-row { cursor: pointer; }
.px-file-del { width: 26px; height: 26px; opacity: 0; }
.px-file-row:hover .px-file-del, .px-file-del:focus-visible { opacity: 1; }
.px-file-cap { position: relative; height: 4px; margin: 12px 0 4px; border-radius: 2px; background: var(--s-inter); overflow: hidden; }
.px-file-cap-fill { position: absolute; inset: 0 auto 0 0; background: var(--rim); }
.px-file-cap.is-full .px-file-cap-fill { background: rgba(var(--danger-rgb), .8); }
.px-file-cap-text { margin: 0 0 10px; font: 400 var(--fs-xs)/1.4 var(--mono); color: var(--t-faint); font-variant-numeric: tabular-nums; }
.px-file-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
@media (hover: none) { .px-file-del { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .px-thread-icon.is-live::before { animation: none; } }
