/* Shared layout corrections and a small, consistent motion system. */
:root{--motion-ease:cubic-bezier(.2,.7,.2,1);--urgent:#be123c}
.navigation-loader{position:fixed;inset:0;z-index:11000;display:grid;place-items:center;background:#0b1f332e;backdrop-filter:blur(2px);pointer-events:none}
.navigation-loader[hidden]{display:none}
.water-loader{display:grid;justify-items:center;gap:14px;padding:26px 38px;border:1px solid var(--line);border-radius:22px;background:var(--surface);color:var(--text);box-shadow:0 16px 60px #0b1f3329;font-size:13px;font-weight:600;max-width:calc(100vw - 32px)}
.water-loader-art{position:relative;display:grid;place-items:center;width:80px;height:86px}
.water-loader-art img{position:relative;z-index:1;width:42px;height:51px;animation:water-drop-float 1.35s ease-in-out infinite}
.water-loader-ripple{position:absolute;bottom:4px;width:48px;height:13px;border:2px solid #13b8ba70;border-radius:50%;animation:water-drop-ripple 1.35s ease-out infinite}
@keyframes water-drop-float{0%,100%{transform:translateY(-5px)}50%{transform:translateY(5px)}}
@keyframes water-drop-ripple{0%{transform:scale(.6);opacity:.8}100%{transform:scale(1.5);opacity:0}}
.filter-toolbar{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:18px 28px;margin-top:4px;padding:18px 0 4px;border-top:1px solid var(--line);min-width:0}
.filter-toolbar .button-row{margin:0;gap:10px;min-width:0;max-width:100%}
.filter-toolbar .export-actions{padding-left:24px;border-left:1px solid var(--line)}
.filter-help{margin-top:12px}
.action-icon{width:18px;height:18px;flex:0 0 18px;stroke-linecap:round;stroke-linejoin:round}
.button>span{min-width:0}

/* Generic inline input rules must never enlarge a checkbox or crush its caption. */
.rule-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(6rem,8rem) minmax(5rem,6rem) minmax(7rem,9rem);align-items:center;gap:16px;width:100%}
.rule-form>strong,.rule-form>label{min-width:0;max-width:100%;width:auto;margin:0}
.rule-form>label:not(.checkbox) input{width:100%;min-width:0;max-width:none;margin-top:7px}
.rule-form>.checkbox{display:inline-flex;align-items:center;align-self:end;gap:10px;min-height:44px;white-space:nowrap;overflow-wrap:normal}
.rule-form .checkbox input{width:18px;height:18px;min-width:18px;max-width:18px;min-height:18px;flex:0 0 18px;margin:0;padding:0;accent-color:var(--blue)}
.rule-form>.button{align-self:end;width:100%}

.button,.icon-button,.text-button{transition:background-color .18s var(--motion-ease),border-color .18s var(--motion-ease),color .18s var(--motion-ease),box-shadow .2s var(--motion-ease),transform .2s var(--motion-ease)}
.button:hover{box-shadow:0 5px 15px #0b78d024;transform:translateY(-2px)}
.button:active,.icon-button:active{transform:translateY(0) scale(.98);box-shadow:none}
.button:disabled{transform:none;box-shadow:none}
.icon-button:hover{background:var(--soft);border-color:#0b78d060}
input,select,textarea{transition:border-color .18s var(--motion-ease),box-shadow .18s var(--motion-ease),background-color .18s var(--motion-ease)}
input:focus,select:focus,textarea:focus{box-shadow:0 0 0 4px #0b78d018}
.sidebar nav>a{transition:background-color .18s var(--motion-ease),color .18s var(--motion-ease),box-shadow .18s var(--motion-ease)}
a.stat{transition:border-color .2s var(--motion-ease),box-shadow .2s var(--motion-ease),transform .2s var(--motion-ease)}
a.stat:hover{transform:translateY(-3px);box-shadow:0 10px 25px #0b1f3310}
summary{transition:color .18s var(--motion-ease)}
.motion-preference{font-size:12px;color:var(--muted);padding:8px 0;white-space:normal;max-width:100%}
.overview-stats{grid-template-columns:repeat(3,minmax(0,1fr))}

/* Keep alert text steady; the surrounding glow and background breathe slowly. */
.notice-row.notice-due{position:relative;isolation:isolate;background:linear-gradient(125deg,#9f1239,#be123c);border:1px solid #fb7185;border-left:5px solid #fda4af;color:#fff;box-shadow:0 5px 18px #9f12391f}
.dark .notice-row.notice-due{background:linear-gradient(125deg,#76102f,#a3113b);border-color:#fb7185;color:#fff}
.notice-due::before{content:"";position:absolute;inset:0;z-index:-1;border-radius:inherit;pointer-events:none;background:linear-gradient(110deg,#ffffff24,transparent 65%);opacity:.22}
.notice-due h3,.notice-due p,.notice-due strong,.notice-due small,.notice-due label,.notice-due summary,.notice-due a:not(.button){color:inherit}
.notice-due a:not(.button){text-decoration:underline;text-underline-offset:3px}
.notice-due .button,.dark .notice-due .button{background:#fff;color:#881337;border-color:#fff}
.notice-due .button:hover{background:#fff1f4;box-shadow:0 4px 15px #4c051940}
.notice-due input,.notice-due select,.notice-due textarea{background:var(--surface);color:var(--text);border-color:#fb718580}
.due-card{border-color:#e11d48;background:linear-gradient(135deg,var(--surface) 65%,#fff1f3);box-shadow:0 4px 15px #be123c12}
.due-card>span,.due-card>strong{color:#be123c}
.dark .due-card{background:linear-gradient(135deg,var(--surface) 65%,#431c31);border-color:#fb7185}
.dark .due-card>span,.dark .due-card>strong{color:#fda4af}
.debt-due{background:#ffe4eb;color:#881337;box-shadow:inset 4px 0 #e11d48}
.debt-due a{color:inherit}
.dark .debt-due{background:#4b1830;color:#ffe4ec}
.is-urgent-visible.notice-due,.is-urgent-visible.due-card{animation:urgent-breathe 2.8s ease-in-out infinite}
.is-urgent-visible.notice-due::before{animation:urgent-sheen 2.8s ease-in-out infinite}
.is-urgent-visible.debt-due{animation:urgent-row 2.8s ease-in-out infinite}
@keyframes urgent-breathe{0%,100%{box-shadow:0 0 0 0 #fb718500,0 5px 18px #9f12391a}50%{box-shadow:0 0 0 4px #fb71853d,0 8px 24px #be123c38}}
@keyframes urgent-sheen{0%,100%{opacity:.15}50%{opacity:.85}}
@keyframes urgent-row{0%,100%{box-shadow:inset 4px 0 #e11d48}50%{box-shadow:inset 7px 0 #fb7185}}
[data-motion="paused"] *,[data-motion="paused"] *::before,[data-motion="paused"] *::after{animation:none!important;transition:none!important}
[data-motion="paused"] .button:hover,[data-motion="paused"] a.stat:hover,[data-motion="paused"] .button:active,[data-motion="paused"] .icon-button:active{transform:none}
@media(max-width:1100px){.overview-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){.filter-toolbar .export-actions{padding-left:0;border-left:0}}
@media(max-width:767px){
 .filter-toolbar{gap:18px;padding-top:16px}
 .filter-toolbar .button-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:10px}
 .filter-toolbar .button{width:100%;height:100%}
 .filter-toolbar .export-actions .button{padding:10px 12px;font-size:13px;gap:7px}
 .filter-toolbar .export-actions{padding-top:18px;border-top:1px solid var(--line)}
 .rule-form{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
 .rule-form>strong{grid-column:1/-1}
 .rule-form>.checkbox{justify-self:start}
 .rule-form>.button{grid-column:1/-1}
 .motion-preference{flex-basis:100%;text-align:left}
}
@media(max-width:359px){.filter-toolbar .export-actions{grid-template-columns:minmax(0,1fr)}}
@media(max-width:600px){.overview-stats{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto}
 *,*::before,*::after{animation:none!important;transition:none!important}
 .button:hover,a.stat:hover,.button:active,.icon-button:active{transform:none}
}
