/* Web adaptations layered after the existing phone and laptop styles. */
:root { --web-control-border: rgba(128, 128, 128, .3); }
body { --bg-primary: #fff; --bg-secondary: #f3f3f3; --text-primary: var(--text-color, #171717); }
body.dark-mode { --bg-primary: #151515; --bg-secondary: #222; }
.workspace-startup { position: fixed; inset: 0; z-index: 4000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--auth-bg, #020204); color: var(--auth-text, #fff); text-align: center; padding: 24px; }
.workspace-startup button, .pwa-update-banner button { min-height: 44px; padding: 8px 16px; font: inherit; border-radius: 8px; border: 1px solid var(--web-control-border); cursor: pointer; }
.pwa-update-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4000; padding: 8px 16px; border-radius: 12px; background: var(--bg-primary, #202020); color: var(--text-primary, #eee); border: 1px solid var(--web-control-border); }
#chat-container {
    top: max(64px, env(safe-area-inset-top)) !important;
    bottom: var(--web-composer-clearance, 160px) !important;
    height: auto !important;
}
#chat-container .chat-window::before { display: none !important; }
@media (min-width: 1024px) {
    .desktop-account-right-content .account-section > .section-heading { display: none; }
}
#floating-input-container .input-field {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) auto 44px 44px !important;
    grid-template-rows: minmax(44px, auto) 44px !important;
    gap: 4px !important;
    padding: 8px !important;
    align-items: center !important;
    border-radius: 22px;
}
#floating-input-container .input-field .floating-input {
    grid-column: 1 / -1 !important; grid-row: 1 !important;
    box-sizing: border-box; width: 100%; min-width: 0; max-height: 160px;
    padding: 10px 12px !important; border: 0 !important; border-radius: 8px;
    background: transparent !important; outline: 0;
}
#floating-input-container .input-field:focus-within { border-color: var(--text-secondary, #888); }
#floating-input-container #attach-file-btn {
    position: static !important; transform: none !important;
    grid-column: 1 !important; grid-row: 2 !important;
}
#floating-input-container #plan-mode-btn {
    position: static !important; transform: none !important;
    grid-column: 3 !important; grid-row: 2 !important;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; width: auto; min-width: 68px; padding: 8px 12px;
    font: inherit; font-size: .85rem; color: var(--text-secondary);
    background: transparent; border: 1px solid var(--web-control-border); border-radius: 12px;
}
#floating-input-container #plan-mode-btn.active { background: var(--text-primary, #eee); color: var(--bg-primary, #111); }
#floating-input-container #voice-input-btn { grid-column: 4 !important; grid-row: 2 !important; }
#floating-input-container #send-message { grid-column: 5 !important; grid-row: 2 !important; transition-property: transform, opacity !important; }
#floating-input-container #send-message.sending { background: #b63c30 !important; color: #fff !important; }
#floating-input-container #input-action-menu { position: absolute; bottom: calc(100% + 8px); top: auto; left: 0; }
#files-inline-preview { padding: 16px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, summary:focus-visible {
    outline: 2px solid var(--text-primary, #ddd);
    outline-offset: 3px;
}
.floating-input { font-size: max(16px, 1rem); }
.input-action-menu { max-height: min(70dvh, 440px); overflow-y: auto; }
.input-action-menu .mode-lock-indicator { display: none; }
.input-action-menu .is-locked .mode-lock-indicator { display: inline; }
.input-action-menu .is-unavailable { opacity: .55; }
#send-message .smart-voice-icon, #send-message .send-icon,
#send-message .stop-icon, #send-message .processing-icon,
#send-message .smart-voice-state-swap { display: none; }
#send-message.smart-voice-ready .smart-voice-icon,
#send-message.send-ready .send-icon,
#send-message.sending .stop-icon,
#send-message.plan-generating .processing-icon { display: inline-flex; }
#send-message.smart-voice-listening .smart-voice-state-swap,
#send-message.smart-voice-processing .smart-voice-state-swap { display: inline-flex; }
#send-message.smart-voice-processing .smart-composing-orb,
#send-message.smart-voice-listening .smart-processing-indicator { display: none; }
#send-message .intelligent-bars-icon { width: 26px; height: 26px; fill: currentColor; }
.smart-voice-state-swap { align-items: center; justify-content: center; }
.smart-processing-ring { display: block; width: 24px; height: 24px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: web-spin 1s linear infinite; }
@keyframes web-spin { to { transform: rotate(360deg); } }
.agent-question-card { max-width: 100%; margin-block: 16px; }
.reasoning-summary { min-height: 44px; padding: 8px 0; border: 0; background: transparent; color: var(--text-secondary); font: inherit; text-align: start; }
.home-pill { min-width: 44px; min-height: 44px; }
#new-task-modal {
    margin: 0; padding: 16px; border: 0; width: 100vw; height: 100dvh;
    max-width: none; max-height: none; box-sizing: border-box;
}
#new-task-modal .task-create-modal { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
#new-task-modal .modal-content { flex: 1; min-height: 0; max-height: none; }
#new-task-modal .modal-header, #new-task-modal .modal-footer { flex-shrink: 0; }
.session-item button.session-content { border: 0; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.agent-question-card input { flex-shrink: 0; }
.agent-question-card textarea { width: 100%; box-sizing: border-box; font-size: 16px; }
.past-session-header { flex-wrap: wrap; gap: 8px; }
.past-session-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.past-session-actions button { min-height: 44px; padding: 8px 10px; color: var(--text-primary); background: var(--bg-secondary, #252525); border: 1px solid var(--web-control-border); border-radius: 8px; }
.web-tool-dialog { position: fixed; inset: 0; margin: auto; width: min(520px, calc(100vw - 32px)); height: fit-content; box-sizing: border-box; max-height: calc(100dvh - 40px); overflow-y: auto; padding: 24px; color: var(--text-primary, #eee); background: var(--bg-primary, #171717); border: 1px solid var(--web-control-border); border-radius: 16px; }
.web-tool-dialog::backdrop { background: rgb(0 0 0 / .65); }
.web-tool-dialog h2 { font-size: 1.15rem; margin-top: 0; }
.web-tool-dialog p { font-size: .9rem; color: var(--text-secondary); }
.web-tool-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; margin-block: 16px; }
.web-tool-dialog label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9rem; }
.web-tool-dialog input { accent-color: var(--text-primary); }
.web-tool-dialog button { min-height: 44px; width: 100%; font: inherit; border-radius: 8px; border: 1px solid var(--web-control-border); padding: 8px; cursor: pointer; }
.web-vault-card { min-width: 0; padding: 16px; border: 1px solid var(--web-control-border); border-radius: 12px; }
.web-vault-card h3 { overflow-wrap: anywhere; font-size: 1rem; margin: 0 0 8px; }
.web-vault-card p, .web-usage-status, .web-usage-summary { color: var(--text-secondary); font-size: .875rem; }
.web-vault-actions, .web-usage-heading { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.web-vault-actions button, .web-usage-heading button, .web-usage-heading select,
.files-type-control select, #files-inline-preview > button {
    min-height: 44px; padding: 8px 12px; color: var(--text-primary); background: var(--bg-secondary, #252525);
    border: 1px solid var(--web-control-border); border-radius: 8px; cursor: pointer;
}
.web-vault-actions button:last-child { margin-inline-start: auto; }
#files-list { display: grid; gap: 12px; }
#files-list.files-preview-view { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
#files-inline-preview img, #files-inline-preview video { max-width: 100%; max-height: 50dvh; object-fit: contain; }
#files-inline-preview audio { max-width: 100%; }
#files-inline-preview pre { overflow: auto; max-height: 50dvh; white-space: pre-wrap; overflow-wrap: anywhere; }
.files-type-control { display: flex; align-items: center; gap: 12px; }
.web-usage-history { margin-top: 24px; padding-block: 20px; border-top: 1px solid var(--web-control-border); }
.web-usage-heading h3 { margin: 0 auto 0 0; }
.web-usage-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; border-bottom: 1px solid var(--web-control-border); margin-block: 20px; }
.web-usage-bar { flex: 1; min-width: 0; height: var(--usage-height); background: var(--text-primary, #ddd); opacity: .75; border-radius: 3px 3px 0 0; }
.web-usage-table-wrap { overflow-x: auto; }
.web-usage-history table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .85rem; }
.web-usage-history td, .web-usage-history th { padding: 8px; text-align: end; border-bottom: 1px solid var(--web-control-border); }
.web-usage-history th:first-child { text-align: start; }
.plan-output-card, .plan-output-editor, .plan-output-content { min-width: 0; max-width: 100%; }
.plan-output-content { overflow-wrap: anywhere; }
.plan-output-editor { box-sizing: border-box; width: 100%; min-height: 240px; font-size: 16px; }
.web-design-dialog { width: min(1200px, calc(100vw - 32px)); height: calc(100dvh - 48px); max-width: none; max-height: none; box-sizing: border-box; padding: 16px; border: 1px solid var(--web-control-border); border-radius: 16px; background: var(--bg-primary, #171717); color: var(--text-primary, #eee); }
.web-design-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
.web-design-dialog::backdrop { background: rgb(0 0 0 / .7); }
.web-design-header, .web-design-tools, .web-design-dialog form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.web-design-header h2 { margin: 0 auto 0 0; font-size: 1.1rem; }
.web-design-dialog button, .web-design-dialog select { min-height: 44px; padding: 8px 12px; background: var(--bg-secondary, #333); color: inherit; border: 1px solid var(--web-control-border); border-radius: 8px; }
.web-design-tools [role="status"] { font-size: .85rem; overflow-wrap: anywhere; }
.web-design-stage { flex: 1; min-height: 180px; overflow: auto; display: flex; justify-content: center; background: #fff; }
.web-design-stage iframe { border: 0; width: 100%; height: 100%; max-width: 100%; flex-shrink: 0; }
.web-design-dialog form label { flex: 1; min-width: min(100%, 240px); }
.web-design-dialog textarea { display: block; box-sizing: border-box; width: 100%; font: inherit; font-size: 16px; background: var(--bg-secondary, #333); color: inherit; border: 1px solid var(--web-control-border); border-radius: 8px; padding: 8px; }
@media (max-width: 1023px) {
    .floating-input-container, #floating-input-container { max-width: calc(100vw - 24px); }
    .top-bar-btn, .input-action-btn, .back-to-menu-btn { min-width: 44px; min-height: 44px; }
    .settings-full-panel { max-width: 100vw; max-height: 100dvh; }
    .project-workspace-sheet { max-height: 85dvh; }
    .message-content pre { max-width: 100%; overflow-x: auto; }
    .agent-question-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* The welcome area shares the chat's reserved composer space at every size. */
#floating-input-container.floating-input-container {
    position: fixed !important;
    left: 50% !important;
    top: auto !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    width: min(760px, calc(100vw - 32px)) !important;
}
#floating-input-container[data-composer-mode='standard'] .input-field {
    background: var(--input-bg, #151515) !important;
    border: 1px solid var(--web-control-border) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}
#floating-input-container[data-composer-mode='standard'] .input-field:focus-within { border-color: var(--text-secondary) !important; }
.welcome-container {
    box-sizing: border-box;
    top: 88px !important;
    bottom: var(--web-composer-clearance, 160px);
    left: 0 !important;
    width: 100%;
    max-width: none;
    transform: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    gap: 24px;
    padding: 24px 16px;
    overflow-y: auto;
    pointer-events: auto !important;
    scrollbar-width: thin;
}
.welcome-container.hidden { display: none; }
.welcome-content { width: min(100%, 760px); flex-shrink: 0; }
.welcome-heading { font-size: clamp(1.8rem, 3.4vw, 3rem); text-wrap: balance; overflow-wrap: anywhere; }
.welcome-container .home-pills-container { max-width: 760px; margin-top: 0; flex-shrink: 0; gap: 8px; }
.welcome-container .home-pill { box-shadow: none; backdrop-filter: none; font: inherit; font-size: .9rem; padding: 10px 16px; border-radius: 12px; }
.welcome-container .home-pill span { display: inline; }
.welcome-container .home-pill-content-panel { flex-shrink: 0; margin-top: 0; max-width: 760px; }
.welcome-container.panel-active .welcome-content, .welcome-container.panel-active .home-pills-container { display: none; }
.home-pill-content-body { max-height: min(380px, 45dvh); }
.prompt-starter-card, .session-pill-item { width: 100%; font: inherit; text-align: start; }
.web-tool-dialog label { padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.web-tool-dialog label:hover { background: var(--bg-secondary, #252525); }
.web-tool-dialog input { width: 18px; height: 18px; flex-shrink: 0; }
.web-tool-dialog button { background: var(--text-primary, #eee); color: var(--bg-primary, #171717); }
.web-tool-dialog p { line-height: 1.5; margin-block: 8px 16px; }
.web-tool-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.web-tool-dialog > h2, .web-tool-dialog > p, .web-tool-dialog > label, .web-tool-dialog > button { flex-shrink: 0; }
.web-tool-dialog .web-tool-options { min-height: 0; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.settings-close-btn {
    position: absolute; inset-block-start: 12px; inset-inline-end: 12px; z-index: 20;
    width: 44px; height: 44px; display: grid; place-items: center;
    border: 1px solid var(--web-control-border); border-radius: 10px;
    color: var(--text-primary, #eee); background: var(--bg-secondary, #252525); cursor: pointer;
}
.settings-account-nav { display: none; }
.settings-dialog-title { display: none; }
.profile-dropdown .settings-menu-item.selected { background: var(--bg-secondary, #252525) !important; box-shadow: inset 3px 0 var(--text-primary, #eee); }
.profile-dropdown .settings-menu-item { min-height: 44px; font-family: inherit; }
.profile-dropdown .panel-header, .desktop-account-right-header { padding-inline-end: 72px !important; }
.profile-dropdown .panel-content, .desktop-account-right-content { min-height: 0; scrollbar-width: thin; }
.profile-dropdown .profile-email { overflow-wrap: anywhere; }
.profile-dropdown .account-subscription-card { box-shadow: none; font-variant-numeric: tabular-nums; }
button:disabled { cursor: not-allowed; }
.template-select-btn, .pill-loading-state button { min-height: 44px; margin-top: 8px; padding: 8px 12px; border: 1px solid var(--web-control-border); border-radius: 8px; background: var(--bg-secondary, #252525); color: var(--text-primary, #eee); font: inherit; font-size: .8rem; cursor: pointer; }
.template-select-btn { width: 100%; }
.template-select-btn[aria-pressed="true"] { background: var(--text-primary, #eee); color: var(--bg-primary, #171717); }
.task-details-toggle { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--text-primary, #eee); cursor: pointer; }
.web-template-dialog { position: fixed; inset: 0; margin: auto; width: min(980px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--web-control-border); border-radius: 16px; background: var(--bg-primary); color: var(--text-primary); }
.web-template-dialog::backdrop { background: rgb(0 0 0 / .65); }
.web-template-dialog .ppt-preview-modal-panel { width: 100%; max-width: none; max-height: calc(100dvh - 42px); border: 0; border-radius: 0; box-shadow: none; }
.web-template-dialog .ppt-preview-modal-panel, .web-template-dialog .ppt-preview-modal-body { background: var(--bg-primary); }
.web-template-dialog .ppt-preview-modal-header h3, .web-template-dialog .close-ppt-preview-btn { color: var(--text-primary); }
.close-ppt-preview-btn { min-width: 44px; min-height: 44px; }
@media (min-width: 1024px) {
    #floating-input-container.floating-input-container { left: calc(50% + 28px) !important; width: min(760px, calc(100vw - 120px)) !important; }
    .welcome-container { left: 56px !important; width: calc(100% - 56px); top: 64px !important; }
    .settings-account-nav { display: flex; }
    .profile-dropdown { width: min(1040px, calc(100vw - 120px)) !important; height: min(640px, calc(100dvh - 64px)) !important; max-height: calc(100dvh - 64px) !important; }
}
@media (max-width: 1023px) {
    .settings-dialog-title { display: block; position: absolute; top: 24px; left: 20px; font-size: 1.1rem; color: var(--text-primary); }
    #profile-dropdown { position: fixed; top: 80px; right: 12px; max-height: calc(100dvh - 96px); max-width: calc(100vw - 24px); }
    .profile-dropdown .profile-settings-panel { padding-top: 64px; }
    .profile-dropdown .profile-settings-panel { display: flex; flex-direction: column; }
    .profile-dropdown .account-section { order: 1; margin-top: 24px; }
}
@media (max-width: 480px) {
    .welcome-container { gap: 20px; }
    .welcome-container .home-pill { font-size: .8rem; padding: 10px 12px; }
    .web-tool-dialog { padding: 20px; }
    .web-tool-options { grid-template-columns: 1fr; }
}
