/* Joshua responsive presentation, 2026-10-18. Existing forms and services. */
html { -webkit-text-size-adjust:100%; }
body.joshua-auth { font-family:system-ui,-apple-system,'Segoe UI',sans-serif!important; }
.joshua-auth, .joshua-auth * { box-sizing:border-box; }
body.joshua-auth { width:100%!important; min-width:0!important; height:auto!important; min-height:100vh!important; min-height:100dvh!important; overflow-x:hidden!important; overflow-y:auto!important; padding:32px 20px!important; align-items:center!important; }
.joshua-auth .box { width:100%!important; max-width:480px!important; margin:auto!important; padding:32px!important; }
.joshua-auth input, .joshua-auth textarea { font-size:16px!important; min-height:48px!important; }
.joshua-auth button, .joshua-auth .public-link { min-height:48px!important; font-size:16px!important; }
.joshua-auth input:focus-visible,.joshua-auth textarea:focus-visible { outline:2px solid #60a5fa; outline-offset:3px; }
.joshua-auth .public-back { min-height:44px; display:inline-flex; align-items:center; font-size:14px; }
.phone-new-chat,#workspace-toggle,#workspace-close,#composer-options-toggle,#responsive-scrim { display:none; }
body.joshua-chat #main,body.joshua-chat #app-shell,body.joshua-chat #chat-shell { min-width:0!important; min-height:0!important; }
body.joshua-chat .message-text { overflow-wrap:anywhere; }
body.joshua-chat .message-text pre,body.joshua-chat .message-text table { max-width:100%; overflow-x:auto; }
body.joshua-chat button:focus-visible,body.joshua-chat a:focus-visible { outline:2px solid #007565; outline-offset:3px; }
@media (min-width:768px) and (max-width:1199px) {
 body.joshua-chat { width:100%!important; height:100dvh!important; min-height:0!important; display:flex!important; overflow:hidden!important; }
 body.joshua-chat #sidebar { position:relative!important; visibility:visible!important; display:flex!important; flex:0 0 224px!important; width:224px!important; min-width:224px!important; height:100dvh!important; transform:none!important; left:auto!important; top:auto!important; }
 body.joshua-chat #main { flex:1 1 0!important; width:auto!important; max-width:none!important; height:100dvh!important; min-height:0!important; margin:0!important; padding:10px!important; }
 body.joshua-chat #top-nav { position:relative!important; flex-wrap:nowrap!important; min-height:60px!important; gap:8px!important; }
 body.joshua-chat #menu-toggle { display:none!important; }
 body.joshua-chat #tools-toggle { display:inline-flex!important; width:44px!important; height:44px!important; align-items:center!important; justify-content:center!important; }
 body.joshua-chat .top-tools { position:absolute!important; top:100%!important; left:0!important; right:0!important; display:none!important; width:100%!important; max-width:100%!important; flex-wrap:wrap!important; max-height:70dvh!important; overflow-y:auto; padding:14px!important; z-index:90!important; background:#fff!important; border:1px solid #dce3df!important; border-radius:18px!important; box-shadow:0 12px 36px #0f172a24!important; }
 body.joshua-chat .top-tools.open { display:flex!important; }
 body.joshua-chat .top-tools > form { display:flex!important; flex-direction:row!important; align-items:center!important; height:auto!important; padding:0!important; flex-wrap:wrap!important; gap:6px!important; min-width:0!important; max-width:100%!important; }
 body.joshua-chat .top-tools .model-preset-form { flex:1 1 100%!important; }
 body.joshua-chat .top-tools .console-select-wrap { min-width:0!important; max-width:100%!important; }
 body.joshua-chat .top-tools select { min-height:36px!important; font-size:14px!important; max-width:100%!important; }
 body.joshua-chat .top-tools .rename-input { width:auto!important; min-width:0!important; max-width:100%!important; height:38px!important; min-height:38px!important; padding:8px 12px!important; flex:1 1 120px!important; }
 body.joshua-chat #app-shell { flex:1 1 0!important; display:flex!important; overflow:hidden!important; }
 body.joshua-chat #chat-shell { flex:1 1 0!important; width:100%!important; display:flex!important; flex-direction:column!important; }
 body.joshua-chat #history { flex:1 1 0!important; overflow-y:auto!important; padding:18px 12px!important; }
 body.joshua-chat #input-area { flex:0 0 auto!important; width:100%!important; }
}
@media (max-width:1199px) {
 body.joshua-chat #workspace-toggle { display:inline-flex; min-height:44px; align-items:center; padding:8px 12px; border:1px solid #d7e0dc; border-radius:12px; background:#fff; color:#172033; font:inherit; }
 body.joshua-chat #right-panel { display:none!important; }
 body.joshua-chat.workspace-open #right-panel { display:block!important; position:fixed!important; inset:0 0 0 auto!important; width:min(92vw,380px)!important; max-width:100%!important; height:100dvh!important; z-index:151!important; overflow-y:auto!important; padding:18px 16px calc(18px + env(safe-area-inset-bottom))!important; box-shadow:-12px 0 40px #0f172a33; }
 body.joshua-chat.workspace-open #workspace-close { display:block; margin:0 0 16px auto; min-height:44px; padding:8px 14px; border:1px solid #cbd5e1; background:white; border-radius:12px; }
 body.joshua-chat.workspace-open #responsive-scrim { display:block; position:fixed; inset:0; z-index:150; border:0; background:#0f172a66; width:100%; height:100%; }
}
@media (max-width:767px), (max-height:500px) and (pointer:coarse) and (max-width:1023px) {
 body.joshua-auth { align-items:flex-start!important; padding:max(24px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom))!important; }
 .joshua-auth .box { width:100%!important; max-width:480px!important; padding:26px 22px!important; margin:0 auto!important; border-radius:24px!important; }
 .joshua-auth h1 { font-size:30px!important; line-height:1.15!important; }
 .joshua-auth p { font-size:15px!important; line-height:1.55!important; }
 .joshua-auth label { font-size:12px!important; }
 .joshua-auth .public-panel { padding:16px!important; }
 html:has(body.joshua-chat) { height:100%; overflow:hidden; }
 body.joshua-chat { display:block!important; width:100%!important; max-width:100%!important; height:var(--joshua-app-height,100dvh)!important; min-height:0!important; overflow:hidden!important; background:#fafbf9!important; }
 body.joshua-chat #main { display:flex!important; flex-direction:column!important; width:100%!important; max-width:100%!important; height:var(--joshua-app-height,100dvh)!important; min-height:0!important; margin:0!important; padding:0!important; gap:0!important; }
 body.joshua-chat #top-nav { display:flex!important; position:relative!important; flex:0 0 auto!important; min-height:64px!important; width:100%!important; padding:8px 12px!important; padding-top:max(8px,env(safe-area-inset-top))!important; gap:8px!important; border:0!important; border-radius:0!important; box-shadow:none!important; background:#fafbf9!important; }
 body.joshua-chat #top-left { display:flex!important; flex:1!important; gap:10px!important; min-width:0!important; }
 body.joshua-chat #menu-toggle,body.joshua-chat #tools-toggle,body.joshua-chat .phone-new-chat { display:inline-flex!important; flex:0 0 44px!important; width:44px!important; height:44px!important; min-height:44px!important; min-width:44px!important; align-items:center!important; justify-content:center!important; border:1px solid #dce3df!important; border-radius:14px!important; background:#fff!important; color:#243c35!important; font-size:22px!important; text-decoration:none; padding:0!important; }
 body.joshua-chat #tools-toggle { font-size:20px!important; }
 body.joshua-chat .brand-lockup-logo { display:none!important; }
 body.joshua-chat .brand-lockup-text span:first-child { display:block!important; font-size:19px!important; line-height:1.2!important; letter-spacing:.025em!important; }
 body.joshua-chat .brand-lockup-text span:last-child { display:none!important; }
 body.joshua-chat .top-tools { display:none!important; position:absolute!important; top:100%!important; left:12px!important; right:12px!important; width:auto!important; max-height:65dvh!important; overflow-y:auto!important; padding:14px!important; z-index:90!important; background:#fff!important; border:1px solid #dce3df!important; border-radius:18px!important; box-shadow:0 12px 36px #0f172a24!important; }
 body.joshua-chat .top-tools.open { display:flex!important; flex-wrap:wrap!important; gap:10px!important; }
 body.joshua-chat .top-tools.open form,body.joshua-chat .top-tools.open .model-preset-form { display:flex!important; width:100%!important; flex-wrap:wrap!important; gap:8px!important; }
 body.joshua-chat .top-tools.open select,body.joshua-chat .top-tools.open input,body.joshua-chat .top-tools.open button,body.joshua-chat .top-tools.open a { min-height:44px!important; max-width:100%!important; font-size:16px!important; }
 body.joshua-chat #sidebar { display:flex!important; position:fixed!important; inset:0 auto 0 0!important; width:min(86vw,320px)!important; min-width:0!important; max-width:86vw!important; height:var(--joshua-app-height,100dvh)!important; z-index:130!important; transform:translateX(-105%)!important; box-shadow:none!important; transition:transform .2s ease!important; }
 body.joshua-chat #sidebar.open { transform:translateX(0)!important; box-shadow:12px 0 40px #0f172a33!important; }
 body.joshua-chat #overlay.open { display:block!important; position:fixed!important; inset:0!important; z-index:120!important; background:#0f172a66!important; }
 body.joshua-chat #app-shell { display:flex!important; flex:1 1 0!important; width:100%!important; min-height:0!important; overflow:hidden!important; gap:0!important; }
 body.joshua-chat #chat-shell { display:flex!important; flex:1 1 0!important; flex-direction:column!important; width:100%!important; max-width:100%!important; min-height:0!important; overflow:hidden!important; border:0!important; border-radius:0!important; background:#fafbf9!important; }
 body.joshua-chat #history { flex:1 1 0!important; min-height:0!important; width:100%!important; overflow-y:auto!important; overscroll-behavior:contain; padding:16px 18px 22px!important; font-size:16px!important; }
 body.joshua-chat .message-row { width:100%!important; max-width:100%!important; display:block!important; margin:0 0 22px!important; }
 body.joshua-chat .message-card { width:100%!important; max-width:100%!important; padding:16px!important; box-shadow:none!important; border-radius:18px!important; }
 body.joshua-chat .message-text { font-size:16px!important; line-height:1.65!important; }
 body.joshua-chat .message-meta { flex-wrap:wrap!important; font-size:11px!important; }
 body.joshua-chat .message-avatar,body.joshua-chat .assistant-avatar,body.joshua-chat .user-avatar,body.joshua-chat .message-spacer { display:none!important; }
 body.joshua-chat .message-actions button { min-height:36px!important; }
 body.joshua-chat .empty-state { width:100%!important; max-width:100%!important; margin:24px auto!important; padding:28px 20px!important; }
 body.joshua-chat #input-area { position:relative!important; flex:0 0 auto!important; width:100%!important; margin:0!important; padding:8px 12px max(12px,env(safe-area-inset-bottom))!important; background:#fafbf9!important; border:0!important; }
 body.joshua-chat .input-container { width:100%!important; max-width:100%!important; padding:8px!important; border:1px solid #ced9d2!important; border-radius:26px!important; background:#fff!important; box-shadow:0 4px 18px #193a2410!important; }
 body.joshua-chat .input-row { display:flex!important; align-items:flex-end!important; gap:6px!important; min-width:0!important; }
 body.joshua-chat #chat-input { flex:1 1 0!important; width:0!important; min-width:0!important; min-height:48px!important; max-height:132px!important; padding:12px 2px!important; font-size:16px!important; line-height:1.5!important; resize:none!important; }
 body.joshua-chat .paperclip { display:inline-flex!important; width:44px!important; min-width:44px!important; height:48px!important; align-items:center!important; justify-content:center!important; font-size:22px!important; }
 body.joshua-chat .send-button { flex:0 0 44px!important; width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important; padding:0!important; margin-bottom:2px!important; border-radius:50%!important; font-size:24px!important; box-shadow:none!important; }
 body.joshua-chat .chat-input-footer { display:none!important; }
 body.joshua-chat #composer-options-toggle { display:inline-flex; min-height:44px; align-items:center; gap:6px; border:0; background:transparent; color:#53675d; font:500 13px/1.2 system-ui; padding:0 12px; }
 body.joshua-chat #chat-form .search-control-bar { display:none!important; }
 body.joshua-chat #chat-form.phone-composer-options-open .search-control-bar { display:flex!important; gap:8px!important; padding:8px!important; }
 body.joshua-chat #chat-form .search-chip,body.joshua-chat #chat-form .composer-model-wrap,body.joshua-chat #chat-form .composer-model-select,body.joshua-chat #chat-form summary { min-height:44px!important; font-size:14px!important; }
 body.joshua-chat #chat-form .composer-tool-placeholder { display:none!important; }

 body.joshua-chat .empty-state { margin:12px auto!important; padding:24px 18px!important; }
 body.joshua-chat .empty-state h1 { font-size:23px!important; line-height:1.2!important; margin:0 0 8px!important; }
 body.joshua-chat .empty-state > p { font-size:14px!important; margin:0!important; }
 body.joshua-chat .empty-state-logo { width:96px!important; max-width:40%!important; height:auto!important; margin:20px auto!important; }
 body.joshua-chat .empty-state-info { font-size:11px!important; line-height:1.5!important; }
 body.joshua-chat #chat-input { overflow-y:auto!important; }
 body.joshua-chat .top-tools.open { overflow-x:hidden!important; flex-direction:column!important; flex-wrap:nowrap!important; align-items:stretch!important; }
 body.joshua-chat .top-tools > *,body.joshua-chat .top-tools.open form { min-width:0!important; max-width:100%!important; width:100%!important; flex-shrink:0!important; }
 body.joshua-chat .top-tools .console-select-wrap { width:100%!important; min-width:0!important; }
 body.joshua-chat .top-tools .console-select { width:100%!important; min-width:0!important; }
 body.joshua-chat .top-tools .rename-input { min-width:0!important; width:100%!important; }
}
@media (prefers-reduced-motion:reduce) { body.joshua-chat #sidebar { transition:none!important; } }

/* Phone fallback for wide virtual viewports, with pinch zoom left available. */

 html[data-joshua-layout="phone"] body.joshua-auth { align-items:flex-start!important; padding:max(24px,env(safe-area-inset-top)) 16px max(24px,env(safe-area-inset-bottom))!important; }
 html[data-joshua-layout="phone"] .joshua-auth .box { width:100%!important; max-width:480px!important; padding:26px 22px!important; margin:0 auto!important; border-radius:24px!important; }
 html[data-joshua-layout="phone"] .joshua-auth h1 { font-size:30px!important; line-height:1.15!important; }
 html[data-joshua-layout="phone"] .joshua-auth p { font-size:15px!important; line-height:1.55!important; }
 html[data-joshua-layout="phone"] .joshua-auth label { font-size:12px!important; }
 html[data-joshua-layout="phone"] .joshua-auth .public-panel { padding:16px!important; }
 html[data-joshua-layout="phone"]:has(body.joshua-chat) { height:100%; overflow:hidden; }
 html[data-joshua-layout="phone"] body.joshua-chat { display:block!important; width:100%!important; max-width:100%!important; height:var(--joshua-app-height,100dvh)!important; min-height:0!important; overflow:hidden!important; background:#fafbf9!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #main { display:flex!important; flex-direction:column!important; width:100%!important; max-width:100%!important; height:var(--joshua-app-height,100dvh)!important; min-height:0!important; margin:0!important; padding:0!important; gap:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #top-nav { display:flex!important; position:relative!important; flex:0 0 auto!important; min-height:64px!important; width:100%!important; padding:8px 12px!important; padding-top:max(8px,env(safe-area-inset-top))!important; gap:8px!important; border:0!important; border-radius:0!important; box-shadow:none!important; background:#fafbf9!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #top-left { display:flex!important; flex:1!important; gap:10px!important; min-width:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #menu-toggle,html[data-joshua-layout="phone"] body.joshua-chat #tools-toggle,html[data-joshua-layout="phone"] body.joshua-chat .phone-new-chat { display:inline-flex!important; flex:0 0 44px!important; width:44px!important; height:44px!important; min-height:44px!important; min-width:44px!important; align-items:center!important; justify-content:center!important; border:1px solid #dce3df!important; border-radius:14px!important; background:#fff!important; color:#243c35!important; font-size:22px!important; text-decoration:none; padding:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #tools-toggle { font-size:20px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .brand-lockup-logo { display:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .brand-lockup-text span:first-child { display:block!important; font-size:19px!important; line-height:1.2!important; letter-spacing:.025em!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .brand-lockup-text span:last-child { display:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools { display:none!important; position:absolute!important; top:100%!important; left:12px!important; right:12px!important; width:auto!important; max-height:65dvh!important; overflow-y:auto!important; padding:14px!important; z-index:90!important; background:#fff!important; border:1px solid #dce3df!important; border-radius:18px!important; box-shadow:0 12px 36px #0f172a24!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open { display:flex!important; flex-wrap:wrap!important; gap:10px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open form,html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open .model-preset-form { display:flex!important; width:100%!important; flex-wrap:wrap!important; gap:8px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open select,html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open input,html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open button,html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open a { min-height:44px!important; max-width:100%!important; font-size:16px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #sidebar { display:flex!important; position:fixed!important; inset:0 auto 0 0!important; width:min(86vw,320px)!important; min-width:0!important; max-width:86vw!important; height:var(--joshua-app-height,100dvh)!important; z-index:130!important; transform:translateX(-105%)!important; box-shadow:none!important; transition:transform .2s ease!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #sidebar.open { transform:translateX(0)!important; box-shadow:12px 0 40px #0f172a33!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #overlay.open { display:block!important; position:fixed!important; inset:0!important; z-index:120!important; background:#0f172a66!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #app-shell { display:flex!important; flex:1 1 0!important; width:100%!important; min-height:0!important; overflow:hidden!important; gap:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-shell { display:flex!important; flex:1 1 0!important; flex-direction:column!important; width:100%!important; max-width:100%!important; min-height:0!important; overflow:hidden!important; border:0!important; border-radius:0!important; background:#fafbf9!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #history { flex:1 1 0!important; min-height:0!important; width:100%!important; overflow-y:auto!important; overscroll-behavior:contain; padding:16px 18px 22px!important; font-size:16px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .message-row { width:100%!important; max-width:100%!important; display:block!important; margin:0 0 22px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .message-card { width:100%!important; max-width:100%!important; padding:16px!important; box-shadow:none!important; border-radius:18px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .message-text { font-size:16px!important; line-height:1.65!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .message-meta { flex-wrap:wrap!important; font-size:11px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .message-avatar,html[data-joshua-layout="phone"] body.joshua-chat .assistant-avatar,html[data-joshua-layout="phone"] body.joshua-chat .user-avatar,html[data-joshua-layout="phone"] body.joshua-chat .message-spacer { display:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .message-actions button { min-height:36px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .empty-state { width:100%!important; max-width:100%!important; margin:24px auto!important; padding:28px 20px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #input-area { position:relative!important; flex:0 0 auto!important; width:100%!important; margin:0!important; padding:8px 12px max(12px,env(safe-area-inset-bottom))!important; background:#fafbf9!important; border:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .input-container { width:100%!important; max-width:100%!important; padding:8px!important; border:1px solid #ced9d2!important; border-radius:26px!important; background:#fff!important; box-shadow:0 4px 18px #193a2410!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .input-row { display:flex!important; align-items:flex-end!important; gap:6px!important; min-width:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-input { flex:1 1 0!important; width:0!important; min-width:0!important; min-height:48px!important; max-height:132px!important; padding:12px 2px!important; font-size:16px!important; line-height:1.5!important; resize:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .paperclip { display:inline-flex!important; width:44px!important; min-width:44px!important; height:48px!important; align-items:center!important; justify-content:center!important; font-size:22px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .send-button { flex:0 0 44px!important; width:44px!important; min-width:44px!important; height:44px!important; min-height:44px!important; padding:0!important; margin-bottom:2px!important; border-radius:50%!important; font-size:24px!important; box-shadow:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .chat-input-footer { display:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #composer-options-toggle { display:inline-flex; min-height:44px; align-items:center; gap:6px; border:0; background:transparent; color:#53675d; font:500 13px/1.2 system-ui; padding:0 12px; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-form .search-control-bar { display:none!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-form.phone-composer-options-open .search-control-bar { display:flex!important; gap:8px!important; padding:8px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-form .search-chip,html[data-joshua-layout="phone"] body.joshua-chat #chat-form .composer-model-wrap,html[data-joshua-layout="phone"] body.joshua-chat #chat-form .composer-model-select,html[data-joshua-layout="phone"] body.joshua-chat #chat-form summary { min-height:44px!important; font-size:14px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-form .composer-tool-placeholder { display:none!important; }

 html[data-joshua-layout="phone"] body.joshua-chat .empty-state { margin:12px auto!important; padding:24px 18px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .empty-state h1 { font-size:23px!important; line-height:1.2!important; margin:0 0 8px!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .empty-state > p { font-size:14px!important; margin:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .empty-state-logo { width:96px!important; max-width:40%!important; height:auto!important; margin:20px auto!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .empty-state-info { font-size:11px!important; line-height:1.5!important; }
 html[data-joshua-layout="phone"] body.joshua-chat #chat-input { overflow-y:auto!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open { overflow-x:hidden!important; flex-direction:column!important; flex-wrap:nowrap!important; align-items:stretch!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools > *,html[data-joshua-layout="phone"] body.joshua-chat .top-tools.open form { min-width:0!important; max-width:100%!important; width:100%!important; flex-shrink:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools .console-select-wrap { width:100%!important; min-width:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools .console-select { width:100%!important; min-width:0!important; }
 html[data-joshua-layout="phone"] body.joshua-chat .top-tools .rename-input { min-width:0!important; width:100%!important; }

html[data-joshua-scaled-phone="true"] body.joshua-chat { zoom:var(--joshua-phone-scale); width:100%!important; max-width:none!important; height:calc(var(--joshua-app-height,100dvh) / var(--joshua-phone-scale))!important; }
html[data-joshua-scaled-phone="true"] body.joshua-chat #main { height:100%!important; }
html[data-joshua-scaled-phone="true"] body.joshua-chat #sidebar { height:calc(var(--joshua-app-height,100dvh) / var(--joshua-phone-scale))!important; }
html[data-joshua-scaled-phone="true"] body.joshua-chat #sidebar { width:min(86%,320px)!important; max-width:86%!important; }
html[data-joshua-scaled-phone="true"] body.joshua-chat.workspace-open #right-panel { width:min(92%,380px)!important; height:calc(var(--joshua-app-height,100dvh) / var(--joshua-phone-scale))!important; }
html[data-joshua-scaled-phone="true"] body.joshua-auth { zoom:var(--joshua-phone-scale); width:100%!important; min-height:calc(100vh / var(--joshua-phone-scale))!important; }
.layout-mode-button { min-height:44px; padding:8px 12px; border:1px solid #d7e0dc; border-radius:12px; background:#fff; color:#172033; font:inherit; cursor:pointer; }

/* Settings and close controls: presentation only. */
.phone-options-header { display:none; }
body.joshua-settings *,body.joshua-settings *::before,body.joshua-settings *::after { box-sizing:border-box; }
body.joshua-settings .settings-grid > *,body.joshua-settings .settings-form-grid > * { min-width:0; }
body.joshua-settings .settings-card { scroll-margin-top:90px; }
body.joshua-settings .settings-back { gap:8px; }
body.joshua-settings .settings-back span { font-size:24px;line-height:1; }
@media(max-width:1199px) {
 body.joshua-chat .phone-options-header { display:flex!important;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:1;background:#fff;padding:0 0 8px;gap:12px; }
 body.joshua-chat #options-close { width:44px!important;height:44px!important;min-height:44px;font-size:28px;border:1px solid #d7e0dc;border-radius:12px;background:#fff;color:#172033;cursor:pointer;flex:0 0 44px; }
}
@media(max-width:767px),(max-height:500px) and (pointer:coarse) and (max-width:1023px) {

body.joshua-settings { display:block!important; width:100%!important;min-width:0!important;height:auto!important;overflow:auto!important;padding:12px!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important;font-size:16px; }
body.joshua-settings .settings-wrap { width:100%;max-width:100%; }
body.joshua-settings .settings-topbar { position:sticky;top:0;z-index:20;display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:14px;margin-bottom:12px;border-radius:16px;background:#fff; }
body.joshua-settings .settings-title { font-size:18px; }
body.joshua-settings .settings-subtitle { display:none; }
body.joshua-settings .settings-actions { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
body.joshua-settings .settings-actions .settings-back { grid-column:1/-1;grid-row:1; }
body.joshua-settings .settings-button,body.joshua-settings .settings-link-button { min-height:44px;font-size:14px;line-height:1.3;padding:10px 12px; }
body.joshua-settings .settings-menu { flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding:8px;gap:8px; }
body.joshua-settings .settings-menu a { flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;font-size:14px;white-space:nowrap; }
body.joshua-settings .settings-grid,body.joshua-settings .settings-form-grid,body.joshua-settings .settings-behavior-row { grid-template-columns:minmax(0,1fr)!important;gap:12px; }
body.joshua-settings .settings-card { padding:16px;border-radius:16px;scroll-margin-top:190px; }
body.joshua-settings .settings-card h2 { font-size:20px; }
body.joshua-settings .settings-card p,body.joshua-settings .settings-meta-item,body.joshua-settings .settings-file-note,body.joshua-settings .settings-behavior-desc { font-size:14px;overflow-wrap:anywhere; }
body.joshua-settings label { font-size:12px!important; }
body.joshua-settings input,body.joshua-settings textarea,body.joshua-settings select { font-size:16px!important;min-height:44px;max-width:100%; }
body.joshua-settings textarea { min-height:160px!important; }
body.joshua-settings .settings-behavior-row { align-items:stretch; }
body.joshua-settings .settings-memory-box { overflow-wrap:anywhere; }
body.joshua-settings table { font-size:14px!important; }
body.joshua-chat .phone-options-header { display:flex!important;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:1;background:#fff;padding:0 0 8px;gap:12px; }
body.joshua-chat #options-close { width:44px!important;height:44px!important;min-height:44px;font-size:28px;border:1px solid #d7e0dc;border-radius:12px;background:#fff;color:#172033;cursor:pointer;flex:0 0 44px; }
}

html[data-joshua-layout="phone"] body.joshua-settings { display:block!important; width:100%!important;min-width:0!important;height:auto!important;overflow:auto!important;padding:12px!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important;font-size:16px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-wrap { width:100%;max-width:100%; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-topbar { position:sticky;top:0;z-index:20;display:flex;flex-direction:column;align-items:stretch;gap:12px;padding:14px;margin-bottom:12px;border-radius:16px;background:#fff; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-title { font-size:18px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-subtitle { display:none; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-actions { display:grid;grid-template-columns:1fr 1fr;gap:8px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-actions .settings-back { grid-column:1/-1;grid-row:1; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-button,html[data-joshua-layout="phone"] body.joshua-settings .settings-link-button { min-height:44px;font-size:14px;line-height:1.3;padding:10px 12px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-menu { flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding:8px;gap:8px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-menu a { flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;font-size:14px;white-space:nowrap; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-grid,html[data-joshua-layout="phone"] body.joshua-settings .settings-form-grid,html[data-joshua-layout="phone"] body.joshua-settings .settings-behavior-row { grid-template-columns:minmax(0,1fr)!important;gap:12px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-card { padding:16px;border-radius:16px;scroll-margin-top:190px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-card h2 { font-size:20px; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-card p,html[data-joshua-layout="phone"] body.joshua-settings .settings-meta-item,html[data-joshua-layout="phone"] body.joshua-settings .settings-file-note,html[data-joshua-layout="phone"] body.joshua-settings .settings-behavior-desc { font-size:14px;overflow-wrap:anywhere; }
html[data-joshua-layout="phone"] body.joshua-settings label { font-size:12px!important; }
html[data-joshua-layout="phone"] body.joshua-settings input,html[data-joshua-layout="phone"] body.joshua-settings textarea,html[data-joshua-layout="phone"] body.joshua-settings select { font-size:16px!important;min-height:44px;max-width:100%; }
html[data-joshua-layout="phone"] body.joshua-settings textarea { min-height:160px!important; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-behavior-row { align-items:stretch; }
html[data-joshua-layout="phone"] body.joshua-settings .settings-memory-box { overflow-wrap:anywhere; }
html[data-joshua-layout="phone"] body.joshua-settings table { font-size:14px!important; }
html[data-joshua-layout="phone"] body.joshua-chat .phone-options-header { display:flex!important;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:1;background:#fff;padding:0 0 8px;gap:12px; }
html[data-joshua-layout="phone"] body.joshua-chat #options-close { width:44px!important;height:44px!important;min-height:44px;font-size:28px;border:1px solid #d7e0dc;border-radius:12px;background:#fff;color:#172033;cursor:pointer;flex:0 0 44px; }

html[data-joshua-scaled-phone="true"] body.joshua-settings { zoom:var(--joshua-phone-scale);width:100%!important;min-height:calc(100vh / var(--joshua-phone-scale))!important; }
