/* White is the original interface; all dark overrides are screen-only. */
.appearance-card { padding:26px; margin-bottom:26px; }
.appearance-card h2 { margin-bottom:8px; font-size:1.15rem; }
.appearance-choices { display:flex; flex-wrap:wrap; gap:16px; padding:0; margin:20px 0 0; border:0; }
.appearance-choices legend { font-size:.88rem; font-weight:600; margin-bottom:12px; }
.theme-choice { display:flex; align-items:center; gap:12px; padding:15px 20px; min-height:62px; border:1px solid var(--line); border-radius:12px; cursor:pointer; }
.theme-choice:has(:checked) { outline:2px solid var(--accent); outline-offset:2px; }
.theme-choice input { width:20px; height:20px; accent-color:#157b70; }
.theme-swatch { width:28px; height:28px; border-radius:8px; border:1px solid #8194a9; }
.theme-swatch-dark { background:#101d32; }
.theme-swatch-white { background:#fff; }
@media screen {
  :root[data-theme="dark"] {
    color-scheme:dark;
    --canvas:#0b1426; --surface:#142239; --ink:#f5f7fc; --muted:#bac9dd;
    --line:#354860; --nav:#101d32; --nav-muted:#bac9dd;
    --accent:#80dfd0; --accent-dark:#a2eade; --accent-soft:#1b3c46;
    --danger:#ffb3bb; --menu-shadow:0 8px 28px #0003,0 2px 5px #0002;
  }
  :root[data-theme="dark"] :is(.site-navbar,.menu-tile,.account-popover,.workspace-chip,
    .chat-compose,.message-bubble,.completion-dialog,.menu-toggle,.move-field,.help-sections a,
    .button-secondary,.common-field-labels > span,.skip-link) {
    background:var(--surface); color:var(--ink); border-color:var(--line);
  }
  :root[data-theme="dark"] :is(.account-popover a,.account-popover button) { background:transparent; color:var(--ink); }
  :root[data-theme="dark"] .account-popover button { color:var(--danger); }
  :root[data-theme="dark"] :is(.account-popover a:hover,.button-secondary:hover,.chat-contact:hover) { background:#223650; }
  :root[data-theme="dark"] :is(.account-popover button:hover,.remove-field:hover) { background:#4a2639; }
  :root[data-theme="dark"] :is(.chat-directory,.chat-history,.ticket-messages,th,.editor-field,.field-add-panel) { background:#101d32; }
  :root[data-theme="dark"] :is(.message-own,.common-fields,.answer-branch,.editor-condition,.editor-section,.conditional-service-section) {
    background:#193240; border-color:#3a5c66;
  }
  :root[data-theme="dark"] .settings-role { background:#263b55; }
  :root[data-theme="dark"] :is(.count-inactive,.wizard-steps span) { background:#263b55; }
  :root[data-theme="dark"] .menu-tile:hover { border-color:#80dfd0; box-shadow:0 14px 32px #0004; }
  :root[data-theme="dark"] .button:not(.button-secondary):not(.button-danger),
  :root[data-theme="dark"] :is(.brand-mark,.wizard-steps .is-active span,.help-sections a[aria-current="page"]) {
    background:#157b70; color:#fff;
  }
  :root[data-theme="dark"] .button:not(.button-secondary):not(.button-danger):hover { background:#11665e; }
  :root[data-theme="dark"] .button-danger { background:#b42332; color:#fff; }
  :root[data-theme="dark"] .button-danger:hover { background:#951e2b; }
  /* Controls stay white with dark text; their surrounding labels stay light. */
  :root[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),select,textarea):not([data-editor-root] *) {
    color-scheme:light; background:#fff; color:#17202d; border-color:#a9bcc6; caret-color:#17202d;
  }
  :root[data-theme="dark"] :is(input,textarea)::placeholder { color:#596675; opacity:1; }
  :root[data-theme="dark"] :is(input,select,textarea):disabled { background:#e8edf3; color:#4d5b6b; opacity:1; }
  :root[data-theme="dark"] :is(input[type="checkbox"],input[type="radio"]) { color-scheme:light; accent-color:#157b70; }
  :root[data-theme="dark"] input::file-selector-button { color:#17202d; background:#edf1f5; border:1px solid #a9bcc6; border-radius:5px; padding:5px 10px; cursor:pointer; }
  :root[data-theme="dark"] .password-toggle { color:#08554f; }
  :root[data-theme="dark"] .password-toggle:hover { background:#e4f2ee; }
  :root[data-theme="dark"] .choice-list label { background:white; color:#17202d; }
  :root[data-theme="dark"] .error { background:#472737; border-color:#8b5161; color:#ffd4da; }
  :root[data-theme="dark"] .success { border-color:#3a7269; }
  :root[data-theme="dark"] .menu-login { background:radial-gradient(ellipse at 12% 40%,#18394c 0,transparent 60%),var(--canvas); }
  :root[data-theme="dark"] .menu-login :is(.login-form,.login-illustration) { background:var(--surface); border-color:var(--line); box-shadow:var(--menu-shadow); }
  :root[data-theme="dark"] .menu-login :is(.login-note,.illustration-row) { border-color:var(--line); }
  :root[data-theme="dark"] .login-avatar { background:var(--accent-soft); }
  :root[data-theme="dark"] .avatar { border-color:var(--surface); color:#08554f; }
}
