/* SpamSpike console. One accent, system type, hairlines, continuous corners. */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #fafafb;
  --surface-press: #f2f2f4;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --sep: rgba(60, 60, 67, 0.18);
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --seg-on: #ffffff;
  --accent: #0071e3;
  --accent-tint: rgba(0, 113, 227, 0.08);
  --bar-bg: rgba(245, 245, 247, 0.74);
  --pop-bg: rgba(252, 252, 253, 0.86);
  --sheet-bg: rgba(255, 255, 255, 0.94);
  --shadow-pop: 0 0 0 0.5px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-panel: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.05);
  --mark: rgba(255, 204, 0, 0.4);
  --avatar: linear-gradient(180deg, #a5abb8 0%, #858a96 100%);

  /* Messages (light) */
  --t-bg: #ffffff;
  --t-text: #000000;
  --t-in: #e9e9eb;
  --t-in-press: #d9d9dc;
  --t-blue: #0a7cff;
  --t-green: #34c759;
  --t-stamp: #8a8a8e;
  --t-sep: rgba(60, 60, 67, 0.16);
  --t-glass: rgba(118, 118, 128, 0.14);
  --t-track: rgba(60, 60, 67, 0.2);
  --warn: #d70015;
  /* device health: Apple system colors, used only as small dots and the card glyph */
  --h-ok: #34c759;
  --h-caution: #ff9500;
  --h-stop: #e5483f;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  /* Springs as linear() curves (Apple's damping/response): 1.0/0.36 s for turns and popovers, 0.86/0.32 s for sheets. */
  --spring: cubic-bezier(0.23, 1, 0.32, 1);
  --spring-sheet: cubic-bezier(0.32, 0.72, 0, 1);
  --r-card: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0f10;
    --surface: #1c1c1e;
    --surface-hover: #212123;
    --surface-press: #262628;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #7c7c82;
    --sep: rgba(255, 255, 255, 0.1);
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.18);
    --seg-on: #636366;
    --accent: #0a84ff;
    --accent-tint: rgba(10, 132, 255, 0.16);
    --bar-bg: rgba(15, 15, 16, 0.72);
    --pop-bg: rgba(40, 40, 42, 0.84);
  --sheet-bg: rgba(44, 44, 46, 0.94);
    --shadow-pop: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-panel: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 24px 64px rgba(0, 0, 0, 0.6);
    --mark: rgba(255, 214, 10, 0.32);
    --avatar: linear-gradient(180deg, #8e939f 0%, #6b6f7a 100%);
    --t-bg: #000000;
    --t-text: #ffffff;
    --t-in: #262628;
    --t-in-press: #3a3a3c;
    --t-blue: #0a84ff;
    --t-green: #30d158;
    --t-stamp: #8d8d93;
    --t-sep: rgba(255, 255, 255, 0.12);
    --t-glass: rgba(118, 118, 128, 0.3);
    --t-track: rgba(235, 235, 245, 0.22);
    --warn: #ff453a;
  --h-ok: #30d158;
  --h-caution: #ff9f0a;
  --h-stop: #ff6961;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f10;
  --surface: #1c1c1e;
  --surface-hover: #212123;
  --surface-press: #262628;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #7c7c82;
  --sep: rgba(255, 255, 255, 0.1);
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.18);
  --seg-on: #636366;
  --accent: #0a84ff;
  --accent-tint: rgba(10, 132, 255, 0.16);
  --bar-bg: rgba(15, 15, 16, 0.72);
  --pop-bg: rgba(40, 40, 42, 0.84);
  --sheet-bg: rgba(44, 44, 46, 0.94);
  --shadow-pop: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-panel: 0 0 0 0.5px rgba(255, 255, 255, 0.1), 0 24px 64px rgba(0, 0, 0, 0.6);
  --mark: rgba(255, 214, 10, 0.32);
  --avatar: linear-gradient(180deg, #8e939f 0%, #6b6f7a 100%);
  --t-bg: #000000;
  --t-text: #ffffff;
  --t-in: #262628;
  --t-in-press: #3a3a3c;
  --t-blue: #0a84ff;
  --t-green: #30d158;
  --t-stamp: #8d8d93;
  --t-sep: rgba(255, 255, 255, 0.12);
  --t-glass: rgba(118, 118, 128, 0.3);
  --t-track: rgba(235, 235, 245, 0.22);
  --warn: #ff453a;
  --h-ok: #30d158;
  --h-caution: #ff9f0a;
  --h-stop: #ff6961;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: default; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0; }
.dim { color: var(--text-3); }
mark { background: var(--mark); color: inherit; border-radius: 3px; }
time, .stats, .summary, .c-count, .c-range, .m-time, .when { font-variant-numeric: tabular-nums; }

/* ---------- toolbar ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color 200ms ease;
}
html.scrolled .bar { border-bottom-color: var(--sep); }
.bar-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; flex: none; }
.brand-mark { width: 18px; height: 18px; color: var(--accent); }
.search {
  flex: 1 1 auto;
  max-width: 400px;
  margin: 0 auto;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text-3);
  transition: box-shadow 150ms ease, background-color 150ms ease;
}
.search:focus-within { background: var(--surface); box-shadow: 0 0 0 3px var(--accent-tint), 0 0 0 0.5px var(--sep); }
.search svg { width: 15px; height: 15px; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { opacity: 0.6; }
.controls { display: flex; align-items: center; gap: 8px; flex: none; }

.seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--fill);
}
.seg button {
  height: 28px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: background-color 150ms ease, box-shadow 150ms ease;
}
.seg button[aria-checked="true"] { background: var(--seg-on); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }
.seg button:active { background: var(--fill); }

.tool-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  font-size: 13px;
  font-weight: 500;
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.tool-btn svg { width: 15px; height: 15px; }
.tool-btn:active { transform: scale(0.97); }
.tool-btn.on { background: var(--accent-tint); color: var(--accent); }
.tool-btn .count:empty { display: none; }
#filter-btn { min-width: 84px; justify-content: center; } /* no layout shift when the count appears */

/* ---------- page head ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 16px 24px 96px; }
.head h1 { margin: 8px 0 4px; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.022em; }
.head-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 28px; margin-bottom: 16px; }
.summary { margin: 0; font-size: 13px; color: var(--text-2); }
.summary .updated { color: var(--text-3); white-space: nowrap; }
.summary .nw { white-space: nowrap; }
.summary .updated::before { content: "\00b7"; margin: 0 6px; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.tokens:empty { display: none; }
.token {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.token svg { width: 14px; height: 14px; opacity: 0.8; }
.skel-line { display: inline-block; width: 220px; height: 10px; border-radius: 5px; background: var(--fill); vertical-align: middle; }

/* ---------- table rows ---------- */
.rows { position: relative; }
.row { position: relative; background: var(--surface); }
.gap { height: 12px; }

/* hairline between rows inside a group */
.conv::before, .msg::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--hair-left, 16px);
  height: 1px;
  background: var(--sep);
  transform: scaleY(0.5);
  transform-origin: top;
}

