/* =====================================================================
   Phone · design system
   Calm, premium utility. Mobile is the real app; wide screens get a
   rail + two floating panels. Light and dark follow the system.
   ===================================================================== */

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --bg: #eef0ec;
  --surface: #ffffff;
  --surface-2: #f2f4f0;
  --surface-3: #e6e9e3;
  --ink: #0e1311;
  --ink-2: #3a423e;
  --muted: #69716c;
  --faint: #a0a7a2;
  --line: rgba(14, 19, 17, .08);
  --line-strong: rgba(14, 19, 17, .15);

  --accent: #0b7a55;
  --accent-2: #14a572;
  --accent-soft: rgba(20, 165, 114, .12);
  --accent-ink: #ffffff;
  --call: #1db85c;
  --red: #e5484d;
  --red-soft: rgba(229, 72, 77, .1);
  --red-line: rgba(229, 72, 77, .3);
  --amber: #f5a524;
  --amber-ink: #2b1700;
  --amber-soft: rgba(245, 165, 36, .16);
  --amber-deep: #995a00;
  --blue: #2f6df0;
  --blue-soft: rgba(47, 109, 240, .11);

  --bubble-in: #eff1ed;
  --bubble-in-ink: var(--ink);
  --bubble-out: linear-gradient(180deg, #14a572 0%, #0b7a55 100%);

  --shadow-1: 0 1px 2px rgba(10, 20, 15, .06), 0 1px 1px rgba(10, 20, 15, .03);
  --shadow-float: 0 18px 40px -12px rgba(10, 20, 15, .28), 0 4px 12px -4px rgba(10, 20, 15, .12);
  --shadow-fab: 0 10px 24px -6px rgba(11, 122, 85, .5), 0 3px 8px -2px rgba(10, 20, 15, .18);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
  --chrome: #ffffff;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050706;
    --surface: #0d100f;
    --surface-2: #171b19;
    --surface-3: #212623;
    --ink: #eef2ef;
    --ink-2: #c4cbc7;
    --muted: #8d9590;
    --faint: #5e6662;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);

    --accent: #3ddc97;
    --accent-2: #22c083;
    --accent-soft: rgba(61, 220, 151, .13);
    --accent-ink: #04140d;
    --red: #ff6369;
    --red-soft: rgba(255, 99, 105, .12);
    --red-line: rgba(255, 99, 105, .32);
    --amber: #ffb224;
    --amber-soft: rgba(255, 178, 36, .14);
    --amber-deep: #ffc35c;
    --blue: #6d9dff;
    --blue-soft: rgba(109, 157, 255, .15);

    --bubble-in: #1a1f1c;
    --bubble-out: linear-gradient(180deg, #1aa673 0%, #11714f 100%);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-float: 0 24px 48px -12px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .06);
    --shadow-fab: 0 12px 28px -8px rgba(61, 220, 151, .35), 0 4px 10px -2px rgba(0, 0, 0, .5);
    --chrome: #0d100f;
    color-scheme: dark;
  }
}

