/* [PJ1 tokens] Projects page brought onto the token system, same rules as
   the chat page (see b2c-vault Patterns section 20).
     - colour: the four `#fff` literals now use --white
     - radius: mapped to kit 4.3 (inputs 9 / buttons 10 / cards 14 /
       popovers+menus 16 / dialogs 18); menus and composers follow the
       chat-page precedent of --radius-pop
     - elevation: the two hand-rolled popover shadows use --shadow-pop
     - type: kit 3 floor, nothing below 12px
   Everything here is .prjx-*, which is Projects-owned, so none of it can
   reach Workflows or Agents. The shared .wfp-* shell is NOT touched. */
/* web/projects_page.css — [projects-v2]
   Styling for the redesigned Projects experience (home / setup chat /
   project page / animated loading state) from the Oct-2026 handoff.
   Theme B only: every color routes through the --tb-* tokens that
   web/theme_b.css declares; no literal hexes in components. */

/* the new pages own the view; the legacy .wfp markup stays in the DOM
   (app.js still binds to it) but is hidden once PRJX boots */
#view-projects.prjx-on > .wfp { display: none !important; }

.prjx { display: flex; height: 100%; min-height: 0; background: var(--tb-bg);
        color: var(--tb-text); font-size: 14px; }
.prjx * { box-sizing: border-box; }
.prjx button { font: inherit; cursor: pointer; }
.prjx input, .prjx textarea, .prjx select {
  font: inherit; color: var(--tb-text); background: var(--tb-surface);
  border: 1px solid var(--tb-border); border-radius: var(--radius-input); padding: 8px 10px; }
.prjx input:focus, .prjx textarea:focus { outline: none;
  border-color: var(--tb-accent-border); }

.prjx .btn { border: 1px solid var(--tb-border-strong); background: var(--tb-surface);
  color: var(--tb-text); border-radius: var(--radius-btn); padding: 7px 12px; }
.prjx .btn:hover { border-color: var(--tb-accent-border); }
.prjx .btn.primary { background: var(--tb-accent); border-color: var(--tb-accent);
  color: var(--white); }
.prjx .btn.primary:hover { filter: brightness(1.1); }
.prjx .btn.danger { color: var(--tb-danger); border-color: var(--tb-danger); }
.prjx .btn.ghost { background: transparent; border-color: transparent;
  color: var(--tb-text-secondary); }
.prjx .btn.ghost:hover { color: var(--tb-accent-text); }

.prjx .pill { display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;   /* kit 4.3: pills stay 999 */ font-size: 12px;
  background: var(--tb-accent-soft); color: var(--tb-accent-text);
  border: 1px solid transparent; white-space: nowrap; }
.prjx .pill.draft { background: var(--tb-warning-soft); color: var(--tb-warning); }
.prjx .pill.ok { background: var(--tb-success-soft); color: var(--tb-success); }

.prjx .muted { color: var(--tb-text-muted); }
.prjx .dim { color: var(--tb-text-secondary); }

/* ============================== Screen 1 — Projects home ================ */
.prjx-side { width: 244px; min-width: 244px; border-right: 1px solid var(--tb-border);
  background: var(--list); padding: 14px 12px; display: flex;
  flex-direction: column; gap: 10px; overflow-y: auto; }
.prjx-side h2 { margin: 2px 2px 6px; font-size: 16px; }
.prjx-side .btn.primary { width: 100%; }
.prjx-side .sect { margin-top: 8px; font-size: 12px; letter-spacing: .12em;
  color: var(--tb-text-muted); text-transform: uppercase; }
.prjx-dom { display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 9px; border-radius: var(--radius-input); border: 1px solid transparent;
  background: transparent; color: var(--tb-text-secondary); text-align: left; }
.prjx-dom .ic { width: 20px; text-align: center; opacity: .9; }
.prjx-dom .n { flex: 1; }
.prjx-dom .c { font-size: 12px; color: var(--tb-text-muted); }
.prjx-dom:hover { background: var(--tb-surface); }
.prjx-dom.sel { background: var(--tb-accent-soft); color: var(--tb-accent-text);
  border-color: var(--tb-accent-border); }

.prjx-list { width: 372px; min-width: 300px; border-right: 1px solid var(--tb-border);
  display: flex; flex-direction: column; min-height: 0; }
.prjx-list .lh { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 8px; }
.prjx-list .lh input { width: 100%; }
.prjx-list .cnt { font-size: 12px; color: var(--tb-text-muted);
  display: flex; justify-content: space-between; padding: 0 2px; }
.prjx-cards { flex: 1; overflow-y: auto; padding: 4px 12px 14px;
  display: flex; flex-direction: column; gap: 9px; }
.prjx-card { border: 1px solid var(--tb-border); border-radius: var(--radius-card);
  background: var(--tb-surface); padding: 11px 12px; cursor: pointer; }
.prjx-card:hover { border-color: var(--tb-border-strong); }
.prjx-card.sel { border-color: var(--tb-accent-border);
  box-shadow: 0 0 0 1px var(--tb-accent-border); }
.prjx-card .t { font-weight: 600; margin-bottom: 3px; display: flex;
  align-items: center; gap: 8px; }
.prjx-card .s { color: var(--tb-text-secondary); font-size: 13px;
  margin-bottom: 7px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.prjx-card .m { display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--tb-text-muted); }

.prjx-prev { flex: 1; min-width: 0; overflow-y: auto; padding: 18px 22px; }
.prjx-prev .ph { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prjx-prev .ph h2 { margin: 0; font-size: 19px; flex: 1 1 auto; }
.prjx-prev .upd { font-size: 12px; color: var(--tb-text-muted); margin: 6px 0 10px; }
.prjx-prev .sum { color: var(--tb-text-secondary); margin-bottom: 14px;
  line-height: 1.5; max-width: 640px; }
.prjx-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px;
  align-items: start; }
.prjx-cardbox { border: 1px solid var(--tb-border); border-radius: var(--radius-card);
  background: var(--tb-bg-panel); padding: 12px 14px; }
.prjx-cardbox .h { display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: .12em; color: var(--tb-text-muted);
  text-transform: uppercase; margin-bottom: 8px; }
.prjx-cardbox .h .add { color: var(--tb-accent-text); background: none;
  border: none; font-size: 12px; letter-spacing: 0; text-transform: none; }
.prjx-row { display: flex; gap: 10px; padding: 6px 0;
  border-top: 1px solid var(--tb-border); font-size: 13px; }
