/* A working home: conversation first, projects close at hand. */
#homeView{--home-ink:#30343a;--home-muted:#7b8189;--home-line:#e2e5e8;--home-soft:#f6f7f8;--home-hover:#eceff1;--home-paper:#fff;}
html.dark-mode #homeView{--home-ink:#e0e2e5;--home-muted:#a0a5ad;--home-line:#363a40;--home-soft:#222528;--home-hover:#303439;--home-paper:#1b1d20;}
.app>.content>#homeView.active{display:block;overflow:auto;padding:0;background:var(--home-paper);color:var(--home-ink);}
.home-workspace{box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;width:min(100%,1040px);min-height:100%;margin:0 auto;padding:clamp(32px,6vh,72px) 40px;}
.home-workspace>.home-ai,.home-workspace>.home-recent{flex:none;}
.home-ai{width:100%;max-width:none;margin:0 0 40px;}
.home-ai h1{margin:0;font:500 28px/1.4 system-ui;letter-spacing:-.6px;text-align:center;}
.home-intro{text-align:center;margin:9px 0 24px;color:var(--home-muted);font:13px/1.7 system-ui;}
.home-ai-composer{padding:14px 14px 10px;border:1px solid var(--home-line);border-radius:16px;background:var(--home-soft);}
#homeAIInput{display:block;box-sizing:border-box;width:100%;height:96px;min-height:96px;max-height:96px;margin:0;padding:0;border:0;outline:none;box-shadow:none;background:transparent;color:var(--home-ink);resize:none;overflow-y:auto;font:14px/1.8 system-ui;}
#homeAIInput::placeholder{color:var(--home-muted);}
.home-ai-composer-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px;}
.home-ai-composer-footer>span{color:var(--home-muted);font:11px/20px system-ui;}
#homeAISend{display:grid;place-items:center;width:32px;height:32px;padding:7px;border:0;border-radius:50%;background:var(--home-ink);color:var(--home-paper);cursor:pointer;}
#homeAISend svg{width:18px;height:18px;}
#homeAISend:hover{opacity:.8;}
#homeAISend:disabled{opacity:.45;cursor:wait;}
.home-ai-suggestions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;}
.home-ai-suggestions button{padding:5px 10px;border:0;border-radius:5px;background:transparent;color:var(--home-muted);font:12px/20px system-ui;cursor:pointer;}
.home-ai-suggestions button:hover{background:var(--home-soft);color:var(--home-ink);}
.home-ai-messages:empty{display:none;}
.home-ai-messages{display:flex;flex-direction:column;gap:18px;max-height:380px;overflow-y:auto;overscroll-behavior:contain;margin:0 0 20px;padding:4px 2px;}
.home-ai-message{max-width:100%;color:var(--home-ink);font:15px/1.8 system-ui;overflow-wrap:anywhere;}
.home-ai-message.user{align-self:flex-end;max-width:85%;padding:9px 13px;border-radius:10px;background:var(--home-soft);white-space:pre-wrap;}
.home-ai-message.ai>:first-child{margin-top:0;}.home-ai-message.ai>:last-child{margin-bottom:0;}
.home-ai-message.pending{color:var(--home-muted);}
.home-ai-message.error{color:#b75e54;}
.home-recent{margin-top:24px;}
.home-recent>header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.home-recent h2{margin:0;font:500 14px/24px system-ui;}
.home-recent>header button{padding:4px 0;border:0;background:transparent;color:var(--home-muted);font:12px/20px system-ui;cursor:pointer;}
#homeRecentProjects{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;}
.home-project{display:flex;align-items:center;gap:12px;min-width:0;padding:10px 8px;border:0;border-radius:7px;background:transparent;text-align:left;color:var(--home-ink);cursor:pointer;}
.home-project:hover{background:var(--home-soft);}
.home-project-thumb{display:grid;place-items:center;flex:0 0 64px;width:64px;height:42px;border-radius:5px;overflow:hidden;background:var(--home-soft);color:var(--home-muted);}
.home-project-thumb svg{width:22px;height:22px;}
.home-project-thumb .entity-image-shell,.home-project-thumb img{width:100%;height:100%;object-fit:cover;}
.home-project-info{display:flex;flex-direction:column;gap:4px;min-width:0;}
.home-project-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 13px/20px system-ui;}
.home-project-info small{font:11px/18px system-ui;color:var(--home-muted);}
.home-recent-empty{grid-column:1/-1;padding:16px 8px;color:var(--home-muted);font:13px/22px system-ui;}
.home-new-project{display:flex;align-items:center;gap:6px;margin-top:12px;padding:6px 8px;border:0;border-radius:5px;background:transparent;color:var(--home-muted);font:12px/20px system-ui;cursor:pointer;}
.home-new-project:hover{background:var(--home-soft);color:var(--home-ink);}
.home-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px;margin-top:30px;padding-top:20px;border-top:1px solid var(--home-line);}
.home-shortcuts button{display:grid;grid-template-columns:1fr auto;gap:4px 8px;padding:8px 0;border:0;background:transparent;text-align:left;color:var(--home-muted);cursor:pointer;}
.home-shortcuts strong{font:400 13px/20px system-ui;color:var(--home-ink);}
.home-shortcuts button>span:first-of-type{grid-row:2;font:11px/20px system-ui;}
.home-shortcuts button>span:last-child{grid-column:2;grid-row:1/3;align-self:center;}
#homeView button:focus-visible{outline:1px solid var(--home-muted);outline-offset:2px;}
#homeView .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap;}
/* Clearer sidebar text and strokes without a colored selection treatment. */
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.btn-new-script){color:#50555c;}
#sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active{color:#50555c;}
#sidebar .nav-icon{opacity:1;}
#sidebar .nav-icon svg{stroke-width:1.7;}
#sidebar .sidebar-section-label{color:#8b9097;}
html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button:not(.btn-new-script),html.dark-mode #sidebar :is(.sidebar-nav,.sidebar-bottom-nav)>button.active{color:#c3c7cd;}
html.dark-mode #sidebar .sidebar-section-label{color:#9399a2;}
@media(max-width:820px){.home-workspace{justify-content:flex-start;padding:28px 20px;}.home-ai h1{font-size:24px;}#homeAIInput{font-size:16px;}.home-ai{margin-bottom:28px;}}
@media(max-width:520px){#homeRecentProjects{grid-template-columns:1fr;}.home-shortcuts{grid-template-columns:1fr;gap:4px;margin-top:20px;}.home-shortcuts button{grid-template-columns:64px 1fr auto;align-items:center;}.home-shortcuts button>span:first-of-type{grid-row:1;}.home-shortcuts button>span:last-child{grid-column:3;grid-row:1;}}

/* Match the sidebar's quiet user bubbles while keeping assistant replies open. */
#homeAIMessages .home-ai-message.user{width:fit-content;max-width:88%;min-width:0;padding:0;border-radius:0;background:none;}
#homeAIMessages .home-ai-message>.chat-bubble{box-sizing:border-box;width:auto;max-width:none;min-width:0;padding:0;border:0;border-radius:0;background:none;color:inherit;font:inherit;white-space:normal;word-break:normal;overflow-wrap:anywhere;box-shadow:none;}
#homeAIMessages .home-ai-message.user>.chat-bubble{padding:9px 12px;border-radius:11px;background:#eff1f3;white-space:pre-wrap;}
#homeAIMessages .home-ai-message.ai>.chat-bubble>:first-child{margin-top:0;}
#homeAIMessages .home-ai-message.ai>.chat-bubble>:last-child{margin-bottom:0;}
html.dark-mode #homeAIMessages .home-ai-message.user>.chat-bubble{background:#2c2f32;color:#d9dce0;}
.home-chat-project{display:flex;align-items:center;justify-content:space-between;gap:20px;width:min(100%,380px);margin-top:10px;padding:14px 16px;border:1px solid var(--home-line);border-radius:8px;background:var(--home-paper);color:var(--home-ink);text-align:left;cursor:pointer;transition:background 150ms;}
.home-chat-project strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;}
.home-chat-project span{flex:none;font-size:12px;color:var(--home-muted);}
.home-chat-project:hover{background:var(--home-soft);}
.home-chat-project:focus-visible{outline:2px solid var(--home-muted);outline-offset:2px;}

#homeAIMessages .ai-markdown hr{display:block;height:0;width:100%;margin:16px 0;border:0;border-top:1px solid var(--home-line);box-shadow:none;background:none;}

 .home-chat-controls{display:flex;align-items:center;justify-content:flex-end;gap:4px;min-width:0;margin:0 0 8px;}
.home-chat-controls button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:5px 7px;border:0;border-radius:6px;background:transparent;color:var(--home-muted);font:400 12px/20px system-ui;white-space:nowrap;cursor:pointer;}
.home-chat-controls svg{width:18px;height:18px;flex:none;}
.home-chat-controls .ai-history-chevron{width:12px;height:12px;margin-left:-3px;}
.home-chat-controls button:focus-visible{outline:1px solid var(--home-muted);outline-offset:2px;}
.home-chat-controls button:disabled{opacity:.5;cursor:wait;}
@media(hover:hover) and (pointer:fine){.home-chat-controls button:hover,.home-chat-controls button[aria-expanded="true"]{background:var(--home-hover);color:var(--home-ink);}}
