.appearance-dialog{width:min(560px,calc(100vw - 28px));max-width:560px;max-height:90dvh;overflow:auto}.appearance-options{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:20px 0}.appearance-option{display:grid;grid-template-columns:20px 1fr;gap:10px;align-content:start;padding:16px;border:1px solid var(--line);border-radius:12px;cursor:pointer}.appearance-option:has(input:checked){outline:2px solid var(--green)}.appearance-option input{width:auto;margin:0}.appearance-option strong,.appearance-option small{grid-column:1/-1}.appearance-swatch{display:block;height:48px;border-radius:6px;border:1px solid #80909d}.appearance-swatch.light{background:linear-gradient(90deg,#ffffff 65%,#21644e 65%)}.appearance-swatch.dark{background:linear-gradient(90deg,#252525 65%,#65b7ff 65%)}@media(max-width:420px){.appearance-options{grid-template-columns:1fr}}
@media screen{
html[data-theme="dark-blue"]{color-scheme:dark;--ink:#ededed;--muted:#b6b6b6;--line:#454545;--green:#80c4ff;--pale:#343434;--paper:#1b1b1b;--amber:#efb968;--surface:#252525;--surface-soft:#303030;--button-ink:#071b2e;--sidebar:#252525;--header:#1b1b1b;--field:#202020}
html[data-theme="dark-blue"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark-blue"] :is(body>aside,.card,.serverbar,dialog,.global-search-results,.global-search-box,.materialrecord,.serverpanel .material-category,.serverpanel .manufacturer-level){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme="dark-blue"] body>aside{background:var(--sidebar)}
html[data-theme="dark-blue"] body>main:not(:has(#app)){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme="dark-blue"] main>header{background:var(--header);border-color:var(--line)}
html[data-theme="dark-blue"] :is(input,select,textarea){background:var(--field);color:var(--ink);border-color:var(--line);accent-color:var(--green)}
html[data-theme="dark-blue"] :is(a,.textbtn,summary,.brand,.invoicebrand,.eyebrow,.formstatus){color:var(--green)}
html[data-theme="dark-blue"] :is(.btn,.machine,.positiontab){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html[data-theme="dark-blue"] :is(.btn.primary,.serverform button,body>main:not(:has(#app)) button){background:var(--green);color:var(--button-ink);border-color:var(--green)}
html[data-theme="dark-blue"] :is(.machine.selected,.positiontab.selected,.pill,.tag,.num,.avatar,.minnote,.summarytop,.documentnotice,.serverpanel .variant-level,.report-track){background:var(--pale);color:var(--ink);border-color:var(--line)}
html[data-theme="dark-blue"] :is(.summarybody,.summaryfooter,.positioncost,.extra-material){background:var(--surface);color:var(--ink);border-color:var(--line)}
html[data-theme="dark-blue"] :is(.subtitle,.micro,.notice,.rate,.sumrow,small,th,.serverform p,body>main:not(:has(#app)) p){color:var(--muted)}
html[data-theme="dark-blue"] :is(.sumrow b,.price,label,.customername,.global-search-hit){color:var(--ink)}
html[data-theme="dark-blue"] :is(nav button,.navlink,.sidebar-account form button){color:var(--muted)}
html[data-theme="dark-blue"] :is(nav button.active,.navlink.active,nav button:hover,.navlink:hover,.global-search-hit:hover,.global-search-hit:focus-visible){background:var(--pale);color:var(--green)}
html[data-theme="dark-blue"] :is(.error,.syncerror,.danger){color:#ffaaa4}
html[data-theme="dark-blue"] :is(.sheet,.sheet *){color-scheme:light;--ink:#23352f;--muted:#75817b;--line:#e2e6df;--green:#21644e;--pale:#eaf2ec;color:var(--ink)}
html[data-theme="dark-blue"] .sheet{background:#fff}
html[data-theme="dark-blue"] .machine.selected{box-shadow:0 0 0 1px var(--green);border-color:var(--green)}
html[data-theme="dark-blue"] .checkrow{background:var(--pale);color:var(--ink);border-color:var(--line)}
html[data-theme="dark-blue"] .unit>span{color:var(--muted)}
html[data-theme="dark-blue"] #toast{background:#e6e6e6;color:#222222}
html[data-theme="dark-blue"] dialog::backdrop{background:#000000b8}
}

.appearance-editor{width:min(780px,calc(100vw - 28px));max-width:780px}.appearance-editor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}.appearance-color{display:grid;grid-template-columns:1fr 48px 94px;align-items:center;gap:10px;margin:0;padding:10px;border:1px solid var(--line);border-radius:8px}.appearance-color input[type=color]{width:48px;height:42px;padding:3px;margin:0}.appearance-color input[type=text]{width:94px;font-size:12px;margin:0;padding:10px}.appearance-editor>.actions:last-child{position:sticky;bottom:0;padding:12px 0;background:var(--surface,#fff);z-index:2}.appearance-editor-note{border:1px solid var(--line);border-radius:8px;padding:12px;line-height:1.6}.appearance-swatch.custom{background:linear-gradient(135deg,#555 25%,#80c4ff 25%,#80c4ff 50%,#ddd 50%,#ddd 75%,#252525 75%)}@media(max-width:650px){.appearance-editor-grid{grid-template-columns:1fr}.appearance-color{grid-template-columns:1fr 44px 88px;font-size:12px}.appearance-color input[type=text]{width:88px}}

/* Keep recovery controls readable even while an unreadable palette is previewed. */
@media screen{html[data-appearance="custom"] .appearance-dialog,.appearance-editor{--ink:#ededed;--muted:#b6b6b6;--line:#555555;--green:#80c4ff;--pale:#343434;--surface:#252525;--surface-soft:#303030;--field:#202020;--button-ink:#071b2e;background:var(--surface);color:var(--ink);color-scheme:dark}}
