/* Projects app — the shell. The frame around every page, and the brand.
   Owns: the sidebar (.pj-bar, a top bar on phones), the work-area header
   (.desk-topbar), the work area (.app-main), the type scale, the one focus
   ring, the dark-theme mapping, and the corrections to pages borrowed from
   the original app (styles.css). Everything inside the work area is
   projects-pages.css; a rule for the frame goes here, never there.
   The Desk brand (DESIGN.md, a mirror of the DeepSeek Harness web client;
   user, 2026-11-06): only the projects app (3025) wears it — server.js sets
   data-brand="desk" for that experience alone; the original app (3004)
   keeps its own look. Colours come from tokens.css (:root[data-brand="desk"]).
   Tokens only, no literal colours. Also loaded by studio.html when embedded. */

html[data-brand="desk"] {
  --desk-top: 52px;   /* the work-area header */
  --desk-rail: 56px;  /* closed sidebar */
  --desk-side: 364px; /* open sidebar (280px × 1.3, user 2026-11-09) */
  --desk-gap: 8px;
  --font-en: var(--rp-font-en);
}

/* The type scale (DESIGN.md: 14px base, 13 secondary, 12 small) is the
   --rp-text-* tokens at a 16px root, so English runs at 100% here (the app's
   106.25% was sized for Plus Jakarta Sans). Persian keeps its larger root. */
html[data-brand="desk"][lang="en"] { font-size: 100%; }

/* One placeholder everywhere in the app (user, 2026-11-22): the subtle text
   colour, regular weight, upright, full opacity — whatever the box, its
   label's weight or the original app's per-component tints. The single rule
   for it: don't add a ::placeholder colour anywhere else. */
html[data-brand="desk"]:root :is(input, textarea)::placeholder { /* :root: outranks monochrome.css per-component rules */
  color: var(--rp-text-subtle); font-weight: 400; font-style: normal; opacity: 1;
}

/* Sora: the Desk brand's Latin face (user, 2026-11-26, as on reportia.ai);
   one variable file, latin subset, weights 100-800, its weight axis remapped
   a step lighter (user, 2026-11-28: regular read as bold): 400 draws at
   Sora's 300, 500 at its 400, 800 stays 800 (avar, fonts/README.md). */
@font-face {
  font-family: "Sora";
  src: url("./fonts/Sora-Variable-Lighter.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* Persian type (user, 2026-11-07, option C). Yekan Bakh's Persian letters are
   small for their size and its Latin letters large, so English words looked
   bigger than the Persian around them. Farsi now runs on the same 16px root as
   English: Persian letters come from these faces (Persian code points only,
   scaled 110%: a step under the old 19px root, user 2026-11-07) and every other letter
   falls through to the English UI's own font and size. */
@font-face {
  font-family: "Desk Persian";
  src: url("./fonts/YekanBakh-Regular.woff2") format("woff2"), url("./fonts/YekanBakh-Regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+00AB, U+00BB;
  size-adjust: 110%;
}
@font-face {
  font-family: "Desk Persian Fallback";
  src: url("./fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+00AB, U+00BB;
  size-adjust: 110%;
}
html[data-brand="desk"][lang="fa"] {
  font-size: 100%;
  --font-fa: "Desk Persian", "Desk Persian Fallback", var(--rp-font-en);
  --font: var(--font-fa);
  --rp-font-fa: var(--font-fa);
  --rp-font-display: var(--font-fa);
}

/* The dark theme's component overrides (monochrome.css) read the mono
   primitives directly; point them at the Desk darks. */
html[data-brand="desk"][data-theme="monochrome"] {
  --rp-mono-950: var(--rp-desk-950);
  --rp-mono-900: var(--rp-desk-950);
  --rp-mono-850: var(--rp-desk-875);
  --rp-mono-810: var(--rp-desk-850);
  --rp-mono-800: var(--rp-desk-850);
  --rp-mono-750: var(--rp-desk-750);
  --rp-mono-500: var(--rp-desk-625);
  --rp-mono-400: var(--rp-desk-400);
  --rp-mono-350: var(--rp-desk-300);
  --rp-mono-300: var(--rp-desk-300);
  --rp-mono-200: var(--rp-desk-50);
}

/* Plain grounds: no gradients, halos or grids behind the app. The canvas is
   the sidebar's fill; the work area is the white surface beside it. */
html[data-brand="desk"] body {
  background: var(--rp-canvas);
  background-image: none;
}
html[data-brand="desk"] ::selection { background: color-mix(in srgb, var(--rp-focus) 30%, transparent); color: var(--rp-text); }

/* ── One focus ring (2026-11-05 audit) ───────────────────────────────
   Controls: a 2px outline in --rp-focus (the Desk blue), 2px out.
   Text fields: the same colour as a 2px ring on the field's own edge.
   Covers the components this app borrows from styles.css too (library-*,
   usecase-drawer*), which otherwise fall back to the browser's ring. */
html[data-brand="desk"] :is(a[href], button, summary, select, [role="button"], [role="tab"], [role="menuitem"], [role="option"], [tabindex]:not([tabindex="-1"]), input[type="checkbox"], input[type="radio"]):focus-visible {
  outline: 2px solid var(--rp-focus);
  outline-offset: 2px;
}
html[data-brand="desk"] .usecase-drawer :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), textarea):focus-visible,
html[data-brand="desk"] .library-toolbar :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), textarea):focus-visible {
  outline: none;
  border-color: var(--rp-focus);
  box-shadow: 0 0 0 1px var(--rp-focus);
}

