:root {
  color-scheme: light;
  --bg: #eef7f4;
  --panel: #ffffff;
  --panel-soft: #f7fcfa;
  --line: #d7e7e2;
  --text: #12221f;
  --muted: #687873;
  --brand: #0b8f87;
  --brand-dark: #08746e;
  --brand-soft: #dff7f3;
  --danger: #c44a29;
  --danger-soft: #fff0e9;
  --warn: #a56a13;
  --warn-soft: #fff8e5;
  --ok: #16815b;
  --shadow: 0 18px 48px rgba(18, 34, 31, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.setup-needed {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-needed section,
.login-card,
.install-card,
.launch-panel {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.setup-needed h1,
.login-card h1,
.launch-panel h1,
.install-card h2 {
  margin: 14px 0 8px;
  line-height: 1.05;
}

.setup-needed p,
.login-card p,
.launch-panel p,
.install-card p {
  color: var(--muted);
  line-height: 1.5;
}

.primary-link,
.secondary-link,
.primary-btn,
.ghost-btn,
.danger-btn,
.tiny-btn,
.icon-btn {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 800;
}

.primary-link,
.primary-btn {
  background: var(--brand);
  color: #fff;
}

.primary-link:hover,
.primary-btn:hover {
  background: var(--brand-dark);
}

.secondary-link,
.ghost-btn,
.icon-btn {
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
}

.danger-btn {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f0c4b3;
}

.tiny-btn {
  min-height: 30px;
  padding: 0 10px;
  background: var(--panel-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.muted {
  color: var(--muted);
}

.error-box,
.notice-box {
  border-radius: 8px;
  padding: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.error-box {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f0c4b3;
}

.notice-box {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #b9e7df;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.field input,
.field textarea,
.field select,
.search-input,
.message-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

.field textarea,
.message-input {
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.search-input:focus,
.message-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 143, 135, 0.13);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  display: grid;
  gap: 16px;
}

.login-card form {
  display: grid;
  gap: 14px;
}

.app-loading,
.admin-shell {
  min-height: 100vh;
}

.messenger-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
}

.sidebar-top {
  padding: 18px;
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.brand-line,
.user-line,
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-line strong,
.user-line strong,
.brand-row strong {
  display: block;
  font-size: 1.1rem;
}

.brand-line small,
.user-line small,
.brand-row small {
  display: block;
  color: var(--muted);
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-row {
  display: flex;
  gap: 8px;
  padding: 12px 18px 0;
}

.tab-row button {
  flex: 1;
}

.tab-row .active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.sidebar-scroll {
  overflow: auto;
  padding: 12px;
}

.section-title {
  margin: 8px 6px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.chat-item:hover,
.person-item:hover,
.chat-item.active {
  background: var(--brand-soft);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
  flex: 0 0 auto;
}

.avatar img,
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-meta,
.person-meta {
  min-width: 0;
}

.chat-meta strong,
.person-meta strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-meta small,
.person-meta small {
  display: block;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-meta small + small {
  margin-top: 2px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.badge {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  font-size: 0.76rem;
  font-weight: 900;
}

.chat-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    linear-gradient(rgba(238, 247, 244, 0.92), rgba(238, 247, 244, 0.92)),
    radial-gradient(circle at 15% 20%, rgba(11, 143, 135, 0.16), transparent 28%),
    radial-gradient(circle at 86% 10%, rgba(22, 129, 91, 0.12), transparent 30%);
}

.chat-header {
  min-height: 72px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  backdrop-filter: blur(10px);
}

.chat-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.chat-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mobile-menu {
  display: none;
}

.messages {
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.day-line {
  align-self: center;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

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

.message-bubble {
  max-width: min(680px, 78%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(18, 34, 31, 0.08);
}

.message-avatar {
  width: 34px;
  height: 34px;
  font-size: 0.78rem;
  box-shadow: 0 6px 16px rgba(18, 34, 31, 0.08);
}

.message-row.own .message-bubble {
  background: #dbf5f0;
  border-color: #b8e5dd;
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.42;
}

.message-bubble.deleted .message-body {
  color: var(--muted);
  font-style: italic;
}

.reply-box {
  border-left: 3px solid var(--brand);
  background: rgba(11, 143, 135, 0.08);
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.86rem;
}

.message-tags,
.reaction-row,
.file-list,
.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.75rem;
  font-weight: 900;
}

.reaction-pill,
.file-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 800;
}

.composer {
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  display: grid;
  gap: 10px;
}

.composer-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.composer-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--brand-soft);
  border: 1px solid #b9e7df;
  color: var(--brand-dark);
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
}

.typing-line {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.iphone-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 28px;
  align-items: center;
  padding: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-weight: 900;
  font-size: 0.78rem;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.phone-preview {
  display: grid;
  place-items: center;
}

.phone-frame {
  width: min(360px, 100%);
  aspect-ratio: 9 / 18.5;
  border: 10px solid #14231f;
  border-radius: 30px;
  background: var(--bg);
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  box-shadow: var(--shadow);
}

.phone-status,
.phone-header,
.phone-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.phone-status {
  font-size: 0.72rem;
  font-weight: 900;
}

.phone-header {
  padding: 10px 0;
}

.phone-header button,
.phone-composer button {
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  padding: 8px 10px;
  font-weight: 900;
}

.phone-header small {
  display: block;
  color: var(--muted);
}

.phone-thread {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: end;
}

.bubble {
  margin: 0;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
}

.bubble.to {
  align-self: flex-end;
  background: #dbf5f0;
}

.bubble p {
  margin: 4px 0 0;
}

.phone-composer {
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
  color: var(--muted);
}

.install-card {
  grid-column: 1 / -1;
  width: min(720px, 100%);
  justify-self: center;
}

.profile-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.profile-card {
  width: min(920px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-main-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-photo-box,
.profile-fields {
  display: grid;
  gap: 12px;
}

.profile-avatar-large {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 2.4rem;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(18, 34, 31, 0.12);
}

.install-card li {
  margin: 8px 0;
  color: var(--muted);
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-nav {
  background: var(--text);
  color: #fff;
  padding: 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
}

.admin-nav .brand-mark {
  background: var(--brand);
}

.admin-tabs {
  display: grid;
  gap: 8px;
}

.admin-tabs button {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 0 12px;
  font-weight: 800;
}

.admin-tabs button.active {
  background: var(--brand);
  border-color: var(--brand);
}

.admin-main {
  padding: 22px;
  overflow: auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-header h1 {
  margin: 0;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card,
.admin-card,
.table-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--brand);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-form {
  display: grid;
  gap: 12px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}

.check-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 750;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.status-dot::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
}

.status-dot.off::before {
  background: var(--danger);
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .messenger-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    z-index: 20;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

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

  .mobile-menu {
    display: inline-flex;
  }

  .message-bubble {
    max-width: 92%;
  }

  .iphone-page {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-rows: auto auto;
  }

  .admin-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .profile-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .chat-header {
    padding: 10px;
  }

  .messages {
    padding: 12px;
  }

  .composer {
    padding: 10px;
  }

  .composer-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .composer-main .primary-btn {
    grid-column: 1 / -1;
  }

  .composer-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-main {
    padding: 14px;
  }
}

/* 221B foundation v22: softer premium interface layer. */
:root {
  --bg: #edf5f2;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-soft: rgba(248, 252, 250, 0.78);
  --line: rgba(35, 66, 59, 0.13);
  --text: #15221f;
  --muted: #6f7f7b;
  --brand: #078b82;
  --brand-dark: #076c66;
  --brand-soft: #def5f1;
  --shadow: 0 28px 72px rgba(21, 34, 31, 0.13);
}

body {
  background:
    linear-gradient(120deg, rgba(237, 245, 242, 0.96), rgba(248, 252, 250, 0.96)),
    radial-gradient(circle at 12% 10%, rgba(7, 139, 130, 0.14), transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(15, 168, 157, 0.11), transparent 28%);
  font-weight: 430;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background:
    repeating-linear-gradient(35deg, transparent 0 28px, rgba(7, 139, 130, 0.045) 28px 29px),
    repeating-linear-gradient(145deg, transparent 0 36px, rgba(21, 34, 31, 0.033) 36px 37px);
  mask-image: radial-gradient(circle at 50% 42%, black 0 54%, transparent 84%);
}

body > * {
  position: relative;
  z-index: 1;
}

.primary-link,
.secondary-link,
.primary-btn,
.ghost-btn,
.danger-btn,
.tiny-btn,
.icon-btn,
.chip-btn {
  border-radius: 999px;
  font-weight: 650;
  box-shadow: none;
}

.primary-link,
.primary-btn {
  background: linear-gradient(135deg, var(--brand), #0fa89d);
  box-shadow: 0 14px 24px rgba(7, 139, 130, 0.18);
}

.ghost-btn,
.icon-btn,
.tiny-btn,
.secondary-link {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
}

.brand-mark {
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.16), transparent 34%),
    #15221f;
  font-weight: 760;
}

.login-card,
.install-card,
.setup-needed section,
.profile-card,
.admin-card,
.table-card,
.stat-card {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 58px rgba(21, 34, 31, 0.1);
}

.messenger-shell {
  width: min(1580px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px auto;
  grid-template-columns: 320px minmax(0, 1fr) 286px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(18px);
}

.sidebar {
  background:
    linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.62)),
    radial-gradient(circle at 20% 14%, rgba(7, 139, 130, 0.1), transparent 38%);
}

.sidebar-top {
  padding: 18px;
}

.user-line {
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(222, 245, 241, 0.9), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(7, 139, 130, 0.15);
}

.search-input,
.message-input,
.field input,
.field textarea,
.field select {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  font-weight: 430;
}

.tab-row {
  gap: 5px;
  margin: 0 18px;
  padding: 5px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.tab-row button {
  min-height: 34px;
  border: 0;
  background: transparent;
}

.tab-row .active {
  box-shadow: 0 10px 20px rgba(7, 139, 130, 0.2);
}

.chat-item,
.person-item {
  border-radius: 16px;
}

.chat-item:hover,
.person-item:hover,
.chat-item.active {
  background: rgba(222, 245, 241, 0.92);
}

.avatar {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent),
    var(--brand);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.chat-pane {
  background:
    linear-gradient(rgba(248, 252, 250, 0.82), rgba(248, 252, 250, 0.84)),
    radial-gradient(circle at 20% 16%, rgba(7, 139, 130, 0.08), transparent 36%);
  position: relative;
}

.chat-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.45;
  pointer-events: none;
  background-image:
    linear-gradient(30deg, rgba(7, 139, 130, 0.038) 12%, transparent 12.5%, transparent 87%, rgba(7, 139, 130, 0.038) 87.5%, rgba(7, 139, 130, 0.038)),
    linear-gradient(150deg, rgba(7, 139, 130, 0.038) 12%, transparent 12.5%, transparent 87%, rgba(7, 139, 130, 0.038) 87.5%, rgba(7, 139, 130, 0.038));
  background-size: 46px 80px;
}

.chat-header,
.messages,
.composer {
  position: relative;
  z-index: 1;
}

.chat-header,
.composer {
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(14px);
}

.message-bubble {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 36px rgba(21, 34, 31, 0.08);
}

.message-row.own .message-bubble {
  background: linear-gradient(135deg, #d9f4ef, #e7faf6);
}

.message-head {
  font-weight: 620;
}

.message-body {
  font-weight: 430;
}

.composer-main {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  padding: 8px;
  box-shadow: 0 16px 34px rgba(21, 34, 31, 0.07);
}

.composer-main .message-input {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.profile-pane {
  border-left: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(244, 250, 248, 0.68)),
    radial-gradient(circle at 50% 0%, rgba(7, 139, 130, 0.12), transparent 35%);
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  overflow: auto;
}

.profile-summary {
  border-radius: 22px;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(7, 139, 130, 0.94), rgba(8, 117, 110, 0.9)),
    repeating-linear-gradient(45deg, transparent 0 16px, rgba(255, 255, 255, 0.08) 16px 17px);
  box-shadow: 0 18px 38px rgba(7, 139, 130, 0.22);
}

.profile-summary h3 {
  margin: 12px 0 4px;
  font-size: 1.08rem;
  font-weight: 720;
}

.profile-summary p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border: 3px solid rgba(255, 255, 255, 0.42);
}

.profile-role,
.role {
  min-height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 650;
}

.profile-box {
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
}

.profile-box h4 {
  margin: 0 0 10px;
  font-size: 0.76rem;
  color: #536661;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 720;
}

.profile-box p {
  margin: 0;
  color: #536661;
  font-size: 0.86rem;
  line-height: 1.55;
}

.profile-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chip-btn {
  min-height: 32px;
  border: 1px solid var(--line);
  color: #536661;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 10px;
  text-decoration: none;
  font-size: 0.78rem;
}

.profile-line-soft {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-layout {
  width: min(1480px, calc(100vw - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.admin-nav {
  background: rgba(18, 31, 28, 0.94);
}

.admin-tabs button {
  border-radius: 14px;
  font-weight: 650;
}

.admin-main {
  background: rgba(248, 252, 250, 0.76);
}

@media (max-width: 1160px) {
  .messenger-shell {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .profile-pane {
    display: none;
  }
}

@media (max-width: 900px) {
  .messenger-shell {
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .admin-layout {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
}
