﻿/* Base app parity layer: shared shell, auth, list, and card styling. */
:root {
  --kg-ink: #0f172a;
  --kg-muted: #64748b;
  --kg-line: rgba(226, 232, 240, 0.9);
  --kg-sand: #f8fafc;
  --kg-tide: #0f766e;
  --kg-blue: #2563eb;
  --kg-orange: #f97316;
  --kg-soft-shadow: 0 28px 80px -48px rgba(15, 23, 42, 0.62);
  --kg-card-shadow: 0 30px 90px -54px rgba(15, 23, 42, 0.82);
}

/* Fresh voice note component */
.chat-box .kg-voice-card {
  display: block;
  width: min(270px, calc(100vw - 102px));
  min-width: min(232px, calc(100vw - 102px));
  max-width: 270px;
  border: 0;
  border-radius: 999px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 42px -34px rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(14px);
}

.chat-box .outgoing .kg-voice-card,
.chat-box .message-row.is-own .kg-voice-card {
  background: linear-gradient(135deg, #0f8a80 0%, #2563eb 62%, #f97316 100%);
  box-shadow: 0 16px 42px -32px rgba(37, 99, 235, 0.9);
}

.chat-box .kg-voice-card > audio {
  display: none;
}

.chat-box .kg-voice-player {
  position: relative;
  display: block;
  min-width: 0;
}

.chat-box .kg-voice-main {
  display: grid;
  grid-template-columns: 38px minmax(118px, 1fr) 34px 32px;
  align-items: center;
  gap: 6px;
}

.chat-box .kg-voice-play,
.chat-box .kg-voice-volume-toggle {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}

.chat-box .kg-voice-play {
  width: 38px;
  min-width: 38px;
  height: 38px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 10px 22px -17px rgba(15, 118, 110, 0.9);
}

.chat-box .outgoing .kg-voice-play,
.chat-box .message-row.is-own .kg-voice-play {
  color: #0f766e;
  background: rgba(255, 255, 255, 0.96);
}

.chat-box .kg-voice-play::before {
  content: "\f04b";
  font-family: "Font Awesome 5 Free";
  font-size: 0.82rem;
  font-weight: 900;
  transform: translateX(1px);
}

.chat-box .kg-voice-player.is-playing .kg-voice-play::before {
  content: "\f04c";
  transform: none;
}

.chat-box .kg-voice-wave {
  position: relative;
  display: block;
  width: 100%;
  height: 38px;
  min-height: 38px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(15, 118, 110, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.05);
  cursor: pointer;
}

.chat-box .outgoing .kg-voice-wave,
.chat-box .message-row.is-own .kg-voice-wave {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.chat-box .kg-voice-waveform {
  position: absolute;
  inset: 8px 11px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2.5px;
  pointer-events: none;
}

.chat-box .kg-voice-bar {
  width: 2.7px;
  min-width: 2.7px;
  height: var(--bar-height, 48%);
  min-height: 5px;
  max-height: 23px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.48);
  transform-origin: center;
}

.chat-box .outgoing .kg-voice-bar,
.chat-box .message-row.is-own .kg-voice-bar {
  background: rgba(255, 255, 255, 0.72);
}

.chat-box .kg-voice-player.is-playing .kg-voice-bar {
  animation: kgVoicePulse 960ms ease-in-out infinite;
  animation-delay: var(--bar-delay, 0ms);
}

.chat-box .kg-voice-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 1;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.22), rgba(37, 99, 235, 0.16));
  pointer-events: none;
}

.chat-box .outgoing .kg-voice-progress-fill,
.chat-box .message-row.is-own .kg-voice-progress-fill {
  background: rgba(255, 255, 255, 0.24);
}