/* Drawer fields: projects-pages.css gives them 10px corners in a rule the
   original app shares; here they take the 12px field radius. */
html[data-brand="desk"] .usecase-drawer :is(textarea, input:not([type="checkbox"], [type="radio"], [type="hidden"])) { border-radius: var(--rp-radius-md); }

/* Components borrowed from styles.css (library-*, collections-*): their
   rem sizes land off the scale at this app's 16px root, and some run
   700/800. Snap them to the Desk scale, weights ≤ 600, and flat. */
html[data-brand="desk"] .app-main :is(.library-filter-section-title, .library-filter-count, .library-sort-tab, .library-filter-chip > span, .library-card-status, .library-card-tag, .library-card-datetime, .library-card-demo-toggle, .library-tag-reveal, .library-filters-clear, .library-filters-done, .library-card-link, .pj-linklabel, .collections-card__member-meta) {
  font-size: var(--rp-text-xs) !important;
}
html[data-brand="desk"] .app-main :is(.report-history-hint, .collections-card__member-name) { font-size: var(--rp-text-sm) !important; }
html[data-brand="desk"] .app-main .library-filters-panel-title { font-size: var(--rp-text-md) !important; }
html[data-brand="desk"] .app-main .library-filters-close { font-size: var(--rp-text-base) !important; }
html[data-brand="desk"] .app-main .view-title { font-size: var(--rp-text-xl) !important; }
html[data-brand="desk"] .app-main :is(h1, h2, h3, h4, h5, h6, strong, b, th, .view-title, .library-filter-section-title, .library-filter-count, .library-filters-panel-title, .library-filters-done) {
  font-weight: 600 !important;
}
html[data-brand="desk"] .app-main :is(.library-toolbar, .library-sort-tab) { box-shadow: none !important; }
html[data-brand="desk"] .app-main .library-category-item > span { font-size: var(--rp-text-xs) !important; }
/* Floating surfaces borrowed from styles.css: menu corners and the soft
   floating shadows (theirs are navy-tinted, 14px). */
html[data-brand="desk"] .library-card-menu-panel { border-radius: var(--rp-radius-xl) !important; border-color: var(--rp-border-subtle) !important; box-shadow: var(--rp-shadow-md) !important; }
html[data-brand="desk"] .usecase-drawer { box-shadow: var(--rp-shadow-lg); }
html[data-brand="desk"] .app-main .report-history-hint { border-radius: var(--rp-radius-lg) !important; }

/* Credits and Gamma keep their own navy in the original app; here every
   category follows the brand (ink). */
html[data-brand="desk"] {
  --cat-credits: var(--brand);
  --cat-credits-soft: var(--brand-soft);
  --cat-credits-grad: var(--brand-soft);
  --cat-gamma: var(--brand);
  --cat-gamma-soft: var(--brand-soft);
  --cat-gamma-grad: var(--brand-soft);
}

/* ── Frame: the original app's sidebar gives way to the shell ───── */
html[data-experience="projects"] .app-sidebar,
html[data-experience="projects"] .mobile-top-bar,
html[data-experience="projects"] .mobile-nav-backdrop { display: none !important; }
html[data-experience="projects"] .app-shell { display: block; }
html[data-experience="projects"] .app-main { padding: 0 clamp(16px, 3vw, 36px) 0; gap: 0; }

/* ── Work-area header (≥768px) ───────────────────────────────────
   The path (Projects / <project> / …, links but the last) across the top of
   the work area, over a 0.5px rule. The brand lives in the sidebar. */
.desk-topbar { display: none; }

.desk-topbar {
  position: fixed; top: 0; inset-inline-start: var(--pj-rail-w, 0px); inset-inline-end: 0; z-index: 55;
  height: var(--desk-top);
  align-items: center; gap: 4px;
  padding-inline: 20px 28px;
  box-sizing: border-box;
  background: var(--rp-surface);
  border-bottom: 0.5px solid var(--rp-border);
  color: var(--rp-text);
  font-size: var(--rp-text-md);
  line-height: 20px;
  transition: inset-inline-start 200ms var(--rp-ease-out);
}
/* An open drawer lives in the work area, which is its own layer under the
   top bar; lift that layer while it is open so the drawer's header shows. */
html[data-experience="projects"] body.pj-drawer-open .app-main { z-index: 56; }
.desk-topbar__org, .desk-topbar > .desk-topbar__sep { display: none; }
.desk-topbar__sep { color: var(--rp-text-faint); }
.desk-topbar__crumb {
  display: flex; align-items: center; gap: 4px; min-width: 0;
  color: var(--rp-text); white-space: nowrap;
}
.desk-topbar__crumb > a, .desk-topbar__crumb > span:not(.desk-topbar__sep) {
  max-width: 220px; padding: 4px 8px; overflow: hidden; text-overflow: ellipsis;
  border-radius: var(--rp-radius-md);
  /* Each crumb takes its own text's direction: an English title in the
     Farsi UI keeps its "?" at the end. */
  unicode-bidi: plaintext;
}
.desk-topbar__crumb > a { color: var(--rp-text-muted); text-decoration: none; transition: background var(--rp-duration-fast), color var(--rp-duration-fast); }
.desk-topbar__crumb > a:hover { background: var(--rp-fill); color: var(--rp-text); }
.desk-topbar__crumb > :last-child { min-width: 0; font-weight: 500; color: var(--rp-text); }
/* Home has no path: no rule either, as dsh's home. */
.desk-topbar:has(.desk-topbar__crumb:empty) { border-bottom-color: transparent; }

