/* Screen-only dark palette. Base stylesheet and printed/PDF colors stay intact. */
@media screen{
 html[data-theme="dark"]{
  color-scheme:dark;background:#111214;color:#fafcfd;
  --app-bg:#111214;--app-surface:#25282c;--app-raised:#30343a;--app-input:#191d23;
  --app-text:#fafcfd;--app-muted:#d0d6dc;--app-line:#8299b3;--app-accent:#8cbfff;
  --app-selected:#223951;--app-on-accent:#122033;--app-warning:#ffe1a3;--app-warning-bg:#332c1d;
  --app-danger:#ffb4bb;--app-danger-bg:#42272e;--app-on-danger:#351216;
  --teal:var(--app-accent);--green:var(--app-text);
 }
 html[data-theme="dark"] body{background:var(--app-bg);color:var(--app-text)}
 html[data-theme="dark"] #home-pane{
  --home-bg:var(--app-bg);--home-surface:var(--app-surface);--home-raised:var(--app-raised);
  --home-text:var(--app-text);--home-muted:var(--app-muted);--home-line:var(--app-line);
  --home-accent:var(--app-accent);--home-soft:var(--app-raised);--home-focus:var(--app-accent);
  --home-selection:var(--app-accent);--home-selection-text:var(--app-on-accent);
 }
 html[data-theme="dark"] header,html[data-theme="dark"] .app-nav{background:#17191c;border-color:var(--app-line)}
 html[data-theme="dark"] .brand small,html[data-theme="dark"] .demo{color:var(--app-muted)}
 html[data-theme="dark"] .compass{color:var(--app-accent)}
 html[data-theme="dark"] .demo{border-color:var(--app-line)}
 html[data-theme="dark"] button{background:var(--app-raised);color:var(--app-text);border-color:var(--app-line)}
 html[data-theme="dark"] button.primary,html[data-theme="dark"] a.map-button{background:var(--app-accent);color:var(--app-on-accent);border-color:var(--app-accent)}
 html[data-theme="dark"] button.outline{color:var(--app-text)}
 html[data-theme="dark"] .app-nav button.active,html[data-theme="dark"] .company.active,html[data-theme="dark"] .choice.chosen{background:var(--app-selected);color:var(--app-accent);border-color:var(--app-accent)}
 html[data-theme="dark"] .company .initial,html[data-theme="dark"] .company.active .initial{background:var(--app-raised);color:var(--app-accent)}
 html[data-theme="dark"] .sheet,html[data-theme="dark"] .plan-card,html[data-theme="dark"] .visit-overview,html[data-theme="dark"] .recent-activities,html[data-theme="dark"] .sales-summary{
  background:var(--app-surface);color:var(--app-text);border-color:var(--app-line);
 }
 html[data-theme="dark"] .record,html[data-theme="dark"] .footer-actions{background:var(--app-raised);color:var(--app-text);border-color:var(--app-line)}
 html[data-theme="dark"] .card-head,html[data-theme="dark"] .subnav,html[data-theme="dark"] .divider,html[data-theme="dark"] details,html[data-theme="dark"] .links-panel,html[data-theme="dark"] .delete-area,html[data-theme="dark"] .photo-save{border-color:var(--app-line)}
 html[data-theme="dark"] .tab{background:transparent;color:var(--app-muted)}
 html[data-theme="dark"] .tab.selected,html[data-theme="dark"] .eyebrow,html[data-theme="dark"] summary,html[data-theme="dark"] .next,html[data-theme="dark"] .saved{color:var(--app-accent)}
 html[data-theme="dark"] .tab.selected{border-bottom-color:var(--app-accent)}
 html[data-theme="dark"] .hint,html[data-theme="dark"] .privacy,html[data-theme="dark"] .company small,html[data-theme="dark"] .company.active small,html[data-theme="dark"] .detail-text,html[data-theme="dark"] .info dt,html[data-theme="dark"] .record-header,html[data-theme="dark"] .empty,html[data-theme="dark"] #count,html[data-theme="dark"] .filter-label,html[data-theme="dark"] .pdf-option small,html[data-theme="dark"] .candidate small{color:var(--app-muted)}
 html[data-theme="dark"] .privacy{border-color:var(--app-line)}
 html[data-theme="dark"] .tag,html[data-theme="dark"] .product,html[data-theme="dark"] .status{background:var(--app-raised);color:var(--app-text);border-color:var(--app-line)}
 html[data-theme="dark"] .status-訪問済み{background:var(--app-selected);color:#bad9ff}
 html[data-theme="dark"] .status-不在{background:var(--app-warning-bg);color:var(--app-warning)}
 html[data-theme="dark"] .status-見送り{background:var(--app-danger-bg);color:var(--app-danger)}
 html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select,
 html[data-theme="dark"] .field input,html[data-theme="dark"] .field textarea,
 html[data-theme="dark"] #card-form textarea,html[data-theme="dark"] #card-ocr-layout,
 html[data-theme="dark"] #list-import-pane input,html[data-theme="dark"] #list-import-pane input:not([type=checkbox]):not([type=file]),
 html[data-theme="dark"] #list-import-pane textarea,html[data-theme="dark"] #list-import-pane select{
  background:var(--app-input);color:var(--app-text);border-color:var(--app-line);accent-color:var(--app-accent);
 }
 html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:var(--app-muted);opacity:1}
 html[data-theme="dark"] option{background:var(--app-surface);color:var(--app-text)}
 html[data-theme="dark"] .search{background:var(--app-input);border-color:var(--app-line)}
 html[data-theme="dark"] .search input{background:transparent}
 html[data-theme="dark"] .search span{color:var(--app-accent)}
 html[data-theme="dark"] a,html[data-theme="dark"] .search-link,html[data-theme="dark"] .card-photo-expand,html[data-theme="dark"] .saved-card-photos a,html[data-theme="dark"] .saved-card-photos>div{color:var(--app-accent)}
 html[data-theme="dark"] .search-link,html[data-theme="dark"] .registered-links .search-link,html[data-theme="dark"] .file-button,html[data-theme="dark"] .selected-company,html[data-theme="dark"] .draft-guide,html[data-theme="dark"] .url-only-note,html[data-theme="dark"] .review,html[data-theme="dark"] .lens-import,html[data-theme="dark"] .manual-crop-editor{
  background:var(--app-raised);color:var(--app-text);border-color:var(--app-line);
 }
 html[data-theme="dark"] .lens-open-link{background:var(--app-selected);color:var(--app-accent);border-color:var(--app-line)}
 html[data-theme="dark"] .card-preview,html[data-theme="dark"] .saved-card-photos img,html[data-theme="dark"] .ocr-diagnostics,html[data-theme="dark"] .ocr-result{background:var(--app-surface);border-color:var(--app-line)}
 html[data-theme="dark"] .saved-card-photos button.primary{background:var(--app-accent);color:var(--app-on-accent);border-color:var(--app-accent)}
 html[data-theme="dark"] .export-fields{border-color:var(--app-line)}
 html[data-theme="dark"] #list-import-pane .import-map,html[data-theme="dark"] #list-import-pane .import-row{background:var(--app-surface);border-color:var(--app-line)}
 html[data-theme="dark"] #list-import-pane .import-excluded,html[data-theme="dark"] #list-import-pane .import-compare{background:var(--app-raised);color:var(--app-text);border-color:var(--app-line)}
 html[data-theme="dark"] dialog{background:var(--app-surface);color:var(--app-text);border:1px solid var(--app-line);box-shadow:0 20px 80px #0009}
 html[data-theme="dark"] dialog::backdrop{background:#07090dcc}
 html[data-theme="dark"] .error,html[data-theme="dark"] .notice,html[data-theme="dark"] .ocr-notice,html[data-theme="dark"] .candidate-box,html[data-theme="dark"] #list-import-pane .import-warning{background:var(--app-warning-bg);color:var(--app-warning);border-color:#bea15d}
 html[data-theme="dark"] .required,html[data-theme="dark"] .save-failed,html[data-theme="dark"] .delete-error,html[data-theme="dark"] #link-error{color:var(--app-danger)}
 html[data-theme="dark"] button.danger-outline{background:var(--app-danger-bg);color:var(--app-danger);border-color:var(--app-danger)}
 html[data-theme="dark"] button.danger{background:var(--app-danger);color:var(--app-on-danger);border-color:var(--app-danger)}
 html[data-theme="dark"] #toast{background:var(--app-selected);color:var(--app-text);border:1px solid var(--app-line)}
 html[data-theme="dark"] #bulk-print-table table{background:var(--app-surface);color:var(--app-text)}
 html[data-theme="dark"] #bulk-print-table th,html[data-theme="dark"] #bulk-print-table td{border-color:var(--app-line)}
 html[data-theme="dark"] button:focus-visible,html[data-theme="dark"] input:focus-visible,html[data-theme="dark"] textarea:focus-visible,html[data-theme="dark"] select:focus-visible,html[data-theme="dark"] a:focus-visible,html[data-theme="dark"] summary:focus-visible{outline:3px solid var(--app-accent);outline-offset:3px}
}
