:root{color-scheme:light;--focus-ring:#416b48}
:root[data-theme="dark"]{color-scheme:dark;--bg:#141a16;--ink:#e8eee8;--green:#89bd90;--sage:#29372c;--muted:#b2bdb1;--line:#3b493e;--cream:#302d24;--white:#202823;--danger:#ffaaa0;--focus-ring:#b9dfa7}
@media(prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--bg:#141a16;--ink:#e8eee8;--green:#89bd90;--sage:#29372c;--muted:#b2bdb1;--line:#3b493e;--cream:#302d24;--white:#202823;--danger:#ffaaa0;--focus-ring:#b9dfa7}}
html,body{background-color:var(--bg);color:var(--ink)}
a{color:inherit}
em{color:var(--green)}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select,textarea{background-color:var(--white);color:var(--ink);border-color:var(--line)}
input[type="file"]{background-color:var(--white);color:var(--ink);border-color:var(--line)}
input[type="file"]::file-selector-button{background-color:var(--sage);color:var(--ink);border-color:var(--line)}
input::placeholder,textarea::placeholder{color:var(--muted);opacity:.85}
::selection{background:var(--green);color:var(--bg)}

:root[data-theme="dark"] .button:not(.secondary):not(.danger-button){background:#315c3d;border-color:#60936a;color:#f5fbf4}
:root[data-theme="dark"] .button:not(.secondary):not(.danger-button):hover{background:#3d7149}
:root[data-theme="dark"] .button.secondary{color:#b5d9b5;border-color:#66816a}
:root[data-theme="dark"] .danger-button,:root[data-theme="dark"] .button.danger{background:#652f2b;border-color:#a85850;color:#ffe9e5}
:root[data-theme="dark"] .dev-banner{background:#453a20;color:#f5dfa0;border-color:#8b753b}
:root[data-theme="dark"] .message{background:#26352b;color:#dbeadd;border-color:#506a53}
:root[data-theme="dark"] .message.error,:root[data-theme="dark"] .message.warning{background:#492c29;color:#ffd7d0;border-color:#865049}
:root[data-theme="dark"] .message.success{background:#243b2b;color:#cfebd1;border-color:#4e7556}
:root[data-theme="dark"] .field-error{color:#ffaaa0}
:root[data-theme="dark"] .guide{background:#26332a;border-color:#415445;color:var(--ink)}
:root[data-theme="dark"] .guide h2,:root[data-theme="dark"] .guide h3{color:var(--ink)}
:root[data-theme="dark"] .guide p{color:var(--muted)}
:root[data-theme="dark"] .feature,:root[data-theme="dark"] .price-card,:root[data-theme="dark"] .care-preview,:root[data-theme="dark"] .floating-card{background:var(--white);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .panel,:root[data-theme="dark"] .plant-card,:root[data-theme="dark"] .plant-list-item,:root[data-theme="dark"] .photo-card,:root[data-theme="dark"] .harvest-panel,:root[data-theme="dark"] .community-reply,:root[data-theme="dark"] .report-box{background:var(--white);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .insight-chart-card{background:var(--white);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .activity-bar{background:#303a31}
:root[data-theme="dark"] .activity-bar.has-activity{background:#77a879}
:root[data-theme="dark"] .feature-icon{color:#a3cf9b}
:root[data-theme="dark"] .plant-image{background:linear-gradient(#27372e,#343128)}
:root[data-theme="dark"] .hero-scene{color:var(--ink)}
:root[data-theme="dark"] .plant-badge{background:#29372c;color:#d8ead5;border-color:#526854}
:root[data-theme="dark"] .plant-badge.due{background:#4a3c22;color:#f6d88f;border-color:#95783d}
:root[data-theme="dark"] .category-filters a{background:var(--white);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .category-filters a.active{background:#315c3d;color:#f5fbf4;border-color:#60936a}
:root[data-theme="dark"] .guide-toc{background:var(--white);border-color:var(--line)}
:root[data-theme="dark"] .public-guide-link,:root[data-theme="dark"] .guide-note{background:var(--sage)}
:root[data-theme="dark"] .empty-state,:root[data-theme="dark"] .empty-card{background:var(--white);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] hr{border-color:var(--line)}
:root[data-theme="dark"] code, :root[data-theme="dark"] pre{background:#202a23;color:#dce9da}

:root[data-theme="dark"] .today-overview{background:var(--white)}
:root[data-theme="dark"] .today-overview-item{background:#1a211c}
:root[data-theme="dark"] .today-overview-icon{background:#29372c;color:#a6d0a0}
:root[data-theme="dark"] .tour-invite{background:#25342a;border-color:#405745}
:root[data-theme="dark"] .tour-invite p{color:var(--muted)}
:root[data-theme="dark"] .tour-invite-icon{background:#1d2820;color:#a6d0a0}
:root[data-theme="dark"] .mobile-bottom-nav{background:#1b231d;border-color:#3b493e;box-shadow:0 -4px 20px #0008}
:root[data-theme="dark"] .mobile-bottom-nav a{color:#b1bdb1}
:root[data-theme="dark"] .mobile-bottom-nav a[aria-current="page"]{background:#304535;color:#c5e0c4}
:root[data-theme="dark"] .view-switch{background:#292d25}
:root[data-theme="dark"] .tabs{background:#29372c}
:root[data-theme="dark"] .tabs a{color:var(--ink)}
:root[data-theme="dark"] .tabs a:hover{background:#3a493d}
:root[data-theme="dark"] .tabs a.active{background:#315c3d;color:#f5fbf4}
.collection-controls a:focus-visible,.category-filters a:focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
:root[data-theme="dark"] .view-switch .active{background:#3a493d;color:#f1f5ee;box-shadow:none}
:root[data-theme="dark"] .plant-shelf{border-color:#594a37;background:linear-gradient(90deg,#26251f,#302d25 50%,#27241e)}
:root[data-theme="dark"] .plant-shelf .plant-card{border-color:#465046;box-shadow:0 7px 17px #0006}
:root[data-theme="dark"] .plant-shelf .plant-card:after{background:linear-gradient(#795b43 0%,#644933 48%,#4d382b 100%);box-shadow:0 7px 9px #0008}
:root[data-theme="dark"] .plant-shelf .plant-image,:root[data-theme="dark"] .plant-shelf .plant-card:nth-child(3n+2) .plant-image,:root[data-theme="dark"] .plant-shelf .plant-card:nth-child(3n) .plant-image{background:linear-gradient(#26352d,#343128)}
:root[data-theme="dark"] .plant-shelf .plant-badge.due{background:#4a3c22;color:#f6d88f;border-color:#95783d}
:root[data-theme="dark"] .plant-card .plant-badge.due{background:#4a3c22;color:#f6d88f;border-color:#95783d}
:root[data-theme="dark"] .support-banner{background:#40371f;color:#f7e5ae;border-color:#977c3c}
:root[data-theme="dark"] .support-banner .button{background:#59471f;border-color:#c09a45;color:#fff3ce}
:root[data-theme="dark"] .share-preview-card,:root[data-theme="dark"] .community-promo{background:#29372c}
:root[data-theme="dark"] .community-demo{background:var(--white);border-color:var(--line);box-shadow:0 12px 35px #0004}
:root[data-theme="dark"] .community-demo h3{color:var(--ink)}
:root[data-theme="dark"] .community-demo p{background:#29332b;color:#dce5d9}
:root[data-theme="dark"] .community-demo small{color:var(--muted)}
:root[data-theme="dark"] .share-promo-art{background:#202823;color:#a3cf9b}
:root[data-theme="dark"] .streak-card{background:linear-gradient(115deg,#26372b,#242b24);border-color:#465747}
:root[data-theme="dark"] .streak-milestone{background:#2d352e;color:#b7c1b6;border-color:#4b584b}
:root[data-theme="dark"] .streak-milestone.earned{background:#2f4a35;color:#c7e5c5;border-color:#638366}
:root[data-theme="dark"] .upload-preview{background:#252e27}
:root[data-theme="dark"] .upload-preview>img{background:#1b241e}
:root[data-theme="dark"] .scanner-page .plant-scan-video{background:#142019}
:root[data-theme="dark"] .photo-viewer{background:#101712f5;color:#fff}
:root[data-theme="dark"] .photo-viewer::backdrop{background:#080d0aeb}

@media print{
  :root[data-theme="dark"],:root[data-theme="light"]{color-scheme:light;--bg:#fff;--ink:#000;--green:#254e3c;--sage:#e6ecdd;--muted:#687265;--line:#dfe4d6;--cream:#f0ebdc;--white:#fffefb;--danger:#913d33}
  html[data-theme],html[data-theme] body{color-scheme:light;background:#fff;color:#000}
}
:root[data-theme="dark"] .tour-count{background:var(--white);border-color:var(--line)}
:root[data-theme="dark"] .tour-count strong{color:var(--ink)}
:root[data-theme="dark"] .tour-check-context{background:#eef3e8;color:#26352a;border-color:#dce5d4}
:root[data-theme="dark"] .tour-check-context div>span{color:#435647}
:root[data-theme="dark"] .tour-due-badge{background:#fffef2e8;color:#604c21;border-color:#fff8}
:root[data-theme="dark"] .tour-detail-link{color:var(--green)}
:root[data-theme="dark"] .tour-finished{background:var(--white);border-color:var(--line)}

@media print{
  :root[data-theme="dark"],:root[data-theme="light"]{color-scheme:light;--bg:#fff;--ink:#000;--green:#254e3c;--sage:#e6ecdd;--muted:#687265;--line:#dfe4d6;--cream:#f0ebdc;--white:#fffefb;--danger:#913d33}
  html[data-theme],html[data-theme] body{color-scheme:light;background:#fff;color:#000}
}