.chat-box .kg-voice-progress {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.chat-box .kg-voice-time {
  position: static;
  z-index: auto;
  min-width: 28px;
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.chat-box .outgoing .kg-voice-time,
.chat-box .message-row.is-own .kg-voice-time {
  color: rgba(255, 255, 255, 0.84);
}

.chat-box .kg-voice-volume-toggle {
  width: 32px;
  min-width: 32px;
  height: 32px;
  color: #0f766e;
  background: rgba(15, 118, 110, 0.09);
}

.chat-box .outgoing .kg-voice-volume-toggle,
.chat-box .message-row.is-own .kg-voice-volume-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.chat-box .kg-voice-volume-toggle::before {
  content: "\f028";
  font-family: "Font Awesome 5 Free";
  font-size: 0.72rem;
  font-weight: 900;
}

.chat-box .kg-voice-volume-panel {
  position: absolute;
  right: 2px;
  bottom: calc(100% + 8px);
  z-index: 40;
  display: grid;
  grid-template-columns: auto 118px auto;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 18px 46px -28px rgba(15, 23, 42, 0.78);
}

.chat-box .kg-voice-volume-panel.is-hidden {
  display: none;
}

.chat-box .kg-voice-volume-label,
.chat-box .kg-voice-volume-value {
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.chat-box .kg-voice-volume {
  width: 118px;
  accent-color: #14b8a6;
}

.chat-box .kg-voice-loading {
  display: none;
}

@keyframes kgVoicePulse {
  0%, 100% {
    transform: scaleY(0.82);
    opacity: 0.72;
  }
  50% {
    transform: scaleY(1.08);
    opacity: 1;
  }
}

@media screen and (max-width: 700px), (hover: none) and (pointer: coarse) {
  .chat-box .kg-voice-card {
    width: min(258px, calc(100vw - 92px));
    min-width: min(226px, calc(100vw - 92px));
    padding: 6px;
  }

  .chat-box .kg-voice-main {
    grid-template-columns: 37px minmax(104px, 1fr) 32px 31px;
  }

  .chat-box .kg-voice-play {
    width: 37px;
    min-width: 37px;
    height: 37px;
  }

  .chat-box .kg-voice-wave {
    height: 37px;
    min-height: 37px;
  }

  .chat-box .kg-voice-volume-toggle {
    width: 31px;
    min-width: 31px;
    height: 31px;
  }
}

/* Fresh message composer component */
html.has-chat-shell .kg-composer {
  position: relative;
  z-index: 60;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 46px minmax(0, 1fr) 42px 42px 48px;
  align-items: end;
  gap: 8px;
  width: 100%;
  min-height: calc(70px + env(safe-area-inset-bottom));
  margin: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -18px 50px -42px rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(18px);
}

html.has-chat-shell .kg-composer-attach,
html.has-chat-shell .kg-composer-action,
html.has-chat-shell .kg-composer-send {
  display: inline-grid;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  place-items: center;
  border: 0;
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

html.has-chat-shell .kg-composer-attach {
  position: relative;
  overflow: hidden;
  color: #0f766e;
  background: rgba(240, 253, 250, 0.92);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.1);
}

html.has-chat-shell .kg-composer-attach input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

html.has-chat-shell .kg-composer-attach span,
html.has-chat-shell .kg-composer-send span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

html.has-chat-shell .kg-composer-input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  max-height: 132px;
  resize: none;
  overflow-y: auto;
  border: 0;
  border-radius: 20px;
  padding: 13px 16px;
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.92);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
  outline: none;
}

html.has-chat-shell .kg-composer-input::placeholder {
  color: #94a3b8;
  font-weight: 850;
}

html.has-chat-shell .kg-composer-input:focus {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18), 0 12px 30px -28px rgba(37, 99, 235, 0.75);
}

html.has-chat-shell .kg-composer-action {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  border-radius: 16px;
  color: #2563eb;
  background: rgba(248, 250, 252, 0.96);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.88);
}

html.has-chat-shell .kg-composer-emoji {
  color: #7c3aed;
}

html.has-chat-shell .kg-composer-voice {
  color: #2563eb;
}

html.has-chat-shell .kg-composer-voice.is-recording {
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 12px 28px -20px rgba(239, 68, 68, 0.9);
}

html.has-chat-shell .kg-composer-voice.is-recording i::before {
  content: "\f04d";
}

html.has-chat-shell .kg-composer-send {
  color: #ffffff;
  background: #64748b;
  box-shadow: 0 14px 30px -22px rgba(15, 23, 42, 0.8);
}

