/* Explicit palettes match the existing system palettes. Without JS the
   original prefers-color-scheme rules remain the fallback. Load this last. */
:root[data-theme="light"] { color-scheme: light dark; --site-color-scheme:light; --bg:#f6f7ef; --ink:#163d2b; --muted:#627468; --card:#ffffffb8; --line:#24533922; --accent:#2e704b; --soft:#e8efd9; --nav-bg:#f6f7efed; }
:root[data-theme="dark"] { color-scheme: light dark; --site-color-scheme:dark; --bg:#0e1c15; --ink:#edf5e7; --muted:#a8b8ac; --card:#1b2d22; --line:#c0e7be22; --accent:#94c792; --soft:#263e2b; --nav-bg:#0e1c15ed; }
:root[data-theme] body { color-scheme:var(--site-color-scheme); }
@supports (color-scheme: only light) {
  :root[data-theme="light"] { --site-color-scheme:only light; }
}
:where(html[data-theme="light"]) .button { color:white; }
:where(html[data-theme="dark"]) .button { color:#102b1b; }
:where(html[data-theme="light"]) .phone { border-color:#183e2a; }
:where(html[data-theme="dark"]) .phone { border-color:#647b5f; }
:where(html[data-theme="light"]) .brand img.wordmark { filter:brightness(0) saturate(100%) invert(18%) sepia(30%) saturate(700%) hue-rotate(98deg); }
:where(html[data-theme="dark"]) .brand img.wordmark { filter:none; }
:where(html[data-theme="dark"]) .site-language select option { color:var(--ink); background:var(--bg); }

:where(html[data-theme="light"]) .home-page { --bg:#faf8f1; --ink:#183c2b; --muted:#68746b; --accent:#25664b; --soft:#eaf0df; --card:#fffdf8; --line:#224c3020; --nav-bg:#faf8f1ed; }
:where(html[data-theme="dark"]) .home-page { --bg:#101f17; --ink:#edf4e8; --muted:#adbaae; --accent:#a1caa1; --soft:#1a2d20; --card:#1a2c20; --line:#d2e7ce24; --nav-bg:#101f17ed; }
:where(html[data-theme="light"]) .home-page .button { color:white; }
:where(html[data-theme="dark"]) .home-page .button { color:#143323; }
:where(html[data-theme="light"]) .device-frame { border-color:#182c24; background:#182c24; box-shadow:0 25px 48px -15px #1436273c,0 3px 7px #14362718; }
:where(html[data-theme="light"]) .inline-screen { border-color:#24392b; background:#0c1b14; box-shadow:0 18px 36px -16px #183c2b55; }
:where(html[data-theme="dark"]) :is(.device-frame,.inline-screen) { border-color:#3c5143; background:#3c5143; box-shadow:0 24px 40px -16px #0007; }
:where(html[data-theme="light"]) .preview-halo { opacity:1; }
:where(html[data-theme="dark"]) .preview-halo { opacity:.3; }

:where(html[data-theme="light"]) .market-page { --bg:#faf8f1; --card:#fffdf8; --ink:#193d2b; --muted:#52645a; --accent:#23684c; --soft:#edf1e4; --line:#d4dbce; --rule:#9cae9c; --nav-bg:#faf8f1ee; }
:where(html[data-theme="dark"]) .market-page { --bg:#101f17; --card:#192b21; --ink:#eef3e7; --muted:#b0c1b4; --accent:#a6d8b2; --soft:#223c2c; --line:#3a5242; --rule:#6b8270; --nav-bg:#101f17ed; }
:where(html[data-theme="light"]) .atlas-page { --bg:#faf8f1; --ink:#183c2b; --muted:#53645a; --accent:#25664b; --soft:#eaf0df; --card:#fffdf8; --line:#224c3037; --nav-bg:#faf8f1ed; }
:where(html[data-theme="dark"]) .atlas-page { --bg:#101e17; --ink:#eef3e7; --muted:#b2c1b6; --accent:#a9d8b2; --soft:#263e2e; --card:#192b21; --line:#c0e7be31; --nav-bg:#101e17ed; }
:where(html[data-theme="light"]) .catalog-preview { background:#e5ecdf; color:#294c3d; }
:where(html[data-theme="dark"]) .catalog-preview { background:#293d32; color:#e2eddb; }
:where(html[data-theme="light"]) .market-preview { background:#ede8df; color:#574431; }
:where(html[data-theme="dark"]) .market-preview { background:#3d3931; color:#efe7d6; }

:where(html[data-theme="light"]) .plant-page:before { background:linear-gradient(180deg,#f5f6ed66,#f5f6eddc); }
:where(html[data-theme="dark"]) .plant-page:before { background:linear-gradient(180deg,#0e1c1544,#0e1c15e8); }
:where(html[data-theme="light"]) .plant-aura img { opacity:.55; }
:where(html[data-theme="dark"]) .plant-aura img { opacity:.65; }
:where(html[data-theme="light"]) .plant-content .card { background:#ffffffb8; }
:where(html[data-theme="dark"]) .plant-content .card { background:#18251bc7; }
:where(html[data-theme="light"]) .plant-heading { background:var(--card); }
:where(html[data-theme="dark"]) .plant-heading { background:#19281fdc; }

.site-theme { position:relative; flex:none; color:var(--ink); }
.site-theme > summary { display:grid; place-items:center; width:44px; height:44px; padding:10px; border:1px solid var(--line); border-radius:50%; list-style:none; cursor:pointer; background:transparent; }
.site-theme > summary::-webkit-details-marker { display:none; }
.site-theme > summary::marker { content:""; }
.site-theme > summary:hover, .site-theme[open] > summary { background:var(--soft); }
.site-theme svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.site-theme-menu { position:absolute; top:calc(100% + 9px); right:0; z-index:80; width:220px; max-width:calc(100vw - 24px); padding:6px; border:1px solid var(--line); border-radius:14px; background:var(--bg); box-shadow:0 8px 28px #102b1b28; }
.site-theme-menu button { display:flex; align-items:center; gap:10px; width:100%; min-height:44px; padding:8px 10px; border:0; border-radius:9px; background:transparent; color:var(--ink); font:inherit; font-size:13px; text-align:start; cursor:pointer; }
.site-theme-menu button:hover, .site-theme-menu button[aria-checked="true"] { background:var(--soft); }
.site-theme-label { flex:1; }
.site-theme-menu button > svg { flex:none; width:18px; height:18px; }
.site-theme-check { display:flex; }
.site-theme-check svg { width:16px; height:16px; }
.site-theme :focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
:root .site-language select,
.site-theme > summary,
:root .site-header .mobile-menu > summary { box-sizing:border-box; height:44px; min-height:44px; border:1px solid var(--line); border-radius:999px; }
:root .site-language select { padding-block:0; }
:root .site-header .nav-shell { grid-template-columns:minmax(0,1fr) auto auto auto auto; }
@media (min-width:1001px) and (max-width:1200px) {
  :root .site-header .nav-shell { gap:12px; padding-inline:18px; }
  :root .site-header .primary-nav { gap:12px; }
  :root .site-header .wordmark { width:108px!important; }
  :root .site-header .site-language > span { display:none; }
}
@media (max-width:1000px) {
  :root .site-header .nav-shell { grid-template-columns:minmax(0,1fr) auto 44px 44px; gap:6px; }
  :root .site-header .site-theme { grid-column:3; grid-row:1; }
  :root .site-header .mobile-menu { grid-column:4; grid-row:1; }
  :root .site-header .mobile-menu > summary { justify-content:center; width:44px; padding-inline:8px; }
  :root .site-header .mobile-menu > summary > span { display:none; }
}
@media (max-width:600px) {
  :root .site-header .wordmark { width:110px!important; height:32px!important; }
  :root .site-header .brand > picture img { width:28px; height:28px; }
  .plant-page > header .site-theme { margin-left:0; }
}
@media (max-width:360px) {
  :root .site-header .nav-shell { gap:4px; padding-inline:16px; }
  :root .site-header .brand { gap:6px; }
  :root .site-header .wordmark { width:82px!important; height:28px!important; }
  :root .site-header .brand > picture img { width:24px; height:24px; }
  :root .site-header .site-language select { width:74px; max-width:74px; font-size:11px; padding-inline:4px; }
  .plant-page > header .brand img.wordmark { width:86px; }
}
