/* One conversation is the working surface; other tabs are personal archives. */
.conversation-page{max-width:800px;margin:0 auto}.chat-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:26px 0}.chat-heading h1{font-size:22px;margin:8px 0;letter-spacing:-.5px}.chat-welcome{padding:38px 12px 46px;text-align:center}.chat-welcome .mascot{margin:0 auto 23px;width:60px;height:60px}.chat-welcome h2{font-size:24px;font-weight:550;margin-bottom:12px}.chat-welcome p{font-size:14px;color:var(--muted);line-height:1.9}.prompt-chips{display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin-top:26px}.prompt-chips button{border:1px solid var(--line);background:#fff9;border-radius:25px;padding:11px 15px;color:var(--green);font-size:12px;min-height:44px}.messages{display:flex;flex-direction:column;gap:24px;padding:12px 0 26px}.messages:empty{display:none}.bubble{font-size:15px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;max-width:95%}.bubble>small{display:block;font-size:10px;color:var(--muted);margin-bottom:7px;letter-spacing:1px}.bubble.user{align-self:flex-end;background:#e7eee4;padding:14px 18px;border-radius:21px 21px 5px 21px;max-width:84%}.bubble.assistant{align-self:stretch;padding:0 3px}.bubble.pending{color:var(--muted);font-size:13px}.agent-card{white-space:normal;border:1px solid #d9e3d6;border-radius:20px;background:#fff;padding:20px;margin-top:14px;font-size:14px;line-height:1.8}.agent-card h3{font-size:17px;margin:0 0 8px}.agent-card h4{font-size:12px;color:var(--green);margin:18px 0 6px}.agent-card small{display:block;font-size:11px;color:var(--muted);margin:10px 0}.agent-card p{margin:10px 0}.agent-card ul{padding-left:20px;margin:8px 0}.agent-card .secondary{margin:6px 8px 0 0;font-size:12px;min-height:42px;padding:9px 12px}.agent-card strong{font-weight:600}.photo-panel{border:1px solid var(--line);border-radius:16px;background:#fff8;margin:12px 0;padding:0 15px}.photo-panel summary{cursor:pointer;padding:14px 0;font-size:12px}.photo-panel summary span{float:right;color:var(--muted);font-size:10px}.scene{position:relative;text-align:center;overflow:hidden;border-radius:12px;background:#eef1e9}.scene img,.scene video{width:100%;max-height:320px;object-fit:contain;display:block}.scene #empty-scene{padding:30px 10px;color:var(--muted);font-size:12px}#photo-label{position:absolute;bottom:8px;left:8px;background:#f8faf5e8;padding:5px 9px;font-size:10px;border-radius:10px}#capture-notice{position:absolute;inset:0;display:grid;place-content:center;background:#193b3060;color:white;font-size:14px}.scene-actions{display:flex;flex-wrap:wrap;gap:8px;padding:12px 0}.file-button{cursor:pointer}.voice-panel{position:relative;padding:15px 18px;background:#edf2e9;border:1px solid #e1e8dc;border-radius:18px;margin:14px 0;display:grid;grid-template-columns:1fr auto;gap:4px 14px}.voice-panel h2{font-size:13px;margin:0}.voice-panel #hint{font-size:11px;color:var(--muted);margin:0;grid-column:1}.voice-actions{grid-column:2;grid-row:1/4;display:flex;flex-direction:column;justify-content:center;gap:4px}.voice-actions button{padding:10px 12px;min-height:42px;font-size:12px}.quiet{background:transparent;color:var(--green);padding:8px;font-size:12px;min-height:40px}.barge-setting{grid-column:1/-1;font-size:10px;color:var(--muted);display:flex;align-items:center;gap:5px;margin-top:6px}.barge-setting small,.voice-panel>.small,.voice-orb{display:none}#mic-level{width:90px;height:3px;border:none;accent-color:var(--green)}#player,#replay{grid-column:1/-1}.heard{font-size:12px;color:var(--muted)}.interrupt-now{font-size:12px;background:transparent;color:var(--green);padding:8px}.recovery{border:1px solid var(--line);padding:15px;border-radius:15px;font-size:12px}.recovery audio{width:100%}.composer{position:sticky;bottom:14px;background:#fff;border:1px solid #ccd9ca;border-radius:22px;box-shadow:0 8px 30px #203c3410;padding:12px 14px 5px;z-index:10}#text-form{display:flex;align-items:flex-end;gap:10px}#question{border:0;background:transparent;resize:vertical;min-height:51px;max-height:180px;line-height:1.6;padding:10px 4px;font-size:16px}#send{width:42px;height:42px;min-height:42px;padding:8px;flex-shrink:0;margin:0 0 4px;font-size:22px;border-radius:50%}.composer-tools{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#95a092}.composer-tools .text{font-size:12px;padding:5px;min-height:34px}.chat-permission{font-size:10px;color:var(--muted);margin:16px 0 24px}.chat-permission summary{padding:8px;cursor:pointer}.consent{display:flex;align-items:flex-start;gap:8px;padding:8px;line-height:1.7}.consent input{flex-shrink:0;width:17px;height:17px;accent-color:var(--green)}#context-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;border-bottom:1px solid var(--line);padding-bottom:5px;color:var(--green)}#context-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#clear-context{white-space:nowrap;font-size:10px;min-height:32px}.gallery-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding-bottom:30px}.gallery-item{background:white;border:1px solid var(--line);border-radius:18px;overflow:hidden;padding:10px}.gallery-item img{width:100%;height:190px;object-fit:cover;border-radius:10px}.gallery-item p{font-size:11px;color:var(--muted);margin:6px 0}.gallery-item button{background:transparent;color:var(--green);min-height:40px;padding:8px 5px;font-size:12px}.gallery-item .actions{display:flex;flex-wrap:wrap;gap:8px}.history-card{margin-top:26px}#conversation-workspace{padding:15px;border:1px solid var(--line);border-radius:22px;background:#eef2e9;margin:14px 0}#workspace-content .card{margin:0;background:#fff}#workspace-content .two-col{display:block}body[data-current-page="home"] main>footer{display:none}body[data-current-page="home"] [data-test-boundary]{font-size:9px;line-height:1.7;max-width:800px;margin:12px auto;color:#89958a}body[data-current-page="home"] .topbar{height:66px}
@media(max-width:720px){.sidebar{padding-top:15px}.sidebar .brand{font-size:23px}.sidebar .brand small{font-size:8px}.sidebar .mascot.mini{width:32px;height:32px}main{padding:0 18px calc(105px + env(safe-area-inset-bottom))}.chat-heading{margin:20px 0 10px}.chat-heading .eyebrow{font-size:7px}.chat-heading h1{font-size:19px}.chat-heading .text{font-size:11px}.chat-welcome{padding:24px 0 30px}.chat-welcome h2{font-size:21px}.chat-welcome p{font-size:12px}.chat-welcome .mascot{width:50px;height:50px;margin-bottom:17px}.prompt-chips{gap:6px;margin-top:20px}.prompt-chips button{font-size:11px;padding:9px 11px}.bubble{font-size:14px;max-width:100%}.bubble.user{max-width:88%;padding:12px 16px}.agent-card{padding:16px}.agent-card h3{font-size:15px}.voice-panel{padding:12px;gap:4px 8px}.voice-panel #hint{font-size:10px}.voice-actions button{font-size:11px;padding:8px 10px}.composer{bottom:calc(81px + env(safe-area-inset-bottom));border-radius:20px;padding:8px 12px 3px}.gallery-grid{grid-template-columns:repeat(2,1fr);gap:10px}.gallery-item img{height:155px}.gallery-item button{font-size:11px}.scene-actions .secondary,.scene-actions .primary{font-size:11px;padding:10px 12px}.scene img,.scene video{max-height:260px}body[data-current-page="home"] .topbar{height:40px}.messages{gap:20px}#conversation-workspace{padding:10px}}
.composer .voice-panel{margin:0 0 6px;padding:5px 0 9px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}.composer .voice-panel #hint{max-width:420px}.composer .voice-panel[data-phase="idle"] #hint,.composer .voice-panel[data-phase="idle"] #mic-level,.composer .barge-setting{display:none}.composer .voice-panel h2{align-self:center}.composer .voice-actions{grid-row:1/3;flex-direction:row;align-items:center}.composer .voice-actions .primary{background:#e8efe4;color:var(--green)}.composer .voice-panel #mic-level{margin-top:3px}.composer .voice-panel[data-phase="idle"] #state{font-weight:450;color:var(--muted);font-size:11px}@media(max-width:720px){.chat-welcome{padding:17px 0 21px}.chat-heading{margin-top:14px}.chat-welcome .mascot{margin-bottom:14px}.prompt-chips{margin-top:16px}.composer .voice-panel #hint{font-size:10px}}
.testing-note{font-size:10px;color:#8a978c;margin:10px 0}.testing-note summary{cursor:pointer;width:max-content}.testing-note p{max-width:800px}.conversation-page .chat-heading{margin-top:18px}.photo-panel:not([open]){display:none}.chat-heading h1{font-size:18px;color:var(--muted);font-weight:450}.chat-welcome{padding:30px 0 38px}.chat-permission{margin:10px 0 14px}.chat-permission summary{font-size:10px}.composer-tools span{display:none}body[data-current-page="home"] .topbar #page-label{visibility:hidden}@media(max-width:720px){.chat-welcome{padding:24px 0 30px}body[data-current-page="home"] .topbar{position:absolute;top:23px;right:20px;border:0;height:20px}body[data-current-page="home"] .topbar .top-status{font-size:9px}.chat-heading{margin-bottom:0}.testing-note{margin-top:10px}.chat-heading h1{font-size:16px}}
/* Fixed conversation dock, with measured space so messages never sit underneath. */
.chat-dock{position:fixed;bottom:90px;left:18px;width:calc(100% - 36px);z-index:25;background:var(--bg);padding-top:6px;border-radius:22px;max-height:65dvh;overflow-y:auto;overscroll-behavior:contain;box-shadow:0 -12px 24px var(--bg)}
.chat-dock .composer{position:static;margin:0;box-shadow:none}.chat-dock .chat-permission{margin:0}.chat-dock .chat-permission summary{padding:5px 10px}.chat-dock #error{margin:4px 10px;padding:8px 10px;border-radius:10px;background:#fff0e9;font-size:12px;line-height:1.5}.chat-dock #retry-question{margin:0 10px 6px;min-height:36px;padding:7px 12px}.chat-dock .heard{margin:3px 10px;max-height:40px;overflow:auto;line-height:1.4}.chat-dock .interrupt-now{display:none}.chat-dock .recovery{margin-bottom:8px;padding:10px}.chat-dock #replay{min-height:28px;padding:2px 0;font-size:10px}.chat-dock .voice-panel #hint{max-height:32px;overflow:hidden;line-height:1.5}.chat-dock #question{resize:none;min-height:44px;max-height:120px;height:44px}.chat-dock .composer-tools{padding-top:0}.conversation-page{padding-bottom:var(--dock-space,240px)}html{scroll-padding-bottom:var(--dock-space,240px)}body[data-current-page="home"] main{padding-bottom:12px}body[data-keyboard="true"][data-current-page="home"] .sidebar nav{visibility:hidden;pointer-events:none}.chat-dock .voice-panel{gap:2px 8px}.chat-dock .voice-panel #replay:not([hidden]){grid-column:1;grid-row:3}.chat-dock .voice-actions{grid-row:1/3}
@media(min-width:721px){.chat-dock{max-width:800px}}

/* Keep controls close to the current message; reveal detail only when needed. */
.attachment-preview{display:flex;align-items:center;justify-content:space-between;padding:0 0 8px;gap:8px;border-bottom:1px solid var(--line);margin-bottom:6px}.attachment-open{display:flex;align-items:center;gap:10px;text-align:left;background:transparent;color:var(--green);font-size:12px;padding:4px;border-radius:12px}.attachment-open img{width:44px;height:44px;object-fit:cover;border-radius:9px}.attachment-open small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.attachment-preview>.text{min-width:44px;min-height:44px;font-size:22px}.chat-dock .photo-panel{position:relative;margin:0 0 8px;background:var(--bg);max-height:42dvh;overflow:auto}.chat-dock .photo-panel summary{padding-right:65px}.photo-close{position:absolute;right:10px;top:0;min-height:44px;font-size:12px}.chat-dock .scene img,.chat-dock .scene video{max-height:22dvh}.chat-dock .scene-actions{gap:6px}.chat-dock .chat-permission[open]{border:1px solid var(--line);border-radius:12px;padding:4px;background:#fff;margin-top:6px}.chat-dock .chat-permission[open] summary{font-size:12px;color:var(--green)}.chat-dock .consent{font-size:12px}.chat-dock .consent input{min-width:20px;min-height:20px}.chat-dock .chat-permission #connection{font-size:10px;padding:0 8px}.chat-dock #send:disabled{opacity:.4}.chat-dock .voice-actions .quiet{color:var(--muted)}.bubble.pending.assistant{display:flex;align-items:center;gap:8px;min-height:30px}.bubble.pending.assistant:before{content:'';width:7px;height:7px;border-radius:50%;background:var(--green);animation:thinking-pulse 1.2s ease-in-out infinite}@keyframes thinking-pulse{50%{opacity:.3}}@media(prefers-reduced-motion:reduce){.bubble.pending.assistant:before{animation:none}}

/* Conversation feedback is truthful: no simulated token streaming. */
.turn-feedback{font-size:13px;color:var(--muted);min-height:28px;display:flex;align-items:center;gap:8px}
.turn-feedback[data-state="waiting"]:before{content:'';width:7px;height:7px;flex-shrink:0;border-radius:50%;background:var(--green);animation:thinking-pulse 1.2s ease-in-out infinite}
.turn-feedback[data-state="failed"],.turn-feedback[data-state="uncertain"]{color:#895339}
.jump-latest{display:block;margin:0 auto 8px;padding:8px 16px;min-height:40px;border:1px solid var(--line);border-radius:24px;background:#fff;color:var(--green);box-shadow:0 3px 12px #203c3410;font-size:12px}
.chat-dock{max-height:var(--visible-dock-max,65dvh)}
@media(prefers-reduced-motion:reduce){.turn-feedback[data-state="waiting"]:before{animation:none}}

/* Default surface: one input row. Extra controls appear only in context. */
body[data-current-page="home"] .topbar,body[data-current-page="home"] .testing-note{display:none}.conversation-page .chat-heading{height:0;margin:0;position:relative}.chat-heading h1{display:none}.chat-heading #new-chat{position:absolute;right:0;top:-56px;min-height:44px;font-size:12px;color:var(--muted)}.chat-welcome{padding:clamp(35px,12dvh,130px) 0 30px}.chat-welcome h2{font-size:27px;letter-spacing:-.5px}.chat-welcome p{font-size:14px}.chat-welcome .mascot{width:55px;height:55px}.chat-dock{border-radius:26px;padding-top:3px}.chat-dock .composer{padding:8px;border-radius:26px;box-shadow:0 4px 20px #263d3210}.chat-dock #text-form{align-items:flex-end;gap:4px}.chat-dock #question{min-height:44px;padding:10px 4px;margin:0;flex:1;width:0}.composer-icon{width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;border-radius:50%;background:transparent;color:var(--green);display:grid;place-items:center;border:0;flex-shrink:0}.composer-icon#attach-photo{font-size:27px;font-weight:300}.composer-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}.composer-icon.mic-button{background:#edf2e9}.mic-button[data-phase="listening"],.mic-button[data-phase="speaking"]{background:var(--green);color:white}.chat-dock #send{margin:0;width:44px;height:44px;min-height:44px;font-size:23px}.chat-dock .voice-panel[data-phase="idle"],.chat-dock .voice-panel[data-phase="retry"],.chat-dock .voice-panel:not([data-phase]){display:none}.chat-dock .voice-panel{display:grid;grid-template-columns:1fr auto;align-items:center;padding:1px 8px 7px;margin:0 0 5px;min-height:32px}.chat-dock .voice-panel h2{font-size:12px;font-weight:450;line-height:1.5}.chat-dock .voice-panel #hint,.chat-dock .voice-panel #mic-level{display:none}.chat-dock .voice-panel .voice-actions{grid-column:2;grid-row:1;min-width:36px}.chat-dock .voice-panel #end{font-size:23px;min-height:36px;min-width:36px;padding:2px 7px}.chat-dock .attachment-preview{margin:0 6px 6px;padding:0 0 6px}.message-replay{color:var(--muted);font-size:12px;padding:2px 8px;min-height:36px}.quick-actions{display:flex;gap:8px;padding:0 0 12px}.quick-actions button{flex:1;background:#e8efe4;color:var(--green);border:0;border-radius:12px;min-height:44px;font-size:13px}.chat-dock .photo-panel .scene-actions{padding-top:0}.chat-dock .photo-panel #empty-scene{display:none}.chat-dock .photo-panel:not(:has(#reference-image:not([hidden]))):not(:has(#preview:not([hidden]))) #attachment-state{display:none}.permission-sheet{max-width:360px;width:calc(100% - 44px);max-height:80dvh;overflow:auto;border:1px solid var(--line);border-radius:24px;background:var(--bg);color:var(--ink);padding:24px;box-sizing:border-box}.permission-sheet::backdrop{background:#18372d55;backdrop-filter:blur(3px)}.permission-sheet h2{font-size:21px;margin:0 0 14px}.permission-sheet p,.permission-sheet .consent{font-size:13px;line-height:1.7;padding:0}.permission-sheet .small{font-size:11px}.permission-sheet button{width:100%;margin-top:8px;min-height:44px}.permission-sheet #permission-accept{border-radius:14px}.permission-sheet .quiet{margin-top:2px}.sidebar nav a{font-weight:450}button:focus-visible{outline:2px solid var(--green);outline-offset:3px}
@media(max-width:720px){.sidebar{padding:20px 20px 12px}.sidebar .brand small{display:none}.sidebar .brand{font-size:24px}.chat-heading #new-chat{top:-54px}.chat-welcome{padding:clamp(35px,11dvh,100px) 0 25px}.chat-welcome h2{font-size:25px}.chat-welcome p{font-size:13px}.sidebar nav{padding-top:8px;padding-bottom:calc(8px + env(safe-area-inset-bottom))}.sidebar nav a{min-height:48px;padding-top:5px;padding-bottom:5px}.chat-dock #question::placeholder{font-size:14px}.chat-dock #question{font-size:16px}}

@media(min-width:721px){.conversation-page .chat-heading{height:64px}.chat-heading #new-chat{top:18px}}

/* A camera opens directly from the composer; the photo stays a draft. */
dialog.photo-panel{padding:0;margin:auto;width:min(520px,100%);height:min(760px,100dvh);max-width:100%;max-height:100dvh;border:0;border-radius:24px;background:#18231f;color:#fff;overflow:hidden}
dialog.photo-panel[open]{display:flex;flex-direction:column}
dialog.photo-panel::backdrop{background:#10231bcc;backdrop-filter:blur(5px)}
.photo-heading{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;flex-shrink:0}
.photo-heading h2{margin:0;font-size:17px;font-weight:500}
.photo-heading button{width:44px;height:44px;border-radius:50%;font-size:30px;background:#ffffff14;color:#fff}
dialog.photo-panel .scene{flex:1;min-height:0;border-radius:0;background:#0c1511;display:grid;place-items:center}
dialog.photo-panel .scene video,dialog.photo-panel .scene img{width:100%;height:100%;max-height:100%;object-fit:contain;position:absolute;inset:0}
dialog.photo-panel #empty-scene{padding:30px;color:#c7d4cb;font-size:14px;line-height:1.8}
dialog.photo-panel #photo-label{background:#ffffffdf;color:#315e4e}
.photo-caption{margin:14px 16px 0;text-align:center;font-size:12px;color:#c7d4cb;line-height:1.6}
dialog.photo-panel .scene-actions{display:grid;grid-template-columns:1fr 80px 1fr;align-items:center;gap:16px;padding:14px 24px max(24px,env(safe-area-inset-bottom))}
dialog.photo-panel .file-button{grid-column:1;justify-self:start;min-width:44px;min-height:44px;display:grid;place-items:center;font-size:14px;color:#fff}
dialog.photo-panel #camera{grid-column:3;justify-self:end;min-height:44px;color:#fff;font-size:14px}
dialog.photo-panel .shutter{grid-column:2;grid-row:1;width:76px;height:76px;border:2px solid #fff;background:transparent;border-radius:50%;padding:5px}
.shutter span{display:block;width:100%;height:100%;border-radius:50%;background:#fff}.shutter:active span{transform:scale(.93)}
dialog.photo-panel #photo-error{color:#ffcfb8;margin:12px 20px 0;font-size:13px;text-align:center}
@media(max-width:720px){dialog.photo-panel{width:100%;height:100dvh;border-radius:0}.photo-heading{padding-top:max(12px,env(safe-area-inset-top))}}

.chat-dock .voice-panel[data-phase="listening"] #mic-level:not([hidden]){display:block;grid-column:1;width:64px;height:3px;margin-top:3px}
