/* Shared Claude dark palette and surface roles. Light component rules remain unchanged. */
html[data-theme="dark"]{
  color-scheme:dark;
  --kp-canvas:#0A0A0A; --kp-surface:#141414; --kp-sunken:#1C1C1C; --kp-line:#262626; --kp-line-strong:#3A3A3A;
  --kp-ink:#EDEDED; --kp-ink-2:#A3A3A3; --kp-ink-3:#A3A3A3;
  --kp-green-900:#FFFFFF; --kp-green-800:#2C693F; --kp-green-700:#347A4A; --kp-green-500:#6CB07D;
  --kp-green-100:#242424; --kp-green-50:#1D1D1D;
  --kp-attention:#E9A23B; --kp-attention-ink:#F3C77E; --kp-attention-bg:#2E220F;
  --kp-progress:#8DB4D6; --kp-progress-ink:#A9C8E4; --kp-progress-bg:#182330;
  --kp-positive:#6CB07D; --kp-positive-ink:#9ED3AA; --kp-positive-bg:#16271B;
  --kp-neutral-ink:#B0B0B0; --kp-neutral-bg:#262626;
  --kp-danger:#D9675A; --kp-danger-fill:#B9473D; --kp-danger-ink:#F0A79D; --kp-danger-bg:#331917;
  --kp-shadow-1:0 1px 2px rgba(0,0,0,.4);
  --kp-shadow-2:0 12px 32px -12px rgba(0,0,0,.7),0 2px 6px rgba(0,0,0,.4);
  --kp-shadow-3:0 24px 60px -20px rgba(0,0,0,.8);
  --admin-focus-shadow:0 0 0 2px var(--kp-canvas),0 0 0 4px var(--kp-green-500);
  --green:var(--kp-green-500); --dark:var(--kp-ink); --muted:var(--kp-ink-2); --bg:var(--kp-canvas); --line:var(--kp-line); --soft:var(--kp-green-50); --danger:var(--kp-danger);
}
html[data-theme="dark"]{
 --kp-background:var(--kp-canvas);--kp-surface-muted:var(--kp-sunken);--kp-border:var(--kp-line);--kp-border-control:var(--kp-line-strong);
 --kp-text-primary:var(--kp-ink);--kp-text-secondary:var(--kp-ink-2);--kp-text-muted:var(--kp-ink-3);
 --kp-brand-green:var(--kp-green-700);--kp-brand-green-hover:var(--kp-green-800);--kp-brand-soft:var(--kp-green-50);
 --kp-success-text:var(--kp-positive-ink);--kp-success-bg:var(--kp-positive-bg);--kp-warning-text:var(--kp-attention-ink);--kp-warning-bg:var(--kp-attention-bg);
 --kp-error:var(--kp-danger-fill);--kp-error-text:var(--kp-danger-ink);--kp-error-bg:var(--kp-danger-bg);
 --kp-neutral-text:var(--kp-neutral-ink);--kp-neutral-bg:var(--kp-sunken);--kp-progress-text:var(--kp-progress-ink);--kp-focus:#9ED3AA;
}
.theme-choice{display:grid;gap:6px;padding:8px 10px 10px;margin:2px 0 6px;border-top:1px solid var(--kp-line);border-bottom:1px solid var(--kp-line)}
.theme-choice-label{font-size:12.5px;font-weight:500;color:var(--kp-ink-2)}
.theme-choice-options{display:grid;grid-template-columns:repeat(3,1fr);gap:2px;padding:3px;border-radius:var(--kp-radius-sm);background:var(--kp-sunken)}
.theme-choice-options button{min-height:32px;padding:0 8px;border:0;border-radius:8px;background:transparent;color:var(--kp-ink-2);font:500 13px var(--kp-font);cursor:pointer}
.theme-choice-options button[aria-pressed="true"]{background:var(--kp-surface);color:var(--kp-ink);font-weight:600;box-shadow:var(--kp-shadow-1)}