html.has-chat-shell .kg-composer-send.active:not(:disabled) {
  background: linear-gradient(135deg, #0f8a80 0%, #2563eb 70%, #f97316 100%);
  box-shadow: 0 16px 34px -22px rgba(37, 99, 235, 0.85);
}

html.has-chat-shell .kg-composer-send:disabled {
  opacity: 0.82;
  cursor: default;
}

html.has-chat-shell .kg-composer-attach:active,
html.has-chat-shell .kg-composer-action:active,
html.has-chat-shell .kg-composer-send:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

html.has-chat-shell .kg-composer .emoji-picker {
  right: 10px;
  bottom: calc(100% + 10px);
  left: 10px;
  width: auto;
  max-height: min(360px, calc(var(--app-viewport-height, 100svh) - var(--chat-topbar-height, 70px) - var(--chat-composer-height, 70px) - 26px));
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px -42px rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
}

html.has-chat-shell .kg-composer .attachment-selected,
html.has-chat-shell .kg-composer .upload-progress {
  grid-column: 1 / -1;
  margin: 0;
  border: 0;
  border-radius: 16px;
  padding: 8px 10px;
  background: rgba(240, 253, 250, 0.9);
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 900;
}

@media screen and (max-width: 700px), (hover: none) and (pointer: coarse) {
  html.has-chat-shell .kg-composer {
    grid-template-columns: 46px minmax(0, 1fr) 42px 42px 48px;
    gap: 7px;
    min-height: calc(68px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
  }

  html.has-chat-shell .kg-composer-input {
    min-height: 46px;
    padding: 13px 15px;
  }
}

/* Fresh text message bubble component */
.chat-box .kg-text-bubble {
  display: inline-grid;
  max-width: min(310px, calc(100vw - 104px));
  min-width: 0;
  gap: 6px;
  border: 0;
  border-radius: 21px 21px 7px 21px;
  padding: 10px 12px 8px;
  color: #ffffff;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(135deg, #0f8a80 0%, #2563eb 68%, #f97316 100%);
  box-shadow: 0 18px 44px -34px rgba(37, 99, 235, 0.88);
}

.chat-box .incoming .kg-text-bubble,
.chat-box .is-peer .kg-text-bubble {
  border-radius: 21px 21px 21px 7px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 42px -36px rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(12px);
}

.chat-box .kg-text-body {
  min-width: 0;
  margin: 0;
  color: inherit;
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.34;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-box .kg-text-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 17px;
  margin: -1px 0 0 auto;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.chat-box .incoming .kg-text-meta,
.chat-box .is-peer .kg-text-meta {
  color: rgba(100, 116, 139, 0.88);
}

.chat-box .kg-text-meta time {
  display: inline-flex;
  align-items: center;
}

.chat-box .kg-text-meta .message-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #2563eb;
  font-size: 0;
  line-height: 1;
  box-shadow: 0 8px 18px -12px rgba(15, 23, 42, 0.78);
}

.chat-box .kg-text-meta .message-status i {
  color: currentColor;
  font-size: 0.62rem;
  line-height: 1;
}

.chat-box .kg-text-meta .message-status.is-read i {
  color: #2563eb;
  filter: none;
}

.chat-box .incoming .kg-text-meta .message-status i,
.chat-box .is-peer .kg-text-meta .message-status i {
  color: currentColor;
}

.chat-box .kg-text-bubble .message-reactions {
  margin-top: 0;
}

@media screen and (max-width: 700px), (hover: none) and (pointer: coarse) {
  .chat-box .kg-text-bubble {
    max-width: min(292px, calc(100vw - 96px));
    border-radius: 20px 20px 7px 20px;
    padding: 9px 11px 8px;
  }

  .chat-box .incoming .kg-text-bubble,
  .chat-box .is-peer .kg-text-bubble {
    border-radius: 20px 20px 20px 7px;
  }

  .chat-box .kg-text-body {
    font-size: 0.95rem;
  }
}

body {
  min-height: 100svh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: transparent !important;
  color: var(--kg-ink);
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

.site-header,
.site-footer {
  width: min(100%, 1040px) !important;
}

.site-header {
  display: grid !important;
  min-height: 74px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center !important;
  gap: 16px;
  padding-block: 14px !important;
}

.brand-mark {
  min-width: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  font-size: 0.96rem;
  color: var(--kg-ink) !important;
  font-weight: 950;
  text-decoration: none !important;
}

.brand-icon {
  border-radius: 15px !important;
  background: linear-gradient(135deg, var(--kg-tide), var(--kg-blue) 58%, var(--kg-orange)) !important;
  box-shadow: 0 18px 36px -28px rgba(37, 99, 235, 0.9) !important;
}

.brand-icon i {
  font-size: 0.98rem;
}

.site-nav {
  justify-self: end;
  display: inline-flex !important;
  min-width: 0;
  align-items: center;
  gap: 7px !important;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 999px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 50px -42px rgba(15, 23, 42, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.nav-form {
  display: inline-flex;
  margin: 0;
}

.site-nav .nav-icon-link,
.site-nav .nav-logout {
  position: relative;
  display: inline-grid !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  place-items: center;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 0 !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
  text-decoration: none;
}

.site-nav .nav-icon-link span,
.site-nav .nav-logout span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-nav .nav-icon-link:hover,
.site-nav .nav-icon-link:focus-visible,
.site-nav .nav-icon-link.is-active {
  border-color: rgba(20, 184, 166, 0.18) !important;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.96), rgba(239, 246, 255, 0.94)) !important;
  color: var(--kg-tide) !important;
  box-shadow: 0 14px 30px -26px rgba(15, 23, 42, 0.72) !important;
  outline: none;
}

.site-nav .nav-icon-link.is-active::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--kg-tide);
}

.premium-profile-chip {
  display: inline-flex !important;
  width: auto !important;
  max-width: 190px !important;
  min-height: 42px !important;
  align-items: center !important;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.88) !important;
  border-radius: 999px !important;
  padding: 4px 10px 4px 4px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--kg-ink) !important;
  box-shadow: 0 14px 32px -28px rgba(15, 23, 42, 0.72) !important;
}

.nav-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  min-width: 34px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--kg-tide), var(--kg-blue) 58%, var(--kg-orange));
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 950;
}

