/* SETO 2.1.032 – global contrast hardening
   Final presentation layer. Keeps semantic/status colors intact while ensuring
   readable foreground/background pairs in light and dark modes. */

/* ---------- shared readable tokens ---------- */
html[data-seto-ui="v2"]{
  --seto-readable-muted:#475467;
  --seto-readable-subtle:#344054;
  --seto-readable-link:#245f96;
}
html[data-seto-ui="v2"][data-theme="dark"]{
  --seto-readable-muted:#b9c5d3;
  --seto-readable-subtle:#d5dde7;
  --seto-readable-link:#8fc3ef;
  --seto-readable-accent:#8fc3ef;
}

/* Older module token families occasionally override the shared v2 tokens. */
html[data-seto-ui="v2"]{
  --muted:var(--seto-readable-muted)!important;
  --text-2:var(--seto-readable-subtle)!important;
  --import-muted:var(--seto-readable-muted)!important;
  --a-muted:var(--seto-readable-muted)!important;
  --analysis-muted:var(--seto-readable-muted)!important;
  --salary-muted:var(--seto-readable-muted)!important;
}
html[data-seto-ui="v2"][data-theme="dark"]{
  --muted:var(--seto-readable-muted)!important;
  --text-2:var(--seto-readable-subtle)!important;
  --import-muted:var(--seto-readable-muted)!important;
  --a-muted:var(--seto-readable-muted)!important;
  --analysis-muted:var(--seto-readable-muted)!important;
  --salary-muted:var(--seto-readable-muted)!important;
  --purple-text:#cfe6fa!important;
}

