html,body{height:auto;min-height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Helvetica,Arial,sans-serif;background:#0b1220;color:#e6edf3}
.app-header{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;background:#0ea5e9;color:#001019;position:sticky;top:0;z-index:50}
.app-header h1{font-size:18px;margin:0;font-weight:800;letter-spacing:.3px}
/* Hide install button by default; will show only when allowed */
#installBtn{display:none}
.container{max-width:980px;margin:16px auto;padding:0 12px}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:14px}
.stats .label{font-size:12px;color:#9fb7c8}
.stats .value{font-size:20px;font-weight:700}
.progress-wrap{width:100%;height:22px;background:#0f1a2b;border-radius:12px;overflow:hidden;margin-bottom:14px;border:1px solid #12233a}
.progress-bar{height:100%;background:#22c55e;width:0%;display:flex;align-items:center;justify-content:center;color:#05290e;font-weight:700;transition:width .25s}
.controls{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 16px}
button{background:#0ea5e9;border:none;color:#001019;padding:10px 14px;border-radius:12px;font-weight:800;cursor:pointer}
button.ghost{background:#6ee7ff;color:#003241}
.start-here{margin:10px 0 8px}
.start-card{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#0f2035;border:1px solid #1b3557;border-radius:14px;padding:12px 14px}
.start-card h2{margin:0 0 4px 0;font-size:16px}
.week{background:#0f1a2b;border:1px solid #1b2b44;border-radius:14px;margin-bottom:12px;overflow:hidden}
.week header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;background:#0f2035;color:#d9effa;cursor:pointer}
.week header h2{font-size:16px;margin:0}
.week .body{padding:10px 10px 14px 10px;display:none}
.week.open .body{display:block}
.grid{display:grid;grid-template-columns:72px 130px 130px 1fr;gap:8px;align-items:center}
.grid .hdr{color:#9fb7c8;font-size:12px}
.row{display:contents}
input,textarea{width:100%;padding:10px;background:#091425;color:#e6edf3;border:1px solid #20314d;border-radius:10px}
textarea{min-height:40px;resize:vertical}
.week-actions{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.tag{display:inline-flex;align-items:center;gap:6px;background:#0b1930;border:1px solid #1b2b44;color:#bde0ff;padding:6px 10px;border-radius:999px;font-size:12px}
.footer{padding:18px;text-align:center;color:#9fb7c8}
.total-line{display:flex;gap:8px;align-items:center;margin-top:10px;color:#9fb7c8}
.total-line strong{color:#e6edf3}
#weeks{min-height:60vh;padding-bottom:24px}
.diag{margin:12px 0;padding:12px;border:1px dashed #28466d;border-radius:12px;background:#0b1930;color:#bde0ff}
