/* ============================================================
   VTN Peer Supporter App — full-screen mobile web app.
   Palette matches the Org Dashboard / Expense app.
   ============================================================ */
:root{
  --navy:#0F2F57; --navy-2:#16406f; --blue:#006394; --blue-600:#0a72a6;
  --ink:#14222f; --muted:#5b6b7a; --faint:#8696a4;
  --line:#e3eaf0; --line-soft:#eef3f7; --bg:#eef2f6; --panel:#fff;
  --red:#dc3545; --red-bg:#fdebec; --orange:#e8890c; --orange-bg:#fdf3e3;
  --green:#1f9d57; --green-bg:#e8f6ee;
  --radius:16px; --radius-sm:11px;
  --shadow-sm:0 1px 2px rgba(15,47,87,.06),0 1px 3px rgba(15,47,87,.05);
  --shadow-md:0 8px 22px rgba(15,47,87,.12);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:var(--font);background:var(--bg);color:var(--ink);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased;overflow:hidden}

/* the app fills the viewport */
#screen{height:100dvh;display:flex;flex-direction:column;background:var(--bg);overflow:hidden;max-width:520px;margin:0 auto;position:relative;box-shadow:0 0 40px rgba(15,47,87,.08)}

/* ---- app header (safe-area aware) ---- */
.appbar{flex:0 0 auto;display:flex;align-items:center;gap:11px;background:linear-gradient(180deg,#123763,#0e2a4d);
  color:#fff;padding:max(11px,env(safe-area-inset-top)) 18px 11px;box-shadow:var(--shadow-md);z-index:30}
.appbar .logo{background:#fff;border-radius:9px;height:38px;width:38px;display:flex;align-items:center;justify-content:center;flex:0 0 auto;overflow:hidden}
.appbar .logo img{height:30px;width:auto;display:block}
.appbar .ttl{font-size:15.5px;font-weight:700;line-height:1.1}
.appbar .sub{font-size:11.5px;color:#9db4cc;margin-top:1px}
.appbar .bell{margin-left:auto;width:34px;height:34px;border-radius:50%;background:rgba(255,255,255,.1);display:flex;align-items:center;justify-content:center;font-size:16px;position:relative;cursor:pointer}
.appbar .bell .dot{position:absolute;top:6px;right:7px;width:8px;height:8px;background:#ff5a5f;border-radius:50%;border:1.5px solid #11365e}
.demopill{display:inline-flex;align-items:center;gap:4px;background:#ffce5c;color:#5a4300;font-size:11px;font-weight:700;padding:5px 9px;border-radius:30px;cursor:pointer;margin-left:8px;white-space:nowrap;flex:0 0 auto}

.body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px 16px 26px}
.body::-webkit-scrollbar{width:0}

.spinner{width:34px;height:34px;border:3px solid #d6e0ea;border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-sm);padding:16px;margin-bottom:14px}
.card h3{font-size:15px;color:var(--navy);margin-bottom:3px}
.card .csub{font-size:12.5px;color:var(--muted);margin-bottom:12px}
.sec-label{font-size:11.5px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--faint);margin:6px 4px 9px}

.greet{padding:4px 4px 14px}
.greet .hi{font-size:23px;font-weight:700;color:var(--navy)}
.greet .role{font-size:13px;color:var(--muted);margin-top:3px;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;font-weight:600;padding:3px 10px;border-radius:30px}
.pill.green{background:var(--green-bg);color:var(--green)}
.pill.orange{background:var(--orange-bg);color:var(--orange)}
.pill.grey{background:#eef2f6;color:#5b6b7a}

.program-hero{border-radius:var(--radius);padding:17px;margin-bottom:16px;color:#fff;position:relative;overflow:hidden;cursor:pointer;background:linear-gradient(135deg,#0c8f53,#0f6e9c);box-shadow:0 12px 26px rgba(15,110,90,.32)}
.program-hero.dim{background:linear-gradient(135deg,#46586b,#5b6b7a);box-shadow:var(--shadow-sm);cursor:default}
.program-hero .glow{position:absolute;inset:0;background:radial-gradient(120px 120px at 85% -10%,rgba(255,255,255,.28),transparent 70%)}
.program-hero .lab{font-size:11px;font-weight:700;letter-spacing:.7px;text-transform:uppercase;opacity:.85}
.program-hero h2{font-size:19px;margin:5px 0 2px;position:relative}
.program-hero .meta{font-size:13px;opacity:.95;position:relative}
.program-hero .row2{display:flex;gap:8px;margin-top:13px;position:relative;flex-wrap:wrap}
.program-hero .chip{background:rgba(255,255,255,.18);border-radius:9px;padding:6px 10px;font-size:12px;font-weight:600}
.program-hero .cta{position:absolute;right:15px;bottom:15px;font-size:20px;opacity:.9}

.qgrid{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin-bottom:6px}
.qtile{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius-sm);padding:15px 13px;box-shadow:var(--shadow-sm);cursor:pointer;transition:transform .08s;position:relative}
.qtile:active{transform:scale(.97)}
.qtile .ico{width:40px;height:40px;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:19px;margin-bottom:9px}
.qtile .t{font-size:14px;font-weight:700;color:var(--navy)}
.qtile .d{font-size:11.5px;color:var(--muted);margin-top:2px;line-height:1.35}
.qtile .badge{position:absolute;top:11px;right:11px;background:#ff5a5f;color:#fff;font-size:10.5px;font-weight:700;min-width:19px;height:19px;border-radius:11px;display:flex;align-items:center;justify-content:center;padding:0 5px}
.i-blue{background:#e7f1f7;color:var(--blue)} .i-green{background:var(--green-bg);color:var(--green)}
.i-orange{background:var(--orange-bg);color:var(--orange)} .i-red{background:var(--red-bg);color:var(--red)}
.i-navy{background:#e8edf4;color:var(--navy)} .i-purp{background:#efe9fb;color:#7c54c9}

.lrow{display:flex;align-items:center;gap:12px;padding:13px 4px;border-bottom:1px solid var(--line-soft);cursor:pointer}
.lrow:last-child{border-bottom:0}
.lrow .ic{width:38px;height:38px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:17px;flex:0 0 auto}
.lrow .tx{flex:1;min-width:0}
.lrow .tx .a{font-size:14px;font-weight:600;color:var(--ink)}
.lrow .tx .b{font-size:12px;color:var(--muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lrow .arr{color:#c2cdd8;font-size:18px;flex:0 0 auto}

.msg-wrap{display:flex;flex-direction:column;height:100%}
.msg-note{background:#fff8e6;border:1px solid #f0e3b8;color:#8a6d1f;font-size:11.5px;padding:8px 12px;border-radius:10px;margin-bottom:12px;display:flex;gap:8px;align-items:flex-start}
.bubble{max-width:80%;padding:10px 13px;border-radius:16px;font-size:13.5px;margin-bottom:9px;line-height:1.4}
.bubble.them{background:#fff;border:1px solid var(--line);border-bottom-left-radius:5px;align-self:flex-start}
.bubble.me{background:var(--blue);color:#fff;border-bottom-right-radius:5px;align-self:flex-end;margin-left:auto}
.bubble .who{font-size:10.5px;font-weight:700;color:var(--blue);margin-bottom:3px}
.bubble .tm{font-size:10px;opacity:.6;margin-top:4px;text-align:right}
.daystamp{text-align:center;font-size:11px;color:var(--faint);margin:6px 0 12px}
.composer{flex:0 0 auto;display:flex;gap:9px;padding:11px 14px calc(11px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff;align-items:center}
.composer input{flex:1;border:1px solid #cfd6e0;border-radius:22px;padding:10px 15px;font-size:14px;font-family:inherit}
.composer .send{width:42px;height:42px;border-radius:50%;background:var(--blue);color:#fff;border:0;font-size:18px;flex:0 0 auto;cursor:pointer}
.thrseg{display:flex;gap:6px;padding:10px 14px 4px;flex:0 0 auto;background:var(--bg);overflow-x:auto;-webkit-overflow-scrolling:touch}
.thrseg::-webkit-scrollbar{height:0}
.thrseg .tb{flex:1 0 62px;display:flex;flex-direction:column;align-items:center;gap:3px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:9px 4px;cursor:pointer;position:relative;transition:.12s}
.thrseg .tb.on{background:var(--navy);border-color:var(--navy)}
.thrseg .tb .av{width:30px;height:30px;font-size:11px}
.thrseg .tb .nm{font-size:11.5px;font-weight:700;color:var(--ink)} .thrseg .tb.on .nm{color:#fff}
.thrseg .tb .dot{position:absolute;top:7px;right:9px;width:9px;height:9px;background:#ff5a5f;border-radius:50%;border:1.5px solid #fff}
.thrseg .tb.on .dot{border-color:var(--navy)}
.thrseg .tb .grp{display:flex} .thrseg .tb .grp .av:last-child{margin-left:-12px}

label{display:block;font-size:12.5px;font-weight:600;color:#344054;margin:14px 0 5px}
input,select,textarea{width:100%;padding:11px 13px;border:1px solid #cfd6e0;border-radius:10px;font-size:14.5px;font-family:inherit;background:#fff}
textarea{resize:vertical;min-height:86px}
input:focus,select:focus,textarea:focus{outline:2px solid #e7f1f7;border-color:var(--blue)}
.btn{display:block;width:100%;background:var(--blue);color:#fff;border:0;padding:13px;border-radius:11px;font-size:15px;font-weight:700;cursor:pointer;margin-top:18px}
.btn:active{background:#00547d}
.btn:disabled{opacity:.6}
.btn.alt{background:#fff;color:var(--navy);border:1px solid #cfd6e0}
.btn.red{background:var(--red)}

.kv{display:flex;justify-content:space-between;gap:14px;padding:11px 2px;border-bottom:1px solid var(--line-soft);font-size:13.5px}
.kv:last-child{border-bottom:0}
.kv .k{color:var(--muted)} .kv .v{font-weight:600;text-align:right}

.note{border-radius:11px;padding:12px 14px;font-size:12.5px;margin-bottom:14px;display:flex;gap:9px;align-items:flex-start}
.note.green{background:var(--green-bg);color:#106c3c} .note.orange{background:var(--orange-bg);color:#9a5b06}
.note.blue{background:#e7f1f7;color:#0a4d72} .note.red{background:var(--red-bg);color:#a31420}
.note .ni{font-size:16px;flex:0 0 auto}

.person{display:flex;align-items:center;gap:11px;padding:10px 2px;border-bottom:1px solid var(--line-soft)}
.person:last-child{border-bottom:0}
.av{width:38px;height:38px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#fff;flex:0 0 auto}
.person .nm{font-size:14px;font-weight:600}.person .rl{font-size:11.5px;color:var(--muted)}

.tabs{flex:0 0 auto;display:flex;background:#fff;border-top:1px solid var(--line);padding:8px 6px calc(8px + env(safe-area-inset-bottom));z-index:30}
.tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:10.5px;color:var(--faint);font-weight:600;cursor:pointer;padding:3px 0;position:relative}
.tab .ti{font-size:21px;line-height:1}
.tab.on{color:var(--blue)}
.tab .tb{position:absolute;top:-2px;right:50%;margin-right:-22px;background:#ff5a5f;color:#fff;font-size:9px;font-weight:700;min-width:16px;height:16px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 4px}

.login{flex:1;display:flex;flex-direction:column;justify-content:center;padding:30px 28px max(30px,env(safe-area-inset-bottom));background:linear-gradient(180deg,#0e2a4d,#0a1f3a);color:#fff}
.login .brand{display:flex;flex-direction:column;align-items:center;margin-bottom:30px}
.login .brand .lg{background:#fff;border-radius:18px;width:78px;height:78px;display:flex;align-items:center;justify-content:center;margin-bottom:16px;box-shadow:0 10px 30px rgba(0,0,0,.3)}
.login .brand .lg img{width:60px}
.login .brand h2{font-size:20px;font-weight:700}
.login .brand p{font-size:13px;color:#9db4cc;margin-top:5px;text-align:center}
.login label{color:#b9cbe0}
.login input{background:rgba(255,255,255,.95);border:0}
.login .otp{display:flex;gap:9px;justify-content:center;margin:8px 0 4px}
.login .otp input{width:46px;height:56px;text-align:center;font-size:24px;font-weight:700;padding:0;border-radius:12px}
.login .ln{font-size:12.5px;color:#9db4cc;text-align:center;margin-top:18px}
.login .ln a{color:#7fc4ee;text-decoration:none;font-weight:600;cursor:pointer}

.toast{position:fixed;left:50%;bottom:96px;transform:translateX(-50%) translateY(20px);background:#11365e;color:#fff;padding:11px 18px;border-radius:30px;font-size:13px;font-weight:600;box-shadow:var(--shadow-md);opacity:0;pointer-events:none;transition:.25s;z-index:80;max-width:90%;text-align:center}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.sheet-back{position:fixed;inset:0;background:rgba(10,25,45,.5);opacity:0;pointer-events:none;transition:.22s;z-index:70;display:flex;align-items:flex-end}
.sheet-back.show{opacity:1;pointer-events:auto}
.sheet{background:#fff;width:100%;max-width:520px;margin:0 auto;border-radius:22px 22px 0 0;padding:20px 18px calc(20px + env(safe-area-inset-bottom));transform:translateY(100%);transition:.26s;max-height:88%;overflow-y:auto}
.sheet-back.show .sheet{transform:translateY(0)}
.sheet .grab{width:40px;height:4px;border-radius:3px;background:#d3dbe4;margin:0 auto 14px}
.sheet h3{font-size:17px;color:var(--navy);margin-bottom:3px}
.sheet .ssub{font-size:12.5px;color:var(--muted);margin-bottom:14px}

.muted-small{font-size:11.5px;color:var(--faint);text-align:center;padding:14px 0 4px}
.checkline{display:flex;gap:10px;align-items:flex-start;padding:11px 0;border-bottom:1px solid var(--line-soft);cursor:pointer;font-size:13.5px}
.checkline:last-child{border-bottom:0}
.checkline .bx{width:21px;height:21px;border:2px solid #c2cdd8;border-radius:6px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;font-size:13px;color:#fff;transition:.12s}
.checkline.done .bx{background:var(--green);border-color:var(--green)}
.checkline.done .lbl{color:var(--faint);text-decoration:line-through}

/* ---- service-anniversary celebration ---- */
.milestone-overlay{position:fixed;inset:0;z-index:300;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#0c2f57,#123763 45%,#0a3d2e);overflow:hidden}
.milestone-overlay canvas{position:absolute;inset:0;width:100%;height:100%}
.milestone-card{position:relative;z-index:2;text-align:center;padding:32px 26px;max-width:340px}
.milestone-card .yrs{font-size:64px;font-weight:800;color:#ffd966;text-shadow:0 2px 12px rgba(0,0,0,.35);line-height:1}
.milestone-card .yrslabel{font-size:14px;font-weight:700;color:#fff;letter-spacing:.6px;text-transform:uppercase;margin-top:4px}
.milestone-card h2{color:#fff;font-size:21px;margin:18px 0 8px}
.milestone-card p{color:#dce7f2;font-size:14.5px;line-height:1.5}
.milestone-card .btn{margin-top:24px;background:#ffd966;color:#123763;font-weight:800}
.milestone-card .btn:active{background:#f0c94a}