@media (min-width: 768px) {
  html[data-brand="desk"][data-experience="projects"] .desk-topbar { display: flex; }
  /* the header carries the trail; phones, without it, keep the page's own */
  html[data-brand="desk"] .app-main .pj-crumbs { display: none; }
}

/* ── Menus (dsh's frosted menu) ──────────────────────────────────
   One look for every small menu in the frame and on home: translucent fill,
   40px blur, 16px corners, 4px padding, 34px rows, the soft floating shadow. */
.pj-menu {
  position: absolute; z-index: 70; min-width: 200px; padding: 4px; box-sizing: border-box;
  border: 0.5px solid var(--rp-border-subtle); border-radius: var(--rp-radius-xl);
  background: color-mix(in srgb, var(--rp-surface) 84%, transparent);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  backdrop-filter: blur(40px) saturate(150%);
  box-shadow: var(--rp-shadow-md);
  animation: pj-fade 140ms var(--rp-ease-out) both;
}
.pj-menu hr { margin: 4px 6px; border: 0; border-top: 0.5px solid var(--rp-border); }
.pj-menu__item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 10px; box-sizing: border-box;
  border: 0; border-radius: var(--rp-radius-sm); background: transparent; color: var(--rp-heading);
  font: inherit; font-size: var(--rp-text-md); line-height: 22px; text-align: start; cursor: pointer;
}
.pj-menu__item > span { flex: 1; min-width: 0; }
.pj-menu__item svg { flex: none; width: 16px; height: 16px; color: var(--rp-text-muted); }
.pj-menu__item:hover:not(:disabled) { background: var(--rp-hover-wash); }
.pj-menu__item:disabled { opacity: 0.4; cursor: not-allowed; }
.pj-menu__item.is-danger { color: var(--rp-danger-text); }
.pj-menu__item.is-danger svg { color: currentColor; }
.pj-menu__item--rich { align-items: flex-start; padding-block: 8px; }
.pj-menu__item--rich > svg:first-child { margin-top: 3px; }
.pj-menu__copy { display: flex; flex-direction: column; gap: 2px; }
.pj-menu__title { color: var(--rp-heading); }
.pj-menu__title:has(.pj-menu__pill) { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pj-menu__pill {
  display: inline-flex; align-items: center; flex: none; padding: 0 7px;
  border: 0.5px solid var(--rp-border-strong); border-radius: var(--rp-radius-pill);
  background: var(--rp-surface); color: var(--rp-text-secondary);
  font-size: var(--rp-text-2xs); font-weight: 650; line-height: 18px; white-space: nowrap;
}
.pj-menu__hint { font-size: var(--rp-text-xs); line-height: 18px; color: var(--rp-text-subtle); }
.pj-menu__note { display: block; padding: 6px 10px; font-size: var(--rp-text-sm); color: var(--rp-text-subtle); }
/* A name typed right in a menu (the composer's workspace picker): the app's own field, a check beside it. */
.pj-menu__new { display: flex; align-items: center; gap: 4px; margin: 2px; }
.pj-menu__new input { flex: 1; min-width: 0; }
.pj-menu__newgo {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0;
  border-radius: var(--rp-radius-sm); background: transparent; color: var(--rp-text-subtle); cursor: pointer;
}
.pj-menu__newgo svg { width: 16px; height: 16px; }
.pj-menu__newgo:hover { background: var(--rp-hover-wash); color: var(--rp-text); }
@media (prefers-reduced-motion: reduce) { .pj-menu { animation: none; } }

/* Names in either script: each keeps its own direction (so a long one is cut
   at its real end), but sits on the page's side, as the rest of the row. */
.pj-bidi { text-align: left; }
html[dir="rtl"] .pj-bidi { text-align: right; }

/* ── Session hover card (dsh): dark, beside the sidebar ─────────── */
.pj-hovercard {
  position: fixed; z-index: 90; max-width: 260px; padding: 10px 12px; box-sizing: border-box;
  border-radius: var(--rp-radius-md); background: var(--rp-chrome-surface); color: var(--rp-chrome-text);
  font-size: var(--rp-text-xs); line-height: 18px; pointer-events: none;
  box-shadow: var(--rp-shadow-md);
}
.pj-hovercard[hidden] { display: none; }
.pj-hovercard__title { font-size: var(--rp-text-sm); font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.pj-hovercard__path, .pj-hovercard__meta { color: var(--rp-chrome-text-muted); overflow-wrap: anywhere; }
.pj-hovercard__state { display: flex; align-items: center; gap: 6px; margin-top: 6px; }

/* ── Sidebar (.pj-bar) on phones: a bar across the top ────────────
   Sessions open in a sheet under this bar (.pj-sessions). A blur here would
   trap that sheet (backdrop-filter is a containing block for position:fixed). */
.pj-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px; height: 56px;
  margin: 0 calc(-1 * clamp(16px, 3vw, 36px)) 20px; padding: 0 clamp(16px, 3vw, 36px);
  background: var(--rp-canvas);
  border-bottom: 0.5px solid var(--rp-border);
}
.pj-bar__sessions {
  display: none; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0;
  border-radius: var(--rp-radius-md); background: transparent; color: var(--rp-text-muted); cursor: pointer;
}
.pj-bar__sessions svg { width: 18px; height: 18px; }
.pj-bar__sessions:hover, .pj-bar__sessions[aria-expanded="true"] { background: var(--rp-hover-wash); color: var(--rp-heading); }
.pj-bar__sessions:focus-visible { outline: 2px solid var(--rp-focus); outline-offset: 2px; }
.pj-sessions { display: contents; }
.pj-bar__top { display: contents; }
.pj-bar__brand { display: inline-flex; align-items: center; gap: 8px; color: var(--rp-heading); text-decoration: none; font-weight: 500; }
.pj-bar__brand img { display: block; }
.pj-bar__mark { display: flex; }
/* The white logo in the dark theme, the dark one otherwise. */
.pj-bar__brand .pj-bar__logo--dark { display: none; }
html[data-theme="monochrome"] .pj-bar__brand .pj-bar__logo--light { display: none; }
html[data-theme="monochrome"] .pj-bar__brand .pj-bar__logo--dark { display: block; }
.pj-bar__name { display: none; }
.pj-bar__new, .pj-bar__link {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  border: 0; border-radius: var(--rp-radius-md); background: transparent; color: var(--rp-text-muted);
  font: inherit; font-size: var(--rp-text-sm); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--rp-duration-fast), color var(--rp-duration-fast);
}
.pj-bar__new:hover, .pj-bar__link:hover { background: var(--rp-hover-wash); color: var(--rp-heading); }
.pj-bar__link.is-on { background: var(--rp-wash-on); color: var(--rp-heading); }
.pj-bar__icon { display: grid; place-items: center; }
.pj-bar__icon svg { width: 18px; height: 18px; overflow: visible; }
/* Signal icons: the dot is the row's own ink until the row is active or
   hovered, then blue. On hover one part of the icon moves. */
