/* Saved messages form the browsing surface; room utilities live in the toolbar. */
#home-room { transition:none; padding:calc(8px + env(safe-area-inset-top,0px)) 18px max(32px,env(safe-area-inset-bottom,0px)); }
#home-room .home-room-content { width:min(960px,100%); min-height:0; gap:18px; }
body.home-room-visible #page-list > .topbar { display:none!important; }
#home-room .home-room-heading { display:flex; align-items:center; gap:4px; min-height:48px; padding:0; }
#home-room .home-room-heading h1 { flex:1; min-width:0; font-family:inherit; font-size:17px; font-weight:550; line-height:1.4; letter-spacing:0; }
#home-room-favorites-count { margin-left:4px; color:var(--text3); font-size:13px; font-weight:400; }
#home-room .home-room-return,#home-room .home-room-options > summary { display:grid; place-items:center; flex:none; width:44px; height:44px; padding:0; margin:0; border:0; border-radius:50%; background:transparent; color:var(--text2); cursor:pointer; }
#home-room .home-room-return { margin-left:-10px; }
#home-room .home-room-return svg,#home-room .home-room-options > summary svg { width:22px; height:22px; }
#home-room .home-room-memory-entry { display:flex; align-items:center; gap:6px; width:auto; min-height:44px; margin:0; padding:0 8px; border:0; background:transparent; color:var(--text2); font-size:14px; }
#home-room .home-room-memory-entry svg { width:20px; height:20px; }
#home-room .home-room-memory-entry:active,#home-room .home-room-return:active { opacity:.55; }
#home-room .home-room-options { position:relative; z-index:6; }
#home-room summary { list-style:none; cursor:pointer; }
#home-room summary::-webkit-details-marker { display:none; }
#home-room .home-room-options[open] > summary { background:var(--bg2); }
#home-room .home-room-options-panel { position:absolute; top:50px; right:0; width:270px; max-width:calc(100vw - 36px); padding:6px; border:1px solid var(--border); border-radius:16px; background:var(--card,var(--bg)); box-shadow:0 10px 35px rgb(0 0 0 / .12); }
#home-room .home-room-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0 4px 4px; padding:14px 0; border:0; border-bottom:1px solid var(--border); }
#home-room .home-room-stat { display:flex; flex-direction:column; gap:4px; padding:0 4px; border:0; }
#home-room .home-room-stat strong { color:var(--text); font-family:inherit; font-size:17px; font-weight:550; }
#home-room .home-room-stat span { color:var(--text3); font-size:11px; }
#home-room .home-room-light,#home-room .home-room-exit { position:static; display:flex; align-items:center; gap:10px; width:100%; min-height:44px; height:auto; padding:10px; border:0; border-radius:9px; background:transparent; color:var(--text); font:inherit; font-size:14px; text-align:left; }
#home-room .home-room-light svg,#home-room .home-room-exit svg { width:21px; height:21px; flex:none; }
#home-room .home-room-light:hover,#home-room .home-room-exit:hover { background:var(--bg2); }
#home-room .home-room-light > span { position:static; width:auto; height:auto; background:transparent; opacity:1; transform:none; }
#home-room .home-room-light .home-room-light-state { position:static; display:block; width:6px; height:6px; margin-left:auto; border-radius:50%; background:var(--text3); opacity:.3; transform:none; }
#home-room.is-light-on .home-room-light .home-room-light-state { background:var(--text); opacity:1; }
#home-room .home-room-favorites { margin:0; }
#home-room .home-room-favorite-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:22px 12px; max-height:none; padding:0; border:0; overflow:visible; background:transparent; }
#home-room .home-room-favorite { min-width:0; padding:0; border:0; }
#home-room .home-room-favorite > p { display:flex; margin:0; aspect-ratio:4/5; border:1px solid color-mix(in srgb,var(--border) 65%,transparent); border-radius:13px; background:var(--card,var(--bg)); color:var(--text); font-family:inherit; font-size:15px; line-height:1.7; white-space:normal; overflow:hidden; }
#home-room .home-room-favorite-open { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; width:100%; min-height:44px; padding:17px 14px; border:0; background:transparent; color:inherit; font:inherit; text-align:left; }
#home-room .home-room-favorite-open > span { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:6; overflow:hidden; white-space:pre-wrap; overflow-wrap:anywhere; }
#home-room .home-room-favorite-open:active { background:color-mix(in srgb,var(--text) 4%,transparent); }
#home-room .home-room-favorite footer { display:flex; align-items:center; gap:0; min-width:0; margin:4px 0 0; padding-left:4px; }
#home-room .home-room-favorite-byline { display:flex; flex:1; flex-direction:column; gap:2px; min-width:0; }
#home-room .home-room-favorite-byline strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text2); font-size:12px; font-weight:500; line-height:1.4; }
#home-room .home-room-favorite footer .home-room-favorite-byline span { color:var(--text3); font-size:11px; line-height:1.4; }
#home-room .home-room-favorite-actions { position:relative; flex:none; }
#home-room .home-room-favorite-actions > summary { display:grid; place-items:center; width:44px; height:44px; border-radius:50%; color:var(--text3); }
#home-room .home-room-favorite-actions > summary svg { width:19px; height:19px; }
#home-room .home-room-favorite-actions[open] { z-index:4; }
#home-room .home-room-favorite-actions[open] > summary { background:var(--bg2); }
#home-room .home-room-favorite-actions > button { position:absolute; z-index:4; top:44px; right:0; display:flex; align-items:center; gap:8px; width:132px; min-height:44px; height:auto; flex:none; margin:0; padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:var(--card,var(--bg)); box-shadow:0 6px 24px rgb(0 0 0 / .08); color:var(--text); font-size:12px; white-space:nowrap; }
#home-room .home-room-favorite-actions > button svg { width:17px; height:17px; flex:none; }
#home-room .home-room-favorite-empty { grid-column:1/-1; display:flex; flex-direction:column; justify-content:center; gap:18px; min-height:min(55svh,440px); margin:0; padding:24px; color:var(--text3); font-size:13px; }
#home-room .home-room-favorite-empty svg { width:40px; height:48px; opacity:.5; }
#home-room :focus-visible { outline:2px solid var(--text2); outline-offset:3px; }
@media(max-width:350px){#home-room { padding-inline:14px; } #home-room .home-room-favorite-list { gap:18px 10px; } #home-room .home-room-favorite-open { padding:14px 11px; } #home-room .home-room-favorite-open > span { -webkit-line-clamp:5; }}
@media(min-width:600px){#home-room .home-room-favorite-list { grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px 18px; }}
@media(min-width:900px){#home-room .home-room-favorite-list { grid-template-columns:repeat(4,minmax(0,1fr)); }}
@media(prefers-reduced-motion:reduce){#home-room * { transition:none!important; }}

/* Keyboard editing has one screen, not a second scroll-snap room below it. */
body.home-composer-focused #page-list.active #home-room,
body.chat-keyboard-open #page-list.active #home-room { display:none !important; }
body.home-composer-focused #page-list.active > .scroll-area,
body.chat-keyboard-open #page-list.active > .scroll-area { overflow:hidden; scroll-snap-type:none; scroll-behavior:auto; padding:0; }
body.chat-keyboard-open #page-list.active .home-start { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; justify-content:stretch; justify-items:center; gap:12px; height:100%; min-height:100%; padding:calc(56px + var(--safe-top)) 0 8px; }
body.chat-keyboard-open #page-list.active .home-intro { position:relative; top:auto; left:auto; align-self:center; min-height:0; max-height:100%; opacity:1; transform:none; padding:0 24px; overflow:hidden; }
body.chat-keyboard-open #page-list.active .home-composer { margin:0; max-height:none; align-self:end; }
body.chat-keyboard-open #page-list.active .home-greeting { font-size:clamp(16px,4.5vw,22px); }
body.chat-keyboard-open #page-list.active .home-intro .conversation-empty-logo { width:38px; height:38px; }
body.chat-keyboard-open #page-list.active #home-message-input { outline:none !important; max-height:clamp(48px,calc(var(--app-height,100dvh) - 180px - var(--safe-top)),150px); }
