/* GovHub v15b Family Chat: compact blue / red / yellow UI (web + mobile) */
.chat{--cb:#1446a0;--cb2:#2563eb;--cbl:#e8efff;--cr:#d92d3a;--crl:#fdecee;--cy:#f4c430;--cyd:#7a5600;--cyl:#fff7db;display:flex;flex-direction:column;gap:10px;font-size:.92rem}
.chat .sect{margin:6px 2px 0}.chat .sect h3{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin:0}
.chat .card{padding:10px 12px;border-radius:14px}
.chk{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.chk__b{display:flex;align-items:center;gap:8px;border:0;border-radius:14px;padding:12px;font:inherit;text-align:left;cursor:pointer;color:#fff;box-shadow:0 4px 12px rgba(15,23,42,.12)}
.chk__b .i{width:24px;height:24px;flex:none}.chk__b b{display:block;font-size:.98rem;line-height:1.1}.chk__b small{opacity:.85;font-size:.74rem}
.chk__b--safe{background:linear-gradient(135deg,#1446a0,#2563eb)}.chk__b--help{background:linear-gradient(135deg,#b91c2b,#e23744)}
.chk__b:active{transform:scale(.98)}
.chbar{display:flex;gap:6px;flex-wrap:wrap}.chbar .btn{flex:1 1 auto;justify-content:center;gap:5px}
.chbar .btn .i,.chtools .btn .i{width:16px;height:16px}
.chlist{padding:2px 6px!important}
.chrow{display:flex;align-items:center;gap:10px;padding:9px 4px;border-bottom:1px solid rgba(15,23,42,.06);color:inherit;text-decoration:none;min-width:0}
.chrow:last-child{border-bottom:0}.chrow .tile{width:40px;height:40px;border-radius:12px}
.chrow__m{flex:1;min-width:0;display:flex;flex-direction:column}.chrow__m b{font-size:.93rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chrow__m small{color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.8rem}
.chrow__r{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}.chrow__r small{color:#64748b;font-size:.72rem}
.chbadge{background:var(--cr);color:#fff;border-radius:99px;font-size:.7rem;font-weight:700;min-width:20px;height:20px;display:grid;place-items:center;padding:0 6px}
.chav{width:40px;height:40px;border-radius:50%;background:var(--cbl);color:var(--cb);display:grid;place-items:center;font-weight:700;font-size:.85rem;flex:none;overflow:hidden}
.chav img{width:100%;height:100%;object-fit:cover}
.chdots{display:flex;gap:3px;margin-top:3px}.chdot{width:9px;height:9px;border-radius:50%;display:inline-block}
.chdot--safe{background:#2563eb}.chdot--help{background:var(--cr);box-shadow:0 0 0 2px var(--crl)}
.chempty{text-align:center;padding:22px 14px!important;display:flex;flex-direction:column;align-items:center;gap:6px}.chempty .i{width:34px;height:34px;color:var(--cb)}.chempty p{margin:0;font-size:.85rem}
.chtools{display:flex;flex-direction:column;gap:2px}
.chtool{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid rgba(15,23,42,.06);cursor:default}
.chtool:last-child{border-bottom:0}.chtool>.i{width:20px;height:20px;color:var(--cb);flex:none}.chtool>div{flex:1;min-width:0}
.chtool b{display:block;font-size:.88rem}.chtool small{display:block;color:#64748b;font-size:.76rem;line-height:1.3}
.chnote{display:flex;gap:8px;align-items:flex-start;border-radius:12px;padding:9px 11px;font-size:.84rem}.chnote .i{width:18px;height:18px;flex:none;margin-top:1px}
.chnote--red{background:var(--crl);color:#8f1622}.chnote--gold{background:var(--cyl);color:var(--cyd)}
.chsw{position:relative;width:40px;height:23px;flex:none;cursor:pointer}.chsw input{opacity:0;width:0;height:0;position:absolute}
.chsw span{position:absolute;inset:0;background:#cbd5e1;border-radius:99px;transition:.2s}.chsw span:before{content:'';position:absolute;width:17px;height:17px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s}
.chsw input:checked+span{background:var(--cb)}.chsw input:checked+span:before{transform:translateX(17px)}.chsw input:focus-visible+span{outline:2px solid var(--cb2);outline-offset:2px}
/* room */
.chroom{gap:0;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 1px 3px rgba(15,23,42,.08);height:calc(100vh - 190px);min-height:420px}
body[data-page=chat] .chroom{height:calc(100dvh - 150px);border-radius:14px}
.chhead{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid rgba(15,23,42,.07);background:#fff}
.chhead .chav,.chhead .tile.sm{width:36px;height:36px;border-radius:50%}.chhead__m{flex:1;min-width:0}.chhead__m b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chhead__m small{color:#64748b;font-size:.75rem}
.chhead__st{color:var(--cb)}.chhead__hp{color:var(--cr)}
.chstat{display:flex;gap:6px;overflow-x:auto;padding:6px 10px;scrollbar-width:none;border-bottom:1px solid rgba(15,23,42,.05)}.chstat::-webkit-scrollbar{display:none}
.chstat__p{flex:none;display:flex;flex-direction:column;border-radius:10px;padding:4px 9px;font-size:.78rem;font-weight:700;background:#f1f5f9;color:#334155;line-height:1.15}
.chstat__p small{font-weight:500;font-size:.68rem;opacity:.85}.chstat__p--safe{background:var(--cbl);color:var(--cb)}.chstat__p--help{background:var(--cr);color:#fff;animation:chpulse 1.4s infinite}
@keyframes chpulse{50%{box-shadow:0 0 0 4px rgba(217,45,58,.25)}}
.chmsgs{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:5px;background:#f6f8fc;scrollbar-width:thin}
.chold{align-self:center;margin-bottom:6px}
.chm1{display:flex;flex-direction:column;align-items:flex-start;max-width:82%}.chm1--me{align-self:flex-end;align-items:flex-end}
.chwho{font-size:.7rem;color:#64748b;margin:2px 8px 1px}
.chbub{position:relative;background:#fff;border-radius:16px 16px 16px 4px;padding:7px 30px 5px 11px;box-shadow:0 1px 1px rgba(15,23,42,.06);word-wrap:break-word;overflow-wrap:anywhere;min-width:70px}
.chm1--me .chbub{background:var(--cb);color:#fff;border-radius:16px 16px 4px 16px}.chm1--me .chbub a{color:#fff}
.chtx{line-height:1.35}.chmeta{display:block;font-size:.66rem;opacity:.65;margin-top:2px;text-align:right}
.chmore{position:absolute;top:3px;right:3px;border:0;background:none;color:inherit;opacity:.45;padding:3px;cursor:pointer;border-radius:8px}.chmore:hover{opacity:1}.chmore .i{width:15px;height:15px}
.chph{display:block;border:0;padding:0;background:none;cursor:zoom-in;margin:2px 0 4px;border-radius:10px;overflow:hidden}.chph img{display:block;max-width:240px;max-height:260px;width:100%;object-fit:cover}
.chst{display:flex;gap:8px;align-items:flex-start;border-radius:12px;padding:8px 10px;margin:-2px -22px -2px -6px;color:#fff}
.chst .i{width:22px;height:22px;flex:none}.chst b{display:block}.chst p{margin:2px 0 0;font-size:.85rem}.chst a{display:inline-flex;align-items:center;gap:3px;color:#fff;font-size:.8rem;font-weight:600;margin-top:3px;text-decoration:underline}
.chst--safe{background:linear-gradient(135deg,#1446a0,#2563eb)}.chst--help{background:linear-gradient(135deg,#b91c2b,#e23744)}
.chm1 .chbub:has(.chst){background:transparent;box-shadow:none;padding:0 26px 4px 0}.chm1 .chbub:has(.chst) .chmeta{color:#475569;opacity:.8}
.chsys{align-self:center;font-size:.72rem;color:#64748b;background:#eef2f7;border-radius:99px;padding:2px 10px;margin:3px 0}
.chseen{align-self:flex-end;font-size:.7rem;color:#64748b;display:flex;align-items:center;gap:3px;margin-right:4px}.chseen .i{width:13px;height:13px}.chseen--on{color:var(--cb)}
.chcomp{display:flex;align-items:flex-end;gap:6px;padding:8px;border-top:1px solid rgba(15,23,42,.07);background:#fff}
.chcomp textarea{flex:1;resize:none;border-radius:18px;padding:9px 13px;font:inherit;max-height:120px;min-height:38px;border:1px solid #d6dde8;scrollbar-width:none}
.chcomp textarea::-webkit-scrollbar{display:none}
.chcomp__ph{cursor:pointer;color:var(--cb)}.chcomp__go{background:var(--cb)!important;color:#fff!important;border-radius:50%!important}
.chopts{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 10px 8px;background:#fff;flex-wrap:wrap}
.chsmsopt{font-size:.78rem;display:flex;align-items:center;gap:5px;background:var(--cyl);color:var(--cyd);border-radius:99px;padding:3px 10px;font-weight:600}.chsmsopt small{font-weight:500}
.chlink{border:0;background:none;color:var(--cyd);font:inherit;font-size:.78rem;font-weight:700;display:inline-flex;align-items:center;gap:4px;cursor:pointer;padding:3px 0;margin-left:auto}
.chlink .i{width:14px;height:14px}
/* modals: scroll without visible scrollbars */
.modal>.chmod{scrollbar-width:none;-ms-overflow-style:none;padding:16px 16px 14px;max-width:420px}.modal>.chmod::-webkit-scrollbar{display:none}
.chm h2{font-size:1.08rem;margin:0}.chm .row.sp{margin-bottom:10px}
.chm .lbl,.chm label.lbl{display:flex;flex-direction:column;gap:4px;font-size:.82rem;font-weight:600;margin:6px 0}
.chm input:not([type=checkbox]):not([type=radio]),.chm textarea{font:inherit;font-weight:400;border:1px solid #d6dde8;border-radius:10px;padding:9px 11px;width:100%;box-sizing:border-box}
.chm textarea{resize:vertical;scrollbar-width:none}.chm textarea::-webkit-scrollbar{display:none}
.chck{display:flex;align-items:center;gap:7px;font-size:.86rem;margin:5px 0}
.chpick{display:flex;flex-direction:column;max-height:210px;overflow:auto;scrollbar-width:none;margin:2px 0 6px}.chpick::-webkit-scrollbar{display:none}
.chseg{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:6px}
.chseg button{border:2px solid #e2e8f0;background:#fff;border-radius:12px;padding:9px;font:inherit;font-weight:700;display:flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;color:#334155}
.chseg button .i{width:18px;height:18px}.chseg button[data-s=safe].on{border-color:var(--cb,#1446a0);background:#e8efff;color:#1446a0}.chseg button[data-s=help].on{border-color:#d92d3a;background:#fdecee;color:#d92d3a}
.chmenu{display:flex;flex-direction:column;gap:2px;margin-top:6px}
.chmenu button{display:flex;align-items:center;gap:9px;border:0;background:none;font:inherit;padding:10px 6px;border-radius:10px;cursor:pointer;text-align:left;color:#0f172a}
.chmenu button:hover{background:#f1f5f9}.chmenu button.red{color:#d92d3a}.chmenu .i{width:18px;height:18px}
.chcode{display:flex;align-items:center;gap:8px;background:#fff7db;border-radius:12px;padding:8px 10px}.chcode div{flex:1}.chcode small{display:block;color:#7a5600;font-size:.72rem}.chcode b{font-size:1.15rem;letter-spacing:.12em;color:#3b2a00}
.chrn{display:flex;gap:6px;margin-bottom:8px}.chrn input{flex:1}
.chmem{max-height:260px;overflow:auto;scrollbar-width:none}.chmem::-webkit-scrollbar{display:none}
.chset{margin-top:6px}.chset .chtool{cursor:pointer}
.chstx{font-weight:700}.chstx--safe{color:#1446a0}.chstx--help{color:#d92d3a}
.chmod--ph{background:#0b1220!important;padding:8px!important;max-width:min(900px,96vw)!important;position:relative}.chm--ph img{display:block;max-width:100%;max-height:82vh;margin:auto;border-radius:8px}
.chm--ph .ib{position:absolute;top:10px;right:10px;background:rgba(255,255,255,.9);z-index:1}
@media (max-width:520px){.chbar .btn{font-size:.78rem;padding:7px 8px}.chm1{max-width:88%}.chph img{max-width:200px}}
@media (prefers-reduced-motion:reduce){.chstat__p--help{animation:none}}
.chdash{display:flex;align-items:center;gap:10px;margin:10px 16px 0;padding:10px 12px;border-radius:14px;background:#fff;color:#0f172a;text-decoration:none;box-shadow:0 1px 3px rgba(15,23,42,.08);border-left:4px solid #d92d3a}
.chdash__ic{width:36px;height:36px;border-radius:11px;background:#e8efff;color:#1446a0;display:grid;place-items:center;flex:none}.chdash__t{flex:1;min-width:0}.chdash__t b{display:block;font-size:.92rem}.chdash__t small{color:#64748b;font-size:.76rem}
.chdash>.i{color:#94a3b8}
/* self-contained buttons (web app.css and mobile.css use different button classes) */
.chat .btn,.chmod .btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:11px;padding:9px 14px;font:inherit;font-weight:700;font-size:.88rem;cursor:pointer;text-decoration:none;line-height:1.1;white-space:nowrap}
.chat .btn--sm,.chmod .btn--sm{padding:7px 11px;font-size:.8rem}
.chat .btn .i,.chmod .btn .i{width:16px;height:16px}
.chat .btn--p,.chmod .btn--p{background:#1446a0;color:#fff}.chat .btn--p:hover,.chmod .btn--p:hover{background:#0b2a63}
.chat .btn--line,.chmod .btn--line{background:#fff;color:#0b2a63;box-shadow:inset 0 0 0 1px #d6dde8}
.chat .btn--gold,.chmod .btn--gold{background:#f4c430;color:#3b2a00}
.chat .btn--red,.chmod .btn--red{background:#d92d3a;color:#fff}
.chat .btn:disabled,.chmod .btn:disabled{opacity:.6;cursor:default}
.chat .ib,.chmod .ib{width:36px;height:36px;border-radius:11px;border:1px solid #e2e8f0;background:#fff;display:inline-grid;place-items:center;cursor:pointer;color:#0f172a;flex:none;padding:0}
.chat .ib .i,.chmod .ib .i{width:18px;height:18px}
.chmod .row{display:flex;align-items:center}.chmod .row.sp{justify-content:space-between}
.chtool .btn{flex:none}
#chseen{display:flex;justify-content:flex-end}
body[data-page=chat] .chroom{height:calc(100dvh - 228px);min-height:380px}
body[data-page=chat] .chopts{padding-bottom:10px}
.chat .chhead__st{color:#1446a0;border-color:#c7d6f5}.chat .chhead__hp{color:#d92d3a;border-color:#f5c2c7}
.chdash{margin-bottom:8px}
/* web app's global label/input styles: keep the SMS pill and checkbox rows on one line */
.chat .chsmsopt,.chmod .chck{display:inline-flex!important;flex-direction:row!important;align-items:center;gap:6px;white-space:nowrap;width:auto!important}
.chat .chsmsopt input,.chmod .chck input{width:16px!important;height:16px;min-height:0!important;margin:0;padding:0;flex:none;accent-color:#1d4ed8}
.chat .chsmsopt small{white-space:nowrap}
/* ---- v17b: aligned header, check-in cards, action buttons, tool rows, bottom clearance (mobile first, web too) ---- */
body[data-page=chat] .phead__bar{z-index:2;min-height:48px;align-items:center}
body[data-page=chat] .phead__t{display:flex;flex-direction:column;justify-content:center;min-height:42px}
body[data-page=chat] .phead__t h1{line-height:1.15}
body[data-page=chat] .phead__t p{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;line-height:1.3;margin-top:2px;text-wrap:pretty}
body[data-page=chat] .app{padding-bottom:calc(132px + var(--sab,env(safe-area-inset-bottom,0px)))}
.chat{gap:12px}
.chat .sect{margin:8px 4px -2px}
.chat .card{padding:12px 14px}
/* check-in cards (v17c): compact, equal width, icon inline left, fully below the header */
.chat .chk{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
.chat .chk__b{flex-direction:row;justify-content:flex-start;align-items:center;text-align:left;gap:8px;min-height:64px;padding:9px 10px;border-radius:14px;width:100%;box-sizing:border-box;box-shadow:0 3px 10px rgba(15,23,42,.10)}
.chat .chk__b .i{width:28px;height:28px;padding:6px;box-sizing:border-box;border-radius:50%;background:rgba(255,255,255,.2);flex:none}
.chat .chk__b>span{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}
.chat .chk__b b{font-size:.88rem;line-height:1.15;text-wrap:balance}
.chat .chk__b small{font-size:.7rem;line-height:1.2;opacity:.92;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
body[data-page=chat] .phead{padding-bottom:1.25rem}
body[data-page=chat] .phead+.body{margin-top:1rem}
/* action buttons: 3 equal tiles, one primary + two secondary of the same weight */
.chat .chbar{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;flex-wrap:nowrap}
.chat .chbar .btn{flex-direction:column;gap:5px;min-height:56px;padding:7px 6px;gap:3px;border-radius:14px;font-size:.78rem;line-height:1.2;white-space:normal;text-align:center;text-wrap:balance;width:100%;box-sizing:border-box}
.chat .chbar .btn .i{width:18px;height:18px;flex:none}
.chat .chbar .btn--line{background:#fff;color:#1446a0;box-shadow:inset 0 0 0 1.5px #c7d6f5}
/* tool rows (No internet? / Nearby / SMS copies): icon column, full-width text, action below */
.chat .chtools{padding:4px 14px!important;gap:0}
.chat .chtool{display:grid;grid-template-columns:36px minmax(0,1fr) auto;column-gap:12px;row-gap:10px;align-items:start;padding:12px 0}
.chat .chtool>.i{grid-column:1;grid-row:1/span 2;width:36px;height:36px;padding:8px;box-sizing:border-box;border-radius:11px;background:var(--cbl);color:var(--cb)}
.chat .chtool>div{grid-column:2;grid-row:1;min-width:0}
.chat .chtool b{font-size:.92rem;line-height:1.25;margin-top:1px}
.chat .chtool small{font-size:.8rem;line-height:1.4;margin-top:2px;overflow-wrap:break-word}
.chat .chtool>.btn{grid-column:2/-1;grid-row:2;justify-self:start;min-height:38px;padding:8px 14px;border-radius:11px;font-size:.82rem;white-space:normal;text-align:center;max-width:100%}
.chat .chtool>.btn--gold{justify-self:stretch}
.chat .chtool>.chsw{grid-column:3;grid-row:1;align-self:center}
.chat .chtool>div+.chsw{margin-left:4px}
@media (max-width:520px){.chat .chbar .btn{font-size:.78rem;padding:7px 6px}}
@media (max-width:359px){.chat .chbar .btn{font-size:.72rem}.chat .chk__b b{font-size:.84rem}.chat .chk__b{gap:7px;padding:9px}}
/* wider screens (web app): horizontal buttons */
@media (min-width:700px){
 .chat .chk__b{min-height:64px;padding:10px 16px;gap:12px}
 .chat .chbar .btn{flex-direction:row;min-height:44px;gap:7px;font-size:.86rem}
 .chat .chtool{grid-template-columns:36px minmax(0,1fr) auto;align-items:center}
 .chat .chtool>.i{grid-row:1}
 .chat .chtool>.btn{grid-column:3;grid-row:1;justify-self:end;white-space:nowrap}
 .chat .chtool>.btn--gold{justify-self:end}
}
/* v17d nearby offline chat explainer sheet */
.chnear .chnote{margin:2px 0 10px}
.chnear__how{background:#f6f8fc;border-radius:12px;padding:10px 12px;font-size:.86rem}.chnear__how b{display:block;margin-bottom:4px;color:#0b2a63}
.chnear__how ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px;color:#334155;line-height:1.4}
.chnear__soon{display:flex;align-items:center;gap:8px;margin:10px 0 0;padding:9px 12px;border-radius:12px;background:#e8efff;color:#1446a0;font-weight:700;font-size:.86rem}.chnear__soon .i{width:18px;height:18px;flex:none}
.chnear__go{width:100%;margin-top:10px;box-sizing:border-box}
.chnear__sms{font-size:.82rem;margin:10px 0 8px;color:#475569}
.chnear__act{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.chnear__have{margin:12px 0 0;font-size:.78rem;text-align:center}.chnear__have a{color:#1446a0;font-weight:600}