.pj-bar__link.is-on .pj-sig__dot,
.pj-bar__new:focus-visible .pj-sig__dot, .pj-bar__link:focus-visible .pj-sig__dot { fill: var(--rp-focus); }
.pj-sig__mv { transform-box: view-box; transform-origin: 12px 12px; }
@media (hover: hover) {
  .pj-bar__new:hover .pj-sig__dot, .pj-bar__link:hover .pj-sig__dot { fill: var(--rp-focus); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pj-sig__mv { transition: transform 350ms cubic-bezier(0.3, 1.6, 0.5, 1); }
  :is(.pj-bar__new, .pj-bar__link):hover .pj-sig__mv--new { transform: rotate(90deg); }
  .pj-bar__link:hover .pj-sig__mv--search { transform: translate(2.5px, 1.5px); }
  .pj-bar__link:hover .pj-sig__mv--skills { transform: rotate(18deg); }
  .pj-bar__link:hover .pj-sig__mv--contexts { transform: rotate(-40deg); }
  .pj-bar__link:hover .pj-sig__mv--sources { transform: scale(1.12); }
  .pj-bar__link:hover .pj-sig__mv--agents { transform: translateY(-1.5px); }
  .pj-bar__link:hover .pj-sig__mv--automation { transform: rotate(110deg); }
  .pj-bar__link:hover .pj-sig__mv--more { transform: rotate(90deg); }
}
.pj-bar__label { display: none; }
.pj-bar__kbd { display: none; }
.pj-bar__count { display: none; }
.pj-bar__nav { display: flex; gap: 2px; }
.pj-bar__morewrap { position: relative; }
.pj-bar__moremenu { top: calc(100% + 6px); inset-inline-start: 0; }
.pj-ws { display: none; }
.pj-bar__end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.pj-bar__account { position: relative; }
.pj-bar__who { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--rp-text); font: inherit; cursor: pointer; }
.pj-bar__email { display: none; }
/* The account is identity, not an action: a neutral circle. */
.pj-bar__avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--rp-fill-strong); color: var(--rp-text); font-size: var(--rp-text-xs); font-weight: 500; letter-spacing: 0.02em; }
.pj-bar__who:hover .pj-bar__avatar { background: var(--rp-fill-bold); }
.pj-bar__menu { top: calc(100% + 8px); inset-inline-end: 0; }
@media (max-width: 640px) {
  .pj-bar { gap: 6px; }
  .pj-bar__new, .pj-bar__link { padding: 0 8px; }
}


/* ── Session tree, shared by the open sidebar and the phone sheet ─ */

