/* AskByte Studio: shared surfaces, navigation and productive tools. */
.askbyte-logo { display:block; object-fit:contain; flex-shrink:0; }
.avatar.bot { background:transparent; }
.avatar.bot .askbyte-logo { width:100%; height:100%; }
.studio-draft-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 4px; color:var(--text-faint); font-size:11px; }
.studio-draft-bar .msg-action { flex-shrink:0; color:var(--accent); }
.studio-draft-item,.studio-assistant-preview { padding:16px; margin:12px 0; border:1px solid var(--border-soft); background:var(--accent-soft); border-radius:14px; overflow-wrap:anywhere; }
.studio-draft-item p,.studio-assistant-preview p { white-space:pre-wrap; color:var(--text-dim); line-height:1.6; margin:8px 0; }
.studio-assistant-preview small { color:var(--text-faint); }
html[data-theme="dark"] {
  --bg-base:#101112; --panel:#171819; --panel-2:#1d1e20; --panel-3:#27282b;
  --border:#37383a; --border-soft:#2a2b2d; --text:#f2eee7; --text-dim:#bbb7b0;
  --text-faint:#96928c; --accent:#d8b985; --accent-2:#ecd6ae;
  --accent-soft:rgba(216,185,133,.10); --accent-glow:rgba(216,185,133,.16);
  --user-bubble:#29261f;
}
html[data-theme="light"] { --accent:#88632f; --accent-2:#735021; --accent-soft:rgba(136,99,47,.08); }
.app { background:radial-gradient(ellipse at 65% 0%,var(--accent-soft),transparent 55%); }
/* Keep overflowing content reachable above the fold, including short viewports. */
.main { min-height:0; }
html { --safe-area-top:env(safe-area-inset-top,0px); --safe-area-bottom:env(safe-area-inset-bottom,0px); }
html[data-device="mobile"] body:not(.landing-open) { overflow:hidden; }
html[data-device="mobile"] body:not(.landing-open) .app {
  position:fixed; left:0; right:0; top:var(--mobile-viewport-top,0px); bottom:auto;
  width:100%; height:var(--mobile-viewport-height,100dvh); min-height:0; max-height:var(--mobile-viewport-height,100dvh);
  overflow:hidden;
}
html[data-device="desktop"] .app { min-width:0; }
.messages { min-height:0; overflow-anchor:none; }
.messages > * { flex-shrink:0; }
.messages .empty-state { height:auto; min-height:0; flex:0 0 auto; width:100%; margin-block:auto; justify-content:flex-start; }
.topbar,.composer-wrap { flex-shrink:0; }
.composer-wrap { max-height:55dvh; overflow-y:auto; }
.agent-bar,.agent-actions,.msg-actions { flex-wrap:wrap; overflow:visible; }
.agent-chip,.quick-action { white-space:normal; }
.mobile-composer-tools { display:none; }
.desktop-install-dialog { width:min(480px,calc(100% - 32px)); margin:auto; max-height:85dvh; padding:28px; border:1px solid var(--border); border-radius:20px; background:var(--panel); color:var(--text); }
.desktop-install-dialog::backdrop { background:#0008; }
.desktop-install-dialog p { line-height:1.6; color:var(--text-dim); margin:16px 0; }
[data-desktop-install][hidden] { display:none!important; }
#mobileSuggestionsDialog { width:min(480px,calc(100% - 24px)); max-height:80dvh; margin:auto; padding:20px; border:1px solid var(--border); border-radius:20px; background:var(--panel); color:var(--text); }
#mobileSuggestionsDialog::backdrop { background:#0008; }
.mobile-sheet-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.mobile-sheet-heading h2 { font-size:20px; margin:0; }
.mobile-suggestion-grid { display:grid; gap:8px; }
.mobile-suggestion-grid button { min-height:48px; white-space:normal; text-align:left; }
html[data-device="mobile"] .agent-bar,
html[data-device="mobile"] .agent-actions { display:none!important; }
html[data-device="mobile"] .agent-bar.visible ~ .mobile-composer-tools { display:flex; align-items:center; gap:8px; margin:0 auto 8px; max-width:740px; }
.mobile-composer-tools label { font-size:12px; color:var(--text-dim); }
.mobile-composer-tools select,.mobile-composer-tools button { min-height:44px; min-width:0; border:1px solid var(--border); border-radius:12px; background:var(--panel); color:var(--text); padding:8px 10px; font:inherit; font-size:14px; }
.mobile-composer-tools select { flex:1; font-size:16px; }
html[data-device="mobile"] .mobile-composer-tools { flex-wrap:wrap; }
.mobile-composer-tools #mobileModel { flex-basis:100%; }
html[data-device="mobile"] .composer { display:grid; grid-template-columns:repeat(4,44px) minmax(0,1fr) 44px; gap:4px; padding:8px; }
html[data-device="mobile"] .composer[style*="flex"] { display:grid!important; }
html[data-device="mobile"] .composer-wrap { display:flex; flex-direction:column; max-height:calc(var(--mobile-viewport-height,100dvh) - var(--mobile-header-height,56px) - 70px); overflow-y:auto; padding-bottom:calc(12px + var(--safe-area-bottom)); }
html[data-device="mobile"][data-keyboard="open"] .composer-wrap { padding-bottom:8px; }
html[data-device="mobile"] .composer-wrap > * { flex-shrink:0; }
html[data-device="mobile"] .composer-details { flex:0 1 auto; min-height:0; max-height:20dvh; overflow-y:auto; }
html[data-device="mobile"] .composer,html[data-device="mobile"] .mobile-composer-tools { width:100%; }
.image-preview:empty { display:none; }
html[data-device="mobile"] .composer textarea { grid-column:1/-1; grid-row:1; width:100%; min-width:0; padding:4px; max-height:clamp(37px,calc(var(--mobile-viewport-height,100dvh) * .18),100px); }
html[data-device="mobile"] .composer .icon-btn { width:44px; height:44px; min-width:44px; }
html[data-device="mobile"] #sendBtn,html[data-device="mobile"] #stopBtn { grid-column:6; grid-row:2; }
html[data-device="mobile"] .msg-actions { flex-wrap:wrap; overflow:visible; gap:6px; }
html[data-device="mobile"] .msg-action { min-height:44px; white-space:normal; }
html[data-device="mobile"] .active-context { flex-wrap:wrap; overflow:visible; }
html[data-device="mobile"] .ctx-chip { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
html[data-device="mobile"] .menu-toggle { width:44px; height:44px; top:calc(var(--mobile-viewport-top,0px) + 6px + var(--safe-area-top)); }
html[data-device="mobile"] .topbar { min-height:56px; padding:calc(8px + var(--safe-area-top)) 12px 8px 64px; }
html[data-device="mobile"] .studio-draft-bar { gap:6px; padding:2px 0; }
html[data-device="mobile"] .studio-draft-bar > span { min-width:0; overflow-wrap:anywhere; }
html[data-device="mobile"] .sidebar { top:var(--mobile-viewport-top,0px); bottom:auto; height:var(--mobile-viewport-height,100dvh); padding-top:calc(16px + var(--safe-area-top)); padding-bottom:calc(16px + var(--safe-area-bottom)); overflow-y:auto; }
html[data-device="mobile"] .sidebar > * { flex-shrink:0; }
html[data-device="mobile"] .sidebar .chat-list { min-height:80px; }
.memory-box { max-height:calc(100dvh - 40px); overflow-y:auto; }
.sidebar-footer::before { content:var(--studio-label,"DEIN STUDIO") !important; }
.sidebar { background:var(--panel); padding:20px 14px; }
.sidebar-footer::before { content:"DEIN STUDIO"; display:block; font-size:10px; font-weight:650; letter-spacing:.18em; color:var(--text-faint); padding:10px 8px; }
.sidebar-footer > div { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:6px!important; }
.sidebar-footer .jarvis-btn { display:flex; align-items:center; justify-content:flex-start; gap:9px; min-height:43px; padding:10px!important; width:100%; border:1px solid transparent; background:transparent; border-radius:10px; font-size:11px; }
.sidebar-footer > div > .jarvis-btn:last-child { grid-column:auto; }
.sidebar-footer .jarvis-btn:hover { border-color:var(--border); background:var(--accent-soft); color:var(--accent); transform:none; }
.sidebar-footer .icon { color:var(--accent); flex-shrink:0; }
.new-chat-btn { border-radius:11px; box-shadow:none; }
.topbar { border-bottom-color:var(--border-soft); }
.hero-title { letter-spacing:-.055em!important; font-weight:500!important; }
.hero-kicker { letter-spacing:.2em!important; font-size:10px!important; }
.empty-icon { background:var(--accent-soft)!important; box-shadow:none!important; border:1px solid var(--border)!important; }
.empty-icon svg { color:var(--accent); }
.starter-card { border-radius:14px; box-shadow:none; background:var(--panel); transition:background .18s,border-color .18s; }
.starter-card:hover { background:var(--accent-soft); transform:translateY(-2px); border-color:var(--accent); }
.starter-card .icon { background:transparent; color:var(--accent); }
.btn-primary { background:var(--accent); color:var(--bg-base); border:1px solid transparent; box-shadow:none; border-radius:10px; font-weight:650; }
html[data-theme="light"] .btn-primary { color:white; }
.btn-primary:hover { background:var(--accent-2); box-shadow:0 5px 20px var(--accent-glow); }
.btn-primary::before { display:none; }
.btn-primary:hover { animation:none; }
.memory-overlay { backdrop-filter:blur(12px); background:rgba(0,0,0,.58); padding:20px; }
.memory-box { background:var(--panel); border:1px solid var(--border); border-radius:22px; box-shadow:0 30px 100px #0005; padding:32px; }
.memory-box h2 { font-weight:550; letter-spacing:-.035em; padding-right:22px; }
.memory-box .sub { line-height:1.65; color:var(--text-dim); }
#workspaceOverlay .memory-box,#goalsOverlay .memory-box,#brainOverlay .memory-box,#autopilotOverlay .memory-box { max-width:740px!important; }
.studio-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:18px 0; }
.studio-toolbar input { flex:1; min-width:160px; }
.studio-input,.studio-field input,.studio-field textarea,.studio-field select { width:100%; border:1px solid var(--border); border-radius:10px; background:var(--panel-2); color:var(--text); padding:12px 14px; font:inherit; font-size:13px; }
.studio-field textarea { min-height:125px; resize:vertical; line-height:1.6; }
.studio-field { display:grid; gap:8px; margin:18px 0; color:var(--text-dim); font-size:12px; font-weight:550; }
.studio-field small { font-weight:400; line-height:1.5; color:var(--text-faint); }
.studio-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.studio-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; flex-wrap:wrap; }
.studio-error { color:#e79d91; font-size:13px; line-height:1.5; }
.login-domain-link { display:block; margin-top:12px; color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
:is(#consentDialog, #checkoutConsentDialog) { margin:auto; width:min(580px,calc(100vw - 28px)); max-height:calc(100dvh - 28px); overflow-y:auto; padding:32px; border:1px solid var(--border); border-radius:24px; background:var(--panel); color:var(--text); box-shadow:0 30px 100px #0006; }
:is(#consentDialog, #checkoutConsentDialog)::backdrop { background:rgba(0,0,0,.78); backdrop-filter:blur(10px); }
:is(#consentDialog, #checkoutConsentDialog) h1 { margin:0 0 12px; font-size:32px; font-weight:550; letter-spacing:-.04em; }
:is(#consentDialog, #checkoutConsentDialog) h2 { margin:24px 0 16px; }
#consentTitle:focus,#consentDocumentTitle:focus { outline:none; }
.consent-intro,.consent-check { font-size:14px; line-height:1.6; }
.consent-intro,.consent-small { color:var(--text-dim); }
.consent-links { display:flex; gap:8px; flex-wrap:wrap; margin:22px 0; }
.consent-links button { border:1px solid var(--border); border-radius:9px; background:var(--panel-2); color:var(--accent); font:inherit; font-size:12px; padding:10px 12px; cursor:pointer; }
.consent-check { display:flex; align-items:flex-start; gap:12px; margin:16px 0; cursor:pointer; }
.consent-check input { accent-color:var(--accent); width:18px; height:18px; flex-shrink:0; margin-top:3px; }
.consent-storage { background:var(--accent-soft); border:1px solid var(--border); border-radius:12px; padding:15px; margin-top:22px; font-size:12px; line-height:1.65; }
.consent-storage p { color:var(--text-dim); margin:5px 0 0; }
.consent-small { font-size:11px; line-height:1.6; margin:16px 0; }
.lp-language { display:flex; flex-wrap:wrap; gap:6px; margin-top:18px; }
.lp-language button { border:1px solid var(--border); border-radius:8px; background:transparent; color:var(--text-dim); font:inherit; font-size:12px; padding:6px 11px; cursor:pointer; }
.lp-language button:hover { color:var(--text); border-color:var(--accent); }
.lp-language button[aria-current="true"] { color:var(--accent); border-color:var(--accent); background:var(--accent-soft); }
.lp-language.in-header { margin:0 10px 0 auto; gap:2px; flex-wrap:nowrap; }
.lp-language.in-header button { padding:5px 7px; font-size:11px; letter-spacing:.04em; border-color:transparent; }
.lp-language.in-header button:hover { border-color:var(--border); }
/* The phone header has no room; the footer copy covers that case. */
@media(max-width:820px) { .lp-language.in-header { display:none; } }
.legal-language-note { background:var(--accent-soft); border:1px solid var(--border); border-radius:10px; padding:12px 14px; margin:0 0 18px; font-size:12px; line-height:1.6; color:var(--text-dim); }
.consent-actions { display:flex; flex-direction:column; gap:8px; }
.consent-actions .btn-primary { width:100%; padding:13px 18px; }
.consent-actions .btn-ghost { width:100%; padding:11px 18px; font-size:13px; color:var(--text-dim); }
@media(max-width:640px) { #consentDialog { padding:24px 20px; border-radius:18px; } }
#consentForm > .btn-primary { width:100%; padding:13px 18px; }
@media(max-width:640px) { :is(#consentDialog, #checkoutConsentDialog) { padding:24px 20px; border-radius:18px; } }
.project-sources { margin-top:18px; border:1px solid var(--border); border-radius:12px; padding:12px 16px; font-size:12px; }
.project-sources summary { cursor:pointer; color:var(--accent); }
.project-sources article { margin-top:16px; }
.project-sources p { white-space:pre-wrap; color:var(--text-dim); line-height:1.65; }
.model-health { font-size:12px; color:var(--text-dim); line-height:1.7; }
#studioResumeRuns { margin-top:24px; }
.studio-eyebrow { font-size:10px; letter-spacing:.18em; text-transform:uppercase; color:var(--accent); margin-bottom:12px; }
.studio-tabs { display:flex; gap:5px; flex-wrap:wrap; padding:5px; background:var(--panel-2); border:1px solid var(--border-soft); border-radius:12px; }
.studio-tabs button { flex:1; border:0; border-radius:8px; padding:10px 14px; color:var(--text-dim); background:transparent; cursor:pointer; font:inherit; font-size:12px; white-space:nowrap; }
.studio-tabs button[aria-pressed="true"] { background:var(--panel-3); color:var(--accent); box-shadow:0 1px 5px #0002; }
.studio-templates { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:18px 0; }
.studio-template { padding:18px 14px; text-align:left; border:1px solid var(--border); border-radius:12px; background:var(--panel-2); color:var(--text); cursor:pointer; }
.studio-template:hover { border-color:var(--accent); }
.studio-template strong { display:block; font-size:13px; margin-bottom:8px; }
.studio-template span { font-size:11px; color:var(--text-dim); line-height:1.6; }
.ws-item,.goal-card { border:1px solid var(--border); background:var(--panel-2); border-radius:14px; padding:18px; margin-bottom:12px; }
.ws-item { gap:12px; }
.ws-info { min-width:0; }
.ws-info strong,.goal-head strong { overflow-wrap:anywhere; }
.ws-info span { line-height:1.6; }
.ws-actions { flex-wrap:wrap; justify-content:flex-end; }
.goal-head { gap:10px; align-items:flex-start; }
.goal-head strong { flex:1; font-size:15px; font-weight:550; }
.goal-bar { height:4px; margin:18px 0 10px; }
.goal-fill { background:var(--accent); transition:width .25s; }
.goal-step { padding:9px 0; align-items:flex-start; line-height:1.5; }
.goal-step input { accent-color:var(--accent); margin-top:3px; }
.studio-meta { display:flex; gap:8px; flex-wrap:wrap; margin:9px 0; font-size:11px; color:var(--text-dim); }
.studio-pill { padding:4px 8px; background:var(--accent-soft); border-radius:6px; color:var(--accent); }
.studio-overdue { color:#e79d91; }
[hidden] { display:none!important; }
#settingsOverlay .settings-group { text-align:left; }
#settingsOverlay .settings-label { text-align:left; }
#settingsOverlay .settings-row { justify-content:space-between; text-align:left; }
.btn-ghost:hover { border-color:var(--accent); background:var(--accent-soft); }
.send-btn { background:var(--accent); box-shadow:none; }
.send-btn:hover { box-shadow:0 4px 18px var(--accent-glow); }
/* Keep the whole chat input on the Studio palette, including focus and tools. */
html[data-theme] .composer {
  background:linear-gradient(120deg,var(--accent-soft),transparent 65%),var(--panel);
  border-color:color-mix(in srgb,var(--accent) 35%,var(--border));
  box-shadow:0 12px 36px #0002;
}
html[data-theme] .composer:focus-within {
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft),0 12px 36px #0002;
}
.composer textarea { color:var(--text); caret-color:var(--accent); }
.composer textarea:focus-visible { outline:none; }
.composer textarea::placeholder { color:var(--text-faint); }
.composer textarea::selection { background:var(--accent); color:var(--bg-base); }
.composer .icon-btn:not(.send-btn):hover { background:var(--accent-soft); color:var(--accent); }
.composer .send-btn { background:var(--accent); color:var(--bg-base); }
.composer .send-btn:hover:not(:disabled) { background:var(--accent-2); }
html[data-theme="light"] .composer .send-btn,
html[data-theme="light"] .composer textarea::selection { color:#fff; }
.studio-summary { display:flex; gap:24px; border-block:1px solid var(--border); padding:18px 0; margin:20px 0; }
.studio-summary strong { display:block; font-size:23px; font-weight:500; margin-bottom:4px; color:var(--text); }
.studio-summary span { font-size:11px; color:var(--text-dim); }
.studio-empty { text-align:center; padding:32px 20px; border:1px dashed var(--border); border-radius:14px; color:var(--text-dim); font-size:13px; line-height:1.7; }
.studio-empty strong { display:block; font-size:18px; font-weight:500; color:var(--text); margin-bottom:8px; }
.studio-focus { text-align:left; width:100%; border:1px solid var(--border); border-radius:16px; padding:20px 24px; margin:0 0 20px; background:linear-gradient(110deg,var(--accent-soft),var(--panel)); }
.starter-grid + .studio-focus { margin-top:18px; }
body:has(.memory-overlay.active) .cookie-banner { visibility:hidden; }
.studio-focus button { text-align:left; width:100%; display:flex; align-items:center; justify-content:space-between; gap:20px; border:0; background:none; padding:0; color:var(--text); cursor:pointer; }
.studio-focus strong { display:block; font-size:15px; font-weight:550; }
.studio-focus small { display:block; color:var(--text-dim); font-size:12px; margin-top:7px; line-height:1.5; }
.studio-focus b { color:var(--accent); font-size:22px; font-weight:400; }
.studio-check { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--text-dim); margin:15px 0; }
.studio-check input { accent-color:var(--accent); }
.ap-step { padding:13px 15px; border-radius:10px; border:1px solid var(--border-soft); margin:7px 0; }
.ap-step.running { background:var(--accent-soft); border-color:var(--accent); }
.ap-note { line-height:1.6; }
#studioEditor { z-index:1200; }
#studioEditor .memory-box { max-width:600px; width:100%; }
.lp-hero h1 { font-weight:500; letter-spacing:-.055em; }
.lp-hero { background:radial-gradient(ellipse at 85% 30%,var(--accent-soft),transparent 60%); }
.lp-accent { background:none!important; -webkit-text-fill-color:var(--accent)!important; color:var(--accent); }
.lp-badge,.lp-ctx { background:var(--accent-soft); color:var(--accent); border-color:var(--border); }
.lp-msg.user { background:var(--user-bubble); border-color:var(--border); }
.lp-nav-cta,.lp-cta { background:var(--accent); }
.lp-demo { border-color:var(--border); box-shadow:0 30px 90px #0003; }
.lp-card { border-radius:16px; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,[tabindex]:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
button:disabled { opacity:.55; cursor:wait; }
@media(max-width:640px) {
  .memory-overlay { padding:10px; }
  .memory-box { padding:24px 18px; border-radius:18px; max-height:90dvh; }
  .studio-templates { grid-template-columns:1fr; }
  .studio-template { padding:14px; }
  .studio-template strong { margin-bottom:4px; }
  .studio-row { grid-template-columns:1fr; gap:0; }
  .ws-item { align-items:flex-start; flex-direction:column; }
  .ws-actions { justify-content:flex-start; }
  .studio-focus { padding:18px; }
  .studio-summary { gap:18px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }

