/* The existing dark theme stays untouched. Appearance controls work in both themes. */
.theme-choices{display:flex;gap:16px;flex-wrap:wrap}.theme-choice{display:grid;gap:8px;text-align:left;position:relative;width:220px;max-width:100%;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--surface2);color:var(--text);font:inherit;cursor:pointer}.theme-choice>span:last-child{font-size:.875rem;color:var(--muted)}.theme-choice[aria-pressed=true]{outline:2px solid var(--cyan);outline-offset:3px}.theme-swatch{display:grid;grid-template-columns:24px 1fr;gap:8px;align-items:center;height:80px;padding:12px;border-radius:10px;border:1px solid #8192b033}.theme-swatch i{display:block;height:100%;border-radius:5px}.theme-swatch i:last-child{height:65%}.swatch-dark{background:#071016}.swatch-dark i{background:#17303c;border:1px solid #58ddff30}.swatch-white{background:linear-gradient(125deg,#e9e5ff,#f8fbff 50%,#dff5ff)}.swatch-white i{background:#ffffffad;border:1px solid white;box-shadow:0 3px 8px #6688bb18}
:root[data-theme=white]{color-scheme:light;--bg:#f3f7fd;--surface:#f8faff;--surface2:#edf3fb;--line:rgba(94,126,169,.20);--border:rgba(94,126,169,.20);--text:#17243d;--muted:#536780;--cyan:#0068ac;--cyan-soft:rgba(36,163,243,.10);--violet:#6844c8;--violet-soft:rgba(139,106,229,.10);--good:#08754e;--bad:#b02b44;--radius:24px;--glass:linear-gradient(140deg,rgba(255,255,255,.93),rgba(247,250,255,.77));--glass-shadow:inset 0 1px 0 #fff,0 8px 30px #6183b510,0 1px 3px #41699908}
html[data-theme=white] body{background:radial-gradient(ellipse at 0 0,#e7e6fc80,transparent 45%),radial-gradient(ellipse at 100% 70%,#dbf5ff70,transparent 55%),#f3f7fd}
html[data-theme=white] body:before{background:none}
html[data-theme=white] .ambient{opacity:.055}
html[data-theme=white] :is(.panel,.feature-panel,.email-draft,dialog,.large-upload-dialog){background:var(--glass);border-color:#ffffffef;box-shadow:var(--glass-shadow);color:var(--text)}
html[data-theme=white] .sidebar{background:linear-gradient(165deg,#ffffffc9,#edf5ffad);border:1px solid #fff;border-radius:26px;box-shadow:var(--glass-shadow);backdrop-filter:blur(24px) saturate(135%);-webkit-backdrop-filter:blur(24px) saturate(135%);inset:12px auto 12px 12px;width:211px;padding:28px 14px 18px}
html[data-theme=white] .brand strong{font-weight:650;letter-spacing:-.025em}
html[data-theme=white] .sidebar nav{gap:10px}
html[data-theme=white] .nav-item{border:1px solid transparent;border-radius:17px;min-height:52px}
html[data-theme=white] .nav-item.active{color:#005eb0;border-color:#fff;background:linear-gradient(130deg,#e5f4ffdf,#dcedffd0);box-shadow:inset 0 1px 1px #fff,0 3px 12px #6494c91a}
html[data-theme=white] .nav-item:hover{background:#ffffffaa}
html[data-theme=white] .sidebar-card{background:#ffffff68;border-color:var(--line);border-radius:16px}
html[data-theme=white] :is(.avatar,.private-pill,.source-chip){color:var(--violet);background:linear-gradient(145deg,#eee8ff,#e3eaff);border-color:#d9d2f5}
html[data-theme=white] .profile-chip{padding:10px 3px;border-top:1px solid var(--line)}
html[data-theme=white] .topbar{background:linear-gradient(110deg,#ffffffb8,#f6f9ffb8);border-color:#fff;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}
html[data-theme=white] :is(.secondary,.icon-button,.language-picker select,.chat-size-control button,.theme-choice){color:var(--text);background:linear-gradient(160deg,#ffffffdf,#eaf1fbc9);border-color:#c7d6ecb3;box-shadow:inset 0 1px 0 #fff,0 3px 10px #5d83b40b;border-radius:13px}
html[data-theme=white] :is(.secondary,.icon-button,.theme-choice):hover{background:#fff;border-color:#98bcdf}
html[data-theme=white] .primary{background:linear-gradient(160deg,#71d6f8,#36b3eb);color:#07324e;border:1px solid #fff9;box-shadow:inset 0 1px 1px #ffffff80,0 3px 10px #008bd327;text-shadow:0 1px 0 #ffffff40;border-radius:13px}
html[data-theme=white] .primary:hover{background:linear-gradient(160deg,#8de0fb,#50bff0)}
html[data-theme=white] .danger{background:#fff1f2;color:#a4213c;border-color:#e8b6c0}
html[data-theme=white] .text-button:hover{background:#e4f2fc;border-radius:10px}
html[data-theme=white] :is(input,textarea,select,.money-form input,.money-form select,.money-toolbar input,.money-toolbar select){color:var(--text);background:#ffffffb3;border-color:#b8cbe1;border-radius:12px;color-scheme:light}
html[data-theme=white] :is(input,textarea)::placeholder{color:#667b95;opacity:1}
html[data-theme=white] :is(input[type=checkbox],input[type=radio]){accent-color:#087ec7}
html[data-theme=white] :is(.quick-ask-form,.composer){background:linear-gradient(135deg,#ffffffed,#f1f7ffcf);border:1px solid #fff;box-shadow:inset 0 1px 1px #fff,0 4px 20px #6a91c31a;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-radius:28px;padding:8px}
html[data-theme=white] :is(.composer textarea,.quick-ask-form input){background:transparent;border:0}
html[data-theme=white] .composer :is(.icon-button,.primary){border-radius:50%}
html[data-theme=white] .composer .attach-control{border-radius:50%}
html[data-theme=white] .composer textarea:focus-visible{outline:2px solid #297faf;outline-offset:-2px}
html[data-theme=white] .chat-panel{background:linear-gradient(150deg,#ffffff91,#f7faff70);border:1px solid #fff;border-radius:26px}
html[data-theme=white] .message.assistant>.message-bubble{background:linear-gradient(135deg,#fffffff2,#fcfdffdd);border:1px solid #dce7f5;box-shadow:inset 0 1px 0 #fff,0 5px 20px #6186b50b;border-radius:22px;color:var(--text)}
html[data-theme=white] .message.user>.message-bubble{background:linear-gradient(130deg,#eaf8ffed,#ddf2ffdf);border:1px solid #bce5fa;box-shadow:inset 0 1px 0 #fff,0 3px 12px #6186b508;border-radius:22px 22px 7px 22px;color:#123454}
html[data-theme=white] .message.assistant strong.role{color:#6049a4}
html[data-theme=white] .formatted-reply strong{color:var(--text)}
html[data-theme=white] .formatted-reply li::marker{color:var(--violet)}
html[data-theme=white] .formatted-reply a{color:#0067a5}
html[data-theme=white] .formatted-reply blockquote{color:#52617c;border-left-color:#9e8bd0}
html[data-theme=white] .formatted-reply :not(pre)>code{background:#eaf0f8;border-color:#d8e2f0}
html[data-theme=white] .code-block{background:#f3f6fc;border-color:#ccd9eb}
html[data-theme=white] :is(.code-header,.formatted-reply th){background:#edf2f9}
html[data-theme=white] .message-content pre{background:#f3f6fc;color:#213957}
html[data-theme=white] .message-content .code-block pre{background:transparent}
html[data-theme=white] .copy-button:hover{color:#274f82;background:#e8eff8}
html[data-theme=white] .table-scroll{background:#ffffff99;border-color:#ccd9e9;border-radius:14px}
html[data-theme=white] :is(.calendar-draft,.calendar-preview,.money-entry,.money-table-wrap td,.money-table-wrap th,.schedule-event,.upload-progress){border-color:var(--line)}
html[data-theme=white] .calendar-draft{background:#ffffffb3}
html[data-theme=white] .schedule-time{color:#0068a8}
html[data-theme=white] :is(.schedule-caption,.chat-model-label strong){color:#536780}
html[data-theme=white] :is(.global-notice,.money-warning){background:#fff1d8;color:#735007;border-color:#ead09a}
html[data-theme=white] :is(#money-notice.error,.file-download-status.error){color:#a32b41}
html[data-theme=white] .file-download{background:#e8f5ff;color:#00629d;border-color:#bddbef}
html[data-theme=white] .file-download:hover{background:#d9edfc}
html[data-theme=white] .file-drop-overlay{background:radial-gradient(ellipse,#f5fbfff5,#dceffcf2)}
html[data-theme=white] dialog{box-shadow:inset 0 1px 0 #fff,0 25px 90px #254a7540;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
html[data-theme=white] dialog::backdrop{background:#465b7b35;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
html[data-theme=white] #email-review-dialog .email-actions{background:#f6f9fc}
html[data-theme=white] .briefing-preferences input[type=time]{color-scheme:light}
html[data-theme=white] .language-buttons [aria-pressed=true]{background:#dff0ff;color:#005f9f;border-color:#a1cdea}
html[data-theme=white] .login-entry{background:transparent}
html[data-theme=white] .mobile-nav{background:linear-gradient(150deg,#ffffffed,#eaf3ffed);border:1px solid #fff;box-shadow:0 -3px 24px #668bc514;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
html[data-theme=white] .mobile-nav .active{background:linear-gradient(145deg,#edf8ff,#dceeff);box-shadow:inset 0 1px 0 #fff;color:#0066ac}
@media(min-width:1200px){html[data-theme=white] .chat-layout{max-width:none}html[data-theme=white] .chat-view{padding-top:20px;padding-bottom:18px}html[data-theme=white] .chat-panel{padding:18px}html[data-theme=white] .conversation{padding:12px 8px 24px}}
@media(min-width:701px) and (max-width:999px){html[data-theme=white] .sidebar{width:76px;inset:8px auto 8px 8px;padding:24px 4px}html[data-theme=white] .nav-item{border-radius:14px}}
@media(min-width:1000px) and (max-width:1199px){html[data-theme=white] .sidebar{width:180px;inset:8px auto 8px 8px;padding:24px 10px}}
@media(max-width:700px){html[data-theme=white] .chat-panel{padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}html[data-theme=white] .message.assistant>.message-bubble{border-radius:18px}html[data-theme=white] .composer{padding:6px;border-radius:25px}html[data-theme=white] .mobile-nav{border-radius:20px 20px 0 0}html[data-theme=white] .panel{border-radius:22px}.theme-choice{flex:1;min-width:135px}.theme-choice>span:last-child{font-size:.8125rem}}
@media(prefers-reduced-transparency:reduce){html[data-theme=white] :is(.sidebar,.topbar,.mobile-nav,.panel,.composer,dialog){background:#f8faff;backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(prefers-contrast:more){:root[data-theme=white]{--line:#879ab3;--muted:#354862}html[data-theme=white] :is(.panel,.message-bubble,dialog){border-color:#879ab3}}
html[data-theme=white] img[src*="ludens-brand-"]{content:url("assets/ludens-light-mark.svg")}
html[data-theme=white] .sidebar .brand small{font-size:.75rem;white-space:nowrap}
html[data-theme=white] #chat-use-location{align-self:flex-start}
@media(min-width:1200px){html[data-theme=white] .chat-view>h1.sr-only{position:static;width:auto;height:auto;clip:auto;white-space:normal;overflow:visible;font-size:1.75rem;font-weight:600;line-height:1.2;margin:0 0 12px}html[data-theme=white] .chat-view{position:relative}html[data-theme=white] #chat-use-location{position:absolute;right:0;top:16px;font-size:.8rem}html[data-theme=white] .chat-size-control{margin-top:0}}
/* Let the light-theme header blend into the page; retain its model pill and controls. */
html[data-theme=white] .topbar{background:transparent;border-color:transparent;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
/* Clear glass navigation over a plain white workspace, on every device. */
:root[data-theme=white]{--bg:#fff;--surface:#fff;--surface2:#f5f6f8;--line:rgba(90,99,116,.20);--border:rgba(90,99,116,.20);--glass:#fff;--glass-shadow:none}
html[data-theme=white] body{background:#fff}
html[data-theme=white] .ambient{display:none}
html[data-theme=white] :is(.panel,.feature-panel,.chat-panel,.email-draft,dialog,.large-upload-dialog){background:#fff;border-color:#dce0e7;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
html[data-theme=white] .chat-panel{border-color:transparent}
html[data-theme=white] .message.assistant>.message-bubble,html[data-theme=white] .message.user>.message-bubble{background:#fff;border-color:#d5dae3;box-shadow:none;color:var(--text)}
html[data-theme=white] :is(.composer,.quick-ask-form){background:#fff;border-color:#d5dae3;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none}
html[data-theme=white] :is(.composer textarea,.quick-ask-form input){background:transparent}
html[data-theme=white] :is(.table-scroll,.calendar-draft){background:#fff}
html[data-theme=white] :is(.formatted-reply th,.code-header){background:#f3f4f6}
html[data-theme=white] :is(.secondary,.icon-button,.language-picker select,.chat-size-control button,.theme-choice){background:#fff;box-shadow:none;border-color:#d5dae3}
html[data-theme=white] :is(.secondary,.icon-button,.theme-choice):hover{background:#f6f7f9;border-color:#adb5c2}
html[data-theme=white] :is(.composer .icon-button,.composer .attach-control>button){background:#f3f4f6}
html[data-theme=white] :is(.sidebar,.mobile-nav){background:linear-gradient(130deg,rgba(255,255,255,.48),rgba(247,247,248,.20) 45%,rgba(255,255,255,.55));border:1px solid rgba(150,154,161,.5);box-shadow:inset 0 0 0 2px #ffffffdb,inset 3px 0 6px #ffffffed,inset -3px -2px 7px #a0a4ae1c,0 6px 18px #2027330b;backdrop-filter:blur(16px) saturate(100%);-webkit-backdrop-filter:blur(16px) saturate(100%)}
html[data-theme=white] .sidebar:before{content:"";position:absolute;inset:4px;border:1px solid #a5a8b323;border-radius:22px;box-shadow:inset 0 2px 4px #fff;pointer-events:none}
html[data-theme=white] .nav-item.active,html[data-theme=white] .mobile-nav .active{color:var(--text);background:linear-gradient(145deg,#ffffffd9,#eceeef80 55%,#ffffffc9);border-color:#b7bbc455;box-shadow:inset 0 0 0 1px #fffffff2,inset 0 3px 5px #fff,0 2px 5px #343b4812}
html[data-theme=white] .nav-item.active>span{color:var(--text)}
html[data-theme=white] .nav-item:hover{background:#f4f4f580}
html[data-theme=white] .sidebar-card{background:#ffffff45;border-color:#cbd0d966}
html[data-theme=white] .profile-chip .avatar{background:#f0f1f3;color:#364153;border-color:#d6d9df}
html[data-theme=white] .swatch-white{background:#fff}
html[data-theme=white] .swatch-white i{background:#f5f5f599;border-color:#c5c8cf;box-shadow:inset 0 0 0 1px white}
html[data-theme=white] dialog{box-shadow:0 20px 70px #19202b26}
@media(prefers-reduced-transparency:reduce){html[data-theme=white] :is(.sidebar,.mobile-nav){background:#f7f7f8;backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(prefers-contrast:more){html[data-theme=white] :is(.sidebar,.mobile-nav,.panel,.message-bubble,.composer){border-color:#7c8595}}

/* White-theme motion for all signed-in users. */
.motion-selection{display:none}
@media(prefers-reduced-motion:no-preference){
 html[data-theme=white][data-ui-motion] button{transition:background-color 150ms ease,border-color 150ms ease,box-shadow 150ms ease,color 150ms ease,transform 150ms cubic-bezier(.2,.8,.2,1)}
 html[data-theme=white][data-ui-motion] button:active:not(:disabled){transform:scale(.97)}
 html[data-theme=white][data-ui-motion] .sidebar nav{position:relative;isolation:isolate}
 html[data-theme=white][data-ui-motion] .mobile-nav{isolation:isolate}
 html[data-theme=white][data-ui-motion] .motion-selection{display:block;position:absolute;left:0;top:0;pointer-events:none;z-index:-1;box-sizing:border-box;border-radius:18px;border:1px solid #b7bbc477;background:linear-gradient(145deg,#ffffffee,#e9ebee99 55%,#ffffffdd);box-shadow:inset 0 0 0 1px #fff,inset 0 3px 5px #fff,0 3px 9px #343b481c}
 html[data-theme=white][data-ui-motion] .motion-ready>.motion-selection{transition:transform 220ms cubic-bezier(.22,1,.36,1),width 220ms ease,height 220ms ease}
 html[data-theme=white][data-ui-motion] .motion-ready button.active{background:transparent;border-color:transparent;box-shadow:none}
 html[data-theme=white][data-ui-motion] .view:not([hidden]){animation:ludens-panel-arrive 200ms cubic-bezier(.22,1,.36,1)}
 html[data-theme=white][data-ui-motion] dialog[open]{animation:ludens-dialog-arrive 220ms cubic-bezier(.22,1,.36,1)}
 html[data-theme=white][data-ui-motion] .message-enter>.message-bubble{animation:ludens-pilot-fade 150ms ease-out}
}
@keyframes ludens-pilot-fade{from{opacity:.65}to{opacity:1}}
@keyframes ludens-panel-arrive{from{opacity:.5;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@keyframes ludens-dialog-arrive{from{opacity:.4;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
