/* Approved palette: Graphite and Copper. Layout identity stays independent of appearance.
   Load after component styles. The CSS media query also works when JavaScript is disabled. */
html:root {
  color-scheme: light;
  --paper:#F5F1EB; --ink:#253036; --muted:#546169; --accent:#895631;
  --on-accent:#FFFFFF; --button-ink:#FFFFFF; --hover:#6D4023; --accent-hover:#6D4023;
  --soft:#E9E2D9; --line:#B5ADA3; --field:#FFFFFF; --input:#FFFFFF;
  --field-line:#B5ADA3; --button-line:#B5ADA3; --button-border:#B5ADA3;
  --header:#F5F1EB; --header-ink:#253036; --header-line:#B5ADA3;
  --caption:#F5F1EB; --caption-ink:#253036; --photo:#E9E2D9; --photo-caption:#F5F1EB;
  --meta:#895631; --meta-ink:#FFFFFF; --demo:#E9E2D9; --selection:#E9E2D9;
  --secondary-hover:#E9E2D9; --focus:#895631;
  background:var(--paper); scrollbar-color:var(--muted) var(--paper);
}
@media (prefers-color-scheme:dark) {
  html:root:not([data-site-theme="light"]) {
    color-scheme:dark;
    --paper:#182329; --ink:#F4EDE4; --muted:#BBC4C5; --accent:#C78E65;
    --on-accent:#182329; --button-ink:#182329; --hover:#D9A680; --accent-hover:#D9A680;
    --soft:#223238; --line:#607075; --field:#2A3C42; --input:#2A3C42;
    --field-line:#607075; --button-line:#607075; --button-border:#607075;
    --header:#182329; --header-ink:#F4EDE4; --header-line:#607075;
    --caption:#182329; --caption-ink:#F4EDE4; --photo:#223238; --photo-caption:#182329;
    --meta:#C78E65; --meta-ink:#182329; --demo:#223238; --selection:#223238;
    --secondary-hover:#223238; --focus:#C78E65;
  }
}
html:root[data-site-theme="dark"] {
    color-scheme:dark;
    --paper:#182329; --ink:#F4EDE4; --muted:#BBC4C5; --accent:#C78E65;
    --on-accent:#182329; --button-ink:#182329; --hover:#D9A680; --accent-hover:#D9A680;
    --soft:#223238; --line:#607075; --field:#2A3C42; --input:#2A3C42;
    --field-line:#607075; --button-line:#607075; --button-border:#607075;
    --header:#182329; --header-ink:#F4EDE4; --header-line:#607075;
    --caption:#182329; --caption-ink:#F4EDE4; --photo:#223238; --photo-caption:#182329;
    --meta:#C78E65; --meta-ink:#182329; --demo:#223238; --selection:#223238;
    --secondary-hover:#223238; --focus:#C78E65;
}