.pj-ws__head { display: flex; align-items: center; justify-content: space-between; height: 36px; padding-inline: 11px 1px; border-radius: var(--rp-radius-md); }
.pj-ws__label { font-size: var(--rp-text-md); color: var(--rp-text-subtle); }
.pj-ws__tools { display: inline-flex; align-items: center; gap: 2px; }
.pj-ws__sortwrap { position: relative; }
.pj-ws__sortmenu { top: calc(100% + 4px); inset-inline-end: 0; }
.pj-ws__tool {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0;
  border-radius: var(--rp-radius-sm); background: transparent; color: var(--rp-text-subtle); cursor: pointer;
}
.pj-ws__tool svg { width: 15px; height: 15px; }
.pj-ws__tool:hover, .pj-ws__tool.is-on { background: var(--rp-hover-wash); color: var(--rp-text); }
/* The Workspaces ⋯ shows on hover, like each workspace's own ⋯; always on touch. */
.pj-ws__head .pj-ws__tool { opacity: 0; }
.pj-ws__head:hover .pj-ws__tool, .pj-ws__head .pj-ws__tool.is-on, .pj-ws__head .pj-ws__tool:focus-visible { opacity: 1; }
@media (hover: none) { .pj-ws__head .pj-ws__tool { opacity: 1; } }
.pj-ws__list, .pj-ws__sessions { margin: 0; padding: 0; list-style: none; }
/* An open workspace's sessions hang off a quiet guide line under its folder
   icon (centred on the 15px icon: 9px pad + 7.5px), so the tree reads at a glance. */
.pj-ws__list > li:not(.pj-ws__loose) > .pj-ws__sessions { position: relative; }
.pj-ws__list > li:not(.pj-ws__loose) > .pj-ws__sessions::before {
  content: ""; position: absolute; top: 2px; bottom: 2px; inset-inline-start: 16px; width: 1px;
  background: var(--rp-border); pointer-events: none;
}
.pj-ws__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.pj-ws__row { position: relative; display: flex; align-items: center; border-radius: var(--rp-radius-md); }
.pj-ws__row:hover, .pj-ws__row.is-menu { background: var(--rp-hover-wash); }
/* The workspace you are in reads like the session you are in: wash + weight. */
.pj-ws__row:has(.pj-ws__toggle.is-on) { background: var(--rp-wash-on); }
.pj-ws__toggle.is-on { font-weight: 500; }
.pj-ws__toggle {
  display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; height: 32px; padding: 0 8px 0 9px;
  border: 0; background: none; color: var(--rp-text); font: inherit; font-size: var(--rp-text-md); text-align: start; cursor: pointer;
}
.pj-ws__folder { display: grid; place-items: center; flex: none; color: var(--rp-text-muted); }
.pj-ws__folder svg, .pj-ws__shared svg { width: 15px; height: 15px; }
.pj-ws__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-ws__shared { display: grid; place-items: center; flex: none; color: var(--rp-text-subtle); }
.pj-ws__more {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin-inline-end: 3px; padding: 0;
  border: 0; border-radius: var(--rp-radius-sm); background: transparent; color: var(--rp-text-subtle);
  cursor: pointer; opacity: 0;
}
.pj-ws__more svg { width: 15px; height: 15px; }
.pj-ws__row:hover .pj-ws__more, .pj-ws__row.is-menu .pj-ws__more, .pj-ws__more:focus-visible { opacity: 1; }
/* The new workspace's name row: a folder row whose name is a field (Folder+). */
.pj-ws__newrow { gap: 6px; height: 32px; padding: 0 8px 0 9px; box-shadow: inset 0 0 0 0.5px var(--rp-focus); background: var(--rp-surface); }
.pj-ws__newrow:hover { background: var(--rp-surface); }
.pj-ws__newrow .pj-spinner { width: 12px; height: 12px; }
.pj-ws__newinput {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: none; background: none;
  color: var(--rp-text); font: inherit; font-size: var(--rp-text-md);
}
.pj-ws__newrow.is-busy .pj-ws__newinput { color: var(--rp-text-subtle); }
.pj-ws__more:hover { background: var(--rp-hover-wash); color: var(--rp-text); }
.pj-menu.pj-ws__panel { position: fixed; top: 0; left: 0; z-index: 80; }
.pj-ws__session {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; padding-inline-start: 30px; box-sizing: border-box;
  border-radius: var(--rp-radius-md); color: var(--rp-text); font-size: var(--rp-text-md); text-decoration: none;
}
.pj-ws__session:hover { background: var(--rp-hover-wash); }
.pj-ws__session.is-on { background: var(--rp-wash-on); font-weight: 500; }
/* A session at work: a small blinking dot after its title, at the row's end
   beside its marks (like Claude Code; user, 2026-11-20). */
.pj-ws__live {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--rp-info-indicator); animation: pj-ws-live 1.6s ease-in-out infinite;
}
@keyframes pj-ws-live { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.75); } }
@media (prefers-reduced-motion: reduce) { .pj-ws__live { animation: none; } }
.pj-ws__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A session's report, slides and audio as small marks; no date (user, 2026-11-09). */
.pj-ws__files { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 22px; color: var(--rp-text-subtle); }
.pj-ws__file { display: grid; place-items: center; }
.pj-ws__file svg { width: 13px; height: 13px; }
/* A session row's hover action (dsh): ⋯ takes the file marks' slot on
   hover, keyboard focus or an open menu. Every row keeps that slot, marks
   or not, so the title never resizes: a long English title in the fa UI
   is anchored at its left and slid sideways when it did (2026-11-28). */