.prjx-row:first-of-type { border-top: 0; }
.prjx-row .k { width: 110px; min-width: 110px; color: var(--tb-text-muted); }
.prjx-row .v { color: var(--tb-text); word-break: break-word; flex: 1; }
.prjx-row .v input { width: 100%; padding: 4px 8px; }
.prjx-frow { display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-top: 1px solid var(--tb-border); font-size: 13px; }
.prjx-frow:first-of-type { border-top: 0; }
.prjx-frow .n { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.prjx-frow .s { font-size: 12px; color: var(--tb-text-muted); }
.prjx-frow .x { background: none; border: none; color: var(--tb-text-muted); }
.prjx-frow .x:hover { color: var(--tb-danger); }
.prjx-menu { position: relative; }
.prjx-menu .pop { position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--tb-surface-2); border: 1px solid var(--tb-border-strong);
  border-radius: var(--radius-pop); min-width: 150px; z-index: 40; overflow: hidden;
  box-shadow: var(--shadow-pop); }
.prjx-menu .pop button { display: block; width: 100%; text-align: left;
  background: none; border: none; color: var(--tb-text); padding: 9px 12px; }
.prjx-menu .pop button:hover { background: var(--tb-accent-soft); }
.prjx-menu .pop button.danger { color: var(--tb-danger); }

.prjx-emptybig { margin: auto; text-align: center; color: var(--tb-text-muted); }
.prjx-emptybig h2 { color: var(--tb-text); }

/* ============================== Screens 2-4 — Setup chat ================ */
.prjx-wiz { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.prjx-wiz .wh { display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding: 10px 20px; border-bottom: 1px solid var(--tb-border);
  background: var(--tb-bg-panel); }
.prjx-wiz .wh h3 { margin: 0; min-width: 0; font-size: 17px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prjx-wiz .wbody { display: flex; flex: 1; min-height: 0; }
.prjx-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.prjx-log { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex;
  flex-direction: column; gap: 10px; }
.prjx-msg { display: flex; gap: 10px; max-width: 760px; }
.prjx-msg .av { width: 28px; height: 28px; border-radius: var(--radius-input, 8px); flex: none;
  background: transparent url("/assets/brand/aisockt-mark-on-dark.png") center / contain no-repeat;
  margin-top: 2px; }
:root[data-theme="light"] .prjx-msg .av {
  background-image: url("/assets/brand/aisockt-mark-on-light.png");
}
.prjx-msg .b { background: var(--tb-surface); border: 1px solid var(--tb-border);
  border-radius: var(--radius-card); padding: 9px 12px; line-height: 1.45; }
.prjx-msg .b .q { font-weight: 600; }
.prjx-msg .b .hint { font-size: 12px; color: var(--tb-text-muted); margin-top: 2px; }
.prjx-msg.user { align-self: flex-end; }
.prjx-msg.user .b { background: var(--tb-accent-soft);
  border-color: var(--tb-accent-border); color: var(--tb-accent-text); }
.prjx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.prjx-chip { display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border-2); background: var(--surface-2);
  color: var(--text); border-radius: 999px;   /* kit 4.3: pills stay 999 */
  padding: 5px 10px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out; }
.prjx-chip .prjh-ico { width: 14px; height: 14px; flex: none; }
.prjx-chip:hover { border-color: var(--border-hover); color: var(--text); }
.prjx-chip.on { background: var(--selected-fill); color: var(--accent-text);
  border-color: var(--selected-border); font-weight: 600; }
.prjx-chip.go { background: var(--primary); border-color: var(--primary);
  color: var(--white); }
.prjx-chip.skip { border-color: transparent; color: var(--text-muted); }
.prjx-collapse { align-self: center; font-size: 12px; color: var(--tb-text-muted); }
.prjx-collapse a { color: var(--tb-accent-text); cursor: pointer; }

.prjx-toolgrid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 9px; margin-top: 9px; }
.prjx-tool { display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--tb-border); border-radius: var(--radius-btn);
  background: var(--tb-bg); padding: 9px 11px; }
.prjx-tool .lg { width: 30px; height: 30px; border-radius: var(--radius-input); flex: none;
  background: var(--tb-surface-2); border: 1px solid var(--tb-border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--tb-accent-text); }
