.project-home { min-height:100vh; background:var(--bg); }
.project-home-bar { position:sticky; top:0; z-index:20; height:var(--topbar); display:flex; align-items:center; padding:0 22px; border-bottom:1px solid var(--line); background:var(--topbar-bg); backdrop-filter:blur(18px); }
.project-home-bar .brand { width:auto; }
.project-home-status { margin-left:auto; display:flex; align-items:center; gap:13px; color:var(--muted); font-size:11px; }
.project-home-status > span { display:flex; align-items:center; gap:7px; }
.project-home-status i { width:5px; height:5px; border-radius:50%; background:var(--success); }
.project-home-main { width:var(--site-width); margin:0 auto; padding:84px 0 70px; }
.project-home-intro { max-width:590px; }
.project-home-intro h1 { margin:13px 0 15px; font-family:var(--headline); font-size:34px; line-height:1.08; letter-spacing:-.006em; font-weight:430; }
.project-home-intro p { margin:0; color:var(--text-soft); font-size:14px; line-height:1.65; }
.start-options { display:grid; gap:10px; margin-top:38px; }
.preset-library { display:grid; gap:28px; margin-top:18px; }
.preset-group { display:grid; gap:10px; }
.preset-group-head { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:18px; padding:0 2px; }
.preset-group-head h2 { margin:4px 0 0; font-family:var(--headline); font-size:14px; font-weight:500; letter-spacing:.006em; }
.preset-group-head p { max-width:520px; margin:4px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }
.preset-group-head > span { color:var(--faint); font-family:var(--mono); font-size:10px; }
.preset-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.start-card.start-blank { min-height:0; align-items:center; padding:17px 20px; }
.start-card.start-blank .start-card-copy { gap:4px; }
.start-card.start-blank .start-card-copy small { max-width:none; }
.start-card.start-blank > .icon { margin-top:0; }
.start-card { min-height:138px; display:grid; grid-template-columns:38px 1fr 18px; align-items:start; gap:13px; padding:18px; border:1px solid var(--line); border-radius:var(--radius-md); background:var(--bg-raised); color:var(--text); text-align:left; transition:border-color .16s ease,background .16s ease; }
.start-card:hover { border-color:var(--line-strong); background:var(--surface-hover); }
.start-card > .icon { width:15px; margin-top:8px; color:var(--faint); }
.start-card-icon { width:36px; height:36px; display:grid; place-items:center; border:1px solid var(--line); border-radius:9px; color:var(--muted); }
.start-card-icon .icon { width:16px; }
.start-card-copy { display:grid; align-content:start; gap:6px; }
.start-card-copy strong { font-family:var(--headline); font-size:15px; font-weight:510; letter-spacing:.006em; }
.start-card-copy small { max-width:290px; color:var(--muted); font-size:12px; line-height:1.55; }
.preset-label { width:max-content; margin-bottom:-1px; color:var(--faint); font-family:var(--mono); font-size:9px; letter-spacing:.06em; text-transform:uppercase; }
.local-specs { margin-top:74px; padding-top:26px; border-top:1px solid var(--line); }
.local-specs-head { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:14px; }
.local-specs-head h2 { margin:6px 0 0; font-family:var(--headline); font-size:18px; font-weight:500; letter-spacing:.005em; }
.local-specs-head > span { color:var(--faint); font-size:11px; }
.local-spec-groups { display:grid; gap:22px; }
.local-spec-group { display:grid; gap:8px; }
.local-spec-group-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:0 3px; }
.local-spec-group-name { display:flex; align-items:center; gap:7px; min-width:0; }
.local-spec-group-name .icon { width:13px; height:13px; color:var(--faint); flex:none; }
.local-spec-group-head strong { color:var(--muted); font-size:11px; font-weight:520; letter-spacing:.015em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.local-spec-group-count { min-width:17px; height:17px; padding:0 5px; display:grid; place-items:center; border-radius:99px; background:var(--panel); color:var(--faint); font-family:var(--mono); font-size:9px; }
.local-spec-group { border-radius:12px; transition:box-shadow .3s ease, background .3s ease; }
.local-spec-group.is-focused { box-shadow:0 0 0 1px var(--line-strong), 0 0 0 5px var(--surface-hover); background:var(--surface-hover); }
.home-sort { display:flex; align-items:center; gap:4px; }
.home-sort > span { color:var(--faint); font-size:11px; margin-right:4px; }
.home-sort-btn { height:26px; padding:0 10px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--muted); font-size:11px; cursor:pointer; transition:background .16s ease, color .16s ease, border-color .16s ease; }
.home-sort-btn:hover { color:var(--text-soft); }
.home-sort-btn.active { border-color:var(--line-strong); background:var(--panel); color:var(--text); }
.home-sort-btn:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.input-hint { display:block; margin-top:6px; color:var(--faint); font-size:11px; line-height:1.5; }
.local-spec-list { display:grid; gap:7px; }
.local-spec-card { position:relative; min-height:72px; border:1px solid var(--line); border-radius:9px; background:var(--bg-raised); color:var(--text-soft); transition:border-color .16s ease,background .16s ease; }
.local-spec-card:hover,.local-spec-card:focus-within { border-color:var(--line-strong); background:var(--surface-hover); color:var(--text); }
.local-spec-open { width:100%; min-height:70px; display:grid; grid-template-columns:34px minmax(0,1fr) auto auto 16px; align-items:center; gap:12px; padding:10px 50px 10px 13px; background:transparent; color:inherit; text-align:left; }
.local-spec-open:focus-visible { outline:2px solid var(--focus); outline-offset:2px; border-radius:8px; }
.local-spec-actions { position:absolute; top:9px; right:9px; width:30px; height:30px; display:grid; place-items:center; border-radius:7px; background:transparent; color:var(--faint); opacity:.72; }
.local-spec-actions:hover,.local-spec-actions:focus-visible,.local-spec-actions[aria-expanded="true"] { background:var(--panel); color:var(--text-soft); opacity:1; }
.local-spec-actions:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
.local-spec-actions .icon { width:15px; height:15px; }
.local-spec-icon { width:32px; height:32px; display:grid; place-items:center; border:1px solid var(--line); border-radius:8px; color:var(--muted); }
.local-spec-icon .icon { width:15px; }
.local-spec-copy,.local-spec-stats { min-width:0; }
.local-spec-copy strong,.local-spec-copy small,.local-spec-stats small,.local-spec-stats span { display:block; }
.local-spec-copy strong { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:13px; font-weight:520; letter-spacing:.005em; }
.local-spec-copy small,.local-spec-stats small { color:var(--muted); font-size:11px; }
.local-spec-copy small { margin-top:2px; }
.local-spec-stats { min-width:180px; text-align:right; }
.local-spec-stats span { margin-top:2px; color:var(--text-soft); font-size:11px; }
.local-spec-stats .local-spec-integrity.critical { color:var(--danger); }
.local-spec-current { padding:2px 7px; border:1px solid var(--line); border-radius:99px; color:var(--muted); font-size:9px; }
.local-spec-chevron { display:flex; color:var(--faint); }
.local-spec-chevron .icon { width:14px; }
.local-empty { min-height:92px; display:grid; place-items:center; padding:22px; border:1px dashed var(--line); border-radius:9px; color:var(--muted); font-size:12px; text-align:center; }
.project-home-note { margin:26px 0 0; color:var(--faint); font-size:10px; text-align:center; }
@media (max-width:900px) {
  .preset-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:680px) {
  .project-home-main { padding-top:54px; }
  .preset-grid { grid-template-columns:1fr; }
  .preset-group-head { gap:8px; }
  .local-spec-open { grid-template-columns:34px minmax(0,1fr) 16px; }
  .local-spec-stats,.local-spec-current { display:none; }
  .project-home-status > span { display:none; }
}

