:root{
  --bg:#f5f7f9;--panel:#fff;--text:#151a22;--muted:#667085;--line:#e7eaee;
  --red:#d71920;--red-soft:#fff1f2;--green:#148544;--green-soft:#eaf8ef;
  --shadow:0 8px 26px rgba(16,24,40,.07);--radius:22px;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{-webkit-font-smoothing:antialiased}
button,input,select{font:inherit}button{cursor:pointer}
.app-shell{max-width:760px;margin:0 auto;min-height:100vh}
.topbar{position:sticky;top:0;z-index:20;min-height:72px;display:flex;align-items:center;justify-content:space-between;padding:12px 18px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}
.brand-wrap{display:flex;align-items:center;gap:11px}
.brand-mark{width:42px;height:42px;display:grid;place-items:center;border-radius:14px 14px 18px 18px;background:linear-gradient(180deg,#e8262c,#bd1218);color:#fff;font-size:24px;box-shadow:0 6px 14px rgba(215,25,32,.22)}
.brand-title{font-size:18px;line-height:1.05;font-weight:850;color:var(--red)}
.brand-subtitle{margin-top:2px;font-size:17px;line-height:1.05;font-weight:800}
.main{padding:18px 16px 34px}
.panel,.welcome-card{background:var(--panel);border:1px solid rgba(231,234,238,.95);border-radius:var(--radius);box-shadow:var(--shadow)}
.panel{padding:20px;margin-bottom:16px}.auth-panel{max-width:560px;margin:20px auto}
h1,h2,p{margin-top:0}h1{margin-bottom:8px;font-size:28px;line-height:1.15}h2{margin-bottom:4px;font-size:21px;line-height:1.2}
.eyebrow{margin-bottom:6px;color:var(--red);font-size:12px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.muted{color:var(--muted);line-height:1.5}
.field{display:block;margin:15px 0}.field>span{display:block;margin-bottom:7px;font-size:14px;font-weight:750}.field small{display:block;margin-top:6px;color:#7a8493;font-size:12px;line-height:1.4}
input,select{width:100%;min-height:48px;padding:11px 13px;border:1px solid #cfd5dc;border-radius:13px;background:#fff;color:var(--text);outline:none;transition:.18s ease}
input:focus,select:focus{border-color:#e38e92;box-shadow:0 0 0 4px rgba(215,25,32,.08)}
.btn{width:100%;min-height:48px;border:0;border-radius:13px;padding:11px 15px;margin-top:10px;font-weight:800}
.btn-primary{background:linear-gradient(180deg,#e52329,#cc151b);color:#fff;box-shadow:0 7px 15px rgba(215,25,32,.18)}
.btn-soft{background:#eef2f5;color:#27303d}.btn-link{background:transparent;color:#606a78}
.text-btn{border:0;background:transparent;color:#6d3a24;font-weight:750}
.hidden{display:none!important}.msg{margin-top:12px;font-size:14px;line-height:1.4}.msg.err{color:#b42318}.msg.ok{color:#067647}
.welcome-card{position:relative;overflow:hidden;min-height:165px;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:24px;margin-bottom:16px;background:radial-gradient(circle at 92% 15%,rgba(233,72,77,.24),transparent 30%),linear-gradient(135deg,#fff8f8,#fff0f0)}
.welcome-card:after{content:"";position:absolute;width:220px;height:220px;right:-90px;bottom:-115px;border-radius:50%;background:rgba(215,25,32,.07)}
.welcome-label{font-size:17px}.welcome-name{margin-top:3px;font-size:33px;line-height:1.05;font-weight:900}.welcome-copy{max-width:420px;margin-top:10px;color:#404857;line-height:1.45}
.welcome-heart{position:relative;z-index:2;font-size:58px;color:var(--red);opacity:.92}
.section-heading{display:flex;align-items:flex-start;gap:12px}.section-heading p{margin:7px 0 0;color:var(--muted);line-height:1.5}
.section-icon{flex:0 0 38px;width:38px;height:38px;display:grid;place-items:center;border:1px solid #ffd1d3;border-radius:12px;background:var(--red-soft);color:var(--red);font-weight:900}
.qr-panel{padding-bottom:22px}.qr-frame{max-width:390px;margin:20px auto 14px;padding:22px 18px 17px;border:1px solid #f0d1d3;border-radius:18px;background:linear-gradient(180deg,#fff,#fffafa);text-align:center}
#qrcode{display:flex;justify-content:center}#qrcode img,#qrcode canvas{max-width:100%;height:auto!important}
.donor-display{margin-top:14px;font-size:18px;font-weight:900;letter-spacing:.01em}
.info-strip{max-width:520px;margin:0 auto 12px;padding:12px 14px;border-radius:13px;background:#fff7f7;color:#5e4547;font-size:13px;line-height:1.5;text-align:center}
.section-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.event-card{display:grid;grid-template-columns:80px 1fr;gap:14px;padding:15px;margin-top:11px;border:1px solid var(--line);border-radius:17px;background:#fff}
.event-date{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:88px;padding:8px;border-radius:14px;background:#f7f7f8;text-align:center}
.event-date .dow{font-size:11px;font-weight:800;color:#626b78;text-transform:uppercase}.event-date .day{margin:2px 0;color:var(--red);font-size:34px;line-height:1;font-weight:900}.event-date .month{font-size:11px;font-weight:800}
.event-title{font-weight:850;line-height:1.35}.event-meta{margin-top:7px;color:#525c69;font-size:14px;line-height:1.55}
.badge{display:inline-flex;align-items:center;gap:5px;margin-top:9px;padding:5px 9px;border-radius:999px;background:var(--green-soft);color:var(--green);font-size:12px;font-weight:850}.event-action{margin-top:10px}
.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:15px 0 18px}.summary-card{padding:13px 8px;border-radius:15px;background:#f7f9fb;text-align:center}.summary-card b{display:block;font-size:27px}.summary-card span{display:block;margin-top:2px;color:var(--muted);font-size:11px;line-height:1.25}
.history-card{padding:14px 0;border-top:1px solid var(--line)}.history-title{font-weight:800}.history-meta,.history-status{margin-top:4px;color:#596270;font-size:13px;line-height:1.45}
.photos{display:flex;gap:8px;overflow:auto;margin-top:10px;padding-bottom:3px}.photos img{width:126px;height:92px;flex:0 0 auto;object-fit:cover;border-radius:11px;border:1px solid var(--line)}
.empty-state{padding:18px 8px;color:var(--muted);text-align:center}
@media(max-width:520px){.main{padding:14px 12px 28px}.panel{padding:17px;border-radius:19px}.welcome-card{min-height:150px;padding:20px}.welcome-name{font-size:29px}.welcome-heart{font-size:44px}.event-card{grid-template-columns:68px 1fr;gap:11px;padding:12px}.event-date{min-height:78px}.event-date .day{font-size:30px}.summary-grid{gap:6px}.summary-card{padding:11px 5px}}

.profile-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin:10px 0 8px;
}
.profile-item{
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fafbfc;
}
.profile-item span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-bottom:5px;
}
.profile-item b{
  font-size:15px;
}
.profile-note{
  margin:8px 0 2px;
  padding:10px 12px;
  border-radius:12px;
  background:#f7f8fa;
  color:#667085;
  font-size:12px;
  line-height:1.5;
}
@media(max-width:520px){
  .profile-grid{grid-template-columns:1fr}
}

.loading-photo{
  background:#eef1f4;
  min-height:92px;
}


.photo-item{
  flex:0 0 auto;
  width:150px;
}

.photo-item .donor-photo{
  display:block;
  width:150px;
  height:188px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--line);
  background:#eef1f4;
}

.photo-download-btn{
  width:100%;
  min-height:36px;
  margin-top:7px;
  padding:7px 8px;
  border:0;
  border-radius:10px;
  background:#eef2f5;
  color:#27303d;
  font-size:12px;
  font-weight:800;
}

.photo-download-btn:disabled{
  opacity:.6;
}

.photo-error{
  display:block;
  position:relative;
  background:#f3f4f6;
}

.install-wrap{
  margin:0 0 14px;
  display:flex;
  justify-content:center;
}
.install-btn-fuhui{
  border:1px solid rgba(215,25,32,.18);
  background:rgba(255,255,255,.88);
  color:#c5161d;
  border-radius:999px;
  padding:10px 16px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,23,42,.06);
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.install-help-fuhui{
  position:fixed;
  inset:0;
  z-index:9998;
  background:rgba(29,46,40,.42);
  backdrop-filter:blur(3px);
  display:none;
  align-items:flex-end;
  justify-content:center;
  padding:18px;
}
.install-help-fuhui.show{display:flex}
.install-sheet-fuhui{
  width:min(100%,520px);
  background:#fff;
  border-radius:24px;
  padding:22px;
  box-shadow:0 20px 60px rgba(30,50,43,.22);
}
.install-sheet-fuhui h3{
  margin:0 0 10px;
  font-size:22px;
  font-weight:700;
}
.install-sheet-fuhui p{
  margin:0;
  font-size:14px;
  line-height:1.6;
  color:#667085;
}
.install-steps-fuhui{
  margin:14px 0 0;
  padding-left:20px;
  font-size:14px;
  line-height:1.7;
}
.install-close-fuhui{
  width:100%;
  margin-top:16px;
  border:0;
  border-radius:14px;
  padding:12px;
  background:#f3f4f6;
  color:#344054;
  font-weight:800;
  cursor:pointer;
}

.global-loading{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(255,255,255,.72);backdrop-filter:blur(3px)}
.global-loading-box{min-width:220px;padding:24px 22px;border-radius:20px;background:#fff;text-align:center;box-shadow:0 18px 55px rgba(16,24,40,.18);border:1px solid var(--line)}
.loading-spinner{width:42px;height:42px;margin:0 auto 14px;border:4px solid #f1d4d6;border-top-color:var(--red);border-radius:50%;animation:donorSpin .8s linear infinite}
@keyframes donorSpin{to{transform:rotate(360deg)}}
.global-loading-title{font-size:17px;font-weight:850}.global-loading-text{margin-top:4px;font-size:13px;color:var(--muted)}


/* V4 — opening checklist */
.preflight-overlay{
  position:fixed;inset:0;z-index:12000;display:flex;align-items:center;justify-content:center;
  padding:18px;background:
    radial-gradient(circle at 85% 10%,rgba(215,25,32,.16),transparent 28%),
    linear-gradient(180deg,#fff6f6,#ffffff 55%,#f7f8fa);
}
.preflight-card{
  width:min(100%,560px);max-height:calc(100vh - 36px);overflow:auto;
  background:#fff;border:1px solid #f0d8d9;border-radius:28px;padding:26px 22px 22px;
  box-shadow:0 24px 70px rgba(83,25,29,.16)
}
.preflight-icon{
  width:56px;height:56px;margin:0 auto 13px;display:grid;place-items:center;border-radius:18px;
  background:linear-gradient(180deg,#e82c32,#c8141a);color:#fff;font-size:29px;
  box-shadow:0 10px 24px rgba(215,25,32,.23)
}
.preflight-eyebrow{text-align:center;color:var(--red);font-size:11px;font-weight:900;letter-spacing:.1em;text-transform:uppercase}
.preflight-card h1{text-align:center;font-size:26px;margin:6px 0 8px}
.preflight-intro{text-align:center;color:var(--muted);font-size:14px;line-height:1.55;margin:0 auto 18px;max-width:470px}
.preflight-list{display:grid;gap:10px}
.preflight-item{
  display:flex;gap:12px;align-items:flex-start;padding:13px 14px;border-radius:16px;
  background:#fff8f8;border:1px solid #f4dddd
}
.preflight-num{
  flex:0 0 31px;width:31px;height:31px;display:grid;place-items:center;border-radius:999px;
  background:var(--red);color:#fff;font-weight:900;font-size:13px
}
.preflight-item b{display:block;font-size:14px;line-height:1.35}
.preflight-item small{display:block;margin-top:3px;color:var(--muted);font-size:12px;line-height:1.4}
.preflight-note{
  margin-top:14px;padding:11px 13px;border-radius:14px;background:#f6f7f8;color:#5e6875;
  font-size:12px;line-height:1.5;text-align:center
}
.preflight-btn{margin-top:16px;min-height:50px}
.summary-grid{grid-template-columns:repeat(4,1fr)}
@media(max-width:520px){
  .preflight-card{padding:22px 16px 17px;border-radius:24px}
  .preflight-card h1{font-size:23px}
  .summary-grid{grid-template-columns:repeat(2,1fr)}
}

.sync-badge{position:fixed;right:12px;top:12px;z-index:11000;background:#fff;border:1px solid #e4e7eb;
border-radius:999px;padding:7px 11px;font-size:11px;font-weight:800;color:#667085;box-shadow:0 5px 16px rgba(0,0,0,.08)}
.sync-badge.ok{color:#247a43}.sync-badge.err{color:#b42318}

.brand-subtitle{font-size:12px;opacity:.82;margin-top:2px;font-weight:600}
