@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700;800;900&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --pink: #df1670;
  --pink-dark: #ae0e54;
  --coral: #ff7850;
  --green: #128459;
  --green-dark: #076140;
  --ink: #242431;
  --muted: #70727d;
  --line: #ecebf0;
  --paper: #fffdfd;
  --soft-pink: #fff0f5;
  --soft-yellow: #fff5da;
  --shadow: 0 18px 50px rgba(39, 25, 55, .11);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: 'Noto Sans TC', system-ui, sans-serif;
  color: var(--ink);
  background: #faf9fb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #faf9fb; color: var(--ink); font-size: 15px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--pink-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(223, 22, 112, .38); outline-offset: 3px; }

.auth-page { min-height: 100svh; background: radial-gradient(circle at 18% 6%, #ffc3cc 0, transparent 32%), linear-gradient(135deg, #df1670, #ff7850 62%, #ffd26d); }
.auth-shell { min-height: 100svh; display: grid; place-items: center; padding: 28px 16px; position: relative; overflow: hidden; }
.auth-shell::before, .auth-shell::after { content: ''; position: absolute; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; width: 52vw; height: 52vw; max-width: 700px; max-height: 700px; }
.auth-shell::before { left: -22vw; bottom: -25vw; }
.auth-shell::after { right: -24vw; top: -25vw; }
.auth-card { position: relative; z-index: 1; width: min(100%, 440px); padding: 38px 34px 28px; border: 1px solid rgba(255,255,255,.66); border-radius: var(--radius-xl); background: rgba(255,255,255,.95); box-shadow: 0 28px 70px rgba(70, 9, 43, .24); text-align: center; }
.auth-snow { color: var(--coral); letter-spacing: 8px; font-size: 16px; }
.brand-mark { width: 66px; height: 66px; display: grid; place-items: center; margin: 10px auto 12px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--pink), var(--coral)); font-family: Georgia, serif; font-size: 34px; box-shadow: 0 12px 30px rgba(223, 22, 112, .25); }
.eyebrow { margin: 0 0 3px; color: var(--pink); font: 800 11px/1.4 Outfit, sans-serif; letter-spacing: .16em; }
.auth-card h1 { margin: 0; color: var(--pink-dark); font-size: clamp(26px, 8vw, 36px); line-height: 1.18; letter-spacing: .03em; }
.auth-subtitle { margin: 8px 0 26px; color: var(--muted); font-weight: 700; }
.stack-form { display: grid; gap: 16px; text-align: left; }
.stack-form label { display: grid; gap: 6px; color: #4c4c59; font-weight: 800; font-size: 14px; }
.stack-form input, .stack-form textarea, .stack-form select { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #e1dfe8; border-radius: 13px; background: #fff; color: var(--ink); }
.stack-form input::placeholder, .stack-form textarea::placeholder { color: #a4a4ae; }
.label-optional { color: #9d9da8; font-size: 12px; font-weight: 500; }
.auth-foot { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.auth-info-link { display: inline-block; margin-top: 12px; color: #8a3b5c; font-size: 13px; }

.alert, .notice { border-radius: 14px; padding: 11px 14px; margin: 0 0 15px; font-size: 14px; }
.alert-error { border: 1px solid #f3b5be; color: #a21b3d; background: #fff0f2; }
.alert-success { border: 1px solid #a9dfc6; color: #126b48; background: #edfff5; }
.notice-soft { color: #95405e; background: var(--soft-pink); border: 1px solid #ffd3e0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(110deg, var(--pink), var(--coral)); box-shadow: 0 12px 24px rgba(223, 22, 112, .22); }
.btn-secondary { color: var(--pink-dark); background: #fff; border: 1px solid #f1b6ca; }
.btn-green { color: #fff; background: var(--green); box-shadow: 0 9px 18px rgba(18,132,89,.18); }
.btn-ghost { color: var(--muted); background: #f5f4f7; }
.btn-large { min-height: 54px; width: 100%; font-size: 16px; }
.icon-btn { width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fff; cursor: pointer; }

.app-shell { min-height: 100svh; padding-bottom: 94px; }
.app-header { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 0 18px; }
.hero { position: relative; overflow: hidden; min-height: 258px; margin: 0 -18px; padding: 45px clamp(22px, 6vw, 92px) 38px; display: flex; align-items: center; background: linear-gradient(120deg, #dd1b70, #fd7257 64%, #ffb653); isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -2; background-image: url('images/christmas-banner.svg'); background-repeat: no-repeat; background-size: cover; background-position: center; opacity: .93; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(192,10,84,.43), rgba(251,91,84,.12) 54%, rgba(164,38,72,.35)); }
.hero-copy { max-width: 660px; margin: 0 auto; text-align: center; color: #fff; text-shadow: 0 3px 18px rgba(102, 8, 40, .28); }
.hero-kicker { margin: 0; font: 800 13px/1.5 Outfit, 'Noto Sans TC', sans-serif; letter-spacing: .22em; }
.hero h1 { margin: 5px 0 3px; font-size: clamp(35px, 7vw, 66px); line-height: 1.08; letter-spacing: .04em; }
.hero-subtitle { margin: 0; font-size: clamp(18px, 3vw, 28px); font-weight: 900; }
.hero-ribbon { display: inline-flex; margin-top: 15px; padding: 5px 17px; border-radius: 999px; color: #fff; background: var(--green-dark); font-size: 13px; font-weight: 800; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0 12px; }
.brand-inline { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--pink-dark); font-weight: 900; text-decoration: none; }
.brand-inline-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--pink); font-family: Georgia, serif; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.user-pill { display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 7px 13px 7px 8px; border: 1px solid #f4bfd2; border-radius: 999px; color: var(--pink-dark); background: #fff; cursor: pointer; font-weight: 800; }
.user-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--coral), var(--pink)); }
.user-pill span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-content { width: min(100% - 32px, 1180px); margin: 0 auto; }
.app-nav { position: sticky; top: 9px; z-index: 10; display: flex; gap: 7px; margin: 0 auto 20px; padding: 7px; border: 1px solid rgba(255,255,255,.72); border-radius: 999px; background: rgba(255,255,255,.93); box-shadow: 0 10px 24px rgba(30,27,40,.1); backdrop-filter: blur(12px); }
.nav-tab { flex: 1; min-width: 0; min-height: 46px; border: 0; border-radius: 999px; color: #777781; background: transparent; cursor: pointer; font-size: 14px; font-weight: 800; }
.nav-tab.active { color: #fff; background: linear-gradient(110deg, var(--pink), var(--coral)); box-shadow: 0 7px 15px rgba(223,22,112,.22); }
.nav-tab .nav-icon { display: block; margin-bottom: -2px; font-size: 18px; }
.view { display: none; animation: fade-in .28s ease both; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 12px 0 18px; }
.welcome-row h2 { margin: 0; font-size: clamp(23px, 4vw, 34px); line-height: 1.2; }
.welcome-row p { margin: 4px 0 0; color: var(--muted); }
.guest-callout { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0; padding: 13px 17px; border: 1px solid #f7c7d8; border-radius: 18px; background: #fff5f8; color: #8f2d52; }
.progress-card { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; padding: 18px 20px; border-radius: var(--radius-lg); color: #fff; background: linear-gradient(110deg, #d9166b, #f05b70 52%, #ff8c4f); box-shadow: 0 17px 32px rgba(223, 22, 112, .18); }
.progress-card::after { content: '✦  ❄  ✦'; position: absolute; right: 20px; bottom: -2px; color: rgba(255,255,255,.2); font-size: 30px; letter-spacing: 8px; }
.progress-label { font-size: 13px; font-weight: 800; opacity: .88; }
.progress-number { font: 800 31px/1 Outfit, sans-serif; }
.progress-track { height: 13px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.38); }
.progress-fill { height: 100%; border-radius: inherit; background: #fff; transition: width .4s ease; }
.progress-hint { margin: 4px 0 0; font-size: 12px; opacity: .88; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0; }
.stat-card { padding: 16px 14px; border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: 0 7px 20px rgba(35, 31, 45, .05); text-align: center; }
.stat-number { display: block; color: var(--pink); font: 800 29px/1 Outfit, sans-serif; }
.stat-label { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 700; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 27px 0 12px; }
.section-heading h3 { margin: 0; font-size: 21px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; padding: 2px 0 7px; scrollbar-width: thin; }
.filter-chip { flex: 0 0 auto; padding: 8px 14px; border: 1px solid #e3e0e7; border-radius: 999px; color: #6d6e79; background: #fff; cursor: pointer; font-size: 13px; font-weight: 800; }
.filter-chip.active { color: #fff; border-color: var(--green); background: var(--green); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(330px, .93fr); gap: 16px; }
.map-card { position: relative; min-height: 440px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #d9edf0; box-shadow: var(--shadow); }
#map { width: 100%; height: 100%; min-height: 440px; }
.map-empty { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; min-height: 440px; padding: 30px; color: #5c6f72; background: linear-gradient(145deg, rgba(223,243,233,.94), rgba(205,233,245,.94)); text-align: center; }
.church-list { display: grid; gap: 10px; max-height: 560px; overflow-y: auto; padding-right: 3px; }
.church-card { display: grid; grid-template-columns: 65px 1fr auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 7px 18px rgba(35,31,45,.05); }
.church-card.collected { border-color: #a6ddc4; background: #f3fff9; }
.church-photo { width: 65px; height: 65px; object-fit: cover; border-radius: 15px; background: #f4e8ed; }
.church-card h4 { margin: 0; font-size: 16px; line-height: 1.35; }
.church-card p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.church-status { align-self: start; padding: 4px 8px; border-radius: 999px; color: var(--green-dark); background: #dff7eb; font-size: 12px; font-weight: 800; white-space: nowrap; }
.church-status.unvisited { color: var(--pink-dark); background: #fff0f5; }
.church-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.mini-btn { min-height: 32px; padding: 5px 10px; border: 1px solid #f0bfd0; border-radius: 999px; color: var(--pink-dark); background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }

.scan-panel { overflow: hidden; border-radius: var(--radius-xl); background: #20212b; box-shadow: var(--shadow); }
.scan-intro { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 22px; color: #fff; background: linear-gradient(110deg, var(--pink), var(--coral)); }
.scan-intro h2 { margin: 0; font-size: clamp(23px, 5vw, 34px); }
.scan-intro p { margin: 4px 0 0; opacity: .9; }
.scan-icon { flex: 0 0 auto; width: 66px; height: 66px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.7); border-radius: 18px; font-size: 34px; }
.scanner-stage { position: relative; min-height: 430px; display: grid; place-items: center; padding: 26px; background: radial-gradient(circle at 50% 40%, #5e5561 0, #252630 56%, #15161d 100%); }
.scanner-stage.is-running { background: #12131a; }
#reader { width: min(100%, 390px); min-height: 290px; overflow: hidden; border-radius: 22px; }
#reader video { width: 100% !important; height: auto !important; border-radius: 18px; }
.scan-frame { position: absolute; width: min(69vw, 270px); aspect-ratio: 1; border: 4px solid #fff; border-radius: 25px; box-shadow: 0 0 0 999px rgba(0,0,0,.32); pointer-events: none; }
.scan-frame::after { content: ''; position: absolute; left: 10%; right: 10%; top: 50%; height: 3px; background: #ff4776; box-shadow: 0 0 14px #ff4776; animation: scan-line 2.2s ease-in-out infinite; }
@keyframes scan-line { 0%,100% { transform: translateY(-95px); opacity: .35; } 50% { transform: translateY(95px); opacity: 1; } }
.scanner-idle { display: grid; place-items: center; gap: 12px; color: #fff; text-align: center; }
.scanner-idle .scan-large-icon { font-size: 70px; }
.scanner-idle p { max-width: 270px; margin: 0; color: #dad8df; }
.scan-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 17px; }
.scan-tools .btn { min-width: 135px; }
.file-label { display: inline-flex; }
.file-label input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.scan-result { display: none; margin: 16px 0 0; padding: 16px; border: 1px solid #aadcc2; border-radius: 20px; background: #effff6; }
.scan-result.show { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 12px; }
.scan-result img { width: 62px; height: 62px; object-fit: cover; border-radius: 16px; }
.scan-result strong { display: block; color: var(--green-dark); font-size: 17px; }
.scan-result span { color: #4e7564; font-size: 13px; }
.scan-result-points { color: var(--pink); font: 800 21px Outfit, sans-serif; white-space: nowrap; }
.scan-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.gift-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gift-head h2 { margin: 0; font-size: clamp(25px, 5vw, 38px); }
.gift-balance { padding: 10px 16px; border-radius: 16px; color: #fff; background: var(--green); text-align: center; }
.gift-balance strong { display: block; font: 800 25px/1 Outfit, sans-serif; }
.gift-balance span { font-size: 12px; }
.gift-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.gift-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 9px 24px rgba(35,31,45,.06); }
.gift-card-image { width: 100%; aspect-ratio: 1.25; object-fit: cover; background: #fff2f6; }
.gift-card-body { display: flex; flex: 1; flex-direction: column; padding: 13px 14px 15px; }
.gift-card h3 { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.35; }
.gift-card p { flex: 1; margin: 6px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gift-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-bottom: 11px; color: var(--pink-dark); font-size: 13px; font-weight: 800; }
.gift-card .btn { width: 100%; }
.gift-unavailable { color: #8d8d95; background: #f3f3f5; box-shadow: none; }
.redemption-list { display: grid; gap: 11px; }
.redemption-card { display: grid; grid-template-columns: 63px 1fr auto; align-items: center; gap: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.redemption-card img { width: 63px; height: 63px; object-fit: cover; border-radius: 14px; }
.redemption-card strong { display: block; font-size: 15px; }
.redemption-card small { color: var(--muted); }
.redemption-status { padding: 5px 9px; border-radius: 999px; color: #9a3d1d; background: #fff0da; font-size: 12px; font-weight: 800; white-space: nowrap; }
.redemption-status.claimed { color: var(--green-dark); background: #dff7eb; }
.redemption-token { margin-top: 5px; color: #7e4560; font: 600 11px/1.4 Outfit, monospace; word-break: break-all; }

.profile-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 23px; border-radius: var(--radius-xl); background: linear-gradient(120deg, #fff1f6, #fff9ec); border: 1px solid #f6d7e2; }
.profile-avatar { width: 86px; height: 86px; display: grid; place-items: center; border: 5px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--pink), var(--coral)); box-shadow: 0 9px 20px rgba(223,22,112,.2); font-size: 35px; }
.profile-hero h2 { margin: 0; font-size: 25px; }
.profile-hero p { margin: 3px 0 0; color: var(--muted); }
.profile-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.profile-form label { display: grid; gap: 5px; color: #5e5e69; font-size: 13px; font-weight: 800; }
.profile-form input { min-height: 43px; padding: 8px 11px; border: 1px solid #e0dee6; border-radius: 12px; background: #fff; }
.timeline { display: grid; gap: 10px; }
.timeline-item { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; padding: 10px; border-left: 4px solid var(--pink); border-radius: 15px; background: #fff; box-shadow: 0 6px 17px rgba(35,31,45,.05); }
.timeline-item img { width: 58px; height: 58px; object-fit: cover; border-radius: 13px; }
.timeline-item strong { display: block; font-size: 16px; }
.timeline-item small { color: var(--muted); }
.timeline-badge { padding: 5px 9px; border-radius: 999px; color: var(--pink-dark); background: var(--soft-pink); font: 700 12px Outfit, sans-serif; white-space: nowrap; }
.empty-state { padding: 28px 18px; border: 1px dashed #dedbe3; border-radius: 18px; color: var(--muted); background: #fff; text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 18px; background: rgba(27,18,30,.65); backdrop-filter: blur(6px); }
.modal-backdrop.show { display: grid; }
.modal-card { position: relative; width: min(100%, 480px); max-height: min(90svh, 720px); overflow: auto; padding: 26px; border-radius: 27px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-card h2 { margin: 0 30px 8px 0; color: var(--pink-dark); font-size: 25px; }
.modal-card p { color: var(--muted); }
.redeem-confirm { text-align: center; }
.redeem-confirm img { width: 170px; height: 136px; object-fit: cover; border-radius: 20px; background: #fff0f5; }
.redeem-confirm .cost { margin: 10px 0 16px; color: var(--pink); font: 800 25px Outfit, sans-serif; }
.gift-opening { display: none; position: fixed; inset: 0; z-index: 200; place-items: center; padding: 18px; background: rgba(35,12,28,.84); }
.gift-opening.show { display: grid; }
.gift-opening-card { width: min(100%, 410px); padding: 29px 24px; border: 3px solid #ffd87b; border-radius: 29px; color: #fff; background: linear-gradient(145deg, #df1670, #ff7850); text-align: center; box-shadow: 0 25px 90px rgba(255,88,101,.3); }
.gift-opening-card h2 { margin: 0; font-size: 28px; }
.gift-box { position: relative; width: 150px; height: 125px; margin: 33px auto 29px; transform-origin: bottom center; animation: box-bounce 1.15s ease-in-out infinite; }
.gift-box::before { content: ''; position: absolute; left: 13px; right: 13px; bottom: 0; height: 92px; border-radius: 10px; background: #e52e62; box-shadow: inset 0 -12px rgba(139,13,71,.12); }
.gift-box::after { content: ''; position: absolute; top: 18px; left: 2px; width: 146px; height: 30px; border-radius: 8px; background: #ffcc56; box-shadow: 0 18px 0 #ffcc56; }
.gift-lid { position: absolute; top: 2px; left: -5px; z-index: 1; width: 160px; height: 35px; border-radius: 9px; background: #ff375f; transform-origin: 12px 31px; animation: lid-open 1.8s ease-in-out infinite; }
.gift-lid::after { content: ''; position: absolute; left: 70px; top: -25px; width: 19px; height: 87px; border-radius: 8px; background: #ffcc56; }
@keyframes box-bounce { 0%,100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-4deg) translateY(-7px); } 65% { transform: rotate(4deg) translateY(-6px); } }
@keyframes lid-open { 0%,22% { transform: rotate(0) translateY(0); } 46%,100% { transform: rotate(-25deg) translate(-15px,-25px); } }
.opening-sparkles { color: #ffe48b; font-size: 26px; letter-spacing: 11px; animation: sparkle 1.1s ease-in-out infinite alternate; }
@keyframes sparkle { from { opacity: .35; transform: scale(.85); } to { opacity: 1; transform: scale(1.12); } }
.gift-opening-result { display: none; }
.gift-opening-result.show { display: block; }
.gift-opening-result img { width: 146px; height: 116px; object-fit: cover; border-radius: 18px; background: #fff; }
.gift-opening-result h3 { margin: 9px 0 2px; font-size: 22px; }
.gift-opening-result p { margin: 0 0 15px; color: rgba(255,255,255,.88); }
.reduced-motion *, .reduced-motion *::before, .reduced-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }

.app-footer-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: none; justify-content: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.93); border-top: 1px solid #eeeaf0; box-shadow: 0 -8px 25px rgba(30,27,40,.08); backdrop-filter: blur(14px); }
.app-footer-nav .nav-tab { max-width: 170px; }
.toast { position: fixed; right: 16px; bottom: 92px; z-index: 250; max-width: min(390px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #dedbe4; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 16px 38px rgba(35,31,45,.16); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: #a8ddc2; color: var(--green-dark); background: #effff6; }
.toast.error { border-color: #f1bbc7; color: #a21b3d; background: #fff1f4; }

@media (max-width: 960px) {
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-layout { grid-template-columns: 1fr; }
  .church-list { max-height: none; }
  .map-card { min-height: 350px; }
  #map { min-height: 350px; }
  .profile-hero { grid-template-columns: auto 1fr; }
  .profile-hero > .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .auth-card { padding: 28px 20px 22px; }
  .hero { min-height: 232px; padding: 34px 18px 29px; margin: 0 -18px; }
  .hero h1 { font-size: clamp(32px, 10vw, 45px); }
  .hero-ribbon { font-size: 12px; }
  .main-content { width: min(100% - 22px, 1180px); }
  .topbar { padding: 11px 0; }
  .brand-inline > span:last-child { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-pill { padding-right: 9px; }
  .user-pill span:last-child { display: none; }
  .app-nav { display: none; }
  .app-footer-nav { display: flex; }
  .progress-card { grid-template-columns: auto 1fr; gap: 11px; padding: 15px; }
  .progress-card > :last-child { grid-column: 1 / -1; }
  .progress-number { font-size: 27px; }
  .stats-grid { gap: 7px; }
  .stat-card { padding: 13px 7px; }
  .stat-number { font-size: 24px; }
  .stat-label { font-size: 12px; }
  .welcome-row { align-items: start; flex-direction: column; gap: 7px; }
  .guest-callout { align-items: stretch; flex-direction: column; }
  .scan-intro { align-items: start; padding: 17px; }
  .scan-icon { width: 53px; height: 53px; font-size: 27px; }
  .scanner-stage { min-height: 390px; padding: 15px; }
  .scan-result.show { grid-template-columns: 56px 1fr; }
  .scan-result-points { grid-column: 2; }
  .gift-head { align-items: start; flex-direction: column; }
  .gift-balance { width: 100%; display: flex; align-items: center; justify-content: space-between; }
  .gift-balance strong { display: inline; }
  .gift-grid { gap: 9px; }
  .gift-card-body { padding: 10px; }
  .gift-card h3 { font-size: 15px; }
  .gift-card p { font-size: 12px; }
  .gift-meta { align-items: start; flex-direction: column; gap: 2px; }
  .church-card { grid-template-columns: 55px 1fr; }
  .church-photo { width: 55px; height: 55px; }
  .church-status { grid-column: 2; justify-self: start; }
  .church-actions { margin-top: 7px; }
  .profile-hero { grid-template-columns: auto 1fr; gap: 12px; padding: 16px; }
  .profile-avatar { width: 65px; height: 65px; font-size: 27px; }
  .profile-hero h2 { font-size: 20px; }
  .profile-hero > .btn { grid-column: 1 / -1; width: 100%; }
  .profile-form { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 48px 1fr; }
  .timeline-item img { width: 48px; height: 48px; }
  .timeline-badge { grid-column: 2; justify-self: start; }
  .modal-card { padding: 22px 17px; }
  .toast { right: 11px; bottom: 83px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
