/* Shared application shell. Theme names and values are fixed, never user CSS. */
html[data-ui-theme]{color-scheme:dark;--ui-bg:#07111f;--ui-surface:#141c29;--ui-raised:#20314a;--ui-border:#435a7c;--ui-text:#edf4ff;--ui-muted:#b3c2d9;--ui-accent:#a9c4ff;--ui-button:#294b80;--ui-on-button:#fff;--ui-danger:#842f43;--ui-danger-text:#fff;--ui-error-bg:#351c27;--ui-error-text:#ffd2dc;--ui-success-bg:#12372c;--ui-success-text:#b2f1d4;--ui-info-bg:#172d47;--ui-info-text:#d1e4ff;--bg:var(--ui-bg);--panel:var(--ui-surface);--panel2:var(--ui-raised);--border:var(--ui-border);--text:var(--ui-text);--muted:var(--ui-muted);--blue:var(--ui-accent);--cyan:var(--ui-accent);--link-bg:var(--ui-surface);--link-hover:var(--ui-raised);background:var(--ui-bg);color:var(--ui-text);font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
html[data-ui-theme="ocean"]{--ui-bg:#061b23;--ui-surface:#102e39;--ui-raised:#17414d;--ui-border:#386b78;--ui-text:#edfaff;--ui-muted:#afd0d8;--ui-accent:#71d9eb;--ui-button:#215e70}
html[data-ui-theme="forest"]{--ui-bg:#0c1b15;--ui-surface:#162d24;--ui-raised:#214536;--ui-border:#4d7663;--ui-text:#edf8f2;--ui-muted:#b8d1c1;--ui-accent:#91d8ac;--ui-button:#2c6345}
html[data-ui-theme="amethyst"]{--ui-bg:#160f23;--ui-surface:#251b36;--ui-raised:#3a2b51;--ui-border:#705b88;--ui-text:#f6eeff;--ui-muted:#cbbbdc;--ui-accent:#d0aaff;--ui-button:#62448a}
html[data-ui-theme="daylight"]{color-scheme:light;--ui-bg:#eef2f8;--ui-surface:#fff;--ui-raised:#e2eaf5;--ui-border:#677991;--ui-text:#17253b;--ui-muted:#485a73;--ui-accent:#254f93;--ui-button:#315f9e;--ui-error-bg:#ffeaf0;--ui-error-text:#81253d;--ui-success-bg:#e3f4ec;--ui-success-text:#17533c;--ui-info-bg:#e3edfc;--ui-info-text:#23477e}
html[data-ui-theme] body,html[data-ui-theme] body.portal{background:var(--ui-bg);color:var(--ui-text);font-family:inherit}
html[data-ui-theme] body:not(.portal)>main,html[data-ui-theme] .profile-card,html[data-ui-theme] .recovery-panel,html[data-ui-theme] .donate-card,html[data-ui-theme] .portal .card,html[data-ui-theme] .portal .portal-search,html[data-ui-theme] .portal .domain-row,html[data-ui-theme] .portal .portal-favorite,html[data-ui-theme] .portal .signup{background:var(--ui-surface);border-color:var(--ui-border);color:var(--ui-text)}
html[data-ui-theme] body>main.profile-page,html[data-ui-theme] body>main.donate-shell{background:transparent}
html[data-ui-theme] .portal .sidebar,html[data-ui-theme] .portal .sidebar-bottom,html[data-ui-theme] .portal .portal-footer,html[data-ui-theme] .portal .userbar{background:var(--ui-bg);border-color:var(--ui-border)}
html[data-ui-theme] .portal .sidebar-note,html[data-ui-theme] .portal .sidebar-caption,html[data-ui-theme] .portal .side-link,html[data-ui-theme] .portal .portal-footer,html[data-ui-theme] .portal .portal-footer .donate-footer-link,html[data-ui-theme] .portal .profile-label{color:var(--ui-muted)}
html[data-ui-theme] .portal .side-link:hover,html[data-ui-theme] .portal .side-link.active,html[data-ui-theme] .portal .portal-favorite:hover,html[data-ui-theme] .portal .card:hover,html[data-ui-theme] .portal .sidebar-toggle{background:var(--ui-raised);border-color:var(--ui-border);color:var(--ui-text)}
html[data-ui-theme] .portal .side-link-donate,html[data-ui-theme] .portal .side-link-donate:hover{background:transparent}
html[data-ui-theme] a,html[data-ui-theme] .back-link,html[data-ui-theme] .donate-back{color:var(--ui-accent)}
html[data-ui-theme] .profile-name-link,html[data-ui-theme] .portal .portal-search-result,html[data-ui-theme] .portal .portal-favorite{color:var(--ui-text)}
html[data-ui-theme] .muted,html[data-ui-theme] .profile-heading p,html[data-ui-theme] .profile-preview-info p,html[data-ui-theme] .upload-note,html[data-ui-theme] .donate-intro p,html[data-ui-theme] .donate-card p,html[data-ui-theme] .donate-note,html[data-ui-theme] .donate-card small,html[data-ui-theme] .donate-heading,html[data-ui-theme] .recovery-panel p,html[data-ui-theme] .portal .card-desc,html[data-ui-theme] .portal .note,html[data-ui-theme] .portal .domain-row small,html[data-ui-theme] .portal .portal-header p,html[data-ui-theme] .portal .portal-search-hint,html[data-ui-theme] .portal .portal-search-box kbd,html[data-ui-theme] .portal .portal-favorite small{color:var(--ui-muted)}
html[data-ui-theme] .eyebrow,html[data-ui-theme] .profile-tag,html[data-ui-theme] .portal .eyebrow,html[data-ui-theme] .portal .side-icon,html[data-ui-theme] .portal .side-link.active .side-icon{color:var(--ui-accent)}
html[data-ui-theme] input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),html[data-ui-theme] select,html[data-ui-theme] textarea,html[data-ui-theme] .portal .portal-search-box,html[data-ui-theme] .portal .portal-search-box input{background:var(--ui-bg);border-color:var(--ui-border);color:var(--ui-text);font:inherit;max-width:100%}
html[data-ui-theme] input::placeholder,html[data-ui-theme] textarea::placeholder,html[data-ui-theme] .portal .portal-search-box input::placeholder{color:var(--ui-muted);opacity:1}
html[data-ui-theme] button,html[data-ui-theme] .upload-button,html[data-ui-theme] .secondary-button,html[data-ui-theme] .profile-back-button,html[data-ui-theme] .portal .userbar-login,html[data-ui-theme] .passkey-edit-button{font:inherit;font-size:13px;font-weight:650;min-height:40px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-button);color:var(--ui-on-button);cursor:pointer;padding:9px 15px}
html[data-ui-theme] button:disabled{opacity:.6;cursor:not-allowed}
html[data-ui-theme] button:hover:not(:disabled),html[data-ui-theme] .upload-button:hover{filter:brightness(1.1)}
html[data-ui-theme] .portal .sidebar-toggle{padding:0;font-size:28px;min-height:36px}
html[data-ui-theme] .portal .side-auth-form{margin:0}
html[data-ui-theme] .portal .side-auth-form .side-link{display:flex;width:100%;margin:0;padding:8px 10px;min-height:36px;border:1px solid transparent;background:transparent;color:var(--ui-muted);font-size:12px;font-weight:400;justify-content:flex-start}
html[data-ui-theme] .portal .side-auth-form .side-link:hover{background:var(--ui-raised);color:var(--ui-text);filter:none}
html[data-ui-theme] .portal h1,html[data-ui-theme] .portal h2,html[data-ui-theme] .portal .card-title,html[data-ui-theme] .portal .domain-row strong,html[data-ui-theme] .portal .profile-summary strong,html[data-ui-theme] .portal .userbar-brand{color:var(--ui-text)}
html[data-ui-theme] .portal .userbar-status,html[data-ui-theme] .portal .portal-search>label,html[data-ui-theme] .portal .portal-favorites-heading,html[data-ui-theme] .portal .status,html[data-ui-theme] .portal .domain-label{color:var(--ui-muted)}
html[data-ui-theme] .portal .domain-label,html[data-ui-theme] .portal .portal-favorite-icon{background:var(--ui-raised);border-color:var(--ui-border);color:var(--ui-accent)}
html[data-ui-theme="daylight"] .portal .userbar-online{background:#def2e8;color:#17533c;border-color:#587e6c}
html[data-ui-theme] .form-field>span,html[data-ui-theme] .recovery-panel__check,html[data-ui-theme] .recovery-panel h2,html[data-ui-theme] .donate-card label{color:var(--ui-text)}
html[data-ui-theme] .recovery-panel__eyebrow{color:var(--ui-accent)}
html[data-ui-theme] .recovery-panel .recovery-panel__warning{background:var(--ui-info-bg);color:var(--ui-info-text);border-color:var(--ui-border);border-left-color:var(--ui-accent)}
html[data-ui-theme] .donate-back-top,html[data-ui-theme] .profile-back-button{background:var(--ui-button);color:var(--ui-on-button);border-color:var(--ui-border);box-shadow:none}
html[data-ui-theme] .avatar-option{background:var(--ui-bg);color:var(--ui-text);border-color:var(--ui-border);padding:12px 8px}
html[data-ui-theme] .avatar-option:hover,html[data-ui-theme] .avatar-option.selected{background:var(--ui-raised);border-color:var(--ui-accent)}
html[data-ui-theme] .profile-preview{background:var(--ui-raised);border-color:var(--ui-border)}
html[data-ui-theme] .avatar-art{background:var(--ui-bg)}
html[data-ui-theme] .form-message,html[data-ui-theme] .notice,html[data-ui-theme] p[role="status"]:not(:empty),html[data-ui-theme] .recovery-notice{padding:12px 15px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-info-bg);color:var(--ui-info-text);overflow-wrap:anywhere;font-size:13px;line-height:1.6}
html[data-ui-theme] .form-message.error,html[data-ui-theme] .error,html[data-ui-theme] p[role="alert"]{padding:12px 15px;border:1px solid var(--ui-error-text);border-radius:9px;background:var(--ui-error-bg);color:var(--ui-error-text)}
html[data-ui-theme] .form-message.success{background:var(--ui-success-bg);color:var(--ui-success-text);border-color:var(--ui-success-text)}
html[data-ui-theme] .danger-button,html[data-ui-theme] .account-confirm-button,html[data-ui-theme] .passkey-delete-button,html[data-ui-theme] .recovery-panel button[data-recovery-generate],html[data-ui-theme] [data-account-close]{background:var(--ui-danger);color:var(--ui-danger-text)}
html[data-ui-theme] .recovery-panel pre,html[data-ui-theme] .recovery-panel code,html[data-ui-theme] .recovery-panel__codes,html[data-ui-theme] .recovery-panel__codes li{background:var(--ui-bg);color:var(--ui-text);border-color:var(--ui-border)}
html[data-ui-theme] .language-picker-trigger,html[data-ui-theme] .language-picker-menu,html[data-ui-theme] .language-picker-option{background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-border)}
html[data-ui-theme] .language-picker-option:hover{background:var(--ui-surface)}
html[data-ui-theme] .donate-heart-icon,html[data-ui-theme] .portal .side-icon.donate-heart-icon{color:#ff3b30}
html[data-ui-theme] :focus-visible{outline:2px solid var(--ui-accent);outline-offset:3px}
html[data-ui-theme] input[type="radio"],html[data-ui-theme] input[type="checkbox"]{accent-color:var(--ui-accent);width:18px;height:18px;flex:0 0 18px}
.appearance-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:12px;margin:18px 0}
html[data-ui-theme] .admin-shell .card{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border)}
html[data-ui-theme] .admin-shell th,html[data-ui-theme] .admin-shell td{border-color:var(--ui-border);overflow-wrap:anywhere}
html[data-ui-theme] .admin-shell form{flex-wrap:wrap}
html[data-ui-theme] .admin-shell input{min-width:0}
.appearance-choice{display:flex;flex-direction:column;gap:10px;min-width:0;padding:12px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-bg);color:var(--ui-text);cursor:pointer}
.appearance-choice:has(input:checked){outline:2px solid var(--ui-accent);outline-offset:1px}
.appearance-choice-label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:650}
html[data-ui-theme] .page-help-trigger{position:fixed;box-sizing:border-box;overflow:visible;right:max(20px,env(safe-area-inset-right));bottom:calc(var(--portal-footer-height,0px) + 20px);z-index:180;display:grid;place-items:center;width:40px;height:40px;min-height:40px;margin:0;padding:0;border:2px solid var(--ui-accent);border-radius:50%;background:var(--ui-surface);color:var(--ui-accent);font:italic 700 24px/1 Georgia,serif;box-shadow:0 3px 12px #0003}
html[data-ui-theme] .page-help-dialog{width:min(680px,calc(100vw - 32px));max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--ui-border);border-radius:16px;background:var(--ui-surface);color:var(--ui-text);font:inherit;overflow:auto;overscroll-behavior:contain}
.page-help-dialog::backdrop{background:rgb(0 0 0 / .65)}
html[data-ui-theme] .page-help-header{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:16px 20px;background:var(--ui-surface);border-bottom:1px solid var(--ui-border);z-index:1}
html[data-ui-theme] .page-help-header h2{margin:0;color:var(--ui-text);font-size:20px;line-height:1.4}
html[data-ui-theme] .page-help-close{flex:0 0 40px;width:40px;height:40px;min-height:40px;margin:0;padding:0;background:var(--ui-raised);color:var(--ui-text);font-size:26px;line-height:1;border-radius:9px}
html[data-ui-theme] .page-help-content{padding:4px 20px 20px}
html[data-ui-theme] .page-help-section{margin:20px 0 0;padding:0;max-width:none}
html[data-ui-theme] .page-help-section h3{margin:0 0 7px;color:var(--ui-accent);font-size:16px;line-height:1.4}
html[data-ui-theme] .page-help-section p{margin:0;color:var(--ui-text);font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.appearance-swatch{height:64px;border-radius:8px;background:linear-gradient(90deg,var(--swatch-side) 25%,transparent 25%),linear-gradient(0deg,var(--swatch-accent) 8px,transparent 8px),var(--swatch-bg);border:1px solid var(--swatch-accent)}
[data-theme-choice="midnight"]{--swatch-bg:#07111f;--swatch-side:#20314a;--swatch-accent:#a9c4ff}
[data-theme-choice="ocean"]{--swatch-bg:#061b23;--swatch-side:#17414d;--swatch-accent:#71d9eb}
[data-theme-choice="forest"]{--swatch-bg:#0c1b15;--swatch-side:#214536;--swatch-accent:#91d8ac}
[data-theme-choice="amethyst"]{--swatch-bg:#160f23;--swatch-side:#3a2b51;--swatch-accent:#d0aaff}
[data-theme-choice="daylight"]{--swatch-bg:#eef2f8;--swatch-side:#fff;--swatch-accent:#254f93}
html[data-ui-theme] .appearance-actions{display:flex;flex-wrap:wrap;gap:10px}
html[data-ui-theme] .appearance-actions button{margin:0;width:auto}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}

/* Fog replaces the former white Daylight palette without changing saved IDs. */
html[data-ui-theme="daylight"]{--ui-bg:#b8bdc6;--ui-surface:#d2d6dd;--ui-raised:#c1c8d2;--ui-border:#59677c;--ui-text:#18283f;--ui-muted:#394b65;--ui-accent:#254875;--ui-button:#344f78;--ui-error-bg:#ead3d8;--ui-error-text:#762039;--ui-success-bg:#cbdcd3;--ui-success-text:#164a34;--ui-info-bg:#c6d1e0;--ui-info-text:#263e60}
html[data-ui-theme="blueprint"]{--ui-bg:#0b1c31;--ui-surface:#142a42;--ui-raised:#1d3a56;--ui-border:#66809b;--ui-text:#eef6ff;--ui-muted:#bfd0e3;--ui-accent:#92c8ff;--ui-button:#285785}
html[data-ui-theme="linen"]{color-scheme:light;--ui-bg:#cbc3b5;--ui-surface:#e0d8ca;--ui-raised:#c1b59e;--ui-border:#766749;--ui-text:#2d2a24;--ui-muted:#584d3a;--ui-accent:#493a1b;--ui-button:#635331;--ui-error-bg:#ead4ce;--ui-error-text:#78222e;--ui-success-bg:#cfddd0;--ui-success-text:#214f35;--ui-info-bg:#d1d9df;--ui-info-text:#2b4359}
html[data-ui-theme="aurora"]{--ui-bg:#111c29;--ui-surface:#192a38;--ui-raised:#263d4a;--ui-border:#5d7a87;--ui-text:#effaff;--ui-muted:#bed3da;--ui-accent:#86e1d4;--ui-button:#245e62}
html[data-ui-theme="blueprint"] body,html[data-ui-theme="blueprint"] body.portal{background-image:linear-gradient(#76b6eb0c 1px,transparent 1px),linear-gradient(90deg,#76b6eb0c 1px,transparent 1px);background-size:24px 24px}
html[data-ui-theme="linen"] body,html[data-ui-theme="linen"] body.portal{background-image:repeating-linear-gradient(135deg,#53472f08 0 1px,transparent 1px 5px)}
html[data-ui-theme="aurora"] body,html[data-ui-theme="aurora"] body.portal{background-image:radial-gradient(ellipse at 15% 10%,#38646666,transparent 50%),radial-gradient(ellipse at 85% 70%,#55477555,transparent 55%);background-attachment:fixed}
html[data-ui-theme="linen"] .portal .userbar-online{background:#cfddd0;color:#214f35;border-color:#587e6c}
[data-theme-choice="daylight"]{--swatch-bg:#b8bdc6;--swatch-side:#d2d6dd;--swatch-accent:#254875}
[data-theme-choice="blueprint"]{--swatch-bg:#0b1c31;--swatch-side:#1d3a56;--swatch-accent:#92c8ff}
[data-theme-choice="linen"]{--swatch-bg:#cbc3b5;--swatch-side:#e0d8ca;--swatch-accent:#493a1b}
[data-theme-choice="aurora"]{--swatch-bg:#111c29;--swatch-side:#263d4a;--swatch-accent:#86e1d4}
[data-theme-choice="blueprint"] .appearance-swatch{background-image:linear-gradient(#92c8ff33 1px,transparent 1px),linear-gradient(90deg,#92c8ff33 1px,transparent 1px);background-size:12px 12px;background-color:var(--swatch-bg)}
[data-theme-choice="linen"] .appearance-swatch{background:repeating-linear-gradient(135deg,#493a1b18 0 1px,transparent 1px 4px),var(--swatch-bg)}
[data-theme-choice="aurora"] .appearance-swatch{background:radial-gradient(ellipse at top left,#386466,transparent 70%),radial-gradient(ellipse at bottom right,#554775,transparent 80%),var(--swatch-bg)}
html[data-ui-theme] button,html[data-ui-theme] .upload-button,html[data-ui-theme] .secondary-button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
html[data-ui-theme] .language-picker-option{white-space:nowrap}



/* Aurora variations retain the portal's fixed semantic token system. */
html[data-ui-theme="aurora-blue"]{--ui-bg:#07152e;--ui-surface:#10264b;--ui-raised:#18385f;--ui-border:#6587af;--ui-text:#f0f7ff;--ui-muted:#bfd2ea;--ui-accent:#88bdff;--ui-button:#2356a5}
html[data-ui-theme="aurora-ember"]{--ui-bg:#211b2a;--ui-surface:#322739;--ui-raised:#49334b;--ui-border:#a18494;--ui-text:#fff3f4;--ui-muted:#e2cbd6;--ui-accent:#ffbd9a;--ui-button:#85465e}
html[data-ui-theme="aurora-blue"] body,html[data-ui-theme="aurora-blue"] body.portal{background-image:radial-gradient(ellipse at 12% 8%,#126ee699,transparent 55%),radial-gradient(ellipse at 88% 72%,#203ce98a,transparent 60%);background-attachment:fixed}
html[data-ui-theme="aurora-ember"] body,html[data-ui-theme="aurora-ember"] body.portal{background-image:radial-gradient(ellipse at 14% 12%,#b3563266,transparent 52%),radial-gradient(ellipse at 86% 75%,#743e8a77,transparent 58%);background-attachment:fixed}
[data-theme-choice="aurora-blue"]{--swatch-bg:#07152e;--swatch-side:#18385f;--swatch-accent:#88bdff}
[data-theme-choice="aurora-ember"]{--swatch-bg:#211b2a;--swatch-side:#49334b;--swatch-accent:#ffbd9a}
[data-theme-choice="aurora-blue"] .appearance-swatch{background:radial-gradient(ellipse at top left,#126ee6,transparent 75%),radial-gradient(ellipse at bottom right,#203ce9,transparent 80%),var(--swatch-bg)}
[data-theme-choice="aurora-ember"] .appearance-swatch{background:radial-gradient(ellipse at top left,#b35632,transparent 75%),radial-gradient(ellipse at bottom right,#743e8a,transparent 80%),var(--swatch-bg)}
/* One bounded panel; nine choices need three rows rather than a tall scroll list. */
html[data-ui-theme] .language-picker-menu{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;width:min(360px,calc(100vw - 24px));min-width:0;max-width:calc(100vw - 24px);padding:6px;box-sizing:border-box;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--ui-border) var(--ui-raised)}
html[data-ui-theme] .language-picker-menu form{min-width:0}
html[data-ui-theme] .language-picker-option{min-height:36px;gap:5px;padding:7px 5px;font-size:11px;line-height:1.25;white-space:nowrap;overflow-wrap:normal;box-sizing:border-box}
html[data-ui-theme] .language-picker-option img{width:18px;height:12px}
html[data-ui-theme] .language-picker-option span{white-space:nowrap}
@media(max-width:350px){html[data-ui-theme] .language-picker-option{font-size:10px;gap:4px;padding:7px 3px}html[data-ui-theme] .language-picker-option img{width:16px;height:11px}}
