/* Member app: mobile-first single column; centred phone-width column on larger screens. */
html { background: var(--tint); }
body { background: var(--tint); }
#app { max-width: 440px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: #fff; position: relative; display: flex; flex-direction: column; }
@media (min-width: 520px) { #app { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(22,27,46,.06); } }

.screen { flex: 1; display: flex; flex-direction: column; padding: 0 16px 24px; animation: fadein .18s ease-out; }
.screen.tabbed { padding-bottom: 88px; }
@keyframes fadein { from { opacity: .4; } }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 60px; padding-top: 6px; position: sticky; top: 0; background: #fff; z-index: 5; }
.topbar h1 { font-size: 24px; flex: 1; }
.topbar h2 { font-size: 18px; flex: 1; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); position: relative; }
.iconbtn:hover { background: var(--tint); }
.iconbtn .ico { width: 20px; height: 20px; }
.iconbtn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--crimson); border: 2px solid #fff; }
.back { margin-left: -8px; }
.sub { color: var(--ink-3); font-size: 13px; margin: -4px 0 14px; }

/* tab bar */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; height: 68px; background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11.5px; }
.tabbar a .ico { width: 21px; height: 21px; }
.tabbar a.on { color: var(--blue); font-weight: 600; }

/* splash */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.splash .logo { width: 148px; height: 148px; border-radius: 50%; overflow: hidden; box-shadow: 0 14px 34px rgba(52,66,138,.32); }
.splash .logo img { width: 100%; height: 100%; display: block; }
.splash h1 { color: var(--blue); font-size: 27px; line-height: 1.2; margin-top: 26px; }
.splash p { color: var(--ink-2); max-width: 260px; margin: 10px auto 0; font-size: 13.5px; }
.splash .foot { margin-top: auto; padding-top: 40px; width: 100%; }
.loadbar { width: 112px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; overflow: hidden; }
.loadbar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 4px; animation: load 1.4s ease-in-out forwards; }
@keyframes load { to { width: 100%; } }

/* auth */
.auth-head { text-align: center; padding: 28px 0 18px; }
.auth-head .logo-sm { width: 64px; height: 64px; border-radius: 50%; display: block; margin: 0 auto 14px; }
.auth-head h1 { font-size: 24px; }
.auth-head p { color: var(--ink-2); margin: 6px 0 0; }
.otp { font-size: 26px; letter-spacing: 12px; text-align: center; font-weight: 600; height: 56px; }
.demo-note { background: var(--amber-50); color: var(--amber); border-radius: var(--r); padding: 10px 12px; font-size: 12.5px; }
.inviter { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--ink-3); font-size: 12.5px; margin-top: 16px; }
.strength { display: flex; gap: 4px; margin-top: 6px; } .strength i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.strength.s1 i:nth-child(-n+1) { background: var(--crimson); } .strength.s2 i:nth-child(-n+2) { background: #D48A1A; } .strength.s3 i { background: var(--green); }

/* wizard */
.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 10px; }
.progress i { height: 4px; border-radius: 4px; background: var(--line); } .progress i.on { background: var(--blue); }
.photo-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 4px; }
.photo-pick label { width: 96px; height: 96px; border-radius: 50%; border: 2px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--blue); font-size: 12.5px; font-weight: 600; text-align: center; background: var(--tint); }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { cursor: pointer; }
.chip .x { margin-left: 2px; opacity: .8; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid var(--line-2); border-radius: var(--r); min-height: 44px; }
.tag-input input { border: 0; outline: 0; flex: 1; min-width: 90px; height: 30px; }
.priv-row { display: flex; align-items: center; gap: 12px; }
.priv-row .input { flex: 1; }
.priv-row .state { font-size: 11.5px; color: var(--ink-3); width: 44px; text-align: right; }
.bloodgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bloodgrid button, .bloodgrid a { display: grid; place-items: center; color: var(--ink); height: 42px; border-radius: var(--r); border: 1px solid var(--line-2); background: #fff; font-weight: 600; }
.bloodgrid button.on, .bloodgrid a.on { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.bloodgrid.blue button.on { background: var(--blue); border-color: var(--blue); }
.footer-cta { margin-top: auto; padding-top: 20px; }
.cap { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: 10px; }

/* fee */
.fee-card { border: 1px solid var(--line); border-radius: 16px; text-align: center; padding: 20px; }
.fee-card .amt { font-family: var(--serif); font-size: 44px; font-weight: 700; line-height: 1.1; margin: 6px 0 4px; }
.ticks { list-style: none; padding: 0; margin: 16px 0; } .ticks li { display: flex; gap: 10px; align-items: center; padding: 5px 0; color: var(--ink-2); }
.ticks .ico { color: var(--green); }
.payopt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--blue); border-radius: var(--r); padding: 12px; }
.payopt .qrb { width: 30px; height: 30px; border-radius: 6px; background: var(--crimson-50); color: var(--crimson); font-weight: 700; font-size: 11px; display: grid; place-items: center; }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 5px solid var(--blue); margin-left: auto; }
.qrbox { border: 2px solid var(--crimson); border-radius: 14px; padding: 12px; width: 236px; margin: 12px auto 6px; position: relative; }
#qr canvas, #qr img { display: block; width: 100% !important; height: auto !important; }
.qrbox .qrlogo { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid #fff; background: #fff; }
.steps { background: var(--tint); border-radius: var(--r); padding: 10px 14px; font-size: 13px; color: var(--ink-2); margin: 12px 0; }
.steps ol { margin: 0; padding-left: 18px; }
.receipt { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.receipt div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.receipt div:last-child { border: 0; } .receipt span { color: var(--ink-3); } .receipt b { font-weight: 600; }
.success-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--green-50); color: var(--green); display: grid; place-items: center; margin: 24px auto 14px; }
.success-ico .ico { width: 32px; height: 32px; stroke-width: 2.4; }

