/* HORIZEN 1.5: fixes UI surfaces only; no changes to D1 or financial logic. */
:root{--hz-report-color:#D4AF37}
.cloud-banner.ready,.cloud-banner.saving,.cloud-banner.checking{display:none!important}
/* Keep conflicts and offline banners visible. Successful sync stays in side status. */
.r8-graphs .r8-bar:not(.cost){background:var(--hz-report-color,#D4AF37)!important}
.r8-graphs .r8-bar.cost{background:#E9BD70!important}
.r8-graphs .r8-track>span{background:var(--hz-report-color,#D4AF37)!important}
.r8-legend span:first-child{color:var(--hz-gold,#D4AF37)}
.hz-chart-chooser{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:12px 0 10px;padding:12px 15px;border-radius:14px;border:1px solid var(--line);background:var(--v7-card,var(--tile));font-size:13px}
.hz-chart-chooser label{display:flex;align-items:center;gap:12px;font-weight:700}
.hz-chart-chooser input[type=color],.chart-config input[type=color]{width:52px;min-width:52px;height:38px;padding:3px;border-radius:9px;border:1px solid #93713B;background:#282624;cursor:pointer}
.hz-chart-chooser>span{font-size:11px;color:var(--muted)}
/* Floating budget totals: visible only on smaller screens, with safe-area offset. */
.hz-budget-summary{display:none}
@media(max-width:850px){
 .hz-budget-summary{display:block;visibility:hidden;opacity:0;pointer-events:none;transform:translateY(120%);position:fixed;z-index:1060;left:9px;right:9px;bottom:calc(var(--hz-safe-bottom,env(safe-area-inset-bottom,0px)) + 81px);border:1px solid #796039;background:#1B1A19;color:#F7F2E8;border-radius:17px;box-shadow:0 10px 35px #0009;padding:10px 13px;transition:opacity .15s,transform .15s,visibility .15s}
 .hz-budget-summary.hz-visible{visibility:visible;opacity:1;pointer-events:auto;transform:translateY(0)}
 .hz-budget-summary-top{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:#E7C781;font-weight:760;margin-bottom:7px}
 .hz-week-switch{display:flex;gap:5px}
 .hz-week-switch button{border:1px solid #665436;background:#2B2822;color:#D1C2A5;width:24px;height:23px;border-radius:7px;font-size:10px;font-weight:800}
 .hz-week-switch button[aria-pressed=true]{background:#D4AF37;color:#1A1610;border-color:#EACB82}
 .hz-budget-summary-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .hz-budget-summary-values span{min-width:0;display:flex;flex-direction:column;gap:3px}
 .hz-budget-summary-values small{color:#BBB0A2;font-size:10px}
 .hz-budget-summary-values b{color:#F8F4EA;font-size:clamp(11px,3vw,15px);white-space:nowrap;font-variant-numeric:tabular-nums}
 .hz-budget-summary-values span:last-child b{color:#EACB82}
 body.hz-drawer-visible .hz-budget-summary,body:has(#modal-root .modal-backdrop) .hz-budget-summary{opacity:0!important;pointer-events:none!important}
}
@media(min-width:851px){.hz-budget-summary{display:none!important}}
/* Select & date panels live in their own stable scroll container, never on page scroll. */
#modal-root .modal-backdrop{position:fixed!important;inset:0!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;overscroll-behavior:contain;padding:calc(env(safe-area-inset-top,0px) + 12px) 12px calc(env(safe-area-inset-bottom,0px) + 12px)!important}
#modal-root .modal,#modal-root .vmodal{position:relative!important;flex:0 1 auto;max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px)!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
#modal-root .modal-head{position:sticky;top:-1px;z-index:2;padding-top:5px;padding-bottom:10px;}
#modal-root .modal-actions{position:sticky;bottom:-1px;z-index:2;background:var(--v7-card,#1F1F22);padding:12px 0 max(7px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--line)}
@media(max-width:850px){
 #modal-root .modal-backdrop{padding-top:calc(var(--hz-top-clearance,env(safe-area-inset-top,0px)) + 10px)!important;padding-bottom:calc(env(safe-area-inset-bottom,0px) + 12px)!important}
 #modal-root .modal,#modal-root .vmodal{max-height:calc(100dvh - var(--hz-top-clearance,0px) - env(safe-area-inset-bottom,0px) - 28px)!important}
}
/* PWA top status layer should be solid, not blurred or translucent */
html.pwa-standalone body::before{background:#111112!important;filter:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
html.pwa-standalone .topbar{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background-image:none!important}
html.pwa-standalone[data-v7-active=light] .topbar{background:#F8F7F3!important;color:#211F1B!important;border-color:#E2D5B6!important}
html.pwa-standalone[data-v7-active=light] .topbar .vbrandmini strong{color:#312717!important}
.hz-language-setting{display:flex;flex-direction:column;gap:8px;background:#262422;border:1px solid #665131;border-radius:14px;padding:13px;margin:12px 0}
.hz-language-setting label{font-weight:750;color:#F2D28E!important;font-size:13px}
.hz-language-setting select{min-height:42px;border-radius:10px;padding:9px 13px;background:#37312B!important;border:1px solid #85704A!important;color:#FAF4E9!important;font-size:15px}
.hz-language-setting small{color:#C7BEAC;font-size:11px;line-height:1.5}
/* Native iOS date or select popovers are drawn by iOS and intentionally left native. */
@media(prefers-reduced-motion:reduce){.hz-budget-summary{transition:none!important}}
html.pwa-standalone[data-v7-active=light] body::before{background:#F8F7F3!important}
@media(min-width:851px) and (max-width:1100px){
 .hz-budget-summary{display:block;visibility:hidden;opacity:0;pointer-events:none;transform:translateY(110%);position:fixed;bottom:18px;left:auto;right:20px;width:min(370px,calc(100vw - 40px));z-index:900;border:1px solid #796039;border-radius:17px;padding:12px;background:#1B1A19;color:#F7F2E8;box-shadow:0 8px 30px #0008;transition:opacity .18s,transform .18s}
 .hz-budget-summary.hz-visible{visibility:visible;opacity:1;pointer-events:auto;transform:none}
 .hz-budget-summary-top{display:flex;justify-content:space-between;align-items:center;color:#E7C781;font-weight:750;font-size:12px;margin-bottom:7px}
 .hz-week-switch{display:flex;gap:4px}.hz-week-switch button{border:1px solid #665436;background:#2B2822;color:#D1C2A5;border-radius:8px;width:26px;height:25px}.hz-week-switch button[aria-pressed=true]{background:#D4AF37;color:#211A0D}
 .hz-budget-summary-values{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.hz-budget-summary-values span{display:flex;flex-direction:column;gap:3px}.hz-budget-summary-values small{font-size:10px;color:#BBB0A2}.hz-budget-summary-values b{font-size:13px;color:#F8F4EA}.hz-budget-summary-values span:last-child b{color:#EACB82}
}
