@font-face {
  font-family: "UCA Sans";
  src: local("SF Pro Text"), local("Inter"), local("Segoe UI");
  font-weight: 100 900;
}

:root {
  --canvas: #f2f5f3;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --surface-warm: #fbfaf6;
  --ink: #14231f;
  --ink-soft: #394a45;
  --muted: #71807a;
  --muted-2: #97a39e;
  --line: #dde5e1;
  --line-soft: #eaf0ed;
  --nav: #11231f;
  --nav-soft: #1a302a;
  --accent: #176858;
  --accent-strong: #0e5043;
  --accent-soft: #e4f2ee;
  --lime: #dff06e;
  --lime-soft: #f3f8c9;
  --amber: #b9771b;
  --amber-soft: #fff4dc;
  --danger: #b64744;
  --danger-soft: #fff0ee;
  --telegram: #2e8bbd;
  --whatsapp: #23845b;
  --signal: #4269d8;
  --sms: #4a9873;
  --email: #b35c42;
  --slack: #785276;
  --discord: #5865f2;
  --wechat: #1a9c50;
  --instagram: #bb477f;
  --shadow-sm: 0 1px 2px rgb(16 35 30 / 4%), 0 4px 14px rgb(16 35 30 / 5%);
  --shadow-md: 0 16px 48px rgb(16 35 30 / 14%), 0 2px 12px rgb(16 35 30 / 7%);
  --shadow-lg: 0 30px 90px rgb(12 28 24 / 24%), 0 5px 20px rgb(12 28 24 / 12%);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-width: 224px;
  --topbar-height: 72px;
  color: var(--ink);
  font-family: "UCA Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas);
}

body {
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
a,
input,
textarea {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(65 148 129 / 32%);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  transform: translateY(-160%);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-md);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 14px 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgb(84 143 124 / 14%), transparent 26%),
    var(--nav);
  color: #dce8e3;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f9fffc;
  text-decoration: none;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 5px 4px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--lime);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 38%);
}

.brand-mark i {
  display: block;
  width: 4px;
  margin: 0 1px;
  border-radius: 4px;
  background: var(--nav);
}

.brand-mark i:nth-child(1) {
  height: 9px;
}

.brand-mark i:nth-child(2) {
  height: 17px;
}

.brand-mark i:nth-child(3) {
  height: 13px;
}

.sidebar-close {
  display: none;
}

.account-switcher {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 13px;
  background: rgb(255 255 255 / 5%);
  color: #f4f9f7;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease;
}

.account-switcher:hover {
  border-color: rgb(255 255 255 / 14%);
  background: rgb(255 255 255 / 9%);
}

.account-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.account-copy strong {
  font-size: 13px;
  font-weight: 700;
}

.account-copy small {
  color: #8fa59e;
  font-size: 11px;
}

.chevron {
  color: var(--muted-2);
  font-size: 13px;
}

.avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #dce5e2;
  color: #203630;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgb(15 36 30 / 6%);
}

