/* ============================================================
   ConsuCare design system — monochrome charcoal on warm paper
   ============================================================ */
:root {
    --ink: #141417;
    --ink-2: #1c1d21;
    --ink-3: #2a2c30;
    --ink-shine: linear-gradient(160deg, #202226 0%, #131417 55%, #0a0a0c 100%);
    --paper: #f6f6f4;
    --card: #ffffff;
    --mut: #73777c;
    --mut-2: #9a9ea2;
    --line: #e5e5e1;
    --line-2: #d8d8d3;
    --wash: #eeeeeb;
    --r: 12px;
    --shadow-sm: 0 1px 2px rgba(10,10,12,.05), 0 1px 1px rgba(10,10,12,.04);
    --shadow-md: 0 14px 32px -18px rgba(10,10,12,.28);
    --shadow-lg: 0 28px 64px -22px rgba(10,10,12,.4);
    --shadow-ink: 0 16px 34px -16px rgba(10,10,12,.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; flex-shrink: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
/* Blazor's FocusOnNavigate focuses the page heading for screen readers; don't draw a ring on it */
h1:focus, h1:focus-visible { outline: none; }
::selection { background: var(--ink); color: #fff; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Boot splash */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--mut); font-size: 13px; }
.boot-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--ink); animation: bootpulse 1.2s ease-in-out infinite; }
@keyframes bootpulse { 50% { opacity: .55; transform: scale(.94); } }

#blazor-error-ui { background: #b32d2d; color: #fff; bottom: 0; display: none; left: 0; padding: .7rem 1.2rem; position: fixed; width: 100%; z-index: 1000; font-size: 13px; }
#blazor-error-ui .reload { color: #fff; text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; color: #fff; }

/* ---------- Utility ---------- */
.lab { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--mut); }
.mut { color: var(--mut); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.spread { justify-content: space-between; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 9px; padding: 10px 18px; font-size: 14px; font-weight: 600;
    border: 1.5px solid transparent; transition: opacity .15s ease, background .2s ease, box-shadow .2s ease, transform .15s ease;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-dark { background: var(--ink-shine); color: #fff; box-shadow: var(--shadow-ink), inset 0 1px 0 rgba(255,255,255,.08); }
.btn-dark:hover:not(:disabled) { box-shadow: 0 18px 38px -14px rgba(10,10,12,.6), inset 0 1px 0 rgba(255,255,255,.1); transform: translateY(-1px); }
.btn-dark:active:not(:disabled) { transform: translateY(0); box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.06); }
.btn-out { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-out:hover:not(:disabled) { background: var(--wash); }
.btn-ghost { background: transparent; color: var(--mut); border-color: transparent; font-weight: 500; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 15px; width: 100%; }

/* ---------- Chips / badges ---------- */
.chip { display: inline-flex; align-items: center; border: 1.3px solid var(--ink-3); color: var(--ink); border-radius: 999px; padding: 3px 11px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; }
.chip-soft { border-color: var(--line-2); color: var(--mut); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.badge-dark { background: var(--ink); color: #fff; }
.badge-grey { background: var(--wash); color: var(--mut); border: 1px solid var(--line); }
.badge-ok { background: var(--wash); color: var(--ink); border: 1px solid var(--line-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3aa76d; flex-shrink: 0; }
.dot-busy { background: #c5722f; }

/* ---------- Avatars ---------- */
.av { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; width: 40px; height: 40px; font-size: 14px; letter-spacing: .02em; }
.av-img { object-fit: cover; }
.av-sm { width: 32px; height: 32px; font-size: 12px; }
.av-md { width: 48px; height: 48px; font-size: 16px; }
.av-lg { width: 72px; height: 72px; font-size: 24px; }
.av-xl { width: 112px; height: 112px; font-size: 36px; }
.t1 { background: #141417; } .t2 { background: #43464b; } .t3 { background: #63676d; }
.t4 { background: #7d8186; } .t5 { background: #2a2c30; } .t6 { background: #54585e; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); }
.card-dark { background: var(--ink-shine); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-ink), inset 0 1px 0 rgba(255,255,255,.06); }
.card-dark .mut, .card-dark .lab { color: #a9adb2; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink); }
.inp { width: 100%; border: 1.5px solid var(--line-2); border-radius: 9px; background: #fff; padding: 11px 13px; font: inherit; font-size: 14px; color: var(--ink); }
.inp::placeholder { color: var(--mut-2); }
.inp:focus { outline: none; border-color: var(--ink); }
textarea.inp { resize: vertical; min-height: 110px; line-height: 1.5; }
select.inp {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2373777c' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}
.form-error { background: #faf0f0; border: 1px solid #e3c8c8; color: #8f3232; border-radius: 9px; padding: 10px 13px; font-size: 13px; margin-bottom: 16px; }

/* ---------- Progress ---------- */
.prog { height: 7px; border-radius: 99px; background: var(--wash); border: 1px solid var(--line); overflow: hidden; flex: 1; }
.prog i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .3s ease; }
.pct { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

/* ---------- Stars ---------- */
.stars { display: inline-flex; gap: 2px; align-items: center; }
.stars svg { width: 14px; height: 14px; }
.stars .f { fill: var(--ink); stroke: var(--ink); }
.stars .e { fill: none; stroke: var(--mut-2); }
.stars b { font-size: 12.5px; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* ============================================================
   App shell — charcoal sidebar layout
   ============================================================ */
.app { display: flex; min-height: 100vh; }
.sb { width: 228px; flex-shrink: 0; background: var(--ink-shine); color: #fff; display: flex; flex-direction: column; padding: 22px 14px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; box-shadow: 1px 0 0 rgba(255,255,255,.05), var(--shadow-lg); }
.sb .logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; color: #fff; }
.sb .logo .mark { width: 30px; height: 30px; border-radius: 8px; background: #fff; color: var(--ink); display: grid; place-items: center; box-shadow: 0 4px 12px -4px rgba(0,0,0,.5); }
.sb nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sb nav a { display: flex; align-items: center; gap: 11px; padding: 9.5px 12px; border-radius: 9px; color: #b6bac0; font-size: 13.5px; font-weight: 500; }
.sb nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sb nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sb nav a .cnt { margin-left: auto; background: #fff; color: var(--ink); border-radius: 99px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; }
.sb .me { display: flex; align-items: center; gap: 10px; padding: 12px 10px 2px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 14px; }
.sb .me b { font-size: 13px; display: block; line-height: 1.25; }
.sb .me span { font-size: 11.5px; color: #9a9ea3; }
.sb .signout { margin-left: auto; background: none; border: none; color: #9a9ea3; padding: 6px; border-radius: 7px; }
.sb .signout:hover { color: #fff; background: rgba(255,255,255,.08); }

.content { flex: 1; min-width: 0; padding: 30px 34px 38px; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pagehead h1 { font-size: 24px; }
.pagehead .sub { color: var(--mut); font-size: 13.5px; margin-top: 3px; }

.loading { padding: 60px; text-align: center; color: var(--mut); font-size: 13.5px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.stat { background: var(--ink-shine); color: #fff; border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow-ink), inset 0 1px 0 rgba(255,255,255,.06); }
.stat .lab { color: #a9adb2; }
.stat b { display: block; font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: #8b8f95; }

.sect h3 { font-size: 15px; margin-bottom: 12px; }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }

/* ============================================================
   Landing page
   ============================================================ */
.land { background: #fff; min-height: 100vh; }
.land .nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 48px; border-bottom: 1px solid var(--line); }
.land .nav .links { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 500; }
.land .nav .links a.mut:hover { color: var(--ink); }
.hero { padding: 84px 48px 72px; text-align: center; max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: clamp(34px, 6vw, 52px); line-height: 1.08; font-weight: 700; }
.hero p { color: var(--mut); font-size: 18px; max-width: 34em; margin: 18px auto 30px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0 48px 72px; max-width: 1080px; margin: 0 auto; }
.feat .card-dark { padding: 26px 24px; }
.feat .icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(255,255,255,.12); display: grid; place-items: center; margin-bottom: 16px; }
.feat h3 { font-size: 16.5px; margin-bottom: 7px; }
.feat p { color: #a9adb2; font-size: 13.5px; line-height: 1.55; }
.how { background: var(--paper); padding: 64px 48px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.how .inner { max-width: 1080px; margin: 0 auto; }
.how h2 { font-size: 28px; text-align: center; margin-bottom: 40px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step .num { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 14px; }
.step h4 { font-size: 15.5px; margin-bottom: 6px; }
.step p { color: var(--mut); font-size: 13.5px; line-height: 1.55; max-width: 26em; }
.testi { padding: 64px 48px; max-width: 1080px; margin: 0 auto; }
.testi h2 { font-size: 28px; text-align: center; margin-bottom: 36px; }
.testi .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.quote { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-sm); }
.quote p { font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.quote .who { display: flex; align-items: center; gap: 10px; }
.quote .who b { font-size: 13.5px; display: block; }
.quote .who span { font-size: 12px; color: var(--mut); }
.foot { background: var(--ink-shine); color: #fff; padding: 36px 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot .flinks { display: flex; gap: 22px; font-size: 13px; color: #b6bac0; }
.foot .flinks a:hover { color: #fff; }
.foot .copy { font-size: 12.5px; color: #8b8f95; }
.logo-inline { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; }
.logo-inline .mark { width: 29px; height: 29px; border-radius: 8px; background: var(--ink-shine); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-ink); }
.logo-inline.inv .mark { background: #fff; color: var(--ink); }
@media (max-width: 900px) {
    .feat, .steps, .testi .grid { grid-template-columns: 1fr; }
    .land .nav, .hero, .how, .testi, .foot { padding-left: 22px; padding-right: 22px; }
}

/* ============================================================
   Auth pages
   ============================================================ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; background: radial-gradient(circle at 50% 0%, #fbfbfa 0%, var(--paper) 60%); }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 38px 40px; width: 100%; max-width: 460px; text-align: center; box-shadow: var(--shadow-lg); }
.auth-card .logo-inline { justify-content: center; margin-bottom: 8px; }
.auth-card h1 { font-size: 22px; margin: 14px 0 4px; }
.auth-card .sub { color: var(--mut); font-size: 13.5px; margin-bottom: 26px; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.role { border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; padding: 16px 12px; text-align: center; color: var(--ink); }
.role svg { margin: 0 auto 8px; }
.role b { display: block; font-size: 13.5px; }
.role span { font-size: 11.5px; color: var(--mut); }
.role.on { background: var(--ink-shine); border-color: var(--ink); color: #fff; box-shadow: var(--shadow-ink); }
.role.on span { color: #a9adb2; }
.auth-foot { margin-top: 20px; font-size: 13.5px; color: var(--mut); }
.auth-foot a { font-weight: 700; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.forgot { display: block; text-align: right; font-size: 12.5px; color: var(--mut); margin: -8px 0 18px; }
.forgot:hover { color: var(--ink); }
.demo-hint { margin-top: 18px; padding: 12px 14px; background: var(--wash); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; color: var(--mut); text-align: left; line-height: 1.7; }
.demo-hint code { background: #fff; border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; font-size: 11.5px; }

/* ============================================================
   Patient dashboard
   ============================================================ */
.supporter-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.supporter-card + .supporter-card { margin-top: 12px; }
.supporter-card .info { flex: 1; min-width: 0; }
.supporter-card .info b { display: block; font-size: 14.5px; }
.supporter-card .info span { font-size: 12.5px; color: var(--mut); }
.goal-mini { padding: 16px 18px; }
.goal-mini + .goal-mini { margin-top: 12px; }
.goal-mini .row { margin-top: 12px; gap: 12px; }
.cta-banner { margin-top: 26px; background: var(--ink-shine); color: #fff; border-radius: var(--r); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; box-shadow: var(--shadow-ink), inset 0 1px 0 rgba(255,255,255,.06); }
.cta-banner h3 { font-size: 18px; }
.cta-banner p { color: #a9adb2; font-size: 13.5px; margin-top: 3px; }
.cta-banner .discover-link { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; font-size: 14px; }
.cta-banner .go { width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; flex-shrink: 0; }

/* ============================================================
   Discover
   ============================================================ */
.discover { display: flex; gap: 22px; align-items: flex-start; }
.filters { width: 216px; flex-shrink: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow-sm); }
.filters .fgroup { padding: 14px 0; border-top: 1px solid var(--line); }
.filters .fgroup:first-of-type { border-top: none; padding-top: 2px; }
.filters .lab { display: block; margin-bottom: 10px; }
.fopt { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); padding: 4px 0; cursor: pointer; }
.fopt .cb { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 4px; flex-shrink: 0; position: relative; }
.fopt .cb.on { background: var(--ink); border-color: var(--ink); }
.fopt .cb.on::after { content: ""; position: absolute; inset: 3px 3px 5px 3px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.switch { width: 36px; height: 20px; border-radius: 99px; background: var(--line-2); position: relative; flex-shrink: 0; border: none; transition: background .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(16px); }
.mgrid { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; box-shadow: var(--shadow-sm); transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.mcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); }
.mcard .av-lg { margin-bottom: 4px; }
.mcard b { font-size: 15px; }
.mcard .role-line { font-size: 12.5px; color: var(--mut); }
.mcard .bio { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mcard .btn { margin-top: 8px; width: 100%; }
.searchbar { position: relative; flex: 1; max-width: 420px; }
.searchbar svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--mut-2); }
.searchbar .inp { padding-left: 38px; }

/* ============================================================
   Supporter profile
   ============================================================ */
.phead { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 28px; display: flex; gap: 24px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.phead .pinfo { flex: 1; min-width: 260px; }
.phead h1 { font-size: 26px; margin-bottom: 2px; }
.phead .role-line { color: var(--mut); font-size: 14px; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 20px; }
.tabs button { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--mut); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.bio-block { max-width: 62ch; font-size: 14.5px; line-height: 1.65; color: #3a3d41; white-space: pre-line; }
.soc { display: flex; gap: 10px; margin-top: 18px; }
.soc a { width: 36px; height: 36px; border: 1.5px solid var(--line-2); border-radius: 9px; display: grid; place-items: center; color: var(--ink); }
.soc a:hover { border-color: var(--ink); }
.skills { display: flex; flex-wrap: wrap; gap: 9px; max-width: 560px; }
.review { padding: 18px 20px; }
.review + .review { margin-top: 12px; }
.review .who { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.review .who b { font-size: 13.5px; display: block; }
.review p { font-size: 13.5px; color: #3a3d41; line-height: 1.6; }

/* ============================================================
   Request form
   ============================================================ */
.req-wrap { max-width: 560px; margin: 0 auto; }
.req-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.req-head h1 { font-size: 20px; }
.cancel { display: block; text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--mut); background: none; border: none; width: 100%; }
.cancel:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   Messages
   ============================================================ */
.msg-page { display: flex; flex: 1; min-height: 100vh; min-width: 0; background: #fff; margin: -30px -34px -38px; }
.convs { width: 296px; flex-shrink: 0; background: var(--ink-shine); color: #fff; display: flex; flex-direction: column; box-shadow: 1px 0 0 rgba(255,255,255,.05); }
.convs .chead { padding: 22px 18px 14px; }
.convs h2 { font-size: 17px; margin-bottom: 14px; }
.convs .searchbar { max-width: none; }
.convs .searchbar .inp { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; font-size: 13px; padding: 9px 12px 9px 36px; }
.convs .searchbar .inp::placeholder { color: #8b8f95; }
.convs .searchbar svg { color: #8b8f95; }
.convlist { overflow-y: auto; flex: 1; }
.conv { display: flex; gap: 11px; padding: 13px 18px; align-items: center; color: #d3d6da; width: 100%; background: none; border: none; text-align: left; }
.conv .cbody { flex: 1; min-width: 0; }
.conv .cbody .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.conv b { font-size: 13.5px; color: #fff; }
.conv .time { font-size: 10.5px; color: #8b8f95; flex-shrink: 0; }
.conv .prev { display: block; font-size: 12px; color: #9a9ea3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .pill { background: #fff; color: var(--ink); border-radius: 99px; font-size: 10px; font-weight: 700; padding: 1.5px 7px; flex-shrink: 0; }
.conv:hover:not(.on) { background: rgba(255,255,255,.05); }
.conv.on { background: #fff; color: var(--ink); }
.conv.on b { color: var(--ink); }
.conv.on .prev { color: var(--mut); }
.conv.on .time { color: var(--mut-2); }
.thread { flex: 1; min-width: 0; display: flex; flex-direction: column; max-height: 100vh; position: sticky; top: 0; }
.thread .thead { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.thread .thead b { font-size: 14.5px; display: block; line-height: 1.3; }
.thread .thead .status { font-size: 11.5px; color: var(--mut); display: flex; align-items: center; gap: 5px; }
.tbody { flex: 1; padding: 22px 26px; display: flex; flex-direction: column; gap: 6px; background: var(--paper); overflow-y: auto; }
.tstamp { text-align: center; font-size: 11px; color: var(--mut-2); margin: 12px 0 8px; letter-spacing: .05em; }
.bub { max-width: 62%; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; border-radius: 14px; }
.bub.them { align-self: flex-start; background: var(--wash); border: 1px solid var(--line); color: var(--ink); border-bottom-left-radius: 4px; }
.bub.me { align-self: flex-end; background: var(--ink-shine); color: #fff; border-bottom-right-radius: 4px; box-shadow: var(--shadow-sm); }
.composer { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; }
.composer .inp { flex: 1; border-radius: 99px; padding: 10px 18px; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent; color: var(--mut); display: grid; place-items: center; transition: background .15s, color .15s; }
.iconbtn:hover { background: var(--wash); color: var(--ink); }
.sendbtn { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--ink-shine); color: #fff; display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--shadow-ink); transition: transform .15s ease, box-shadow .15s ease; }
.sendbtn:hover { transform: translateY(-1px) scale(1.03); }

/* ============================================================
   Goal tracker
   ============================================================ */
.goal-card { display: flex; gap: 26px; align-items: center; padding: 22px 26px; }
.goal-card + .goal-card { margin-top: 14px; }
.goal-card .gleft { width: 240px; flex-shrink: 0; }
.goal-card .gleft h3 { font-size: 16px; margin: 8px 0 6px; }
.goal-card .gleft .mut { font-size: 12.5px; }
.gmiles { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.mile { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.mile input { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 5px; margin: 0; cursor: pointer; flex-shrink: 0; position: relative; background: #fff; }
.mile input:checked { background: var(--ink); border-color: var(--ink); }
.mile input:checked::after { content: ""; position: absolute; inset: 4px 3.5px 6px 3.5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.mile input:checked + span { color: var(--mut); text-decoration: line-through; }
.gright { width: 130px; flex-shrink: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ring { position: relative; width: 74px; height: 74px; }
.ring svg { transform: rotate(-90deg); }
.ring .trk { stroke: var(--wash); }
.ring .val { stroke: var(--ink); stroke-linecap: round; transition: stroke-dashoffset .3s ease; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.goal-card.done { background: var(--ink-shine); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-ink), inset 0 1px 0 rgba(255,255,255,.06); }
.goal-card.done .mut { color: #a9adb2; }
.goal-card.done .chip { border-color: #5b6067; color: #fff; }
.goal-card.done .mile input { background: transparent; border-color: #8b8f95; }
.goal-card.done .mile input:checked { background: #fff; border-color: #fff; }
.goal-card.done .mile input:checked::after { border-color: var(--ink); }
.goal-card.done .mile input:checked + span { color: #8b8f95; }
.goal-card.done .ring .trk { stroke: #3a3d41; }
.goal-card.done .ring .val { stroke: #fff; }

/* ============================================================
   Supporter dashboard
   ============================================================ */
.reqcard { display: flex; gap: 16px; padding: 18px 20px; align-items: flex-start; }
.reqcard + .reqcard { margin-top: 12px; }
.reqcard .rbody { flex: 1; min-width: 0; }
.reqcard .rbody .row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.reqcard .rbody b { font-size: 14.5px; }
.reqcard .msgprev { font-size: 13px; color: var(--mut); margin: 6px 0 4px; max-width: 56ch; }
.reqcard .acts { display: flex; gap: 9px; flex-shrink: 0; align-items: center; }
.patient-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.patient-row + .patient-row { margin-top: 10px; }
.patient-row .mb { width: 200px; flex-shrink: 0; }
.patient-row .mb b { display: block; font-size: 14px; }
.patient-row .mb span { font-size: 12px; color: var(--mut); }
.patient-row .mg { flex: 1; min-width: 0; }
.patient-row .mg span { font-size: 12.5px; display: block; margin-bottom: 6px; }
.patient-row .last { width: 140px; font-size: 12px; color: var(--mut); flex-shrink: 0; }

/* ============================================================
   Notifications
   ============================================================ */
.ngroup { margin-bottom: 26px; }
.ngroup .lab { display: block; margin-bottom: 10px; }
.notif { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 15px 18px; box-shadow: var(--shadow-sm); }
.notif + .notif { margin-top: 9px; }
.notif .undot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex-shrink: 0; }
.notif.read .undot { background: transparent; }
.notif .nicon { width: 38px; height: 38px; border-radius: 10px; background: var(--wash); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); flex-shrink: 0; }
.notif .nbody { flex: 1; min-width: 0; }
.notif .nbody b { font-size: 13.5px; display: block; }
.notif .nbody span { font-size: 12.5px; color: var(--mut); }
.notif .ntime { font-size: 11.5px; color: var(--mut-2); flex-shrink: 0; }
.notif.read .nbody b { font-weight: 500; }

/* ============================================================
   Settings
   ============================================================ */
.set-layout { display: flex; gap: 26px; align-items: flex-start; }
.set-menu { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; }
.set-menu button { text-align: left; border: none; background: transparent; padding: 10px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 500; color: var(--mut); }
.set-menu button.on { background: var(--ink-shine); color: #fff; font-weight: 600; box-shadow: var(--shadow-ink); }
.set-body { flex: 1; min-width: 0; }
.avatar-up { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 24px; }
.avatar-up .change { font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; background: none; border: none; padding: 0; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fgrid .wide { grid-column: 1 / -1; }
.tog-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 2px; border-top: 1px solid var(--line); }
.tog-row:first-of-type { border-top: none; }
.tog-row b { font-size: 13.5px; display: block; }
.tog-row span { font-size: 12px; color: var(--mut); }
.save-note { font-size: 12.5px; color: var(--mut); margin-right: 12px; }

/* ============================================================
   Support Network
   ============================================================ */
.mship { display: flex; gap: 18px; align-items: center; padding: 20px 24px; flex-wrap: wrap; }
.mship + .mship { margin-top: 14px; }
.mship .info { width: 230px; flex-shrink: 0; }
.mship .info b { display: block; font-size: 15px; }
.mship .info span { font-size: 12.5px; color: var(--mut); }
.mship .goal { flex: 1; min-width: 220px; }
.mship .goal .g1 { font-size: 13px; margin-bottom: 7px; }
.mship .meta { width: 160px; font-size: 12px; color: var(--mut); flex-shrink: 0; }
.mship .acts { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.empty-tab { padding: 40px; text-align: center; color: var(--mut); font-size: 13.5px; background: #fff; border: 1px dashed var(--line-2); border-radius: var(--r); }

/* ============================================================
   Admin
   ============================================================ */
.admin-top { display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); padding: 14px 28px; position: sticky; top: 0; z-index: 5; box-shadow: var(--shadow-sm); }
.admin-top .lab { letter-spacing: .14em; }
.admin-shell { display: flex; min-height: calc(100vh - 63px); }
.admin-shell .sb { height: auto; position: static; }
.pills { display: flex; gap: 8px; margin-bottom: 20px; }
.pills button { border: 1.3px solid var(--line-2); background: #fff; color: var(--mut); border-radius: 999px; padding: 6px 16px; font-size: 12.5px; font-weight: 600; }
.pills button.on { background: var(--ink-shine); color: #fff; border-color: var(--ink); box-shadow: var(--shadow-ink); }
.vrow { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.vrow + .vrow { margin-top: 10px; }
.vrow .vb { width: 240px; flex-shrink: 0; }
.vrow .vb b { display: block; font-size: 14.5px; }
.vrow .vb span { font-size: 12.5px; color: var(--mut); }
.vrow .inst { flex: 1; min-width: 160px; font-size: 13px; }
.vrow .inst span { display: block; font-size: 12px; color: var(--mut); }
.vrow .applied { width: 130px; font-size: 12.5px; color: var(--mut); flex-shrink: 0; }
.vrow .lnk { width: 34px; height: 34px; border: 1.3px solid var(--line-2); border-radius: 8px; display: grid; place-items: center; color: var(--ink); flex-shrink: 0; }
.vrow .lnk:hover { border-color: var(--ink); }
.vrow .acts { display: flex; gap: 8px; flex-shrink: 0; }

/* Mobile-only controls, hidden on desktop */
.sb-top { display: contents; }
.sb-toggle { display: none; background: none; border: none; color: #fff; padding: 8px; margin: -8px -6px -8px 0; border-radius: 8px; }
.sb-toggle:hover { background: rgba(255,255,255,.08); }
.thread-back { display: none; margin-left: -8px; }
.admin-name { font-size: 13px; font-weight: 600; }

/* ============================================================
   Responsive — tablet (<= 980px)
   ============================================================ */
@media (max-width: 980px) {
    .two-col, .set-layout, .discover { display: block; }
    .two-col > * + * { margin-top: 22px; }
    .filters { width: 100%; margin-bottom: 18px; }
    .set-menu { width: 100%; margin-bottom: 18px; flex-direction: row; overflow-x: auto; }
    .set-menu button { white-space: nowrap; }
    .content { padding: 24px 22px 32px; }
    .msg-page { margin: -24px -22px -32px; }
    .convs { width: 240px; }
    .goal-card { flex-wrap: wrap; }
    .goal-card .gleft { width: 100%; }
    .patient-row { flex-wrap: wrap; }
    .patient-row .mg { flex-basis: 200px; }
}

/* ============================================================
   Responsive — phone (<= 860px): sidebar becomes a top bar
   ============================================================ */
@media (max-width: 860px) {
    body { font-size: 14.5px; }

    /* App shell */
    .app { flex-direction: column; }
    .sb { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; padding: 12px 16px; overflow: visible; box-shadow: var(--shadow-md); }
    .sb-top { display: flex; align-items: center; justify-content: space-between; }
    .sb .logo { padding: 0; }
    .sb-toggle { display: grid; place-items: center; }
    .sb nav, .sb .me { display: none; }
    .sb.open nav { display: flex; padding-top: 14px; }
    .sb.open nav a { padding: 12px; font-size: 14.5px; }
    .sb.open .me { display: flex; }
    .content { padding: 20px 16px 28px; }

    .pagehead { flex-wrap: wrap; margin-bottom: 18px; }
    .pagehead h1 { font-size: 21px; }
    .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
    .stat { padding: 12px; }
    .stat .lab { font-size: 9.5px; letter-spacing: .06em; }
    .stat b { font-size: 26px; margin-top: 4px; }
    .stat span:not(.lab) { display: none; }
    .stat .lab { display: block; line-height: 1.3; min-height: 2.6em; }
    .card { padding: 16px; }

    /* Landing */
    .land .nav { padding: 14px 16px; gap: 12px; }
    .land .nav .links { gap: 14px; font-size: 13.5px; }
    .land .nav .links a.mut:not([href="/signup"]) { display: none; }
    .hero { padding: 52px 20px 44px; }
    .hero p { font-size: 16px; }
    .feat { padding: 0 16px 48px; }
    .how, .testi { padding: 48px 16px; }
    .how h2, .testi h2 { font-size: 23px; margin-bottom: 28px; }
    .foot { padding: 28px 16px; flex-direction: column; align-items: flex-start; }
    .foot .flinks { flex-wrap: wrap; gap: 14px 20px; }

    /* Auth */
    .auth { padding: 24px 14px; place-items: start center; }
    .auth-card { padding: 28px 20px; border-radius: 14px; }

    /* Patient dashboard */
    .supporter-card { flex-wrap: wrap; row-gap: 10px; }
    .supporter-card .info { flex-basis: calc(100% - 62px); }
    .supporter-card .btn { margin-left: auto; }
    .cta-banner { flex-direction: column; align-items: flex-start; padding: 20px; }

    /* Discover */
    .searchbar { max-width: none; }
    .mgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

    /* Supporter profile */
    .phead { padding: 20px; gap: 16px; }
    .phead .pinfo { min-width: 0; flex-basis: 100%; }
    .phead h1 { font-size: 22px; }
    .tabs { overflow-x: auto; }
    .tabs button { white-space: nowrap; padding: 10px 12px; }

    /* Messages: one pane at a time */
    .msg-page { margin: -20px -16px -28px; min-height: calc(100dvh - 58px); }
    .convs { width: 100%; }
    .thread { display: none; position: static; max-height: none; height: calc(100dvh - 58px); }
    .msg-page.thread-open .convs { display: none; }
    .msg-page.thread-open .thread { display: flex; }
    .thread-back { display: grid; }
    .thread .thead { padding: 10px 14px; }
    .tbody { padding: 16px 14px; }
    .bub { max-width: 82%; }
    .composer { padding: 10px 12px; gap: 6px; }

    /* Goals */
    .goal-card { padding: 18px; gap: 18px; }
    .gright { width: 100%; flex-direction: row; justify-content: flex-start; text-align: left; }

    /* Supporter dashboard */
    .reqcard { flex-wrap: wrap; }
    .reqcard .acts { width: 100%; }
    .reqcard .acts .btn { flex: 1; }
    .patient-row .mb { width: auto; flex: 1 1 calc(100% - 64px); }
    .patient-row .last { width: auto; flex: 1 1 100%; }

    /* Notifications */
    .notif { flex-wrap: wrap; padding: 14px; }
    .notif .ntime { flex-basis: 100%; padding-left: 60px; }

    /* Settings */
    .fgrid { grid-template-columns: 1fr; }

    /* Support Network */
    .mship { padding: 18px; }
    .mship .info { width: auto; flex: 1 1 calc(100% - 72px); }
    .mship .meta { width: 100%; }
    .mship .goal { min-width: 0; flex-basis: 100%; }
    .mship .acts { flex-direction: row; width: 100%; }
    .mship .acts > * { flex: 1; }

    /* Admin */
    .admin-top { padding: 12px 16px; }
    .admin-top .lab, .admin-name { display: none; }
    .admin-shell { flex-direction: column; }
    .admin-shell .sb { padding: 8px 12px; position: static; box-shadow: none; }
    .admin-shell .sb nav { display: flex; flex-direction: row; overflow-x: auto; }
    .admin-shell .sb nav a { white-space: nowrap; }
    .pills { overflow-x: auto; }
    .pills button { white-space: nowrap; }
    .vrow .vb { width: auto; flex: 1 1 calc(100% - 72px); }
    .vrow .applied { width: auto; flex: 1 1 100%; }
    .vrow .acts { width: 100%; }
    .vrow .acts .btn { flex: 1; }
}

@media (max-width: 420px) {
    .roles { grid-template-columns: 1fr; }
}
