/* Restore the selected 853 x 1844 artwork at its intrinsic proportions. */
body.theme-night-chat { --night-nav:74px; }
body.theme-night-chat .night-chat-stage { height:100dvh; min-height:0; padding:0!important; overflow:hidden; position:relative; container-type:inline-size; }
body.theme-night-chat { overflow:hidden; }
body.theme-night-chat .night-chat-home,
body.theme-night-chat .night-chat-conversation { height:100%; min-height:0; padding:0; background:none; isolation:isolate; }
.night-chat-home::before,.night-chat-conversation::before { content:none!important; }
.night-chat-home::after,.night-chat-conversation::after { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; background-position:center top; background-repeat:no-repeat; background-size:100% auto; }
.night-chat-home::after { background-image:url('/bg/night-chat-home-demo-v4.png'); }
.night-chat-conversation::after { background-image:url('/bg/night-chat-conversation-v5.png'); }
.night-chat-home { display:flex; flex-direction:column; }
.night-chat-hero { height:86.4cqw; flex:none; background:none; overflow:visible; }
.night-chat-hero::after { content:none; }
.night-chat-brand { left:7.7%; top:7.6cqw; }
.night-chat-brand h1 { font-size:8.3cqw; font-weight:700; letter-spacing:1.15cqw; line-height:1.15; color:#f7dfae; }
.night-chat-brand p { margin-top:2.2cqw; font-size:3.2cqw; letter-spacing:.55cqw; color:#bca781; }
.night-chat-quote { left:8%; top:31.7cqw; font-family:"Nightingale Song","Songti SC",serif; font-weight:400; font-size:2.95cqw; line-height:1.6; letter-spacing:.7cqw; color:#bda984; }
.night-chat-hero-actions { top:10.2cqw; right:4%; border-color:#514532; border-radius:2.6cqw; background:rgba(20,17,15,.84); }
.night-chat-hero-actions button { width:16.8cqw; min-width:0; height:12.4cqw; padding:1.5cqw 0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1.1cqw; font-size:2.6cqw; }
.night-chat-ui-icon { width:4cqw; height:4cqw; flex:none; filter:invert(85%) sepia(29%) saturate(562%) hue-rotate(349deg) brightness(96%) contrast(88%); }
.night-chat-home-body { padding:3.8cqw 4.2cqw calc(var(--night-nav) + 12px); flex:1; min-height:0; display:flex; flex-direction:column; }
.night-chat-prompt { font-size:5.6cqw; font-weight:700; letter-spacing:.6cqw; margin:0 0 4cqw; line-height:1.3; white-space:nowrap; }
.night-chat-starters { gap:2.8cqw; }
.night-chat-starter { display:flex; align-items:center; gap:2cqw; min-height:13.2cqw; border-radius:4.5cqw; padding:0 3.2cqw; font-size:3.2cqw; letter-spacing:0; background:rgba(47,36,26,.66); border-color:rgba(187,150,98,.4); }
.night-chat-starter span { white-space:nowrap; }
.night-chat-chevron { width:2.6cqw; height:3.5cqw; margin-left:auto; }
.night-chat-home-form { margin-top:auto; min-height:12.2cqw; padding:1.4cqw 1.4cqw 1.4cqw 4.2cqw; gap:3cqw; border-color:rgba(187,150,98,.4); background:rgba(42,33,25,.7); }
.night-chat-home-form input { font-size:3.5cqw; }
.night-chat-pencil { opacity:.56; }
.night-chat-home-form input::placeholder,.night-chat-composer textarea::placeholder { color:#a79b89; opacity:.8; }
.night-chat-send { width:9.5cqw; height:9.5cqw; flex-basis:9.5cqw; box-shadow:0 0 13px #e2b55d22; }
.night-chat-send img { display:block; width:4.8cqw; height:4.8cqw; margin:auto; opacity:.79; }
.night-chat-quota { margin-top:2cqw; font-size:2.6cqw; letter-spacing:0; color:#b49f80; }
.night-chat-chat-head { height:19.8cqw; padding:0 3.6cqw; grid-template-columns:1fr 2fr 1fr; align-items:center; }
.night-chat-chat-title strong { font-size:6.4cqw; font-weight:700; letter-spacing:.55cqw; }
.night-chat-chat-title span { font-size:2.8cqw; letter-spacing:.16cqw; margin-top:1.1cqw; }
.night-chat-back { width:44px; height:44px; padding:0; display:flex; align-items:center; }
.night-chat-back img { width:5.5cqw; height:5.5cqw; }
.night-chat-new { min-width:0; margin:0; padding:0; min-height:44px; display:flex; align-items:center; justify-content:flex-end; gap:1cqw; font-size:2.9cqw; white-space:nowrap; }
.night-chat-thread-label { margin:6.3cqw 4cqw 4.6cqw; gap:3cqw; font-size:3.1cqw; letter-spacing:.3cqw; line-height:1.4; }
.night-chat-messages { margin:0 3.5cqw; max-height:calc(100dvh - var(--night-nav) - 71cqw); gap:4.6cqw; background:none; }
.night-chat-message { max-width:79%; }
.night-chat-message.assistant { max-width:96%; padding-left:13cqw; }
.night-chat-avatar { width:10cqw; height:10cqw; box-shadow:none; transform:none; border-radius:0; object-fit:contain; background:transparent; }
.night-chat-bubble { padding:3cqw 3.3cqw; border-radius:2.7cqw; background:rgba(41,33,27,.67); border-color:rgba(166,141,104,.3); font-size:3.75cqw; line-height:1.5; letter-spacing:0; backdrop-filter:none; color:#f0e9dd; }
.night-chat-message.user .night-chat-bubble { background:rgba(104,78,53,.67); border-color:rgba(208,175,125,.4); font-size:3.5cqw; padding:3.5cqw 3.3cqw; }
.night-chat-time { font-size:2.6cqw; margin-top:1.7cqw; color:#a29683; }
.night-chat-actions { position:absolute; left:3.5%; right:3.5%; transform:none; width:auto; bottom:calc(var(--night-nav) + 25cqw); gap:1.3cqw; }
.night-chat-actions button { min-height:9cqw; border-color:#8d71504d; background:rgba(20,15,10,.6); font-size:2.85cqw; gap:1.7cqw; }
.night-chat-action-icon { width:3.9cqw; height:3.9cqw; }
.night-chat-composer { position:absolute; left:3.5%; right:3.5%; width:auto; bottom:calc(var(--night-nav) + 3cqw); transform:none; padding:0; background:none; }
.night-chat-composer form { min-height:13.7cqw; padding:1.5cqw 1.2cqw 1.5cqw 4.1cqw; background:rgba(44,35,28,.77); border-color:rgba(187,150,98,.4); }
.night-chat-composer textarea { font-size:3.5cqw; padding:0; }
.night-chat-composer small { font-size:2.65cqw; margin-top:2.6cqw; color:#b4a38c; }
.night-chat-candidate { position:absolute; bottom:calc(var(--night-nav) + 37cqw); left:4%; right:4%; z-index:4; }
body.theme-night-chat .bottom-nav { height:var(--night-nav); padding:7px 0 max(10px,env(safe-area-inset-bottom)); background:rgba(18,13,9,.72); border-color:#a88a5333; backdrop-filter:none; }
body.theme-night-chat .nav-item { position:relative; gap:5px; color:#a79883; font-family:-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; }
.night-chat-nav-icon { display:none; }
body.theme-night-chat .nav-item svg { display:none; }
body.theme-night-chat .night-chat-nav-icon { display:block; width:23px; height:23px; filter:invert(67%) sepia(12%) saturate(574%) hue-rotate(356deg) brightness(87%) contrast(89%); }
body.theme-night-chat .nav-item.active .night-chat-nav-icon { filter:invert(88%) sepia(28%) saturate(762%) hue-rotate(340deg) brightness(99%) contrast(87%); }
body.theme-night-chat .nav-item .lbl { font-size:12px; letter-spacing:0; }
body.theme-night-chat .nav-item.active { color:#edc780; }
body.theme-night-chat .nav-item.active::after { content:""; position:absolute; bottom:0; width:34px; height:2px; background:#edc780; border-radius:2px; box-shadow:0 0 8px #edc78066; }
@media(max-height:740px) {
 body.theme-night-chat { --night-nav:65px; }
 .night-chat-home-body { padding-top:2cqw; }
 .night-chat-hero { height:81cqw; }
 .night-chat-prompt { font-size:5cqw; margin-bottom:3cqw; }
 .night-chat-starter { min-height:11.5cqw; }
 .night-chat-home-form { margin-top:auto; }
 .night-chat-home-body { padding-bottom:calc(var(--night-nav) + 8px); }
}
@media(max-height:620px) {
 body.theme-night-chat { overflow:auto; }
 body.theme-night-chat:not(.night-chat-conversation-mode) .night-chat-stage { height:auto; min-height:620px; }
 .night-chat-home { min-height:620px!important; }
}

/* Keep the selected Demo composition within the visible mobile screen. */
.night-chat-starters { margin-top:auto; flex-shrink:0; }
.night-chat-home .night-chat-home-form { margin-top:12px; flex-shrink:0; }
body.theme-night-chat.night-chat-conversation-mode { position:fixed; inset:0; width:100%; height:100%; overflow:hidden; }
body.theme-night-chat.night-chat-conversation-mode .night-chat-stage { height:100%; height:100dvh; min-height:0; }
.night-chat-conversation::after { background-size:100% 100%; }
/* iOS zooms focused controls below 16px, enlarging the whole composition. */
.night-chat-home-form input,.night-chat-composer textarea { font-size:16px; }

/* The artwork's header curve is 9.2% down the full-height background. */
.night-chat-conversation .night-chat-chat-head { height:9.2%; min-height:0; padding:0 3.6cqw; }
.night-chat-chat-title strong { line-height:1.15; }
.night-chat-chat-title span { line-height:1.3; margin-top:1cqw; }

@font-face { font-family:"Night Chat Prompt"; src:url('/fonts/night-chat-prompt-v2.ttf') format('truetype'); font-weight:400; font-style:normal; font-display:block; }
.night-chat-home .night-chat-prompt { font-family:"Night Chat Prompt",serif; font-weight:400; font-synthesis:none; margin-top:15cqw; }
@media(max-height:660px) { .night-chat-home .night-chat-prompt { margin-top:10cqw; } }

/* Grow long drafts without covering the actions or message list. */
.night-chat-composer form { border-radius:26px; }
.night-chat-composer textarea { height:24px; min-height:24px; max-height:120px; line-height:24px; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.night-chat-composer .night-chat-send { align-self:flex-end; }
.night-chat-actions { bottom:calc(var(--night-nav) + 25cqw + var(--night-input-growth, 0px)); }
.night-chat-candidate { bottom:calc(var(--night-nav) + 37cqw + var(--night-input-growth, 0px)); }
.night-chat-messages { max-height:max(0px, calc(100dvh - var(--night-nav) - 71cqw - var(--night-input-growth, 0px))); }