.avatar-wesley {
  width: 34px;
  height: 34px;
  background: linear-gradient(145deg, #deefa0, #9ed2ba);
}

.avatar-alex { background: linear-gradient(145deg, #f5c9aa, #df967f); color: #63382c; }
.avatar-mom { background: linear-gradient(145deg, #f1d9e0, #d49baa); color: #673749; }
.avatar-math { background: linear-gradient(145deg, #c6d4f3, #95a9df); color: #2f426f; }
.avatar-john { background: linear-gradient(145deg, #d7e8bf, #abc88b); color: #3b5831; }
.avatar-anthropic { background: linear-gradient(145deg, #ead5c3, #cfae92); color: #5c4434; }
.avatar-maya { background: linear-gradient(145deg, #d8cdf1, #af9bd9); color: #49376a; }
.avatar-team { background: linear-gradient(145deg, #bee6de, #82bdaf); color: #285a50; }
.avatar-sienna { background: linear-gradient(145deg, #f1c8b7, #d8977d); color: #683729; }
.avatar-sienna-alt { background: linear-gradient(145deg, #edc2ac, #c98268); color: #5b2d21; }
.avatar-fedex { background: linear-gradient(145deg, #e0cdf1, #bca0dc); color: #4d3569; }

.avatar-small {
  width: 34px;
  height: 34px;
  font-size: 10px;
}

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 17px;
}

.nav-label {
  padding: 0 10px 5px;
  color: #6f8980;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-label-spaced {
  padding-top: 17px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  gap: 10px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: #a9bcb5;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: color 150ms ease, background 150ms ease;
}

.nav-item:hover {
  background: rgb(255 255 255 / 5%);
  color: #eff7f4;
}

.nav-item.is-active {
  background: #254039;
  color: #f4fff9;
}

.nav-item.is-active .nav-icon {
  color: var(--lime);
}

.nav-icon {
  display: inline-grid;
  width: 19px;
  place-items: center;
  color: #829c93;
  font-size: 18px;
  font-weight: 400;
}

.nav-count {
  min-width: 23px;
  height: 21px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--lime);
  color: #26331e;
  font-size: 10px;
  font-weight: 800;
  line-height: 21px;
  text-align: center;
}

.nav-item kbd {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 5px;
  background: rgb(0 0 0 / 12%);
  color: #779188;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
}

.health-dot,
.mobile-alert {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 50%;
  background: #e4a64c;
  box-shadow: 0 0 0 3px rgb(228 166 76 / 12%);
}

.sidebar-spacer {
  flex: 1;
}

.privacy-card {
  padding: 13px;
  border: 1px solid rgb(213 237 226 / 9%);
  border-radius: 13px;
  background: rgb(213 237 226 / 5%);
}

.privacy-card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d9e9e3;
  font-size: 11px;
}

.privacy-shield {
  color: var(--lime);
  font-size: 9px;
}

.privacy-card p {
  padding: 7px 0 9px;
  color: #82998f;
  font-size: 10px;
  line-height: 1.5;
}

.privacy-card button {
  padding: 0;
  background: transparent;
  color: #b8d2c8;
  font-size: 10px;
  font-weight: 700;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 13px 8px 0;
  color: #c9d8d3;
}

.sync-status > span:last-child {
  display: flex;
  flex-direction: column;
}

.sync-status strong {
  font-size: 10px;
  font-weight: 700;
}

.sync-status small {
  color: #738b82;
  font-size: 9px;
}

.sync-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6ed69f;
}

.sync-pulse::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgb(110 214 159 / 35%);
  border-radius: inherit;
  content: "";
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(0.5); }
  80%, 100% { opacity: 0; transform: scale(1.5); }
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--canvas);
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  flex: 0 0 var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(16px);
}

.topbar-leading,
.topbar-actions {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-actions {
  gap: 9px;
}

.page-heading h1 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.page-heading p {
  padding-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.mobile-menu,
.mobile-brand {
  display: none;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 17px;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-button:active {
  transform: scale(0.95);
}

.search-trigger {
  display: flex;
  align-items: center;
  width: clamp(180px, 23vw, 286px);
  height: 38px;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.search-trigger:hover {
  border-color: #c8d4cf;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.search-trigger > span:first-child {
  color: var(--ink-soft);
  font-size: 17px;
}

.search-trigger-label {
  flex: 1;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-trigger kbd,
.search-header kbd {
  padding: 2px 6px;
  border: 1px solid #d7dfdb;
  border-radius: 5px;
  background: #fff;
  color: #8a9792;
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  box-shadow: 0 1px 1px rgb(16 35 30 / 5%);
}

.quiet-button,
.dark-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 7px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 750;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.quiet-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}

.quiet-button:hover {
  border-color: #c7d3ce;
  background: var(--surface-soft);
}

.dark-button {
  background: var(--ink);
  color: #fff;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 12px rgb(23 104 88 / 15%);
}

.primary-button:hover {
  background: var(--accent-strong);
  box-shadow: 0 7px 16px rgb(23 104 88 / 21%);
}

.primary-button:active,
.quiet-button:active,
.dark-button:active {
  transform: translateY(1px);
}

.spark {
  color: #8a6a1c;
}

.view-stack {
  position: relative;
  flex: 1;
  min-height: 0;
}

.app-view {
  width: 100%;
  height: 100%;
}

.app-view[hidden] {
  display: none !important;
}

.inbox-view {
  display: grid;
  grid-template-columns: clamp(310px, 29vw, 370px) minmax(0, 1fr);
  min-height: 0;
}

.conversation-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.rail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 18px 13px;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.eyebrow {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #eaf6ee;
  color: #3d7d5e;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #45ad77;
}

.rail-header h2,
.section-intro h2 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.compact-compose {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 20px;
}

.filter-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
  padding: 0 17px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  height: 29px;
  flex: 0 0 auto;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.filter-tab:hover {
  border-color: var(--line);
  color: var(--ink-soft);
}

.filter-tab.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.filter-tab span {
  color: inherit;
  opacity: 0.75;
}

.conversation-list {
  flex: 1;
  min-height: 0;
  padding: 0 8px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conversation-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  width: 100%;
  min-height: 76px;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease;
}

.conversation-item:hover {
  background: var(--surface-soft);
}

.conversation-item.is-selected {
  border-color: #dbe8e3;
  background: #edf5f2;
}

.conversation-item.is-selected::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: -8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  content: "";
}

.conversation-avatar-wrap {
  position: relative;
}

.platform-pin {
  position: absolute;
  right: -2px;
  bottom: -1px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 6px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.conversation-copy {
  min-width: 0;
}

.conversation-title-line,
.conversation-preview-line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.conversation-title-line {
  gap: 5px;
}

.conversation-title-line strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview-line {
  gap: 5px;
  padding-top: 3px;
  color: var(--muted);
}

.conversation-preview-line p {
  flex: 1;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item.is-unread .conversation-preview-line p {
  color: var(--ink-soft);
  font-weight: 650;
}

.conversation-platforms {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 3px;
  padding-top: 6px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 650;
}

.conversation-platforms span {
  display: inline-flex;
  align-items: center;
  max-width: 82px;
  gap: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-platforms i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.conversation-meta {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 9px;
  padding-top: 1px;
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
}

.unread-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 850;
}

.priority-indicator {
  color: #cb882a;
  font-size: 9px;
}

.verified-mark {
  display: inline-grid;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.list-skeleton {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 76px;
  padding: 11px 10px;
}

.list-skeleton i,
.list-skeleton b {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef2f0 20%, #f8faf9 50%, #eef2f0 80%);
  background-size: 240% 100%;
  animation: shimmer 1.4s linear infinite;
}

.list-skeleton i {
  width: 43px;
  height: 43px;
  border-radius: 50%;
}

.list-skeleton span {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.list-skeleton b:first-child { width: 45%; height: 9px; }
.list-skeleton b:last-child { width: 82%; height: 7px; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.empty-state {
  display: grid;
  min-height: 240px;
  padding: 30px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state span {
  display: block;
  padding-bottom: 8px;
  color: #9aaba4;
  font-size: 28px;
}

.empty-state strong {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state p {
  padding-top: 4px;
  font-size: 10px;
}

.conversation-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 65% 12%, rgb(210 235 225 / 28%), transparent 24%),
    var(--surface-soft);
}

.conversation-header {
  display: flex;
  flex: 0 0 65px;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 90%);
  backdrop-filter: blur(14px);
}

.person-summary {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 3px 5px 3px 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.person-summary:hover .person-name-line strong {
  color: var(--accent);
}

.person-summary .avatar {
  width: 38px;
  height: 38px;
}

.person-summary-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.person-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.person-name-line strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 150ms ease;
}

.person-summary-copy small {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 1px;
  color: var(--muted);
  font-size: 9px;
}

.presence-online {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3eb979;
}

.presence-away { background: #db9d43; }
.presence-offline { background: #97a39e; }
.presence-unknown { background: transparent; border: 1px solid #97a39e; }

.conversation-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.conversation-actions .icon-button {
  width: 33px;
  height: 33px;
  color: var(--muted);
  font-size: 15px;
}

.mobile-back {
  display: none;
}

.identity-context {
  display: flex;
  flex: 0 0 47px;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(247 250 248 / 86%);
}

.identity-stack {
  display: flex;
  padding-left: 5px;
}

.identity-chip {
  display: grid;
  width: 22px;
  height: 22px;
  margin-left: -5px;
  place-items: center;
  border: 2px solid #f7faf8;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 6px;
  font-weight: 900;
}

.identity-context p {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.identity-context p strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
}

.identity-context p span {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-context > button {
  margin-left: auto;
  padding: 3px;
  background: transparent;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
}

.message-timeline {
  flex: 1;
  min-height: 0;
  padding: 24px clamp(20px, 5vw, 72px) 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.timeline-loading {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.timeline-loading span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: loading-dot 1.2s ease-in-out infinite;
}

.timeline-loading span:nth-child(2) { animation-delay: 150ms; }
.timeline-loading span:nth-child(3) { animation-delay: 300ms; }

@keyframes loading-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.date-divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 2px 0 18px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.date-divider::before,
.date-divider::after {
  flex: 1;
  height: 1px;
  background: var(--line);
  content: "";
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 0 14px;
}

.message-row.is-outgoing {
  justify-content: flex-end;
}

.message-row + .message-row.is-continuation {
  margin-top: -8px;
}

.message-sender-avatar {
  width: 27px;
  height: 27px;
  font-size: 8px;
}

.message-block {
  display: flex;
  max-width: min(72%, 610px);
  flex-direction: column;
  align-items: flex-start;
}

.is-outgoing .message-block {
  align-items: flex-end;
}

.message-source {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 3px 4px;
  color: var(--muted);
  font-size: 8px;
}

.message-source i,
.platform-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.platform-telegram-text { color: var(--telegram); }
.platform-whatsapp-text { color: var(--whatsapp); }
.platform-signal-text { color: var(--signal); }
.platform-sms-text { color: var(--sms); }
.platform-email-text { color: var(--email); }
.platform-slack-text { color: var(--slack); }
.platform-discord-text { color: var(--discord); }
.platform-wechat-text { color: var(--wechat); }
.platform-instagram-text { color: var(--instagram); }

.message-bubble {
  position: relative;
  min-width: 72px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 5px 15px 15px 15px;
  background: #fff;
  color: var(--ink-soft);
  box-shadow: 0 1px 1px rgb(16 35 30 / 3%);
  font-size: 11px;
  line-height: 1.48;
  white-space: pre-wrap;
  word-break: break-word;
}

.is-outgoing .message-bubble {
  border-color: #1d6154;
  border-radius: 15px 5px 15px 15px;
  background: #1f6b5d;
  color: #f7fffc;
}

.message-bubble.is-failed {
  border-color: #e7c3c0;
  background: var(--danger-soft);
  color: #6e3432;
}

.message-bubble.is-pending {
  opacity: 0.72;
}

.message-meta-line {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 3px 0;
  color: var(--muted-2);
  font-size: 7px;
}

.message-status-failed {
  color: var(--danger);
  font-weight: 750;
}

.message-status-sent {
  color: var(--accent);
}

.message-reaction {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  margin-top: -4px;
  margin-left: 8px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  font-size: 9px;
  box-shadow: var(--shadow-sm);
}

.attachment-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 245px;
  gap: 9px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 10px;
  background: rgb(255 255 255 / 12%);
}

.is-incoming .attachment-card {
  border-color: var(--line-soft);
  background: var(--surface-soft);
}

.file-icon {
  display: grid;
  width: 34px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 8px;
  font-weight: 850;
}

.attachment-card p {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.attachment-card p strong {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-card p small {
  padding-top: 2px;
  color: inherit;
  font-size: 7px;
  opacity: 0.7;
}

.attachment-card > span:last-child {
  font-size: 14px;
}

.route-change-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.route-change-divider span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 75%);
  color: var(--muted);
  font-size: 7px;
}

.compose-area {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: 0 clamp(16px, 4vw, 54px) 10px;
  background: linear-gradient(to bottom, rgb(247 249 248 / 0%), #f7f9f8 18%);
}

.route-preview {
  display: flex;
  align-items: center;
  min-height: 41px;
  gap: 12px;
  margin: 0 6px;
  padding: 0 2px;
}

.route-preview-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 9px;
  background: transparent;
  text-align: left;
}

.route-preview-main:hover {
  background: #eef4f1;
}

.route-preview-main > span:nth-child(2) {
  display: flex;
  flex-direction: column;
}

.route-preview-main small {
  color: var(--muted);
  font-size: 7px;
}

.route-preview-main strong {
  color: var(--ink-soft);
  font-size: 9px;
}

.route-preview-main strong i {
  color: var(--muted-2);
  font-style: normal;
}

.route-preview-main strong em {
  color: var(--accent);
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
}

.route-auto-mark,
.manual-mark {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--lime-soft);
  color: #536622;
  font-size: 9px;
  font-weight: 900;
}

.manual-mark {
  background: #eef2f1;
  color: var(--muted);
}

.route-reason {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted);
  font-size: 7px;
}

.route-reason i {
  color: var(--accent);
  font-size: 6px;
}

.composer {
  display: flex;
  align-items: flex-end;
  min-height: 52px;
  gap: 3px;
  padding: 7px;
  border: 1px solid #d1ddd8;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 24px rgb(16 35 30 / 8%);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer:focus-within {
  border-color: #85aa9f;
  box-shadow: 0 7px 26px rgb(16 35 30 / 10%), 0 0 0 3px rgb(52 133 114 / 9%);
}

.composer-tools,
.composer-actions {
  display: flex;
  align-items: center;
}

.composer .icon-button {
  width: 35px;
  height: 35px;
  color: var(--muted);
}

.composer textarea {
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  flex: 1;
  resize: none;
  padding: 9px 4px 7px;
  overflow-y: auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: #a1ada8;
}

.send-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  transition: background 150ms ease, transform 150ms ease;
}

.send-button:hover {
  background: var(--accent-strong);
}

.send-button:active {
  transform: scale(0.94);
}

.composer-disclaimer {
  padding-top: 5px;
  color: var(--muted-2);
  font-size: 7px;
  text-align: center;
}

.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px 20px;
}

.section-intro .eyebrow {
  display: inline-block;
  padding-bottom: 5px;
}

.section-intro h2 {
  font-size: 26px;
}

.section-intro p {
  padding-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.inline-search {
  display: flex;
  align-items: center;
  width: 210px;
  height: 38px;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
}

.inline-search input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 10px;
}

.directory-view,
.connections-view,
.settings-view {
  min-height: 0;
  overflow-y: auto;
}

.identity-review {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 30px 18px;
  padding: 13px 15px;
  border: 1px solid #e8ddb6;
  border-radius: 14px;
  background: #fffbeb;
}

.identity-review-avatars {
  display: flex;
  padding-left: 8px;
}

.identity-review-avatars .avatar {
  margin-left: -8px;
  border: 2px solid #fffbeb;
}

.identity-review strong {
  color: #58481e;
  font-size: 11px;
}

.identity-review p {
  padding-top: 2px;
  color: #8a7540;
  font-size: 9px;
}

.identity-review-actions {
  display: flex;
  gap: 7px;
}

.identity-review .quiet-button,
.identity-review .dark-button {
  min-height: 34px;
}

.contacts-layout {
  display: grid;
  grid-template-columns: minmax(460px, 1fr) 330px;
  gap: 16px;
  min-height: 0;
  padding: 0 30px 30px;
}

.contact-list-panel,
.contact-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.contact-list-panel {
  min-width: 0;
  padding: 16px;
}

.contact-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 13px;
  color: var(--muted);
  font-size: 9px;
}

.contact-list-meta button {
  padding: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.contact-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface-soft);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.contact-card:hover,
.contact-card.is-selected {
  border-color: #c5d8d1;
  background: #eef6f3;
}

.contact-card:active { transform: scale(0.99); }

.contact-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.contact-card-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-card-copy small {
  padding-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.mini-platform-stack {
  display: flex;
}

.mini-platform-stack span {
  display: grid;
  width: 19px;
  height: 19px;
  margin-left: -4px;
  place-items: center;
  border: 2px solid var(--surface-soft);
  border-radius: 50%;
  color: #fff;
  font-size: 5px;
  font-weight: 900;
}

.contact-detail {
  align-self: start;
  min-height: 480px;
  overflow: hidden;
}

.contact-detail-hero {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 25px 20px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(160deg, #f5faf8, #fff 70%);
  text-align: center;
}

.contact-detail-hero .avatar {
  width: 66px;
  height: 66px;
  font-size: 17px;
  box-shadow: 0 5px 16px rgb(16 35 30 / 10%);
}

.contact-detail-hero h3 {
  padding-top: 10px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.contact-detail-hero p {
  color: var(--muted);
  font-size: 9px;
}

.contact-actions {
  display: flex;
  gap: 8px;
  padding-top: 13px;
}

.contact-actions button {
  min-height: 32px;
}

.contact-detail-section {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.contact-detail-section:last-child { border-bottom: 0; }

.contact-detail-section > strong {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
}

.identity-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.network-badge {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 6px;
  font-weight: 900;
}

.identity-row p {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.identity-row p strong {
  font-size: 9px;
}

.identity-row p small {
  overflow: hidden;
  color: var(--muted);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-row > small {
  color: var(--muted-2);
  font-size: 7px;
}

.platform-telegram { background: var(--telegram); }
.platform-whatsapp { background: var(--whatsapp); }
.platform-signal { background: var(--signal); }
.platform-sms { background: var(--sms); }
.platform-email { background: var(--email); }
.platform-gmail { background: var(--email); }
.platform-slack { background: var(--slack); }
.platform-discord { background: var(--discord); }
.platform-wechat { background: var(--wechat); }
.platform-instagram { background: var(--instagram); }
.platform-teams { background: #5c62b9; }

.connection-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 0.55fr)) minmax(250px, 1.4fr);
  gap: 10px;
  padding: 0 30px 18px;
}

.overview-stat,
.overview-sync {
  display: flex;
  align-items: center;
  min-height: 72px;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.overview-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
}

.overview-icon.success { background: var(--accent-soft); color: var(--accent); }
.overview-icon.realtime { background: #eef0fb; color: #5d6ba8; }
.overview-icon.attention { background: var(--amber-soft); color: var(--amber); }

.overview-stat p,
.overview-sync p {
  display: flex;
  flex-direction: column;
}

.overview-stat strong {
  font-size: 19px;
  line-height: 1.1;
}

.overview-stat small,
.overview-sync small {
  color: var(--muted);
  font-size: 8px;
}

.overview-sync .sync-pulse {
  margin: 0 5px;
}

.overview-sync strong {
  font-size: 10px;
}

.overview-sync .quiet-button {
  min-height: 32px;
  margin-left: auto;
}

.connector-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 30px 13px;
}

.segmented-control {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #eaefed;
}

.segmented-control button {
  height: 29px;
  padding: 0 11px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.segmented-control button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.connector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 11px;
  padding: 0 30px 30px;
}

.connector-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.connector-card:hover {
  transform: translateY(-1px);
  border-color: #c9d6d1;
  box-shadow: 0 7px 22px rgb(16 35 30 / 7%);
}

.connector-card.is-attention {
  border-color: #ead9b6;
}

.connector-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connector-logo {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.connector-card-top p {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.connector-card-top strong {
  font-size: 11px;
}

.connector-card-top small {
  overflow: hidden;
  padding-top: 1px;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.attention { background: var(--amber-soft); color: var(--amber); }
.status-pill.available { background: #f0f2f1; color: var(--muted); }
.status-pill.handoff { background: #eef0fb; color: #606da5; }
.status-pill.disabled { background: var(--danger-soft); color: var(--danger); }

.connector-capabilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  padding: 13px 0 12px;
}

.capability {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}

.capability strong {
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.capability .yes { color: var(--accent); }
.capability .no { color: var(--muted-2); }

.connector-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.connector-card-footer p {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 7px;
}

.connector-card-footer p strong {
  color: var(--ink-soft);
  font-size: 8px;
}

.connector-card-footer button {
  padding: 5px;
  background: transparent;
  color: var(--accent);
  font-size: 8px;
  font-weight: 750;
}

.settings-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 700px);
  align-items: start;
  gap: 16px;
  padding: 0 30px 30px;
}

.settings-nav,
.settings-content {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
}

.settings-nav button {
  min-height: 39px;
  padding: 0 11px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
  text-align: left;
}

.settings-nav button:hover { background: var(--surface-soft); }

.settings-nav button.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 750;
}

.settings-content {
  min-width: 0;
  overflow: hidden;
}

.settings-panel-header {
  padding: 21px;
  border-bottom: 1px solid var(--line-soft);
}

.settings-panel-header h3 {
  font-size: 15px;
}

.settings-panel-header p {
  padding-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.settings-group {
  padding: 6px 21px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 65px;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.setting-row:last-child { border-bottom: 0; }

.setting-row > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.setting-row strong {
  font-size: 10px;
}

.setting-row small {
  max-width: 470px;
  padding-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  position: relative;
  width: 36px;
  height: 21px;
  border-radius: 11px;
  background: #cdd6d2;
  transition: background 170ms ease;
}

.toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(16 35 30 / 25%);
  content: "";
  transition: transform 170ms ease;
}

.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(15px); }
.toggle input:focus-visible + span { outline: 3px solid rgb(65 148 129 / 32%); outline-offset: 2px; }

.settings-select {
  min-width: 150px;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 650;
}

.settings-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 15px 21px 21px;
  padding: 11px;
  border: 1px solid #e9dcbb;
  border-radius: 11px;
  background: var(--amber-soft);
  color: #806329;
}

.settings-warning > span { font-size: 11px; }

.settings-warning p {
  display: flex;
  flex-direction: column;
  font-size: 8px;
}

.settings-warning strong { font-size: 9px; }

.mobile-nav {
  display: none;
}

.modal {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.modal::backdrop {
  background: rgb(10 24 20 / 48%);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modal-in 170ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-card {
  width: min(92vw, 510px);
  max-height: min(82vh, 760px);
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 21px 14px;
}

.modal-header h2 {
  padding-top: 3px;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.search-card {
  width: min(94vw, 680px);
}

.search-header {
  display: flex;
  align-items: center;
  height: 61px;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.search-header > span {
  color: var(--muted);
  font-size: 22px;
}

.search-header input {
  min-width: 0;
  height: 100%;
  flex: 1;
  border: 0;
  font-size: 14px;
}

.search-header input::placeholder { color: #98a59f; }

.search-header .modal-close {
  display: none;
}

.search-tips {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 43px;
  padding: 0 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 8px;
}

.search-tips button {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7px;
}

.search-results {
  min-height: 300px;
  max-height: 520px;
  padding: 9px;
  overflow-y: auto;
}

.search-empty {
  display: grid;
  min-height: 285px;
  place-content: center;
  color: var(--muted);
  text-align: center;
}

.search-empty > span {
  display: grid;
  width: 43px;
  height: 43px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 19px;
}

.search-empty strong { color: var(--ink-soft); font-size: 11px; }
.search-empty p { max-width: 300px; padding-top: 4px; font-size: 9px; }

.search-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-group-title span { color: var(--muted-2); font-weight: 650; }

.search-result-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px;
  border-radius: 11px;
  background: transparent;
  text-align: left;
}

.search-result-item:hover { background: var(--surface-soft); }

.search-result-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.search-result-copy strong { font-size: 10px; }
.search-result-copy p { overflow: hidden; padding-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy mark { background: #f2efad; color: inherit; }
.search-result-meta { color: var(--muted-2); font-size: 7px; text-align: right; }

.new-message-card {
  width: min(92vw, 540px);
  min-height: 430px;
}

.recipient-field {
  display: flex;
  align-items: center;
  min-height: 51px;
  gap: 11px;
  margin: 0 20px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.recipient-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.recipient-field input {
  min-width: 0;
  height: 45px;
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.recipient-results {
  padding: 13px 20px 20px;
}

.recipient-hint {
  padding: 4px 2px 9px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recipient-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 9px;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.recipient-item:hover { background: var(--surface-soft); }
.recipient-item-copy { display: flex; min-width: 0; flex-direction: column; }
.recipient-item-copy strong { font-size: 11px; }
.recipient-item-copy small { color: var(--muted); font-size: 8px; }
.recipient-route-count { color: var(--accent); font-size: 8px; font-weight: 700; }

.route-card {
  width: min(92vw, 470px);
  padding-bottom: 18px;
}

.route-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 20px 17px;
}

.route-mode > button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
}

.route-mode > button.is-active {
  border-color: #95b8ad;
  background: #f0f7f4;
  box-shadow: 0 0 0 2px rgb(23 104 88 / 7%);
}

.route-mode > button > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.route-mode strong { font-size: 9px; }
.route-mode small { color: var(--muted); font-size: 7px; line-height: 1.35; }
.route-mode > button > i { color: var(--accent); font-size: 10px; font-style: normal; }

.route-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 21px 8px;
  color: var(--muted);
  font-size: 8px;
}

.route-list-heading strong { color: var(--ink-soft); }
.route-list-heading small { color: var(--muted-2); font-size: 7px; }

.route-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 20px;
}

.route-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 17px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: left;
}

.route-option:hover { border-color: var(--line); }
.route-option.is-selected { border-color: #9dbeb4; background: #edf6f3; }

.route-option .network-badge { width: 32px; height: 32px; border-radius: 10px; }

.route-option-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.route-option-copy strong { font-size: 10px; }
.route-option-copy small { color: var(--muted); font-size: 7px; }
.route-score { display: flex; align-items: flex-end; flex-direction: column; }
.route-score strong { color: var(--accent); font-size: 9px; }
.route-score small { color: var(--muted-2); font-size: 7px; }

.radio-mark {
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid #b9c7c2;
  border-radius: 50%;
  background: #fff;
}

.route-option.is-selected .radio-mark {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px var(--accent);
}

.route-consent-note,
.ai-policy-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 14px 20px;
  padding: 10px;
  border-radius: 11px;
  background: var(--lime-soft);
  color: #5b6929;
}

.route-consent-note > span,
.ai-policy-note > span { padding-top: 2px; font-size: 7px; }

.route-consent-note p,
.ai-policy-note p { display: flex; flex-direction: column; }
.route-consent-note strong,
.ai-policy-note strong { font-size: 8px; }
.route-consent-note small,
.ai-policy-note small { padding-top: 2px; color: #75804c; font-size: 7px; }

.route-done {
  width: calc(100% - 40px);
  margin: 0 20px;
}

.consent-card {
  width: min(92vw, 430px);
  padding: 25px;
  text-align: center;
}

.consent-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 17px;
}

.consent-illustration .network-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  font-size: 8px;
}

.consent-illustration i {
  color: var(--muted-2);
  font-style: normal;
}

.consent-card h2 {
  padding-top: 5px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.consent-card > p:not(.consent-footnote) {
  max-width: 350px;
  margin: 7px auto 17px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.consent-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: left;
}

.consent-details span {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
}

.consent-details span + span { border-left: 1px solid var(--line); }
.consent-details small { color: var(--muted); font-size: 7px; }
.consent-details strong { padding-top: 2px; font-size: 9px; }

.remember-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 3px;
  color: var(--ink-soft);
  font-size: 8px;
  text-align: left;
}

.remember-choice input { accent-color: var(--accent); }

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.consent-footnote {
  padding-top: 10px;
  color: var(--muted-2);
  font-size: 7px;
}

.catch-up-card {
  width: min(92vw, 570px);
}

.catch-up-intro {
  padding: 0 21px 12px;
  color: var(--muted);
  font-size: 10px;
}

.catch-up-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}

.catch-up-list li {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface-soft);
}

.priority-index {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9px;
  font-weight: 850;
}

.catch-up-list strong { font-size: 9px; }
.catch-up-list p { padding-top: 2px; color: var(--muted); font-size: 7px; }
.catch-up-list button { padding: 5px; background: transparent; color: var(--accent); font-size: 8px; font-weight: 750; }

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: flex;
  width: min(350px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 13px;
  background: #173029;
  color: #f7fffc;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 200ms ease-out;
}

.toast.is-error { background: #663936; }

.toast > span:first-child {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: rgb(255 255 255 / 10%);
  font-size: 11px;
}

.toast p { display: flex; flex-direction: column; }
.toast strong { font-size: 9px; }
.toast small { padding-top: 1px; color: #a9beb6; font-size: 7px; }
.toast button { background: transparent; color: #cee2da; font-size: 14px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sidebar-scrim { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 205px; }
  .catch-up-button { width: 38px; padding: 0; }
  .catch-up-button:not(:focus) { font-size: 0; }
  .catch-up-button .spark { font-size: 13px; }
  .connector-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .connection-overview { grid-template-columns: repeat(3, 1fr); }
  .overview-sync { grid-column: 1 / -1; }
  .contacts-layout { grid-template-columns: minmax(400px, 1fr) 290px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  :root { --topbar-height: 64px; }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(82vw, 280px);
    transform: translateX(-105%);
    box-shadow: var(--shadow-lg);
    transition: transform 220ms cubic-bezier(.22, .8, .3, 1);
  }

  .app-shell.is-sidebar-open .sidebar { transform: translateX(0); }

  .sidebar-scrim {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    background: rgb(11 28 23 / 45%);
    backdrop-filter: blur(3px);
  }

  .sidebar-scrim[hidden] { display: none; }
  .sidebar-close { display: grid; color: #b9ccc5; }

  .workspace { height: 100dvh; }

  .topbar {
    padding: 0 16px;
  }

  .mobile-menu {
    display: grid;
    margin-right: 7px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .mobile-brand .brand-mark { width: 25px; height: 25px; border-radius: 8px; }
  .mobile-brand .brand-mark i:nth-child(1) { height: 8px; }
  .mobile-brand .brand-mark i:nth-child(2) { height: 14px; }
  .mobile-brand .brand-mark i:nth-child(3) { height: 11px; }
  .mobile-brand strong { font-size: 16px; letter-spacing: 0.08em; }
  .page-heading { display: none; }
  .search-trigger { width: 38px; justify-content: center; padding: 0; }
  .search-trigger-label,
  .search-trigger kbd { display: none; }

  .inbox-view {
    grid-template-columns: 330px minmax(0, 1fr);
  }

  .message-timeline { padding-right: 30px; padding-left: 30px; }
  .compose-area { padding-right: 24px; padding-left: 24px; }

  .contacts-layout { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-detail { display: none; }
  .settings-layout { grid-template-columns: 190px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  :root { --mobile-nav-height: 65px; }

  .workspace {
    padding-bottom: var(--mobile-nav-height);
  }

  .topbar {
    flex: 0 0 58px;
    padding: 0 11px;
  }

  .topbar-actions { gap: 5px; }
  .topbar .quiet-button { width: 36px; min-height: 36px; }
  .topbar .primary-button { width: 38px; min-height: 38px; padding: 0; border-radius: 11px; }
  .new-message-label { display: none; }

  .view-stack { min-height: 0; }

  .inbox-view {
    position: relative;
    display: block;
    overflow: hidden;
  }

  .conversation-rail,
  .conversation-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 100%;
  }

  .conversation-rail {
    border-right: 0;
    transform: translateX(0);
    transition: transform 220ms cubic-bezier(.22, .8, .3, 1);
  }

  .conversation-panel {
    z-index: 2;
    display: none;
    transform: none;
  }

  .inbox-view.mobile-conversation-open .conversation-rail { display: none; transform: none; }
  .inbox-view.mobile-conversation-open .conversation-panel { display: flex; transform: none; }

  .rail-header { padding: 17px 16px 11px; }
  .rail-header h2 { font-size: 21px; }
  .filter-tabs { padding-right: 15px; padding-left: 15px; }
  .conversation-list { padding-right: 7px; padding-left: 7px; }

  .conversation-item {
    min-height: 73px;
    padding: 10px 9px;
  }

  .conversation-item.is-selected::before { display: none; }
  .conversation-item.is-selected { border-color: transparent; background: transparent; }
  .conversation-item:active { background: var(--surface-soft); }

  .mobile-back { display: grid; }
  .conversation-header { flex: 0 0 58px; padding: 0 9px; }
  .person-summary .avatar { width: 35px; height: 35px; }
  .conversation-actions { gap: 0; }
  .conversation-actions .icon-button { width: 31px; }
  #conversation-search { display: none; }

  .identity-context { flex: 0 0 43px; padding: 0 13px; }
  .identity-context > button { display: none; }

  .message-timeline { padding: 18px 13px 12px; }
  .message-block { max-width: 84%; }
  .message-bubble { font-size: 11px; }

  .compose-area { padding: 0 10px 7px; }
  .route-preview { min-height: 38px; margin: 0 3px; }
  .route-reason { display: none; }
  .composer { min-height: 49px; border-radius: 15px; }
  .emoji-button { display: none !important; }
  .composer-disclaimer { display: none; }

  .section-intro {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 16px 15px;
  }

  .section-intro h2 { font-size: 23px; }
  .section-intro p { font-size: 10px; }
  .section-actions { width: 100%; }
  .section-actions .inline-search { flex: 1; width: auto; }
  .section-actions .primary-button { flex: 0 0 auto; }

  .identity-review {
    grid-template-columns: auto minmax(0, 1fr);
    margin: 0 16px 14px;
    padding: 12px;
  }

  .identity-review-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .contacts-layout { padding: 0 16px 20px; }
  .contact-list-panel { padding: 11px; }
  .contact-grid { grid-template-columns: 1fr; }

  .connection-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 0 16px 14px;
  }

  .overview-stat {
    align-items: flex-start;
    min-height: 87px;
    flex-direction: column;
    gap: 8px;
    padding: 11px;
  }

  .overview-icon { width: 28px; height: 28px; border-radius: 9px; }
  .overview-stat strong { font-size: 16px; }
  .overview-sync { grid-column: 1 / -1; min-height: 61px; }

  .connector-toolbar {
    align-items: stretch;
    flex-direction: column;
    padding: 0 16px 12px;
  }

  .segmented-control { overflow-x: auto; }
  .segmented-control button { flex: 1 0 auto; }
  .connector-toolbar .inline-search { width: 100%; }
  .connector-grid { grid-template-columns: 1fr; padding: 0 16px 22px; }

  .settings-layout {
    display: block;
    padding: 0 16px 20px;
  }

  .settings-nav {
    flex-direction: row;
    margin-bottom: 10px;
    overflow-x: auto;
    border-radius: 13px;
    scrollbar-width: none;
  }

  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav button { flex: 0 0 auto; white-space: nowrap; }
  .setting-row { gap: 10px; }
  .settings-select { min-width: 125px; }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: var(--mobile-nav-height);
    grid-template-columns: repeat(5, 1fr);
    padding: 5px max(7px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgb(255 255 255 / 96%);
    box-shadow: 0 -8px 30px rgb(16 35 30 / 5%);
    backdrop-filter: blur(18px);
  }

  .mobile-nav button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    background: transparent;
    color: var(--muted);
  }

  .mobile-nav button > span { font-size: 18px; line-height: 1; }
  .mobile-nav button small { font-size: 7px; font-weight: 700; }
  .mobile-nav button.is-active { color: var(--accent); }
  .mobile-nav button > i:not(.mobile-alert) {
    position: absolute;
    top: 2px;
    left: calc(50% + 7px);
    display: grid;
    min-width: 16px;
    height: 16px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 6px;
    font-style: normal;
    font-weight: 800;
  }

  .mobile-nav .mobile-alert {
    position: absolute;
    top: 3px;
    left: calc(50% + 8px);
    margin: 0;
  }

  .mobile-nav .mobile-compose {
    width: 46px;
    height: 46px;
    align-self: center;
    justify-self: center;
    border-radius: 15px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 7px 17px rgb(23 104 88 / 25%);
  }

  .mobile-nav .mobile-compose > span { font-size: 25px; }

  .modal-card { max-height: min(86dvh, 760px); }
  .search-modal { margin: 10px auto auto; }
  .search-card { width: calc(100vw - 20px); border-radius: 17px; }
  .search-header kbd { display: none; }
  .search-header .modal-close { display: grid; }
  .search-results { max-height: calc(86dvh - 105px); }
  .route-mode { grid-template-columns: 1fr; }
  .route-card { max-height: 91dvh; }
  .route-option { min-height: 51px; }

  .toast-region {
    right: 10px;
    bottom: calc(var(--mobile-nav-height) + 10px);
    width: calc(100vw - 20px);
  }
}

@media (max-width: 390px) {
  .mobile-brand strong { display: none; }
  .conversation-actions #conversation-info { display: none; }
  .identity-context p span { max-width: 175px; }
  .attachment-card { min-width: 220px; }
  .identity-review-actions { display: grid; grid-template-columns: repeat(2, 1fr); }
  .section-actions .primary-button { width: 42px; padding: 0; font-size: 0; }
  .section-actions .primary-button::first-letter { font-size: 14px; }
  .connection-overview { grid-template-columns: repeat(3, 1fr); }
  .overview-stat { padding: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --line: #a7b5af; --line-soft: #cfd9d5; --muted: #53625c; }
  .conversation-item.is-selected { border-width: 2px; }
}
