/* Type: the foundation's own pairing — Barlow Condensed for headlines, Inter for
   everything you read. Self-hosted, because the app is meant to open with no
   signal and a font CDN is the first thing to fail there. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-700.woff2") format("woff2");
}

/* SOSALERT — interface v10, built to the references in /refs.
   Language taken from them: pale grey canvas, big soft white cards (22-26px),
   oversized numerals with small muted labels, one dark hero card, tinted status
   pills, and a floating dark pill bar with an orange active capsule.
   One surface: a phone fills the screen, a laptop spreads the same cards wide. */

:root {
  --bg: #f1f2f4;
  --card: #ffffff;
  --card-2: #f7f8f9;
  --ink: #101215;
  --ink-2: #3c434c;
  --muted: #767e88;
  --dim: #9aa1aa;
  --line: #e8eaed;
  --line-2: #dcdfe3;
  --accent: #f2552c;
  --accent-2: #d9410f;
  --accent-soft: #fdece6;
  --lime: #b7e26a;
  --lime-ink: #3f5a10;
  --lime-soft: #f0f8dd;
  --ok: #1f9d63;
  --ok-soft: #e5f5ee;
  --warn: #a2660a;
  --warn-soft: #fdf1dc;
  --bad: #b8332a;
  --bad-soft: #fdeceb;
  --info: #2b56c9;
  --info-soft: #e9eefc;
  --r-xl: 26px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(16, 18, 21, .04), 0 10px 26px -20px rgba(16, 18, 21, .28);
  --shadow-lg: 0 2px 4px rgba(16, 18, 21, .05), 0 26px 48px -30px rgba(16, 18, 21, .35);
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Barlow Condensed", "Inter", "Segoe UI", system-ui, sans-serif;
  --bar-h: 56px;
  --tabs-h: 78px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0e;
    --card: #15171b;
    --card-2: #1b1e23;
    --ink: #f5f7f9;
    --ink-2: #c8ced6;
    --muted: #99a1ab;
    --dim: #7b838d;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .16);
    --accent: #ff6034;
    --accent-2: #ff7d57;
    --accent-soft: rgba(255, 96, 52, .16);
    --lime: #b7e26a;
    --lime-ink: #d8f3a4;
    --lime-soft: rgba(183, 226, 106, .14);
    --ok: #4fd68b; --ok-soft: rgba(79, 214, 139, .14);
    --warn: #f0b456; --warn-soft: rgba(240, 180, 86, .14);
    --bad: #ff8a7d; --bad-soft: rgba(255, 138, 125, .14);
    --info: #93acff; --info-soft: rgba(147, 172, 255, .14);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 16px 34px -26px rgba(0,0,0,.9);
    color-scheme: dark;
  }
}

[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] {
  --bg: #0b0c0e; --card: #15171b; --card-2: #1b1e23;
  --ink: #f5f7f9; --ink-2: #c8ced6; --muted: #99a1ab; --dim: #7b838d;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
  --accent: #ff6034; --accent-2: #ff7d57; --accent-soft: rgba(255,96,52,.16);
  --ok: #4fd68b; --ok-soft: rgba(79,214,139,.14);
  --warn: #f0b456; --warn-soft: rgba(240,180,86,.14);
  --bad: #ff8a7d; --bad-soft: rgba(255,138,125,.14);
  --info: #93acff; --info-soft: rgba(147,172,255,.14);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 10px; top: 10px; background: var(--card); padding: 10px 14px; border-radius: var(--r-sm); z-index: 99; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--bar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.brand-mark { width: 28px; height: 28px; color: var(--ink); display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-size: 13.5px; letter-spacing: .05em; }
.brand-text i { font-style: normal; font-size: 9.5px; letter-spacing: .18em; color: var(--dim); margin-top: 3px; }

.topnav { display: none; gap: 2px; margin-left: 10px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.topnav a { padding: 7px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 560; color: var(--muted); white-space: nowrap; }
.topnav a:hover { color: var(--ink); }
.topnav a.on { background: var(--ink); color: var(--bg); }

.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); border-radius: 50%; cursor: pointer;
  color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; }