.start-card:active,.local-spec-card:active { background:var(--panel); }

/* Project navigation stays in the workspace header on every agent. */
.workspace-project-nav { display:flex; align-items:center; gap:10px; min-width:0; }
.workspace-project-nav label { font-size:11px; color:var(--muted); }
.workspace-project-nav select { width:clamp(140px,18vw,280px); min-height:34px; border:1px solid var(--line-strong); border-radius:7px; background:var(--input); color:var(--text); padding:6px 28px 6px 10px; }
.workspace-project-nav a { font-size:12px; color:var(--text-soft); white-space:nowrap; }
.project-home-bar,.flow-bar { flex-wrap:wrap; height:auto; min-height:58px; }
.flow-bar .workspace-project-nav { flex-basis:100%; padding:8px 0; border-top:1px solid var(--line); }
.project-home-bar { position:sticky; top:0; z-index:20; background:var(--bg); gap:12px; }
.project-directory { margin-bottom:48px; }
.folder-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; }
.folder-tile { text-align:left; display:flex; flex-direction:column; gap:12px; padding:24px; border:1px solid var(--line-strong); border-radius:12px; background:var(--bg-raised); color:var(--text); cursor:pointer; }
.folder-tile:hover { background:var(--panel-hover); }
.folder-tile>span { font-size:24px; color:var(--muted); }
.folder-tile small { color:var(--muted); }
.folder-overview { display:grid; gap:36px; }
.folder-overview h1 { font-size:clamp(30px,4vw,44px); line-height:1.15; margin:10px 0; overflow-wrap:anywhere; }
.folder-overview h2 { font-size:20px; margin-bottom:18px; }
.folder-overview p { color:var(--muted); line-height:1.6; }
.folder-intro { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.folder-actions { display:flex; flex-wrap:wrap; gap:8px; }
.folder-empty { border:1px dashed var(--line-strong); border-radius:12px; padding:30px; margin:16px 0; }
.agent-map { margin:20px 0 26px; padding:28px; border:1px solid var(--line); border-radius:12px; background:var(--bg-raised); text-align:center; }
.agent-map-root { display:inline-block; padding:9px 18px; border:1px solid var(--line-strong); border-radius:8px; font-size:13px; }
.agent-map>div { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; padding-top:28px; }
.agent-map button { position:relative; display:grid; gap:8px; width:170px; padding:16px; border:1px solid var(--line-strong); border-radius:10px; background:var(--panel); color:var(--text); cursor:pointer; }
.agent-map button:before { content:''; position:absolute; height:28px; width:1px; background:var(--line-strong); top:-29px; left:50%; }
.agent-map button span { font-size:22px; color:var(--success); }
.agent-map small { font-size:10px; color:var(--muted); }
.project-guide { padding:18px 0; border-bottom:1px solid var(--line); display:grid; gap:10px; }
.project-guide a { color:var(--text); font-size:14px; line-height:1.5; }
.project-guide p { margin:0; font-size:12px; line-height:1.6; }
.project-guide small { color:var(--muted); font-size:11px; }
.project-guide .btn { justify-self:start; }
.sidebar-project-guides { padding:20px; border-bottom:1px solid var(--line-strong); }
.sidebar-project-guides h3 { font-size:13px; }
.sidebar-project-guides>p,.sidebar-project-guides>a { font-size:12px; color:var(--muted); line-height:1.6; }
.sidebar-project-guides>a { display:block; margin-top:16px; }
@media(max-width:760px) {
  .workspace-project-nav { flex-wrap:wrap; width:100%; }
  .workspace-project-nav select { flex:1; }
  .workspace-project-nav>a { display:none; }
  .folder-intro { align-items:flex-start; flex-direction:column; }
  .folder-grid { grid-template-columns:1fr; }
}

.flow-bar { position:sticky; top:0; z-index:30; background:var(--bg); }
.shell:has(.workspace-project-nav) { --topbar:106px; }
.topbar:has(.workspace-project-nav) { flex-wrap:wrap; gap:8px 16px; padding-block:8px; }
.topbar .workspace-project-nav { order:10; flex-basis:100%; }
.folder-overview>button { justify-self:start; }
@media(max-width:760px) { .shell:has(.workspace-project-nav) { --topbar:128px; } }

.project-home-bar { padding-inline:max(var(--site-gutter), calc((100% - var(--site-max)) / 2)); }
.workspace-project-nav select { width:clamp(180px,24vw,360px); }

.local-specs-head { flex-wrap:wrap; gap:16px; }