/* directory */
.search { position: relative; }
.search > .ico { position: absolute; left: 12px; top: 14px; color: var(--ink-3); }
.search input { padding-left: 38px; padding-right: 36px; background: var(--tint); border-color: var(--tint); }
.search input:focus { background: #fff; }
.search .clear { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
/* The app has its own clear button; hide the browser's built-in one. */
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 10px; }
.quick a { background: var(--tint); border-radius: var(--r); padding: 10px; color: var(--ink); }
.quick b { display: block; font-size: 13px; } .quick span { font-size: 11.5px; color: var(--ink-3); }
.hscroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hscroll::-webkit-scrollbar { display: none; }
.count { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 8px; }
.mcard { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 8px; color: var(--ink); }
.mcard:hover { border-color: var(--line-2); }
.mcard .name { font-weight: 600; font-size: 14.5px; }
.mcard .meta { font-size: 12.5px; color: var(--ink-2); margin: 1px 0 7px; }
.mcard .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 12.5px; border: 0; }
.empty { text-align: center; color: var(--ink-3); padding: 40px 12px; }
.sentinel { height: 40px; display: grid; place-items: center; }
.browse-list a { display: flex; justify-content: space-between; padding: 13px 2px; border-bottom: 1px solid var(--line); color: var(--ink); }
.browse-list a span { color: var(--ink-3); }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(22,27,46,.4); z-index: 40; animation: fadein .2s; }
.sheet { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 18px 18px 0 0; z-index: 41; padding: 10px 16px 16px; animation: up .22s ease-out; }
@keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 12px; }
.sheet h3 { font-family: var(--sans); font-size: 15px; font-weight: 600; margin: 14px 0 8px; }
.sheet .chk { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; cursor: pointer; }
.sheet .chk input { width: 18px; height: 18px; accent-color: var(--blue); }
.sheet .chk .n { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.sheet .sticky { position: sticky; bottom: -16px; background: #fff; padding: 12px 0 0; margin-top: 12px; }

/* profile */
.prof-head { text-align: center; padding: 10px 0 14px; }
.prof-head .av { margin: 0 auto 10px; }
.photo-zoom { display: block; margin: 0 auto; padding: 0; border: 0; background: none; border-radius: 50%; cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 20, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 24px; cursor: zoom-out; animation: lb-in .15s ease-out; }
.lightbox img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; border-radius: 8px; }
.lightbox .lb-name { color: #fff; margin-top: 14px; font-weight: 500; }
.lightbox .lb-close { position: absolute; top: 10px; right: 10px; color: #fff; }
.lightbox .lb-close:hover { background: rgba(255, 255, 255, .12); }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.prof-head h2 { font-size: 22px; }
.prof-head .role { color: var(--ink-2); margin-top: 2px; }
.prof-head .tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 14px; }
.contact-grid.n2 { grid-template-columns: repeat(2, 1fr); } .contact-grid.n3 { grid-template-columns: repeat(3, 1fr); }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: var(--r); border: 1px solid var(--line); color: var(--ink); font-size: 12px; background: #fff; }
.cbtn .ico { width: 20px; height: 20px; color: var(--blue); }
.cbtn.wa .ico { color: var(--green); }
.cbtn:hover { background: var(--tint); }
.section h4 { font-size: 13px; margin: 18px 0 8px; font-weight: 600; }
.section p { margin: 0; color: var(--ink-2); }
.note { background: var(--tint); border-radius: var(--r); padding: 12px; font-size: 13px; color: var(--ink-2); }
.report-link { display: block; text-align: center; color: var(--crimson); font-size: 13px; margin: 26px 0 0; background: none; border: 0; width: 100%; }

/* compose */
.compose .line { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.compose .line > span:first-child { color: var(--ink-3); width: 38px; }
.compose input.bare, .compose textarea.bare { border: 0; outline: 0; width: 100%; padding: 10px 0; }
.compose textarea.bare { min-height: 220px; resize: vertical; line-height: 1.55; }

/* blood */
.urgent { display: flex; align-items: center; gap: 8px; background: var(--crimson-50); color: var(--crimson); border-radius: var(--r); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.urgent b { font-weight: 600; }
.dcard { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 8px; }
.dcard .grp { color: var(--crimson); font-weight: 700; margin-left: auto; }
.req-card { border: 1.5px solid var(--crimson); border-radius: var(--r-lg); padding: 14px; margin-bottom: 14px; }
.req-card h2 { color: var(--crimson); font-size: 22px; }
.req-card.done { border-color: var(--line-2); } .req-card.done h2 { color: var(--ink-2); }
.counter { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); height: 44px; }
.counter button { width: 40px; height: 100%; border: 0; background: none; font-size: 18px; color: var(--blue); }
.counter b { flex: 1; text-align: center; }
.alert-red { background: var(--crimson-50); color: var(--crimson); border-radius: var(--r); padding: 10px 12px; font-size: 13px; }

/* me */
.me-head { display: flex; gap: 14px; align-items: center; padding: 6px 0 16px; }
.meter { background: var(--tint); border-radius: 12px; padding: 12px 14px; }
.meter .bar { height: 6px; border-radius: 6px; background: var(--line); margin: 8px 0 6px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.menu { margin-top: 14px; border-top: 1px solid var(--line); }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; padding: 14px 2px; border: 0; border-bottom: 1px solid var(--line); width: 100%; background: none; color: var(--ink); text-align: left; font-size: 14px; }
.menu .ico { color: var(--ink-3); width: 18px; height: 18px; }
.menu small { display: block; color: var(--ink-3); font-size: 12px; }
.menu .chev { margin-left: auto; }
.menu .red { color: var(--crimson); }
.prow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.prow .grow b { font-weight: 500; display: block; } .prow .grow span { font-size: 12.5px; color: var(--ink-3); word-break: break-all; }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 20px 0 2px; font-weight: 600; }
.banner { background: var(--amber-50); color: var(--amber); border-radius: var(--r); padding: 10px 12px; font-size: 12.5px; margin-bottom: 10px; }
.banner.blue { background: var(--blue-50); color: var(--blue); }
.notif { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif .ico { width: 18px; height: 18px; margin-top: 2px; color: var(--blue); }
.notif.unread { font-weight: 500; }
.notif time { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; }


/* groups */
.gcard { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 8px; color: var(--ink); transition: border-color .15s, background .15s; }
a.gcard:hover { border-color: var(--line-2); background: #FAFBFC; }
a.gcard:active { background: var(--tint); }
.gcard b { display: block; font-weight: 600; font-size: 14.5px; }
.gcard .desc { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.gcard .plat { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.gcard .go { color: var(--ink-3); width: 18px; height: 18px; }
.gcard.off { opacity: .55; }
.gcard.off .pbadge { filter: grayscale(1); }