/* Avatar hues: deterministic per number, soft tint + strong glyph */
.av-0 { --av-bg: #d9f2e5; --av-fg: #0b7a55; }
.av-1 { --av-bg: #dfe8ff; --av-fg: #2457c5; }
.av-2 { --av-bg: #ebe2ff; --av-fg: #6a3fc8; }
.av-3 { --av-bg: #ffecd0; --av-fg: #9a5800; }
.av-4 { --av-bg: #ffe0e5; --av-fg: #bb2c4a; }
.av-5 { --av-bg: #d6f0f2; --av-fg: #0b6f7a; }
.av-6 { --av-bg: #e2e4ff; --av-fg: #3a45b5; }
.av-7 { --av-bg: #e6e9ed; --av-fg: #46505c; }
@media (prefers-color-scheme: dark) {
  .av-0 { --av-bg: rgba(61, 220, 151, .14); --av-fg: #6be3ae; }
  .av-1 { --av-bg: rgba(110, 160, 255, .16); --av-fg: #9bbcff; }
  .av-2 { --av-bg: rgba(170, 130, 255, .16); --av-fg: #c6aaff; }
  .av-3 { --av-bg: rgba(255, 190, 90, .15); --av-fg: #ffc877; }
  .av-4 { --av-bg: rgba(255, 110, 140, .15); --av-fg: #ff9db2; }
  .av-5 { --av-bg: rgba(70, 200, 215, .15); --av-fg: #82dde7; }
  .av-6 { --av-bg: rgba(130, 140, 255, .16); --av-fg: #adb4ff; }
  .av-7 { --av-bg: rgba(170, 180, 195, .14); --av-fg: #bcc4cf; }
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.42 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; }
svg { display: block; flex: none; }
a { color: var(--accent); }
.mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
::selection { background: var(--accent-soft); }

/* ---------------------------------------------------------------- shell (phone first) */
.app {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100dvh;
  transition: padding-top .3s var(--ease);
}
.list, .main { grid-row: 1; grid-column: 1; min-height: 0; min-width: 0; background: var(--surface); }
@media (max-width: 820px) {
  .app[data-pane="detail"] .list { display: none; }
  .app[data-pane="list"]:not([data-tab="keypad"]) .main { display: none; }
  .app[data-pane="detail"]:not([data-tab="keypad"]) .tabbar { display: none; }
  .app[data-pane="detail"]:not([data-tab="keypad"]) .main { animation: pushIn .32s var(--ease) both; }
}
.app[data-tab="keypad"] .list { display: none; }
.app[data-tab="keypad"] .main { animation: fadeIn .22s ease both; }
@keyframes pushIn { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- tab bar */
.tabbar {
  grid-row: 2; grid-column: 1;
  display: flex; align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 8px var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
  position: relative; z-index: 5;
}
.tabbar .brand, .tabbar .spacer, .tabbar .rail-only { display: none; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.tab-icon {
  position: relative; width: 60px; height: 32px; border-radius: 16px;
  display: grid; place-items: center;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.tab-icon svg { width: 24px; height: 24px; transition: transform .25s var(--ease-spring); }
.tab.active { color: var(--ink); }
.tab.active .tab-icon { background: var(--accent-soft); color: var(--accent); }
.tab:active .tab-icon svg { transform: scale(.88); }
.badge {
  position: absolute; top: -3px; left: calc(50% + 6px);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center;
  border: 2px solid var(--surface);
  animation: badgePop .35s var(--ease-spring);
}
.badge:empty { display: none; }
@keyframes badgePop { from { transform: scale(.4); } to { transform: scale(1); } }

/* ---------------------------------------------------------------- list pane */
.list { display: flex; flex-direction: column; position: relative; }
.topbar {
  flex: none; height: 58px; padding: 0 12px 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
  position: relative; z-index: 3;
}
.list.scrolled .topbar { border-bottom-color: var(--line); }
.compact-title {
  position: absolute; left: 50%; top: 50%; pointer-events: none;
  font-weight: 650; font-size: 16.5px; letter-spacing: -.01em;
  opacity: 0; transform: translate(-50%, -30%);
  transition: opacity .2s ease, transform .25s var(--ease);
}
.list.scrolled .compact-title { opacity: 1; transform: translate(-50%, -50%); }
/* when the title folds up, the status chip shrinks to its dot so they never collide */
.status-chip span { max-width: 220px; transition: max-width .3s var(--ease), opacity .2s ease; }
.list.scrolled .status-chip { gap: 0; padding: 0 12px; }
.list.scrolled .status-chip span { max-width: 0; opacity: 0; }

.status-chip {
  min-width: 0; max-width: calc(100% - 52px);
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px 0 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; font-weight: 550;
  transition: background-color .25s ease, color .25s ease, transform .15s ease, padding .3s var(--ease), gap .3s var(--ease);
}
.status-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-btn { flex: none; margin-left: auto; }
.status-chip:active { transform: scale(.97); }
.status-chip i { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status-chip.ready i { background: var(--call); }
.status-chip.ready i::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--call);
  animation: ping 2.4s cubic-bezier(0, 0, .2, 1) infinite;
}
.status-chip.wait i { animation: blink 1s ease-in-out infinite; }
.status-chip.warn { background: var(--amber-soft); color: var(--amber-deep); }
.status-chip.warn i { background: var(--amber); }
.status-chip.error { background: var(--red-soft); color: var(--red); }
.status-chip.error i { background: var(--red); animation: blink 1s ease-in-out infinite; }
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 75%, 100% { transform: scale(3.2); opacity: 0; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.me-btn {
  justify-self: end; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2);
  transition: transform .15s ease, background-color .2s ease;
}
.me-btn svg { width: 20px; height: 20px; }
.me-btn:active { transform: scale(.94); background: var(--surface-3); }

.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.large-title {
  margin: 2px 20px 14px; font-size: 34px; line-height: 1.08; font-weight: 700; letter-spacing: -.03em;
}
.list-tools { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 10px; }
.app[data-tab="keypad"] .list-tools { display: none; }

.search {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 13px;
  border-radius: 14px; background: var(--surface-2); color: var(--muted);
  transition: box-shadow .2s ease, background-color .2s ease;
}
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); background: var(--surface); }
.search > svg { width: 19px; height: 19px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-clear { width: 34px; height: 34px; display: grid; place-items: center; color: var(--faint); border-radius: 50%; }
.search-clear svg { width: 19px; height: 19px; }

.segmented {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  height: 40px; padding: 3px; border-radius: 12px; background: var(--surface-2);
}
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform .3s var(--ease);
}
@media (prefers-color-scheme: dark) { .seg-thumb { background: var(--surface-3); } }
.segmented[data-value="missed"] .seg-thumb { transform: translateX(100%); }
.segmented button { position: relative; z-index: 1; font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s ease; }
.segmented button[aria-selected="true"] { color: var(--ink); }

.rows { padding-bottom: 104px; }
.app[data-tab="calls"] .rows { padding-bottom: 24px; }

.section-head {
  position: sticky; top: 0; z-index: 1;
  padding: 14px 20px 6px; font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .01em;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.row {
  position: relative; width: 100%; text-align: left;
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: center;
  min-height: 76px; padding: 10px 16px;
  transition: background-color .15s ease;
  cursor: pointer;
}
.row.call { grid-template-columns: 48px minmax(0, 1fr) auto; min-height: 72px; padding-right: 10px; }
.row + .row::before {
  content: ''; position: absolute; top: 0; left: 78px; right: 0; height: 1px; background: var(--line);
}
.row:active { background: var(--surface-2); }
.row:active::before, .row:active + .row::before { opacity: 0; }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .name {
  font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.row .time { margin-left: auto; flex: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-bottom { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.preview {
  flex: 1; min-width: 0; color: var(--muted); font-size: 14.5px; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.preview .you { color: var(--ink-2); }
.preview.blocked { display: flex; align-items: center; gap: 5px; color: var(--red); font-weight: 600; }
.preview.blocked svg, .preview .media-ic { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; }
.row.unread .name { font-weight: 700; }
.row.unread .preview { color: var(--ink-2); }
.row.unread .time { color: var(--accent); font-weight: 650; }
.count {
  flex: none; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; margin-top: 1px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; line-height: 21px; text-align: center;
}
.sub { display: inline-flex; align-items: center; gap: 5px; min-width: 0; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sub > span { overflow: hidden; text-overflow: ellipsis; }
.sub svg { width: 15px; height: 15px; }
.sub .rec-ic { color: var(--accent); margin-left: 2px; }
.row.missed .name, .row.missed .sub { color: var(--red); }
.row-call {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  transition: transform .15s ease;
}
.row-call svg { width: 19px; height: 19px; }
.row-call:active { transform: scale(.9); }

/* skeleton */
.sk-row { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; padding: 14px 16px; }
.sk { background: var(--surface-2); border-radius: 8px; animation: skPulse 1.4s ease-in-out infinite; }
.sk.c { width: 48px; height: 48px; border-radius: 50%; }
.sk-lines { display: flex; flex-direction: column; gap: 9px; }
.sk.l1 { height: 13px; width: 46%; }
.sk.l2 { height: 11px; width: 78%; }
@keyframes skPulse { 50% { opacity: .45; } }

/* empty states */
.empty { padding: 56px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic {
  width: 68px; height: 68px; border-radius: 22px; margin-bottom: 8px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.empty-ic svg { width: 30px; height: 30px; }
.empty h3 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.empty p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; max-width: 280px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  height: 44px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  transition: transform .15s ease, background-color .2s ease, opacity .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-tonal { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; height: 52px; border-radius: 16px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: var(--ink);
  transition: background-color .15s ease, transform .15s ease;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: var(--surface-2); transform: scale(.94); }
.icon-btn.accent { color: var(--accent); }
.icon-btn.filled { background: var(--accent-soft); color: var(--accent); }

.fab {
  position: absolute; right: 16px; bottom: 16px; z-index: 4;
  height: 56px; padding: 0 20px 0 17px; border-radius: 18px;
  display: flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 15px; font-weight: 650; box-shadow: var(--shadow-fab);
  transition: padding .3s var(--ease), gap .3s var(--ease), transform .15s ease;
}
.fab svg { width: 22px; height: 22px; }
.fab span { max-width: 140px; overflow: hidden; white-space: nowrap; transition: max-width .3s var(--ease), opacity .2s ease; }
.fab.compact { padding: 0 17px; gap: 0; }
.fab.compact span { max-width: 0; opacity: 0; }
.fab:active { transform: scale(.95); }
.app:not([data-tab="messages"]) .fab { display: none; }

/* ---------------------------------------------------------------- tags */
.tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  height: 20px; padding: 0 8px 0 6px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.tag svg { width: 12px; height: 12px; }
.tag.first { background: var(--amber); color: var(--amber-ink); }
.tag.returning { background: var(--blue-soft); color: var(--blue); }
.tag.withheld { background: var(--surface-2); color: var(--muted); }
.tag.lg { height: 28px; padding: 0 12px 0 9px; font-size: 13px; gap: 6px; }
.tag.lg svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- avatars */
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--av-bg, var(--surface-2)); color: var(--av-fg, var(--muted));
  font-weight: 650; font-size: 19px; letter-spacing: -.01em;
}
.avatar svg { width: 23px; height: 23px; }
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.avatar.sm svg { width: 18px; height: 18px; }
.avatar.lg { width: 64px; height: 64px; font-size: 25px; }
.avatar.lg svg { width: 30px; height: 30px; }
.avatar.xl { width: 96px; height: 96px; font-size: 38px; }
.avatar.xl svg { width: 44px; height: 44px; }

/* ---------------------------------------------------------------- detail panes */
.main { display: flex; flex-direction: column; }
.pane-head {
  flex: none; height: 62px; padding: 0 8px; gap: 4px;
  display: flex; align-items: center;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.pane-title { flex: 1; min-width: 0; padding-left: 6px; font-weight: 650; font-size: 17px; letter-spacing: -.01em; }
.convo-who {
  flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 6px 4px; border-radius: 14px; text-align: left;
  transition: background-color .15s ease;
}
.convo-who:active { background: var(--surface-2); }
.convo-who > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.convo-name { font-weight: 650; font-size: 16.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-sub { font-size: 12.5px; color: var(--muted); }
.head-gap { flex: 1; }
.icon-btn.copy-num { width: 34px; height: 34px; color: var(--muted); }
.icon-btn.copy-num svg { width: 17px; height: 17px; }
.icon-btn.copy-num:hover { color: var(--ink); }
.pane-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(32px + var(--safe-b)); }

/* ---------------------------------------------------------------- conversation */
.messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px 12px 14px; display: flex; flex-direction: column;
}
.messages > :first-child { margin-top: auto; }
.day-sep {
  align-self: center; margin: 18px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted);
  letter-spacing: .01em;
}
.day-sep b { color: var(--ink-2); font-weight: 650; }
.bubble {
  max-width: min(78%, 540px); padding: 9px 14px; border-radius: 20px;
  font-size: 16px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere;
  margin-top: 2px;
}
.bubble.in { align-self: flex-start; background: var(--bubble-in); color: var(--bubble-in-ink); }
.bubble.out { align-self: flex-end; background: var(--bubble-out); color: #fff; }
.bubble.g-first, .bubble.g-single { margin-top: 10px; }
.bubble.in.g-first { border-bottom-left-radius: 6px; }
.bubble.in.g-mid { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.bubble.in.g-last { border-top-left-radius: 6px; }
.bubble.out.g-first { border-bottom-right-radius: 6px; }
.bubble.out.g-mid { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.bubble.out.g-last { border-top-right-radius: 6px; }
.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.bubble.media-only { padding: 4px; background: none; }
.bubble img { display: block; max-width: 100%; border-radius: 16px; margin: 2px 0 6px; }
.bubble.media-only img { margin: 0; }
.bubble.sending { opacity: .65; }
.bubble.failed { background: var(--red-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--red-line); }
.bubble.fresh { animation: bubbleIn .34s var(--ease-spring) both; }
.bubble.out.fresh { transform-origin: 100% 100%; }
.bubble.in.fresh { transform-origin: 0 100%; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
.msg-meta { margin: 4px 8px 2px; font-size: 12px; color: var(--muted); align-self: flex-end; display: flex; align-items: center; gap: 6px; }
.msg-meta.in { align-self: flex-start; }
.msg-meta.failed { color: var(--red); font-weight: 600; }
.msg-meta button { color: var(--accent); font-weight: 650; font-size: 12px; padding: 2px 4px; }
.msg-meta svg { width: 14px; height: 14px; }
.code-chip {
  align-self: flex-start; margin: 6px 0 2px;
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px 0 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 650;
  transition: transform .15s ease;
}
.code-chip svg { width: 15px; height: 15px; }
.code-chip:active { transform: scale(.96); }
.code-chip b { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.bubble.blocked {
  white-space: normal; max-width: min(88%, 540px);
  background: var(--red-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--red-line);
  padding: 13px 15px; border-radius: 20px;
}
.blocked-title { display: flex; align-items: center; gap: 7px; font-weight: 700; color: var(--red); }
.blocked-title svg { width: 17px; height: 17px; }
.blocked-why { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.convo-empty { margin: auto; text-align: center; color: var(--muted); font-size: 14.5px; padding: 24px; }

.composer {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 10px calc(10px + var(--safe-b)) 12px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.composer-field {
  flex: 1; min-width: 0; display: flex; align-items: flex-end;
  min-height: 46px; border-radius: 23px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s ease, background-color .2s ease;
}
.composer-field:focus-within { box-shadow: inset 0 0 0 1px var(--line-strong); background: var(--surface); }
.composer textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none;
  padding: 12px 16px; font-size: 16px; line-height: 22px; max-height: 150px; color: var(--ink);
}
.composer textarea::placeholder { color: var(--muted); }
.counter { flex: none; padding: 0 14px 14px 0; font-size: 11.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter:empty { display: none; }
.counter.warn { color: var(--amber-deep); }
.send {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  transition: transform .25s var(--ease-spring), background-color .2s ease, color .2s ease;
}
.send svg { width: 20px; height: 20px; transform: translateX(1px); }
.send:disabled { background: var(--surface-2); color: var(--faint); transform: scale(.9); }
.send:not(:disabled):active { transform: scale(.9); }
.no-reply {
  flex: none; display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13.5px;
}
.no-reply svg { width: 18px; height: 18px; margin-top: 1px; }

/* new message */
.to-row {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 18px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.to-row label { color: var(--muted); font-weight: 600; font-size: 15px; }
.to-row input { flex: 1; min-width: 0; height: 50px; border: 0; outline: 0; background: none; font-size: 17px; font-variant-numeric: tabular-nums; }
.to-row input::placeholder { color: var(--faint); }
.suggest { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.suggest-head { padding: 12px 18px 4px; font-size: 13px; font-weight: 650; color: var(--muted); }
.suggest .row { min-height: 64px; }

/* ---------------------------------------------------------------- call details */
.detail-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 0 20px; }
.detail-hero .avatar { margin-bottom: 8px; }
.hero-name { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.hero-sub { color: var(--muted); font-size: 14.5px; }
.detail-hero .tag { margin-top: 6px; }
.action-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 440px; margin: 0 auto 18px; }
.action {
  height: 68px; border-radius: 18px; background: var(--surface-2); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 13px; font-weight: 600;
  transition: transform .15s ease, background-color .2s ease;
}
.action svg { width: 22px; height: 22px; color: var(--accent); }
.action.primary { background: var(--accent); color: var(--accent-ink); }
.action.primary svg { color: var(--accent-ink); }
.action:active:not(:disabled) { transform: scale(.96); }
.action:disabled { opacity: .4; }
.card { max-width: 520px; margin: 0 auto 14px; padding: 16px; border-radius: 22px; background: var(--surface-2); }
.card-title { margin: 0 0 6px; font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .01em; }
.info-line { display: flex; align-items: center; gap: 13px; }
.info-ic { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.info-ic.missed { background: var(--red-soft); color: var(--red); }
.info-ic svg { width: 21px; height: 21px; }
.info-text strong { display: block; font-size: 15.5px; font-weight: 650; }
.info-text small { display: block; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.info-note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 10px; }
.info-note svg { width: 17px; height: 17px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li + li { border-top: 1px solid var(--line); }
.hist button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 2px; text-align: left; border-radius: 10px; }
.hist .h-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); flex: none; }
.hist .h-ic svg { width: 15px; height: 15px; }
.hist .missed .h-ic { color: var(--red); }
.hist .h-label { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 550; }
.hist .missed .h-label { color: var(--red); }
.hist .h-when { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist .current .h-label::after { content: 'This call'; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.hist-link { width: 100%; margin-top: 4px; display: flex; align-items: center; gap: 12px; padding: 12px 2px 2px; border-top: 1px solid var(--line); font-size: 14.5px; font-weight: 600; color: var(--accent); }
.hist-link svg { width: 18px; height: 18px; }
.hist-link span { flex: 1; text-align: left; }

/* recording player */
.player {
  margin-top: 14px; padding: 12px 14px 10px 12px; border-radius: 18px; background: var(--surface);
  display: grid; grid-template-columns: 46px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; align-items: center;
}
@media (prefers-color-scheme: dark) { .player { background: var(--surface-3); } }
.player-btn {
  grid-row: span 2; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  transition: transform .15s ease;
}
.player-btn svg { width: 20px; height: 20px; }
.player-btn:active { transform: scale(.92); }
.player-track { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.wave { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; pointer-events: none; }
.wave i { flex: 1; height: var(--h); min-height: 3px; border-radius: 2px; background: var(--line-strong); }
.wave.fill { clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.wave.fill i { background: var(--accent); }
.player-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-rate { height: 24px; min-width: 38px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.player-dl { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 4px; font-size: 12.5px; font-weight: 650; color: var(--accent); text-decoration: none; }
.player-dl svg { width: 15px; height: 15px; }
button.player-dl { border: 0; background: none; font-family: inherit; cursor: pointer; }

/* desktop empty main */
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 32px; color: var(--muted); }
.ph-ic { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); margin-bottom: 10px; }
.ph-ic svg { width: 34px; height: 34px; }
.placeholder h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.placeholder p { margin: 0 0 12px; font-size: 14.5px; }
.placeholder .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------------------------------------------------------------- keypad */
.keypad-wrap {
  --key: clamp(64px, 20vw, 78px);
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 20px 22px;
}
.dial-display { flex: 1; width: 100%; max-width: 360px; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding-bottom: 14px; }
.dial-input {
  width: 100%; text-align: center; border: 0; outline: 0; background: none;
  font-size: 38px; font-weight: 500; letter-spacing: .01em; color: var(--ink); caret-color: var(--accent);
  font-variant-numeric: tabular-nums; height: 52px;
  transition: font-size .15s ease;
}
.dial-input.len-m { font-size: 31px; }
.dial-input.len-l { font-size: 25px; }
.dial-input::placeholder { color: var(--faint); font-size: 21px; font-weight: 450; letter-spacing: 0; }
.dial-hint { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13.5px; color: var(--muted); text-align: center; }
.dial-hint.warn { color: var(--amber-deep); font-weight: 600; }
.dial-hint svg { width: 15px; height: 15px; }
.dial-match {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: 13.5px; font-weight: 600;
  animation: fadeUp .25s var(--ease);
}
.dial-match .avatar { width: 24px; height: 24px; font-size: 11px; }
.dial-match .avatar svg { width: 13px; height: 13px; }
.dial-match small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.keys { display: grid; grid-template-columns: repeat(3, var(--key)); gap: 14px clamp(18px, 7vw, 28px); }
.key {
  width: var(--key); height: var(--key); border-radius: 50%; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  transition: background-color .18s ease, transform .12s ease;
  touch-action: manipulation;
}
.key b { font-size: 31px; font-weight: 500; letter-spacing: -.01em; }
.key small { margin-top: 3px; min-height: 11px; font-size: 10px; font-weight: 700; letter-spacing: .18em; color: var(--muted); padding-left: .18em; }
.key[data-d="*"] b { font-size: 36px; transform: translateY(5px); }
.key.pressed, .key:active { background: var(--surface-3); transform: scale(.94); transition-duration: .05s; }
.key-actions { display: grid; grid-template-columns: repeat(3, var(--key)); gap: 0 clamp(18px, 7vw, 28px); margin-top: 18px; justify-items: center; align-items: center; }
.call-btn {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--call); color: #fff;
  transition: transform .15s ease, opacity .2s ease, box-shadow .2s ease;
}
.call-btn svg { width: 28px; height: 28px; }
.call-btn.big { width: var(--key); height: var(--key); box-shadow: 0 10px 26px -8px rgba(29, 184, 92, .7); }
.call-btn.big svg { width: 32px; height: 32px; }
.call-btn:active:not(:disabled) { transform: scale(.93); }
.call-btn:disabled { opacity: .4; box-shadow: none; }
.call-btn.hang { background: var(--red); }
.call-btn.swap { background: #9a5b2a; }
.key-side {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  transition: opacity .2s ease, transform .15s ease, background-color .15s ease;
}
.key-side svg { width: 25px; height: 25px; }
.key-side:active { background: var(--surface-2); transform: scale(.92); }
.key-side.gone { opacity: 0; pointer-events: none; }
.from-line { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.from-line code { font-size: 12px; }

/* ---------------------------------------------------------------- live call (always dark) */
.call-screen {
  --cs-tint: #1db86f;
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  color: #f2f5f3;
  background:
    radial-gradient(120% 60% at 50% 22%, color-mix(in srgb, var(--cs-tint) 26%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, #0a0e0c 0%, #050706 100%);
  padding: var(--safe-t) 0 var(--safe-b);
  animation: csIn .38s var(--ease) both;
  overflow: hidden;
}
.call-screen.tier-first { --cs-tint: #f5a524; }
.call-screen.tier-returning { --cs-tint: #3e7bfa; }
.call-screen.tier-withheld { --cs-tint: #6f7880; }
@keyframes csIn { from { opacity: 0; transform: translateY(40px) scale(.98); } to { opacity: 1; transform: none; } }
.cs-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.cs-icon, .cs-icon-spacer { width: 44px; height: 44px; }
.cs-icon { border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #fff; transition: background-color .15s ease, transform .15s ease; }
.cs-icon:active { transform: scale(.92); background: rgba(255, 255, 255, .16); }
.cs-icon svg { width: 22px; height: 22px; }
.cs-rec { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, .07); font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .72); letter-spacing: .02em; }
.cs-rec i { width: 7px; height: 7px; border-radius: 50%; background: #ff5a5f; animation: blink 1.6s ease-in-out infinite; }

.cs-held { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.cs-held:empty { display: none; }
.held-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 20px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08);
  animation: fadeUp .3s var(--ease);
}
.held-icon { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(245, 165, 36, .18); color: #ffbe55; animation: heldPulse 2s ease-in-out infinite; }
.held-icon svg { width: 16px; height: 16px; }
@keyframes heldPulse { 50% { opacity: .5; } }
.held-who { flex: 1; min-width: 0; }
.held-num { font-weight: 650; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.held-time { margin-top: 2px; overflow: hidden; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.held-time .tag { height: 18px; font-size: 11px; }
.held-resume { height: 38px; padding: 0 16px; border-radius: 999px; background: var(--call); color: #fff; font-size: 14px; font-weight: 650; flex: none; transition: transform .15s ease; }
.held-end { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e5484d; color: #fff; flex: none; transition: transform .15s ease; }
.held-end svg { width: 18px; height: 18px; }
.held-resume:active, .held-end:active { transform: scale(.93); }

.cs-who { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px 24px; text-align: center; }
.cs-avatar { --vol: 0; position: relative; width: 116px; height: 116px; margin-bottom: 18px; flex: none; }
.cs-avatar .avatar { position: relative; width: 116px; height: 116px; font-size: 44px; background: rgba(255, 255, 255, .1); color: #fff; }
.cs-avatar .avatar svg { width: 52px; height: 52px; }
.cs-halo {
  position: absolute; inset: 0; border-radius: 50%; background: var(--cs-tint);
  opacity: calc(.14 + var(--vol) * .5);
  transform: scale(calc(1.06 + var(--vol) * .38));
  transition: transform .1s linear, opacity .1s linear;
}
.cs-halo.h2 { opacity: calc(.06 + var(--vol) * .22); transform: scale(calc(1.18 + var(--vol) * .75)); }
.cs-name { font-size: 31px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.cs-name-row { position: relative; max-width: calc(100% - 76px); }
.cs-copy {
  position: absolute; left: 100%; top: 50%; margin: -17px 0 0 6px;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: rgba(255, 255, 255, .6); transition: background-color .15s ease, color .15s ease;
}
.cs-copy[hidden] { display: none; }
.cs-copy svg { width: 18px; height: 18px; }
.cs-copy:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cs-copy:active { transform: scale(.94); }
.cs-tag:empty { display: none; }
.cs-tag .tag.returning, .held-time .tag.returning { background: rgba(110, 157, 255, .22); color: #b9cfff; }
.cs-tag .tag.withheld, .held-time .tag.withheld { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
.cs-state { font-size: 16px; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; letter-spacing: .02em; min-height: 22px; }
.cs-state.live { color: #fff; font-weight: 550; }
.cs-state.reconnecting { color: #ffc46b; font-weight: 600; animation: blink 1.6s ease-in-out infinite; }
.cs-state .muted-chip { margin-left: 8px; font-size: 12px; font-weight: 700; color: #ffbe55; letter-spacing: .02em; }
.cs-warn { margin-top: 8px; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(245, 165, 36, .16); color: #ffc46b; font-size: 13px; font-weight: 600; }
.cs-warn svg { width: 15px; height: 15px; }
.cs-idle { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; }
.cs-idle-title { font-size: 20px; font-weight: 650; }
.cs-idle-sub { font-size: 14.5px; color: rgba(255, 255, 255, .6); }

/* live text of what they're saying: the newest words bright and at the bottom */
.cs-tx {
  flex: 1; min-height: 132px; margin: 2px 14px 12px; display: flex; flex-direction: column;
  border-radius: 22px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .07);
  overflow: hidden; animation: fadeUp .3s var(--ease);
}
.cs-tx[hidden] { display: none; }
.cs-tx-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 11px 16px 2px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255, 255, 255, .5);
}
.cs-tx-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--cs-tint); }
.cs-tx-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 16px 14px;
  font-size: 19px; line-height: 1.42; font-weight: 450; letter-spacing: -.005em;
}
.cs-tx-body p { margin: 0 0 9px; color: rgba(255, 255, 255, .5); overflow-wrap: anywhere; transition: color .4s ease; }
.cs-tx-body p.new { color: #fff; animation: fadeUp .25s var(--ease); }
.cs-tx-body p.new.seen { animation: none; }
.cs-tx-body p.hint { color: rgba(255, 255, 255, .38); font-size: 15px; }
.cs-tx-dots { display: inline-flex; gap: 4px; padding: 6px 0 2px; }
.cs-tx-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); animation: txDot 1.2s ease-in-out infinite; }
.cs-tx-dots i:nth-child(2) { animation-delay: .15s; }
.cs-tx-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes txDot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
/* with the text on, the caller's picture and the buttons shrink to make room for it */
.call-screen.tx-on .cs-who { flex: none; gap: 3px; padding: 0 24px 10px; }
.call-screen.tx-on .cs-avatar, .call-screen.tx-on .cs-avatar .avatar { width: 64px; height: 64px; }
.call-screen.tx-on .cs-avatar { margin-bottom: 8px; }
.call-screen.tx-on .cs-avatar .avatar { font-size: 25px; }
.call-screen.tx-on .cs-avatar .avatar svg { width: 30px; height: 30px; }
.call-screen.tx-on .cs-name { font-size: 23px; }
.call-screen.tx-on .cs-state { font-size: 14.5px; min-height: 19px; }
.call-screen.tx-on .cs-warn { margin-top: 4px; }
.call-screen.tx-on .cs-controls { gap: 10px 0; padding-bottom: 10px; }
.call-screen.tx-on .cs-ic { width: 56px; height: 56px; }
.call-screen.tx-on .cs-ic svg { width: 24px; height: 24px; }
.call-screen.tx-on .cs-btn { width: 20%; gap: 5px; font-size: 12px; } /* one row of buttons */
.call-screen.tx-on .cs-bottom { padding: 2px 0 18px; }
.call-screen.tx-on .end-btn { width: 64px; height: 64px; }
.call-screen.tx-on .end-btn svg { width: 30px; height: 30px; }
.call-screen.pad-on .cs-tx { display: none; }

.cs-controls {
  flex: none; width: 100%; max-width: 400px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 0; padding: 6px 18px 18px;
}
.cs-btn { width: 33.33%; display: flex; flex-direction: column; align-items: center; gap: 8px; color: rgba(255, 255, 255, .9); font-size: 12.5px; font-weight: 550; }
.cs-ic {
  width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color .2s ease, color .2s ease, transform .12s ease;
}
.cs-ic svg { width: 28px; height: 28px; }
.cs-btn:active:not(:disabled) .cs-ic { transform: scale(.92); }
.cs-btn.on .cs-ic { background: #fff; color: #0a0e0c; }
.cs-btn:disabled { opacity: .32; }
.cs-btn .ic-off, .cs-btn.on .ic-on { display: none; }
.cs-btn.on .ic-off { display: block; }

.cs-pad { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 24px 8px; animation: fadeUp .25s var(--ease); }
.cs-pad-digits { min-height: 38px; max-width: 100%; font-size: 30px; font-weight: 500; letter-spacing: .08em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; direction: rtl; }
.cs-pad-keys { display: grid; grid-template-columns: repeat(3, 70px); gap: 12px 26px; }
.cs-pad-keys button {
  width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, .1);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  transition: background-color .15s ease, transform .1s ease;
}
.cs-pad-keys button b { font-size: 28px; font-weight: 500; }
.cs-pad-keys button small { font-size: 9.5px; font-weight: 700; letter-spacing: .16em; opacity: .6; margin-top: 3px; min-height: 10px; }
.cs-pad-keys button:active { background: rgba(255, 255, 255, .24); transform: scale(.93); }
.cs-pad-hide { margin-top: 2px; padding: 10px 16px; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .75); }
.call-screen.pad-on .cs-avatar, .call-screen.pad-on .cs-tag, .call-screen.pad-on .cs-warn { display: none; }
.call-screen.pad-on .cs-who { flex: none; padding-top: 4px; }
.call-screen.pad-on .cs-name { font-size: 20px; }
.call-screen.pad-on .cs-controls { display: none; }

.cs-bottom { flex: none; display: flex; justify-content: center; padding: 6px 0 26px; }
.end-btn {
  width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: #e5484d; color: #fff; box-shadow: 0 12px 32px -8px rgba(229, 72, 77, .6);
  transition: transform .15s ease;
}
.end-btn svg { width: 34px; height: 34px; }
.end-btn:active { transform: scale(.92); }

/* minimised call */
.call-pill {
  position: fixed; z-index: 45; left: 12px; right: 12px; top: calc(8px + var(--safe-t));
  height: 46px; padding: 0 5px 0 16px; border-radius: 999px;
  display: flex; align-items: center; gap: 11px;
  background: var(--call); color: #fff; box-shadow: 0 10px 28px -10px rgba(29, 184, 92, .8);
  cursor: pointer; animation: pillIn .35s var(--ease-spring) both;
}
.call-pill.held-only { background: #c27a12; box-shadow: 0 10px 28px -10px rgba(194, 122, 18, .8); }
@keyframes pillIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.pill-wave { display: flex; align-items: center; gap: 2.5px; height: 16px; }
.pill-wave i { width: 3px; height: 100%; border-radius: 2px; background: #fff; transform-origin: 50% 50%; animation: eq 1s ease-in-out infinite; }
.pill-wave i:nth-child(2) { animation-delay: -.35s; }
.pill-wave i:nth-child(3) { animation-delay: -.7s; }
.call-pill.held-only .pill-wave i, .call-pill.reconnecting .pill-wave i { animation: none; transform: scaleY(.45); }
.call-pill.reconnecting { background: #c27a12; box-shadow: 0 10px 28px -10px rgba(194, 122, 18, .8); }
.call-pill.reconnecting .pill-time { animation: blink 1.6s ease-in-out infinite; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.pill-who { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-time { font-size: 14px; font-weight: 600; opacity: .92; }
.pill-end { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #e5484d; color: #fff; flex: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.pill-end svg { width: 18px; height: 18px; }
body.pill-on .app { padding-top: calc(62px + var(--safe-t)); }

/* ---------------------------------------------------------------- incoming call (always dark) */
.incoming { display: none; position: fixed; inset: 0; z-index: 60; background: #050706; }
.incoming.show { display: flex; }
.in-card {
  --tier: #3e7bfa; --tier-ink: #fff;
  flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(28px + var(--safe-t)) 24px calc(30px + var(--safe-b));
  color: #fff;
  background:
    radial-gradient(90% 50% at 50% 34%, color-mix(in srgb, var(--tier) 32%, transparent) 0%, transparent 70%),
    linear-gradient(180deg, #0b0f0d 0%, #050706 100%);
  animation: fadeIn .3s ease both;
}
.in-card.tier-first { --tier: #f5a524; --tier-ink: #2b1700; }
.in-card.tier-returning { --tier: #3e7bfa; --tier-ink: #fff; }
.in-card.tier-withheld { --tier: #7d868e; --tier-ink: #fff; }
.in-label { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, .66); letter-spacing: .02em; }
.in-tier {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 6px 0 12px; border-radius: 999px;
  background: var(--tier); color: var(--tier-ink);
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  animation: fadeUp .4s .1s var(--ease) both;
}
.in-tier svg { width: 17px; height: 17px; }
.in-tier .tier-chip { height: 26px; line-height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(0, 0, 0, .18); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; }
.in-tier.solo { padding-right: 14px; }
.in-avatar { position: relative; width: 128px; height: 128px; margin: auto 0 26px; flex: none; }
.in-avatar .avatar { position: relative; width: 128px; height: 128px; font-size: 48px; background: color-mix(in srgb, var(--tier) 22%, #121614); color: #fff; }
.in-avatar .avatar svg { width: 56px; height: 56px; }
.in-avatar .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--tier); opacity: 0; animation: ripple 2.7s cubic-bezier(.2, .6, .3, 1) infinite; }
.in-avatar .r2 { animation-delay: .9s; }
.in-avatar .r3 { animation-delay: 1.8s; }
@keyframes ripple { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(2.1); opacity: 0; } }
.in-num { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12; overflow-wrap: anywhere; }
.in-detail { margin-top: 8px; max-width: 320px; font-size: 15px; color: rgba(255, 255, 255, .72); min-height: 21px; }
.in-waiting { margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.in-btns { margin-top: auto; padding-top: 30px; width: 100%; max-width: 380px; display: flex; justify-content: space-around; align-items: flex-start; }
.act { width: 104px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .86); line-height: 1.25; }
.act .call-btn { width: 76px; height: 76px; }
.act .call-btn svg { width: 32px; height: 32px; }
.act[data-act="answer"] .call-btn { box-shadow: 0 12px 34px -8px rgba(29, 184, 92, .75); animation: nudge 2.2s ease-in-out infinite; }
.act[data-act="decline"] .call-btn { box-shadow: 0 12px 34px -8px rgba(229, 72, 77, .6); }
.act:active .call-btn { transform: scale(.92); animation: none; }
@keyframes nudge {
  0%, 60%, 100% { transform: none; }
  66% { transform: translateY(-6px) rotate(-12deg); }
  72% { transform: translateY(-6px) rotate(10deg); }
  78% { transform: translateY(-3px) rotate(-6deg); }
  84% { transform: none; }
}
.in-text { margin-top: 18px; padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .78); font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------------- sheet */
.sheet { position: fixed; inset: 0; z-index: 70; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(4, 8, 6, .48); opacity: 0; transition: opacity .28s ease; }
.sheet.show .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 6px 18px calc(22px + var(--safe-b));
  transform: translateY(100%); transition: transform .34s var(--ease);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .18);
}
.sheet.show .sheet-panel { transform: translateY(0); }
.sheet-panel.dragging { transition: none; }
.sheet-grab { padding: 8px 0 12px; cursor: grab; touch-action: none; }
.sheet-grab::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; margin: 0 auto; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 2px 16px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.sheet-close svg { width: 18px; height: 18px; }

.me-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 18px 20px 18px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .22) 0%, transparent 46%),
    linear-gradient(135deg, #14a572 0%, #0b7a55 55%, #075238 100%);
  box-shadow: 0 16px 34px -14px rgba(11, 122, 85, .7);
}
.me-card::after {
  content: ''; position: absolute; right: -40px; bottom: -70px; width: 200px; height: 200px; border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, .07);
}
.me-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .78; }
.me-num { margin-top: 6px; font-size: 27px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.me-row { position: relative; z-index: 1; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.me-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; opacity: .92; }
.me-status i { width: 8px; height: 8px; border-radius: 50%; background: #b9ffd9; }
.me-status.warn i { background: #ffc35c; }
.me-status.error i { background: #ff9a9a; }
.me-copy { position: relative; z-index: 1; height: 34px; padding: 0 13px; border-radius: 999px; background: rgba(255, 255, 255, .18); color: #fff; font-size: 13px; font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.me-copy svg { width: 15px; height: 15px; }

.section-label { margin: 22px 4px 8px; font-size: 13px; font-weight: 650; color: var(--muted); letter-spacing: .01em; }
.group { border-radius: 18px; background: var(--surface-2); padding: 2px 14px; }
.sp-row { display: flex; gap: 12px; padding: 12px 0; }
.sp-row + .sp-row { border-top: 1px solid var(--line); }
.sp-row i { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--faint); }
.sp-row i.ok { background: var(--call); }
.sp-row i.bad { background: var(--red); }
.sp-row i.wait { animation: blink 1s ease-in-out infinite; }
.sp-label { font-size: 14.5px; font-weight: 600; }
.sp-detail { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.sp-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); }
.sp-foot .btn { height: 36px; padding: 0 14px; font-size: 13.5px; flex: none; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; font-size: 14.5px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:last-child { color: var(--muted); text-align: right; }
.sheet .btn-block { margin-top: 22px; }
.peer-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.peer-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 0 4px; }
.peer-hero .avatar { margin-bottom: 8px; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 90;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 16px;
  background: #111614; color: #f1f4f2; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45);
  opacity: 0; transform: translate(-50%, 16px) scale(.98); pointer-events: none;
  transition: opacity .2s ease, transform .3s var(--ease);
}
@media (prefers-color-scheme: dark) { .toast { background: #e9eeeb; color: #0d100f; } }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast svg { width: 18px; height: 18px; }
.toast.ok svg { color: var(--call); }
.toast.err svg { color: var(--red); }
.toast button { color: #6be3ae; font-weight: 700; font-size: 14px; padding: 4px; }
@media (prefers-color-scheme: dark) { .toast button { color: #0b7a55; } }

/* ---------------------------------------------------------------- login */
.login {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  background:
    radial-gradient(80% 50% at 50% 0%, var(--accent-soft) 0%, transparent 70%),
    var(--surface);
  overflow-y: auto;
}
body:has(.login) { overflow: auto; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; animation: fadeUp .5s var(--ease) both; }
.login .mark {
  width: 68px; height: 68px; border-radius: 22px; margin-bottom: 10px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #16b07a 0%, #0a6b4b 100%);
  box-shadow: 0 16px 34px -12px rgba(11, 122, 85, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.login .mark svg { width: 32px; height: 32px; }
.login h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.03em; }
.login p { margin: 0 0 10px; color: var(--muted); font-size: 15.5px; }
.pw { position: relative; }
.login input {
  width: 100%; height: 56px; padding: 0 52px 0 18px; border-radius: 16px; border: 0; outline: 0;
  background: var(--surface-2); color: var(--ink); font-size: 17px;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s ease, background-color .2s ease;
}
.login input:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); }
.pw-toggle { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.pw-toggle svg { width: 21px; height: 21px; }
.login .btn-primary { height: 56px; border-radius: 16px; font-size: 16.5px; box-shadow: var(--shadow-fab); }
.login .err { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 600; animation: shake .4s ease; }
.login .err svg { width: 18px; height: 18px; }
.login .foot { margin-top: 10px; text-align: center; font-size: 12.5px; color: var(--faint); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------------------------------------------------------------- hover (mouse only) */
@media (hover: hover) and (pointer: fine) {
  .row:hover { background: var(--surface-2); }
  .row:hover::before, .row:hover + .row::before { opacity: 0; }
  .icon-btn:hover, .key-side:hover { background: var(--surface-2); }
  .key:hover { background: var(--surface-3); }
  .btn-primary:hover, .action.primary:hover { filter: brightness(1.06); }
  .btn-ghost:hover, .action:hover:not(.primary), .me-btn:hover, .status-chip:hover { background: var(--surface-3); }
  .tab:hover:not(.active) .tab-icon { background: var(--surface-2); }
  .cs-ic:hover { background: rgba(255, 255, 255, .16); }
  .cs-btn.on .cs-ic:hover { background: #fff; }
}

/* ---------------------------------------------------------------- wide screens: rail + two floating panels */
@media (min-width: 821px) {
  body { background: var(--bg); }
  .app {
    grid-template-columns: 92px minmax(320px, 380px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 10px; padding: 10px 10px 10px 0;
  }
  .tabbar {
    grid-column: 1; grid-row: 1;
    flex-direction: column; align-items: center; gap: 6px;
    height: auto; padding: 8px 0; background: none; border: 0;
  }
  .tabbar .brand, .tabbar .spacer, .tabbar .rail-only { display: flex; }
  .tabbar .spacer { flex: 1; }
  .brand {
    width: 46px; height: 46px; border-radius: 15px; margin-bottom: 18px; align-items: center; justify-content: center;
    color: #fff; background: linear-gradient(135deg, #16b07a 0%, #0a6b4b 100%);
    box-shadow: 0 10px 22px -10px rgba(11, 122, 85, .8), inset 0 1px 0 rgba(255, 255, 255, .25);
  }
  .brand svg { width: 22px; height: 22px; }
  .tab { flex: none; width: 76px; padding: 6px 0; }
  .tab-icon { width: 56px; }
  .badge { left: calc(50% + 4px); }
  .list, .main { border-radius: 22px; box-shadow: var(--shadow-1); overflow: hidden; }
  .list { grid-column: 2; }
  .main { grid-column: 3; }
  .app[data-tab="keypad"] .main { grid-column: 2 / 4; }
  .back { display: none; }
  .me-btn { display: none; }
  .row { padding-left: 18px; }
  .row.active { background: var(--accent-soft); }
  .row.active + .row::before, .row.active::before { opacity: 0; }
  .fab { right: 18px; bottom: 18px; }
  .toast { bottom: 28px; }
  .call-screen {
    inset: auto 22px 22px auto; width: 380px; height: min(700px, calc(100dvh - 44px));
    border-radius: 30px; box-shadow: 0 40px 90px -24px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .06);
    padding: 0;
  }
  .call-pill { left: auto; right: 22px; top: auto; bottom: 22px; width: 340px; }
  body.pill-on .app { padding-top: 10px; }
  .incoming { background: rgba(4, 8, 6, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); align-items: center; justify-content: center; }
  .in-card { flex: none; width: 400px; min-height: 640px; border-radius: 34px; padding: 30px 24px 30px; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .07); }
  .sheet-panel {
    left: 50%; right: auto; top: 50%; bottom: auto; width: 460px; max-height: calc(100dvh - 64px);
    border-radius: 28px; padding: 22px 22px 24px;
    transform: translate(-50%, -46%) scale(.97); opacity: 0;
    transition: transform .3s var(--ease), opacity .2s ease;
    box-shadow: var(--shadow-float);
  }
  .sheet.show .sheet-panel { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grab { display: none; }
  .keypad-wrap { justify-content: center; }
  .dial-display { flex: none; min-height: 150px; }
}

/* ---------------------------------------------------------------- small phones */
@media (max-width: 360px) {
  .large-title { font-size: 30px; }
  .cs-ic { width: 62px; height: 62px; }
  .cs-pad-keys { gap: 10px 20px; }
}
@media (max-height: 700px) and (max-width: 820px) {
  .cs-avatar, .cs-avatar .avatar { width: 92px; height: 92px; }
  .cs-avatar { margin-bottom: 10px; }
  .cs-controls { gap: 12px 0; }
  .in-avatar, .in-avatar .avatar { width: 104px; height: 104px; }
  .keypad-wrap { --key: clamp(58px, 17vw, 70px); }
  .keys { gap: 10px clamp(18px, 7vw, 28px); }
}

/* ---------------------------------------------------------------- Mac app
   The page runs right up under a see-through title bar; --safe-t keeps
   everything clear of the traffic lights and the drag strip. */
html.mac { --safe-t: var(--mac-titlebar, 28px); }
html.mac .app { padding-top: var(--safe-t); }
html.mac body.pill-on .app { padding-top: calc(62px + var(--safe-t)); }
@media (min-width: 821px) {
  html.mac .app, html.mac body.pill-on .app { padding-top: calc(var(--safe-t) + 2px); }
  html.mac .tabbar { padding-top: 2px; }
  html.mac .call-screen { height: min(700px, calc(100dvh - 44px - var(--safe-t))); }
  html.mac .sheet-panel { max-height: calc(100dvh - 64px - var(--safe-t)); top: calc(50% + var(--safe-t) / 2); }
}
html.mac .login { min-height: 100dvh; }

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .in-avatar .ring { display: none; }
  .cs-halo { transition: none; }
}

/* ---------------------------------------------------------------- company name and logo
   Only the name and logo change from company to company (brands/<BRAND>/); colours and
   fonts stay the same in every copy of the app. */
.brand-tag {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-2); white-space: nowrap;
}
.brand-tag img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 20px 12px; }
.title-row .large-title { margin: 0; min-width: 0; }
.title-row .brand-tag { gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: .05em; color: var(--ink); }
.title-row .brand-tag img { width: 58px; height: 58px; }
/* Folded title while scrolling: the company name stays in view next to the section name */
.compact-title { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.compact-title img { width: 28px; height: 28px; object-fit: contain; }
.compact-title .ct-brand { font-weight: 800; letter-spacing: .05em; font-size: 15px; color: var(--ink); }
.compact-title .ct-dot { color: var(--faint); }
/* Side rail on wide screens: the logo instead of the phone mark */
@media (min-width: 821px) {
  .tabbar .brand {
    width: 64px; height: auto; margin-bottom: 18px; flex-direction: column; gap: 4px;
    background: none; box-shadow: none; color: var(--ink-2); border-radius: 0;
  }
  .tabbar .brand img { width: 56px; height: 56px; object-fit: contain; }
  .tabbar .brand span { font-size: 11px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; color: var(--ink); }
}
.login .mark.logo { width: auto; height: auto; border-radius: 0; background: none; box-shadow: none; margin-bottom: 6px; }
.login .mark.logo img { display: block; width: 72px; height: 72px; object-fit: contain; }
.keypad-brand { display: flex; justify-content: center; margin-bottom: 6px; }
.keypad-brand .brand-tag { gap: 8px; font-size: 16px; font-weight: 800; color: var(--ink); }
.keypad-brand .brand-tag img { width: 42px; height: 42px; }
/* The logo's navy shield lifts off the page: a soft shadow in light mode, a faint glow in dark mode */
.brand-tag img, .compact-title img, .tabbar .brand img, .login .mark.logo img { filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .22)); }
@media (prefers-color-scheme: dark) {
  .brand-tag img, .compact-title img, .tabbar .brand img, .login .mark.logo img {
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55)) drop-shadow(0 0 12px rgba(255, 255, 255, .16));
  }
}