.prjx-tool .tx { flex: 1; min-width: 0; }
.prjx-tool .tx .n { font-weight: 600; font-size: 13px; }
.prjx-tool .tx .p { font-size: 12px; color: var(--tb-text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prjx-tool .btn { padding: 4px 10px; font-size: 12.5px; }
.prjx-tool.added { border-color: var(--tb-success); }
.prjx-tool.added .btn { background: var(--tb-success-soft);
  border-color: var(--tb-success); color: var(--tb-success); }
.prjx-tool .err { font-size: 12px; color: var(--tb-danger); }

.prjx-files { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.prjx-file { display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--tb-border); border-radius: var(--radius-input);
  background: var(--tb-bg); padding: 7px 10px; font-size: 13px; }
.prjx-file .n { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.prjx-file .st { font-size: 12px; color: var(--tb-text-muted); }
.prjx-file .st.ok { color: var(--tb-success); }
.prjx-file .st.bad { color: var(--tb-danger); }

.prjx-profilecard { border: 1px solid var(--tb-accent-border); border-radius: var(--radius-card);
  background: var(--tb-bg-panel); padding: 14px 16px; max-width: 560px;
  margin-top: 9px; }
.prjx-profilecard .pt { display: flex; align-items: center; gap: 10px;
  font-weight: 700; margin-bottom: 4px; }
.prjx-profilecard .ps { color: var(--tb-text-secondary); line-height: 1.5;
  margin-bottom: 10px; }
.prjx-profilecard .acts { display: flex; gap: 9px; margin-top: 12px; }
.prjx-row.hl .v { animation: prjx-hl 2s ease-out 1; border-radius: var(--radius-input); }
@keyframes prjx-hl { 0% { background: var(--tb-accent-soft); }
  100% { background: transparent; } }

.prjx-composer { display: flex; align-items: flex-end; gap: 9px;
  padding: 12px 16px 14px; border-top: 1px solid var(--tb-border);
  background: var(--tb-bg-panel); }
.prjx-composer textarea { flex: 1; resize: none; min-height: 42px;
  max-height: 140px; border-radius: var(--radius-input); }
.prjx-composer .ic { width: 38px; height: 38px; border-radius: var(--radius-btn);
  border: 1px solid var(--tb-border-strong); background: var(--tb-surface);
  color: var(--tb-text-secondary); font-size: 16px; }
.prjx-composer .snd { width: 38px; height: 38px; border-radius: var(--radius-btn);
  background: var(--tb-accent); color: var(--white); border: none; font-size: 15px; }

.prjx-panel { width: 300px; min-width: 300px; border-left: 1px solid var(--tb-border);
  background: var(--tb-bg-panel); overflow-y: auto; padding: 13px 14px; }
.prjx-panel .pph { display: flex; align-items: baseline; justify-content:
  space-between; gap: 8px; margin-bottom: 10px; }
.prjx-panel .pph .t { font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--tb-text-muted); }
.prjx-panel .pph a { font-size: 12px; color: var(--tb-accent-text);
  cursor: pointer; text-decoration: none; }
.prjx-pitem { padding: 8px 2px; border-top: 1px solid var(--tb-border);
  display: flex; gap: 9px; font-size: 13px; }
.prjx-pitem:first-of-type { border-top: 0; }
.prjx-pitem .mk { width: 16px; flex: none; margin-top: 1px; }
.prjx-pitem .mk.done { color: var(--tb-success); }
.prjx-pitem .mk.todo { color: var(--tb-text-muted); }
.prjx-pitem .kk { color: var(--tb-text-muted); font-size: 12px; }
.prjx-pitem .vv { color: var(--tb-text); }
.prjx-pitem .vv.idle { color: var(--tb-text-muted); font-style: italic; }
.prjx-okbar { margin-top: 10px; border-radius: var(--radius-input); padding: 8px 10px;
  font-size: 12.5px; background: var(--tb-success-soft);
  color: var(--tb-success); border: 1px solid var(--tb-success); }

/* form mode ("Use the form instead") & editor form — [Dreamer UI Brand Kit Section 7 Forms] */
.prjx-form { display: flex; flex-direction: column; gap: 14px;
  max-width: 640px; padding: 18px 20px; overflow-y: auto; flex: 1; }
.prjx-form-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--text); }
.prjx-form .fcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prjx-form .fcard-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}
.prjx-form label { display: flex; flex-direction: column; gap: 6px; }

/* Section 7 form elements */
.frm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; width: 100%; }
.frm-label { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text);
  display: flex; align-items: center; gap: 4px; margin: 0; }
.frm-label .frm-opt { color: var(--text-muted); font-weight: 400; font-size: 12px; }
.frm-ctl {
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.frm-ctl::placeholder { color: var(--placeholder); }
.frm-ctl:hover { border-color: var(--border-hover); }
.frm-ctl:focus { border-color: var(--selected-border); box-shadow: 0 0 0 2px var(--selected-fill); }
.frm-ctl.has-error { border-color: var(--danger); }
.frm-ctl.has-error:focus { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-tint); }

textarea.frm-ctl {
  height: auto;
  min-height: 76px;
  max-height: 210px;
  padding: 8px 12px;
  resize: vertical;
  line-height: 1.5;
  overflow-y: auto;
}

.frm-hint { font-size: 12px; line-height: 1.4; color: var(--text-muted); margin: 0; }
.frm-error { display: flex; align-items: center; gap: 6px; font-size: 12px;
  line-height: 1.4; color: var(--danger); font-weight: 500; margin: 0; }
.frm-error .prjh-ico { width: 14px; height: 14px; flex: none; stroke: var(--danger); }

/* Search input with 16px icon and clear button (Section 7 Search) */
.frm-search-wrap { position: relative; display: flex; align-items: center; width: 100%; }
.frm-search-wrap .frm-search-ico { position: absolute; left: 12px; width: 16px; height: 16px;
  color: var(--text-muted); pointer-events: none; stroke: currentColor; }
