/* Project home adapted from PR #24; native controls and live project data. */
.home{position:relative;isolation:isolate;min-height:100dvh;padding-bottom:4.5rem}
.home .app-header{background:var(--surface);border-bottom:1px solid var(--line-soft);display:flex;align-items:center;justify-content:space-between;height:3.5rem;padding:0 1.5rem;gap:0.75rem}
.home .brand{font-size:1.25rem}
.home .brand .brandmark{width:2rem;height:2rem;border-radius:var(--radius-lg)}
.home-header-meta{display:flex;align-items:center;gap:0.75rem}
.home-header-meta .pill{height:2rem;font-size:0.8125rem;padding:0 0.75rem;border-radius:var(--radius-sm)}
.home .app-header .icon{width:2rem;height:2rem;padding:0.5rem;border-radius:var(--radius-sm)}
.home .app-header .icon svg{width:1rem;height:1rem}
.home .app-header .avatar{width:1.5rem;height:1.5rem;font-size:0.6875rem}
.home-content{max-width:min(88.75rem,88vw);margin:0 auto;padding:0 1rem}
.toolbar{--toolbar-control-height:2.25rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:1.75rem 0 2rem}
.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:0.75rem;min-width:0;flex-wrap:wrap}
.toolbar-left{margin-left:0.5625rem}
.home .search-field{display:flex;align-items:center;gap:0.5625rem;width:20rem;min-height:var(--toolbar-control-height);border:1px solid var(--control-line);border-radius:var(--radius-lg);background:var(--surface);padding:0 1rem;box-shadow:none;transition:border-color 160ms,background 160ms,box-shadow 160ms}
.home .search-field svg{width:1.1875rem;color:var(--faint)}
.home .search-field input{flex:1;min-width:0;border:0;background:none;padding:0;font-size:0.875rem;color:var(--ink)}
.home .search-field input::placeholder{color:var(--faint)}
.home .search-field input:focus-visible{outline:none}
.home .search-field:hover{background:var(--hover)}
.home .search-field:focus-within{border-color:var(--accent)}
.view-toggle{--thumb:1.75rem;--thumb-gap:2px;--thumb-pad:0.1875rem;position:relative;height:var(--toolbar-control-height);display:flex;gap:var(--thumb-gap);padding:var(--thumb-pad);border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--surface);box-shadow:none}
.view-thumb{position:absolute;top:var(--thumb-pad);left:var(--thumb-pad);width:var(--thumb);height:var(--thumb);border-radius:var(--radius-sm);background:var(--accent-soft);pointer-events:none;transition:transform 280ms var(--ease)}
.view-toggle[data-view=list] .view-thumb{transform:translateX(calc(var(--thumb) + var(--thumb-gap)))}
.view-toggle button{position:relative;z-index:1;width:var(--thumb);height:var(--thumb);padding:0.3125rem;border:0;border-radius:var(--radius-sm);background:transparent;color:var(--muted);transition:color 220ms var(--ease),background 220ms var(--ease)}
.view-toggle button svg{width:1.1875rem;height:1.1875rem;transition:transform 280ms var(--ease)}
.view-toggle button:hover:not(.active){background:var(--hover);color:var(--ink)}
.view-toggle button.active{background:transparent;color:var(--accent)}
.view-toggle button.active svg{transform:none}
@keyframes viewswap{from{opacity:0;transform:none}to{opacity:1;transform:none}}
.projects.view-swap{animation:viewswap 260ms var(--ease)}
.home .toolbar-right>.primary{padding:0 1.375rem;min-height:var(--toolbar-control-height)}
.home .toolbar-right>.primary svg{width:1.3125rem;height:1.3125rem}
.collection-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:0 2px 1.25rem;padding-left:0.5625rem}
.collection-count{color:var(--faint);font-size:0.8125rem;font-weight:400;font-variant-numeric:tabular-nums;margin-left:0.625rem}
.projects{display:grid;grid-auto-rows:minmax(12.5rem,auto);grid-template-columns:repeat(auto-fill,minmax(17.75rem,1fr));gap:1.25rem}
.nb-new{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem;border:1px dashed var(--line);border-radius:var(--radius-lg);background:var(--surface);color:var(--accent);font-size:0.875rem;box-shadow:none;transition:transform 200ms var(--ease),background 160ms var(--ease),color 160ms,border-color 160ms,box-shadow 200ms var(--ease)}
.nb-new:hover{transform:none;background:var(--hover);border-color:var(--accent-hover);box-shadow:none}
.nb-new:active{transform:none;box-shadow:none}
.plus-circle{display:grid;place-items:center;width:2.75rem;height:2.75rem;border-radius:50%;background:var(--surface-2);box-shadow:none;transition:background 160ms}
.plus-circle svg{width:1.6875rem;height:1.6875rem}
.nb-new:hover .plus-circle{background:var(--surface-3)}
.nb-card{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:1.25rem;border:1px solid var(--line-soft);border-radius:var(--radius-lg);background:var(--surface);padding:1.25rem;text-align:left;box-shadow:none;transition:transform 200ms var(--ease),background 160ms,box-shadow 200ms var(--ease)}
.nb-card:hover{transform:none;background:var(--hover);box-shadow:none}
.nb-card:active{transform:none;box-shadow:none}
.nb-card-top{display:flex;align-items:center;justify-content:space-between;width:100%}
.nb-thumb{display:grid;place-items:center;width:2.5rem;height:2.5rem;border-radius:var(--radius-lg);box-shadow:none}
.nb-thumb svg{width:1.5625rem;height:1.5625rem}
.nb-menu{color:var(--faint)}.nb-menu svg{width:1.3125rem;height:1.3125rem}.projects.list-view .nb-menu{display:none}
.nb-card-body{display:flex;flex-direction:column;gap:0.5rem;margin-top:auto}
.nb-state{color:var(--faint);font-size:0.875rem}
.nb-card h2{font-size:1rem;font-weight:500;line-height:1.55;overflow-wrap:anywhere}
.nb-card small{font-size:0.875rem;font-variant-numeric:tabular-nums}
.no-project{grid-column:1/-1;margin:0;padding:2.75rem;border:1px dashed var(--line);border-radius:var(--radius-lg);background:transparent;color:var(--muted);font-size:0.875rem;line-height:2;text-align:center}
.projects.list-view{display:flex;flex-direction:column;gap:0;grid-auto-rows:auto;border-top:1px solid var(--line-soft)}
.projects.list-view .nb-new{flex-direction:row;justify-content:flex-start;gap:1.125rem;min-height:5.5rem;border:0;border-radius:0;border-bottom:1px solid var(--line-soft)}
.projects.list-view .nb-new .plus-circle{width:2.875rem;height:2.875rem}
.projects.list-view .nb-new .plus-circle svg{width:1.1875rem;height:1.1875rem}
.projects.list-view .nb-card{flex-direction:row;align-items:center;gap:1.25rem;min-height:5.5rem;padding:1.25rem 0.625rem;border:0;border-bottom:1px solid var(--line-soft);border-radius:0;background:transparent;box-shadow:none}
.projects.list-view .nb-card:hover{transform:none;background:var(--hover);box-shadow:none}
.projects.list-view .nb-card-top{width:auto}
.projects.list-view .nb-thumb{width:2.375rem;height:2.375rem;border-radius:var(--radius-lg)}
.projects.list-view .nb-thumb svg{width:1.1875rem;height:1.1875rem}
.projects.list-view .nb-card-body{margin:0;flex:1;min-width:0}
.projects.list-view .nb-card h2{font-size:1.15625rem}
.projects.list-view .nb-state{display:none}
.projects.list-view .no-project{grid-column:auto}
@container app (max-width:53.75rem){
 .home-content{padding:0 1.375rem}
 .toolbar{margin-bottom:1.875rem}
 .home .search-field{flex:1;width:auto;min-width:10rem}
 .toolbar-right{width:100%;justify-content:space-between}
 .projects{grid-template-columns:repeat(auto-fill,minmax(14.375rem,1fr));gap:1rem}
}
@container app (max-width:35.0rem){
 .projects{grid-template-columns:1fr}
 .projects .nb-card,.projects .nb-new{min-height:11.25rem}
}
@media(prefers-reduced-motion:reduce){.home *,.home *::before,.home *::after{animation:none!important;transition:none!important}.nb-card:hover{transform:none}}
/* Sort control: a real select keeps the state, an app-styled menu replaces the native popup. */
.sort-field{position:relative;display:flex;align-items:center}
.project-sort{position:absolute;left:0;top:0;width:1px;height:1px;padding:0;border:0;opacity:0;overflow:hidden;font-size:0.875rem}
.sort-menu{position:relative}
.sort-menu>summary{display:flex;align-items:center;gap:0.4375rem;min-height:var(--toolbar-control-height);padding:0 1rem 0 1.25rem;border:1px solid transparent;border-radius:var(--radius-lg);background:var(--surface);color:var(--accent);font-size:0.875rem;cursor:pointer;list-style:none;box-shadow:none;transition:background 160ms var(--ease),box-shadow 160ms var(--ease)}
.sort-menu>summary::-webkit-details-marker{display:none}
.sort-menu>summary:hover{background:var(--hover)}
.sort-menu[open]>summary{background:var(--surface-2)}
.sort-display svg{width:0.9375rem;height:0.9375rem;transform:rotate(90deg);transition:transform 180ms var(--ease)}
.sort-menu[open] .sort-display svg{transform:rotate(-90deg)}
.sort-options{position:absolute;z-index:20;right:0;top:calc(100% + 0.5rem);min-width:10.5rem;display:flex;flex-direction:column;gap:2px;padding:0.375rem;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow-2);animation:slideup .18s var(--ease)}
.sort-options>button{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;width:100%;padding:0.625rem 0.8125rem;border:0;border-radius:var(--radius);background:transparent;box-shadow:none;font-size:0.875rem;color:var(--ink);text-align:left}
.sort-options>button:hover:not(:disabled){background:var(--hover);transform:none;box-shadow:none}
.sort-options>button[aria-selected=true]{background:var(--accent-soft);color:var(--accent);font-weight:550}
.sort-options>button svg{width:0.9375rem;height:0.9375rem;color:var(--accent)}
.view-toggle button{box-shadow:none}.view-toggle button:hover:not(:disabled){transform:none;box-shadow:none}
.nb-card:hover:not(:disabled){transform:none;box-shadow:none}
.projects.list-view .nb-card:hover:not(:disabled){transform:none;box-shadow:none}
.collection-head h1{font-size:1.25rem;font-weight:500}.projects.list-view .nb-new{padding:1rem 0.625rem;box-shadow:none}
.toolbar-left{max-width:100%}.home-content{width:100%}
@container app (max-width:35.0rem){.home-content{max-width:100%;padding:0 1.25rem}.home .brand{font-size:1.4375rem;gap:0.5rem}.home .app-header{padding:0 1rem;gap:0.5rem}.home .brand .brandmark{width:2.625rem;height:2.625rem}.home-header-meta{gap:0.375rem}.home-header-meta .pill{font-size:0.8125rem;padding:0.5rem 0.8125rem}.home .app-header .icon{width:2.375rem;height:2.375rem;padding:0.5625rem}.home .app-header .icon svg{width:1.25rem;height:1.25rem}.home .app-header .avatar{width:1.5rem;height:1.5rem;font-size:0.6875rem}.toolbar{margin-top:1.5rem}.toolbar-left{width:100%;margin:0}.toolbar-right{gap:0.5rem}.sort-menu>summary{min-height:2.875rem;padding:0 0.75rem 0 0.9375rem;font-size:0.8125rem}.home .toolbar-right>.primary{padding:0 1rem}.collection-head{padding:0;margin-bottom:1.375rem}.nb-card h2{font-size:1.21875rem}.view-toggle{--toolbar-control-height:2.875rem;--thumb:2.375rem;--thumb-pad:0.25rem;padding:var(--thumb-pad)}.view-toggle button{padding:0.5625rem}}
@container app (max-width:25.0rem){.home .brand{font-size:1.3125rem}.home-header-meta{gap:0.25rem}.home-header-meta .pill{padding:0.4375rem 0.625rem}.view-toggle{--toolbar-control-height:2.625rem;--thumb:2.125rem}.view-toggle button{padding:0.5rem}}
@media(prefers-reduced-motion:reduce){.nb-card:hover:not(:disabled){transform:none}}