.nav-user-name {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-nav .nav-logout {
  background: #fff1f2 !important;
  color: #e11d48 !important;
}

.site-nav .nav-logout:hover,
.site-nav .nav-logout:focus-visible {
  background: #ffe4e6 !important;
  color: #be123c !important;
  outline: none;
}

.site-nav .nav-register {
  display: inline-flex !important;
  min-height: 42px !important;
  align-items: center;
  gap: 8px;
  border-radius: 999px !important;
  padding: 0 14px !important;
}

.site-nav a,
.site-nav button,
.nav-user,
.button-link,
.button-primary {
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

.site-nav a:hover,
.site-nav button:hover,
.button-link:hover,
.button-primary:hover {
  transform: translateY(-1px);
}

.site-nav .nav-cta,
.button-primary,
.button-link.primary {
  background: linear-gradient(135deg, var(--kg-tide), var(--kg-blue) 58%, var(--kg-orange)) !important;
  color: #ffffff !important;
  box-shadow: 0 22px 46px -30px rgba(37, 99, 235, 0.9) !important;
}

.site-nav .nav-logout {
  border-color: rgba(244, 63, 94, 0.18) !important;
  background: #fff1f2 !important;
  color: #e11d48 !important;
  box-shadow: none !important;
}

.site-nav .nav-logout:hover,
.site-nav .nav-logout:focus-visible {
  background: #ffe4e6 !important;
  color: #be123c !important;
  box-shadow: 0 14px 30px -26px rgba(225, 29, 72, 0.7) !important;
}

.site-nav .nav-register {
  background: linear-gradient(135deg, var(--kg-tide), var(--kg-blue) 58%, var(--kg-orange)) !important;
  color: #ffffff !important;
  box-shadow: 0 22px 46px -30px rgba(37, 99, 235, 0.9) !important;
}

.app-shell {
  width: min(100%, 1040px) !important;
  min-height: calc(100svh - 144px);
  padding: clamp(18px, 5vw, 56px) clamp(14px, 4vw, 28px) !important;
}

.auth-form,
.meta-grid,
.people-list,
.conversation-list {
  display: grid;
}

.auth-form {
  gap: 14px;
  margin-top: 24px;
}

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-field input {
  width: 100%;
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: var(--kg-ink);
  font: inherit;
  font-weight: 700;
  outline: none;
  padding: 0 14px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.form-field input:focus {
  border-color: rgba(20, 184, 166, 0.46);
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

.field-error {
  color: #be123c;
  font-size: 0.76rem;
  font-weight: 800;
}

.form-alert {
  margin-top: 18px;
  border: 1px solid rgba(244, 63, 94, 0.18);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 241, 242, 0.86);
  color: #be123c;
  font-size: 0.86rem;
  font-weight: 850;
}

.button-primary {
  min-height: 50px;
  border: 0;
  border-radius: 17px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 24px;
}

.meta-grid {
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
}

.foundation-card,
.dashboard-card,
.discovery-card,
.inbox-card {
  border: 1px solid rgba(226, 232, 240, 0.92) !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: var(--kg-card-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(18px);
}

.dashboard-card,
.discovery-card,
.inbox-card {
  border: 0 !important;
}

.meta-grid div,
.section-heading,
.kg-list-header,
.kg-list-row,
.kg-search-panel,
.kg-premium-list {
  border-color: transparent !important;
}

.foundation-card,
.dashboard-card {
  width: min(100%, 760px) !important;
}

.discovery-card,
.inbox-card {
  width: min(100%, 900px) !important;
}

.eyebrow,
.kg-users-eyebrow {
  color: var(--kg-muted) !important;
  font-size: 0.7rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.16em !important;
}

h1,
.section-heading h1 {
  color: var(--kg-ink);
  font-size: clamp(2rem, 6vw, 3.25rem) !important;
  font-weight: 850;
  line-height: 1.02;
}

.lead,
.kg-auth-copy {
  color: var(--kg-muted);
  font-size: 0.96rem;
  font-weight: 650;
}

body:has(.kg-auth-screen) .site-header,
body:has(.kg-auth-screen) .site-footer {
  display: none !important;
}

body:has(.kg-auth-screen) .app-shell {
  width: 100% !important;
  min-height: 100svh;
  padding: 18px !important;
  place-items: center;
}

.kg-auth-screen {
  display: grid !important;
  width: min(100%, 920px) !important;
  min-height: min(650px, calc(100svh - 36px));
  grid-template-columns: minmax(0, 0.94fr) minmax(360px, 1fr);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.92) !important;
  border-radius: 30px !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: var(--kg-soft-shadow) !important;
  backdrop-filter: blur(18px);
}

.kg-auth-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 5vw, 36px);
}

.kg-login-visual {
  position: relative;
  display: grid;
  min-height: 100%;
  align-content: space-between;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.26), transparent 26%),
    linear-gradient(145deg, #0f766e, #2563eb 58%, #f97316);
  color: #ffffff;
}

.kg-login-visual::after {
  content: "";
  position: absolute;
  inset: auto -24% -28% 18%;
  height: 320px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(4px);
}

.kg-login-visual-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 900;
}

.kg-login-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.kg-login-phone,
.kg-signup-preview {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 28px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.23);
  box-shadow: 0 32px 74px -42px rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
}

.kg-login-phone-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
}

.kg-login-phone-header span {
  grid-row: span 2;
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffffff, #ccfbf1);
}

.kg-login-phone-header strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-login-phone-header em {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 750;
}

.kg-login-thread {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.kg-login-bubble {
  width: fit-content;
  max-width: 86%;
  border-radius: 18px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 800;
}

.kg-login-bubble-in {
  background: rgba(255, 255, 255, 0.94);
  color: var(--kg-ink);
}

.kg-login-bubble-out {
  justify-self: end;
  background: rgba(15, 23, 42, 0.74);
  color: #ffffff;
}

.kg-login-bubble-voice {
  display: grid;
  width: min(100%, 250px);
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.2);
}

.kg-login-bubble-voice i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--kg-tide);
}

.kg-login-bubble-voice span {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
}

.kg-login-bubble-voice span:last-child {
  width: 56%;
}

