/* panel-projects.css — Projects (040, 074): the rail's top actions, the
 * Projects index, a project's home, Library, the row "…" button, pinned
 * project rows and the conversation's day dividers.
 *
 * FLINT tokens only: ink, bone and rim at opacities; Newsreader for headings,
 * Alegreya Sans for body, IBM Plex Mono for labels; 16px card radius. Both
 * themes are already here, because every colour is a token html[data-theme]
 * redefines. Loaded after the inline sheet and before glass-surface.css,
 * which upgrades .proj-tile (a "bubble") in place and must stay last. */

/* ---- shared with Bibliography (panel-bibliography.js) ---------------------
 * The Projects dialog's fields, card, grid, tiles, empty state and links, as
 * they were (040): Bibliography's dialog is built from them. The Projects
 * views below restate what they need under .proj-view. */
.proj-tile:focus-visible {
  outline: 1px solid rgba(var(--rim-rgb), .7); outline-offset: 2px;
}

.proj-label {
  display: block; margin: 0 0 6px;
  font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--t-meta);
}
.proj-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.proj-count { font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .08em; color: var(--t-faint); }
.proj-count.is-over { color: var(--rim); }
.proj-input {
  display: block; width: 100%; box-sizing: border-box;
  border: none; border-radius: var(--r-ctl); padding: 0 12px; margin-bottom: 14px;
  font: 400 var(--fs-body)/1.4 var(--sans); color: var(--bone);
  background: var(--s-card); box-shadow: var(--lit-card); outline: none;
}
.proj-input::placeholder { color: var(--t-faint); }
.proj-input:focus { box-shadow: var(--lit-card), 0 0 0 1px rgba(var(--rim-rgb), .34); }
.proj-input.is-over { box-shadow: var(--lit-card), 0 0 0 1px rgba(var(--rim-rgb), .8); }
.proj-textarea { resize: vertical; min-height: 96px; font-size: var(--fs-lg); line-height: 1.5; }
.proj-form-error { margin: -6px 0 12px; font: 400 var(--fs-base)/1.45 var(--sans); color: var(--rim); }
.proj-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

.proj-form {
  flex-shrink: 0;
  margin: 0 0 18px; padding: 16px;
  border-radius: var(--r-card);
  background: var(--s-quiet); box-shadow: var(--lit-card);
}
.proj-form[hidden] { display: none; }

.proj-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  /* Room for a focused card's outline at the sides; the shared scroll inset
     (--scroll-pad) above and below. */
  padding: var(--scroll-pad) 3px;
  margin: 0 -3px;
}

.proj-status {
  margin: 0 0 12px;
  font: 400 var(--fs-2xs)/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--t-faint);
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.proj-grid-item { display: flex; min-width: 0; }

