/* Per-browser appearance. Screen-only colors keep engineering printouts light. */
.user-theme-control{position:relative;display:inline-flex;align-items:center;flex-shrink:0}
.user-theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:35px;padding:7px 10px;border:1px solid var(--border,#dce5f0);border-radius:7px;background:var(--card-background,#fff);color:var(--muted-text,#526379);font:500 10px/1.4 Inter,"Segoe UI",Arial,sans-serif;white-space:nowrap;cursor:pointer}
.user-theme-toggle:hover{color:var(--primary,#0556a5);border-color:var(--primary,#0556a5)}
.user-theme-toggle[aria-pressed="true"]{box-shadow:inset 0 -2px 0 var(--accent,#f4783a)}
.user-theme-toggle:focus-visible{outline:2px solid var(--primary,#0556a5);outline-offset:3px}
.user-theme-toggle svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.user-theme-toggle .user-theme-sun{display:none}
[data-theme="dark"] .user-theme-toggle .user-theme-sun{display:block}
[data-theme="dark"] .user-theme-toggle .user-theme-moon{display:none}
.user-theme-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.user-theme-status[data-save-error="true"]{position:absolute;top:calc(100% + 5px);right:0;z-index:20;width:230px;height:auto;margin:0;padding:9px 11px;overflow:visible;clip:auto;white-space:normal;border:1px solid var(--border,#dce5f0);border-radius:6px;background:var(--card-background,#fff);color:var(--text,#17324d);font-size:11px;line-height:1.5;box-shadow:0 4px 15px #0002}
.user-theme-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap}
@media(max-width:450px){.user-theme-toggle{min-height:36px;padding:7px 8px}.admin-header{flex-wrap:wrap}.user-theme-header-actions{gap:9px}.unlock-heading{flex-wrap:wrap}.unlock-heading .user-theme-header-actions{margin-left:auto}}
@media screen{
  :root[data-theme="dark"]{
    color-scheme:dark;
    --page-background:#101a28!important;--card-background:#192638!important;
    --primary:#8ac4ff!important;--accent:#ff985f!important;
    --text:#e8eff8!important;--muted-text:#adbed2!important;
    --heading-text:#93c9ff!important;--label-text:#dce8f6!important;
    --result-text:#93c9ff!important;--button-text:#102035!important;
    --recommendation-background:#123e70!important;--recommendation-text:#f1f6fc!important;
    --border:#3b506a!important;--preview-background:#142235!important;--preview-label-text:#b4c7de!important;
    --admin-green:#93c9ff;--admin-accent:#ff985f;--admin-border:#3b506a;--admin-muted:#adbed2;
    --red:#ffb4a4;--canvas:var(--page-background);--paper:var(--card-background);--green:var(--primary);--lime:var(--accent);--muted:var(--muted-text);--line:var(--border);
    color:var(--text);background:var(--page-background);
  }
  [data-theme="dark"] body{color:var(--text);background:var(--page-background)}
  [data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),textarea,select){color:var(--text);background:var(--card-background);border-color:var(--border)}
  [data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted-text)}
  [data-theme="dark"] :is(input,textarea,select):focus-visible{outline-color:var(--primary)}
  [data-theme="dark"] :is(button,a,summary):focus-visible{outline-color:var(--primary)}
  [data-theme="dark"] :is(h1,h2,h3,.catalog-code,.catalog-featured-copy>strong,.visitor-card-heading>strong,.visitor-block-row strong){color:var(--heading-text)}
  [data-theme="dark"] :is(.back-link,.quiet-button,.field-group-heading,.text-limit,.visibility-group>legend,.county-row .table-tag,.unlock-intro,.unit-field>span,.calculation-details>.details-content,.calculation-details h3,.source-links a,th){color:var(--muted-text)}
  [data-theme="dark"] :is(.auth-card,.editor-card,.save-bar,.outline-button,.color-inputs,.catalog-sizes-dialog,.catalog-size-fields select,.county-order-button,.catalog-featured-list>li,.visitor-card,.access-lock-toggle,.unlock-card){background:var(--card-background);border-color:var(--border);color:var(--text)}
  [data-theme="dark"] :is(.county-row:hover,.county-row:has(input:checked),.visibility-row:hover,.catalog-import-form,.catalog-item-hidden,.catalog-sizes-close,.catalog-size-tool,.catalog-featured,.visitor-block-row,.access-lock){background:var(--page-background);border-color:var(--border)}
  [data-theme="dark"] :is(.catalog-instructions code,.catalog-size-fields select,.option-default select){color:var(--text)}
  [data-theme="dark"] .catalog-import-form input[type="file"]::file-selector-button,[data-theme="dark"] .visitor-count{background:#233c59;color:var(--primary);border-color:var(--border)}
  [data-theme="dark"] :is(.primary-button,.calculate-button){background:#8ac4ff;border-color:#8ac4ff;color:#102035}
  [data-theme="dark"] :is(.primary-button:hover:enabled,.calculate-button:hover:enabled){background:#b3d9ff}
  [data-theme="dark"] :is(.bracing-viewer-toolbar button:hover,.bracing-viewer-toolbar button[aria-pressed="true"]){color:#102035}
  [data-theme="dark"] :is(.form-error,.error-notice){background:#3b2628;color:#ffbeae;border-color:#82534f}
  [data-theme="dark"] :is(.no-match,.lock-mark,.catalog-size-default,.catalog-featured-hidden,.visitor-badge-blocked){background:#3d2b24;color:#ffbb8e;border-color:#785743}
  [data-theme="dark"] :is(.no-match h3,.no-match p,.visibility-parent-hint,.visitor-danger,.field-error,.lock-session-error){color:#ffbb9a}
  [data-theme="dark"] :is(.success-notice,.visitor-badge-online){background:#163b32;color:#ace4c7;border-color:#38775b}
  [data-theme="dark"] .visitor-badge:not(.visitor-badge-online):not(.visitor-badge-blocked){background:#26384d;color:#c0d0e1}
  [data-theme="dark"] .post-count-badge{color:#102035}
  [data-theme="dark"] .recommendation :is(h3,.recommendation-label,.capacity-line,.capacity-line strong){color:var(--recommendation-text)}
  [data-theme="dark"] .catalog-item>img{background:#f4f7fb}
  [data-theme="dark"] :is(.picture-picker,.catalog-sizes-dialog,.app-notice)::backdrop{background:#030914ba}
  [data-theme="dark"] .user-theme-toggle{background:var(--card-background);color:var(--text);border-color:var(--border)}
}
@media print{.user-theme-control{display:none!important}:root[data-theme="dark"]{color-scheme:light}}