.kg-auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kg-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  padding: 6px 11px;
  background: #ffffff;
  color: var(--kg-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kg-auth-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.kg-auth-product {
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 900;
}

.kg-auth-title {
  margin-top: 22px !important;
  font-size: clamp(1.85rem, 4vw, 2.45rem) !important;
}

.kg-auth-copy {
  margin-top: 8px;
}

.kg-auth-form {
  gap: 15px !important;
  margin-top: 24px !important;
}

.kg-auth-screen .form-field span {
  color: #64748b !important;
  font-size: 0.7rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}

.kg-auth-screen .form-field input,
.search-panel input {
  min-height: 50px !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  font-size: 0.9rem !important;
}

.kg-auth-submit {
  display: inline-flex !important;
  min-height: 50px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 9px !important;
  border-radius: 18px !important;
  background: #1f2937 !important;
  text-transform: uppercase;
}

.kg-auth-submit i {
  transition: transform 160ms ease;
}

.kg-auth-submit:hover i {
  transform: translateX(3px);
}

.kg-auth-link {
  margin-top: 22px !important;
  color: #64748b !important;
  font-size: 0.88rem;
  text-align: center;
}

.kg-auth-link a {
  color: var(--kg-ink) !important;
  font-weight: 900;
}

.kg-signup-preview {
  display: grid;
  gap: 13px;
}

.kg-signup-avatar {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--kg-tide);
  font-size: 1.25rem;
}

.kg-signup-preview strong {
  font-size: 1.16rem;
  line-height: 1.2;
}

.kg-signup-preview > span,
.kg-signup-preview-row p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.kg-signup-preview-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.kg-signup-preview-row i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.74rem;
}

.section-heading {
  border-bottom: 0 !important;
  padding-bottom: 18px;
}

.kg-list-screen {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 4vw, 26px) !important;
}

.kg-list-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start !important;
  gap: 16px;
  border-bottom: 0 !important;
  padding-bottom: 18px;
}

.kg-list-title {
  min-width: 0;
}

.kg-list-title .eyebrow {
  margin-bottom: 6px !important;
}

.kg-list-title h1 {
  font-size: clamp(2rem, 5vw, 2.85rem) !important;
}

.kg-list-title .lead {
  max-width: 48ch;
  margin-top: 8px !important;
}

.kg-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kg-icon-action,
.kg-action-pill,
.kg-clear-search {
  min-height: 42px !important;
  border-radius: 999px !important;
}

.kg-icon-action {
  display: inline-grid;
  width: 42px;
  min-width: 42px;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.88);
  color: #475569;
  text-decoration: none;
  box-shadow: 0 14px 32px -28px rgba(15, 23, 42, 0.7);
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.kg-icon-action:hover {
  border-color: rgba(20, 184, 166, 0.36);
  color: var(--kg-tide);
  transform: translateY(-1px);
}

.kg-action-pill,
.kg-search-submit,
.person-action {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap;
}

.kg-premium-list {
  display: grid;
  gap: 10px !important;
  margin-top: 0 !important;
}

.kg-list-row {
  position: relative;
  min-height: 76px;
  border: 0 !important;
  border-radius: 22px !important;
  padding: 12px !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9)) !important;
  box-shadow: 0 18px 42px -38px rgba(15, 23, 42, 0.72) !important;
  transform: translateZ(0);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.kg-list-row:hover,
.kg-list-row:focus-visible,
.kg-list-row:focus-within {
  border-color: transparent !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(240, 253, 250, 0.88) 48%, rgba(239, 246, 255, 0.92)) !important;
  box-shadow: 0 24px 54px -42px rgba(15, 23, 42, 0.82) !important;
  outline: none;
  transform: translateY(-1px);
}

.kg-row-avatar {
  position: relative;
  display: grid !important;
  width: 52px !important;
  height: 52px !important;
  min-width: 52px;
  place-items: center;
  overflow: visible;
  border-radius: 18px !important;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(20, 184, 166, 0.8), rgba(37, 99, 235, 0.75), rgba(249, 115, 22, 0.78)) border-box !important;
  border: 2px solid transparent;
  color: var(--kg-tide) !important;
  font-size: 1rem;
  font-weight: 950;
}

.kg-row-avatar span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.94), rgba(239, 246, 255, 0.94));
}

.kg-row-avatar i {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 8px 16px -10px rgba(15, 23, 42, 0.85);
}

.kg-row-avatar i.is-online {
  background: #22c55e;
}

.kg-row-trailing {
  display: grid;
  min-width: 34px;
  justify-items: end;
  align-self: stretch;
  align-content: center;
  gap: 7px;
  color: #cbd5e1;
}

.kg-row-trailing > i {
  font-size: 0.78rem;
}

.conversation-list,
.people-list {
  gap: 10px !important;
}

.conversation-item,
.person-card {
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 18px 42px -38px rgba(15, 23, 42, 0.72) !important;
}

.conversation-item:hover,
.person-card:hover {
  border-color: rgba(20, 184, 166, 0.36) !important;
  transform: translateY(-1px);
}

.kg-conversation-row {
  grid-template-columns: 52px minmax(0, 1fr) auto !important;
  text-decoration: none;
}

.kg-conversation-row .conversation-main,
.kg-person-row .person-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.kg-conversation-row .conversation-title-row,
.kg-person-row .person-title-row {
  min-width: 0;
}

