#projects-panel[hidden], #projects-panel [hidden] { display: none !important; }
.main.projects-open > #content-scroll, .main.projects-open > .composer-area,
.main.projects-open > .topbar { display: none; }
#project-path { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
#project-path .pj-back { margin-bottom: 0; }
#projects-panel { overflow: auto; min-height: 0; flex: 1; scrollbar-width: thin; }
.projects-page { width: min(100%, 930px); margin-inline: auto; padding: 38px clamp(18px, 5vw, 64px) 70px; color: var(--ink); }
.projects-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 0 25px; }
.projects-heading h1 { margin: 0; line-height: 1.12; font-size: clamp(29px, 4vw, 46px); letter-spacing: -.045em; overflow-wrap: anywhere; }
#projects-panel h2 { margin: 16px 0 10px; font-size: 19px; letter-spacing: -.02em; }
#projects-panel :is(input:not([type=checkbox]), select, textarea) {
  font: inherit; font-size: 16px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 10px; width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px;
}
#projects-panel textarea { resize: vertical; }
#projects-panel :is(button,input,textarea,select):focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
#projects-panel button { font: inherit; }
#projects-panel .pj-primary, #projects-panel .pj-quiet, #projects-panel .pj-back, #projects-panel .pj-danger {
  min-height: 44px; border-radius: 10px; font-size: 14px; padding: 9px 15px; font-weight: 650;
}
#projects-panel .pj-primary { border: 1px solid var(--accent-hover); background: var(--accent-hover); color: #fffaf5; }
#projects-panel .pj-primary:hover { background: #924226; }
#projects-panel .pj-quiet { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
#projects-panel .pj-danger { color: #8d3825; background: transparent; padding-inline: 8px; }
#projects-panel .pj-back { background: transparent; color: var(--accent-hover); padding-inline: 0; margin-bottom: 8px; }
#projects-panel .pj-back span { margin-right: 5px; }
#projects-panel .pj-quiet:hover, #projects-panel .pj-danger:hover { background: var(--soft); }
#projects-panel button:disabled { opacity: .6; }
.pj-search-wrap { display: flex; position: relative; align-items: center; }
.pj-search-wrap .icon { width: 18px; height: 18px; position: absolute; left: 13px; color: #746d60; pointer-events: none; }
#projects-panel #projects-search { padding-left: 40px; }
.pj-filters, .pj-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pj-filters { margin: 10px 0 18px; }
.pj-filters button, .pj-tabs button { min-height: 44px; border-radius: 9px; padding: 7px 12px; background: transparent; color: #514d43; font-size: 14px; }
.pj-filters button[aria-pressed=true], .pj-tabs button[aria-current=page] { background: var(--soft); color: #803d24; font-weight: 700 !important; }
.pj-filters button:hover, .pj-tabs button:hover { background: #efe8dc; }
.pj-list { margin: 0; padding: 0; list-style: none; }
#projects-list li + li { margin-top: 8px; }
#projects-panel .pj-project { color: var(--ink); display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 15px; align-items: center; text-align: left; width: 100%; padding: 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; }
#projects-panel .pj-project:hover { border-color: #b29279; background: #fffaf1; }
.pj-folder { position: relative; display: inline-flex; width: 24px; height: 17px; border: 1.7px solid currentColor; border-radius: 3px; margin-top: 3px; flex: none; }
.pj-folder::before { content: ''; position: absolute; left: -1.7px; top: -5px; width: 11px; height: 4px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 3px 4px 0 0; }
.pj-project .pj-folder-box { display: grid; place-items: center; background: #f3e7d8; color: #9a5432; border-radius: 11px; width: 44px; height: 44px; }
.pj-project-text, .pj-row-text { min-width: 0; display: grid; gap: 3px; overflow-wrap: anywhere; }
.pj-project-text strong, .pj-row-text strong { font-size: 16px; }
.pj-project-text small, .pj-row-text small, .pj-hint, .pj-empty, .pj-meta, .pj-role { color: #676153; font-size: 14px; line-height: 1.45; }
.pj-role { white-space: nowrap; border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; }
.pj-empty { padding-block: 15px; margin: 0; }
.pj-incoming { padding: 4px 16px 12px; margin-block: 5px 18px; border-left: 3px solid var(--accent); background: #f2e7d8; border-radius: 0 12px 12px 0; }
.pj-tabs { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 18px; }
.pj-detail-heading { margin-bottom: 15px; }
.pj-section { min-width: 0; }
.pj-form { display: grid; gap: 7px; }
.pj-form > label, .pj-form .pj-task-fields > label { font-size: 14px; font-weight: 650; }
.pj-create, .pj-task-form, .pj-invite-form, .pj-post-form { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin-block: 0 18px; }
.pj-actions, .pj-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pj-actions { margin-top: 3px; }
.pj-inline > input { flex: 1 1 160px; }
.pj-hint { margin: 0 0 3px; }
.pj-task-fields { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.pj-task-fields > label { display: grid; gap: 4px; }
.pj-team-row, .pj-task-row, .pj-invite-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pj-team-row > .pj-row-text, .pj-invite-row > .pj-row-text { flex: 1 1 130px; }
.pj-team-row, .pj-invite-row { flex-wrap: wrap; }
.pj-task-row label { display: flex; align-items: center; gap: 12px; min-height: 44px; flex: 1; cursor: pointer; }
.pj-task-row input { width: 19px; height: 19px; accent-color: var(--accent-hover); flex: none; }
.pj-task-row input:checked + .pj-row-text strong { color: #716b60; text-decoration: line-through; }
.pj-ask { width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; }
.pj-posts { max-height: min(48dvh, 500px); overflow-y: auto; scrollbar-width: thin; }
.pj-posts:not(:empty) { margin-bottom: 16px; }
.pj-posts li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.pj-posts li:first-child { padding-top: 2px; }
.pj-posts p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 5px 0 0; line-height: 1.5; }
.pj-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; overflow-wrap: anywhere; }
.pj-post-head time { color: #676153; font-size: 13px; }
.pj-feedback { margin-block: 8px; }
.pj-feedback p { color: #66594d; overflow-wrap: anywhere; }
.pj-feedback p:empty { margin: 0; }
@media (max-width: 600px) {
  .projects-page { padding: 20px 14px 42px; }
  .projects-heading { align-items: center; margin-bottom: 17px; gap: 7px; }
  .projects-heading .mobile-menu { flex-shrink: 0; }
  #projects-title { margin-right: auto; }
  #projects-panel #projects-new { padding-inline: 9px; }
  #projects-panel #project-path { margin-inline-start: -4px; }
  .pj-detail-heading { flex-wrap: wrap; }
  .pj-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; }
  .pj-tabs button { text-align: left; padding-inline: 5px; }
  .pj-filters { gap: 2px; }
  .pj-filters button { padding-inline: 9px; }
  .pj-create, .pj-task-form, .pj-post-form, .pj-invite-form { padding: 13px 12px; }
  #projects-panel .pj-project { gap: 10px; padding: 12px; }
  .pj-posts { max-height: 36dvh; }
}
@media (max-width: 365px) { .pj-task-fields { grid-template-columns: 1fr; } }

@media (min-height: 540px) {
  #project-path, #project-tabs { position: sticky; z-index: 2; background: var(--paper); }
  #project-path { top: 0; min-height: 48px; }
  #project-tabs { top: 48px; }
  #projects-panel { scroll-padding-block-start: 108px; }
}
@media (min-height: 540px) and (max-width: 600px) {
  #projects-panel { scroll-padding-block-start: 154px; }
}

#project-code-profile { margin: 0 0 15px; }
#project-code-profile summary { display: list-item; width: fit-content; min-height: 44px; padding-block: 10px; cursor: pointer; color: var(--accent-hover); font-size: 14px; font-weight: 650; }
#project-code-profile .pj-inline { margin-top: 6px; }
#projects-panel #project-own-code { font-family: ui-monospace, monospace; font-size: 14px; }
#projects-panel .pj-ai-action { margin-inline-start: auto; min-height: 44px; padding: 5px 8px; border-radius: 8px; background: transparent; color: var(--accent-hover); font-weight: 650; font-size: 13px; white-space: nowrap; }
#projects-panel .pj-ai-action:hover { background: var(--soft); }
#project-ai-hint { margin: 3px 0 10px; }
@media (max-width: 600px) {
  #project-code-profile .pj-inline { display: grid; grid-template-columns: minmax(0,1fr); justify-items: start; }
  #projects-panel #project-own-code { font-size: clamp(12px, 3.8vw, 15px); }
}