.pj-ws__srow { position: relative; }
.pj-ws__acts {
  position: absolute; top: 0; inset-inline-end: 4px; display: flex; align-items: center; gap: 2px; height: 32px;
  opacity: 0; pointer-events: none; transition: opacity var(--rp-duration-fast);
}
.pj-ws__srow:hover .pj-ws__acts, .pj-ws__srow:focus-within .pj-ws__acts, .pj-ws__srow.is-menu .pj-ws__acts { opacity: 1; pointer-events: auto; }
.pj-ws__srow:is(:hover, :focus-within, .is-menu) .pj-ws__files { visibility: hidden; }
.pj-ws__srow:is(:hover, :focus-within, .is-menu) .pj-ws__session { background: var(--rp-hover-wash); }
.pj-ws__srow:is(:hover, :focus-within, .is-menu) .pj-ws__tack { visibility: hidden; }
.pj-ws__act {
  display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--rp-radius-sm);
  background: transparent; color: var(--rp-text-muted); cursor: pointer;
}
.pj-ws__act svg { width: 15px; height: 15px; }
.pj-ws__act:hover { background: var(--rp-hover-wash); color: var(--rp-text); }
.pj-ws__act.is-on { color: var(--rp-text); }
.pj-ws__srow.is-archived .pj-ws__title { color: var(--rp-text-subtle); }
/* An archived session keeps its Restore in view, not only on hover. */
.pj-ws__srow.is-archived .pj-ws__session { padding-inline-end: 84px; }
.pj-ws__restore {
  position: absolute; top: 4px; inset-inline-end: 4px; height: 24px; padding: 0 8px; border: 0;
  border-radius: var(--rp-radius-sm); background: transparent; color: var(--rp-text-muted);
  font: inherit; font-size: var(--rp-text-sm); cursor: pointer;
}
.pj-ws__restore:hover, .pj-ws__restore:focus-visible { background: var(--rp-hover-wash); color: var(--rp-text); }
.pj-ws__note { padding: 6px 8px; padding-inline-start: 30px; font-size: var(--rp-text-sm); color: var(--rp-text-subtle); list-style: none; }
/* "View more" / "Show less": quiet text rows under a workspace's sessions,
   and under the workspaces themselves (indented to the names, not the sessions). */
.pj-ws__pager { display: flex; gap: 4px; padding-inline-start: 22px; list-style: none; }
.pj-ws__pager--ws { padding-inline-start: 0; }
/* Sessions in no workspace: their own label under the workspaces, rows flush
   with it (no folder above them to indent from). */
.pj-ws__loose { margin-top: 12px; }
.pj-ws__loosehead { display: flex; align-items: center; height: 36px; padding-inline-start: 11px; }
.pj-ws__loose .pj-ws__session { padding-inline-start: 11px; }
.pj-ws__loose .pj-ws__pager { padding-inline-start: 3px; }
/* Pinned (claude.ai's sidebar): pinned workspaces, then pinned sessions, above
   Workspaces under a label that folds. Scrolls on its own if it grows long. */
.pj-ws__pinwrap:empty { display: none; }
.pj-ws__pinwrap { flex: none; margin-bottom: 12px; }
.pj-ws__pinlist { padding-bottom: 0; }
.pj-ws__fold {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; margin-inline-start: -6px; padding: 0 6px; border: 0;
  border-radius: var(--rp-radius-sm); background: transparent; font: inherit; cursor: pointer;
}
.pj-ws__fold:hover .pj-ws__label { color: var(--rp-text); }
.pj-ws__chev { display: grid; place-items: center; color: var(--rp-text-subtle); transition: transform var(--rp-duration-fast); }
.pj-ws__chev svg { width: 12px; height: 12px; }
.pj-ws__fold[aria-expanded="true"] .pj-ws__chev { transform: rotate(90deg); }
[dir="rtl"] .pj-ws__fold[aria-expanded="false"] .pj-ws__chev { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .pj-ws__chev { transition: none; } }
.pj-ws__pinned .pj-ws__tack { display: none; }
.pj-ws__pinned .pj-ws__head { padding-inline-end: 11px; }
.pj-ws__list > li.pj-ws__pinsess > .pj-ws__sessions::before { content: none; }
.pj-ws__pinsess .pj-ws__session { gap: 6px; padding-inline-start: 9px; }
.pj-ws__chat { color: var(--rp-text-muted); }
.pj-ws__page {
  height: 28px; padding: 0 8px; border: 0; border-radius: var(--rp-radius-md); background: transparent;
  color: var(--rp-text-subtle); font: inherit; font-size: var(--rp-text-sm); cursor: pointer;
}
.pj-ws__page:hover { background: var(--rp-hover-wash); color: var(--rp-text); }

/* Phones: Sessions opens that tree in a sheet under the top bar.
   The nav leaves the bar and sits in the sheet with its labels. */