.frm-search-wrap input.frm-ctl[type="search"] {
  height: 40px; padding-left: 36px; padding-right: 32px; font-size: 13px;
}
.frm-search-wrap .frm-search-clear { position: absolute; right: 8px; background: none;
  border: none; color: var(--text-muted); cursor: pointer; padding: 4px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.frm-search-wrap .frm-search-clear:hover { color: var(--text); }
.frm-search-wrap .frm-search-clear .prjh-ico { width: 14px; height: 14px; }

/* Button loader & spinner */
.btn-spinner { width: 12px; height: 12px; border: 2px solid currentColor;
  border-top-color: transparent; border-radius: 50%;
  animation: prjx-spin 0.8s linear infinite; display: inline-block;
  vertical-align: middle; margin-right: 6px; }

/* ============================== Screen 5 — Project page ================= */
/* [PRJ4 page-v1] restyled in place to the Agents/Projects-home language:
   56px header with icon buttons + status/vertical pills, a hero question
   with the summary under it, a composer card, chats as a bordered list, and
   the Project info drawer with home-style boxes. No glyph emoji. */
.prjx-pp { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.prjx-pp .pph2 { display: flex; align-items: center; gap: 10px; min-height: 60px;
  padding: 10px 20px; border-bottom: 1px solid var(--tb-border);
  background: var(--list); }
.prjx-pp .pph2 .back { width: 36px; height: 36px; }
.prjx-pp .pph2 h3 { margin: 0; min-width: 0; font-size: 17px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prjx-pp .pph2 .pph-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.prjx-pp .pph2 .pp-infobtn[aria-pressed="true"] { background: var(--selected-fill);
  border-color: var(--tb-accent-border); color: var(--tb-accent-text); }
.prjx-pp .ppmain { flex: 1; display: flex; min-height: 0; }
.prjx-pp .ppc { flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  align-items: center; padding: 9vh 24px 40px; background: var(--bg);
  scrollbar-width: thin; scrollbar-color: var(--tb-border-strong) transparent; }
.prjx-pp .ppc h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em;
  margin: 0 0 8px; text-align: center; padding-bottom: 0; border-bottom: 0; }
.prjx-pp .ppc .ppsub { max-width: 620px; margin: 0 0 22px; text-align: center;
  color: var(--tb-text-secondary); font-size: 14.5px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prjx-ppcomposer { width: 100%; max-width: 680px; border: 1px solid
  var(--tb-border-strong); border-radius: var(--radius-pop); background: var(--tb-surface);
  padding: 14px 14px 12px;
  transition: border-color 120ms ease-out; }
.prjx-ppcomposer:focus-within { border-color: var(--tb-accent-border); }
.prjx-ppcomposer textarea { width: 100%; border: none; background: transparent;
  resize: none; min-height: 56px; padding: 2px 4px; font-size: 15px; line-height: 1.5; }
.prjx-ppcomposer textarea:focus { outline: none; }
.prjx-ppcomposer .r { display: flex; align-items: center; gap: 9px;
  margin-top: 8px; }
.prjx-ppcomposer .ppsend { width: 36px; height: 36px; flex: none; display: inline-flex;
  align-items: center; justify-content: center; border: 0; border-radius: var(--radius-btn);
  background: var(--tb-accent); color: var(--white); }
.prjx-ppcomposer .ppsend:hover { background: var(--primary-hover); }
.prjx-ctxchip { display: inline-flex; align-items: center; gap: 6px; height: 30px;
  border: 1px solid var(--tb-border-strong); border-radius: 999px;   /* kit 4.3: pills stay 999 */
  background: var(--bg); color: var(--tb-text-secondary);
  font-size: 12.5px; padding: 0 12px; }
.prjx-ctxchip .prjh-ico { width: 16px; height: 16px; }
.prjx-ctxchip:hover { color: var(--tb-accent-text);
  border-color: var(--tb-accent-border); }
.prjx-ppchats { width: 100%; max-width: 680px; margin-top: 32px; }
.prjx-ppchats .h { display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform:
  uppercase; color: var(--tb-text-muted); margin: 0 4px 10px; }
.prjx-ppchats .h .n { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.prjx-ppchats .ppempty { padding: 14px 16px; border: 1px dashed var(--tb-border-strong);
  border-radius: var(--radius-card); font-size: 13px; }
.prjx-ppchats .pplist { border: 1px solid var(--tb-border); border-radius: var(--radius-card);
  background: var(--tb-surface); overflow: hidden; }
.prjx-ppchat { display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; background: none; border: none; border-top: 1px solid var(--tb-border);
  padding: 12px 16px; color: var(--tb-text); font-size: 14px; }
.prjx-ppchat:first-child { border-top: 0; }
.prjx-ppchat .prjh-ico { color: var(--tb-text-muted); }
.prjx-ppchat:hover { background: var(--surface-2); }
.prjx-ppchat:hover .t { color: var(--tb-accent-text); }
.prjx-ppchat .t { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.prjx-ppchat .w { font-size: 12px; color: var(--tb-text-muted); flex: none; }

/* Project info side panel */
.prjx-info { width: 340px; min-width: 340px; border-left: 1px solid
  var(--tb-border); background: var(--list); overflow-y: auto;
  padding: 16px; scrollbar-width: thin; scrollbar-color: var(--tb-border-strong) transparent; }
.prjx-info .ih { display: flex; align-items: center; justify-content:
  space-between; margin-bottom: 12px; }
.prjx-info .ih .t { font-size: 15px; font-weight: 700; }
.prjx-info .ih .x { width: 32px; height: 32px; }
.prjx-info .prjx-cardbox { background: var(--tb-surface); padding: 14px 16px; }
.prjx-info .prjx-cardbox .h > span:first-child { font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--tb-text-muted); }

/* ============================== Screen 6 — Loading (animated) =========== */
.prjx-load { flex: 1; display: flex; flex-direction: column; align-items:
  center; padding-top: 9vh; }
.prjx-load .markwrap { position: relative; width: 96px; height: 96px;
  margin-bottom: 20px; }
.prjx-load .glow { position: absolute; inset: -16px; border-radius: 50%;
  background: radial-gradient(circle, var(--tb-accent-soft) 0%, transparent 70%);
  animation: prjx-glow 2.4s ease-in-out infinite; }
.prjx-load .ring { position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--tb-border);
  border-top-color: var(--tb-accent-border);
  animation: prjx-spin 1.2s linear infinite; }
.prjx-load .orbit { position: absolute; inset: -7px;
  animation: prjx-spin 6s linear infinite; }
.prjx-load .orbit i { position: absolute; width: 7px; height: 7px;
  border-radius: 50%; }
.prjx-load .orbit i.a { top: 0; left: 50%; margin-left: -3px;
  background: var(--tb-accent-border); }
.prjx-load .orbit i.b { bottom: 0; left: 50%; margin-left: -3px;
  background: var(--tb-success); }
.prjx-load .mark { position: absolute; inset: 22px; border-radius: var(--radius-card);
  background: var(--tb-accent); display: flex; align-items: center;
  justify-content: center; color: var(--white);   /* [PRJ4] holds a folder svg, was an emoji */
  animation: prjx-pulse 1.6s ease-in-out infinite; }
.prjx-load .mark .prjh-ico { width: 28px; height: 28px; }
.prjx-load h2 { margin: 0 0 5px; font-size: 18px; }
.prjx-load .sub { color: var(--tb-text-muted); font-size: 13px;
  margin-bottom: 16px; }
.prjx-load .bar { width: 260px; height: 4px; border-radius: 999px;   /* kit 4.3: pills stay 999 */
  background: var(--tb-surface-2); overflow: hidden; margin-bottom: 20px; }
.prjx-load .bar i { display: block; width: 35%; height: 100%;
  border-radius: 999px;   /* kit 4.3: pills stay 999 */ background: var(--tb-accent);
  animation: prjx-bar 1.4s ease-in-out infinite; }
.prjx-load .steps { display: flex; flex-direction: column; gap: 9px;
  min-height: 84px; }
.prjx-step { display: flex; align-items: center; gap: 9px; font-size: 13.5px;
  color: var(--tb-text-secondary); opacity: 0;
  animation: prjx-stepin .4s ease-out forwards; }
.prjx-step .ic { width: 18px; height: 18px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; }
.prjx-step.done .ic { background: var(--tb-success-soft);
  color: var(--tb-success); }
.prjx-step.cur .ic { border: 2px solid var(--tb-accent-border);
  border-top-color: transparent; animation: prjx-spin 1s linear infinite; }
.prjx-step.todo .ic { border: 2px dashed var(--tb-border-strong); }
.prjx-load .skel { width: 100%; max-width: 620px; margin-top: 34px;
  opacity: .6; }
.prjx-load .sk { height: 46px; border-radius: var(--radius-card); margin-bottom: 11px;
  background: linear-gradient(100deg, var(--tb-surface) 40%,
    var(--tb-surface-2) 50%, var(--tb-surface) 60%);
  background-size: 200% 100%;
  animation: prjx-shimmer 1.6s linear infinite; border: 1px solid var(--tb-border); }
.prjx-load .sk.s2 { height: 34px; width: 70%; }
.prjx-load .slowacts { display: flex; gap: 10px; margin-top: 14px; }
.prjx-alert { border: 1px solid var(--tb-danger); background:
  var(--tb-danger-soft); color: var(--tb-danger); border-radius: var(--radius-card);
  padding: 12px 15px; margin-top: 10px; display: flex; align-items: center;
  gap: 12px; }

@keyframes prjx-spin { to { transform: rotate(360deg); } }
@keyframes prjx-pulse { 0%,100% { transform: scale(1); }
  50% { transform: scale(.9); } }
@keyframes prjx-glow { 0%,100% { opacity: .35; } 50% { opacity: .8; } }
@keyframes prjx-bar { 0% { transform: translateX(-100%); }
  100% { transform: translateX(380%); } }
@keyframes prjx-stepin { from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); } }
@keyframes prjx-shimmer { 0% { background-position: 200% 0; }
  100% { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .prjx-load .ring, .prjx-load .orbit, .prjx-load .mark, .prjx-load .glow,
  .prjx-load .bar i, .prjx-load .sk, .prjx-step.cur .ic {
    animation: none !important; }
  .prjx-step { opacity: 1 !important; animation: none !important; }
}

/* ==================== TOAST & WARNBANNER (Top-Right Redesign) ==================== */
.prjx-toast,
.prjx-warnbanner {
  position: fixed;
  top: 24px;
  right: 24px;
  left: auto;
  bottom: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  z-index: 99999;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font, sans-serif);
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.38), 0 4px 12px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: prjx-toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
  pointer-events: auto;
}

