/* Shared dark palette. Existing CSS fallbacks preserve the light appearance. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --wt-surface: #192826;
    --wt-surface-alt: #101b1a;
    --wt-text: #e4eeeb;
    --wt-muted: #b0c3bd;
    --wt-on-accent: #ffffff;
    --wt-border: #465b55;
    --wt-shadow: rgba(0, 0, 0, .22);
    --wt-overlay: rgba(0, 0, 0, .7);
    --wt-success-text: #a4e4cf;
    --wt-success-soft: #203e34;
    --wt-success-border: #46695d;
    --wt-success-solid: #266756;
    --wt-error-text: #ffb7b7;
    --wt-error-soft: #432b2e;
    --wt-error-border: #855557;
    --wt-error-solid: #913e42;
    --wt-warning-text: #f6d58b;
    --wt-warning-soft: #403722;
    --wt-warning-border: #827043;
    --wt-warning-solid: #705612;
    --wt-info-text: #b8d1f3;
    --wt-info-soft: #25394e;
    --wt-info-border: #50667c;
    --wt-info-solid: #305d8c;
    --wt-violet-text: #dfc5f3;
    --wt-violet-soft: #3b2e49;
    --wt-violet-border: #78608a;
    --wt-violet-solid: #68477e;
}
:root[data-theme="light"] { color-scheme: light; }
.theme-control { display:inline-flex; align-items:center; gap:10px; font-size:14px; color:var(--wt-muted,#61706b); }
.theme-control__field { position:relative; display:inline-flex; min-width:0; }
.theme-control select, .theme-control .theme-control__button {
    box-sizing:border-box; width:180px; min-width:0; min-height:50px;
    padding:11px 14px; border:1px solid var(--wt-success-border,#bddfd2);
    border-radius:14px; background:var(--wt-surface,#fff);
    color:var(--wt-text,#17232a); font:inherit; line-height:1.4;
    text-align:left; cursor:pointer;
}
.theme-control .theme-control__button { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.theme-control select { appearance:none; -webkit-appearance:none; padding-right:44px; }
.theme-control select[hidden] { display:none !important; }
.theme-control__field--native::after {
    content:""; pointer-events:none; position:absolute; right:20px; top:50%;
    width:8px; height:8px; border-right:2px solid var(--wt-muted,#5d6873);
    border-bottom:2px solid var(--wt-muted,#5d6873); transform:translateY(-65%) rotate(45deg);
}
@media (hover: hover) and (pointer: fine) {
.theme-control :is(select,button):hover { border-color:var(--wt-success-border,#7eb9ae); background:var(--wt-success-soft,#eef8f5); }
}
.theme-control :is(select,button):focus-visible { outline:2px solid var(--wt-success-text,#287568); outline-offset:2px; }
/* Theme and sign-out belong to the verified identity, not notifications. */
.identity__actions { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:14px; grid-column:2; min-width:0; }
.identity__actions [data-theme-host] { flex:1 1 auto; min-width:0; max-width:260px; }
.identity__actions .theme-control { display:flex; width:100%; gap:8px; }
.identity__actions .theme-control__field { flex:1; }
.identity__actions .theme-control :is(select,.theme-control__button) { width:100%; min-height:44px; padding:9px 14px; }
.identity__actions .theme-control__button > span { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
html body .identity__actions .identity__logout { flex:0 0 auto; margin:0; }
.identity__actions .identity__logout button { width:88px; min-height:44px; padding:9px 12px; font-size:14px; border-radius:14px; }
@media (max-width:480px) {
    .identity__actions { gap:10px; }
    .identity__actions .theme-control > span:not(.theme-control__field) { display:none; }
}
@media print {
    :root[data-theme] { color-scheme:light; }
    [data-theme-host] { display:none !important; }
}
html[data-theme="dark"], html[data-theme="dark"] body { background:var(--wt-surface-alt); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color:var(--wt-muted); opacity:1; }
@media print { :root[data-theme="dark"] { --wt-surface:initial;--wt-surface-alt:initial;--wt-text:initial;--wt-muted:initial;--wt-on-accent:initial;--wt-border:initial;--wt-shadow:initial;--wt-overlay:initial;--wt-success-text:initial;--wt-success-soft:initial;--wt-success-border:initial;--wt-success-solid:initial;--wt-error-text:initial;--wt-error-soft:initial;--wt-error-border:initial;--wt-error-solid:initial;--wt-warning-text:initial;--wt-warning-soft:initial;--wt-warning-border:initial;--wt-warning-solid:initial;--wt-info-text:initial;--wt-info-soft:initial;--wt-info-border:initial;--wt-info-solid:initial;--wt-violet-text:initial;--wt-violet-soft:initial;--wt-violet-border:initial;--wt-violet-solid:initial; } html[data-theme="dark"], html[data-theme="dark"] body { background:white; } }

/* Align the browser theme label with the identity details column. */
html.browser-ui .identity__actions [data-theme-host] { max-width:none; }
html.app-ui .identity__actions .theme-control > span:not(.theme-control__field) { display:none; }

/* Use the same columns as the login row; logout starts below its value. */
html.browser-ui .identity__actions { display:grid; grid-template-columns:minmax(110px, 0.7fr) minmax(0, 1fr); gap:12px; }
html.browser-ui .identity__actions .identity__logout { justify-self:stretch; width:100%; }
html.browser-ui .identity__actions .identity__logout button { width:100%; }
html.app-ui #identity-username,
html.app-ui #identity-id { text-align:right; }

/* On phones align the login text with the center of the visible logout. */
@media (max-width:899px) {
    html.browser-ui #identity-username { text-align:center; }
    html.app-ui .identity:has(.identity__logout:not([hidden])) #identity-username { width:88px; justify-self:end; text-align:center; }
}

/* Mini App: the theme selector fills the identity action row */
html.app-ui .identity__actions [data-theme-host] { max-width:none; }

/* Shared typography by semantic level, independent of section-specific layout */
:root { --wt-heading-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; --wt-section-title:20px; --wt-card-title:18px; --wt-subtitle:16px; --wt-eyebrow:13px; }
html body .module-panel h2,html body .app-modal h2 { font-family:var(--wt-heading-font); font-size:var(--wt-section-title); line-height:1.3; font-weight:700; letter-spacing:normal; }
html body .module-panel h3,html body .app-modal h3,html body .monthly-detail__heading h2,html body .operations__employee,html body .shift__employee,html body #smoke-name { font-family:var(--wt-heading-font); font-size:var(--wt-card-title); line-height:1.35; font-weight:700; letter-spacing:normal; }
html body .module-panel h4,html body .app-modal h4 { font-family:var(--wt-heading-font); font-size:var(--wt-subtitle); line-height:1.4; font-weight:700; letter-spacing:normal; }
html body .section-label,html body .module-panel .section-label,html body .shift__label,html body .shift__intervals-title { font-family:var(--wt-heading-font); font-size:var(--wt-eyebrow); line-height:1.4; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