.kg-conversation-row .conversation-title-row h2,
.kg-person-row .person-title-row h2 {
  color: var(--kg-ink) !important;
  font-size: 0.98rem !important;
  font-weight: 950 !important;
  letter-spacing: 0;
}

.kg-conversation-row .conversation-title-row time {
  color: #94a3b8 !important;
  font-size: 0.72rem !important;
  font-weight: 900 !important;
}

.kg-conversation-row [data-conversation-preview],
.kg-person-row .person-main p {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.84rem !important;
  font-weight: 760 !important;
  line-height: 1.35;
}

.kg-conversation-row .presence-dot,
.kg-person-row .presence-dot {
  width: fit-content;
}

.person-avatar {
  border-radius: 18px !important;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(37, 99, 235, 0.18)) !important;
  color: var(--kg-tide) !important;
}

.state-badge,
.presence-dot,
.unread-badge {
  font-weight: 950 !important;
}

.empty-state {
  border-radius: 20px !important;
  background: rgba(248, 250, 252, 0.78) !important;
}

.kg-search-panel {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  margin-top: 0 !important;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 22px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.72);
}

.kg-search-field {
  position: relative;
  gap: 6px;
}

.kg-search-field > span {
  padding-left: 4px;
}

.kg-search-field > i {
  position: absolute;
  bottom: 15px;
  left: 15px;
  z-index: 1;
  color: #94a3b8;
  font-size: 0.9rem;
  pointer-events: none;
}

.kg-search-field input {
  padding-left: 42px !important;
}

.kg-search-submit {
  align-self: end;
  min-width: 112px;
}

.kg-clear-search {
  align-self: end;
  background: rgba(255, 255, 255, 0.9) !important;
}

.kg-person-row {
  grid-template-columns: 52px minmax(0, 1fr) auto !important;
}

.kg-person-row .person-title-row {
  justify-content: flex-start;
}

.kg-person-row .state-badge {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-actions {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px !important;
}

.person-action {
  min-height: 40px !important;
  border-radius: 999px !important;
  padding-inline: 13px !important;
  font-size: 0.8rem !important;
}

.person-action.muted {
  color: #64748b !important;
}

.kg-empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 18px !important;
  text-align: center;
}

.kg-empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(37, 99, 235, 0.14));
  color: var(--kg-tide);
  font-size: 1.1rem;
}