/* Common secondary text. Avoid pale grey on glass/white surfaces. */
html[data-seto-ui="v2"] body.seto-ui :is(.muted,.subtle,.hint,.sub,.source,.field-source,.menu-desc,.table-footnote,.basis-source){
  color:var(--seto-readable-muted)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui :is(label,.muted,.subtle,.hint,.sub,.source,.field-source,.menu-desc,.table-footnote,.basis-source){
  color:var(--seto-readable-muted)!important;
}

/* Accent text needs a lighter tint on dark backgrounds. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui :is(.eyebrow,.kicker,.panel-kicker,.admin-eyebrow,.import-kicker,.export-kicker,.tool-kicker,.vdn-kicker){
  color:var(--seto-readable-accent)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui h1{
  color:#dcecff!important;
}

/* ---------- importer ----------
   Unified shell made this header transparent while importer text stayed white. */
html[data-seto-ui="v2"] body[data-seto-v2-area="import"] .import-hero.seto-v2-page-header{
  padding:24px!important;
  border:1px solid rgba(143,195,239,.28)!important;
  border-radius:24px!important;
  background:
    radial-gradient(circle at 88% 0,rgba(255,255,255,.16),transparent 18rem),
    linear-gradient(135deg,#102d4a,#1f527f 56%,#3278b4)!important;
  color:#fff!important;
  box-shadow:0 15px 36px rgba(17,50,82,.17)!important;
}
html[data-seto-ui="v2"] body[data-seto-v2-area="import"] .import-hero.seto-v2-page-header :is(h1,p,.back,.import-kicker,.pill){
  color:#fff!important;
}
html[data-seto-ui="v2"] body[data-seto-v2-area="import"] .import-hero.seto-v2-page-header p{color:rgba(255,255,255,.86)!important}
html[data-seto-ui="v2"] body[data-seto-v2-area="import"] .import-hero.seto-v2-page-header :is(.back,.import-kicker){color:#d7eafb!important}
html[data-seto-ui="v2"] body[data-seto-v2-area="import"] .import-hero.seto-v2-page-header .pill{
  background:rgba(255,255,255,.14)!important;border-color:rgba(255,255,255,.30)!important
}

/* ---------- admin ----------
   UI v2 intentionally uses a light hero surface: use dark copy on it. */
html[data-seto-ui="v2"] body.seto-admin-page .admin-hero{
  color:var(--seto-ink)!important;
}
html[data-seto-ui="v2"] body.seto-admin-page .admin-hero :is(h1,p){
  color:var(--seto-ink)!important;
}
html[data-seto-ui="v2"] body.seto-admin-page .admin-hero .admin-eyebrow{
  color:var(--seto-blue)!important;
}
html[data-seto-ui="v2"] body.seto-admin-page .admin-hero .admin-btn.primary{
  background:var(--seto-navy)!important;border-color:var(--seto-navy)!important;color:#fff!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-admin-page .admin-hero :is(h1,p){color:var(--seto-ink)!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-admin-page .admin-hero .admin-eyebrow{color:var(--seto-readable-accent)!important}

/* ---------- payroll ---------- */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .panel-head{
  background:var(--seto-surface-solid)!important;
  color:var(--seto-ink)!important;
  border-color:var(--seto-line)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .panel-head :is(h2,p,strong,span){
  color:inherit!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .panel-head p{color:var(--seto-readable-muted)!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(.advanced-disclosure,.diagnostic-panel,.calendar-trace) summary{
  color:var(--seto-readable-subtle)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(.period-arrow,.icon-action,.secondary-button,.text-button,.user-chip){
  background:var(--seto-surface-solid)!important;
  color:var(--seto-ink)!important;
  border-color:var(--seto-line)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .primary-button{
  background:#245f96!important;border-color:#2f75b5!important;color:#fff!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(.editor-head,.reconcile-summary>div,.calendar-basis-grid>div){
  color:var(--seto-ink)!important;
  border-color:var(--seto-line)!important;
}

/* ---------- calendar ---------- */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-calendar-page :is(.cal-nav .btn,.btn.icon,.btn.sm){
  background:var(--seto-surface-solid)!important;
  color:var(--seto-ink)!important;
  border-color:var(--seto-line)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-calendar-page .cal-toggle{
  background:var(--seto-surface-solid)!important;
  color:var(--seto-ink)!important;
  border-color:var(--seto-line)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-calendar-page .cal-toggle:has(input:checked){
  background:color-mix(in srgb,#2f75b5 22%,var(--seto-surface-solid))!important;
  color:#dcecff!important;
  border-color:rgba(143,195,239,.38)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-calendar-page .cal-toggle small{color:var(--seto-readable-muted)!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-calendar-page .menu-icon{color:#dcecff!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-calendar-page .menu-title{color:var(--seto-ink)!important}

/* ---------- analysis ---------- */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page :is(label,.form-label,.simulation-form label){
  color:var(--seto-readable-muted)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page :is(.eyebrow,.kicker,.panel-kicker){
  color:var(--seto-readable-accent)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page h1{color:#dcecff!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page :is(.secondary,.btn.secondary,.button.secondary){
  background:var(--seto-surface-solid)!important;color:var(--seto-ink)!important;border-color:var(--seto-line)!important;
}

/* ---------- forms ---------- */
html[data-seto-ui="v2"] body.seto-ui :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  color:var(--seto-ink)!important;
}
html[data-seto-ui="v2"] body.seto-ui :is(input,textarea)::placeholder{color:#667085!important;opacity:1}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui :is(input,textarea)::placeholder{color:#9eabba!important;opacity:1}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui :is(input:disabled,select:disabled,textarea:disabled){
  color:#b9c5d3!important;-webkit-text-fill-color:#b9c5d3!important;opacity:1;
}

/* ---------- legal/docs/public small copy ---------- */
html[data-seto-ui="v2"] body.seto-ui :is(.docs-toolbar,.sidebar,.page,.card) small{color:var(--seto-readable-muted)!important}

/* Focus indication must remain visible in both themes. */
html[data-seto-ui="v2"] :focus-visible{outline:3px solid #5b9bd5!important;outline-offset:2px}
html[data-seto-ui="v2"][data-theme="dark"] :focus-visible{outline-color:#8fc3ef!important}

/* ---------- 2.1.032 audit pass II: local light islands + manual theme coverage ---------- */

/* The payroll VDN is deliberately a printable light document even when the app is dark.
   Isolate its typography from global dark-mode tokens. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet{
  --ink:#111!important;
  --muted:#555f6b!important;
  --surface:#fff!important;
  --surface-2:#eef1f4!important;
  background:#fff!important;
  color:#111!important;
  border-color:#aeb4bb!important;
  box-shadow:0 12px 34px rgba(0,0,0,.34)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet :is(.vdn-company h1,.vdn-period-box strong,.vdn-person strong,.vdn-mini-block dd,.deduction-grid strong,.vdn-net strong,.vdn-table td,.vdn-table tfoot td){
  color:#111!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet :is(.vdn-kicker,.vdn-company p,.vdn-label,.vdn-period-box span,.vdn-block-title small,.vdn-mini-block dt,.deduction-grid span,.vdn-person .vdn-fsq-inline){
  color:#555f6b!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-person .vdn-fsq-inline{
  background:#f4f6f8!important;
  border-color:#b8bcc1!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-person .vdn-fsq-inline :is(.fsq-inline-title,strong){color:#111!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-block-title{
  background:#e4e8ec!important;
  color:#20262d!important;
  border-color:#7e858d!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-table th{
  background:#435264!important;
  color:#fff!important;
  border-color:#667384!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet :is(.vdn-mini-block,.deduction-grid,.vdn-net,.vdn-person){
  border-color:#8d949c!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet :is(.vdn-mini-block,.deduction-grid>div,.vdn-net>div){background:#f7f8f9!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-net .payout{background:#e4ebf3!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-net .payout strong{color:#17365d!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-empty{color:#555f6b!important}

/* Auth CSS historically reacted only to prefers-color-scheme. Respect SETO's explicit theme. */
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] :is(.link-button,.account-links a,.legal-mini a,.check-row a,.public-tools a){
  color:#8fc3ef!important;
}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] :is(.consent-box,.mini-note,.mode-card,.local-login-panel,.recovery-form){
  color:#d5dde7!important;
}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .consent-box{
  background:#222936!important;
  border-color:#3b4555!important;
}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .check-row{color:#c4cfdd!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .mini-note{color:#b9c5d3!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] :is(input,select,textarea){background:#222936!important;color:#f3f6fa!important;border-color:#465164!important}

/* Public pages also used OS preference only. Explicit app theme must win. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-start-page{
  --bg:#0f1117!important;
  --card:#1b202b!important;
  --text:#f3f6fa!important;
  --muted:#b9c5d3!important;
  --border:#3b4555!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-start-page :is(.tool-card strong,.section-heading .eyebrow,.account-section .eyebrow){color:#8fc3ef!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-start-page :is(.login-link,.tool-card,.account-section){background:var(--card)!important;color:var(--text)!important;border-color:var(--border)!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-start-page :is(.section-heading p,.account-section p,.tool-card p,.public-footer,.public-brand small){color:var(--muted)!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-start-page .account-section .btn.primary{background:#2f75b5!important;color:#fff!important}

/* Browser-default links are too dark on minimal dark redirect/tool pages. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui a:not([class]){color:#8fc3ef}

/* Export/import workflow: hard-coded light surfaces need explicit dark counterparts. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page :is(.export-workflow-block,.export-advanced-options,.export-selected-files-main,.export-step,.export-consent-compact){
  background:var(--seto-surface-solid)!important;
  border-color:var(--seto-line)!important;
  color:var(--seto-ink)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page .workflow-number{background:#245f96!important;color:#fff!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page :is(.export-privacy-details summary,.export-advanced-options summary,.export-preview-details summary){color:#d5dde7!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page .export-step>span{background:#354052!important;color:#e8eef6!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page .export-step.is-current{background:#172f49!important;color:#b9dcfb!important;border-color:#517da8!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page .export-step.is-done{background:#153226!important;color:#8ce5aa!important;border-color:#337650!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page .export-consent-compact:has(input:checked){background:#153226!important;border-color:#337650!important}

/* Admin counters and body-specific muted token were slightly below AA. */
html[data-seto-ui="v2"] body.dedicated-admin{--a-muted:#475467!important}
html[data-seto-ui="v2"][data-theme="dark"] body.dedicated-admin{--a-muted:#b9c5d3!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-admin-page .count-badge{
  background:#263b52!important;color:#dcecff!important;border:1px solid #3e6388!important;
}

/* Simulation has descriptive inline spans with hard-coded #667085. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page :is(.advanced-details>summary span,.hero-copy>span:not(.eyebrow),.hero-metrics span,.avg-bar-item>span,.month-delta-card span,.trend-legend){
  color:#b9c5d3!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page :is(.table-details>summary,.advanced-details>summary strong){color:#dcecff!important}

/* Documentation code and active navigation stay readable on dark cards. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-hilfe-page .nav-item.active{color:#cfe6fa!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-hilfe-page code{background:#222836!important;color:#e6edf6!important;border-color:#3c4657!important}

/* Near-AA legacy muted values in light mode: keep a single safer minimum. */
html[data-seto-ui="v2"] body.seto-ui :is(.admin-panel,.tool-card,.card,.panel,.section-head,.intro,.field) :is(p,small):not(.status-chip):not(.badge){
  text-decoration-thickness:auto;
}

/* ---------- 2.1.032 audit pass III ---------- */

/* Public calendar exporter: explicit theme selection must not depend on OS preference. */
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] body{
  background:#111827!important;color:#eef2f7!important;
}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export :is(.hero,.card){
  background:#18212f!important;border-color:#344054!important;color:#eef2f7!important;
}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export :is(.hero p,.note,.status,.brand small,.check small,.help ol){color:#b9c5d3!important}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export :is(.field select,.field input[type="number"]){background:#111827!important;border-color:#475467!important;color:#eef2f7!important}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export .check{border-color:#344054!important}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export .privacy{background:#17324f!important;color:#c9ddf5!important}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export .top>a:last-child{color:#8fc3ef!important}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export .eyebrow{color:#8fc3ef!important}
html[data-seto-ui="v2"][data-seto-section="public"][data-theme="dark"] .public-export h1{color:#eef2f7!important}

/* Auth auxiliary tool links are light cards in light mode, dark cards in explicit dark mode. */
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .public-tools a{
  background:#222936!important;color:#b9dcfb!important;border-color:#3b4555!important;
}

/* Finish the VDN light-document island after generic small-text rules. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet small,
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .vdn-fsq-inline small{
  color:#555f6b!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page .vdn-sheet .sr-only{color:#111!important}

/* Import destructive controls must not keep a light card in dark theme. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-import-page .danger-ghost{
  background:#2a2021!important;color:#ffaaa4!important;border-color:#6c3f3d!important;
}

/* Analysis body copy: legacy #6b7785 values were just below AA on near-white cards. */
html[data-seto-ui="v2"] body.seto-analyse-page :is(.card p,.card small,.section-head p,.data-note,.progression-chart-note,.advanced-details>summary span,.hero-copy>span:not(.eyebrow),.hero-metrics span,.avg-bar-item>span,.month-delta-card span,.trend-legend){
  color:var(--seto-readable-muted)!important;
}

/* Docs small blue labels were 4.3:1 on the app background. */
html[data-seto-ui="v2"] body.seto-hilfe-page :is(.eyebrow,.kicker){color:#245f96!important}
html[data-seto-ui="v2"] body.seto-hilfe-page .nav-item.active{color:#17365d!important}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-hilfe-page :is(.eyebrow,.kicker,.nav-item.active){color:#cfe6fa!important}

/* Minimal redirect pages have no module typography layer. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page > :is(main,section,div) :is(p,li){color:var(--seto-readable-muted)}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-analyse-page > :is(main,section,div) a:not([class]){color:#8fc3ef!important}

/* ---------- 2.1.032 audit pass IV: gradient islands + disabled controls ---------- */

/* Public landing hero is always dark/blue, independent from app theme. Keep all copy and
   navigation tiles in the hero on the same high-contrast palette. */
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero{
  color:#fff!important;
}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-copy :is(h1,.eyebrow){color:#fff!important}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-copy>p{color:rgba(255,255,255,.88)!important}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-summary a{
  background:rgba(10,37,64,.28)!important;
  border-color:rgba(255,255,255,.24)!important;
  color:#fff!important;
}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-summary a :is(span,strong,small,b){color:#fff!important}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-summary a span{color:rgba(255,255,255,.76)!important}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-summary a small{color:rgba(255,255,255,.86)!important}
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-actions .btn.secondary{
  background:rgba(255,255,255,.92)!important;color:#17365d!important;border-color:rgba(255,255,255,.96)!important;
}

/* Auth brand panel is another permanent dark gradient island. */
html[data-seto-ui="v2"][data-seto-section="auth"] .auth-brand-panel :is(.auth-brand strong,.auth-brand small,.auth-brand-copy h2){color:#fff!important}
html[data-seto-ui="v2"][data-seto-section="auth"] .auth-brand-panel .auth-brand small{color:rgba(255,255,255,.78)!important}
html[data-seto-ui="v2"][data-seto-section="auth"] .auth-brand-panel .auth-brand-copy .eyebrow{color:#b9dcfb!important}
html[data-seto-ui="v2"][data-seto-section="auth"] .auth-brand-panel .auth-brand-copy p{color:rgba(255,255,255,.88)!important}
html[data-seto-ui="v2"][data-seto-section="auth"] .auth-brand-panel .auth-brand-footer a{color:rgba(255,255,255,.84)!important}

/* Disabled actions are still readable. Avoid white text on washed-out disabled buttons. */
html[data-seto-ui="v2"] body.seto-ui :is(button,.btn,.button,.primary-button,.secondary-button):disabled,
html[data-seto-ui="v2"] body.seto-ui :is(button,.btn,.button,.primary-button,.secondary-button)[aria-disabled="true"]{
  opacity:1!important;
  background:#e1e7ee!important;
  color:#526174!important;
  border-color:#c7d0dc!important;
  box-shadow:none!important;
  -webkit-text-fill-color:#526174!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui :is(button,.btn,.button,.primary-button,.secondary-button):disabled,
html[data-seto-ui="v2"][data-theme="dark"] body.seto-ui :is(button,.btn,.button,.primary-button,.secondary-button)[aria-disabled="true"]{
  background:#263243!important;
  color:#b9c5d3!important;
  border-color:#435064!important;
  -webkit-text-fill-color:#b9c5d3!important;
}

/* Small accent labels on plain light surfaces use the deeper accessible blue. */
html[data-seto-ui="v2"] body.seto-profil-page .eyebrow{color:#245f96!important}

/* Public hero tiles need an opaque-enough dark surface for white text. */
html[data-seto-ui="v2"][data-seto-section="public"] .public-hero .hero-summary a{background:rgba(6,31,57,.58)!important}


/* ---------- 2.1.032: Recovery visibility + complete theme/contrast audit ----------
   Recovery remains technically available, but is absent from the normal login/setup flow.
   Explicit theme selection always wins over legacy prefers-color-scheme rules. */
#showRecoveryBtn,
#setupRecoveryDeferred,
#setupRecoveryNext{
  display:none!important;
}

/* Light theme baseline: dark navy/near-black copy on white and pale surfaces. */
html[data-seto-ui="v2"]:not([data-theme="dark"]) body.seto-ui,
html[data-seto-ui="v2"][data-theme="light"] body.seto-ui{
  --seto-readable-muted:#475467!important;
  --seto-readable-subtle:#344054!important;
}

/* Payroll: only genuinely light islands keep dark copy in dark mode. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(
  .notice-box,
  .help-toc,
  .help-toc-head,
  .help-toc-head button,
  .help-article
){
  --ink:#111827!important;
  --text:#111827!important;
  --text-secondary:#344054!important;
  --muted:#475467!important;
  color:#17365d!important;
  -webkit-text-fill-color:#17365d!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(
  .notice-box,
  .help-toc,
  .help-toc-head,
  .help-article
) :is(h1,h2,h3,h4,strong,summary,label,td,th){
  color:#111827!important;
  -webkit-text-fill-color:#111827!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(
  .notice-box,
  .help-toc,
  .help-toc-head,
  .help-article
) :is(p,small,.muted,.subtle,.hint,.basis-source){
  color:#475467!important;
  -webkit-text-fill-color:#475467!important;
}

/* Payroll dark controls are true dark surfaces; never force navy text onto them. */
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(
  .shift-stat,
  .wage-editor-row input,
  .wage-editor-row select,
  .net-row input,
  .icon-btn,
  .vdn-period-control select
){
  background:var(--seto-surface-solid)!important;
  color:var(--seto-ink)!important;
  -webkit-text-fill-color:var(--seto-ink)!important;
  border-color:var(--seto-line)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(input[readonly],select:disabled){
  background:var(--seto-surface-soft)!important;
  color:var(--seto-readable-muted)!important;
  -webkit-text-fill-color:var(--seto-readable-muted)!important;
  border-color:var(--seto-line)!important;
}
html[data-seto-ui="v2"][data-theme="dark"] body.seto-payroll-page :is(.badge-ts,.badge-ns,.badge-entry,.badge-holiday){
  background:rgba(91,155,213,.13)!important;
  color:#dcecff!important;
  -webkit-text-fill-color:#dcecff!important;
  border-color:rgba(143,195,239,.20)!important;
}

/* Explicit LIGHT must win even when the OS/browser itself prefers dark. */
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="auth"]{
  --bg:#f4f5f8!important;
  --card:#fff!important;
  --text:#1f2733!important;
  --muted:#475467!important;
  --border:#d9dee7!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="auth"] :is(input,select,textarea){
  background:#fff!important;color:#1f2733!important;border-color:#c7d0dc!important;
  -webkit-text-fill-color:#1f2733!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="auth"] :is(.btn.secondary,.public-tools a,.consent-box,.mode-card,.local-login-panel,.recovery-form){
  background:#f8fafc!important;color:#344054!important;border-color:#d9dee7!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="auth"] :is(.account-links a,.legal-mini a,.check-row a,.link-button){color:#245f96!important}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="auth"] .error{background:#feeceb!important;color:#991b1b!important}

html[data-seto-ui="v2"][data-theme="light"][data-seto-section="public"]{
  --bg:#f0f2f5!important;--card:#fff!important;--text:#1f2733!important;--muted:#475467!important;--border:#dfe5ec!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="public"] body{background:var(--bg)!important;color:var(--text)!important}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="public"] :is(.login-link,.tool-card,.account-section){background:#fff!important;color:#1f2733!important;border-color:#dfe5ec!important}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="public"] :is(.public-brand small,.section-heading p,.account-section p,.tool-card p,.public-footer){color:#475467!important}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="public"] .tool-card strong{color:#17365d!important}

/* Calendar legacy prefers-color-scheme rules previously overrode manual light mode. */
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="kalender"] body.seto-calendar-page .menu-icon{
  background:color-mix(in srgb,#2f75b5 14%,#fff)!important;color:#17365d!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="kalender"] body.seto-calendar-page .help-note{
  background:#e9f1fa!important;color:#344054!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="kalender"] body.seto-calendar-page .formula{
  background:rgba(0,0,0,.05)!important;color:#111827!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="kalender"] body.seto-calendar-page .compare-status.ok{color:#15803d!important}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="kalender"] body.seto-calendar-page .compare-status.warn{color:#9a5700!important}

/* Salary analysis navigation had an unguarded OS-dark rule. */
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="analyse"] .salary-analysis-nav a{
  background:#fff!important;color:#172033!important;border-color:#d8dee8!important;
}
html[data-seto-ui="v2"][data-theme="light"][data-seto-section="analyse"] .salary-analysis-nav a.active{
  background:#17365d!important;color:#fff!important;border-color:#17365d!important;
}

/* Small text on light surfaces: AA-safe dark navy/slate. */
html[data-seto-ui="v2"][data-theme="light"] body.seto-start-page :is(
  .overview-head small,
  .home-overview-grid>.overview-card:not(.overview-card-salary) .overview-head small,
  .stat-tile small,
  .salary-stat small,
  .salary-stat span,
  .start-card-head small
){color:#526174!important}
html[data-seto-ui="v2"][data-theme="light"] body.seto-import-page .import-brand small{color:#526174!important}
html[data-seto-ui="v2"][data-theme="light"] body.seto-import-page .import-card-badge{color:#526174!important}
html[data-seto-ui="v2"][data-theme="light"] body.seto-analyse-page .compare-arrow{color:#245f96!important}
html[data-seto-ui="v2"][data-theme="light"] body.seto-profil-page .password-error{color:#991b1b!important;border-color:#b42318!important}

/* Explicitly readable calendar/export labels. */
html[data-seto-ui="v2"] body.seto-calendar-page .legend-ferien{color:#245f96!important}
html[data-seto-ui="v2"] body.seto-import-page .export-drop-zone.is-locked .export-drop-icon{color:#526174!important}

/* 2.1.058: paired surfaces also before the UI adapter adds body classes. */
html[data-seto-ui="v2"] {
  --seto-paired-bg:#fff; --seto-paired-text:#24364b; --seto-paired-muted:#475467;
}
html[data-seto-ui="v2"][data-theme="dark"] {
  --seto-paired-bg:#1f2937; --seto-paired-text:#eef3f8; --seto-paired-muted:#b9c5d3;
}
html[data-seto-ui="v2"] body :is(.delete-card,.new-invite,.json-preview,.kb-release,.roadmap-tabs,.learning-level,.setup-choice .choice-icon) {
  background:var(--seto-paired-bg)!important; color:var(--seto-paired-text)!important;
}
html[data-seto-ui="v2"] body .learning-level:has(input:checked) {
  background:var(--seto-paired-bg)!important; border-color:var(--seto-readable-link)!important;
}
html[data-seto-ui="v2"] body :is(.delete-warning,.danger-note) {background:#fff2f2!important;color:#a51d27!important}
html[data-seto-ui="v2"] body .admin-btn.danger {background:#b4232b!important;border-color:#b4232b!important;color:#fff!important}
html[data-seto-ui="v2"][data-seto-section="start"] body .setup-card h3 {color:var(--seto-paired-text)!important}
html[data-seto-ui="v2"][data-seto-section="start"] body :is(.start-card-head small,.setup-kicker,.simple-card p,.app-card p,.quick-card p) {color:var(--seto-paired-muted)!important}
html[data-seto-ui="v2"][data-seto-section="start"] body #nextShiftCalendarLink {background:var(--seto-paired-bg)!important;color:var(--seto-paired-text)!important}
html[data-seto-ui="v2"][data-seto-section="importer"] body .learning-level strong small {background:#e7f0ff!important;color:#244568!important}
/* A primary KPI is content, not a primary action button. */
html[data-seto-ui="v2"][data-seto-section="analyse"] body .user-kpi.primary {background:var(--seto-paired-bg)!important;color:var(--seto-paired-text)!important}
html[data-seto-ui="v2"] body .vdn-sheet .vdn-fsq-inline .fsq-help-popover {background:#fff!important;color:#24364b!important}
html[data-seto-ui="v2"] body .vdn-sheet .vdn-fsq-inline .fsq-help-popover :is(strong,small,p,span) {color:#24364b!important}
html[data-seto-ui="v2"] body .help-quick-card {background:#fff!important;color:#24364b!important}
html[data-seto-ui="v2"] body .help-quick-card :is(p,span,small,strong) {color:#24364b!important}
html[data-seto-ui="v2"] body .retro-grid article {background:var(--seto-paired-bg)!important;color:var(--seto-paired-text)!important}
html[data-seto-ui="v2"][data-seto-section="docs"] body .privacy-button:not(.secondary) {background:#245f96!important;color:#fff!important}
html[data-seto-ui="v2"][data-seto-section="docs"] body .privacy-button.danger {background:#b4232b!important;color:#fff!important}
html[data-seto-ui="v2"][data-seto-section="start"] body {--start-muted:var(--seto-paired-muted)}
html[data-seto-ui="v2"][data-seto-section="start"] body .start-dashboard-eyebrow {color:var(--seto-readable-link)!important;opacity:1}
html[data-seto-ui="v2"] body .smart-storage-details > summary {color:var(--seto-readable-link)!important}
html[data-seto-ui="v2"] body .import-card strong {color:var(--seto-readable-link)!important}
html[data-seto-ui="v2"] body .st-month-table th small {color:var(--seto-paired-muted)!important;opacity:1}
html[data-seto-ui="v2"] body :is(.metric-toggle,.result-tabs) button:not(.active) {color:var(--seto-paired-muted)!important}
html[data-seto-ui="v2"] body .schritt-nr {background:#245f96!important;color:#fff!important}

/* 2.1.066: readable loading and recovery state on the start page. */
html[data-seto-ui="v2"] body .start-load-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;margin:12px 0;border:1px solid var(--seto-paired-muted);border-radius:12px;background:var(--seto-paired-bg);color:var(--seto-paired-text)}
html[data-seto-ui="v2"] body .start-load-status[hidden]{display:none}
html[data-seto-ui="v2"] body .start-load-status span{display:block;color:var(--seto-paired-muted);font-size:13px}
html[data-seto-ui="v2"] body .start-load-status button{flex-shrink:0;min-height:44px;padding:10px 14px;border:1px solid #245f96;border-radius:8px;background:#245f96;color:#fff;font:inherit;cursor:pointer}
html[data-seto-ui="v2"] body .start-load-status button:focus-visible{outline:3px solid var(--seto-readable-link);outline-offset:3px}
@media(max-width:480px){html[data-seto-ui="v2"] body .start-load-status{align-items:stretch;flex-direction:column}}

/* SETO 2.1.078 – Profil-Abrechnungsbereiche */
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-form-section{background:var(--seto-surface-solid)!important;color:var(--seto-ink)!important;border-color:var(--seto-line-strong)!important}
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-readonly-section{background:var(--seto-surface-soft)!important}
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-form-section :is(h3,h4,strong,summary){color:var(--seto-ink)!important}
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-form-section :is(label,small,.form-hint){color:var(--seto-readable-muted)!important}
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-form-section :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--seto-surface-solid)!important;color:var(--seto-ink)!important;border-color:var(--seto-readable-muted)!important;opacity:1!important}
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-form-section :is(input[readonly],textarea[readonly],input:disabled,select:disabled,textarea:disabled){background:var(--seto-surface-soft)!important;color:var(--seto-readable-muted)!important;border-color:var(--seto-readable-muted)!important;opacity:1!important}
html[data-seto-ui="v2"][data-seto-section="profil"] .profile-form-section :is(input,select,textarea,summary):focus-visible{outline:3px solid var(--seto-readable-link)!important;outline-offset:2px!important;box-shadow:none!important}


/* SETO 2.1.159 – Analyse: UI2 changed the topbar from blue hero to glass surface;
   keep its copy/status on the corresponding surface palette. */
html[data-seto-ui="v2"][data-seto-section="analyse"] body.seto-analyse-page .topbar{color:var(--seto-ink)!important}
html[data-seto-ui="v2"][data-seto-section="analyse"] body.seto-analyse-page .topbar p{color:var(--seto-readable-muted,var(--seto-muted))!important}
html[data-seto-ui="v2"][data-seto-section="analyse"] body.seto-analyse-page .topbar .status{
  background:var(--seto-surface-soft)!important;color:var(--seto-ink)!important;border:1px solid var(--seto-line)!important;
}

/* SETO 2.1.159 – Auth: explicit SETO dark theme must not depend on OS prefers-color-scheme. */
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .auth-card h1{color:#f3f6fa!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] :is(.auth-text-action,.auth-more-content a,.auth-inline-button){color:#b9d8f3!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .login-mode-option{color:#b9c5d3!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .login-mode-option.active{
  background:#2a3241!important;color:#f3f6fa!important;border-color:#4a6079!important;box-shadow:none!important;
}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] :is(.auth-inline-button,.auth-more-content>a){background:#222936!important}

/* SETO 2.1.160 – Mini-App tiles follow the explicit SETO theme. */
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .auth-miniapp-tile{background:linear-gradient(135deg,#202938,#1b2230)!important;border-color:#344154!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .auth-miniapp-copy strong{color:#f4f7fb!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .auth-miniapp-copy small{color:#aebed0!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="dark"] .auth-miniapp-arrow{color:#8bc2ec!important}
html[data-seto-ui="v2"][data-seto-section="auth"][data-theme="light"] .auth-miniapp-tile{background:linear-gradient(135deg,color-mix(in srgb,var(--card) 94%,var(--blue) 6%),color-mix(in srgb,var(--card) 98%,transparent))!important}
