/* Shared header and light / dark appearance for all three routes. */
:root{color-scheme:light;--bg:#fff}
body{background:var(--bg);color:var(--ink)}
.topbar{height:auto;min-height:76px}
.topbar .topbar-inner{min-height:76px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 18px;padding-top:14px;padding-bottom:14px}
.topbar .brand{font-size:22px;flex-shrink:0}
.topbar .brand-mark{display:flex;background:#162b41}
.topbar .site-nav{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-left:auto;width:auto}
.topbar .site-nav a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:10px 14px!important;border:1px solid var(--line);border-radius:8px;font-size:14px!important;font-weight:650;color:var(--ink);text-decoration:none;white-space:nowrap;background:var(--paper)}
.topbar .site-nav a:hover{background:#edf3f6;border-color:#9caebb}
.topbar .site-nav a.active{background:#162b41;color:#fff;border-color:#162b41}
.display-toggle{border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);min-height:42px;padding:10px 14px;font:600 14px Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","Malgun Gothic",sans-serif;white-space:nowrap;cursor:pointer}
.display-toggle:hover{background:#edf3f6}
.display-toggle:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
@media(max-width:760px){
 .topbar .topbar-inner{padding:14px 18px}
 .topbar .brand{font-size:20px}
 .topbar .site-nav{order:3;width:100%;margin-left:0;justify-content:flex-start}
 .topbar .site-nav a{flex:1}
 .display-toggle{margin-left:auto}
}
@media(max-width:370px){.topbar .brand{font-size:18px;gap:7px}.topbar .brand-mark{width:28px;height:28px;padding:6px}.display-toggle{padding:9px;font-size:14px}.topbar .topbar-inner{gap:10px;padding:12px}}
html[data-theme="dark"]{color-scheme:dark;--ink:#ecf0f4;--muted:#aab8c5;--line:#39424c;--blue:#70d5e5;--blue-hover:#9de6f0;--paper:#191c21;--bg:#101114;--focus:#81dfed}
html[data-theme="dark"] :is(.panel,.service-card,.definitions,.upload-symbol,kbd){background:var(--paper);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] :is(.panel-heading,.farmer-body h3,.linkage,.home-note,.card-link,.example){border-color:var(--line)}
html[data-theme="dark"] :is(.drop-zone,.report,#sequence-lines,.crop-inputs input,.form-row select){background:#121519;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] #sequence-lines:focus{background:#181e25;border-color:var(--blue)}
html[data-theme="dark"] :is(.form-row label,.review-instruction label,.inline-check,.linkage label,.check-grid label,.final-check,.service-card>p,.card-detail,.note-label,.empty-meta){color:#bdc9d3}
html[data-theme="dark"] :is(.grade-help,.step,.example-icon,.image-area,.pill){background:#252e38;color:#b5dce8}
html[data-theme="dark"] .final-check{background:#18312e}
html[data-theme="dark"] .button{background:#232a32;color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .button:hover:not(:disabled){background:#34404d;border-color:#748695}
html[data-theme="dark"] .button.primary{background:#70d5e5;color:#10242c;border-color:#70d5e5}
html[data-theme="dark"] .button.primary:hover:not(:disabled){background:#9de6f0}
html[data-theme="dark"] .button[aria-pressed="true"]{background:#173a43;border-color:var(--blue);color:var(--blue)}
html[data-theme="dark"] .copy-button{background:#69d4d5;color:#112d3c;border-color:#69d4d5}
html[data-theme="dark"] :is(.output-panel,.farmer-card){background:#182430;border:1px solid #3b5061;color:#f2f6f9}
html[data-theme="dark"] :is(.topbar .site-nav a:hover,.display-toggle:hover){background:#2b3540;border-color:#7d909f}
html[data-theme="dark"] .topbar .site-nav a.active{background:#70d5e5;border-color:#70d5e5;color:#10242c}
html[data-theme="dark"] .brand-mark{background:#30404f}
html[data-theme="dark"] :is(.count,.upload-symbol,kbd){border-color:var(--line)}
html[data-theme="dark"] .tool-icon{background:#1d3944;color:#83dcea}
html[data-theme="dark"] .card-link{color:#83dcea}
html[data-theme="dark"] .drop-zone.drag-over{background:#17343e;border-color:var(--blue)}
html[data-theme="dark"] .recognition-summary{background:#352d1c;color:#efcf85}
html[data-theme="dark"] .error{background:#3d2422;color:#ffb5a8}
html[data-theme="dark"] .toast{background:#d9edf3;color:#112b38}