@media (max-width: 760px) {
  body:has(.kg-auth-screen) .app-shell {
    padding: 0 !important;
  }

  .kg-auth-screen {
    min-height: 100svh;
    grid-template-columns: 1fr;
    border-width: 0 !important;
    border-radius: 0 !important;
  }

  .kg-login-visual {
    display: none;
  }

  .kg-auth-panel {
    justify-content: center;
    padding: 22px;
  }

  .kg-auth-title {
    font-size: 2rem !important;
  }

  .form-grid,
  .kg-auth-name-grid,
  .search-panel {
    grid-template-columns: 1fr !important;
  }

  .section-heading {
    display: grid !important;
  }

  .person-card,
  .conversation-item,
  .kg-person-row,
  .kg-conversation-row {
    grid-template-columns: 50px minmax(0, 1fr) !important;
    align-items: start !important;
  }

  .person-actions,
  .unread-badge {
    grid-column: 2;
    justify-content: flex-start;
  }

  .site-header {
    display: grid !important;
    width: 100% !important;
    min-height: 64px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  .brand-mark {
    width: 42px;
    max-width: 42px;
    justify-content: center;
    gap: 0;
  }

  .brand-mark > span:last-child {
    display: none !important;
  }

  .brand-icon {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    border-radius: 12px !important;
  }

  .site-nav {
    justify-self: end;
    width: auto !important;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 4px !important;
    overflow: visible;
    padding: 4px !important;
  }

  .site-nav .nav-icon-link,
  .site-nav .nav-logout,
  .site-nav .nav-register {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    justify-content: center;
    font-size: 0.84rem !important;
  }

  .premium-profile-chip {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    justify-content: center !important;
    padding: 1px !important;
  }

  .nav-avatar {
    width: 32px;
    min-width: 32px;
    height: 32px;
    font-size: 0.78rem;
  }

  .nav-user-name {
    display: none !important;
  }

  .site-nav .nav-register span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  body:has(.kg-chats-screen) .app-shell {
    width: 100% !important;
    min-height: auto;
    padding: 8px 12px 18px !important;
  }

  .kg-chats-screen.inbox-card {
    width: 100% !important;
    min-height: auto;
    gap: 12px;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .kg-chats-screen .kg-list-header {
    display: flex !important;
    min-height: 46px;
    align-items: center !important;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 0;
    padding: 0 2px 6px;
  }

  .kg-chats-screen .kg-list-title {
    display: grid;
    gap: 2px;
  }

  .kg-chats-screen .eyebrow,
  .kg-chats-screen .lead {
    display: none !important;
  }

  .kg-chats-screen .kg-list-title h1 {
    margin: 0 !important;
    font-size: 1.72rem !important;
    line-height: 1;
    letter-spacing: 0;
  }

  .kg-chats-screen .kg-list-actions {
    width: auto;
    gap: 7px;
    justify-content: flex-end;
  }

  .kg-chats-screen .kg-icon-action,
  .kg-chats-screen .kg-action-pill {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    justify-content: center;
    border-color: transparent !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.76) !important;
  }

  .kg-chats-screen .kg-action-pill span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .kg-chats-screen .kg-premium-list {
    gap: 8px !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .kg-chats-screen .kg-conversation-row {
    min-height: 74px;
    grid-template-columns: 48px minmax(0, 1fr) auto !important;
    gap: 10px !important;
    border: 0 !important;
    border-bottom: 0 !important;
    border-radius: 20px !important;
    padding: 12px 14px !important;
    background: rgba(255, 255, 255, 0.76) !important;
    box-shadow: none !important;
  }

  .kg-chats-screen .kg-row-avatar {
    width: 46px !important;
    min-width: 46px;
    height: 46px !important;
    border-radius: 16px !important;
  }

  .kg-chats-screen .kg-row-avatar span {
    border-radius: 13px;
  }

  .kg-chats-screen .conversation-title-row h2 {
    font-size: 0.96rem !important;
  }

  .kg-chats-screen [data-conversation-preview] {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kg-list-screen {
    min-height: calc(100svh - 140px);
    border-radius: 24px !important;
    padding: 16px !important;
  }

  .kg-list-header {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .kg-list-actions {
    width: 100%;
    justify-content: space-between;
  }

  .kg-action-pill {
    flex: 1;
  }

  .kg-row-trailing {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
  }

  .kg-row-trailing > i {
    display: none;
  }

  .kg-search-panel {
    grid-template-columns: 1fr 44px auto !important;
    gap: 8px;
    padding: 8px;
  }

  .kg-search-field {
    grid-column: 1 / -1;
  }

  .kg-search-submit {
    min-width: 44px;
    width: 44px;
    padding: 0 !important;
  }

  .kg-search-submit span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .person-actions {
    width: 100%;
  }

  .person-action {
    min-height: 38px !important;
  }

  body:has(.kg-chats-screen) .app-shell,
  body:has(.kg-people-screen) .app-shell {
    width: 100% !important;
    min-height: auto;
    padding: 8px 12px 18px !important;
  }

  .kg-chats-screen.kg-list-screen,
  .kg-people-screen.kg-list-screen {
    width: 100% !important;
    min-height: auto;
    gap: 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .kg-chats-screen .kg-list-header,
  .kg-people-screen .kg-list-header {
    display: flex !important;
    min-height: 46px;
    align-items: center !important;
    justify-content: space-between;
    gap: 10px !important;
    border-bottom: 0 !important;
    padding: 0 2px 6px !important;
  }

  .kg-chats-screen .eyebrow,
  .kg-chats-screen .lead,
  .kg-people-screen .eyebrow,
  .kg-people-screen .lead {
    display: none !important;
  }

  .kg-chats-screen .kg-list-title h1,
  .kg-people-screen .kg-list-title h1 {
    margin: 0 !important;
    font-size: 1.66rem !important;
    line-height: 1;
  }

  .kg-chats-screen .kg-list-actions,
  .kg-people-screen .kg-list-actions {
    width: auto !important;
    justify-content: flex-end !important;
    gap: 7px !important;
  }

  .kg-chats-screen .kg-icon-action,
  .kg-chats-screen .kg-action-pill,
  .kg-people-screen .kg-icon-action,
  .kg-people-screen .kg-action-pill {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    flex: 0 0 42px !important;
    justify-content: center;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.76) !important;
  }

  .kg-chats-screen .kg-action-pill span,
  .kg-people-screen .kg-action-pill span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .kg-people-screen .kg-search-panel {
    display: block !important;
    position: relative;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .kg-people-screen .kg-search-field {
    display: block !important;
    width: 100%;
    margin: 0;
  }

  .kg-people-screen .kg-search-field > span {
    display: none !important;
  }

  .kg-people-screen .kg-search-field input {
    width: 100%;
    min-height: 54px !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding-left: 48px !important;
    padding-right: 58px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 18px 42px -34px rgba(15, 23, 42, 0.76), inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  }

  .kg-people-screen .kg-search-field > i {
    left: 18px !important;
    color: #94a3b8 !important;
  }

  .kg-people-screen .kg-search-submit {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 0 !important;
    display: inline-grid !important;
    place-items: center;
    box-shadow: 0 16px 28px -22px rgba(37, 99, 235, 0.9) !important;
  }

  .kg-people-screen .kg-clear-search {
    display: inline-flex !important;
    width: fit-content;
    min-height: 34px !important;
    margin-top: 8px;
    border: 0 !important;
    padding: 0 12px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    font-size: 0.78rem !important;
  }

  .kg-chats-screen .kg-premium-list,
  .kg-people-screen .kg-premium-list {
    gap: 8px !important;
    overflow: visible;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .kg-chats-screen .kg-list-row,
  .kg-people-screen .kg-list-row {
    border: 0 !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.78) !important;
    box-shadow: 0 16px 38px -34px rgba(15, 23, 42, 0.78) !important;
  }

  .kg-people-screen .kg-person-row {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  .kg-people-screen .kg-row-avatar {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    border-radius: 16px !important;
  }

  .kg-people-screen .person-title-row {
    display: grid;
    gap: 3px;
  }

  .kg-people-screen .state-badge {
    width: fit-content;
    max-width: 100% !important;
  }

  .kg-people-screen .person-main p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kg-people-screen .person-actions {
    grid-column: 2 !important;
    width: 100%;
    justify-content: flex-start !important;
  }

  .kg-people-screen .person-action {
    width: 100%;
    justify-content: center;
    border: 0 !important;
    background: rgba(248, 250, 252, 0.88) !important;
  }

  body:has(.dashboard-card) .app-shell {
    width: 100% !important;
    min-height: auto;
    padding: 8px 12px 18px !important;
  }

  .dashboard-card {
    width: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
  }

  .dashboard-card .eyebrow {
    display: none !important;
  }

  .dashboard-card h1 {
    margin: 0 2px 8px !important;
    font-size: 1.68rem !important;
    line-height: 1.08;
  }

  .dashboard-card .lead {
    display: none !important;
  }

  .dashboard-card .meta-grid {
    display: grid;
    gap: 8px;
    margin: 12px 0 14px !important;
  }

  .dashboard-card .meta-grid div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    border: 0 !important;
    border-radius: 18px !important;
    padding: 13px 14px !important;
    background: rgba(255, 255, 255, 0.76) !important;
    box-shadow: 0 14px 34px -32px rgba(15, 23, 42, 0.72) !important;
  }

  .dashboard-card dt {
    color: #64748b !important;
    font-size: 0.72rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dashboard-card dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--kg-ink) !important;
    font-size: 0.96rem !important;
    font-weight: 900 !important;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dashboard-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    margin-top: 0 !important;
  }

  .dashboard-actions form {
    grid-column: 1 / -1;
    margin: 0;
  }

  .dashboard-actions .button-link {
    width: 100%;
    min-height: 48px !important;
    justify-content: center;
    border: 0 !important;
    border-radius: 18px !important;
    padding: 0 12px !important;
    box-shadow: 0 16px 34px -28px rgba(15, 23, 42, 0.72) !important;
  }

  .dashboard-actions form .button-link {
    background: rgba(255, 255, 255, 0.82) !important;
    color: #475569 !important;
    box-shadow: 0 12px 30px -28px rgba(15, 23, 42, 0.68) !important;
  }
}

@media screen and (max-width: 700px), (hover: none) and (pointer: coarse) {
  html.has-chat-shell .chat-topbar.kg-chat-header {
    grid-template-columns: 38px 42px minmax(0, 1fr) auto !important;
    min-height: calc(62px + env(safe-area-inset-top)) !important;
    gap: 7px !important;
    padding: calc(7px + env(safe-area-inset-top)) 10px 7px !important;
    border: 0 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 253, 250, 0.82) 48%, rgba(239, 246, 255, 0.86)) !important;
    box-shadow: 0 14px 34px -34px rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(16px);
  }

  html.has-chat-shell .chat-topbar.kg-chat-header::after {
    display: none !important;
  }

  html.has-chat-shell .chat-topbar .back-icon,
  html.has-chat-shell .kg-chat-actions .kg-settings-link,
  html.has-chat-shell .kg-chat-actions .kg-refresh-btn {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: #475569 !important;
    box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.74) !important;
    font-size: 0.88rem !important;
    transform: none !important;
  }

  html.has-chat-shell .chat-topbar .back-icon span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  html.has-chat-shell .chat-topbar .back-icon::before,
  html.has-chat-shell .kg-chat-actions .kg-settings-link::before,
  html.has-chat-shell .kg-chat-actions .kg-refresh-btn::before {
    display: none !important;
    content: none !important;
  }

  html.has-chat-shell .chat-topbar .back-icon i,
  html.has-chat-shell .kg-chat-actions .kg-settings-link i,
  html.has-chat-shell .kg-chat-actions .kg-refresh-btn i {
    display: block !important;
    line-height: 1 !important;
  }

  html.has-chat-shell .chat-peer-avatar.kg-chat-peer-avatar {
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    border: 0 !important;
    border-radius: 15px !important;
    background: linear-gradient(135deg, #0f766e, #2563eb 56%, #f97316) !important;
    color: #ffffff !important;
    font-size: 0.92rem !important;
    font-weight: 950 !important;
    box-shadow: 0 14px 28px -22px rgba(37, 99, 235, 0.9) !important;
  }

  html.has-chat-shell .chat-peer-main.kg-chat-peer-details {
    gap: 2px !important;
    overflow: hidden !important;
  }

  html.has-chat-shell .kg-chat-peer-name {
    font-size: 0.96rem !important;
    font-weight: 950 !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
  }

  html.has-chat-shell [data-peer-presence] {
    min-height: auto !important;
    max-width: 100% !important;
    margin: 2px 0 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    color: #64748b !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
  }

  html.has-chat-shell [data-peer-presence] i {
    display: inline-block !important;
    width: 6px !important;
    height: 6px !important;
    flex: 0 0 6px !important;
    border-radius: 999px !important;
    background: #94a3b8 !important;
    box-shadow: none !important;
  }

  html.has-chat-shell [data-peer-presence].kg-peer-online i {
    background: #22c55e !important;
  }

  html.has-chat-shell .kg-chat-actions {
    gap: 5px !important;
  }
}