@media (max-width: 767px) {
  .pj-bar__sessions { display: grid; }
  .pj-bar__nav { display: none; }
  html.pj-sessions-open { overflow: hidden; }
  html.pj-sessions-open .pj-sessions {
    display: flex; flex-direction: column; position: fixed; z-index: 45;
    inset-inline: 0; top: 56px; bottom: 0; padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); box-sizing: border-box;
    background: var(--rp-canvas); overflow: auto; overscroll-behavior: contain;
  }
  html.pj-sessions-open .pj-ws { display: flex; flex-direction: column; flex: none; min-height: auto; margin-top: 8px; }
  html.pj-sessions-open .pj-ws__list { flex: none; min-height: auto; overflow: visible; }
  html.pj-sessions-open .pj-bar__count { display: inline; margin-inline-start: auto; padding-inline-end: 12px; font-size: var(--rp-text-sm); color: var(--rp-text-subtle); }
  html.pj-sessions-open .pj-bar__nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; flex: none; margin-bottom: 8px; }
  html.pj-sessions-open .pj-bar__link { width: 100%; height: 44px; padding: 0; color: var(--rp-text); font-size: var(--rp-text-md); }
  html.pj-sessions-open .pj-bar__link .pj-bar__label { display: block; overflow: hidden; text-overflow: ellipsis; }
  html.pj-sessions-open .pj-bar__icon { flex: none; width: 40px; height: 44px; }
  html.pj-sessions-open .pj-ws__session,
  html.pj-sessions-open .pj-ws__toggle { min-height: 44px; height: auto; }
  html.pj-sessions-open .pj-ws__srow:not(.is-archived) .pj-ws__session { padding-inline-end: 44px; }
  html.pj-sessions-open .pj-ws__acts { display: flex; opacity: 1; pointer-events: auto; height: 44px; }
  html.pj-sessions-open .pj-ws__act { width: 36px; height: 36px; }
  html.pj-sessions-open .pj-ws__srow .pj-ws__files,
  html.pj-sessions-open .pj-ws__srow .pj-ws__tack { visibility: hidden; }
  html.pj-sessions-open .pj-ws__more,
  html.pj-sessions-open .pj-ws__head .pj-ws__tool { opacity: 1; }
  html.pj-sessions-open .pj-ws__more { width: 36px; height: 36px; }
  html.pj-sessions-open .pj-ws__fold { min-height: 44px; }
}

/* ── Sidebar (.pj-bar) from 768px ────────────────────────────────
   dsh's sidebar on the page's start side (right for Farsi), full height, on
   the pale canvas with a 0.5px rule against the work area. Open (the default
   on wide screens): 364px with New session, Sources · Automation tasks ·
   More, the workspace tree and the account row. Closed: the 56px icon rail. */