@media screen {
  html[data-theme="dark"] body[data-ux-surface] { color-scheme:dark;background:var(--kp-canvas);color:var(--kp-ink); }
  html[data-theme="dark"] body[data-ux-surface="portal"] .tabbar {background:rgba(20,20,20,.96);}
  @media (max-width:900px){
    html[data-theme="dark"] body[data-ux-surface="portal"] .topline {background:rgba(20,20,20,.96);}
  }
  html[data-theme="dark"] body[data-ux-surface="portal"] .shot:not(.voor) span {background:var(--kp-sunken);color:var(--kp-ink);}
  html[data-theme="dark"] body[data-ux-surface] :is(.link-btn,.textbtn,.btn-quiet) {color:var(--kp-green-500);}
  /* Actual document paper and media are excluded; these are application panels. */
  html[data-theme="dark"] body[data-ux-surface] :is(.card:not(.invoice-print),.login-card,.sheet,.account-menu,.portal-account-menu,.lightbox .seg,.close) {
    background:var(--kp-surface)!important;color:var(--kp-ink);border-color:var(--kp-line);
  }
  html[data-theme="dark"] body[data-ux-surface] :is(.kp-empty,.request-empty,.workflow-completed,.dashboard-all-clear,.request-messages,.klacht-vak,.visit-report-note,.request-facts>div,.request-next-step,.request-customer-message,.complaint-visit,.complaint-closed,.detail-notes>div,.detail-grid>div,.estate-photo-placeholder,.visits-calendar-meter,.uploads a,.visit-report-photos a,.complaint-photo-grid button,.request-linked-quote) {
    background:var(--kp-sunken)!important;color:var(--kp-ink-2);border-color:var(--kp-line);
  }
  html[data-theme="dark"] body[data-ux-surface] :is(.kp-empty,.request-empty,.dashboard-all-clear) :is(strong,h2,h3) {color:var(--kp-ink);}
  html[data-theme="dark"] body[data-ux-surface] :is(.internal-detail-item,.detail-grid>div.internal,.detail-notes>div.internal) {background:var(--kp-attention-bg)!important;color:var(--kp-attention-ink);}
  html[data-theme="dark"] body[data-ux-surface] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=submit]):not([type=button]),select,textarea) {
    background-color:var(--kp-surface)!important;color:var(--kp-ink)!important;border-color:var(--kp-line-strong)!important;color-scheme:dark;
  }
  html[data-theme="dark"] body[data-ux-surface] :is(input,textarea)::placeholder {color:var(--kp-ink-3);opacity:1;}
  html[data-theme="dark"] body[data-ux-surface] :focus-visible {outline-color:var(--kp-focus);box-shadow:0 0 0 2px var(--kp-canvas);}
  html[data-theme="dark"] body[data-ux-surface] :is(.btn.ghost,.close) {background:var(--kp-surface)!important;color:var(--kp-ink)!important;border-color:var(--kp-line-strong);}
  html[data-theme="dark"] body[data-ux-surface] :is(.home-summary-card,.complaint-row,.request-row,.profile-tab,.inline-action,.icon-action):hover {background:var(--kp-sunken)!important;}
  html[data-theme="dark"] body[data-ux-surface] .toast {background:var(--kp-sunken);color:var(--kp-ink);border:1px solid var(--kp-line);}
  html[data-theme="dark"] body[data-ux-surface] .admin-skeleton i {background:linear-gradient(100deg,var(--kp-sunken),var(--kp-line),var(--kp-sunken));}
  html[data-theme="dark"] body[data-ux-surface="portal"] a {color:var(--kp-green-500);}
  html[data-theme="dark"] body[data-ux-surface="portal"] :is(.obj-icon,.nav button[aria-current=page],.tabbar button[aria-current=page]) {color:var(--kp-green-500);}
}

/* Paper previews stay white; portal invoice details follow the application theme. */
html[data-theme="dark"] .invoice-print:not(.invoice-document) {--kp-surface:#ffffff;--kp-ink:#1a231c;--kp-ink-2:#535c52;--kp-ink-3:#62695f;--kp-text-primary:#1a231c;--kp-text-secondary:#535c52;--kp-text-muted:#62695f;--kp-line:#e3dfd4;--kp-border:#e3dfd4;color-scheme:light;}
@media screen {html[data-theme="dark"] body[data-ux-surface] .btn.danger:hover:not(:disabled) {background:#9C372F;}}

/* Shared planning/completion badges: status semantics, never purpose colours. */
body .kp-operation-status{display:inline-block;width:fit-content;flex-grow:0;justify-self:start;align-self:start;padding:2px 8px;border-radius:999px;font-size:12px;font-weight:600;line-height:1.4;background:var(--kp-neutral-bg);color:var(--kp-neutral-ink)}
body .kp-operation-status[data-state="planned"],body .kp-operation-status[data-state="rescheduled"]{background:var(--kp-progress-bg);color:var(--kp-progress-ink)}
body .kp-operation-status[data-state="ready_for_review"]{background:var(--kp-neutral-bg);color:var(--kp-neutral-ink)}
body .kp-operation-status[data-state="completed"]{background:var(--kp-positive-bg);color:var(--kp-positive-ink)}
body .kp-operation-status[data-state="cancelled"]{background:var(--kp-danger-bg);color:var(--kp-danger-ink)}
