/* One browser preference and palette for all AI Interactive Datasheets. Layout and artwork are theme-independent. */
html { --sheet-bg:#fff; --sheet-fg:#172631; --sheet-muted-fg:#465e70; --sheet-panel:#f5f9fc; --sheet-card:#fff; --sheet-line:#c0dae8; --sheet-accent:#087fb9; --sheet-rail:#edf7fc; --sheet-rail-cap:#e1f1fa; --sheet-rail-line:#9bc7da; --sheet-selected:#008ac51a; --sheet-green:#087b4b; }
html[data-datasheet-theme="dark"] { --sheet-bg:#14191f; --sheet-fg:#e6edf3; --sheet-muted-fg:#b0c1ce; --sheet-panel:#1b242e; --sheet-card:#222d38; --sheet-line:#3a4d5d; --sheet-accent:#6ed4ff; --sheet-rail:#192632; --sheet-rail-cap:#233646; --sheet-rail-line:#435f73; --sheet-selected:#4dcaff25; --sheet-green:#6ee7ac;
    --sheet-surface:#202b36; --sheet-soft:#263745; --sheet-ink:#e6edf3; --sheet-muted:#bacbd8; --sheet-border:#3c5365; --sheet-amber:#3a3224; --sheet-mint:#1d3835; --sheet-violet:#302c45; --sheet-rose:#3c2934;
    --sheet-blue-ink:#7bd7ff; --sheet-amber-ink:#f0cb7b; --sheet-mint-ink:#7ce6c8; --sheet-violet-ink:#c7aaff; --sheet-rose-ink:#ffa3ba;
}
html:has(:is(.ds-page,.uc-workspace)),body:has(:is(.ds-page,.uc-workspace)) { background:var(--sheet-bg); color:var(--sheet-fg); }
html :is(.ds-page,.uc-workspace) { color-scheme:light; background:var(--sheet-bg); color:var(--sheet-fg); }
html[data-datasheet-theme="dark"] :is(.ds-page,.uc-workspace) { color-scheme:dark; }
html .ds-page { --ds-ink:var(--sheet-fg); --ds-muted:var(--sheet-muted-fg); --ds-line:var(--sheet-line); }
/* Header retains the universal TEP brand in either theme. */
.ds-theme-switch { display:inline-flex; align-items:center; flex:none; gap:3px; padding:3px; border:1px solid #ffffff60; border-radius:9px; background:#006ba44d; box-shadow:inset 0 1px #ffffff26; color-scheme:light; }
.ds-theme-switch button { appearance:none; display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:30px; border:1px solid transparent; border-radius:6px; padding:5px 9px; background:transparent; color:#fff; font:600 12px/1.25 "Segoe UI",system-ui,sans-serif; cursor:pointer; }
.ds-theme-switch svg { width:17px; height:17px; flex:none; }
.ds-theme-switch button:hover { background:#ffffff24; }
html:not([data-datasheet-theme="dark"]) .ds-theme-switch [data-datasheet-theme-choice="light"],html[data-datasheet-theme="dark"] .ds-theme-switch [data-datasheet-theme-choice="dark"] { background:#fff; color:#086da2; border-color:#c7ecff; box-shadow:0 1px 5px #00486c30; }
.ds-theme-switch button:focus-visible { outline:2px solid #fff; outline-offset:3px; }
/* Identical rail surfaces, borders, selection and footer colours in both modules. */
html :is(.ds-workspace,.uc-workspace) :is(.ds-rail-surface,.uc-rail-surface) { background:var(--sheet-rail); border-color:var(--sheet-rail-line); box-shadow:none; }
html :is(.ds-workspace,.uc-workspace) :is(.ds-rail-caption,.uc-rail-caption) { background:var(--sheet-rail-cap); border-color:var(--sheet-rail-line); color:var(--sheet-muted-fg); }
html :is(.ds-workspace,.uc-workspace) :is(.ds-toolrail,.uc-toolrail) { scrollbar-color:var(--sheet-rail-line) transparent; }
html :is(.ds-workspace,.uc-workspace) :is(.ds-toolrail,.uc-toolrail) a { color:var(--sheet-muted-fg); }
html :is(.ds-workspace,.uc-workspace) :is(.ds-toolrail,.uc-toolrail) a:hover { color:var(--sheet-fg); background:var(--sheet-selected); border-color:var(--sheet-rail-line); box-shadow:inset 0 1px #ffffff25; }
html :is(.ds-workspace,.uc-workspace) :is(.ds-toolrail,.uc-toolrail) a[aria-current="page"] { color:var(--sheet-fg); background:linear-gradient(125deg,var(--sheet-selected),transparent); border-color:var(--sheet-rail-line); box-shadow:inset 3px 0 #06b8e8,inset 0 1px #ffffff28,0 2px 5px #003a5310; font-weight:700; }
html :is(.ds-workspace-status,.uc-workspace-status) { background:var(--sheet-rail); border-color:var(--sheet-rail-line); color:var(--sheet-muted-fg); }
html .uc-source-credit>div { background:var(--sheet-card); color:var(--sheet-fg); border-color:var(--sheet-line); }
/* MCU data uses the same surfaces, with its physical package/lead painting left intact. */
html .uc-workspace { --uc-bg:var(--sheet-bg); --uc-panel:var(--sheet-panel); --uc-card:var(--sheet-card); --uc-line:var(--sheet-line); --uc-fg:var(--sheet-fg); --uc-muted:var(--sheet-muted-fg); --uc-dim:var(--sheet-muted-fg); --uc-accent:var(--sheet-accent); --uc-green:var(--sheet-green); }
.uc-workspace :is(.uc-hero h1,.uc-tiles b,.uc-card h2,.uc-links b,.uc-reg-group h2,.uc-reg h3,.uc-block h2,.uc-chip-card b,.uc-lede,.uc-pin,.uc-pin[aria-pressed=true],.uc-pin-filters button,.uc-pin-filters button[aria-pressed=true]) { color:var(--uc-fg); }
.uc-workspace :is(code,.uc-chips a.pin) { color:var(--uc-accent); }
.uc-workspace :is(.uc-table td,.uc-card div) { border-color:var(--uc-line); }
.uc-workspace .uc-pinout { background:radial-gradient(var(--sheet-line) .65px,transparent .65px) center/14px 14px,var(--uc-card); }
.uc-workspace .uc-pin-filters b { background:var(--sheet-selected); }
.uc-workspace .uc-bits li { background:var(--sheet-selected); border-color:var(--uc-line); }
.uc-workspace .uc-bits li.unused { background:var(--uc-panel); border-color:var(--uc-line); }
.uc-workspace .uc-bits small { color:var(--uc-muted); }
.uc-workspace .uc-fuse output.changed { color:#ac6600; }
html[data-datasheet-theme="dark"] .uc-workspace .uc-fuse output.changed { color:#ffd166; }
html:not([data-datasheet-theme="dark"]) .uc-workspace :is(.port,.pwm,.adc,.comms,.interrupt,.clock,.reset,.power,.ground,.other) { --pin:#166ec0; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .pwm { --pin:#7940be; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .adc { --pin:#087c50; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .comms { --pin:#007b9c; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .interrupt { --pin:#a36800; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .clock { --pin:#b12a73; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .reset { --pin:#c33545; }
html:not([data-datasheet-theme="dark"]) .uc-workspace .power { --pin:#b24a12; }
html:not([data-datasheet-theme="dark"]) .uc-workspace :is(.ground,.other) { --pin:#506778; }
.uc-workspace .uc-rail-icon { --rail-icon:#0788c0; background:linear-gradient(145deg,#ffffff40,#ffffff08); }
.uc-workspace .uc-rail-icon.violet { --rail-icon:#9160cf; }.uc-workspace .uc-rail-icon.mint { --rail-icon:#159c82; }.uc-workspace .uc-rail-icon.cyan { --rail-icon:#008fa6; }.uc-workspace .uc-rail-icon.amber { --rail-icon:#bc840d; }.uc-workspace .uc-rail-icon.rose { --rail-icon:#d85079; }
html[data-datasheet-theme="dark"] .uc-workspace .uc-rail-icon { --rail-icon:#77ceff; }
html[data-datasheet-theme="dark"] .uc-workspace .uc-rail-icon.violet { --rail-icon:#c3a3ff; }html[data-datasheet-theme="dark"] .uc-workspace .uc-rail-icon.mint { --rail-icon:#6ce0ba; }html[data-datasheet-theme="dark"] .uc-workspace .uc-rail-icon.cyan { --rail-icon:#69dce8; }html[data-datasheet-theme="dark"] .uc-workspace .uc-rail-icon.amber { --rail-icon:#f5c36a; }html[data-datasheet-theme="dark"] .uc-workspace .uc-rail-icon.rose { --rail-icon:#ff9fb8; }
/* Package artwork is not inverted: keep the photographed/3D materials and their silver leads. */
html[data-datasheet-theme="dark"] .ds-page .ds-viewport { background-color:#edf3f7; --sheet-surface:#edf3f7; --sheet-soft:#edf3f7; --sheet-ink:#172631; --sheet-muted:#465e70; }
html[data-datasheet-theme="dark"] .ds-page .ds-pcb-view { background-color:#070d12; }
/* Circuit drawings keep their authored paper, wire colours and labels, just like the package previews. */
html[data-datasheet-theme="dark"] .ds-page .ds-internal-canvas { background:linear-gradient(145deg,#f3faff,#fff); --sheet-surface:#fff; --sheet-soft:#edf7fc; --sheet-ink:initial; --sheet-muted:initial; --sheet-blue-ink:initial; --sheet-mint-ink:initial; --sheet-amber-ink:initial; --sheet-rose-ink:initial; --sheet-violet-ink:initial; }
html[data-datasheet-theme="dark"] .ds-page { --ds-card-footer:var(--sheet-soft); }
html[data-datasheet-theme="dark"] .ds-page .ds-segmented button[aria-pressed="true"] { background:#fff; color:#0876ad; }
html[data-datasheet-theme="dark"] .ds-page .ds-icon-tile { background:linear-gradient(145deg,#ffffffed,#ffffffcc); }
html[data-datasheet-theme="dark"] .ds-page :is(.ds-lead,.ds-reference p,.ds-reference a,.ds-resource strong,.ds-resource small) { color:var(--sheet-fg); }
html[data-datasheet-theme="dark"] .ds-page .ds-resource { background:linear-gradient(125deg,var(--sheet-panel),var(--sheet-soft)); border-color:var(--sheet-line); }
html[data-datasheet-theme="dark"] .ds-page .ds-resource:has(.violet) { background:linear-gradient(125deg,var(--sheet-panel),var(--sheet-violet)); }
html[data-datasheet-theme="dark"] .ds-page .ds-resource:has(.mint) { background:linear-gradient(125deg,var(--sheet-panel),var(--sheet-mint)); }
html[data-datasheet-theme="dark"] .ds-page .ds-resource:has(.amber) { background:linear-gradient(125deg,var(--sheet-panel),var(--sheet-amber)); }
html[data-datasheet-theme="dark"] .ds-page .ds-resource:has(.rose) { background:linear-gradient(125deg,var(--sheet-panel),var(--sheet-rose)); }
html[data-datasheet-theme="dark"] .ds-page :is(.ds-family,.ds-reference,.ds-table-search,.ds-ref-search,.ds-view-dialog) { background:var(--sheet-panel); color:var(--sheet-fg); border-color:var(--sheet-line); }
html[data-datasheet-theme="dark"] .ds-page :is(.ds-reference a,.ds-breadcrumb a,.ds-spec-source a,.ds-source-link) { color:var(--sheet-accent); }
html[data-datasheet-theme="dark"] .ds-page :is(input,select,textarea) { background-color:var(--sheet-panel); color:var(--sheet-fg); border-color:var(--sheet-line); }
html[data-datasheet-theme="dark"] .ds-page :is(input,textarea)::placeholder { color:var(--sheet-muted-fg); }
html[data-datasheet-theme="dark"] .ds-page :is(.ds-workspace-content,.cl-main) :is(h1,h2,h3,p,dt,dd,label) { color:var(--sheet-fg); }
html[data-datasheet-theme="dark"] .ds-page .ds-pin-view-label { background:var(--sheet-panel); color:var(--sheet-muted-fg); }
html[data-datasheet-theme="dark"] .ds-workspace-content [data-pin-role] { --pin:#70caff; }
html[data-datasheet-theme="dark"] .ds-workspace-content [data-pin-role=ground] { --pin:#65d5a0; }
html[data-datasheet-theme="dark"] .ds-workspace-content :is([data-pin-role=supply],[data-pin-role=power]) { --pin:#ff8c9f; }
html[data-datasheet-theme="dark"] .ds-workspace-content [data-pin-role=pump] { --pin:#ebbd66; }
html[data-datasheet-theme="dark"] .ds-workspace-content [data-pin-role=rs232] { --pin:#c4a4ff; }
html[data-datasheet-theme="dark"] .ds-workspace-content [data-pin-role=output] { --pin:#71decd; }
html[data-datasheet-theme="dark"] .ds-workspace-content [data-pin-role=nc] { --pin:#b0c1ce; }
html[data-datasheet-theme="dark"] .ds-page .ds-view-dialog::backdrop { background:#050c17b3; }
@media(max-width:1350px) { .uc-workspace-bar .uc-workspace-find span { display:none; } }
@media(max-width:700px) { .ds-theme-switch { gap:2px; padding:2px; }.ds-theme-switch button { padding:6px; min-width:30px; }.ds-theme-switch button span { display:none; }.uc-workspace-bar .uc-workspace-find { display:none; } }
@media print { .ds-theme-switch { display:none; } }
