/* app-shell.css: makes CivicBridge feel like a phone app. Loaded after styles.css; delete the link in index.html to go back. */
:root{--ink:#14212b;--muted:#5b6770;--teal:#2458c4;--teal-dark:#193f91;--canvas:#f3f5f6;--surface:#fff;--mint:#e8efff;--line:#e3e8eb;--warning:#fdf3df;--warning-ink:#5d4413;--radius:16px;--bar:56px;--tabs:64px;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:var(--canvas);-webkit-text-size-adjust:100%}
body{background:var(--canvas);-webkit-font-smoothing:antialiased;overscroll-behavior-y:none}
h1,h2,h3{font-family:inherit;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
h1{font-size:clamp(1.75rem,3.2vw,2.5rem);line-height:1.12;margin-bottom:.7rem}
h1 em{font-style:normal;color:var(--teal)}
h2{font-size:1.3rem;line-height:1.25;margin-bottom:.5rem}
h3{font-size:1.05rem}
.eyebrow{font-size:.8125rem;font-weight:600;letter-spacing:0;text-transform:none;color:var(--muted);margin-bottom:.35rem}
.muted,.meta{color:var(--muted)}
a{text-underline-offset:3px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:1.1rem 1.15rem;box-shadow:none}
.notice{border:0;border-radius:12px;background:var(--warning);color:var(--warning-ink)}
.pill{background:var(--mint);color:var(--teal-dark);border-radius:999px;padding:.2rem .65rem;font-size:.75rem;font-weight:600}
button{border-radius:12px;border:1px solid var(--line);background:var(--surface);font-weight:600;transition:transform .08s,background-color .15s}
button:hover,a.card:hover{background:#f6f8f8;border-color:var(--line)}
button:active,.primary:active,a.card:active{transform:scale(.98)}
.primary{background:var(--teal);border-color:var(--teal);border-radius:12px;font-weight:600;font-size:1rem;min-height:50px}
.primary:hover{background:var(--teal-dark);border-color:var(--teal-dark)}
.text-link{color:var(--teal);font-weight:600}
input[type=search],input[type=text],select,textarea,#voice-input{font-size:1rem;border:1px solid #cfd7dc;border-radius:12px;background:#fff;min-height:50px}
textarea{width:100%;padding:.8rem 1rem;font:inherit;color:var(--ink)}
:focus-visible{outline:3px solid #3870d9;outline-offset:3px}
/* top bar */
.topbar{position:sticky;top:0;z-index:30;background:rgba(255,255,255,.92);-webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);border-bottom:1px solid var(--line);padding:max(.45rem,env(safe-area-inset-top)) 1.25rem .45rem;max-width:none;margin:0;min-height:var(--bar)}
.topbar>*{position:relative}
.brand{font-size:1.2rem;font-weight:700;letter-spacing:-.03em}
.brand-mark{width:34px;height:34px;border-radius:10px;background:var(--teal);color:#fff}
.brand-mark svg{width:24px;height:24px}
.topbar .quiet{font-size:.9rem;border:0;background:transparent;color:var(--ink);min-height:44px}
.topbar #global-voice{background:var(--teal);color:#fff;border-radius:999px;padding:.4rem 1.05rem .4rem 2.2rem;position:relative}
.topbar #global-voice::before{content:"";position:absolute;left:.85rem;top:50%;width:16px;height:16px;margin-top:-8px;background:#fff;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3z'/%3E%3Cpath d='M19 11a7 7 0 0 1-14 0'/%3E%3Cpath d='M12 18v3'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3z'/%3E%3Cpath d='M19 11a7 7 0 0 1-14 0'/%3E%3Cpath d='M12 18v3'/%3E%3C/svg%3E") center/contain no-repeat}
.app-layout{max-width:1120px;padding:1.25rem 1.25rem 2rem}
.navigation{border-bottom:0;margin-bottom:1.5rem;padding:0;gap:.25rem}
.navigation a{border-radius:10px;font-weight:600;color:var(--muted)}
.navigation a[aria-current=page]{background:var(--mint);color:var(--teal-dark)}
.count[hidden]{display:none}
.count{background:var(--teal);color:#fff;border-radius:999px;font-size:.7rem;padding:.05rem .45rem;min-width:1.2rem;text-align:center}
/* tab icons exist for every link; shown only in the phone tab bar */
.navigation a::before{content:none}
main{animation:cb-in .22s ease-out}
@keyframes cb-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){main{animation:none}}
.footer{border-top:0;background:transparent}
/* letter picker: a big, obvious camera target */
.file-pick{display:block;border:2px dashed #b7c4ca;border-radius:var(--radius);padding:1rem;background:#fafcfc;text-align:center}
.file-pick span{display:block;font-weight:600;margin-bottom:.6rem}
.file-pick input{width:100%;font-size:.95rem}
.file-pick input::file-selector-button{background:var(--teal);color:#fff;border:0;border-radius:10px;padding:.7rem 1.1rem;font:inherit;font-weight:600;margin-right:.7rem;min-height:44px}
.letter-plan .check-row{padding:.8rem 0}
.voice-card{background:var(--teal);border-radius:var(--radius)}
.voice-card .feature-icon{background:rgba(255,255,255,.16);color:#fff}
.voice-card button{background:#fff;border-color:#fff;color:var(--teal-dark)}
.feature-icon{background:var(--mint);color:var(--teal);border-radius:12px}
.featured,.local-controls,.empty{background:#eef3fc;border-color:var(--line)}
.category-symbol{background:var(--mint);border-radius:10px}
.mini-tags span{background:var(--mint);color:var(--teal-dark);border-radius:999px}
.filters button[aria-pressed=true]{background:var(--teal);border-color:var(--teal)}
progress{accent-color:var(--teal)}
.check-row input{accent-color:var(--teal)}
.trust-row span:before{color:var(--teal)}
dialog{border-radius:20px;border:0;background:var(--surface)}
dialog::backdrop{background:rgba(16,28,36,.5);backdrop-filter:none}
/* ---- phone ---- */
@media(max-width:760px){
 :root{font-size:16px}
 body{padding-bottom:calc(var(--tabs) + env(safe-area-inset-bottom))}
 .topbar{padding-left:1rem;padding-right:.5rem;gap:.15rem;flex-wrap:nowrap}
 .topbar #global-voice{padding:.35rem .9rem .35rem 2.1rem}
 .topbar [data-action=settings]{font-size:0;width:44px;padding:0;position:relative;flex:none}
 .topbar [data-action=settings]::before{content:"";position:absolute;inset:0;margin:auto;width:22px;height:22px;background:var(--ink);-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E") center/contain no-repeat}
 .app-layout{padding:1rem 1rem 1.5rem}
 h1{font-size:1.75rem}
 .navigation{position:fixed;left:0;right:0;bottom:0;z-index:40;margin:0;padding:.3rem .25rem calc(.3rem + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,1fr);gap:0;background:rgba(255,255,255,.94);-webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);border-top:1px solid var(--line)}
 .navigation a[data-nav=local],.navigation a[data-nav=benefits]{display:none}
 .navigation a{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:.15rem;padding:.35rem .1rem;min-height:54px;font-size:.6875rem;line-height:1.15;text-align:center;border-radius:10px;position:relative;background:transparent;color:var(--muted)}
 .navigation a[aria-current=page]{background:transparent;color:var(--teal)}
 .navigation a::before{content:"";display:block;width:24px;height:24px;background:currentColor;-webkit-mask:var(--ic) center/contain no-repeat;mask:var(--ic) center/contain no-repeat}
 .navigation a[aria-current=page]::before{background:var(--teal)}
 .navigation a[data-nav=home]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8v10a1 1 0 0 1-1 1h-5v-7H9v7H4a1 1 0 0 1-1-1z'/%3E%3C/svg%3E")}
 .navigation a[data-nav=explore]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14z'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E")}
 .navigation a[data-nav=federal]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M5 21V10l7-5 7 5v11'/%3E%3Cpath d='M9 21v-6h6v6'/%3E%3C/svg%3E")}
 .navigation a[data-nav=letter]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3Cpath d='M9 13h6'/%3E%3Cpath d='M9 17h6'/%3E%3C/svg%3E")}
 .navigation a[data-nav=plan]{--ic:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4h6v3H9z'/%3E%3Cpath d='M7 5H6a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-1'/%3E%3Cpath d='M9 14l2 2 4-4'/%3E%3C/svg%3E")}
 .count{position:absolute;top:.15rem;left:calc(50% + 6px);font-size:.625rem;margin:0}
 .footer{display:none}
 .community-art{display:none}
 .welcome-grid{display:block;padding:.25rem 0 1rem}
 .welcome-description,.hero-grid p:not(.eyebrow){max-width:none}
 .welcome-grid .button-row{flex-direction:column;align-items:stretch}
 .welcome-grid .button-row .primary{width:100%}
 .welcome-footnote{margin-top:.75rem}
 .hero-grid{grid-template-columns:1fr;gap:.75rem}
 .hero-grid>.card,.voice-card{padding:1.15rem}
 .section-head.card,.featured{flex-direction:column;align-items:stretch;gap:.9rem}
 .section-head.card .primary,.featured .primary{width:100%}
 .primary,.button-row>button{width:100%}
 .button-row{gap:.6rem}
 .button-row>.text-link{width:auto}
 /* categories as an iOS-style grouped list */
 .category-grid{display:block;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
 .category-grid a{border:0;border-radius:0;border-bottom:1px solid var(--line);padding:.85rem 1rem;min-height:56px}
 .category-grid a:last-child{border-bottom:0}
 .resource-grid{grid-template-columns:1fr;gap:.75rem}
 .detail-grid{grid-template-columns:1fr}
 .detail-grid .source{position:static}
 .trust-row{justify-content:flex-start;gap:.5rem 1.2rem}
 .everyday-section{margin-top:1.75rem}
 .section-heading{margin-bottom:.75rem}
 /* dialogs are bottom sheets */
 dialog{margin:auto 0 0;width:100%;max-width:none;max-height:92dvh;border-radius:20px 20px 0 0;padding:1.25rem 1rem calc(1rem + env(safe-area-inset-bottom))}
 dialog::before{content:"";display:block;width:40px;height:5px;border-radius:3px;background:#cdd5da;margin:-.5rem auto .9rem}
 dialog[open]{animation:cb-sheet .26s cubic-bezier(.2,.8,.2,1)}
 @keyframes cb-sheet{from{transform:translateY(40%);opacity:.4}to{transform:none;opacity:1}}
 @media(prefers-reduced-motion:reduce){dialog[open]{animation:none}}
 .bubble{margin-left:1rem}.bubble.assistant{margin-right:1rem}
}
@media(max-width:360px){.navigation a{font-size:.625rem}}
@media(hover:none){button:hover,a.card:hover{background:var(--surface)}.primary:hover{background:var(--teal)}}

.bubble .meta{text-transform:none;letter-spacing:0;font-size:.75rem;font-weight:600;color:var(--muted)}
.bubble{border-radius:18px}
.bubble.assistant{background:var(--mint);border-color:transparent}
/* ---- start here, deadline-first plan, text size ---- */
:root[data-text=large]{font-size:112.5%}
:root[data-text=xlarge]{font-size:125%}
@media(max-width:760px){:root[data-text=large]{font-size:18px}:root[data-text=xlarge]{font-size:20px}.navigation a{font-size:max(.6875rem,11px)}}
.start-here{margin:0 0 1.5rem}
.start-here h2{font-size:1.15rem;margin-bottom:.7rem}
.start-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(16rem,100%),1fr));gap:.75rem}
.start-card{display:flex;gap:.9rem;align-items:flex-start;padding:1rem 1.1rem;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line);color:var(--ink);text-decoration:none;min-height:64px}
.start-card strong{display:block;font-size:1.1rem;letter-spacing:-.01em}
.start-sub{display:block;margin-top:.2rem;color:var(--muted);font-size:.95rem;line-height:1.4}
.start-icon{flex:none;width:44px;height:44px;border-radius:12px;background:var(--mint);color:var(--teal);display:grid;place-items:center;font-size:1.4rem;font-weight:700}
.start-letter{background:var(--teal);border-color:var(--teal);color:#fff}
.start-letter .start-sub{color:rgba(255,255,255,.88)}
.start-letter .start-icon{background:rgba(255,255,255,.18);color:#fff}
.start-letter:hover{background:var(--teal-dark);border-color:var(--teal-dark)}
.text-size{display:flex;align-items:center;gap:.5rem;margin:.9rem 0 0}
.text-size-label{font-size:.9rem;color:var(--muted);font-weight:600;margin-right:.25rem}
.text-size button{min-width:48px;min-height:48px;padding:0;line-height:1;border-radius:12px}
.text-size button[aria-pressed=true]{background:var(--teal);border-color:var(--teal);color:#fff}
.plan-deadline{display:flex;flex-direction:column;gap:.15rem;border-radius:14px;padding:.9rem 1.1rem;margin:.6rem 0 .9rem;background:var(--mint);color:var(--teal-dark)}
.plan-deadline strong{font-size:1.5rem;line-height:1.2;letter-spacing:-.02em;color:inherit}
.plan-deadline-label{font-size:.8125rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em}
.plan-deadline.urgent{background:#fbe3dc;color:#7a2514}
.plan-deadline.soon{background:#fbf0d3;color:#6b4a06}
.plan-deadline.none{background:#eef3fc;color:var(--muted)}
.letter-plan .plan-steps li:first-child{background:#f0f5ff;border-radius:12px;padding:0 .75rem}
.clarify,.clarify-card{border-radius:var(--radius)}
/* ---- Talk sheet: the conversation gets the room ---- */
#voice-history{position:relative}
@media(max-width:760px){
 #voice-dialog[open]{display:flex;flex-direction:column;height:92dvh}
 #voice-dialog #voice-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
 #voice-dialog .notice{font-size:.8125rem;line-height:1.4;padding:.6rem .8rem;margin:.2rem 0 .7rem}
 #voice-dialog .language-label{margin-top:.4rem}
 #voice-dialog #voice-history{max-height:none;min-height:46dvh}
 #voice-dialog .bubble{padding:.85rem 1rem;margin-top:.6rem;margin-bottom:.6rem}
}
