/* Budget 2.0: optional dark appearance. Light theme remains the original. */
:root {color-scheme:light;}
html[data-theme="dark"] {color-scheme:dark;background:#0b1414;}
html[data-theme="dark"] body {background:#0b1414;color:#e9f5f1;}
html[data-theme="dark"] .brand {color:#57dda4;}
html[data-theme="dark"] .muted,html[data-theme="dark"] .tiny.muted {color:#a1b9b2;}
html[data-theme="dark"] .hero {background:linear-gradient(125deg,#123a2b,#076443);box-shadow:0 12px 35px #0005;}
html[data-theme="dark"] .hero small {color:#bce8d4;}
html[data-theme="dark"] .hero .sub {color:#c0dfd1;}
html[data-theme="dark"] .card {background:#162422;border-color:#2c4540;box-shadow:0 6px 20px #0003;}
html[data-theme="dark"] .metric {background:#203530;}
html[data-theme="dark"] .metric span,html[data-theme="dark"] .line .detail {color:#a3c0b7;}
html[data-theme="dark"] .line {border-color:#2b423d;}
html[data-theme="dark"] .progress {background:#304840;}
html[data-theme="dark"] .bar {background:linear-gradient(90deg,#18aa6c,#65e8aa);}
html[data-theme="dark"] .expense {color:#ff9d9d;}
html[data-theme="dark"] .income {color:#72e9ad;}
html[data-theme="dark"] .tabs {background:#12211f;border-color:#2a403a;}
html[data-theme="dark"] .tabs button {color:#a6c0b8;}
html[data-theme="dark"] .tabs button.active {color:#80f2b8;background:#234337;}
html[data-theme="dark"] input:not([type="checkbox"]),html[data-theme="dark"] select {background:#0e1d1b;color:#f1fbf6;border-color:#3b5b51;}
html[data-theme="dark"] input::placeholder {color:#8ba9a0;}
html[data-theme="dark"] .btn {background:#147f55;color:#fff;}
html[data-theme="dark"] .btn.secondary {background:#2a443c;color:#c4f3da;}
html[data-theme="dark"] .btn.danger {background:#492a2a;color:#ffb4b4;}
html[data-theme="dark"] .chip {background:#203a32;color:#b4efcf;border-color:#3e6857;}
html[data-theme="dark"] .notice {background:#20352f;color:#b4d2c5;}
html[data-theme="dark"] .empty {color:#a5bfb5;}
html[data-theme="dark"] .error {color:#ff9999;}
.theme-line{display:flex;align-items:center;justify-content:space-between;gap:15px;}
.theme-line>div{flex:1;}
.theme-switch{display:inline-flex;position:relative;align-items:center;flex-shrink:0;width:60px;height:36px;margin:0;cursor:pointer;}
.theme-switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;z-index:1;cursor:pointer;}
.theme-track{width:60px;height:36px;border-radius:50px;background:#c9d5d1;display:flex;align-items:center;padding:4px;transition:background .2s ease;}
.theme-thumb{width:28px;height:28px;border-radius:50%;background:white;box-shadow:0 2px 5px #0003;transition:transform .2s ease;}
.theme-switch input:checked+.theme-track{background:#17aa70;}
.theme-switch input:checked+.theme-track .theme-thumb{transform:translateX(24px);}
.theme-switch input:focus-visible+.theme-track{outline:3px solid #68dca9;outline-offset:3px;}
@media(prefers-reduced-motion:reduce){.theme-track,.theme-thumb{transition:none;}}

/* Accessible first-run tutorial */
.guide-overlay{position:fixed;inset:0;background:#071511b8;z-index:100;display:flex;align-items:center;justify-content:center;padding:18px;overflow-y:auto}
.guide-dialog{width:min(100%,490px);max-height:calc(100dvh - 36px);overflow:auto;background:#fff;color:#19342f;border-radius:24px;padding:24px;box-shadow:0 24px 75px #0005}
.guide-header{display:flex;justify-content:space-between;align-items:center;color:#287b5b;font-size:12px;font-weight:800;letter-spacing:.09em}
.guide-header button{border:0;background:transparent;color:inherit;font-size:29px;line-height:1;cursor:pointer;padding:3px 9px}
.guide-progress{height:5px;background:#e1eee8;border-radius:9px;overflow:hidden;margin:15px 0 22px}.guide-progress>div{height:100%;background:#21b876;border-radius:9px}
.guide-dialog h2{font-size:25px;line-height:1.17;letter-spacing:-.03em;margin:0 0 12px}.guide-description{color:#58736a;line-height:1.55;font-size:14px;margin:0 0 19px}.guide-hint{font-size:12px;color:#647c72;line-height:1.5;background:#edf6f1;padding:12px;border-radius:12px;margin-top:16px}
.guide-welcome-icon{height:64px;width:64px;border-radius:18px;background:#1dba75;color:white;display:grid;place-items:center;font-size:35px;font-weight:900}
.guide-actions{display:flex;gap:10px;margin-top:24px}.guide-actions .btn{flex:1}.guide-skip{display:block;border:0;background:none;color:#427b69;margin:15px auto 0;text-decoration:underline;font-size:13px}
.guide-estimate{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#e9f6ef;border-radius:14px;padding:15px;margin-top:16px}.guide-estimate span{font-size:12px}.guide-estimate strong{font-size:18px}
.guide-toast{position:fixed;z-index:110;bottom:25px;left:50%;transform:translateX(-50%);width:min(calc(100% - 30px),430px);padding:20px;background:#123d2d;color:white;border-radius:19px;box-shadow:0 14px 50px #0005}.guide-toast p{font-size:13px;line-height:1.5}.guide-toast button{background:#20b678}
html[data-theme="dark"] .guide-dialog{background:#162522;color:#f2fff7}html[data-theme="dark"] .guide-description{color:#b0cfc0}html[data-theme="dark"] .guide-hint,html[data-theme="dark"] .guide-estimate{background:#254037;color:#d5f0df}html[data-theme="dark"] .guide-progress{background:#365247}html[data-theme="dark"] .guide-header,html[data-theme="dark"] .guide-skip{color:#7ce8ad}
