/* Pactum Workspace v0.9.0 — «Проекты» (pactum-projects.js). Цвета — переменные темы Pactum/LibreChat
 * (--surface-*, --text-*, --border-*, --pt-gold), поэтому светлая и тёмная темы работают сами. Телефон — окно на весь экран. */
.pt-ic { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.pt-ic.pt-rot { transform: rotate(90deg); }
.pt-ic.pt-folder { color: var(--pt-gold-d, #c8960a); }
html.dark .pt-ic.pt-folder { color: var(--pt-gold, #f5b70a); }
.pt-hidden { display: none !important; }

/* ───────── левая панель ───────── */
#pt-projects { flex: 0 0 auto; margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light, rgba(128,128,128,.2));
  font-size: 13.5px; color: var(--text-primary); max-height: 42vh; overflow-y: auto; }
.pt-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px 0; }
.pt-nav-title { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 6px;
  color: var(--text-secondary-alt, #6b7080); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.pt-nav-title .pt-ic { width: 12px; height: 12px; }
.pt-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0;
  border-radius: 4px; background: transparent; color: var(--text-secondary, inherit); cursor: pointer; flex: 0 0 auto; }
.pt-icon-btn:hover, .pt-icon-btn:focus-visible { background: var(--surface-hover); color: var(--text-primary); }
.pt-list, .pt-sub, .pt-files, .pt-convs { list-style: none; margin: 0; padding: 0; }
.pt-row { display: flex; align-items: center; border-radius: 3px; }
.pt-row:hover { background: var(--surface-hover); }
.pt-row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: none;
  border: 0; color: inherit; text-align: left; cursor: pointer; font-size: 13.5px; }
.pt-row-gear { opacity: .55; }
.pt-row:hover .pt-row-gear, .pt-row-gear:focus-visible { opacity: 1; }
.pt-proj.pt-active > .pt-row { box-shadow: inset 2px 0 0 var(--pt-gold, #f5b70a); background: var(--surface-active-alt); }
.pt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-count { font-size: 11px; color: var(--text-secondary-alt, #6b7080); padding: 0 2px; }
.pt-sub { margin: 2px 0 6px 18px; border-left: 1px solid var(--border-light, rgba(128,128,128,.25)); padding-left: 6px; }
.pt-sub-item, .pt-sub-new { width: 100%; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 0;
  border-radius: 3px; background: none; color: inherit; text-align: left; cursor: pointer; font-size: 13px; min-width: 0; }
.pt-sub-item:hover, .pt-sub-new:hover { background: var(--surface-hover); }
.pt-sub-item.pt-current { background: var(--surface-active-alt); box-shadow: inset 2px 0 0 var(--pt-gold, #f5b70a); }
.pt-sub-new { color: var(--pt-accent-light, #876100); font-weight: 500; }
html.dark .pt-sub-new { color: var(--pt-gold, #f5b70a); }
.pt-muted { color: var(--text-secondary-alt, #6b7080); }
.pt-empty { padding: 4px 8px 6px; }
.pt-link { background: none; border: 0; padding: 4px 0; color: var(--pt-accent-light, #876100); cursor: pointer; font-size: 13.5px; }
html.dark .pt-link { color: var(--pt-gold, #f5b70a); }
.pt-hint { font-size: 12px; line-height: 1.45; color: var(--text-secondary-alt, #6b7080); margin: 2px 0 6px; }

/* ───────── плашка над полем ввода ───────── */
#pt-chip { display: flex; justify-content: center; width: 100%; margin: 0 auto 6px; padding: 0 8px; box-sizing: border-box; }
.pt-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border-radius: 999px;
  border: 1px dashed var(--border-medium, rgba(128,128,128,.4)); background: transparent; color: var(--text-secondary-alt, #6b7080);
  font-size: 12.5px; cursor: pointer; line-height: 1.2; }
.pt-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-chip:hover { color: var(--text-primary); border-style: solid; }
.pt-chip.pt-chip-on { border: 1px solid rgba(200, 150, 10, .55); background: rgba(245, 183, 10, .10); color: var(--text-primary); }
.pt-chip .pt-ic.pt-rot { transform: rotate(-90deg); width: 12px; height: 12px; }
.pt-chip-x { display: inline-flex; border: 0; background: none; color: inherit; padding: 0 0 0 2px; cursor: pointer; opacity: .7; }
.pt-chip-x:hover { opacity: 1; }
.pt-menu { position: fixed; z-index: 1000; width: 280px; max-height: 50vh; overflow-y: auto; padding: 6px;
  border: 1px solid var(--border-light, rgba(128,128,128,.25)); border-radius: 6px; background: var(--surface-dialog, #fff);
  box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.pt-menu-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 4px;
  background: none; color: var(--text-primary); text-align: left; cursor: pointer; font-size: 13.5px; }
.pt-menu-item:hover, .pt-menu-item:focus-visible { background: var(--surface-hover); }
.pt-menu-item.pt-current { background: var(--surface-active-alt); }

/* ───────── окно проекта ───────── */
.pt-backdrop { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 7, 12, .55); backdrop-filter: blur(2px); padding: 16px; }
.pt-modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--surface-dialog, #fff); color: var(--text-primary); border: 1px solid var(--border-light, rgba(128,128,128,.25));
  border-top: 2px solid var(--pt-gold, #f5b70a); border-radius: 6px; box-shadow: 0 24px 64px rgba(0,0,0,.35); font-size: 14px; }
.pt-modal.pt-wide { max-width: 720px; }
.pt-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px 20px;
  border-bottom: 1px solid var(--border-light, rgba(128,128,128,.2)); }
.pt-modal-head h2 { margin: 0; font-family: var(--pt-serif, Georgia, serif); font-size: 24px; font-weight: 500; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-modal-body { padding: 14px 20px 18px; overflow-y: auto; }
.pt-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 20px 16px; }
.pt-section { padding: 12px 0; border-bottom: 1px solid var(--border-light, rgba(128,128,128,.15)); }
.pt-section:last-child { border-bottom: 0; }
.pt-label { display: block; margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-secondary-alt, #6b7080); }
.pt-input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--border-medium, rgba(128,128,128,.35));
  border-radius: 4px; background: var(--surface-primary, #fff); color: var(--text-primary); font: inherit; font-size: 14px; }
.pt-input:focus { outline: 2px solid rgba(245, 183, 10, .55); outline-offset: 0; border-color: transparent; }
.pt-ta { resize: vertical; min-height: 120px; line-height: 1.5; }
.pt-title-input { font-size: 16px; font-weight: 500; }
.pt-row-end { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pt-inline { display: flex; gap: 8px; align-items: center; }
.pt-inline .pt-input { flex: 1; min-width: 0; }
.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 4px;
  border: 1px solid var(--border-medium, rgba(128,128,128,.35)); background: transparent; color: var(--text-primary);
  font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.pt-btn:hover { background: var(--surface-hover); }
.pt-btn.pt-primary { background: var(--pt-gold, #f5b70a); border-color: var(--pt-gold, #f5b70a); color: #0b0e13; font-weight: 600; }
.pt-btn.pt-primary:hover { background: var(--pt-gold-d, #c8960a); }
.pt-btn.pt-danger { color: #c0392b; border-color: rgba(192, 57, 43, .45); }
html.dark .pt-btn.pt-danger { color: #ff8a7a; border-color: rgba(255, 138, 122, .4); }
.pt-btn.pt-danger:hover { background: rgba(192, 57, 43, .1); }
.pt-newchat { margin-top: 10px; }
.pt-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border: 1px dashed var(--border-medium, rgba(128,128,128,.45));
  border-radius: 6px; text-align: center; cursor: pointer; color: var(--text-secondary); }
.pt-drop .pt-ic { width: 22px; height: 22px; color: var(--pt-gold-d, #c8960a); }
.pt-drop:hover, .pt-drop.pt-over, .pt-drop:focus-visible { border-color: var(--pt-gold, #f5b70a); background: rgba(245, 183, 10, .06); }
.pt-files { margin-top: 10px; }
.pt-file, .pt-conv { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border-light, rgba(128,128,128,.12)); }
.pt-file-main { flex: 1; min-width: 0; }
.pt-file-main .pt-hint { margin: 0; }
.pt-conv .pt-sub-item { flex: 1; }
.pt-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pt-badge.pt-ok { background: rgba(6, 138, 153, .14); color: #035e5e; }
html.dark .pt-badge.pt-ok { color: #5fd0dc; }
.pt-badge.pt-wait { background: rgba(245, 183, 10, .16); color: #876100; }
html.dark .pt-badge.pt-wait { color: #f5b70a; }
.pt-badge.pt-err { background: rgba(192, 57, 43, .12); color: #a93226; }
html.dark .pt-badge.pt-err { color: #ff8a7a; }
.pt-warn { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid #c0392b; background: rgba(192, 57, 43, .08); font-size: 12.5px; line-height: 1.45; }
.pt-danger-zone { display: flex; justify-content: flex-end; }
.pt-toast { position: fixed; z-index: 1001; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(560px, calc(100vw - 32px));
  padding: 10px 14px; border-radius: 6px; background: var(--pt-ink, #1c2028); color: #f3f1ea; font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); border-left: 3px solid var(--pt-gold, #f5b70a); white-space: pre-line; transition: opacity .35s; }
.pt-toast.pt-bad { border-left-color: #e74c3c; }
.pt-toast.pt-out { opacity: 0; }

@media (max-width: 767px) {
  .pt-backdrop { padding: 0; align-items: stretch; }
  .pt-modal, .pt-modal.pt-wide { max-width: none; max-height: none; height: 100%; border-radius: 0; border-left: 0; border-right: 0; }
  .pt-modal-head h2 { font-size: 21px; }
  .pt-modal-body { padding: 12px 16px 24px; }
  .pt-inline { flex-wrap: wrap; }
  .pt-inline .pt-input { flex-basis: 100%; }
  #pt-projects { max-height: 38vh; }
  .pt-row-gear { opacity: 1; }
  #pt-chip { padding: 0 10px; margin-bottom: 4px; }
  .pt-btn, .pt-row-main, .pt-sub-item, .pt-sub-new, .pt-menu-item { min-height: 40px; }
}
