.rail-project-group { min-width:0; }
.rail-project-panel[hidden] { display:none; }
.rail-project-panel { margin:2px 0 8px 21px; padding-left:12px; border-left:1px solid #ffffff26; }
.rail-project-list { list-style:none; margin:0; padding:0; }
.rail-project-link, .rail-project-all { display:block; width:100%; min-width:0; padding:9px 8px; border:0; border-radius:5px; background:transparent; color:#a8afbd; text-align:left; font:inherit; font-size:12px; cursor:pointer; }
.rail-project-link { display:flex; align-items:center; gap:9px; white-space:nowrap; }
.rail-project-title { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.rail-project-indicator { display:none; flex:none; width:12px; height:12px; box-sizing:border-box; border-radius:50%; }
.rail-project-link[data-activity="running"] .rail-project-indicator { display:block; border:1.7px solid #b3a7ff45; border-top-color:#d5caff; border-right-color:#d5caff; animation:rail-project-spin .85s linear infinite; }
.rail-project-link[data-activity="queued"] .rail-project-indicator { display:block; border:1.5px dashed #a8afbd; }
.rail-project-link[data-activity="attention"] .rail-project-indicator { display:block; width:6px; height:6px; margin:3px; background:#e7b877; }
@keyframes rail-project-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .rail-project-link[data-activity="running"] .rail-project-indicator { animation:none; } }
.rail-project-link:hover, .rail-project-link[aria-current="page"], .rail-project-all:hover { background:var(--rail-soft,#ffffff14); color:#fff; }
.rail-project-link:focus-visible, .rail-project-all:focus-visible { outline:2px solid #a9a1ff; outline-offset:-2px; }
.rail-project-link[aria-busy="true"] { opacity:.5; cursor:progress; }
.rail-project-all { font-size:11px; color:#8d91a6; }
.rail-project-note { padding:9px 8px; font-size:11px; line-height:1.6; color:#8d91a6; }
.home-recent-toggle { display:none; }
#home .home-recent .deck-preview.is-placeholder { display:flex; flex-direction:column; justify-content:flex-end; align-items:flex-start; padding:12px; box-sizing:border-box; }
#home .home-recent .deck-preview.is-placeholder small { max-width:92%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#home .home-recent .deck-preview.is-placeholder strong { display:-webkit-box; max-width:92%; margin-top:6px; overflow:hidden; font-size:13px; line-height:1.15; -webkit-box-orient:vertical; -webkit-line-clamp:3; }
@media (min-width:1401px) {
  #home.has-generation-chat .home-recent { position:fixed; inset:0; z-index:6; width:auto; max-height:none; margin:0; padding:0; overflow:visible; border:0; border-radius:0; background:transparent; box-shadow:none; pointer-events:none; }
  #home.has-generation-chat .home-recent .recent-heading { display:none; }
  #home.has-generation-chat .home-recent .recent-heading h2,
  #home.has-generation-chat .home-recent .recent-heading>[data-view="projects"] { display:none; }
  #home.has-generation-chat .generation-chat-title { min-width:0; }
  #home.has-generation-chat .generation-chat-title h1 { max-width:12em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  /* On wide screens the recent-project entry belongs to the viewport chrome,
     so it stays at the far right instead of moving with the centered chat. */
  #home.has-generation-chat .home-recent-toggle { position:fixed; top:70px; right:20px; display:inline-flex; align-items:center; gap:8px; min-height:36px; padding:0 12px; border:1px solid #e4e1eb; border-radius:9px; background:#fff; color:#5e5870; box-shadow:0 5px 18px #24203812; font-size:12px; cursor:pointer; pointer-events:auto; z-index:121; }
  #home.has-generation-chat .home-recent-toggle::after { content:'⌄'; color:#8475a7; transition:transform .18s ease; }
  #home.has-generation-chat .home-recent.is-open .home-recent-toggle::after { transform:rotate(180deg); }
  #home.has-generation-chat .home-recent .recent-grid[hidden] { display:none!important; }
  #home.has-generation-chat .home-recent:not(.is-open) .recent-grid { display:none!important; }
  #home.has-generation-chat .home-recent-popover { position:fixed; top:var(--recent-panel-top,72px); right:var(--recent-panel-right,24px); z-index:120; display:none; width:min(220px,calc(100vw - 290px)); max-height:calc(100dvh - 154px); overflow:auto; padding:9px; border:1px solid #e6e2ee; border-radius:12px; background:#fff; box-shadow:0 12px 36px #24203820; pointer-events:auto; }
  #home.has-generation-chat .home-recent.is-open .home-recent-popover { display:block; }
  #home.has-generation-chat .home-recent-popover .recent-grid { position:static; display:grid; grid-template-columns:minmax(0,1fr); gap:8px; width:auto; max-height:none; overflow:visible; padding:0; border:0; box-shadow:none; }
  #home.has-generation-chat .home-recent.is-open .recent-grid .real-recent { display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; width:100%; border-radius:8px; }
  #home.has-generation-chat .home-recent.is-open .recent-grid .deck-preview { width:72px; min-height:0; aspect-ratio:16/9; }
  #home.has-generation-chat .home-recent.is-open .recent-grid .deck-preview.is-placeholder { padding:7px; }
  #home.has-generation-chat .home-recent.is-open .recent-grid .deck-preview.is-placeholder small { font-size:5px; }
  #home.has-generation-chat .home-recent.is-open .recent-grid .deck-preview.is-placeholder strong { margin-top:3px; font-size:8px; line-height:1.05; }
}
@media (max-width:1400px) {
  #home.has-generation-chat .home-recent { display:block!important; position:fixed; inset:0; z-index:6; width:auto; height:auto; margin:0; padding:0; border:0; background:transparent; box-shadow:none; pointer-events:none; overflow:visible; }
  #home.has-generation-chat .generation-chat-head { position:relative; }
  #home.has-generation-chat .generation-chat-title { min-width:0; }
  #home.has-generation-chat .generation-chat-title { padding-right:90px; }
  #home.has-generation-chat .generation-chat-title h1 { max-width:12em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #home.has-generation-chat .home-recent-toggle { display:inline-flex; align-items:center; gap:7px; min-height:34px; margin-left:auto; padding:0 10px; border:1px solid #e4e1eb; border-radius:9px; background:#fff; color:#5e5870; font-size:11px; cursor:pointer; }
  #home.has-generation-chat .home-recent-toggle::after { content:'⌄'; color:#8475a7; }
  #home.has-generation-chat .home-recent-popover { position:fixed; top:74px; right:16px; z-index:120; display:none; width:min(220px,calc(100vw - 104px)); max-height:calc(100dvh - 154px); overflow:auto; padding:9px; border:1px solid #e6e2ee; border-radius:12px; background:#fff; box-shadow:0 12px 36px #24203820; }
  #home.has-generation-chat .home-recent.is-open .home-recent-popover { display:block; }
  #home.has-generation-chat .home-recent-popover .recent-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:7px; }
}
@media (max-width:850px) {
  .rail:has(.rail-project-toggle[aria-expanded="true"]) { z-index:150; }
  .rail-project-group:has(.rail-project-toggle[aria-expanded="true"]) { position:relative; }
  .rail-project-panel { position:fixed; top:150px; left:72px; width:min(240px,calc(100vw - 88px)); z-index:110; margin:0; padding:8px; border:1px solid #ffffff26; border-radius:8px; background:var(--rail,#191b26); box-shadow:0 8px 24px #0004; max-height:calc(100dvh - 170px); overflow-y:auto; }
}

.rail-project-all[hidden]{display:none}
