/* Shared controls retain readable text in both appearances and on small screens. */
html[data-theme=light]{color-scheme:light!important}
html[data-theme=dark]{color-scheme:dark!important}
html body .ts-appearance-toggle,
html body #ts-shared-header .ts-header-original-actions .ts-appearance-toggle{box-sizing:border-box!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;width:auto!important;min-width:78px!important;height:36px!important;min-height:36px!important;padding:7px 10px!important;margin:0!important;border:1px solid var(--border,var(--line2,#dedde1))!important;border-radius:9px!important;background:var(--surface,var(--card,#fff))!important;color:var(--text,var(--ink,#29262b))!important;box-shadow:none!important;font:400 13px/1.5 -apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif!important;white-space:nowrap!important;cursor:pointer!important}
html body .ts-appearance-toggle svg{display:none!important}
html body .ts-appearance-label{display:inline!important;color:inherit!important;font:inherit!important;white-space:nowrap!important}
html body .ts-appearance-toggle:focus-visible{outline:2px solid var(--accent,#aa1e35)!important;outline-offset:3px!important}
html[data-theme=dark] body .ts-appearance-toggle{background:#29282c!important;color:#eee9ee!important;border-color:#514750!important}
/* Translation delivery choice used a fixed pale background with inherited dark text. */
html[data-theme=dark] .workspace .mode{background:#302428!important;color:#f1e9e7!important;border-color:#db8295!important;box-shadow:inset 0 0 0 1px #db8295!important}
html[data-theme=dark] .workspace .mode p{color:#c5b8bf!important}
html[data-theme=dark] .estimate-card:not(.good) .estimate-badge{background:#49351f;color:#f0cea2}
html[data-theme=dark] .estimate-card:not(.good) .estimate-explain{color:#e8c998;border-color:#6e5332}
html[data-theme=dark] .status-pill.fail{background:#3b3237;color:#d4c2cb}
html[data-theme=dark] .ts-evidence-home-return{background:#29282c;color:#eeadbd;border-color:#865363}
html[data-theme=dark] .ts-login{background:var(--card,#27242a);color:var(--text,#eee8ee);border-color:var(--border,#52444e)}
@media(max-width:820px){html body #ts-shared-header .ts-header-original-actions .ts-appearance-toggle{display:inline-flex!important;min-width:70px!important;height:34px!important;min-height:34px!important;padding:6px 7px!important;font-size:12px!important}}
/* Private LaTeX prototype chrome; slide previews preserve their paper colors. */
html[data-ts-surface=latex-preview][data-theme=dark]{--ink:#e7e7ed;--muted:#adb0bd;--line:#41434c;--soft:#191b20;--accent:#d58099;--accent-dark:#b6667e}
html[data-ts-surface=latex-preview][data-theme=dark] body,
html[data-ts-surface=latex-preview][data-theme=dark] .topbar,
html[data-ts-surface=latex-preview][data-theme=dark] .editor-panel{background:#222329;color:var(--ink)}
html[data-ts-surface=latex-preview][data-theme=dark] :is(.template-button,.template-menu,.icon-button,.tool-button,.code-shell,.prompt-row){background:#292b33;color:#e5e6ed;border-color:#494b57}
html[data-ts-surface=latex-preview][data-theme=dark] .line-numbers{background:#202229;color:#a4a9b8;border-color:#41434c}
html[data-ts-surface=latex-preview][data-theme=dark] :is(#latex-editor,#prompt){background:transparent;color:#e4e8f2;caret-color:#e9a1b6}
html[data-ts-surface=latex-preview][data-theme=dark] :is(.template-menu p,.preview-status){color:#b5bac8}
html[data-ts-surface=latex-preview][data-theme=dark] :is(.slide,.template-preview){--accent:#8b1534;--muted:#758096;--ink:#172036;color:#172036;color-scheme:light}
html[data-ts-surface=latex-preview][data-theme=dark] :is(.compile,.export,.send){background:#8b2847;color:#fff;border-color:#ad4767}
@media(max-width:600px){html[data-ts-surface=latex-preview] .topbar{height:auto;min-height:92px;grid-template-columns:1fr auto;padding:10px 12px;gap:7px}html[data-ts-surface=latex-preview] .doc-title{grid-column:1/-1;grid-row:2;min-width:0}html[data-ts-surface=latex-preview] .top-actions{gap:5px}html[data-ts-surface=latex-preview] .template-button{padding:7px;font-size:12px}html[data-ts-surface=latex-preview] .export{padding:8px;font-size:12px}}
@media print{.ts-appearance-toggle{display:none!important}}

/* The destination icon sits left of the explicit appearance label. */
html body .ts-appearance-toggle{gap:6px!important}
html body .ts-appearance-toggle svg.ts-appearance-icon,
html body #ts-shared-header .ts-appearance-toggle svg.ts-appearance-icon{display:block!important;flex:0 0 16px!important;width:16px!important;height:16px!important;margin:0!important;fill:none!important;stroke:currentColor!important;stroke-width:1.6!important;stroke-linecap:round!important;stroke-linejoin:round!important;order:0!important}
html body .ts-appearance-toggle .ts-appearance-label{order:1!important}