@keyframes prjx-toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.prjx-toast .prjh-ico,
.prjx-warnbanner .prjh-ico {
  width: 18px;
  height: 18px;
  flex: none;
  stroke-width: 2.2;
}

.prjx-toast-txt {
  line-height: 1.4;
  word-break: break-word;
}

/* Success toast: LIME in Dark theme */
.prjx-toast {
  background: color-mix(in srgb, #84cc16 13%, #14171f);
  border: 1px solid color-mix(in srgb, #84cc16 38%, transparent);
  color: #d9f99d;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45), 0 0 16px rgba(132, 204, 22, 0.16);
}
.prjx-toast .prjh-ico {
  color: #a3e635;
}

/* Success toast: BLUE in Light theme */
:root[data-theme="light"] .prjx-toast {
  background: color-mix(in srgb, #2563eb 8%, #ffffff);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.15), 0 2px 8px rgba(0, 0, 0, 0.05);
}
:root[data-theme="light"] .prjx-toast .prjh-ico {
  color: #2563eb;
}

/* Fail / Warning toast: RED in Dark theme */
.prjx-warnbanner {
  background: color-mix(in srgb, #ef4444 14%, #14171f);
  border: 1px solid color-mix(in srgb, #ef4444 40%, transparent);
  color: #fca5a5;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45), 0 0 16px rgba(239, 68, 68, 0.16);
}
.prjx-warnbanner .prjh-ico {
  color: #ef4444;
}

/* Fail / Warning toast: RED in Light theme */
:root[data-theme="light"] .prjx-warnbanner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  box-shadow: 0 12px 28px -4px rgba(239, 68, 68, 0.15), 0 2px 8px rgba(0, 0, 0, 0.05);
}
:root[data-theme="light"] .prjx-warnbanner .prjh-ico {
  color: #dc2626;
}
.prjx-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; z-index: 290; }
.prjx-modal .box { background: var(--tb-bg-panel); border: 1px solid
  var(--tb-border-strong); border-radius: var(--radius-dialog); padding: 18px 20px;
  max-width: 420px; width: 92%; }
.prjx-modal .box h3 { margin: 0 0 7px; font-size: 15px; }
.prjx-modal .box p { margin: 0 0 14px; color: var(--tb-text-secondary);
  font-size: 13.5px; line-height: 1.5; }
.prjx-modal .acts { display: flex; justify-content: flex-end; gap: 9px; }

@media (max-width: 1100px) {
  .prjx-side { width: 200px; min-width: 200px; }
  .prjx-list { width: 300px; }
  .prjx-panel, .prjx-info { width: 260px; min-width: 260px; }
}

/* [projects-v2-p2] validation warnings under the final profile card */
.prjx-warnbox{margin-top:8px;border:1px solid var(--tb-border);
  border-left:3px solid var(--tb-accent);background:var(--tb-surface-2);   /* [UT1] --tb-bg-2 was never defined */
  border-radius: var(--radius-btn);padding:8px 10px;display:flex;flex-direction:column;gap:5px}
.prjx-warnbox .wrow{font-size:12.5px;color:var(--tb-text);opacity:.92}

/* [projects-v2-p21] chat-edit row in the Edit profile dialog */
.prjx-editchat{display:flex;gap:8px;margin-bottom:12px}
.prjx-editchat input{flex:1}

/* [projects-v2-p2-1] chat-edit line inside the Edit profile dialog */
.prjx-assistline{display:flex;gap:8px;margin:4px 0 10px}
.prjx-assistline input{flex:1}

/* ===== [prjx-menu-clear-x-v1] the app shell's global close button
   (#viewclose, app.css: absolute top:14px right:18px z-index:50) floats
   over every takeover view's top-right corner — exactly where the
   preview header's "..." menu and the project page's header buttons
   land. Reserve that corner so nothing sits underneath it. */
/* [NAV1] RETIRED — #viewclose is gone (components/navbar/navbar.css), so this
   corner no longer needs reserving. Restore both lines if the X comes back.
   Logged in b2c-vault/Removed-for-redesign.md section 1.2.
.prjx-prev .ph { padding-right: 68px; }
.prjx-pp .pph2 { padding-right: 68px; } */

/* [prjx-prewarm-v1] first-ever list fetch shows a hint, not a flash of
   the empty state. */
.prjx-loadhint { padding: 26px 8px; text-align: center; }

/* ===== [prjx-multivert-v1] / [prjx-edit-duo-v1] / [prjx-tool-suggest-v1]
   / [prjx-pane-collapse-v1] — Oct 2026 multi-vertical tranche ========== */

/* [prjx-pane-collapse-v1] the divider of a right-hand pane in create/edit
   carries a slim handle; clicking collapses the pane so the left window
   gets the full width. */
.prjx-clps { width: 16px; min-width: 16px; align-self: stretch;
  border: none; border-left: 1px solid var(--tb-border);
  background: var(--tb-bg-panel); color: var(--tb-text-muted);
  font-size: 12px; padding: 0; cursor: pointer; }
.prjx-clps:hover { color: var(--tb-accent-text);
  background: var(--tb-accent-soft); }
.prjx-clpsd { width: 0 !important; min-width: 0 !important;
  padding: 0 !important; border: none !important; overflow: hidden !important; }

/* [prjx-edit-duo-v1] chat + form editor: the form pane is wider than the
   wizard's checklist panel, and its embedded .prjx-form loses the page
   padding (the pane already pads). */
.prjx-editpane { width: 420px; min-width: 420px; }
.prjx-editpane .prjx-form { max-width: none; overflow: visible; }
.prjx-editpane .prjx-cardbox { margin-top: 2px; }
@media (max-width: 1250px) {
  .prjx-editpane { width: 340px; min-width: 340px; } }

/* [prjx-tool-suggest-v1] tools in the form + the Add-a-tool dialog — [Section 7 checkbox & row rules] */
.prjx-formtools { display: flex; flex-direction: column; gap: 6px;
  border: 1px solid var(--border-2); border-radius: var(--radius-card);
  background: var(--surface); padding: 10px 12px; }
.prjx-formtools .trow { display: flex; align-items: center; gap: 8px;
  flex-direction: row; font-size: 13.5px; color: var(--text); padding: 6px 8px;
  border-radius: var(--radius-btn); cursor: pointer; transition: background-color 120ms ease-out; }
.prjx-formtools .trow:hover { background: var(--surface-2); }
.prjx-formtools .trow input[type="checkbox"] { width: 18px; height: 18px; margin: 0;
  accent-color: var(--primary); cursor: pointer; flex: none; border-radius: 4px; }
.prjx-formtools .trow .n { font-weight: 600; white-space: nowrap; }
.prjx-formtools .trow .p { font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 4px; }
.prjx-tooltagnote { font-size: 12px; margin-bottom: 9px; color: var(--text-muted); }
.prjx-form .fsec { display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--text); }

/* ===== [prjx3-x-corner-v1] The wizard/editor header's Save and Cancel
   sat under the app shell's global X (#viewclose, absolute top:14px
   right:18px z-50). Reserve the corner, same cure as
   [prjx-menu-clear-x-v1]. */
/* [NAV1] RETIRED with #viewclose — see Removed-for-redesign.md 1.2
.prjx-wiz .wh { padding-right: 68px; } */

/* ===== [prjx-tool-picker-v1] Add-a-tool: Suggested + full catalogue with
   live search; custom preferred-tool tags. */
.prjx-tpick-sec { font-size: 12px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--tb-text-muted);
  margin: 12px 0 6px; }
.prjx-toolcat { max-height: 240px; overflow-y: auto; padding-right: 4px; }
.prjx-toolcat .btn, .prjx-tpick-sugg .btn { display: block; width: 100%;
  margin-bottom: 7px; text-align: left; }
.prjx-tpick-custom { border-style: dashed !important; }

/* ===== [uxc2 batch-questions-v1] one block per vertical, every question */
.prjx-batch { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; min-width: min(560px, 100%); }
.prjx-bq { display: flex; flex-direction: column; gap: 5px; }
.prjx-bq-l { font-size: 13px; font-weight: 600; }
.prjx-bq .frm-ctl { width: 100%; }
.prjx-batch input:disabled, .prjx-batch button:disabled { opacity: .6; cursor: default; }
/* ===== [uxc2 tool-groups-v1] grouped, searchable catalogue in the wizard */
.prjx-tpk { margin-top: 8px; min-width: min(640px, 100%); }
.prjx-tpk-bar { display: flex; flex-direction: column; gap: 8px; }
.prjx-tpk-bar .frm-ctl { width: 100%; }
.prjx-tpk-meta { margin: 6px 0 2px; }
.prjx-tpk-list { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.prjx-tpk-sec { margin-top: 8px; }
.prjx-tpk-hd { display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; border-bottom: 1px solid var(--tb-border); padding: 6px 2px;
  color: var(--tb-text-muted); font-size: 12px; letter-spacing: .07em; text-transform: uppercase;
  cursor: pointer; text-align: left; }
.prjx-tpk-hd .n { flex: 1; } .prjx-tpk-hd .c { opacity: .8; } .prjx-tpk-hd .tg { font-size: 14px; }
.prjx-tool.sugg .n::after { content: ' \2605'; color: var(--tb-accent-text); font-size: 11px; }
.prjx-tdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--tb-text-muted); opacity: .5; }
.prjx-tdot.ok { background: var(--tb-success); opacity: 1; }
.prjx-tdot.off { background: var(--tb-danger); opacity: .9; }