.proj-tile {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  padding: 14px 16px 13px;
  border: none; border-radius: var(--r-card); cursor: pointer;
  text-align: left; color: inherit;
  background: var(--s-card); box-shadow: var(--lit-card);
}
.proj-tile:hover { background: var(--s-inter); }
.proj-tile-name {
  font: 400 var(--fs-xl)/1.25 var(--serif); color: var(--t-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Truncated by the line clamp, never by slicing the string: the text node
   holds the whole thing, so nothing here decides what part of someone's
   instructions is "enough". pre-line keeps their line breaks. */
.proj-tile-instr {
  font: 400 var(--fs-base)/1.45 var(--sans); color: var(--t-secondary);
  white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: calc(3 * 1.45em);
}
.proj-tile-instr.is-empty { color: var(--t-faint); font-style: italic; }
.proj-tile-meta {
  margin-top: auto;
  font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--t-faint);
}

/* Empty, error and signed-out: one centred note in the body. */
.proj-empty {
  max-width: 380px; margin: 12vh auto 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.proj-empty-title { font: 400 var(--fs-3xl)/1.25 var(--serif); color: var(--t-primary); }
.proj-empty-text { margin: 0 0 6px; font: 400 var(--fs-lg)/1.5 var(--sans); color: var(--t-secondary); }
.proj-link {
  padding: 4px 0; border: none; background: transparent; cursor: pointer;
  font: 400 var(--fs-2xs)/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--t-meta);
}
.proj-link:hover { color: var(--bone); }
.proj-link:focus-visible { outline: 1px solid rgba(var(--rim-rgb), .7); outline-offset: 2px; border-radius: var(--r-xs); }

/* ---- the rail's top actions ---------------------------------------------------
 * Claude's register: an icon and a sentence-case label, a rounded row, and a
 * filled ground on the one whose view is open. Inset 8px as #sessions' rows
 * are, so the icon column and the rows' text line up down the rail. */
/* New group, Bibliography and Memory stay in the markup, hidden, as where
   their clicks are bound; .new-thread's display: flex would otherwise show them. */
.new-thread[hidden] { display: none; }
.new-thread.rail-nav {
  width: calc(100% - 16px); margin: 0 8px 1px; padding: 7px 8px;
  border-radius: var(--r-md);
  font: 400 var(--fs-lg)/1.3 var(--sans); letter-spacing: 0; text-transform: none;
  color: var(--t-strong); gap: 10px;
}
.new-thread.rail-nav svg { width: 16px; height: 16px; }
.new-thread.rail-nav:hover { background: var(--s-quiet); color: var(--bone); }
/* The open view's row: its ground is the selected rail row's glass
   (glass-surface.css, .rail-nav in TARGETS); this is the unglassed fallback. */
.new-thread.rail-nav.is-current { color: var(--t-primary); }
.new-thread.rail-nav:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.new-thread.rail-nav + .new-thread.rail-nav { margin-top: 0; }
/* The last of the run leaves the gap the run used to close with. */
.new-thread.rail-nav.customize-btn { margin-bottom: 14px; }
.customize-btn svg circle { stroke: currentColor; }

/* New shares its line with the fixed rail toggle (.collapse-btn, top 18px at
   the rail's right), so its row stops short of it. Its menu is
   panel-new-menu.js's (#railNewPop). */
.rail-nav-row { position: relative; margin: 18px 52px 1px 8px; }
.rail-nav-row .new-thread.rail-nav { width: 100%; margin: 0; }

/* ---- a rail row's "…" ---------------------------------------------------------
 * Over the row's trailing slot (the count, the document mark, the run's dot),
 * which steps aside while the dots show. Shown on hover, on keyboard focus
 * within the row, and while its menu is open. */
.sessions .session-head { position: relative; }
.row-more {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: var(--r-ctl-sm); background: transparent;
  color: var(--t-secondary); cursor: pointer; opacity: 0; pointer-events: none;
}
.row-more svg { width: 14px; height: 14px; }
.session-head:hover > .row-more,
.session-head:focus-within > .row-more,
.session-head.menu-open > .row-more { opacity: 1; pointer-events: auto; }
.row-more:hover, .row-more:focus-visible { background: var(--s-inter); color: var(--t-primary); }
.row-more:focus-visible { outline: var(--focus-ring); outline-offset: -1px; }
.session-head:is(:hover, :focus-within, .menu-open):has(> .row-more) > :is(.session-count, .tab-doc-mark, .tab-incog-mark, .rr-dot) { visibility: hidden; }
/* Room for the dots on a row with no trailing slot of its own. */
.project-row { padding-right: 32px; }
@media (hover: none) { .row-more { opacity: 1; pointer-events: auto; } }
/* A drag carries the row, not its button. */
.pin-ghost .row-more { display: none; }

/* ---- pinned projects in the rail --------------------------------------------- */
.project-row-glyph { display: inline-grid; place-items: center; flex: none; width: 14px; }
.project-row-glyph svg { width: 14px; height: 14px; stroke: var(--t-secondary); }
.project-row.active-session .project-row-glyph svg { stroke: var(--t-primary); }
.project-row:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }

/* ---- the views: what they cover is hidden as well as covered --------------- */
.main.px-projects-open > :not(#projectsView),
.main.px-project-open > :not(#projectView),
.main.px-library-open > :not(#libraryView) { visibility: hidden; }

/* The column view's own column (.search-view-col): its width and padding, so
   the head and the content sit where every other view's do. */
.proj-view .search-view-col.proj-col { container-type: inline-size; }
.proj-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 16px 32px;
}
.proj-scroll[hidden] { display: none; }

/* ---- buttons the views share ---- */
.proj-icon-btn {
  flex: none; width: 32px; height: 32px; padding: 0;
  display: inline-grid; place-items: center;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  color: var(--t-secondary); cursor: pointer;
}
.proj-icon-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.proj-icon-btn:hover, .proj-icon-btn.is-on { background: var(--s-inter); color: var(--t-primary); }
.proj-icon-btn:focus-visible { outline: var(--focus-ring); outline-offset: 0; }
.proj-icon-btn:disabled { opacity: .45; cursor: default; }

/* The high-contrast pill: the one filled control on the page. */
.proj-view .proj-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 400 var(--fs-md)/1.4 var(--sans); letter-spacing: 0; text-transform: none; color: var(--t-secondary);
}
.proj-view .proj-link:hover { color: var(--bone); }
.proj-view .proj-link:disabled { opacity: .45; cursor: default; }
.proj-view .proj-link:focus-visible { outline: var(--focus-ring); outline-offset: 2px; border-radius: var(--r-xs); }

.proj-h1 {
  margin: 0; min-width: 0;
  font: 400 var(--fs-4xl)/1.15 var(--serif); letter-spacing: -.01em;
  color: var(--t-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* The project mark in a rounded square: cards, the home's title. */
.proj-glyph {
  flex: none; width: 32px; height: 32px; display: inline-grid; place-items: center;
  border-radius: var(--r-md); background: var(--s-inter); color: var(--t-secondary);
}
.proj-glyph svg { width: 16px; height: 16px; stroke: currentColor; }
.proj-glyph--lg { width: 36px; height: 36px; }
.proj-glyph--lg svg { width: 18px; height: 18px; }

/* ---- fields ---- */
.proj-view .proj-label {
  display: block; margin: 0 0 6px;
  font: 400 var(--fs-2xs)/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--t-faint);
}
.proj-view .proj-input {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 12px; padding: 9px 12px;
  border: 0; border-radius: var(--r-ctl); background: var(--s-card); box-shadow: var(--lit-card);
  font: 400 var(--fs-lg)/1.45 var(--sans); color: var(--t-primary); outline: none;
}
.proj-view .proj-input::placeholder { color: var(--t-faint); }
.proj-view .proj-input:focus { box-shadow: var(--lit-card), 0 0 0 1px rgba(var(--rim-rgb), .5); }
.proj-view .proj-input.is-over { box-shadow: var(--lit-card), 0 0 0 1px rgba(var(--rim-rgb), .9); }
.proj-view .proj-textarea { resize: vertical; min-height: 72px; }
.proj-form-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin: -4px 0 10px; }
.proj-view .proj-count { font: 400 var(--fs-2xs)/1.4 var(--mono); letter-spacing: .06em; color: var(--t-faint); }
.proj-view .proj-count.is-over { color: var(--rim); }
.proj-view .proj-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-left: auto; }
.proj-view .proj-form-error { margin: 0 0 10px; font: 400 var(--fs-base)/1.45 var(--sans); color: var(--rim); }
.proj-view .proj-form-error[hidden] { display: none; }

/* ---- the index --------------------------------------------------------------- */
/* The shared column-view head (panel-column-view.js): PROJECTS, its actions, ×. */
.proj-index-head h1.pxpop-title { margin: 0; }
.proj-index-actions { display: flex; align-items: center; gap: 4px; }
.proj-index-actions[hidden] { display: none; }
.proj-index-actions .px-btn { margin-left: 6px; }
.proj-filter { margin: 0 16px 14px; }
.proj-filter[hidden] { display: none; }