.net { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.net.off { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }

/* ---------- view ---------- */

.view {
  flex: 1 1 auto; width: 100%;
  padding: 18px 16px calc(var(--tabs-h) + 34px);
  display: flex; flex-direction: column; gap: 16px;
}
.view:focus { outline: none; }

.wrap { width: 100%; max-width: 100%; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; }

/* ---------- greeting ---------- */

.hello { display: flex; align-items: center; gap: 14px; padding: 2px 2px 0; }
.hello .who { flex: 1 1 auto; min-width: 0; }
.hello .hi { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 520; }
.hello h1 { font-size: clamp(24px, 6.4vw, 34px); font-weight: 720; letter-spacing: -.035em; }
.hello .sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: var(--ink); color: var(--bg);
}

/* ---------- cards ---------- */

.card {
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px;
}
.card.tight { padding: 14px; }
.card h2 { font-size: 16.5px; font-weight: 660; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-link { font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { color: var(--ink); }

.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: nowrap; }
.page-head > div { flex: 1 1 auto; min-width: 0; }
.page-head .btn { flex: none; }
.page-head h1 { font-size: clamp(23px, 5.4vw, 30px); font-weight: 720; letter-spacing: -.03em; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ---------- hero: the SOS card ---------- */

.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(140% 120% at 85% -10%, #2a2d33 0%, #101215 55%);
  color: #fff; border-radius: var(--r-xl); padding: 18px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center;
  box-shadow: var(--shadow-lg);
}
/* Five choices, two even rows on a phone instead of four and a stray fifth. */
.hero .row.tight {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
.hero .row.tight .pill { justify-content: center; width: 100%; }
.hero .numbers { display: none; }
.hero .sos-hold { justify-self: center; }
.hero p { max-width: none; font-size: 13px; }
.hero h2 { font-size: clamp(18px, 4.8vw, 22px); margin-top: 10px; }
.hero { padding: 16px; gap: 12px; }
.hero .tag { font-size: 11px; padding: 4px 10px; }
.hero .tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); font-size: 11.5px; font-weight: 620; letter-spacing: .02em;
}
.hero .tag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.hero h2 { font-size: clamp(20px, 5.2vw, 26px); font-weight: 700; letter-spacing: -.03em; margin-top: 12px; }
.hero p { color: rgba(255, 255, 255, .62); font-size: 13.5px; margin-top: 7px; max-width: 34ch; }
.hero .numbers { gap: 20px; margin-top: 14px; }
.hero .numbers div b { display: block; font-size: 22px; font-weight: 720; letter-spacing: -.02em; }
.hero .numbers div span { font-size: 11.5px; color: rgba(255, 255, 255, .55); }

.sos-hold { position: relative; display: grid; place-items: center; }
.sos-btn {
  position: relative; width: 112px; aspect-ratio: 1; border: 0; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center; gap: 1px;
  background: linear-gradient(168deg, #ff6a3d, var(--accent-2));
  color: #fff; touch-action: manipulation; user-select: none;
  box-shadow: 0 18px 40px -20px rgba(242, 85, 44, .9), 0 0 0 10px rgba(255, 255, 255, .06);
  transition: transform .12s ease, box-shadow .2s ease;
}
.sos-btn:active { transform: scale(.98); }
.sos-btn b { font-size: clamp(30px, 8.4vw, 40px); font-weight: 800; letter-spacing: .02em; }
.sos-btn span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.sos-ring { position: absolute; inset: -10px; border-radius: 50%; pointer-events: none; }
.sos-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sos-ring circle { fill: none; stroke: var(--lime); stroke-width: 3.5; opacity: .9; }

/* ---------- stat cards ---------- */

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; min-height: 104px;
}
.stat .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip {
  width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--card-2); color: var(--ink-2);
}
.chip svg { width: 16px; height: 16px; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.lime { background: var(--lime-soft); color: var(--lime-ink); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.stat b { font-size: clamp(22px, 5.6vw, 27px); font-weight: 740; letter-spacing: -.03em; line-height: 1; }
.stat small { font-size: 11.5px; color: var(--muted); font-weight: 540; }
.delta { font-size: 11px; font-weight: 650; padding: 3px 7px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.delta.flat { background: var(--card-2); color: var(--muted); }

/* ---------- row links (reference: settings rows with chevrons) ---------- */

.rows { display: flex; flex-direction: column; }
.rowlink {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 4px; border-bottom: 1px solid var(--line);
}
.rowlink:last-child { border-bottom: 0; }
.rowlink .chip { flex: none; }
.rowlink .txt { flex: 1 1 auto; min-width: 0; }
.rowlink .txt b { display: block; font-size: 14.5px; font-weight: 580; }
.rowlink .txt span { font-size: 12.5px; color: var(--muted); }
.rowlink .chev { color: var(--dim); flex: none; }
.rowlink .chev svg { width: 16px; height: 16px; }
.rowlink:hover .chev { color: var(--ink); }

/* ---------- alert rows ---------- */

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px; border-radius: var(--r-md); background: var(--card-2); border: 1px solid transparent;
}
.av {
  width: 40px; height: 40px; border-radius: 13px; flex: none; display: grid; place-items: center;
  background: var(--card-2); font-weight: 650; font-size: 14px; color: var(--ink-2); border: 1px solid var(--line);
}
.item .av { background: var(--card); }
.item .meta { min-width: 0; flex: 1 1 auto; }
.item .meta b { display: block; font-size: 14.5px; font-weight: 600; }
.item .meta span { color: var(--muted); font-size: 12.5px; }
.item .meta .tiny { display: block; font-size: 11.5px; color: var(--dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty {
  padding: 26px 8px; text-align: center; color: var(--muted); font-size: 13.5px;
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
}

/* ---------- pills, buttons, fields ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 640;
  background: var(--card-2); color: var(--ink-2);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.lime { background: var(--lime-soft); color: var(--lime-ink); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--card); font-weight: 620; font-size: 14.5px; cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.solid { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #9d2a22; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; font-size: 13px; padding: 0 14px; border-radius: 11px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 620; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; height: 48px; padding: 0 14px; font: inherit;
  background: var(--card-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 13px;
}
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; background: var(--card);
}
.field .hint { font-size: 12px; color: var(--dim); }

.grid2, .grid3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.seg { display: inline-flex; padding: 4px; background: var(--card-2); border: 1px solid var(--line); border-radius: 13px; }
.seg button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer;
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- live alert banner ---------- */

.live {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.live .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
.live b { font-size: 14.5px; }
.live span { display: block; font-size: 12.5px; color: var(--muted); }

/* ---------- floating pill nav (the reference signature) ---------- */

.tabs {
  position: fixed; z-index: 45;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  height: 62px; padding: 6px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center;
  background: color-mix(in srgb, #101215 94%, transparent);
  border-radius: 999px; box-shadow: 0 18px 34px -18px rgba(0, 0, 0, .55);
  backdrop-filter: blur(12px);
}
/* Every tab carries its label, always. Labelling only the active one made the
   whole row shift sideways each time you changed screen. */
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 50px; border-radius: 999px; color: rgba(255, 255, 255, .52);
  font-size: 9.5px; font-weight: 620; letter-spacing: .02em;
}
.tabs a svg { width: 20px; height: 20px; flex: none; }
.tabs a span { display: block; }
.tabs a.on { background: var(--accent); color: #fff; }

/* ---------- sign-in ---------- */

.signin { width: 100%; max-width: 1000px; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-content: center; padding: 6px 0 16px; }
.signin > * { width: 100%; min-width: 0; }
.signin .card { width: 100%; }
.signin-hero { display: flex; flex-direction: column; gap: 13px; }
.signin-hero .eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.signin-hero h1 { font-size: clamp(27px, 7vw, 44px); font-weight: 730; letter-spacing: -.04em; line-height: 1.05; }
.signin-hero .lede { color: var(--muted); font-size: 14.5px; max-width: 44ch; }
.signin-hero .points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 9px; }
.signin-hero .points li { display: grid; gap: 1px; padding-left: 16px; position: relative; }
.signin-hero .points li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.signin-hero .points b { font-size: 14px; font-weight: 620; }
.signin-hero .points span { color: var(--muted); font-size: 13px; }

/* ---------- sheet + toast ---------- */

.sheet {
  width: min(560px, 100%); max-height: min(88dvh, 720px); margin: auto auto 0;
  padding: 0; border: 0; border-radius: 24px 24px 0 0;
  background: var(--card); color: var(--ink); box-shadow: 0 -22px 60px -30px rgba(0, 0, 0, .6);
  overflow: hidden;
}
.sheet::backdrop { background: rgba(8, 10, 13, .45); backdrop-filter: blur(3px); }
.sheet-form { display: flex; flex-direction: column; max-height: inherit; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 17px; font-weight: 660; }
.sheet-body { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 14px); transform: translate(-50%, 16px);
  z-index: 60; max-width: min(92vw, 420px);
  padding: 11px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 560;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- one app, every screen ---------- */

/* A phone gets the phone app. A laptop gets the same app laid out for the
   window it is in: the header carries the sections, the bottom pill bar goes
   away, and the cards spread into the width instead of sitting in a column. */

@media (min-width: 481px) {
  html { scrollbar-gutter: stable both-edges; }
}

@media (min-width: 900px) {
  body { max-width: none; margin: 0; height: auto; min-height: 100vh; box-shadow: none; }
  .topbar { height: 66px; padding: 0 26px; }
  .topnav { display: flex; }
  .tabs { display: none; }
  .view {
    max-width: 1140px; width: 100%; margin: 0 auto;
    padding: 26px 26px 72px; gap: 18px;
  }
  .toast { bottom: 26px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; padding: 26px 28px; gap: 28px; }
  .hero .numbers { display: flex; }
  .hero h2 { font-size: 27px; }
  .signin { grid-template-columns: 1.04fr .96fr; max-width: 1060px; gap: 64px; padding: 46px 0 60px; align-items: center; min-height: calc(100dvh - 200px); }
  .signin-hero h1 { font-size: 46px; }
  .signin-hero .lede { font-size: 16px; }
  .sheet { max-width: 540px; margin: auto; border-radius: 24px; }
  .dash { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .page-head h1 { font-size: 32px; }
  .hello h1 { font-size: 36px; }
}

@media (max-width: 699px) {
  .signin-hero .points { display: none; }
  .signin-hero h1 { font-size: clamp(25px, 7.2vw, 31px); }
  .signin { gap: 16px; align-content: start; }
}

.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ---------------- maps: Leaflet, with a floor under it ---------------- */
.map-shell { position: relative; background: var(--card-2); }
.map-shell .leaflet-container { background: transparent; font: inherit; }
.map-shell.no-tiles #osm {
  background-image: radial-gradient(circle, var(--line-2) 1px, transparent 1px);
  background-size: 24px 24px;
}
.map-note {
  position: absolute; left: 12px; right: 12px; bottom: 26px; z-index: 500;
  background: var(--ink); color: #fff; font-size: 12.5px; line-height: 1.45;
  padding: 10px 12px; border-radius: 12px; box-shadow: var(--shadow);
}
.map-pin span {
  display: block; width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.35);
}
.map-pin.sos span { background: var(--accent); }
.map-pin.member span { background: #2f6fed; }
.map-pin.me span { background: var(--ink); }

.flat-map {
  position: relative; height: 100%; min-height: 240px;
  background-image: radial-gradient(circle, var(--line-2) 1px, transparent 1px);
  background-size: 24px 24px;
}
.flat-pin {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0,0,0,.3);
}
.flat-pin.sos { background: var(--accent); }
.flat-pin.member { background: #2f6fed; }
.flat-pin.me { background: var(--ink); }
.flat-label {
  position: absolute; transform: translate(-50%, 14px); font-size: 11px;
  color: var(--muted); white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis;
}


/* ---------------- dashboard + troubleshooting ---------------- */
.dash { display: grid; gap: 16px; margin-top: 16px; }
.who-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.who-right .pill { white-space: nowrap; }
.help-item { border-top: 1px solid var(--line); padding: 14px 0; }
.help-item:first-child { border-top: 0; }
.help-item summary { cursor: pointer; font-weight: 640; font-size: 14.5px; list-style: none; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item summary::after { content: "+"; float: right; color: var(--muted); font-weight: 400; }
.help-item[open] summary::after { content: "\2212"; }
.help-item ol { margin: 10px 0 0 18px; display: grid; gap: 7px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* ---------------- installed-app feel ---------------- */

/* launch: the mark comes up, the app fades in behind it */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .36s ease, visibility .36s ease;
  /* never swallow the first tap: the app is already live underneath */
  pointer-events: none;
  /* safety net: fades even if timers are throttled (a tab opened in the background) */
  animation: splashOut .36s ease 1s both;
}
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }
.splash.done { opacity: 0; visibility: hidden; }
.splash-inner { display: grid; justify-items: center; gap: 9px; }
.splash-mark { width: 62px; height: 62px; color: var(--ink); animation: splashIn .55s cubic-bezier(.2, .8, .2, 1) both; }
.splash-mark svg { width: 100%; height: 100%; display: block; }
.splash-inner b { font-size: 14px; letter-spacing: .16em; }
.splash-inner i { font-style: normal; font-size: 10px; letter-spacing: .2em; color: var(--dim); }
.splash-bar { width: 86px; height: 3px; margin-top: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.splash-bar span { display: block; width: 45%; height: 100%; border-radius: 999px; background: var(--accent); animation: splashBar 1.05s ease-in-out infinite; }

@keyframes splashIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes splashBar { 0% { transform: translateX(-110%); } 100% { transform: translateX(240%); } }

/* a screen change rises in; a re-render inside a screen does not */
@keyframes screenIn { from { opacity: 0; transform: translate3d(0, 7px, 0); } to { opacity: 1; transform: none; } }
.view.enter { animation: screenIn .2s cubic-bezier(.2, .8, .2, 1) both; }

/* the control gives under the finger */
button, .btn, .icon-btn, .tabs a, .item, .rowlink, .stat { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn, .icon-btn, .tabs a { transition: transform .12s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:active, .icon-btn:active { transform: scale(.965); }
.tabs a:active { transform: scale(.94); }
.item:active, .rowlink:active, .stat:active { opacity: .7; }

/* notched phones: the bar clears the status area, nothing hides under the
   home indicator or beside the notch in landscape */
.topbar {
  height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
}
.view {
  padding-bottom: calc(var(--tabs-h) + 34px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
}
.toast { bottom: calc(var(--tabs-h) + 14px + env(safe-area-inset-bottom, 0px)); }
.sheet { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Motion is decoration: the app still launches and still changes screens. */
@media (prefers-reduced-motion: reduce) {
  .splash { transition: none; animation: none; }
  .splash-mark, .splash-bar span, .view.enter { animation: none !important; }
  .btn, .icon-btn, .tabs a { transition: none; }
  .btn:active, .icon-btn:active, .tabs a:active { transform: none; }
}

/* ================= the front door =================
   Shown on a wide window before sign-in: the product explained, then the app
   itself one click away. A phone never sees this page; it opens straight into
   the app, which is the whole point of the thing. */

body.landing { background: var(--bg); }
body.landing .topbar, body.landing .tabs { display: none; }
body.landing .view { max-width: none; padding: 0; }

.lp { --lp-max: none; --lp-x: clamp(20px, 4.4vw, 76px); }

/* Sections run edge to edge; only the text inside them keeps a measure. The
   page is never a card floating on a grey field. */
.lp-hero, .lp-section, .lp-facts-in, .lp-dark-in, .lp-band-in, .lp-foot-in, .lp-legal, .lp-nav-in {
  max-width: none;
  margin: 0;
}

.lp-nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.3) blur(16px);
  border-bottom: 1px solid var(--line);
}
.lp-nav-in { height: 76px; padding: 0 var(--lp-x); display: flex; align-items: center; gap: 24px; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.lp-brand svg { width: 30px; height: 30px; color: var(--ink); }
.lp-brand b { font-size: 15px; letter-spacing: .04em; }
.lp-brand span { font-size: 10px; letter-spacing: .2em; color: var(--dim); }
.lp-links { display: flex; gap: 2px; margin-left: 22px; }
.lp-link { background: none; border: 0; cursor: pointer; padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 560; color: var(--muted); }
.lp-link:hover { color: var(--ink); background: var(--card); }
.lp-nav-cta { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lp-nav-cta .btn { padding: 11px 18px; }

.lp-hero { padding: clamp(56px, 6vw, 104px) var(--lp-x) clamp(48px, 5vw, 84px); display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); gap: clamp(36px, 5vw, 88px); align-items: center; }
.lp-eyebrow { font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
.lp-hero h1 { margin: 18px 0 20px; font-size: clamp(42px, 4.7vw, 68px); line-height: .98; letter-spacing: -.045em; font-weight: 770; }
.lp-lede { font-size: 17px; line-height: 1.6; color: var(--muted); max-width: 47ch; }
.lp-actions { display: flex; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.lp-actions .btn { padding: 15px 24px; font-size: 15px; }
.lp-note { display: flex; gap: 20px; margin-top: 26px; color: var(--dim); font-size: 12.5px; }
.lp-note span { display: inline-flex; align-items: center; gap: 7px; }
.lp-note i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); font-style: normal; }

/* the product, drawn with the same parts the app uses */
.lp-phone { width: 336px; margin-inline: auto; padding: 12px; background: var(--card); border: 1px solid var(--line-2); border-radius: 34px; box-shadow: var(--shadow-lg); }
/* On a wide screen the mock grows and sits at the edge of its column, so the
   hero fills the window instead of hugging the middle. */
@media (min-width: 1280px) {
  .lp-phone { width: clamp(360px, 25vw, 500px); margin-left: auto; margin-right: 0; }
  .lp-head { max-width: 860px; }
}
.lp-screen { background: var(--card-2); border-radius: 24px; padding: 13px; display: grid; gap: 11px; }
.lp-screen-bar { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; font-size: 10.5px; font-weight: 660; color: var(--dim); letter-spacing: .1em; }
.lp-screen-hero { background: radial-gradient(140% 130% at 82% -15%, #2a2d33 0%, #101215 58%); color: #fff; border-radius: 18px; padding: 18px 16px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.lp-screen-hero .tag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: 10.5px; font-weight: 620; }
.lp-screen-hero .tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.lp-sos { width: 96px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; gap: 0; background: linear-gradient(168deg, #ff6a3d, var(--accent-2)); color: #fff; font-weight: 800; font-size: 27px; letter-spacing: .02em; box-shadow: 0 18px 34px -18px rgba(242,85,44,.9), 0 0 0 9px rgba(255,255,255,.06); }
.lp-sos small { font-size: 8.5px; letter-spacing: .16em; font-weight: 650; opacity: .85; }
.lp-screen-hero p { font-size: 11.5px; line-height: 1.5; color: rgba(255,255,255,.6); max-width: 24ch; }
.lp-screen-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.lp-screen-row .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 720; }
.lp-screen-row b { font-size: 12px; font-weight: 620; }
.lp-screen-row span { display: block; font-size: 10.5px; color: var(--muted); }
.lp-screen-row .go { margin-left: auto; font-size: 10.5px; font-weight: 650; color: var(--ok); background: var(--ok-soft); padding: 3px 8px; border-radius: 999px; }

.lp-facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.lp-facts-in { padding: 0 var(--lp-x); display: grid; grid-template-columns: repeat(3, 1fr); }
.lp-fact { padding: 28px 32px 28px 0; display: grid; gap: 4px; }
.lp-fact + .lp-fact { border-left: 1px solid var(--line); padding-left: 32px; }
.lp-fact b { font-size: 15px; font-weight: 660; }
.lp-fact span { font-size: 13.5px; color: var(--muted); max-width: 34ch; }

.lp-section { padding: clamp(60px, 7vw, 108px) var(--lp-x); }
.lp-head { max-width: 720px; margin-bottom: 40px; }
.lp-head h2 { font-size: clamp(30px, 3.1vw, 44px); letter-spacing: -.038em; line-height: 1.05; }
.lp-head p { margin-top: 14px; font-size: 16px; line-height: 1.6; color: var(--muted); }

.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; }
.lp-step { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 30px 26px; box-shadow: var(--shadow); display: grid; gap: 12px; align-content: start; }
.lp-step .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 740; font-size: 14px; }
.lp-step h3 { font-size: 18px; font-weight: 680; letter-spacing: -.02em; }
.lp-step p { font-size: 14px; line-height: 1.6; color: var(--muted); }

.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 26px; display: grid; gap: 10px; align-content: start; }
.lp-card .chip { width: 38px; height: 38px; border-radius: 12px; }
.lp-card h3 { font-size: 16px; font-weight: 660; letter-spacing: -.015em; }
.lp-card p { font-size: 13.8px; line-height: 1.6; color: var(--muted); }

.lp-dark { background: #101215; color: #fff; }
.lp-dark-in { padding: clamp(60px, 6.5vw, 100px) var(--lp-x); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 5vw, 88px); align-items: start; }
.lp-dark h2 { font-size: clamp(28px, 3vw, 40px); letter-spacing: -.04em; line-height: 1.05; }
.lp-dark .lp-lede { color: rgba(255,255,255,.55); font-size: 15.5px; margin-top: 16px; }
.lp-dark-cols { display: grid; gap: 26px; }
.lp-dark-cols div { border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; display: grid; gap: 7px; }
.lp-dark-cols h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 680; }
.lp-dark-cols p { font-size: 14px; line-height: 1.6; color: rgba(255,255,255,.8); }

.lp-band { border-top: 1px solid var(--line); background: var(--card); }
.lp-band-in { padding: clamp(44px, 5vw, 76px) var(--lp-x); display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.lp-band h2 { font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.04em; }
.lp-band p { margin-top: 8px; color: var(--muted); font-size: 15px; }
.lp-band .lp-actions { margin-top: 0; flex: none; }

.lp-foot { border-top: 1px solid var(--line); }
.lp-foot-in { padding: clamp(40px, 4.5vw, 64px) var(--lp-x) 40px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(24px, 3vw, 56px); }
.lp-foot-brand p { margin-top: 14px; font-size: 13.5px; color: var(--muted); max-width: 32ch; line-height: 1.6; }
.lp-foot h4 { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 700; margin-bottom: 14px; }
.lp-foot a { display: block; padding: 5px 0; font-size: 14px; color: var(--ink-2); }
.lp-foot .lp-brand { display: inline-flex; }
.lp-foot button.lp-link { display: block; }
.lp-foot a:hover { color: var(--accent); }
.lp-legal { padding: 18px var(--lp-x) 40px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--dim); border-top: 1px solid var(--line); }

@media (max-width: 1080px) {
  .lp-hero { grid-template-columns: 1fr; gap: 44px; padding-top: 48px; }
  .lp-phone { margin-inline: start; }
  .lp-dark-in { grid-template-columns: 1fr; gap: 36px; }
  .lp-grid, .lp-steps { grid-template-columns: repeat(2, 1fr); }
  .lp-links { display: none; }
  .lp-band-in { flex-direction: column; align-items: flex-start; }
}

/* Later rules above reset .stats to two columns; the wide app wants four. */
@media (min-width: 900px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { min-height: 96px; }
}

/* ---------- the left rail: the app's own furniture on a desktop ---------- */

.rail { display: none; }

@media (min-width: 1100px) {
  body.rail-on { padding-left: 268px; }
  body.rail-on .rail {
    display: flex; flex-direction: column;
    position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 50;
    padding: 18px 14px 16px;
    background: var(--card); border-right: 1px solid var(--line);
  }
  body.rail-on .topbar { display: none; }
  body.rail-on .view { padding-top: 34px; }
  body.rail-on .view { max-width: none; padding: 34px clamp(28px, 3vw, 56px) 80px; }
  body.rail-on .dash { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.rail-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.rail-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--bg); flex: none; }
.rail-mark svg { width: 19px; height: 19px; }
.rail-brand b { display: block; font-size: 13.5px; letter-spacing: .04em; }
.rail-brand i { font-style: normal; font-size: 9px; letter-spacing: .15em; color: var(--dim); }

.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 560; color: var(--ink-2); }
.rail-nav a svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.rail-nav a:hover { background: var(--card-2); color: var(--ink); }
.rail-nav a.on { background: var(--ink); color: var(--bg); }
.rail-nav a.on svg { color: var(--bg); }

.rail-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.rail-who { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.rail-who .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 720; font-size: 12px; flex: none; }
.rail-who .txt { display: grid; min-width: 0; }
.rail-who b { font-size: 13px; font-weight: 640; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-who small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail-actions .btn { height: 36px; padding: 0 10px; font-size: 12.5px; }

/* ---------- headlines: the condensed face, at the sizes it wants ----------
   Condensed capitals carry more per line, so they take a little positive
   tracking and a lower leading than the grotesque did. Sizes are raised to keep
   the same optical weight; the labels and body copy stay in Inter. */

.lp-hero h1, .lp-head h2, .lp-dark h2, .lp-band h2,
.signin-hero h1, .hello h1, .page-head h1, .hero h2,
#sheet-title, .lp-brand b, .rail-brand b {
  font-family: var(--display);
  letter-spacing: .012em;
}
.lp-hero h1 { font-size: clamp(46px, 5.3vw, 78px); line-height: .93; font-weight: 700; }
.lp-head h2 { font-size: clamp(34px, 3.4vw, 50px); line-height: 1; font-weight: 700; }
.lp-dark h2 { font-size: clamp(32px, 3.3vw, 46px); line-height: 1; font-weight: 700; }
.lp-band h2 { font-size: clamp(30px, 2.9vw, 42px); line-height: 1; font-weight: 700; }
.signin-hero h1 { font-size: clamp(30px, 7.6vw, 48px); line-height: 1; font-weight: 700; }
.hello h1 { font-size: clamp(30px, 6.6vw, 40px); font-weight: 700; }
.page-head h1 { font-size: clamp(29px, 5.6vw, 36px); font-weight: 700; }
.hero h2 { font-size: clamp(24px, 5.4vw, 30px); font-weight: 700; line-height: 1.02; }
#sheet-title { font-size: 25px; font-weight: 700; }
.lp-brand b, .rail-brand b { font-weight: 700; letter-spacing: .05em; font-size: 16px; }

/* Figures line up in columns instead of dancing. */
.stat b, .numbers b, .lp-fact b { font-variant-numeric: tabular-nums; }

/* ---------- signed-in screens on a desktop ----------
   Under 1000px every one of these stays the single column it is on a phone. Above
   it each screen gets the columns its content actually has: an identity rail on
   the profile, numbers beside the list on contacts, a two-up grid of groups. */

.list-head { display: none; }

@media (min-width: 1000px) {
  /* Profile: who you are on the left, settings and data beside it. */
  .w-profile {
    display: grid;
    grid-template-columns: minmax(300px, .88fr) minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 22px; align-items: start;
  }
  .w-profile > .page-head { grid-column: 1 / -1; }
  .w-profile > section:nth-of-type(1) { grid-column: 1; grid-row: 2 / span 2; position: sticky; top: 24px; }
  .w-profile > section:nth-of-type(2) { grid-column: 2; grid-row: 2; }
  .w-profile > section:nth-of-type(3) { grid-column: 2; grid-row: 3; }
  .w-profile > section:nth-of-type(4) { grid-column: 3; grid-row: 2 / span 2; }
  .w-profile > .btn { grid-column: 3; grid-row: 4; }

  /* Contacts: the circle on the left, its numbers in a rail on the right. */
  .w-contacts {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, .8fr);
    gap: 22px; align-items: start;
  }
  .w-contacts > .page-head { grid-column: 1 / -1; }
  .w-contacts > .stats { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; }
  .w-contacts > .contacts-card { grid-column: 1; grid-row: 2; }
  .w-contacts .stat { min-height: 0; }
  .w-contacts .item { padding: 15px 8px; }

  /* Groups: the list two across, invitations and counts in the rail. */
  .w-groups {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, .8fr);
    gap: 22px; align-items: start;
  }
  .w-groups > .page-head { grid-column: 1 / -1; }
  .w-groups > .groups-card { grid-column: 1; grid-row: 2 / span 2; }
  .w-groups > .stats { grid-column: 2; grid-template-columns: 1fr; }
  .w-groups > .invites-card { grid-column: 2; margin-top: 0 !important; }
  .w-groups .stat { min-height: 0; }
  .w-groups .groups-card .list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px !important; }
  .w-groups .groups-card .item { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }

  /* Alerts: a log with columns, not rows stretched across the window. */
  .w-alerts .list-head {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) 110px 44px;
    column-gap: 18px; align-items: center;
    padding: 0 14px 8px; font-size: 11.5px; letter-spacing: .12em;
    text-transform: uppercase; color: var(--dim); font-weight: 700;
  }
  .w-alerts .list .item {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) 110px 44px;
    column-gap: 18px; align-items: center; padding: 13px 14px;
    border-bottom: 1px solid var(--line);
  }
  .w-alerts .list .item .pill { justify-self: start; text-transform: capitalize; }
  .w-alerts .list .item .icon-btn { justify-self: end; }
  .w-alerts .list .item .meta b { font-size: 14.5px; }

  /* Broadcast: write on the left, who it reaches and what you sent on the right. */
  .w-broadcast {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .85fr);
    gap: 22px; align-items: start;
  }
  .w-broadcast > .page-head { grid-column: 1 / -1; }
  .w-broadcast > .broadcast-compose { grid-column: 1; grid-row: 2 / span 2; }
  .w-broadcast > .stats { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; }
  .w-broadcast > .broadcast-sent { grid-column: 2; grid-row: 3; }
  .w-broadcast .stat { min-height: 0; }
  .w-broadcast textarea { min-height: 210px; }

  /* Group tiles: avatar and name on one row, the three actions on the next. The
     inline flex-wrap on the card used to push the whole name block under the
     avatar as soon as its content was wider than the tile. */
  .w-groups .groups-card .item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center; column-gap: 12px; row-gap: 12px;
  }
  .w-groups .groups-card .item > .av { grid-column: 1; }
  .w-groups .groups-card .item > .meta { grid-column: 2; }
  .w-groups .groups-card .item > .row.tight { grid-column: 1 / -1; margin-top: 0 !important; }
  .w-groups .groups-card .item .row.tight:last-child {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  }
  .w-groups .groups-card .item .row.tight:last-child .btn {
    width: 100%; padding: 0 8px; font-size: 12.5px; white-space: nowrap;
  }
  .w-groups .groups-card .pill { white-space: nowrap; }
  .w-groups .groups-card .item > .meta .row.tight { justify-content: flex-start; }

  /* Profile rows: one line each, with the detail cut short rather than wrapped
     into three lines inside a narrow column. */
  .w-profile .rowlink .txt { min-width: 0; }
  .w-profile .rowlink .txt b,
  .w-profile .rowlink .txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