/* ===== [split-drag-v1] the create/edit divider is a drag handle too */
.prjx-clps { cursor: col-resize; }

/* [PGS1 page-shell-v1] Home is the only column layout: navbar on top, the
   page body below. The wizard, project page and editor keep the row flex
   above, so the direction rides on a class the router sets/clears. */
.prjx.prjx-home { flex-direction: column; }

/* ===== [PRJ3 three-col-v1] Projects home on the Agents page skeleton
   (2026-10-12). verticals 240 (--list) | list (--bg) | detail (--bg), cards
   and boxes on --surface - the brand kit's three layers. Line icons
   (.prjh-ico), fold groups, thin scrollbars, pills by meaning:
   lime = active/connected, amber = draft/needs action, accent = vertical.
   New .prjh-* classes only; the PGS1 .pg-* home markup is retired. */
.prjx.prjx-home > .prjh { flex: 1 1 auto; min-height: 0; display: flex; overflow: hidden; }
.prjx .prjh-ico { width: 20px; height: 20px; flex: none; fill: none;
  stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.prjx .prjh-ico .fill { fill: currentColor; stroke: none; }
.prjh h1, .prjh h2, .prjh h3 { padding-bottom: 0; border-bottom: 0; }   /* renderer.css bare-h2 rule */

.prjh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-btn); border: 1px solid transparent;
  background: transparent; color: var(--tb-text); font-size: 13.5px; font-weight: 600;
  white-space: nowrap; transition: background-color 120ms ease-out, border-color 120ms ease-out; }