@media (min-width: 768px) {
  html[data-experience="projects"] { --pj-rail-w: var(--desk-rail); }
  html[data-experience="projects"].pj-rail-open { --pj-rail-w: var(--desk-side); }

  .pj-bar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 4px; width: var(--pj-rail-w); height: auto;
    margin: 0; padding: 10px 8px 8px; box-sizing: border-box; overflow: visible;
    border: 0; border-inline-end: 0.5px solid var(--rp-border);
    background: var(--rp-canvas); backdrop-filter: none;
    transition: width 200ms var(--rp-ease-out);
  }
  .pj-bar__top { position: relative; display: flex; align-items: center; height: 36px; margin-bottom: 4px; }
  html:not(.pj-rail-open) .pj-bar__top { justify-content: center; }

  /* The first tile toggles the sidebar; the name sits beside it when open. */
  .pj-bar__brand { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--rp-text-md); cursor: pointer; border-radius: var(--rp-radius-md); }
  .pj-bar__brand:focus-visible { outline: 2px solid var(--rp-focus); outline-offset: 2px; }
  .pj-bar__mark {
    flex: none; display: grid; place-items: center; width: 40px; height: 36px;
    border-radius: var(--rp-radius-md); background: transparent; color: var(--rp-text-muted);
    transition: background var(--rp-duration-fast), color var(--rp-duration-fast);
  }
  .pj-bar__mark img { display: none !important; }
  .pj-bar__mark::before {
    content: ""; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: var(--desk-icon-panel) center / contain no-repeat;
    mask: var(--desk-icon-panel) center / contain no-repeat;
  }
  .pj-bar__brand:hover .pj-bar__mark { background: var(--rp-hover-wash); color: var(--rp-text); }
  .pj-rail-open .pj-bar__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--rp-text); }

  /* New session: dsh's outline button, 38px, full width when open. */
  .pj-bar__new {
    justify-content: center; gap: 6px; width: 100%; height: 38px; padding: 0; margin-bottom: 8px; box-sizing: border-box;
    border: 0.5px solid var(--rp-border); background: var(--rp-surface); color: var(--rp-text);
    font-size: var(--rp-text-md); font-weight: 500;
  }
  .pj-bar__new:hover { background: var(--rp-fill); color: var(--rp-text); }
  .pj-rail-open .pj-bar__new .pj-bar__label { display: block; }
  .pj-rail-open .pj-bar__new:hover .pj-bar__kbd, .pj-rail-open .pj-bar__new:focus-visible .pj-bar__kbd { display: inline; }
  .pj-bar__kbd { margin-inline-start: 4px; font: inherit; font-size: var(--rp-text-2xs); color: var(--rp-text-muted); }

  .pj-bar__nav { flex-direction: column; align-items: stretch; gap: 0; }
  .pj-bar__link {
    display: flex; align-items: center; gap: 4px; width: 100%; height: 36px; padding: 0;
    color: var(--rp-text); font-size: var(--rp-text-md);
  }
  .pj-bar__link:hover { background: var(--rp-hover-wash); }
  .pj-bar__icon { flex: none; width: 40px; height: 36px; color: var(--rp-text-muted); }
  .pj-bar__link.is-on { background: var(--rp-wash-on); font-weight: 500; }
  .pj-rail-open .pj-bar__link .pj-bar__label { display: block; overflow: hidden; text-overflow: ellipsis; }
  /* The Credits row's balance, quiet at the row's end like New session's shortcut. */
  .pj-rail-open .pj-bar__count { display: inline; margin-inline-start: auto; padding-inline-end: 12px; font-size: var(--rp-text-sm); font-variant-numeric: tabular-nums; unicode-bidi: isolate; color: var(--rp-text-subtle); }
  /* on the tinted current row the quiet grey falls under AA */
  .pj-bar__link.is-on .pj-bar__count { color: var(--rp-text-muted); }
  .pj-bar__moremenu { top: calc(100% + 4px); inset-inline-start: 4px; }
  html:not(.pj-rail-open) .pj-bar__moremenu { top: 0; inset-inline-start: calc(100% + 10px); }

  /* Workspaces: the tree's look is shared with the phone sheet. Shown when the sidebar is open. */
  .pj-ws { display: none; }
  .pj-rail-open .pj-ws { display: flex; flex-direction: column; flex: 1; min-height: 0; margin-top: 12px; }
  /* Nav and the tree sit in .pj-sessions (display: contents), so they
     are not the bar's own children and miss the shrink rule above. */
  .pj-rail-open .pj-bar__nav { flex-shrink: 0; }
  /* Open, the whole column scrolls as one (user, 2026-11-14): New session,
     the nav, Pinned and the tree move together, not an inner
     scroller under a fixed head. The toggle row and the account row stay put. */
  .pj-rail-open .pj-bar { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .pj-rail-open .pj-bar > * { flex-shrink: 0; }
  .pj-rail-open .pj-ws { flex: none; min-height: auto; }
  .pj-rail-open .pj-ws__list { flex: none; min-height: auto; overflow: visible; }
  .pj-rail-open .pj-bar__top { position: sticky; top: -10px; z-index: 2; margin-top: -10px; padding-top: 10px; height: 46px; box-sizing: border-box; background: var(--rp-canvas); }
  .pj-rail-open .pj-bar__end { position: sticky; bottom: -8px; z-index: 2; margin-bottom: -8px; padding-bottom: 8px; background: var(--rp-canvas); }
  @media (hover: none) { .pj-ws__acts { display: none; } }

  /* The account row at the foot, as dsh's "Signed in" row. */
  .pj-bar__end { flex-direction: column; align-items: stretch; margin: auto 0 0; padding-top: 4px; }
  .pj-bar__account { position: relative; }
  .pj-bar__who { display: flex; width: 100%; height: 44px; padding: 0 6px; gap: 10px; border-radius: var(--rp-radius-md); }
  .pj-bar__who:hover, .pj-bar__who[aria-expanded="true"] { background: var(--rp-hover-wash); }
  html:not(.pj-rail-open) .pj-bar__who { justify-content: center; padding: 0; }
  .pj-rail-open .pj-bar__email { display: block; min-width: 0; overflow: hidden; font-size: var(--rp-text-sm); color: var(--rp-text-muted); text-overflow: ellipsis; white-space: nowrap; }
  /* the account menu opens upwards, over the row */
  .pj-bar__menu { top: auto; bottom: calc(100% + 6px); inset-inline-start: 0; inset-inline-end: auto; }
  html:not(.pj-rail-open) .pj-bar__menu { bottom: 0; inset-inline-start: calc(100% + 10px); }

  /* the work area: white, edge to edge beside the sidebar, under the header */
  html[data-brand="desk"][data-experience="projects"] .app-main {
    margin: 0;
    margin-inline-start: var(--pj-rail-w);
    padding-inline: clamp(16px, 3vw, 36px);
    padding-top: calc(var(--desk-top) + 28px);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--rp-surface) !important;
    border: 0;
    border-radius: 0;
    transition: margin-inline-start 200ms var(--rp-ease-out);
  }
  /* things that stick to the top of the page now stick under the header */
  html[data-brand="desk"] .pj .pj-library > .library-toolbar { top: calc(var(--desk-top) + 12px); }
  html[data-brand="desk"] .pj-reader { top: calc(var(--desk-top) + 12px); height: calc(100dvh - var(--desk-top) - 24px); }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  .pj-bar, .pj-bar__mark, .desk-topbar, html[data-brand="desk"][data-experience="projects"] .app-main { transition: none; }
}

/* sidebar panel icon (the toggle), drawn with currentColor */
html[data-brand="desk"] {
  --desk-icon-panel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2.5'/%3E%3Cpath d='M9 4v16'/%3E%3C/svg%3E");
}


/* ── Standalone page (the Kavosh compare page, 2026-11-16) ─────────
   Opened in its own browser tab like a report or a deck, so no sidebar:
   the header and the work area run edge to edge. */
html[data-experience="projects"].pj-standalone { --pj-rail-w: 0px; }
html.pj-standalone .pj-bar { display: none !important; }