/* hover and selection: an inset rounded highlight, like a macOS source list */
.conv::after, .msg::after {
  content: "";
  position: absolute;
  inset: 3px 8px 3px var(--hl-left, 8px);
  border-radius: 10px;
  pointer-events: none;
  transition: background-color 120ms ease;
}
.conv > *, .msg > * { position: relative; z-index: 1; }

/* group header (client or sender) */
.gh { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: var(--r-card); padding-right: 12px; }
.gh.open { border-radius: var(--r-card) var(--r-card) 0 0; }
.row.last { border-radius: 0 0 var(--r-card) var(--r-card); }
.gh-main {
  position: relative;
  display: grid;
  grid-template-columns: 12px 32px minmax(0, 1fr) 220px 192px 88px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 8px 12px 20px;
  border: 0;
  background: none;
  text-align: left;
  border-radius: var(--r-card);
}
.gh-main:focus-visible { outline-offset: -2px; }
.i-disc { width: 12px; height: 12px; color: var(--text-3); transition: transform 200ms var(--ease-out); justify-self: center; }
.gh.open .i-disc { transform: rotate(90deg); }
/* client cards: who, one line of counts, when, and the one control: a trailing chevron that turns down when open.
   No disclosure column, so the unread dot has the gutter to itself. */
.gh.gh-c { grid-template-columns: minmax(0, 1fr); padding-right: 0; }
.gh-c .gh-main { grid-template-columns: 32px minmax(0, 1fr) 248px 88px 16px; column-gap: 14px; padding: 14px 18px 14px 28px; }
.gh-c .gh-main .udot { left: 10px; }
.i-exp { width: 14px; height: 14px; color: var(--text-3); justify-self: end; }
.gh.open .i-exp { transform: rotate(90deg); }
.gh-c .stats { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { display: flex; flex-direction: column; min-width: 0; }
.name, .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Messages-style unread dot, in the gutter left of the disclosure chevron / avatar */
.udot {
  position: absolute;
  top: 50%;
  left: 6px;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: var(--t-blue);
  pointer-events: none;
}
.conv > .udot { position: absolute; left: 72px; width: 10px; height: 10px; margin-top: -5px; }
.summary .new-n { color: var(--t-blue); font-weight: 500; }
.name { font-size: 15px; font-weight: 600; }
.sub { font-size: 13px; color: var(--text-2); }
.stats { font-size: 13px; color: var(--text-2); min-width: 0; display: flex; flex-direction: column; }
.stats > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats .st-sub { color: var(--text-3); }
.when { font-size: 13px; color: var(--text-2); text-align: right; white-space: nowrap; }
.srcs { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
.badge {
  font-size: 12px;
  line-height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--fill-2);
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.icon-btn, .icon-btn-space { width: 32px; height: 32px; flex: none; }
.icon-btn {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:active { transform: scale(0.94); background: var(--fill); }
.icon-btn[aria-expanded="true"] { background: var(--fill); color: var(--text); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--avatar);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  overflow: hidden;
  flex: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.person svg { width: 100%; height: 100%; color: rgba(255, 255, 255, 0.96); }

/* the open client's toolbar: quiet glyphs in the name column, 44 px targets, a fill only on hover and while open */
.tools { --tools-left: 74px; padding: 0 16px 6px calc(var(--tools-left) - 12px); margin-top: -6px; }
.tools.last { padding-bottom: 14px; }
.tbar { display: flex; align-items: center; gap: 2px; }
.tb {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  transition: color 150ms ease, transform 160ms var(--ease-out);
}
.tb::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 9px;
  background: var(--fill);
  opacity: 0;
  transition: opacity 150ms ease;
}
.tb svg { position: relative; width: 20px; height: 20px; }
.tb:active { transform: scale(0.92); }
.tb:active::before, .tb[aria-expanded="true"]::before { opacity: 1; }
.tb[aria-expanded="true"] { color: var(--text); }
.tb:focus-visible { outline-offset: -4px; border-radius: 12px; }
.t-note { margin: 2px 0 0 12px; font-size: 13px; color: var(--text-3); }

/* conversation rows */
.conv {
  --hair-left: 88px;
  --hl-left: 76px;
  display: grid;
  grid-template-columns: 28px minmax(140px, 208px) minmax(0, 1fr) 128px 140px 192px 12px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 20px 8px 88px;
}
.c-who { display: flex; flex-direction: column; min-width: 0; }
.c-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-type { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-prev { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-count, .c-range { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-range { color: var(--text-3); }
.i-chev { width: 12px; height: 12px; color: var(--text-3); opacity: 0.7; }
.c-mob, .c-last { display: none; }
.call-note { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
/* counts as symbols: glyph + number, glyphs sit on the text baseline like SF Symbols in a label */
.counts { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.counts .cnt { white-space: nowrap; }
.counts .cnt + .cnt { margin-left: 10px; }
.counts .cnt svg { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -1.5px; color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i-call { width: 13px; height: 13px; color: var(--text-3); flex: none; }

/* flat message rows (Group by: None) */
.colhead, .msg {
  display: grid;
  grid-template-columns: 148px 148px 176px minmax(0, 1fr) 172px;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}
.colhead { height: 36px; border-radius: var(--r-card) var(--r-card) 0 0; font-size: 12px; font-weight: 500; color: var(--text-3); }
.msg { --hair-left: 20px; min-height: 44px; padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
.m-time { color: var(--text-2); white-space: nowrap; }
.m-time .tz { color: var(--text-3); font-size: 12px; }
.m-client { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sender { display: flex; flex-direction: column; min-width: 0; }
.m-num { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-sender .c-type { font-size: 12px; }
.m-text { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* interaction */
@media (hover: hover) and (pointer: fine) {
  .gh:not(.open):hover { background: var(--surface-hover); }
  .conv:hover::after, .msg:hover::after { background: var(--fill-2); }
  .icon-btn:hover { background: var(--fill); color: var(--text); }
  .tb:hover { color: var(--text); }
  .tb:hover::before { opacity: 0.7; }
  .tool-btn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--fill-2)); }
}
.conv:active::after, .msg:active::after { background: var(--fill); }
.row.sel::after, .row.sel:hover::after { background: var(--accent-tint); }
.conv:focus-visible, .msg:focus-visible { outline-offset: -2px; }

/* medium widths: drop the least important columns */
@media (max-width: 1099px) {
  .gh-main { grid-template-columns: 12px 32px minmax(0, 1fr) 168px 152px 76px; }
  .gh-c .gh-main { grid-template-columns: 32px minmax(0, 1fr) 224px 76px 16px; }
  .conv { grid-template-columns: 28px minmax(120px, 180px) minmax(0, 1fr) 112px 152px 12px; }
  .conv .c-range { display: none; }
  .colhead, .msg { grid-template-columns: 140px 132px 160px minmax(0, 1fr) 152px; }
}
@media (max-width: 899px) {
  .gh-main { grid-template-columns: 12px 32px minmax(0, 1fr) auto 76px; }
  .gh-c .gh-main { grid-template-columns: 32px minmax(0, 1fr) auto 76px 16px; }
  .gh-main .srcs { display: none; }
  .conv { grid-template-columns: 28px minmax(120px, 170px) minmax(0, 1fr) 104px 12px; }
  .conv .srcs { display: none; }
  .colhead, .msg { grid-template-columns: 136px 116px 148px minmax(0, 1fr); }
  .colhead span:last-child, .msg .m-src { display: none; }
}

/* ---------- empty / loading / error ---------- */
.status { padding: 88px 16px; text-align: center; color: var(--text-2); }
.status h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.status p { margin: 4px auto 16px; max-width: 360px; font-size: 13px; }
.status-icon { width: 32px; height: 32px; color: var(--text-3); margin-bottom: 12px; }
.btn {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: transform 120ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.status.loading { padding: 0; }
.skel {
  height: 64px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px 0 44px;
  border-radius: var(--r-card);
  background: var(--surface);
  animation: pulse 1.1s ease-in-out calc(var(--i) * 90ms) infinite alternate;
}
.skel-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--fill); }
.skel-text { display: flex; flex-direction: column; gap: 8px; }
.skel-text span { display: block; height: 10px; width: 160px; border-radius: 5px; background: var(--fill); }
.skel-text span + span { width: 104px; background: var(--fill-2); }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }

/* ---------- popovers, menu, toast ---------- */
.pop {
  position: fixed;
  z-index: 40;
  padding: 6px;
  border-radius: 14px;
  background: var(--pop-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  opacity: 0;
  transform: scale(0.96);
  transform-origin: var(--origin, top right);
  transition: opacity 120ms ease, transform 160ms var(--ease-out);
}
.pop.in { opacity: 1; transform: none; transition: opacity 140ms ease, transform 420ms var(--spring); }
.pop:focus { outline: none; }
.filter-pop { width: 248px; }
.filter-pop:has([data-kind="voicemail"]:not([hidden])) { width: 296px; }
.f-sec { padding: 6px 6px 8px; }
.f-sec + .f-sec { border-top: 0.5px solid var(--sep); padding-top: 10px; }
.f-label { margin: 0 4px 6px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.seg-wide { display: flex; }
.seg-wide button { flex: 1; padding: 0; }
.checks { display: flex; flex-direction: column; }
.checks button, .menu button {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 7px;
  background: none;
  text-align: left;
  font-size: 13px;
}
.check { width: 20px; height: 14px; flex: none; position: relative; }
[aria-checked="true"] > .check::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  width: 5px;
  height: 10px;
  border: solid var(--accent);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}
.checks button:hover, .menu button:hover { background: var(--fill); }
.custom-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 4px 0; }
.custom-range label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.custom-range input { height: 28px; padding: 0 6px; border: 0; border-radius: 7px; background: var(--fill); font-size: 12px; min-width: 0; }
.f-foot { border-top: 0.5px solid var(--sep); padding: 6px 4px 0; display: flex; justify-content: flex-end; }
.link-btn { border: 0; background: none; color: var(--accent); font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.menu { width: 220px; }
.menu button { width: 100%; padding-left: 10px; }
.menu button:disabled { color: var(--text-3); background: none; }
.grab { display: none; }

/* Details and App installs */
.info-pop { width: 320px; padding: 6px 0 4px; }
.info-pop.wide { width: 380px; }
.info-pop .pop-head { margin: 0; padding: 8px 16px 10px; }
.facts { margin: 0; padding: 0 0 2px; }
.facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 16px; position: relative; }
.facts > div + div::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--sep); }
.facts dt { color: var(--text-2); white-space: nowrap; flex: none; }
.facts dd { margin: 0; color: var(--text); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.installs { list-style: none; margin: 0; padding: 0 0 4px; max-height: min(60vh, 520px); overflow-y: auto; }
.installs li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 10px 16px; position: relative; }
.installs li + li::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 0.5px; background: var(--sep); }
.in-icon { color: var(--text-2); padding-top: 1px; }
.in-icon svg { width: 20px; height: 20px; display: block; }
.in-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.in-top { display: flex; align-items: baseline; gap: 8px; }
.in-name { font-weight: 600; color: var(--text); }
.in-tag { font-size: 11px; color: var(--text-3); }
.in-when { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.in-saved { margin-top: 3px; color: var(--text-2); }
.in-top .in-health { margin-left: auto; padding-left: 8px; flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.hdot { width: 7px; height: 7px; border-radius: 50%; background: var(--h-ok); flex: none; }
.h-attention .hdot { background: var(--h-caution); }
.h-stopped .hdot { background: var(--h-stop); }
.in-issue { font-size: 13px; color: var(--text); }
.in-when .nw, .in-issue .nw { white-space: nowrap; }
/* client card: a quiet glyph after the name when a device needs attention */
.name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.name-row .name { min-width: 0; }
.dev-warn { flex: none; display: inline-flex; color: var(--h-caution); }
.dev-warn svg { width: 14px; height: 14px; display: block; }

/* phone: popovers marked .sheetable rise from the bottom as an inset sheet over a scrim */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  transition: opacity 220ms ease;
}
.scrim.in { opacity: 1; transition-duration: 300ms; }
.pop.sheet {
  left: 8px;
  right: 8px;
  top: auto;
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: auto;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 0 10px;
  border-radius: 26px;
  background: var(--sheet-bg);
  font-size: 15px;
  opacity: 1;
  transform: translateY(calc(100% + 24px));
  transition: transform 240ms cubic-bezier(0.4, 0, 1, 1);
  touch-action: none;
}
.pop.sheet.in { transform: none; transition: transform 500ms var(--spring-sheet); }
.pop.sheet.dragging { transition: none; }
.sheet .grab { display: block; width: 36px; height: 5px; margin: 0 auto 4px; border-radius: 3px; background: var(--text-3); opacity: 0.45; }
.sheet .pop-head { padding: 6px 20px 12px; margin-bottom: 4px; text-align: center; }
.sheet .pop-title { font-size: 17px; }
.sheet .pop-sub { font-size: 13px; }
.sheet.menu button { height: 50px; padding: 0 20px; font-size: 17px; border-radius: 0; position: relative; }
.sheet.menu button + button::before { content: ""; position: absolute; top: 0; left: 20px; right: 0; height: 0.5px; background: var(--sep); }
.sheet.menu button:active { background: var(--fill); }
.sheet .facts > div { padding: 12px 20px; }
.sheet .facts > div + div::before { left: 20px; }
.sheet .installs { max-height: none; }
.sheet .installs li { padding: 12px 20px; }
.sheet .installs li + li::before { left: 52px; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
.pop-head { padding: 6px 10px 8px; margin-bottom: 4px; border-bottom: 0.5px solid var(--sep); }
.pop-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-sub { font-size: 12px; color: var(--text-3); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--pop-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ---------- conversation panel (Messages) ---------- */
.thread {
  position: fixed;
  top: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 30;
  width: 420px;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: var(--t-bg);
  color: var(--t-text);
  box-shadow: var(--shadow-panel);
  transform: translateX(calc(100% + 16px));
  visibility: hidden;
  transition: transform 260ms var(--ease-drawer), visibility 0s linear 260ms;
}
.thread.open {
  transform: none;
  visibility: visible;
  transition: transform 380ms var(--ease-drawer), visibility 0s;
}
/* Wide screens: slide the page left so the panel doesn't cover the table, when there is room. */
.bar-in, .page { transition: transform 260ms var(--ease-drawer); }
@media (min-width: 1100px) {
  html.thread-open .bar-in, html.thread-open .page {
    transform: translateX(calc(-1 * clamp(0px, 1036px - 50vw, max(0px, 50vw - 624px))));
    transition-duration: 380ms;
  }
}

@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0521, 0.1653, 0.2976, 0.4268, 0.5425, 0.6409, 0.7219, 0.7868, 0.838, 0.8778, 0.9084, 0.9317, 0.9493, 0.9625, 0.9724, 0.9797, 0.9852, 0.9892, 0.9921, 0.9943, 0.9958, 0.997, 0.9978, 1);
    --spring-sheet: linear(0, 0.0503, 0.1646, 0.3034, 0.4431, 0.5704, 0.6793, 0.7682, 0.838, 0.891, 0.93, 0.9577, 0.9767, 0.9893, 0.9971, 1.0017, 1.004, 1.0049, 1.005, 1.0045, 1.0039, 1.0032, 1.0025, 1.0019, 1.0014, 1.001, 1.0007, 1.0005, 1);
  }
}

@supports (corner-shape: squircle) {
  .thread { corner-shape: squircle; border-radius: 36px; }
  .row, .gh-main, .skel { corner-shape: squircle; }
  :root { --r-card: 22px; }
}

.t-bar {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: start;
  padding: 10px 12px 8px;
  background: color-mix(in srgb, var(--t-bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--t-sep);
}
.t-glass {
  width: 32px;
  height: 32px;
  margin-top: 6px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--t-glass);
  color: var(--t-text);
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.t-glass:active { transform: scale(0.94); }
.t-glass svg { width: 14px; height: 14px; }
.t-glass span { display: grid; }
.g-back { display: none !important; }
.t-who { grid-column: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.t-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--avatar); color: #fff; }
.t-avatar svg { width: 100%; height: 100%; display: block; }
.t-name { max-width: 100%; font-size: 12px; line-height: 14px; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.t-scroll {
  position: relative;
  z-index: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 92px 0 16px;
  outline: none;
}
.t-thread {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.2px;
}
.t-stamp { margin: 16px 0 8px; text-align: center; font-size: 12px; line-height: 16px; letter-spacing: 0; color: var(--t-stamp); }
.t-stamp b { font-weight: 600; }
.t-stamp.first { margin-top: 4px; }
.t-row { display: flex; margin-top: 2px; }
.t-row.g-start { margin-top: 8px; }
.t-stamp + .t-row { margin-top: 0; }
.t-row.out { justify-content: flex-end; }
.b {
  position: relative;
  max-width: 75%;
  padding: 6px 12px;
  border-radius: 17px;
  background: var(--t-in);
  color: var(--t-text);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  outline: none;
  transition: background-color 150ms ease;
}
.b-text { position: relative; z-index: 2; }
.b a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
.b.out.blue { background: var(--t-blue); color: #fff; }
.b.out.green { background: var(--t-green); color: #fff; }
.b.sel { background: var(--t-in-press); }
.b.out.blue.sel { background: color-mix(in srgb, var(--t-blue) 82%, #000); }
.b.out.green.sel { background: color-mix(in srgb, var(--t-green) 82%, #000); }
.b:focus-visible { box-shadow: 0 0 0 2px var(--t-bg), 0 0 0 4px var(--accent); }
.b-empty { opacity: 0.6; font-style: italic; }
/* Bubble tails */
.b.tail::before, .b.tail::after { content: ""; position: absolute; bottom: 0; height: 20px; }
.b.in.tail::before { z-index: 0; left: -7px; width: 20px; background: inherit; border-bottom-right-radius: 15px; }
.b.in.tail::after { z-index: 1; left: -10px; width: 10px; background: var(--t-bg); border-bottom-right-radius: 10px; }
.b.out.tail::before { z-index: 0; right: -7px; width: 20px; background: inherit; border-bottom-left-radius: 15px; }
.b.out.tail::after { z-index: 1; right: -10px; width: 10px; background: var(--t-bg); border-bottom-left-radius: 10px; }

.t-call {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 10px 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0;
  color: var(--t-stamp);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: background-color 300ms ease;
}
.t-call b { font-weight: 600; }
.t-call svg { width: 12px; height: 12px; flex: none; }
.t-call + .t-call { margin-top: -6px; }
.t-call.flash, .t-call.sel { background: var(--fill); }
.t-call:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

/* Voicemail: a compact received card. Play, scrubber, time left (duration when idle), date. */
/* MMS attachments: a photo tile like Messages (no bubble), loaded when scrolled near, opens full-size */
.att-wrap { max-width: 75%; display: flex; flex-direction: column; gap: 3px; }
.t-row.out .att-wrap { align-items: flex-end; }
.att { position: relative; width: min(240px, 100%); min-width: 160px; border-radius: 17px; overflow: hidden; background: var(--t-in); }
.att-btn { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--t-dim, var(--t-text)); cursor: zoom-in; outline: none; aspect-ratio: var(--ar, 4 / 3); max-height: 320px; transition: transform 160ms var(--ease-out); }
.att-btn:disabled { cursor: default; }
.att-btn:not(:disabled):active { transform: scale(0.985); }
.att-btn:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.att-btn img { display: block; width: 100%; height: 100%; object-fit: cover; animation: att-in 220ms ease both; }
.att-ph { display: grid; place-items: center; width: 100%; height: 100%; opacity: 0.45; }
.att-ph svg { width: 26px; height: 26px; }
.att[data-state="loading"] .att-ph { animation: att-pulse 1.2s ease-in-out infinite; }
.att.unverified::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--warn); pointer-events: none; }
.att-err { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; padding: 12px; text-align: center; font-size: 12px; line-height: 16px; background: var(--t-in); }
.att-file { display: flex; align-items: center; gap: 8px; width: auto; min-width: 0; padding: 9px 12px; }
.att-ico svg { width: 18px; height: 18px; display: block; }
.att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.att-cap { display: flex; gap: 6px; padding: 0 4px; font-size: 11px; line-height: 14px; color: var(--t-dim, var(--t-text)); opacity: 0.75; outline: none; cursor: pointer; }
.att-cap b { font-weight: 600; }
.att-cap.warn b { color: var(--warn); }
.att-cap:focus-visible { border-radius: 4px; box-shadow: 0 0 0 2px var(--accent); }
.att-box { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(0, 0, 0, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background-color 200ms ease, backdrop-filter 200ms ease, -webkit-backdrop-filter 200ms ease; cursor: zoom-out; }
.att-box.on { background: rgba(0, 0, 0, 0.86); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.att-x { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; margin: 0; color: #fff; background: rgba(255, 255, 255, 0.18); }
.att-full { display: grid; place-items: center; width: 100%; height: 100%; padding: 56px 12px 16px; box-sizing: border-box; }
.att-full img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; cursor: default; transform: scale(0.96); opacity: 0; transition: transform 240ms var(--ease-out), opacity 200ms ease; }
.att-box.on .att-full img { transform: none; opacity: 1; }
@keyframes att-in { from { opacity: 0; } }
@keyframes att-pulse { 50% { opacity: 0.2; } }
.vm {
  position: relative;
  width: min(272px, 80%);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  padding: 9px 12px 9px 9px;
  border-radius: 18px;
  background: var(--t-in);
  color: var(--t-text);
  outline: none;
  transition: background-color 150ms ease;
  --p: 0;
}
.vm.sel, .vm.flash { background: var(--t-in-press); }
.vm:focus-visible { box-shadow: 0 0 0 2px var(--t-bg), 0 0 0 4px var(--accent); }
.vm-play {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--t-blue);
  color: #fff;
  transition: transform 120ms var(--ease-out), background-color 150ms ease;
}
.vm-play:active:not(:disabled) { transform: scale(0.92); }
.vm-play:disabled { background: var(--t-track); color: var(--t-stamp); }
.vm-play svg { width: 14px; height: 14px; grid-area: 1 / 1; }
.vm-i-play { transform: translateX(1px); }
.vm-i-pause, .vm.is-playing .vm-i-play, .vm.is-loading .vm-i-play { display: none; }
.vm.is-playing .vm-i-pause { display: block; }
.vm-spin { display: none; grid-area: 1 / 1; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: vm-spin 0.8s linear infinite; }
.vm.is-loading .vm-spin { display: block; }
@keyframes vm-spin { to { transform: rotate(360deg); } }
.vm-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vm-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 16px; letter-spacing: -0.08px; }
.vm-title { font-weight: 600; }
.vm-date { font-size: 12px; color: var(--t-stamp); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vm-bar { display: flex; align-items: center; gap: 8px; height: 16px; }
.vm-scrub { position: relative; flex: 1; height: 16px; display: flex; align-items: center; outline: none; touch-action: none; }
.vm-track { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--t-track); overflow: hidden; }
.vm-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); background: var(--t-blue); border-radius: inherit; }
.vm-knob {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 100%);
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 150ms ease, transform 150ms var(--ease-out);
}
.vm.is-active .vm-knob, .vm-scrub:hover .vm-knob, .vm-scrub:focus-visible .vm-knob { opacity: 1; transform: none; }
.vm.scrubbing .vm-knob { transform: scale(1.15); }
.vm-scrub:focus-visible .vm-track { box-shadow: 0 0 0 2px var(--accent); }
.vm-time { min-width: 30px; text-align: right; font-size: 12px; color: var(--t-stamp); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.vm-note { font-size: 12px; line-height: 16px; color: var(--t-stamp); letter-spacing: 0; }
.vm-warn, .vm-err { font-size: 12px; line-height: 16px; letter-spacing: 0; }
.vm-warn { color: var(--warn); }
.vm-err { color: var(--t-stamp); }
.d-warn { color: var(--warn); }

/* The machine transcript under the player: reads like the message, then quiet notes. */
.vm.has-tr { width: min(412px, 92%); row-gap: 0; }
.vm-tr { grid-column: 1 / -1; margin: 9px 0 0; padding: 8px 2px 1px; border-top: 0.5px solid var(--t-sep); }
.vm-tr p { margin: 0; letter-spacing: 0; }
.vm-tr .vm-tr-text { font-size: 15px; line-height: 20px; letter-spacing: -0.24px; overflow-wrap: anywhere; white-space: pre-wrap; }
.vm-tr .vm-tr-cb { margin-top: 5px; text-wrap: pretty; font-size: 12px; line-height: 16px; color: var(--t-stamp); }
.vm-tr .vm-tr-label { margin-top: 5px; font-size: 11px; line-height: 13px; color: var(--t-stamp); }
.vm-prev { min-width: 0; max-width: 100%; }
.vm-prev-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.t-foot { flex: none; border-top: 0.5px solid var(--t-sep); background: var(--t-bg); font-size: 12px; line-height: 16px; letter-spacing: 0; }
.t-foot-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 12px;
  text-align: left;
}
.t-foot-bar > svg { width: 14px; height: 14px; flex: none; }
.t-foot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t-foot-on { color: var(--text-2); font-variant-numeric: tabular-nums; }
.t-foot-on, .t-foot-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-foot-more { color: var(--text-2); }
.t-foot-chev svg { width: 12px; height: 12px; display: block; transform: rotate(180deg); transition: transform 200ms var(--ease-out); }
.details-open .t-foot-chev svg { transform: none; }
.t-foot-body { max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 16px; color: var(--text-2); }
.t-foot-body dl { margin: 0; }
.d-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding: 4px 0; }
.d-row dt { color: var(--text-3); }
.d-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.d-dim { color: var(--text-3); }
.d-hash { font-size: 11px; word-break: break-all; }
.d-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 4px; font-weight: 600; color: var(--text); }
.d-link { border: 0; background: none; padding: 0 0 0 8px; color: var(--accent); font-size: 12px; }
.d-caps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.d-caps li { display: flex; flex-direction: column; }
.d-hint { margin: 8px 0 0; color: var(--text-3); }

/* ---------- phone width ---------- */
@media (max-width: 719px) {
  .bar-in { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
  .brand { display: none; }
  .search { order: 1; flex: 1 1 0; max-width: none; margin: 0; }
  .controls { order: 2; display: contents; }
  #filter-btn { order: 2; }
  .controls .seg { order: 3; width: 100%; }
  .controls .seg button { flex: 1; padding: 0; }
  .page { padding: 8px 16px 80px; }
  .head h1 { margin-top: 4px; }

  .gh { padding-right: 4px; }
  .gh-main {
    grid-template-columns: 12px 32px minmax(0, 1fr) auto;
    grid-template-areas: "disc av who when" "disc av stats stats" "disc av srcs srcs";
    column-gap: 10px;
    row-gap: 2px;
    align-items: start;
    padding: 12px 4px 12px 18px;
  }
  .gh-main .udot { left: 5px; }
  .gh-c .gh-main { grid-template-columns: 32px minmax(0, 1fr) auto 14px; grid-template-areas: "av who when chev" "av stats stats chev"; column-gap: 14px; row-gap: 2px; padding: 12px 16px 12px 24px; }
  .gh-c .gh-main .udot { left: 8px; }
  .gh-c .i-exp { grid-area: chev; align-self: center; }
  .gh-c .who { gap: 1px; }
  .gh-main .i-disc { grid-area: disc; align-self: center; }
  .gh-main .avatar { grid-area: av; align-self: center; }
  .gh-main .who { grid-area: who; }
  .gh-main .stats { grid-area: stats; }
  .gh-main .srcs { grid-area: srcs; display: flex; margin-top: 4px; }
  .gh-main .when { grid-area: when; padding-top: 2px; }
  .tools { --tools-left: 70px; padding-right: 8px; }

  .conv {
    --hair-left: 70px;
    --hl-left: 20px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas: "av who range" "av prev prev" "av count srcs";
    column-gap: 10px;
    row-gap: 2px;
    align-items: start;
    padding: 12px 16px 12px 32px;
  }
  .conv .avatar { grid-area: av; }
  .conv > .udot { left: 16px; width: 9px; height: 9px; top: 21.5px; margin-top: 0; }
  .conv .c-who { grid-area: who; }
  .conv[data-act] .c-who .c-type { display: none; }
  .conv .c-prev { grid-area: prev; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .conv .c-count, .conv .c-range { display: none; }
  .conv .c-mob { grid-area: count; display: block; align-self: center; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .conv .c-last { grid-area: range; display: block; font-size: 13px; color: var(--text-3); padding-top: 2px; white-space: nowrap; }
  .conv .srcs { grid-area: srcs; display: flex; justify-content: flex-end; }
  .conv .i-chev { display: none; }

  .colhead { display: none; }
  .msg {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "sender time" "text text" "client src";
    gap: 2px 12px;
    padding: 12px 16px;
  }
  .msg.first { border-radius: var(--r-card) var(--r-card) 0 0; }
  .msg.first.last { border-radius: var(--r-card); }
  .msg.first::before { display: none; }
  .m-time { grid-area: time; }
  .m-sender { grid-area: sender; flex-direction: row; gap: 6px; align-items: baseline; }
  .m-num { font-weight: 500; font-size: 15px; }
  .m-text { grid-area: text; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .m-client { grid-area: client; color: var(--text-3); align-self: center; }
  .msg .m-src { grid-area: src; display: block; justify-self: end; }
  .m-sender .c-type { display: none; }

  .thread { inset: 0; width: 100vw; border-radius: 0; transform: translateX(100%); corner-shape: round; }
  .t-thread { font-size: 17px; line-height: 22px; letter-spacing: -0.4px; }
  .b { padding: 7px 12px; border-radius: 18px; }
  .vm { width: min(288px, 82%); }
  .t-bar { padding-top: max(10px, env(safe-area-inset-top)); }
  .t-scroll { padding-top: calc(92px + env(safe-area-inset-top)); }
  .g-x { display: none !important; }
  .t-foot-more { display: none; }
  .g-back { display: grid !important; }
  html.thread-open body { overflow: hidden; }
}

/* ---------- motion & material preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .thread, .thread.open { transform: none; opacity: 0; transition: opacity 180ms ease, visibility 0s linear 180ms; }
  .thread.open { opacity: 1; transition: opacity 180ms ease, visibility 0s; }
  .pop, .toast { transform: none !important; }
  .pop.sheet { opacity: 0; transition: opacity 180ms ease; }
  .pop.sheet.in { opacity: 1; transition: opacity 180ms ease; }
  .t-scroll { scroll-behavior: auto; }
  .bar-in, .page { transition: none; }
  .i-disc, .t-foot-chev svg, .tb { transition: none; }
  .skel { animation: none; }
  .att-ph, .att-btn img { animation: none !important; }
  .att-box, .att-full img, .att-btn { transition: none; }
  .vm-spin { animation-duration: 2.4s; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .pop, .toast { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .scrim { background: rgba(0, 0, 0, 0.45); }
  .t-bar { background: var(--t-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