.prjh-btn .prjh-ico { width: 19px; height: 19px; }
.prjh-btn.primary { background: var(--tb-accent); color: var(--white); }
.prjh-btn.primary:hover { background: var(--primary-hover); }
.prjh-btn.secondary { border-color: var(--tb-border-strong); }
.prjh-btn.secondary:hover { border-color: var(--border-hover); background: var(--surface-2); }
.prjh-ibtn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-btn); border: 1px solid var(--tb-border-strong);
  background: transparent; color: var(--tb-text-secondary); }
.prjh-ibtn:hover { color: var(--tb-text); border-color: var(--border-hover); background: var(--surface-2); }
.prjh-link { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0;
  padding: 0; color: var(--tb-accent-text); font-size: 13px; font-weight: 600; }
.prjh-link .prjh-ico { width: 18px; height: 18px; }
.prjh-link:hover { color: var(--tb-accent-hover); }
.prjh-seclabel { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tb-text-muted); }
.prjh-muted { margin: 4px 0; color: var(--tb-text-muted); font-size: 13px; }

.prjh-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 600;
  white-space: nowrap; flex: none; }
.prjh-pill .prjh-ico { width: 16px; height: 16px; }
.prjh-pill.active { color: var(--tb-success-text); background: var(--tb-success-soft); }
.prjh-pill.draft { color: var(--tb-warning-text); background: var(--tb-warning-soft); }
.prjh-pill.dom { color: var(--tb-accent-text); background: var(--tb-accent-soft); }

/* column 1: verticals */
.prjh-side { width: 240px; min-width: 240px; background: var(--list);
  border-right: 1px solid var(--tb-border); padding: 20px 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: var(--tb-border-strong) transparent; }
.prjh-side .prjh-new {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-btn);
  background: var(--tb-accent);
  color: #fff;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 120ms ease-out, transform 120ms ease-out, box-shadow 120ms ease-out;
  cursor: pointer;
}
.prjh-side .prjh-new .prjh-ico {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}
.prjh-side .prjh-new:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(47, 107, 255, 0.25);
  transform: translateY(-1px);
}
.prjh-side .prjh-new:active {
  transform: translateY(0);
}
.prjh-side .prjh-seclabel { margin: 6px 0 -6px 4px; }
.prjh-doms { display: flex; flex-direction: column; gap: 2px; }
.prjh-dom { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px;
  padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-btn);
  background: transparent; color: var(--tb-text-secondary); text-align: left;
  font-size: 13.5px; font-weight: 500; }
.prjh-dom:hover { background: var(--surface-2); color: var(--tb-text); }
.prjh-dom .ic { width: 28px; height: 28px; flex: none; display: flex; align-items: center;
  justify-content: center; border-radius: 8px; background: var(--surface-2);
  color: var(--tb-text-secondary); }
.prjh-dom .ic .prjh-ico { width: 19px; height: 19px; }
.prjh-dom .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prjh-dom .n { color: var(--tb-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.prjh-dom[aria-pressed="true"] { background: var(--selected-fill); color: var(--tb-text);
  border-color: color-mix(in srgb, var(--tb-accent-border) 40%, transparent); }
.prjh-dom[aria-pressed="true"] .ic { color: var(--tb-accent-text); }

/* column 2: list */
.prjh-list { width: 380px; min-width: 300px; border-right: 1px solid var(--tb-border);
  padding: 16px; overflow-y: auto; background: var(--bg);
  scrollbar-width: thin; scrollbar-color: var(--tb-border-strong) transparent; }
.prjh-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.prjh-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 34px;
  padding: 0 10px; background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-btn); color: var(--text-muted);
  transition: border-color 120ms ease-out, background 120ms ease-out, box-shadow 120ms ease-out; }
.prjh-search:hover { border-color: var(--border-hover); }
.prjh-search:focus-within { border-color: var(--tb-accent-border); background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tb-accent) 15%, transparent); }
.prjh-search .prjh-ico { width: 15px; height: 15px; color: var(--text-muted); flex: none; stroke-width: 2; }
.prjh-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0;
  background: transparent; outline: none; font-size: 13px; color: var(--text); }
.prjh-search input::placeholder { color: var(--text-muted); font-size: 13px; }
.prjh-tools .prjh-sort { height: 34px; padding: 0 28px 0 10px; background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--radius-btn);
  color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color 120ms ease-out, background-color 120ms ease-out; outline: none; }