.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj-item { position: relative; min-width: 0; }
.proj-view .proj-tile {
  width: 100%; display: flex; flex-direction: row; align-items: center; gap: 12px;
  padding: 14px 52px 14px 14px; text-align: left;
  border: 0; border-radius: var(--r-card);
  background: var(--s-card); box-shadow: var(--lit-card);
  color: var(--t-primary); cursor: pointer;
}
.proj-view .proj-tile:hover { background: var(--s-inter); }
.proj-view .proj-tile:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.proj-view .proj-tile-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.proj-view .proj-tile-name {
  font: 500 var(--fs-body)/1.3 var(--sans); color: var(--t-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proj-view .proj-tile-date { font: 400 var(--fs-md)/1.3 var(--sans); color: var(--t-meta); }
.proj-view .proj-tile-pin {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: var(--r-ctl); background: transparent;
  color: var(--t-faint); cursor: pointer; opacity: 0;
}
.proj-view .proj-tile-pin svg { width: 15px; height: 15px; stroke: currentColor; }
.proj-item:hover .proj-tile-pin, .proj-tile-pin:focus-visible, .proj-item.is-pinned .proj-tile-pin { opacity: 1; }
.proj-item.is-pinned .proj-tile-pin { color: var(--t-primary); }
.proj-item.is-pinned .proj-tile-pin svg { fill: currentColor; }
.proj-view .proj-tile-pin:hover { background: var(--s-inter); color: var(--t-primary); }
.proj-view .proj-tile-pin:focus-visible { outline: var(--focus-ring); outline-offset: 0; }
@media (hover: none) { .proj-tile-pin { opacity: 1; } }
.proj-item.is-archived .proj-tile { opacity: .72; }

.proj-archived-toggle { margin: 14px 2px 0; }
.proj-view .proj-status-line { padding: 4px 2px 12px; font: 400 var(--fs-base)/1.5 var(--sans); color: var(--t-meta); }
.proj-view .proj-status-line.is-error { color: var(--rim); }
.proj-view .proj-status { margin: 0; font: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.proj-view .proj-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; max-width: none; margin: 0; padding: 24px 2px; text-align: left; }
.proj-view .proj-empty-title { font: 400 var(--fs-3xl)/1.25 var(--serif); color: var(--t-primary); }
.proj-view .proj-empty-text { margin: 0; max-width: 46ch; font: 400 var(--fs-lg)/1.5 var(--sans); color: var(--t-secondary); }

/* The new-project form, in place of the list. */
.proj-create { padding: 4px 16px 24px; max-width: 560px; }
.proj-create[hidden] { display: none; }
.proj-create-title { margin: 0 0 16px; font: 400 var(--fs-2xl)/1.3 var(--serif); color: var(--t-primary); }
.proj-create .proj-form-actions { margin-top: 6px; }

/* ---- a project's home ---------------------------------------------------------- */
/* The shared head (.search-view-head): the way back where the title sits, × at the right. */
.proj-back {
  padding: 4px 6px; margin-left: -6px; border: 0; border-radius: var(--r-ctl-sm); background: none; cursor: pointer;
  font: 400 var(--fs-base)/1.3 var(--sans); color: var(--t-meta);
}
.proj-back:hover { color: var(--t-primary); background: var(--s-quiet); }
.proj-back:focus-visible { outline: var(--focus-ring); outline-offset: 1px; }

.proj-title-row { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; min-width: 0; }
.proj-title-row .proj-name { flex: 0 1 auto; }
.proj-menu-btn { width: 28px; height: 28px; margin-left: -4px; }
.proj-menu-btn svg { width: 15px; height: 15px; }
.proj-pin { margin-left: auto; }
.proj-pin[aria-pressed="true"] { color: var(--t-primary); }
.proj-pin[aria-pressed="true"] svg { fill: currentColor; }

.proj-archived-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 6px 0 4px;
  padding: 8px 12px; border-radius: var(--r-ctl); background: var(--s-quiet);
  font: 400 var(--fs-base)/1.4 var(--sans); color: var(--t-secondary);
}
.proj-archived-note[hidden] { display: none; }

.proj-desc { margin: 2px 0 22px; }
.proj-desc-view {
  display: block; width: 100%; padding: 4px 6px; margin-left: -6px; text-align: left;
  border: 0; border-radius: var(--r-ctl-sm); background: none; cursor: text;
  font: 400 var(--fs-lg)/1.5 var(--sans); color: var(--t-secondary);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.proj-desc-view:hover { background: var(--s-quiet); }
.proj-desc-view:focus-visible { outline: var(--focus-ring); outline-offset: 0; }
.proj-desc-view.is-empty { color: var(--t-faint); }
.proj-desc-view[hidden], .proj-desc-edit[hidden] { display: none; }

/* Two columns where there is room for them; one in a side panel, the
   instructions and knowledge under the chats. */
.proj-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; align-items: start; }
@container (max-width: 640px) {
  .proj-home-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .proj-h1 { font-size: var(--fs-3xl); }
}
.proj-main, .proj-side { min-width: 0; }
.proj-side { display: flex; flex-direction: column; gap: 12px; }

/* The prompt bar: a chat starts here, inside the project. */
.proj-prompt {
  display: flex; align-items: flex-end; gap: 8px; margin: 0 0 22px; padding: 10px 10px 10px 14px;
  border-radius: var(--r-card); background: var(--s-card); box-shadow: var(--lit-card);
}
.proj-prompt:focus-within { box-shadow: var(--lit-card), 0 0 0 1px rgba(var(--rim-rgb), .5); }
.proj-prompt-input {
  flex: 1; min-width: 0; min-height: 24px; max-height: 180px; padding: 4px 0; resize: none;
  border: 0; outline: none; background: transparent;
  font: 400 var(--fs-body)/1.5 var(--sans); color: var(--t-primary);
}
.proj-prompt-input::placeholder { color: var(--t-faint); }
.proj-prompt-send {
  flex: none; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: var(--r-ctl); background: var(--bone); color: var(--ink); cursor: pointer;
}
.proj-prompt-send svg { width: 16px; height: 16px; stroke: currentColor; }
.proj-prompt-send:disabled { background: var(--s-inter); color: var(--t-faint); cursor: default; }
.proj-prompt-send:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.proj-chats-label { margin-bottom: 8px; padding-left: 2px; }
.proj-chats { display: flex; flex-direction: column; }
.proj-chat {
  width: 100%; display: flex; align-items: baseline; gap: 12px; padding: 10px 10px;
  border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; background: none;
  text-align: left; cursor: pointer;
}
.proj-chat-item:last-child .proj-chat { border-bottom: 0; }
.proj-chat:hover, .proj-chat:focus-visible { background: var(--s-quiet); border-radius: var(--r-md); }
/* The rail's hover is the quiet wash AND the text lifting to --bone; the wash alone
   read as a fainter highlight than a rail row's, so the lift is matched here. */
.proj-chat:is(:hover, :focus-visible) :is(.proj-chat-name, .proj-chat-date) { color: var(--bone); }
.proj-chat:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.proj-chat.is-active .proj-chat-name { color: var(--t-primary); }
.proj-chat-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 var(--fs-body)/1.35 var(--sans); color: var(--t-strong);
}
.proj-chat-date { flex: none; font: 400 var(--fs-md)/1.3 var(--sans); color: var(--t-meta); }
.proj-chats-empty { padding: 6px 2px; font: 400 var(--fs-base)/1.5 var(--sans); color: var(--t-meta); }
/* A chat's threads, under it: the rail row's list, now that the project's row holds the chat. */
.proj-chat-item:has(.proj-chat-threads) .proj-chat { border-bottom: 0; }
.proj-chat-threads {
  display: flex; flex-direction: column; padding: 0 0 6px 22px;
  border-bottom: 1px solid var(--hair);
}
.proj-chat-item:last-child .proj-chat-threads { border-bottom: 0; }
.proj-thread {
  width: 100%; display: flex; padding: 5px 10px; border: 0; border-radius: var(--r-md);
  background: none; text-align: left; cursor: pointer;
}
.proj-thread:hover, .proj-thread:focus-visible { background: var(--s-quiet); }
.proj-thread:is(:hover, :focus-visible) .proj-thread-name { color: var(--bone); }
.proj-thread:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.proj-thread-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 var(--fs-md)/1.35 var(--sans); color: var(--t-meta);
}
.proj-thread.is-active .proj-thread-name { color: var(--t-primary); }

