:root{color-scheme:light}
.theme-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}.theme-options label{display:flex;align-items:center;gap:8px;padding:14px 10px;border:1px solid #cbd8ce;border-radius:12px;cursor:pointer}.theme-options label:has(:checked){border-color:#18654c;background:#e9f1e8}.theme-options input{accent-color:#18654c;width:20px;height:20px;flex:none}
.free-colors{display:grid;grid-template-columns:repeat(auto-fit,minmax(42px,1fr));gap:6px;margin:8px 0}.color-choice{height:44px;max-width:62px;border:2px solid transparent;border-radius:12px;background:transparent;padding:5px}.color-choice span{display:block;width:100%;height:100%;border-radius:7px;background:var(--crop-color)}.color-choice.selected{border-color:#18654c;box-shadow:0 0 0 1px #18654c}.custom-color-line{display:flex;align-items:center;gap:12px;margin-top:12px;font-size:13px}.custom-color-line input[type=color]{flex:none;width:54px;height:44px;padding:4px}.birth-date-input{display:flex;align-items:center;gap:8px}.birth-date-input input{min-width:0;flex:1}.birth-date-input .iconbtn{flex:none;border:1px solid #d3dfd5;height:48px;background:#e9efea}.birth-calendar{width:min(430px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto}.calendar-controls{display:grid;grid-template-columns:36px minmax(0,1fr) minmax(70px,.75fr) 36px;gap:6px;margin:16px 0}.calendar-controls .iconbtn{width:36px}.calendar-controls select{width:100%;min-width:0;border:1px solid #cbd8ce;border-radius:8px;background:#f8faf6;color:inherit;padding:8px 4px}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center;margin:12px 0 20px}.calendar-grid>span{font-size:12px;color:#667a6e}.calendar-day{min-height:40px;background:#f1f5ef;border-radius:9px;color:#234536}.calendar-day.selected{background:#18654c;color:white}.calendar-day:disabled{background:transparent}.birth-calendar .btnrow .btn{padding:10px 8px;font-size:13px}#date-dialog-root .dialog-overlay{z-index:1000}
html[data-theme=dark]{color-scheme:dark}
html[data-theme=dark] body{background:#101b16;color:#e7efe9}
html[data-theme=dark] .topbar{background:#101b16f2;border-color:#314139}
html[data-theme=dark] :is(.sidebar,.card,.formcard,.stat,.categorycard,.record,.row,.auth-panel,.dialog,.datebadge,.detailhero,.map-card){background:#1b2a22;color:#e7efe9;border-color:#35473b}
html[data-theme=dark] :is(input,select,textarea,.searchbar){background:#122019;color:#e7efe9;border-color:#405246}
html[data-theme=dark] :is(.brand,.sidebrand,.mini-brand,.auth-brand,.maintext,.navitem,.field label,.checklabel,.iconbtn,.record strong,.row strong,.stat strong,.categorycard strong){color:#e7efe9}
html[data-theme=dark] :is(small,.muted,.footnote,.fieldhelp,.optional,.pagehead p,.intro p,.row small,.record small,.event p,.eventdate,.statlabel,.navlabel,.auth-brand p,.crop-color-note,.custom-color-line,.calendar-grid>span){color:#b0c1b5}
html[data-theme=dark] :is(.btn.outline,.textbtn,.auth-back){color:#a3dfb7;border-color:#4a6553}
html[data-theme=dark] :is(.btn.secondary,.tab,.loginmodes,.badge,.datepreview,.pregnancy,.totalbar,.history-total,.calc-total,.fertilizer-total,.passport-toolbar,.passport-zoom-tools,.map-toolbar,.calendar-day,.birth-date-input .iconbtn){background:#283d30;color:#dbece0;border-color:#4a6553}
html[data-theme=dark] :is(.navitem.selected,.tab.active,.loginmodes .active,.theme-options label:has(:checked)){background:#27513d;color:#eef9f0;border-color:#73bb8b}
html[data-theme=dark] :is(.theme-options label,.calendar-controls select){border-color:#4a6553}
html[data-theme=dark] :is(.calendar-controls select,.passport-empty,.map-notice){background:#22362b;color:#c4d8cb}
html[data-theme=dark] .calendar-day.selected{background:#87c9a0;color:#10251a}
html[data-theme=dark] .calendar-day:disabled{background:transparent}
html[data-theme=dark] .iconbtn:hover{background:#314c3b}
html[data-theme=dark] .color-choice.selected{border-color:#b4ebc6;box-shadow:0 0 0 1px #b4ebc6}
html[data-theme=dark] :is(.formerror,.badge.red,.btn.danger){background:#492b2a;color:#ffbdb7}
html[data-theme=dark] .badge.warn{background:#483e22;color:#f2d68b}
html[data-theme=dark] .badge.blue{background:#233f52;color:#a9d5fa}
html[data-theme=dark] .badge.grey{background:#34413a;color:#cad6ce}
html[data-theme=dark] :is(.divider,.event,.record,.row,.sidebar,.formactions,.crop-history){border-color:#35473b}
html[data-theme=dark] .divider{background:#35473b}
html[data-theme=dark] .financial-amount.income{color:#9ddbb3}
html[data-theme=dark] .financial-amount.expense{color:#ffa7a0}
html[data-theme=dark] :is(.leaflet-popup-content-wrapper,.leaflet-popup-tip,.leaflet-control-zoom a){background:#1b2a22;color:#e7efe9}
@media(max-width:380px){.theme-options{grid-template-columns:1fr}.birth-calendar{padding:16px}.calendar-controls{gap:3px}.calendar-controls select{font-size:13px}}

html[data-theme=dark] :is(.map-legend>span,.history-total strong,.calc-total strong,.fertilizer-total strong,.calc-total small,.history-total span,.calf-transition p){color:#c8e7d2}
html[data-theme=dark] :is(.calf-transition,.passport-thumb){background:#283d30;border-color:#4a6553}
html[data-theme=dark] .passport-pick{color:#a3dfb7!important}
html[data-theme=dark] input[readonly]{background:#26382d;color:#b6ccbe}

html[data-theme=dark] .empty h3{color:#e1efe5}
html[data-theme=dark] :is(.empty,.detailhero p,.pregnancy p,.dialog p,.statusline,.localnote,.record-count,.loginmodes button){color:#afc5b7}
.theme-options input{min-height:20px;padding:0}

.help-links{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 14px;margin:20px 0 12px}.help-links .textbtn{font-size:12px;padding:6px 0}.help-dialog{max-width:650px;max-height:88vh;display:flex;flex-direction:column;gap:16px}.help-dialog header{display:flex;align-items:center;gap:12px}.help-dialog h2{font-size:22px;flex:1}.help-body{overflow:auto;overscroll-behavior:contain}.help-body h3{font-size:16px;margin:18px 0 8px}.help-body p{font-size:14px;line-height:1.65;margin-bottom:12px}.help-dialog .btnrow{flex-wrap:wrap;flex-shrink:0}