html:root body {background:var(--paper);color:var(--ink);scrollbar-color:var(--muted) var(--paper);}
html:root ::selection {background:var(--accent);color:var(--on-accent);}
html:root :is(input,textarea,select) {caret-color:var(--ink);accent-color:var(--accent);}
html:root :is(input,textarea)::placeholder {color:var(--muted);opacity:1;}
html:root :is(header,.header,.mobile-bar,footer) {background:var(--paper);color:var(--ink);border-color:var(--line);}
html:root :is(.viewer-panel,.studio,.canvas-wrap,.scene-stage,.configurator-scene,.scene-fallback) {background:var(--soft);border-color:var(--line);}
html:root :is(.viewer-top,.scene-controls,.boat-picker,.studio-panel,.scene-camera) {background:transparent;border-color:var(--line);}
html:root :is(.scene-angles,.service-column li,.prepare-grid li,.scene-fallback .photo-note) {border-color:var(--line);}
html:root :is(.tents-section,.prepare-section,.process-section,.contact-form) {
  --muted:inherit;--line:inherit;--button-line:inherit;--secondary-hover:inherit;
  background:var(--soft);color:var(--ink);
}
html:root .review-section {background:var(--soft);color:var(--ink);}
html:root :is(.photo,.work-photo,.storage-photo,.tents-grid .photo,.case-layout .photo,.storage-layout .photo) {background:var(--photo);}
html:root :is(.photo span,.model-label) {background:var(--photo-caption);color:var(--ink);}
html:root :is(.hero-copy>p,.viewer-top span,.scene-note,.scene-help,.scene-status,.fine,.note,.bc-help,.prepare-grid p,.storage-copy>p,.contact-copy>p,.service-column small,.scene-fallback p,.tents-copy>p,.review-note) {color:var(--muted);}
html:root :is(.service-column h3,.prepare-grid li:before,.form-status,.contact-status) {color:var(--accent);}
html:root :is(.scene-button,.scene-camera button,.scene-parts button,.task-choices button) {background:var(--field);color:var(--ink);border-color:var(--line);}
html:root :is(.scene-button,.scene-camera button,.scene-parts button,.task-choices button)[aria-pressed=true] {background:var(--accent);color:var(--on-accent);border-color:transparent;box-shadow:none;outline:0;}
html:root body .primary {background:var(--accent);color:var(--on-accent);border-color:var(--accent);}
html:root body .secondary {background:transparent;color:var(--ink);border-color:var(--line);}
html:root :is(.scene-button,.scene-camera button,.scene-parts button,.task-choices button):focus-visible {outline:0;box-shadow:none;text-decoration:underline;text-underline-offset:4px;}
html:root :is(canvas):focus-visible {outline:0;box-shadow:none;}
html:root :is(.canvas-wrap,.scene-stage,.configurator-scene):has(canvas:focus-visible) {background:var(--field);}
@media (hover:hover) and (pointer:fine) {
  html:root body .primary:hover {background:var(--hover);color:var(--on-accent);border-color:var(--hover);}
  html:root :is(.scene-button,.scene-camera button,.scene-parts button,.task-choices button):not(:disabled):hover {background:var(--soft);color:var(--ink);border-color:var(--line);}
  html:root :is(.scene-button,.scene-camera button,.scene-parts button,.task-choices button)[aria-pressed=true]:not(:disabled):hover {background:var(--hover);color:var(--on-accent);border-color:transparent;}
  html:root :is(.service-column a,.tents-copy .text-link):hover {color:var(--accent);}
}

/* The theme control is a small disclosure, separate from the site menu. */
.theme-picker {display:none;position:relative;flex:none;align-items:center;z-index:20;}
html[data-site-theme] .theme-picker {display:inline-flex;}
html:root .theme-toggle {display:inline-flex;align-items:center;justify-content:center;min-width:56px;min-height:44px;padding:10px 12px;border:0;border-radius:0;background:transparent;color:var(--ink);font:inherit;font-size:13px;font-weight:500;cursor:pointer;}
html:root .theme-toggle[aria-expanded=true] {background:var(--soft);}
html:root .theme-options {position:absolute;inset-inline-end:0;top:calc(100% + 8px);display:grid;min-width:174px;max-width:calc(100vw - 36px);gap:4px;padding:8px;background:var(--field);color:var(--ink);border:1px solid var(--line);z-index:30;}
html:root .theme-options[hidden] {display:none;}
html:root .theme-options button {display:flex;align-items:center;min-width:0;width:100%;min-height:44px;padding:10px 13px;border:0;border-radius:0;background:transparent;color:var(--ink);text-align:left;font:inherit;font-size:14px;cursor:pointer;}
html:root .theme-options button[aria-pressed=true] {background:var(--soft);font-weight:700;}
html:root :is(.theme-toggle,.theme-options button):focus-visible {outline:0;box-shadow:none;text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:2px;}
.theme-status {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;}
@media (hover:hover) and (pointer:fine) {html:root :is(.theme-toggle,.theme-options button):hover {background:var(--soft);}}
@media (max-width:1100px) {
  html:root .header-row {gap:8px;}
  html:root .theme-picker {margin-inline-start:auto;}
  html:root .header-row .brand {min-width:0;max-width:min(230px,calc(100% - 132px));}
  html:root .header .header-row .brand {max-width:min(230px,calc(100% - 140px));}
  html:root .header-row .brand>span {min-width:0;}
  html:root .theme-toggle {min-width:52px;padding-inline:8px;}
  html:root .header-row .menu-toggle {flex:none;font-size:13px;padding-inline:11px;}
}

@media (max-width:360px) {html:root .header-row .brand small {display:none;}}

/* Original approved emblem keeps its blue, graphite and white in both themes.
   Intrinsic dimensions reserve the complete rectangle before decoding. */
html:root body .brand .brand-logo {display:block;flex:0 0 72px;width:72px;height:auto;aspect-ratio:508 / 256;object-fit:contain;background:#fff;border:0;border-radius:4px;box-shadow:none;}
@media (max-width:1100px) {html:root body .brand .brand-logo {flex-basis:65px;width:65px;}}