/* Instructions and knowledge: two cards. */
.proj-side-card {
  padding: 14px; border-radius: var(--r-card); background: var(--s-card); box-shadow: var(--lit-card);
  /* Focused by code from "Files and knowledge"; a ring only from the keyboard. */
  outline: none;
}
.proj-side-card:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.proj-side-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.proj-side-card-title { margin: 0; font: 500 var(--fs-lg)/1.3 var(--sans); color: var(--t-primary); }
.proj-side-card-actions { display: flex; gap: 12px; }
.proj-instr-view {
  font: 400 var(--fs-base)/1.5 var(--sans); color: var(--t-secondary);
  white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
}
.proj-instr-view.is-expanded { display: block; -webkit-line-clamp: unset; }
.proj-instr-view.is-empty { color: var(--t-faint); }
.proj-instr-view[hidden], .proj-instr-edit[hidden], .proj-instr-more[hidden] { display: none; }
.proj-instr-more { margin-top: 6px; }
.proj-instr-edit .proj-textarea { min-height: 150px; font-size: var(--fs-base); }

.proj-cap { display: flex; flex-direction: column; gap: 6px; margin: 2px 0 8px; }
.proj-cap-bar { display: block; height: 4px; border-radius: var(--r-pill); background: var(--s-inter); overflow: hidden; }
.proj-cap-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--t-secondary); transition: width var(--dur-3) var(--ease-out); }
.proj-cap.is-near .proj-cap-fill { background: var(--rim); }
.proj-cap.is-full .proj-cap-fill { background: rgb(var(--danger-rgb)); }
.proj-cap-text { font: 400 var(--fs-2xs)/1.3 var(--mono); letter-spacing: .06em; color: var(--t-meta); }
.proj-cap.is-full .proj-cap-text { color: rgb(var(--danger-rgb)); }
@media (prefers-reduced-motion: reduce) { .proj-cap-fill { transition: none; } }
.proj-know-note { margin: 0 0 10px; font: 400 var(--fs-md)/1.45 var(--sans); color: var(--t-meta); }
.proj-know-form { margin-bottom: 4px; }
.proj-know-form[hidden] { display: none; }
.proj-know-list { display: flex; flex-direction: column; gap: 2px; }
.proj-know-item { border-radius: var(--r-md); }
.proj-know-head { display: flex; align-items: center; gap: 2px; }
.proj-know-open {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 7px 8px;
  border: 0; border-radius: var(--r-md); background: none; text-align: left; cursor: pointer;
}
.proj-know-open:hover, .proj-know-open[aria-expanded="true"] { background: var(--s-quiet); }
.proj-know-open:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
.proj-know-title { font: 400 var(--fs-base)/1.35 var(--sans); color: var(--t-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-know-meta { font: 400 var(--fs-2xs)/1.3 var(--mono); letter-spacing: .06em; color: var(--t-faint); }
.proj-know-del { width: 28px; height: 28px; opacity: 0; }
.proj-know-del svg { width: 13px; height: 13px; }
.proj-know-item:hover .proj-know-del, .proj-know-del:focus-visible { opacity: 1; }
@media (hover: none) { .proj-know-del { opacity: 1; } }
.proj-know-edit { padding: 6px 4px 4px; }
.proj-know-edit .proj-textarea { min-height: 140px; font-size: var(--fs-base); }
.proj-know-empty { padding: 4px 2px; font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-faint); }

/* ---- the setup card: a new project's three questions ---------------------------- */
.proj-setup-host { margin: 0 0 18px; }
.proj-setup-host[hidden] { display: none; }
.proj-setup-card {
  display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px;
  border-radius: var(--r-card); background: var(--s-card); box-shadow: var(--lit-card);
}
.proj-setup-icon {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--r-md); background: var(--s-inter); color: var(--rim);
}
.proj-setup-icon svg { width: 16px; height: 16px; stroke: currentColor; }
.proj-setup-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.proj-setup-title { font: 600 var(--fs-base)/1.35 var(--sans); color: var(--t-primary); }
.proj-setup-line { font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-meta); }
/* The question, written as the assistant writes: the conversation's serif. */
.proj-setup-msg { margin: 0 0 14px; font: 400 var(--fs-body)/1.6 var(--serif); color: var(--t-body); }
.proj-setup-msg p { margin: 0 0 6px; }
.proj-setup-qs { margin: 0; padding-left: 22px; }
.proj-setup-qs li { margin: 2px 0; }
.proj-setup-form .proj-label { text-transform: none; letter-spacing: 0; font: 400 var(--fs-base)/1.4 var(--sans); color: var(--t-secondary); }
.proj-setup-form .proj-textarea { min-height: 52px; }

/* Delete's three answers wrap to a column in a narrow panel. */
.proj-delete-actions { flex-wrap: wrap; }

/* ---- Library -------------------------------------------------------------------- */
.lib-row { align-items: center; }
.lib-glyph { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--s-inter); color: var(--t-secondary); }
.lib-glyph svg { width: 16px; height: 16px; stroke: currentColor; }
.lib-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lib-title { font: 400 var(--fs-body)/1.3 var(--sans); color: var(--t-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-sub { font: 400 var(--fs-md)/1.4 var(--sans); color: var(--t-meta); }
.lib-note { padding-top: 18px; }
.lib-empty { padding: 2px 8px 12px; font: 400 var(--fs-base)/1.5 var(--sans); color: var(--t-meta); }

/* ---- day dividers in a conversation ---------------------------------------------- */
.px-day {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 14px;
  font: 400 var(--fs-md)/1.3 var(--sans); color: var(--t-faint); white-space: nowrap;
}
.px-day::before, .px-day::after { content: ""; flex: 1; border-top: 1px dashed var(--hair); }
.proj-setup-host .px-day { margin-top: 0; }

/* Delete project: what happens to its memory (D70), above the buttons. */
.proj-delete-mem { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
