/* R54-R2: photo entry and dark mobile dashboard legibility */
#r54r2-photo-button{position:fixed;z-index:9000;right:16px;bottom:85px;bottom:calc(72px + env(safe-area-inset-bottom, 0px));background:#059669;color:#fff;border:2px solid #b4f4d7;border-radius:999px;padding:13px 18px;box-shadow:0 4px 16px #0008;font-weight:800;font-size:15px;line-height:1.3;cursor:pointer;min-height:48px;-webkit-tap-highlight-color:transparent}
#r54r2-photo-button:focus-visible{outline:3px solid #fcd34d;outline-offset:3px}
.r54r2-backdrop{position:fixed;inset:0;z-index:10500;background:#030812b3}
#r54r2-panel{position:fixed;z-index:10501;right:14px;bottom:20px;width:min(440px,calc(100vw - 28px));max-height:min(88vh,880px);overflow-y:auto;overscroll-behavior:contain;background:#f8fafc;color:#0f172a;border:1px solid #cbd5e1;border-radius:18px;box-shadow:0 8px 36px #0007;padding:18px;font:15px system-ui,-apple-system,sans-serif}
#r54r2-panel header{display:flex;align-items:center;gap:10px;margin-bottom:14px}
#r54r2-panel header h2{color:#0f172a;font-size:20px;margin:0}
#r54r2-panel header p{color:#475569;font-size:12px;margin:3px 0 0}
#r54r2-panel .r54r2-camera{font-size:23px;border-radius:50%;padding:9px;background:#d1fae5}
#r54r2-close{margin-left:auto;background:transparent;border:0;color:#334155;font-size:22px;padding:8px}
#r54r2-panel label{display:block;color:#172b4d;margin:10px 0 4px;font-weight:750;font-size:13px}
#r54r2-panel input:not([type=file]):not([type=checkbox]),#r54r2-panel textarea,#r54r2-panel select{display:block;width:100%;min-height:43px;padding:10px 12px;border:1px solid #94a3b8;border-radius:8px;background:#fff;color:#0f172a;font-size:16px}
#r54r2-panel textarea{resize:vertical}
#r54r2-panel .r54r2-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
#r54r2-panel .r54r2-actions button{background:#dbeafe;border:1px solid #bfdbfe;color:#1e3a8a;border-radius:10px;padding:11px 4px;min-height:44px;font-weight:700}
#r54r2-save{display:block;width:100%;border:0;border-radius:9px;padding:12px;margin-top:13px;background:#059669;color:#fff;font-size:16px;font-weight:800;min-height:44px}
#r54r2-save:disabled{opacity:.55}
#r54r2-message{min-height:20px;font-size:12px;color:#166534;margin:8px 0}
#r54r2-message[data-error=true]{color:#b91c1c}
#r54r2-preview img{display:block;max-width:100%;max-height:140px;object-fit:contain;margin-top:10px;border-radius:8px}
#r54r2-panel h3{color:#0f172a;font-size:14px;padding-top:8px;border-top:1px solid #e2e8f0}
#r54r2-gallery{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
#r54r2-gallery>p{grid-column:1/-1;color:#475569;font-size:13px}
.r54r2-photo{background:#fff;border:1px solid #cbd5e1;padding:6px;border-radius:8px;min-width:0}
.r54r2-photo img{width:100%;height:120px;object-fit:cover;border-radius:6px}
.r54r2-photo small{display:block;color:#334155;overflow-wrap:anywhere;font-size:11px;line-height:1.4;margin:4px 0}
.r54r2-photo button{border:1px solid #fca5a5;color:#b91c1c;background:#fff1f2;border-radius:6px;padding:6px}
@media(max-width:768px){
 #r54r2-photo-button{right:15px;bottom:83px;bottom:calc(74px + env(safe-area-inset-bottom, 0px));font-size:14px}
 #r54r2-panel{right:0;left:0;bottom:0;width:100%;max-height:87dvh;border-radius:20px 20px 0 0;padding:17px 16px calc(20px + env(safe-area-inset-bottom, 0px));border-bottom:0}
 #r54r2-panel .r54r2-handle{width:40px;height:5px;border-radius:99px;background:#94a3b8;margin:0 auto 12px}
 #r54r2-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* Dashboard uses inline light-theme surfaces. Correct only documented, identified cards. */
@media (max-width: 768px) and (prefers-color-scheme: dark){
 :root{--text-tertiary:#a5b7cb}
 .r54r2-home-today{background:#0b2b32!important;border-color:#1d635a!important}
 .r54r2-home-finance{background:#12283c!important;border-color:#334e6e!important}
 .r54r2-home-today [style*="background: white"],.r54r2-home-finance [style*="background: white"]{background:#1b3446!important;color:#f8fafc!important;border-color:#35546b!important}
 .r54r2-home-today [style*="background: rgb(255, 251, 235)"],.r54r2-home-today [style*="background: #fffbeb"]{background:#383017!important;color:#fde68a!important;border-color:#d5a52a!important}
 .r54r2-home-decisions [style*="background: rgb(254, 242, 242)"],.r54r2-home-plan [style*="background: rgb(254, 242, 242)"],.r54r2-home-status [style*="background: rgb(254, 242, 242)"]{background:#3f2733!important;color:#f8fafc!important}
 .r54r2-home-decisions [style*="background: rgb(255, 251, 235)"],.r54r2-home-plan [style*="background: rgb(255, 251, 235)"]{background:#3b321e!important;color:#f8fafc!important}
 .r54r2-home-plan [style*="background: rgb(240, 253, 244)"],.r54r2-home-finance [style*="background: rgb(240, 253, 244)"]{background:#193b37!important;color:#f8fafc!important}
 .r54r2-home-plan [style*="background: rgb(239, 246, 255)"]{background:#1a3148!important;color:#f8fafc!important}
 .r54r2-home-finance [style*="background: rgb(255, 247, 237)"]{background:#3c301f!important}
 .r54r2-home-plan a>div[style*="color: rgb(185, 28, 28)"],.r54r2-home-status strong[style*="color: rgb(185, 28, 28)"]{color:#fda4af!important}
 .r54r2-home-plan a>div[style*="color: rgb(22, 101, 52)"]{color:#86efac!important}
 .r54r2-home-plan a>div[style*="color: rgb(180, 83, 9)"]{color:#fcd34d!important}
 .r54r2-home-finance strong[style*="color: rgb(180, 83, 9)"]{color:#fcd34d!important}
 .r54r2-home-decisions [style*="background: rgb(254, 242, 242)"] strong,.r54r2-home-decisions [style*="background: rgb(255, 251, 235)"] strong{color:#f8fafc!important}
}
@media print{#r54r2-photo-button,#r54r2-panel,.r54r2-backdrop{display:none!important}}

#r54r2-panel label.r54r2-history-toggle{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#475569}#r54r2-panel .r54r2-history-toggle input{width:17px;height:17px;accent-color:#059669}
