:root {
  color-scheme: dark;
  --bg: #07101c;
  --panel: rgba(17, 27, 43, 0.88);
  --panel-strong: rgba(22, 34, 53, 0.95);
  --line: rgba(186, 200, 222, 0.15);
  --text: #f7f9ff;
  --muted: #9caac1;
  --orange: #ff6b35;
  --amber: #ffb13d;
  --green: #20d49b;
  --blue: #4ca3ff;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 107, 53, 0.18), transparent 34%),
    radial-gradient(circle at 14% 24%, rgba(76, 163, 255, 0.13), transparent 26%),
    linear-gradient(135deg, #040a13 0%, var(--bg) 48%, #0c1321 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.14));
}

a {
  color: inherit;
  text-decoration: none;
}

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

.navbar {
  backdrop-filter: blur(18px);
  background: rgba(5, 11, 20, 0.72);
  border-bottom: 1px solid rgba(186, 200, 222, 0.12);
}

.navbar nav a[aria-current="page"] {
  color: #fff;
}

.chat-page {
  width: min(1320px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 156px 0 104px;
}

.chat-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 107, 53, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.chat-eyebrow,
.panel-head span,
.side-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ff8a58;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-eyebrow::before {
  width: 28px;
  height: 2px;
  content: "";
  background: var(--orange);
}

.chat-hero h1,
.panel-head h2,
.side-card h2,
.chat-card h3,
.chat-hero p,
.chat-card p,
.side-card p {
  margin: 0;
}

.chat-hero h1 {
  margin-top: 18px;
  color: #fff;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.chat-hero p {
  max-width: 680px;
  margin-top: 18px;
  color: #c4d0e4;
  font-size: 18px;
  line-height: 1.7;
}

.chat-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.hero-btn,
.open-chat-btn,
.side-card.highlight > a {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 900;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.hero-btn.primary,
.open-chat-btn,
.side-card.highlight > a {
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #ff8b4a);
  box-shadow: 0 18px 46px rgba(255, 107, 53, 0.22);
}

.hero-btn.secondary {
  border: 1px solid rgba(186, 200, 222, 0.2);
  color: #edf3ff;
  background: rgba(255, 255, 255, 0.045);
}

.hero-btn:hover,
.open-chat-btn:hover,
.side-card.highlight > a:hover,
.side-link:hover,
.chat-card:hover,
.chat-summary article:hover {
  transform: translateY(-2px);
}

.hero-btn:focus-visible,
.open-chat-btn:focus-visible,
.side-card a:focus-visible,
.chat-search input:focus-visible {
  outline: 3px solid rgba(255, 177, 61, 0.42);
  outline-offset: 3px;
}

.chat-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.chat-summary article {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(16, 25, 39, 0.88);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.chat-summary article:hover {
  border-color: rgba(255, 107, 53, 0.24);
  background: rgba(21, 33, 50, 0.95);
}

.chat-summary i {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ff9b6e;
  background: rgba(255, 107, 53, 0.12);
}

.chat-summary strong {
  display: block;
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.chat-summary span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.58fr);
  gap: 16px;
}

.chat-main-panel,
.side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.chat-main-panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2 {
  margin-top: 7px;
  color: #fff;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
}

.chat-search {
  width: min(330px, 100%);
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(186, 200, 222, 0.14);
  border-radius: 8px;
  color: #8292aa;
  background: rgba(7, 16, 28, 0.72);
}

.chat-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}

.chat-search input::placeholder {
  color: #7889a0;
}

.conversation-list {
  display: grid;
  gap: 12px;
}

.chat-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(186, 200, 222, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.chat-card:hover {
  border-color: rgba(255, 107, 53, 0.28);
  background: rgba(255, 255, 255, 0.06);
}

.chat-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange), #ffb13d);
  font-size: 15px;
  font-weight: 900;
}

.chat-avatar.instagram {
  background: linear-gradient(135deg, #e43d8f, #ff8b4a);
}

.chat-avatar.ads {
  background: linear-gradient(135deg, #287cff, #20d49b);
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.chat-card h3 {
  color: #fff;
  font-size: 19px;
  line-height: 1.2;
}

.status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(186, 200, 222, 0.16);
  border-radius: 999px;
  color: #c6d2e4;
  background: rgba(186, 200, 222, 0.08);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.online {
  border-color: rgba(32, 212, 155, 0.24);
  color: #bdf7e1;
  background: rgba(32, 212, 155, 0.09);
}

.chat-card p {
  color: #aebbd0;
  line-height: 1.6;
}

.chat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chat-tags span {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: #ff9b6e;
  background: rgba(255, 107, 53, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.open-chat-btn {
  min-width: 148px;
}

.chat-side-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.side-card {
  padding: 22px;
}

.side-card.highlight {
  background:
    radial-gradient(circle at top right, rgba(255, 107, 53, 0.17), transparent 42%),
    var(--panel-strong);
}

.side-card h2 {
  margin-top: 8px;
  color: #fff;
  font-size: 24px;
  line-height: 1.15;
}

.side-card p {
  margin-top: 12px;
  color: #aebbd0;
  line-height: 1.65;
}

.side-card.highlight > a {
  width: 100%;
  margin-top: 18px;
}

.side-link {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 0 13px;
  border: 1px solid rgba(186, 200, 222, 0.13);
  border-radius: 8px;
  color: #edf3ff;
  background: rgba(255, 255, 255, 0.045);
  font-weight: 900;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.side-link i {
  color: #ff9b6e;
}

@media (max-width: 1040px) {
  .chat-layout,
  .chat-hero {
    grid-template-columns: 1fr;
  }

  .chat-hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .chat-summary {
    grid-template-columns: 1fr;
  }

  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-search {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .chat-page {
    width: min(100% - 28px, 1320px);
    padding: 112px 0 96px;
  }

  .chat-hero,
  .chat-main-panel,
  .side-card {
    padding: 20px;
  }

  .chat-hero h1 {
    font-size: 42px;
    line-height: 1.05;
  }

  .chat-hero p {
    font-size: 16px;
  }

  .chat-hero-actions {
    display: grid;
  }

  .hero-btn,
  .open-chat-btn {
    width: 100%;
  }

  .chat-card {
    grid-template-columns: 1fr;
  }

  .chat-avatar {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 430px) {
  .chat-page {
    width: min(100% - 20px, 1320px);
  }

  .chat-hero h1 {
    font-size: 36px;
  }

  .panel-head h2,
  .side-card h2 {
    font-size: 22px;
  }
}