.prjh-tools .prjh-sort:hover { border-color: var(--border-hover); background-color: var(--surface); }
.prjh-tools .prjh-sort:focus-visible { border-color: var(--tb-accent-border); box-shadow: 0 0 0 2px color-mix(in srgb, var(--tb-accent) 15%, transparent); }
.prjh-tools .prjh-sort option { background: var(--surface); color: var(--text); }
[data-theme="dark"] .prjh-tools .prjh-sort {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.prjh-group { margin-bottom: 14px; }
.prjh-group > .h { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px;
  margin: 0 0 8px; padding: 0 6px; border: 0; border-radius: var(--radius-btn);
  background: transparent; color: var(--tb-text-secondary); text-align: left; }
.prjh-group > .h:hover { background: var(--surface-2); color: var(--tb-text); }
.prjh-group > .h .chev { width: 18px; height: 18px; color: var(--tb-text-muted);
  transition: transform 150ms ease-out; }
.prjh-group.shut > .h .chev { transform: rotate(-90deg); }
.prjh-group > .h .t { flex: 1; font-size: 13px; font-weight: 600; }
.prjh-group > .h .n { color: var(--tb-text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.prjh-group.shut > .rows { display: none; }
.prjh-card { display: block; width: 100%; text-align: left; margin-bottom: 10px; padding: 14px 16px;
  background: var(--tb-surface); border: 1px solid var(--tb-border); border-radius: var(--radius-card);
  color: var(--tb-text); transition: border-color 120ms ease-out; }
.prjh-card:hover { border-color: var(--tb-border-strong); }
.prjh-card.sel { border-color: var(--tb-accent-border);
  background: color-mix(in srgb, var(--tb-accent) 7%, var(--tb-surface)); }
.prjh-card .t { font-size: 14.5px; font-weight: 600; margin-bottom: 2px; }
.prjh-card .co { color: var(--tb-text-secondary); font-size: 12.5px; margin-bottom: 4px; }
.prjh-card .s { color: var(--tb-text-muted); font-size: 13px; line-height: 1.45; margin: 4px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prjh-card .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.prjh-card .m { margin-top: 10px; color: var(--tb-text-muted); font-size: 12px;
  font-variant-numeric: tabular-nums; }
.prjh-listempty { padding: 8px 4px; color: var(--tb-text-muted); font-size: 13px; }
.prjh-listempty p { margin: 0 0 6px; }
.prjh-skel { height: 96px; margin-bottom: 10px; border-radius: var(--radius-card);
  border: 1px solid var(--tb-border);
  background: linear-gradient(90deg, var(--tb-surface) 0%, var(--tb-surface-2) 45%, var(--tb-surface) 90%);
  background-size: 200% 100%; animation: bk-shimmer 1.8s linear infinite; }
.prjh-dskel .prjh-skel { margin-bottom: 14px; }
.prjh-dskel .prjh-skel.t { height: 34px; width: 50%; }
.prjh-dskel .prjh-skel.m { height: 22px; width: 30%; }
.prjh-dskel .prjh-skel.p { height: 16px; width: 85%; }
.prjh-dskel .prjh-skel.box { height: 180px; }

/* column 3: detail */
.prjh-main { flex: 1; min-width: 0; overflow-y: auto; padding: 28px 32px 48px; background: var(--bg);
  scrollbar-width: thin; scrollbar-color: var(--tb-border-strong) transparent; }
.prjh-side::-webkit-scrollbar, .prjh-list::-webkit-scrollbar,
.prjh-main::-webkit-scrollbar { width: 6px; }
.prjh-side::-webkit-scrollbar-thumb, .prjh-list::-webkit-scrollbar-thumb,
.prjh-main::-webkit-scrollbar-thumb { background: var(--tb-border-strong); border-radius: 999px; }
.prjh-side::-webkit-scrollbar-track, .prjh-list::-webkit-scrollbar-track,
.prjh-main::-webkit-scrollbar-track { background: transparent; }
.prjh-empty { max-width: 520px; margin: 64px auto; text-align: center; }
.prjh-empty .glyph { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tb-accent-soft); color: var(--tb-accent-text); }
.prjh-empty .glyph .prjh-ico { width: 26px; height: 26px; }
.prjh-empty h1 { margin: 0 0 8px; font-size: 26px; font-weight: 700; }
.prjh-empty p { margin: 0; color: var(--tb-text-secondary); font-size: 15px; line-height: 1.55; }
.prjh-loaderr { margin-bottom: 16px; }
.prjh-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.prjh-head h1 { margin: 0; min-width: 0; font-size: 26px; font-weight: 700; line-height: 1.2;
  letter-spacing: -.01em; overflow-wrap: anywhere; }
.prjh-head .sp { flex: 1; }
.prjh-head .acts { display: flex; align-items: center; gap: 8px; flex: none; }
.prjh-menuwrap { position: relative; }
.prjh-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 200px;
  padding: 6px; background: var(--tb-bg-panel); border: 1px solid var(--tb-border-strong);
  border-radius: 14px; box-shadow: var(--shadow-pop); }
.prjh-menu button { display: flex; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-btn);
  background: none; color: var(--tb-text); text-align: left; font-size: 13.5px; }
.prjh-menu button:hover { background: var(--surface-2); }
.prjh-menu button.danger { color: var(--tb-danger); }
.prjh-menu .sep { height: 1px; margin: 6px 4px; background: var(--tb-border); }
.prjh-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px;
  color: var(--tb-text-muted); font-size: 13px; }
.prjh-lead { max-width: 820px; margin: 0 0 18px; color: var(--tb-text-secondary);
  font-size: 15px; line-height: 1.6; }
.prjh-status { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 14px 16px;
  border: 1px solid var(--tb-border); border-radius: var(--radius-card); background: var(--tb-surface); }
.prjh-status .ic { flex: none; display: flex; margin-top: 1px; }
.prjh-status .ic .prjh-ico { width: 22px; height: 22px; }
.prjh-status .lvl { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.prjh-status .m { color: var(--tb-text-secondary); font-size: 13px; line-height: 1.5; }
.prjh-status.draft { border-color: color-mix(in srgb, var(--tb-warning) 45%, transparent);
  background: var(--tb-warning-soft); }
.prjh-status.draft .ic, .prjh-status.draft .lvl { color: var(--tb-warning-text); }
.prjh-status.ready { border-color: color-mix(in srgb, var(--tb-success) 40%, transparent);
  background: var(--tb-success-soft); }
.prjh-status.ready .ic, .prjh-status.ready .lvl { color: var(--tb-success-text); }
.prjh-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
/* every box in the grid, including the shared filesCard/toolsCard
   (.prjx-cardbox gets .prjh-box added by the home) */
.prjh-grid > .prjh-box { min-width: 0; margin: 0; padding: 16px 18px; background: var(--tb-surface);
  border: 1px solid var(--tb-border); border-radius: var(--radius-card); }
.prjh-boxhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.prjh-grid > .prjx-cardbox .h { margin-bottom: 8px; }
.prjh-grid > .prjx-cardbox .h > span:first-child { font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--tb-text-muted); }
.prjh-grid > .prjx-cardbox .h .add { font-size: 13px; font-weight: 600; }
.prjh-chats .rows { display: flex; flex-direction: column; }
.prjh-chat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 0;
  border: 0; border-top: 1px solid var(--tb-border); background: none; color: var(--tb-text);
  text-align: left; font-size: 13.5px; }
.prjh-chat:first-child { border-top: 0; }
.prjh-chat .prjh-ico { color: var(--tb-text-muted); }
.prjh-chat .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prjh-chat .w { color: var(--tb-text-muted); font-size: 12px; }
.prjh-chat:hover .t { color: var(--tb-accent-text); }
.prjh-chats .prjh-link { margin-top: 8px; }
.prjx-frow .frow-ico { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--tb-text-muted);
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 1100px) {
  .prjh-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .prjx.prjx-home > .prjh { flex-direction: row; overflow: hidden; }
}
@media (max-width: 767px) {
  .prjx.prjx-home > .prjh { flex-direction: column; overflow-y: auto; }
  .prjh-side, .prjh-list { width: 100%; min-width: 0; border-right: 0;
    border-bottom: 1px solid var(--tb-border); overflow: visible; }
  .prjh-main { padding: 20px 16px; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  .prjh-skel, .prjx-ppcomposer { animation: none; transition: none; }
  .prjh-btn, .prjh-card, .prjh-group > .h .chev { transition: none; }
}
