:root {
  color: #1c1714;
  background:
    radial-gradient(circle at 12% 12%, rgba(233, 175, 111, 0.32), transparent 24%),
    radial-gradient(circle at 88% 14%, rgba(40, 94, 86, 0.22), transparent 24%),
    linear-gradient(160deg, #f6efe4 0%, #f1e2cd 48%, #ead6bc 100%);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.55;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  --page-shadow: 0 24px 70px rgba(55, 38, 24, 0.16);
  --panel: rgba(255, 251, 245, 0.84);
  --panel-strong: rgba(255, 249, 241, 0.94);
  --panel-dark: rgba(33, 70, 63, 0.92);
  --line: rgba(68, 48, 33, 0.12);
  --accent: #ad5f3d;
  --accent-soft: #e2ab7e;
  --forest: #21463f;
  --ink-soft: #6b5c4d;
  --paper: #fff8f1;
  --paper-strong: #fffcf7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.site-shell,
.admin-shell,
.auth-shell,
.public-auth-shell {
  min-height: 100vh;
  padding: 20px;
}

.topbar,
.topbar-nav,
.topbar-brand,
.topbar-brand-copy,
.hero-cta-row,
.metric-ribbon,
.duo-grid,
.story-grid,
.section-grid,
.steps-grid,
.timeline,
.cta-band,
.cta-actions,
.hero-panel,
.hero-copy-block,
.section-head,
.admin-grid,
.admin-hero,
.story-grid-compact,
.public-auth-panel {
  display: flex;
}

.site-shell {
  display: grid;
  gap: 18px;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(20px);
  background: rgba(255, 251, 245, 0.74);
  box-shadow: var(--page-shadow);
}

.topbar-brand {
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.topbar-brand-copy {
  flex-direction: column;
  gap: 2px;
}

.topbar-brand-copy strong {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.topbar-brand-copy span:last-child {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.topbar-brand-compact {
  margin-bottom: 24px;
}

.topbar-nav {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-nav a {
  padding: 10px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: #2d241c;
}

.topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.42);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1f4f46, #b36543);
  color: #fffaf5;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 32px rgba(33, 70, 63, 0.22);
}

.brand-block h1,
.hero-copy-block h1,
.section-copy h2,
.section-head h2,
.quote-card blockquote,
.admin-hero h2,
.public-auth-panel h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.03em;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.landing-shell {
  display: grid;
  gap: 18px;
}

.hero-band,
.section-grid,
.section-block,
.quote-band,
.cta-band,
.public-auth-panel,
.admin-sidebar,
.admin-main,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 30px;
  backdrop-filter: blur(20px);
  box-shadow: var(--page-shadow);
}

.hero-band,
.section-grid,
.cta-band,
.public-auth-panel {
  gap: 18px;
}

.hero-band {
  align-items: stretch;
  justify-content: space-between;
  padding: 28px;
  background: linear-gradient(165deg, rgba(255, 251, 245, 0.9), rgba(243, 230, 212, 0.86));
}

.hero-copy-block,
.hero-panel,
.section-copy,
.section-head {
  flex-direction: column;
}

.hero-copy-block {
  gap: 18px;
  flex: 1.3;
}

.hero-copy-block h1 {
  font-size: clamp(2.7rem, 5.2vw, 5.3rem);
  line-height: 0.95;
  max-width: 13ch;
}

.hero-body,
.section-copy p,
.story-card p,
.path-card p,
.step-card p,
.cta-card p,
.auth-copy,
.admin-card p,
.sidebar-card p,
.sidebar-card li,
.timeline-item p {
  margin: 0;
  color: var(--ink-soft);
}

.hero-cta-row,
.metric-ribbon,
.duo-grid,
.story-grid,
.steps-grid,
.timeline,
.cta-actions,
.admin-grid,
.story-grid-compact {
  gap: 16px;
}

.site-pill,
.admin-link,
.admin-button,
.auth-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(33, 70, 63, 0.16);
  background: rgba(255, 252, 248, 0.78);
  color: #2d241c;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

.site-pill:hover,
.admin-link:hover,
.admin-button:hover:not(:disabled),
.auth-form button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(33, 70, 63, 0.28);
  background: rgba(255, 252, 248, 1);
}

.site-pill-primary,
.admin-button,
.auth-form button {
  border: 0;
  background: linear-gradient(135deg, #1f4f46, #ad5f3d);
  color: #fffaf3;
}

.site-pill-block {
  width: 100%;
}

.hero-panel {
  gap: 16px;
  flex: 0.9;
}

.metric-ribbon,
.duo-grid,
.story-grid,
.steps-grid,
.admin-grid,
.cta-actions {
  flex-wrap: wrap;
}

.metric-card,
.story-card,
.path-card,
.step-card,
.quote-card,
.cta-card,
.public-auth-card,
.admin-card,
.sidebar-card,
.auth-panel {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.74);
  border: 1px solid rgba(68, 48, 33, 0.08);
}

.metric-card {
  flex: 1;
  min-width: 150px;
}

.metric-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.8rem;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.metric-card span,
.sidebar-label {
  color: var(--ink-soft);
}

.sidebar-label {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.story-card h3,
.path-card h3,
.step-card h3,
.cta-card h2,
.admin-card h3,
.timeline-item h3 {
  margin: 0 0 10px;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.02em;
}

.story-card-highlight {
  background: linear-gradient(135deg, rgba(34, 70, 63, 0.95), rgba(27, 52, 48, 0.92));
  border-color: rgba(34, 70, 63, 0.18);
}

.story-card-highlight h2,
.story-card-highlight p,
.story-card-highlight .sidebar-label {
  color: #f7f1e8;
}

.path-card {
  flex: 1;
  min-width: 220px;
}

.path-card-accent {
  background: linear-gradient(135deg, rgba(173, 95, 61, 0.12), rgba(240, 201, 171, 0.34));
}

.section-grid,
.section-block,
.quote-band,
.cta-band {
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.86), rgba(250, 242, 233, 0.88));
}

.section-grid {
  align-items: start;
}

.section-copy {
  gap: 14px;
  min-width: 0;
  flex: 1.05;
}

.section-copy h2,
.section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.story-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.story-grid .story-card:last-child {
  grid-column: 1 / -1;
}

.section-block {
  display: grid;
  gap: 20px;
}

.section-head {
  gap: 8px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-card {
  position: relative;
  overflow: hidden;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(173, 95, 61, 0.12);
  color: var(--accent);
  font-weight: 800;
}

.quote-band {
  background: linear-gradient(145deg, rgba(34, 70, 63, 0.92), rgba(173, 95, 61, 0.82));
}

.quote-card {
  background: transparent;
  border: 0;
  padding: 8px 8px 4px;
}

.quote-card .eyebrow,
.quote-card blockquote {
  color: #f8f2ea;
}

.quote-card blockquote {
  font-size: clamp(1.5rem, 2.7vw, 2.25rem);
  line-height: 1.2;
  max-width: 30ch;
}

.timeline {
  flex-direction: column;
}

.timeline-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid rgba(68, 48, 33, 0.1);
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cta-band {
  align-items: stretch;
  justify-content: space-between;
}

.cta-card {
  flex: 1;
}

.cta-card h2 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
}

.cta-actions {
  width: min(280px, 100%);
  flex-direction: column;
  justify-content: center;
}

.public-auth-shell {
  display: grid;
  place-items: center;
}

.public-auth-panel {
  width: min(1120px, 100%);
  align-items: stretch;
  padding: 26px;
  background: linear-gradient(165deg, rgba(255, 251, 245, 0.92), rgba(241, 226, 205, 0.88));
}

.auth-story,
.public-auth-card,
.auth-form,
.admin-sidebar,
.admin-main,
.auth-panel {
  display: flex;
  flex-direction: column;
}

.auth-story {
  gap: 16px;
  flex: 1.1;
}

.public-auth-card {
  gap: 18px;
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.92), rgba(251, 245, 237, 0.94));
}

.auth-form {
  gap: 12px;
}

.auth-avatar-picker {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.auth-avatar-picker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-avatar-picker-note {
  color: #7d7066;
  font-size: 0.78rem;
}

.auth-avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.auth-avatar-option {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(68, 48, 33, 0.12);
  background: rgba(255, 252, 247, 0.88);
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.auth-avatar-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.auth-avatar-option span {
  font-size: 1.45rem;
  line-height: 1;
}

.auth-avatar-option:hover {
  transform: translateY(-1px);
  border-color: rgba(113, 92, 70, 0.24);
  box-shadow: 0 8px 18px rgba(120, 103, 88, 0.08);
}

.auth-avatar-option-selected,
.auth-avatar-option:has(input:checked) {
  border-color: rgba(73, 112, 92, 0.28);
  background: linear-gradient(180deg, rgba(242, 249, 244, 0.96), rgba(235, 244, 238, 0.9));
  box-shadow:
    0 10px 20px rgba(100, 126, 108, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.composer-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-form input,
.auth-select,
.composer textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(68, 48, 33, 0.12);
  background: var(--paper);
  color: #1f1812;
}

.auth-form input:focus,
.auth-select:focus,
.composer textarea:focus {
  outline: 2px solid rgba(173, 95, 61, 0.2);
  border-color: rgba(173, 95, 61, 0.38);
}

.auth-notice,
.auth-alert {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(68, 48, 33, 0.08);
}

.auth-notice {
  background: rgba(33, 70, 63, 0.1);
  color: var(--forest);
}

.auth-alert {
  background: rgba(173, 95, 61, 0.12);
  color: #8b3416;
}

.auth-footer {
  margin-top: 6px;
}

.story-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
}

.admin-sidebar {
  gap: 18px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.92), rgba(248, 239, 227, 0.76));
}

.admin-main {
  gap: 18px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.8), rgba(251, 245, 237, 0.84));
}

.admin-hero {
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

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

.admin-card-wide {
  grid-column: 1 / -1;
}

.admin-list,
.sidebar-card ul {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.admin-button-secondary {
  width: 100%;
  background: rgba(35, 34, 31, 0.08);
  color: #2d241c;
  border: 1px solid rgba(35, 34, 31, 0.08);
}

.auth-shell {
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(520px, 100%);
  gap: 18px;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 251, 247, 0.86), rgba(251, 245, 237, 0.9));
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-band,
.section-grid,
.section-block,
.quote-band,
.cta-band,
.public-auth-panel,
.admin-sidebar,
.admin-main,
.auth-panel {
  animation: rise-in 420ms ease;
}

@media (max-width: 1120px) {
  .hero-band,
  .section-grid,
  .cta-band,
  .public-auth-panel {
    flex-direction: column;
  }

  .story-grid,
  .steps-grid,
  .admin-grid,
  .story-grid-compact {
    grid-template-columns: 1fr;
  }

  .story-grid .story-card:last-child {
    grid-column: auto;
  }

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

  .admin-hero {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 760px) {
  .site-shell,
  .admin-shell,
  .auth-shell,
  .public-auth-shell {
    padding: 12px;
  }

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

  .topbar-nav {
    width: 100%;
  }

  .hero-copy-block h1 {
    max-width: 100%;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .public-auth-panel,
  .hero-band,
  .section-grid,
  .section-block,
  .quote-band,
  .cta-band,
  .admin-sidebar,
  .admin-main,
  .auth-panel {
    padding: 20px;
    border-radius: 24px;
  }
}

body.home-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: #4f4563;
  background: linear-gradient(180deg, #69489c 0%, #56357f 100%);
}

.home-shell {
  position: relative;
  width: min(1460px, calc(100vw - 28px));
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 14px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.home-shell::before,
.home-shell::after {
  display: none;
}

.home-topbar,
.home-nav,
.home-brand,
.home-brand-copy,
.home-hero,
.home-copy,
.home-actions,
.home-badges,
.home-section-head,
.home-steps,
.home-topics,
.home-cta,
.connection-play,
.connection-stage,
.connection-link,
.connection-panel-footer,
.connection-actions,
.connection-meter {
  display: flex;
}

.home-topbar,
.home-hero,
.home-section,
.home-cta,
.home-character-card {
  position: relative;
  z-index: 1;
}

.home-topbar {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  margin-bottom: 0;
  padding: 14px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 48px rgba(36, 20, 61, 0.22);
}

.home-brand {
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.home-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: linear-gradient(180deg, #7d57bf, #6b4bab);
  color: #ffffff;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.9rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(38, 18, 66, 0.2);
}

.home-brand-copy {
  flex-direction: column;
  gap: 2px;
}

.home-brand-copy strong,
.home-copy h1,
.home-section-head h2,
.home-character-copy h2,
.home-step h3,
.home-cta h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.03em;
}

.home-brand-copy strong {
  font-size: 1.2rem;
}

.home-brand-copy span {
  color: #7a7090;
  font-size: 0.94rem;
}

.home-nav {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.home-nav a {
  color: #6d6184;
  text-decoration: none;
  font-weight: 700;
}

.home-nav-form {
  margin: 0;
}

.home-viewer {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f5f0fc;
  color: #6e4faf;
  font-weight: 800;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.home-button:hover {
  transform: translateY(-1px);
}

.home-button-primary {
  background: linear-gradient(180deg, #7d57bf, #6b4bab);
  color: #ffffff;
  border: 1px solid rgba(103, 73, 156, 0.26);
  box-shadow: 0 12px 22px rgba(52, 28, 86, 0.18);
}

.home-button-primary:hover {
  background: linear-gradient(180deg, #744fb7, #603fa7);
}

.home-button-secondary {
  background: #f8f5fd;
  color: #6c5f84;
  border: 1px solid rgba(139, 121, 181, 0.16);
}

.home-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.home-flash {
  padding: 16px 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(36, 20, 61, 0.16);
}

.home-flash p {
  margin: 0;
  color: #6d6184;
  font-weight: 700;
}

.home-hero {
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 30px 34px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 56px rgba(36, 20, 61, 0.2);
  overflow: hidden;
}

.home-copy {
  flex: 1;
  flex-direction: column;
  gap: 16px;
}

.home-kicker,
.home-character-label {
  margin: 0;
  color: #8b7aa8;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-copy h1 {
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.95;
  max-width: 10ch;
}

.home-lead,
.home-character-copy p,
.home-step p {
  margin: 0;
  color: #6d6184;
  font-size: 1.04rem;
}

.home-chat-launch {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 420px);
  margin: 6px 0 2px;
  padding: 20px 22px;
  border-radius: 28px;
  background: linear-gradient(180deg, #f7f2ff 0%, #ffffff 100%);
  border: 1px solid rgba(121, 92, 176, 0.12);
  box-shadow: 0 20px 36px rgba(43, 24, 74, 0.12);
}

.home-chat-launch-label {
  margin: 0;
  color: #8b7aa8;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-chat-launch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 62px;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7d57bf, #6b4bab);
  color: #ffffff;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  box-shadow: 0 16px 28px rgba(52, 28, 86, 0.22);
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.home-chat-launch-button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #744fb7, #603fa7);
}

.home-chat-launch-link {
  color: #6e4faf;
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 800;
}

.home-chat-launch-link:hover {
  text-decoration: underline;
}

.home-hero-note {
  margin: 0;
  color: #808984;
  font-size: 0.98rem;
  font-weight: 700;
}

.home-actions,
.home-badges {
  flex-wrap: wrap;
  gap: 12px;
}

.home-badges span,
.home-topics span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.home-badges span {
  background: #f6f2ed;
  color: #68716d;
}

.home-character-card,
.home-section,
.home-cta {
  border-radius: 30px;
  background: #fbf9fe;
  box-shadow: 0 18px 32px rgba(45, 23, 76, 0.08);
}

.home-character-card {
  width: min(420px, 100%);
  padding: 24px;
  background: linear-gradient(180deg, #fbf7ff 0%, #ffffff 100%);
}

.home-character {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 16px;
}

.home-bubble,
.home-figure {
  transform-origin: center;
}

.home-bubble-left {
  animation: home-float 4.8s ease-in-out infinite;
}

.home-bubble-right {
  animation: home-float 4.8s ease-in-out infinite 0.8s;
}

.home-figure-left {
  animation: home-sway 5.6s ease-in-out infinite;
}

.home-figure-right {
  animation: home-sway 5.6s ease-in-out infinite 1s;
}

.home-connection-line {
  stroke: #d8cbed;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 8 12;
}

.home-flow-dot {
  fill: #8d75b6;
}

.home-flow-dot-one {
  animation: home-pulse 2.4s ease-in-out infinite;
}

.home-flow-dot-two {
  animation: home-pulse 2.4s ease-in-out infinite 0.4s;
}

.home-flow-dot-three {
  animation: home-pulse 2.4s ease-in-out infinite 0.8s;
}

.home-character-copy {
  display: grid;
  gap: 8px;
}

.home-character-copy h2 {
  font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.home-section {
  padding: 28px;
}

.home-section-accent {
  background: linear-gradient(180deg, #faf8f5 0%, #f7f4ef 100%);
}

.home-section-head {
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.home-section-head h2 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.home-steps {
  gap: 16px;
}

.home-step {
  flex: 1;
  min-width: 0;
  padding: 22px;
  border-radius: 24px;
  background: #faf7f3;
}

.home-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #ebe4dc;
  color: #596661;
  font-weight: 800;
}

.home-step h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.home-topics {
  flex-wrap: wrap;
  gap: 12px;
}

.home-topics span:nth-child(4n + 1) {
  background: #f8f4ef;
  color: #6b7370;
}

.home-topics span:nth-child(4n + 2) {
  background: #f4f8f5;
  color: #67716d;
}

.home-topics span:nth-child(4n + 3) {
  background: #f8f3ef;
  color: #726963;
}

.home-topics span:nth-child(4n) {
  background: #f5f7f6;
  color: #69726e;
}

.home-cta {
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 30px;
  background: linear-gradient(135deg, #faf7f3 0%, #f8f6f3 42%, #f6f8f6 100%);
}

.home-cta h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  max-width: 18ch;
}

@keyframes home-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes home-sway {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(3px);
  }
}

@keyframes home-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.home-section-play {
  background: linear-gradient(180deg, #faf8f5 0%, #f6f8f6 100%);
}

.connection-play {
  align-items: center;
  gap: 22px;
}

.connection-stage,
.connection-panel {
  flex: 1;
}

.connection-stage {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 12%, rgba(233, 226, 217, 0.38), transparent 32%),
    linear-gradient(180deg, #fbfaf7 0%, #f6f8f6 100%);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.connection-stage.is-complete {
  box-shadow: 0 12px 24px rgba(149, 161, 156, 0.1);
}

.connection-person {
  display: grid;
  gap: 8px;
  width: min(180px, 100%);
  text-align: center;
}

.connection-person strong {
  color: #58645f;
  font-size: 1rem;
}

.connection-person span,
.connection-intro,
.connection-status,
.connection-note {
  color: #717974;
}

.connection-avatar {
  display: inline-grid;
  place-self: center;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ece3d8, #e1ebe5);
  color: #5a6762;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(132, 126, 118, 0.08);
}

.connection-avatar-alt {
  background: linear-gradient(135deg, #e4ebe7, #e9efeb);
}

.connection-link {
  position: relative;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 110px;
}

.connection-bridge {
  width: 100%;
  max-width: 180px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #efebe5, #f5f2ed);
  transition: background 180ms ease, transform 180ms ease;
}

.connection-core {
  position: absolute;
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  background: #ffffff;
  color: #5c6863;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(107, 116, 112, 0.08);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.connection-stage.is-active .connection-core {
  transform: scale(1.05);
}

.connection-stage.is-complete .connection-bridge {
  background: linear-gradient(90deg, #ebe1d6, #dfe8e3, #efe9e2);
}

.connection-stage.is-complete .connection-core {
  background: #e1e9e4;
  color: #5b6762;
}

.connection-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 28px;
  background: #faf7f3;
}

.connection-intro,
.connection-status,
.connection-note {
  margin: 0;
}

.connection-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.connection-action {
  flex: 1;
  min-width: 180px;
  padding: 16px;
  border: 1px solid rgba(122, 137, 130, 0.08);
  border-radius: 22px;
  background: #ffffff;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.connection-action:hover {
  transform: translateY(-1px);
  border-color: rgba(144, 157, 151, 0.22);
}

.connection-action span,
.connection-action small {
  display: block;
}

.connection-action span {
  margin-bottom: 6px;
  color: #596661;
  font-weight: 800;
}

.connection-action small {
  color: #727a75;
  font-size: 0.9rem;
}

.connection-action.is-selected {
  border-color: rgba(144, 157, 151, 0.2);
  background: #f7f4ef;
  box-shadow: 0 8px 16px rgba(132, 140, 136, 0.06);
}

.connection-action:disabled {
  cursor: default;
  opacity: 1;
}

.connection-meter {
  gap: 10px;
}

.connection-meter span {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(126, 138, 132, 0.08);
  transition: background-color 140ms ease, transform 140ms ease;
}

.connection-meter span.is-filled {
  background: linear-gradient(90deg, #e5dbd0, #d8e2dd);
  transform: scaleY(1.05);
}

.connection-status {
  min-height: 48px;
  font-size: 1rem;
}

.connection-panel-footer {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.connection-note {
  font-size: 0.94rem;
  font-weight: 700;
}

.connection-reset {
  min-width: 112px;
}

@media (max-width: 980px) {
  body.home-page {
    overflow: auto;
  }

  .home-shell {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .home-hero,
  .home-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-steps {
    flex-direction: column;
  }

  .connection-play,
  .connection-stage {
    flex-direction: column;
  }

  .home-copy h1 {
    max-width: 100%;
  }

  .home-chat-launch {
    width: 100%;
  }

  .home-character-card {
    width: 100%;
  }

  .connection-person {
    width: 100%;
  }

  .connection-link {
    width: 100%;
    min-height: 82px;
  }
}

@media (max-width: 760px) {
  .home-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 16px;
    gap: 12px;
  }

  .home-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-nav {
    width: 100%;
  }

  .home-hero,
  .home-section,
  .home-cta,
  .home-character-card {
    padding: 20px;
    border-radius: 24px;
  }

  .home-copy h1 {
    font-size: clamp(2.2rem, 10vw, 3.3rem);
  }

  .home-chat-launch {
    padding: 18px;
    border-radius: 24px;
  }

  .home-chat-launch-button {
    width: 100%;
    min-width: 0;
  }
}

body.chat-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: #36423e;
  background:
    radial-gradient(circle at top left, rgba(198, 223, 210, 0.58), transparent 34%),
    radial-gradient(circle at top right, rgba(243, 221, 196, 0.62), transparent 30%),
    linear-gradient(180deg, #fffcf7 0%, #f2eadf 100%);
}

.chat-page [hidden] {
  display: none !important;
}

.chat-shell {
  width: calc(100% - 24px);
  max-width: 1720px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 18px 0;
  box-sizing: border-box;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  position: relative;
}

.chat-shell.chat-shell-with-flash {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.chat-hero {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
  border: 1px solid rgba(89, 103, 96, 0.24);
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(214, 231, 221, 0.72), transparent 30%),
    radial-gradient(circle at bottom left, rgba(247, 228, 206, 0.64), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(245, 238, 229, 0.92));
  box-shadow:
    0 20px 42px rgba(94, 83, 71, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.chat-hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-hero-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(250, 246, 240, 0.98), rgba(231, 239, 234, 0.92));
  border: 1px solid rgba(101, 114, 107, 0.16);
  color: #40504a;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 10px 20px rgba(99, 88, 75, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-hero-brand strong {
  color: #30403b;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(248px, 286px) minmax(0, 1.35fr) minmax(258px, 318px);
  gap: 14px;
  justify-content: center;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.chat-layout-active {
  grid-template-columns: minmax(248px, 286px) minmax(0, 1.35fr) minmax(258px, 318px);
}

.chat-sidebar,
.chat-room,
.chat-profile-panel,
.chat-toolbar-actions,
.chat-photo-preview,
.chat-compose-row {
  display: flex;
}

.chat-sidebar,
.chat-room,
.chat-profile-panel,
.chat-flash {
  border: 1px solid rgba(89, 103, 96, 0.28);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 20px 42px rgba(94, 83, 71, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.chat-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: 10px;
  padding: 18px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(243, 236, 227, 0.9));
}

.chat-profile-panel {
  height: 100%;
  min-height: 0;
  padding: 16px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(243, 237, 228, 0.92));
}

.chat-profile-panel-idle {
  grid-template-rows: auto minmax(0, 1fr);
}

.chat-side-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.chat-side-toolbar-idle {
  padding-top: 6px;
}

.chat-side-tool {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(109, 121, 114, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: #586661;
  box-shadow: 0 10px 18px rgba(101, 91, 79, 0.08);
}

.chat-side-tool:hover,
.chat-side-tool-active {
  color: #4c356f;
  border-color: rgba(109, 84, 168, 0.22);
  background: rgba(246, 241, 255, 0.96);
}

.chat-side-tool svg {
  width: 18px;
  height: 18px;
}

.chat-side-tool-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #7a56c7;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 14px rgba(74, 54, 118, 0.16);
}

.chat-side-drawer {
  min-height: 0;
}

.chat-global-blocked {
  position: absolute;
  top: 18px;
  right: 12px;
  z-index: 12;
  display: grid;
  justify-items: end;
  gap: 12px;
  pointer-events: none;
}

.chat-global-blocked > * {
  pointer-events: auto;
}

.chat-global-blocked-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.chat-global-blocked-panel {
  width: min(340px, calc(100vw - 48px));
  max-height: min(460px, calc(100vh - 96px));
  max-height: min(460px, calc(100dvh - 96px));
}

.chat-side-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-side-drawer-head strong {
  color: #374540;
  font-size: 0.96rem;
}

.chat-side-drawer-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(109, 121, 114, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #596762;
}

.chat-side-drawer-close svg {
  width: 16px;
  height: 16px;
}

.chat-match-controls,
.chat-match-panel,
.chat-conversation-empty,
.chat-idle-state,
.chat-match-waiting {
  border: 1px solid rgba(115, 104, 92, 0.22);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 239, 229, 0.88));
  box-shadow:
    0 12px 24px rgba(111, 99, 85, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.chat-match-controls,
.chat-match-panel,
.chat-match-waiting {
  display: grid;
  gap: 10px;
}

.chat-match-controls {
  display: contents;
}

.chat-match-panel-header,
.chat-topic-option,
.chat-match-waiting {
  display: grid;
  gap: 6px;
}

.chat-match-panel-header strong,
.chat-idle-state strong,
.chat-match-waiting strong {
  color: #3f4d48;
  font-size: 1rem;
}

.chat-match-panel-copy,
.chat-conversation-empty p,
.chat-idle-state p,
.chat-match-panel-feedback,
.chat-topic-option span,
.chat-match-waiting p {
  margin: 0;
  color: #56635f;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-new-trigger,
.chat-match-cancel-button {
  width: 100%;
  min-height: 0;
  color: #43504c;
  font-weight: 700;
  text-align: left;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.chat-new-trigger {
  appearance: none;
}

.chat-new-trigger-avatar {
  font-size: 1.45rem;
  line-height: 1;
}

.chat-new-trigger:hover,
.chat-topic-option:hover {
  transform: translateY(-1px);
}

.chat-match-waiting {
  padding: 12px 14px;
}

.chat-conversation-waiting {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.chat-conversation-waiting .chat-conversation-copy {
  gap: 1px;
}

.chat-match-cancel-button {
  padding: 10px 14px;
  border: 1px solid rgba(138, 113, 93, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 248, 240, 1), rgba(247, 236, 226, 0.96));
  color: #795643;
}

.chat-conversation-waiting .chat-match-cancel-button {
  width: auto;
  min-width: 0;
  white-space: nowrap;
  justify-self: end;
  text-align: center;
}

.chat-match-panel {
  gap: 14px;
  padding: 14px;
}

.chat-match-panel-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.chat-match-panel-close {
  width: 32px;
  height: 32px;
}

.chat-match-panel-feedback {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 241, 229, 0.98);
  color: #8b5338;
}

.chat-topic-grid {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-topic-option {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid rgba(113, 101, 88, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 237, 227, 0.94));
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.chat-topic-option strong {
  color: #43514c;
  font-size: 0.94rem;
}

.chat-topic-option:hover {
  border-color: rgba(92, 118, 107, 0.24);
  background: linear-gradient(180deg, rgba(247, 252, 249, 0.96), rgba(238, 245, 240, 0.9));
  box-shadow: 0 10px 18px rgba(112, 126, 115, 0.08);
}

.chat-topic-option:disabled {
  opacity: 0.62;
  cursor: wait;
}

.chat-conversation-items {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.chat-conversation-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.chat-conversation-empty {
  padding: 18px 14px;
  text-align: center;
}

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

.chat-conversation {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  border-radius: 22px;
  text-decoration: none;
  border: 1px solid rgba(111, 100, 88, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 238, 228, 0.82));
  backdrop-filter: blur(12px) saturate(116%);
  -webkit-backdrop-filter: blur(12px) saturate(116%);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.chat-conversation-row .chat-conversation {
  min-width: 0;
}

.chat-conversation:hover {
  transform: translateY(-1px);
  border-color: rgba(92, 108, 100, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 239, 229, 0.9));
  box-shadow: 0 14px 22px rgba(108, 96, 82, 0.09);
}

.chat-conversation-static {
  cursor: default;
}

.chat-conversation-active {
  border-color: rgba(88, 117, 104, 0.38);
  background: linear-gradient(180deg, rgba(235, 245, 238, 0.95), rgba(228, 239, 232, 0.92));
  box-shadow: 0 14px 24px rgba(102, 118, 107, 0.12);
}

.chat-conversation-unread {
  border-color: rgba(77, 100, 91, 0.42);
  background: linear-gradient(180deg, rgba(248, 252, 249, 0.96), rgba(234, 241, 236, 0.92));
  box-shadow:
    0 16px 28px rgba(97, 112, 102, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.chat-conversation-returned {
  animation: chat-conversation-return 420ms ease;
}

.chat-conversation-delete {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(240, 232, 223, 0.92);
  color: #7e6f64;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.chat-conversation-delete svg {
  width: 14px;
  height: 14px;
}

.chat-conversation-row:hover .chat-conversation-delete,
.chat-conversation-row:focus-within .chat-conversation-delete {
  opacity: 1;
  pointer-events: auto;
}

.chat-conversation-delete:hover:not(:disabled) {
  background: rgba(230, 207, 198, 0.98);
  color: #8f4d3f;
}

.chat-conversation-delete:disabled {
  opacity: 0.58;
  cursor: wait;
}

.chat-conversation-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 236, 229, 0.98), rgba(226, 236, 229, 0.94));
  border: 1px solid rgba(102, 112, 105, 0.22);
  color: #47534e;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
}

.chat-conversation-presence {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.96);
  background: #b9c1bc;
  box-shadow: 0 0 0 4px rgba(185, 193, 188, 0.12);
}

.chat-conversation-presence-online {
  background: #36b85d;
  box-shadow: 0 0 0 4px rgba(54, 184, 93, 0.14);
}

.chat-conversation-avatar-search {
  overflow: hidden;
}

.chat-search-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.chat-search-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.46;
  transform: translateY(0) scale(0.92);
  animation: chat-search-dot-wave 1.15s ease-in-out infinite;
}

.chat-search-dot:nth-child(2) {
  animation-delay: 0.14s;
}

.chat-search-dot:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes chat-search-dot-wave {
  0%,
  60%,
  100% {
    opacity: 0.42;
    transform: translateY(0) scale(0.92);
  }

  30% {
    opacity: 1;
    transform: translateY(-4px) scale(1.08);
  }
}

.chat-conversation-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-nick-with-badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-conversation-copy strong,
.chat-conversation-topic,
.chat-conversation-preview {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-conversation-copy strong {
  color: #3e4b46;
  font-size: 0.98rem;
}

.chat-friend-badge {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(111, 92, 170, 0.1);
  color: #6e56b7;
}

.chat-friend-badge svg {
  width: 11px;
  height: 11px;
}

.chat-conversation-topic {
  color: #68756f;
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-conversation-preview {
  color: #505d59;
  font-size: 0.84rem;
}

.chat-conversation-unread .chat-conversation-copy strong,
.chat-conversation-unread .chat-conversation-topic,
.chat-conversation-unread .chat-conversation-preview {
  color: #2c3733;
  font-weight: 800;
}

@keyframes chat-conversation-return {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-flash {
  padding: 14px 18px;
}

.chat-flash p {
  margin: 0;
  color: #4d5a56;
  font-weight: 700;
}

.chat-room {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  height: 100%;
  min-height: 0;
  padding: 14px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(244, 236, 226, 0.94));
}

.chat-room > * {
  min-height: 0;
}

.chat-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(111, 100, 88, 0.22);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 239, 229, 0.88));
  box-shadow:
    0 12px 24px rgba(111, 99, 85, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.chat-room-head-main,
.chat-room-head-actions {
  display: flex;
  align-items: center;
}

.chat-room-head-main {
  min-width: 0;
  gap: 12px;
}

.chat-room-head-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 236, 229, 0.98), rgba(226, 236, 229, 0.94));
  border: 1px solid rgba(102, 112, 105, 0.22);
  color: #46524d;
  font-size: 1.32rem;
  line-height: 1;
}

.chat-room-head-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.chat-nick-with-badge-head {
  align-items: center;
}

.chat-room-head-copy strong {
  color: #31403b;
  font-size: 0.98rem;
}

.chat-friend-badge-head {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
}

.chat-room-head-actions {
  gap: 8px;
}

.chat-room-head-action {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(111, 100, 88, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: #42504b;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.chat-room-head-action:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 109, 100, 0.3);
  background: rgba(252, 253, 251, 0.98);
  box-shadow: 0 12px 20px rgba(101, 113, 104, 0.12);
}

.chat-room-head-action svg {
  width: 18px;
  height: 18px;
}

.chat-room-head-action-call {
  color: #456ea9;
  border-color: rgba(101, 132, 184, 0.18);
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.94), rgba(235, 243, 255, 0.84));
}

.chat-room-head-action-call:hover {
  border-color: rgba(82, 118, 175, 0.28);
  background: linear-gradient(180deg, rgba(249, 252, 255, 1), rgba(239, 246, 255, 0.92));
  box-shadow: 0 10px 20px rgba(95, 126, 175, 0.12);
}

.chat-room-head-action-call:disabled {
  opacity: 0.62;
  cursor: wait;
}

.chat-room-head-action-danger {
  color: #8d5d5d;
  border-color: rgba(153, 99, 99, 0.18);
  background: rgba(255, 247, 247, 0.82);
}

.chat-room-head-action-danger:hover {
  border-color: rgba(153, 99, 99, 0.28);
  background: rgba(255, 242, 242, 0.92);
  box-shadow: 0 10px 18px rgba(153, 99, 99, 0.08);
}

.chat-profile-card,
.chat-media-card,
.chat-blocked-card {
  border: 1px solid rgba(111, 100, 88, 0.22);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 238, 228, 0.9));
  box-shadow:
    0 12px 24px rgba(111, 99, 85, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.chat-profile-card {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.chat-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 236, 229, 0.98), rgba(226, 236, 229, 0.95));
  border: 1px solid rgba(102, 112, 105, 0.22);
  color: #44514c;
  font-size: 1.8rem;
  line-height: 1;
  font-weight: 800;
}

.chat-profile-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.chat-profile-copy strong {
  color: #33413d;
  font-size: 1.05rem;
}

.chat-profile-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 233, 224, 0.94);
  color: #626a67;
  font-size: 0.82rem;
  font-weight: 700;
}

.chat-profile-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #b8bfbb;
  box-shadow: 0 0 0 4px rgba(184, 191, 187, 0.14);
}

.chat-profile-status-online {
  background: rgba(233, 245, 236, 0.88);
  color: #3f6d4b;
}

.chat-profile-status-online .chat-profile-status-dot {
  background: #3fb563;
  box-shadow: 0 0 0 4px rgba(63, 181, 99, 0.14);
}

.chat-media-card {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.chat-blocked-card {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
}

.chat-blocked-card-fill {
  height: 100%;
  min-height: 0;
  max-height: none;
}

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

.chat-side-head strong {
  color: #374540;
  font-size: 0.96rem;
}

.chat-side-head span {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(235, 240, 236, 0.98);
  color: #515d58;
  font-size: 0.82rem;
  font-weight: 800;
}

.chat-media-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  padding-right: 2px;
}

.chat-media-item {
  min-width: 0;
}

.chat-media-item-audio {
  grid-column: 1 / -1;
}

.chat-media-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.chat-media-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(109, 120, 113, 0.18);
  box-shadow: 0 12px 22px rgba(110, 98, 84, 0.12);
}

.chat-media-file {
  min-height: 78px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  text-decoration: none;
  border: 1px solid rgba(111, 124, 116, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: #43504c;
}

.chat-media-file-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(240, 244, 255, 0.94);
  color: #4f75b6;
}

.chat-media-file-icon svg {
  width: 18px;
  height: 18px;
}

.chat-media-file-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.chat-media-file-copy strong,
.chat-media-file-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-media-file-copy strong {
  color: #374540;
  font-size: 0.9rem;
}

.chat-media-file-copy span {
  color: #606a66;
  font-size: 0.8rem;
}

.chat-media-empty {
  margin: 0;
  grid-column: 1 / -1;
  color: #58635f;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-sidebar-searchbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-conversation-list-head {
  display: flex;
}

.chat-sidebar-search-action,
.chat-friend-panel-close {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
}

.chat-sidebar-search-action-wide {
  width: auto;
  min-width: 108px;
  padding: 0 14px;
  gap: 8px;
}

.chat-sidebar-search-action svg,
.chat-friend-panel-close svg {
  width: 18px;
  height: 18px;
}

.chat-sidebar-search-action-label {
  font-size: 0.82rem;
  font-weight: 800;
}

.chat-sidebar-search-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.chat-friend-search-panel,
.chat-friend-requests-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
}

.chat-friend-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-friend-panel-head strong {
  font-size: 0.94rem;
}

.chat-friend-search-feedback,
.chat-friend-request-feedback,
.chat-friend-search-hint,
.chat-friend-search-empty,
.chat-friend-request-empty {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.chat-friend-search-results,
.chat-friend-request-list {
  display: grid;
  gap: 8px;
}

.chat-friend-search-item,
.chat-friend-request-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border-radius: 16px;
}

.chat-friend-search-avatar,
.chat-friend-request-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
}

.chat-friend-search-copy,
.chat-friend-request-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-friend-search-copy strong,
.chat-friend-search-copy span,
.chat-friend-request-copy strong,
.chat-friend-request-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-friend-search-copy strong,
.chat-friend-request-copy strong {
  font-size: 0.93rem;
}

.chat-friend-search-copy span,
.chat-friend-request-copy span {
  font-size: 0.78rem;
}

.chat-friend-search-action,
.chat-friend-request-action {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.chat-friend-request-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-blocked-feedback,
.chat-blocked-empty {
  margin: 0;
  color: #58635f;
  font-size: 0.88rem;
  line-height: 1.45;
}

.chat-blocked-feedback {
  color: #7a5144;
  font-weight: 700;
}

.chat-blocked-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-right: 2px;
}

.chat-blocked-user {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 11px 12px;
  border-radius: 20px;
  border: 1px solid rgba(111, 124, 116, 0.2);
  background: rgba(255, 255, 255, 0.86);
}

.chat-blocked-user-avatar {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(242, 236, 229, 0.98), rgba(226, 236, 229, 0.94));
  border: 1px solid rgba(102, 112, 105, 0.22);
  color: #47534e;
  font-size: 1.25rem;
  line-height: 1;
}

.chat-blocked-user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-blocked-user-copy strong,
.chat-blocked-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-blocked-user-copy strong {
  color: #37443f;
  font-size: 0.94rem;
}

.chat-blocked-user-copy span {
  color: #6b7570;
  font-size: 0.8rem;
}

.chat-blocked-user-action {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(81, 107, 98, 0.24);
  background: rgba(247, 251, 248, 0.94);
  color: #355149;
  font-size: 0.82rem;
  font-weight: 800;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.chat-blocked-user-action:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(71, 102, 91, 0.34);
  background: rgba(252, 255, 253, 0.98);
}

.chat-blocked-user-action:disabled {
  opacity: 0.58;
  cursor: wait;
}

.chat-room-idle {
  grid-template-rows: minmax(0, 1fr);
  padding: 0;
}

.chat-idle-state {
  width: 100%;
  height: 100%;
  max-width: none;
  padding: 34px 38px;
  text-align: center;
  display: grid;
  place-content: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 242, 233, 0.56));
  box-shadow: none;
}

.chat-log {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 12px;
  height: 100%;
  min-height: 0;
  padding: 20px 16px 20px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scroll-behavior: smooth;
  position: relative;
  border-radius: 24px;
  background-color: #f6fbff;
  background-image: url("/static/chat-wallpaper.svg");
  background-size: 560px 560px;
  background-repeat: repeat;
  background-position: 0 0;
  background-attachment: local;
  border: 1px solid rgba(183, 214, 235, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.chat-log::before {
  content: "";
  flex: 1 1 0;
}

.chat-log.chat-log-sparse {
  justify-content: flex-start;
}

.chat-message,
.chat-empty {
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  align-self: flex-start;
  width: fit-content;
  max-width: min(84%, 780px);
}

.chat-log.chat-log-sparse .chat-message {
  width: fit-content;
  max-width: min(84%, 780px);
  align-self: flex-start;
}

.chat-message {
  grid-template-columns: auto auto;
  align-items: start;
  column-gap: 8px;
}

.chat-message-content {
  display: grid;
  gap: 6px;
  grid-column: 1;
  grid-row: 1;
}

.chat-message-bubble,
.chat-empty {
  padding: 12px 16px;
  border-radius: 24px 24px 24px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 236, 225, 0.84));
  border: 1px solid rgba(111, 100, 88, 0.26);
  box-shadow:
    0 10px 22px rgba(103, 91, 77, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px) saturate(112%);
  -webkit-backdrop-filter: blur(8px) saturate(112%);
}

.chat-log.chat-log-sparse .chat-message-bubble {
  width: auto;
  min-height: 0;
  display: block;
}

.chat-message-self {
  align-self: flex-end;
}

.chat-log.chat-log-sparse .chat-message-self .chat-message-bubble {
  margin-left: 0;
}

.chat-message-self .chat-message-bubble {
  grid-column: 1;
  grid-row: 1;
  border-radius: 24px 24px 12px 24px;
  background: linear-gradient(180deg, rgba(235, 246, 239, 0.94), rgba(225, 238, 230, 0.9));
  border-color: rgba(88, 118, 103, 0.34);
}

.chat-message-attachment .chat-message-content {
  gap: 8px;
}

.chat-message-attachment .chat-message-bubble {
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: grid;
  gap: 8px;
}

.chat-message-attachment .chat-message-bubble > p {
  margin: 0;
  padding: 12px 16px;
  border-radius: 24px 24px 24px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 236, 225, 0.84));
  border: 1px solid rgba(111, 100, 88, 0.26);
  box-shadow:
    0 10px 22px rgba(103, 91, 77, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.chat-message-self.chat-message-attachment .chat-message-bubble > p {
  border-radius: 24px 24px 12px 24px;
  background: linear-gradient(180deg, rgba(235, 246, 239, 0.94), rgba(225, 238, 230, 0.9));
  border-color: rgba(88, 118, 103, 0.34);
}

.chat-message-self .chat-message-content {
  justify-items: end;
}

.chat-message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-message-self .chat-message-reactions {
  justify-content: flex-end;
}

.chat-message-reaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid rgba(111, 100, 88, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #4f5c58;
  font-size: 0.76rem;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(113, 103, 92, 0.06);
}

.chat-message-reaction small {
  font-size: 0.71rem;
  color: #64706a;
}

.chat-message-reaction-active {
  border-color: rgba(88, 118, 103, 0.38);
  background: rgba(231, 242, 235, 0.96);
  color: #43544d;
}

.chat-message-actions {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  align-self: start;
  justify-self: start;
}

.chat-message-menu-toggle {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  border: 1px solid rgba(107, 118, 111, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #5a6762;
  box-shadow: 0 8px 18px rgba(96, 85, 73, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.chat-message-menu-toggle svg {
  width: 14px;
  height: 14px;
}

.chat-message:hover .chat-message-menu-toggle,
.chat-message:focus-within .chat-message-menu-toggle {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.chat-message-menu-toggle:hover,
.chat-message-menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.96);
  color: #58665f;
}

.chat-message-menu {
  position: absolute;
  top: 36px;
  right: 0;
  z-index: 4;
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(111, 100, 88, 0.22);
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.98);
  box-shadow:
    0 18px 38px rgba(95, 86, 75, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(118%);
  -webkit-backdrop-filter: blur(16px) saturate(118%);
}

.chat-message-menu-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chat-message-menu-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(247, 241, 233, 0.95);
  color: #46534e;
  font-size: 1.02rem;
  line-height: 1;
}

.chat-message-menu-item-danger {
  color: #754a4a;
}

.chat-message-menu-item svg {
  width: 16px;
  height: 16px;
}

.chat-message-menu-item:hover,
.chat-message-menu-item:focus-visible {
  background: rgba(236, 241, 237, 0.92);
}

.chat-message-reaction-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.chat-message-reaction-option {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(111, 100, 88, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 1rem;
  line-height: 1;
}

.chat-message-reaction-option:hover,
.chat-message-reaction-option:focus-visible {
  background: rgba(240, 246, 241, 0.94);
  transform: translateY(-1px);
}

.chat-message-media-only {
  width: fit-content;
  max-width: min(76%, 460px);
}

.chat-log.chat-log-sparse .chat-message-media-only {
  width: fit-content;
  max-width: min(76%, 460px);
  align-self: flex-start;
}

.chat-log.chat-log-sparse .chat-message-self.chat-message-media-only {
  align-self: flex-end;
}

.chat-message-media-only .chat-message-bubble {
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: contents;
}

.chat-log.chat-log-sparse .chat-message-media-only .chat-message-bubble {
  min-height: 0;
  width: auto;
}

.chat-message-bubble p,
.chat-empty p {
  margin: 0;
  color: #33403c;
  font-size: 0.97rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-message-photo {
  margin: 0;
  display: inline-block;
  line-height: 0;
}

.chat-view-once-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(111, 126, 148, 0.2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(244, 248, 255, 0.9), rgba(234, 241, 251, 0.78));
  color: #56666d;
  box-shadow: 0 12px 22px rgba(108, 124, 150, 0.08);
}

.chat-view-once-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #54709b;
}

.chat-view-once-icons svg {
  width: 20px;
  height: 20px;
}

.chat-view-once-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(72, 108, 165, 0.12);
  color: #466ca5;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.chat-message-self .chat-view-once-card {
  background: linear-gradient(180deg, rgba(235, 246, 240, 0.9), rgba(227, 239, 232, 0.78));
}

.chat-message-audio {
  margin: 0;
  display: inline-block;
  width: auto;
  line-height: 0;
}

.chat-message-photo img {
  display: block;
  width: min(100%, 420px);
  border-radius: 18px;
  border: 0;
  box-shadow: none;
  cursor: zoom-in;
}

.chat-message-attachment .chat-message-photo img {
  border: 0;
}

.chat-message-audio audio {
  width: min(320px, 72vw);
  min-width: 0;
  max-width: 100%;
  display: block;
}

.chat-message-seen {
  display: block;
  align-self: start;
  justify-self: end;
  margin-top: 2px;
  color: #5b6661;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
}

.chat-empty {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.chat-composer {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 254, 251, 0.9) 0%, rgba(247, 240, 229, 0.88) 100%);
  border: 1px solid rgba(88, 103, 96, 0.28);
  box-shadow:
    0 14px 28px rgba(104, 92, 79, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px) saturate(112%);
  -webkit-backdrop-filter: blur(10px) saturate(112%);
}

.chat-status-message {
  margin: 0;
  color: #495652;
  font-size: 0.84rem;
  font-weight: 700;
}

.chat-toolbar-actions {
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.chat-toolbar-actions-inline {
  padding-bottom: 2px;
}

.chat-tool-icon,
.chat-photo-trigger,
.chat-photo-clear,
.chat-send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(101, 132, 184, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.96), rgba(237, 244, 255, 0.82));
  color: #4370b1;
  box-shadow: 0 6px 14px rgba(105, 132, 176, 0.08);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.chat-tool-icon:hover,
.chat-photo-trigger:hover,
.chat-photo-clear:hover,
.chat-send-button:hover {
  transform: translateY(-1px);
  border-color: rgba(82, 118, 175, 0.28);
  background: linear-gradient(180deg, rgba(250, 252, 255, 1), rgba(240, 246, 255, 0.92));
  box-shadow: 0 10px 18px rgba(95, 126, 175, 0.12);
}

.chat-tool-icon svg,
.chat-send-button svg {
  width: 19px;
  height: 19px;
}

.chat-tool-icon-1x {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.chat-tool-icon-1x span {
  line-height: 1;
}

.chat-tool-icon-active {
  transform: translateY(-1px);
  border-color: rgba(66, 108, 170, 0.48);
  background: linear-gradient(180deg, rgba(88, 125, 183, 0.98), rgba(69, 104, 160, 0.94));
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(78, 111, 168, 0.22);
}

.chat-photo-trigger {
  cursor: pointer;
}

.chat-photo-preview {
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(245, 241, 234, 0.42));
  border: 1px solid rgba(126, 137, 152, 0.16);
  box-shadow: 0 8px 16px rgba(120, 132, 149, 0.06);
}

.chat-voice-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(245, 241, 234, 0.42));
  border: 1px solid rgba(126, 137, 152, 0.16);
  box-shadow: 0 8px 16px rgba(120, 132, 149, 0.06);
}

.chat-voice-preview audio {
  width: min(240px, 52vw);
  max-width: 100%;
  display: block;
}

.chat-photo-preview img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(104, 121, 114, 0.12);
}

.chat-photo-view-once-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(84, 119, 177, 0.94), rgba(70, 104, 160, 0.94));
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 18px rgba(75, 107, 162, 0.16);
}

.chat-photo-clear {
  width: 30px;
  height: 30px;
}

.chat-voice-clear {
  width: 30px;
  height: 30px;
}

.chat-tool-icon-recording {
  position: relative;
  border-color: rgba(188, 91, 91, 0.28);
  background: linear-gradient(180deg, rgba(255, 245, 245, 1), rgba(255, 233, 233, 0.92));
  color: #b34d4d;
  box-shadow: 0 10px 18px rgba(179, 77, 77, 0.12);
  animation: chat-recording-pulse 1s ease-in-out infinite;
}

.chat-tool-icon-recording::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d84b4b;
  box-shadow: 0 0 0 0 rgba(216, 75, 75, 0.38);
  animation: chat-recording-dot 1s ease-in-out infinite;
}

.chat-tool-icon-recording svg {
  animation: chat-recording-icon 1s ease-in-out infinite;
}

@keyframes chat-recording-pulse {
  0%,
  100% {
    border-color: rgba(188, 91, 91, 0.28);
    background: linear-gradient(180deg, rgba(255, 245, 245, 1), rgba(255, 233, 233, 0.92));
    box-shadow: 0 10px 18px rgba(179, 77, 77, 0.12);
  }

  50% {
    border-color: rgba(216, 75, 75, 0.64);
    background: linear-gradient(180deg, rgba(255, 234, 234, 1), rgba(255, 214, 214, 0.96));
    box-shadow: 0 14px 24px rgba(216, 75, 75, 0.24);
  }
}

@keyframes chat-recording-dot {
  0%,
  100% {
    opacity: 1;
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(216, 75, 75, 0.34);
  }

  50% {
    opacity: 0.35;
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(216, 75, 75, 0);
  }
}

@keyframes chat-recording-icon {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.62;
  }
}

.chat-emoji-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 42px));
  justify-content: start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f9fbf8, #f3f7f4);
  border: 1px solid rgba(104, 121, 114, 0.18);
  max-width: 470px;
}

.chat-emoji-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(104, 121, 114, 0.12);
  border-radius: 999px;
  background: #fffdf9;
  font-size: 1.15rem;
  line-height: 1;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.chat-emoji-option:hover {
  transform: translateY(-1px);
  border-color: rgba(104, 121, 114, 0.24);
  background: #ffffff;
}

.chat-compose-status {
  min-height: 0;
  padding: 0 2px;
}

.chat-compose-row {
  align-items: flex-end;
  gap: 10px;
}

.chat-input-stack {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 8px;
}

.chat-composer textarea {
  width: 100%;
  min-height: 40px;
  max-height: 160px;
  padding: 9px 16px;
  border-radius: 24px;
  border: 1px solid rgba(102, 115, 108, 0.26);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 241, 232, 0.92));
  color: #37443f;
  line-height: 20px;
  box-sizing: border-box;
  resize: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 16px rgba(103, 92, 79, 0.08);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
}

.chat-composer textarea:focus {
  outline: 2px solid rgba(122, 147, 136, 0.18);
  border-color: rgba(95, 117, 107, 0.32);
}

.chat-send-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(180deg, #5d89d2, #4574ba);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(67, 112, 177, 0.18);
}

.chat-send-button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.chat-message-enter {
  animation: chat-enter 220ms ease;
}

body.chat-lightbox-open {
  overflow: hidden;
}

body.chat-call-open {
  overflow: hidden;
}

.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(36, 44, 52, 0.62);
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
}

.chat-lightbox-dialog {
  position: relative;
  display: block;
  padding: 0;
  margin: 0;
  width: auto;
  max-width: calc(100vw - 56px);
  max-width: calc(100dvw - 56px);
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  background: transparent;
  border: 0;
  box-shadow: none;
}

.chat-lightbox-dialog img {
  display: block;
  width: auto;
  max-width: calc(100vw - 56px);
  max-width: calc(100dvw - 56px);
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  object-fit: contain;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}

.chat-lightbox[data-view-once="true"] .chat-lightbox-dialog::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  overflow: hidden;
}

.chat-lightbox[data-view-once="true"] .chat-lightbox-dialog::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 1;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(181, 214, 255, 0.98));
  transform-origin: left center;
  animation: chat-view-once-progress 5s linear forwards;
}

.chat-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(37, 46, 58, 0.56);
  color: #ffffff;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.chat-lightbox-close:hover {
  transform: translateY(-1px);
  background: rgba(37, 46, 58, 0.76);
  border-color: rgba(255, 255, 255, 0.4);
}

.chat-lightbox-close svg {
  width: 18px;
  height: 18px;
}

.chat-call-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 40, 48, 0.56);
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
}

.chat-call-dialog {
  width: min(100%, 980px);
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(252, 249, 245, 0.94), rgba(246, 238, 228, 0.9));
  box-shadow: 0 28px 64px rgba(26, 31, 39, 0.22);
}

.chat-call-modal[data-call-state="incoming"] .chat-call-dialog {
  width: min(100%, 560px);
  gap: 14px;
  padding: 14px 16px 16px;
  border-radius: 28px;
}

.chat-call-modal[data-call-state="incoming"] .chat-call-head {
  display: none;
}

.chat-call-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-call-head-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chat-call-head-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.chat-call-head-copy strong {
  color: #3c4742;
  font-size: 1.12rem;
}

.chat-call-head-copy span {
  color: #6e7873;
  font-size: 0.88rem;
  font-weight: 700;
}

.chat-call-close {
  position: static;
  background: rgba(53, 63, 74, 0.62);
}

.chat-call-minimize {
  position: static;
  background: rgba(53, 63, 74, 0.62);
}

.chat-call-restore-icon {
  display: none;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-minimize-icon {
  display: none;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-restore-icon {
  display: block;
}

.chat-call-videos {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
}

.chat-call-modal[data-call-state="incoming"] .chat-call-videos {
  grid-template-columns: 1fr;
  gap: 10px;
}

.chat-call-remote-wrap,
.chat-call-local-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(110, 121, 114, 0.16);
  background:
    radial-gradient(circle at top, rgba(229, 235, 245, 0.42), transparent 42%),
    linear-gradient(180deg, rgba(230, 234, 239, 0.72), rgba(212, 217, 222, 0.88));
  min-height: 220px;
}

.chat-call-remote-wrap {
  min-height: min(64vh, 620px);
  cursor: pointer;
}

.chat-call-modal[data-call-state="incoming"] .chat-call-remote-wrap {
  min-height: 220px;
}

.chat-call-local-wrap {
  align-self: end;
  min-height: 160px;
}

.chat-call-modal[data-call-state="incoming"] .chat-call-local-wrap {
  display: none;
}

.chat-call-remote-video,
.chat-call-local-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: transparent;
}

.chat-call-video-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  justify-items: center;
  color: #52605b;
  text-align: center;
}

.chat-call-video-empty span {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(106, 118, 112, 0.14);
  font-size: 1.55rem;
  font-weight: 800;
}

.chat-call-video-empty strong {
  font-size: 1rem;
}

.chat-call-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.chat-call-action {
  min-width: 124px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(93, 104, 114, 0.16);
}

.chat-call-action-icon-only {
  min-width: 44px;
  width: 44px;
  padding: 0;
}

.chat-call-action-icon-only svg {
  width: 18px;
  height: 18px;
}

.chat-call-action-accept {
  background: linear-gradient(180deg, #5caf74, #3f8d58);
}

.chat-call-action-decline,
.chat-call-action-end {
  background: linear-gradient(180deg, #cb745f, #b35c48);
}

.chat-call-modal[data-call-minimized="true"] {
  inset: auto 18px 18px auto;
  width: min(340px, calc(100vw - 24px));
  height: auto;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  place-items: end;
  pointer-events: none;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-dialog {
  width: 100%;
  max-width: 340px;
  gap: 10px;
  padding: 12px;
  border-radius: 24px;
  box-shadow: 0 22px 46px rgba(26, 31, 39, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-videos {
  grid-template-columns: 1fr;
  gap: 8px;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-remote-wrap {
  min-height: 190px;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-local-wrap {
  position: absolute;
  right: 14px;
  bottom: 68px;
  width: 92px;
  min-height: 74px;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(28, 35, 43, 0.24);
}

.chat-call-modal[data-call-minimized="true"] .chat-call-actions {
  justify-content: stretch;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-action {
  flex: 1 1 0;
  min-width: 0;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-head-copy strong {
  font-size: 1rem;
}

.chat-call-modal[data-call-minimized="true"] .chat-call-head-copy span {
  font-size: 0.8rem;
}

@keyframes chat-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chat-view-once-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@media (max-width: 760px) {
  .chat-shell {
    width: calc(100% - 12px);
    padding: 8px 0;
  }

  .chat-hero {
    padding: 14px 16px;
    border-radius: 24px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chat-layout-active {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chat-sidebar {
    height: auto;
    gap: 8px;
    padding: 12px;
    border-radius: 24px;
  }

  .chat-match-panel,
  .chat-match-waiting {
    border-radius: 20px;
  }

  .chat-conversation-list {
    grid-template-rows: auto auto;
    gap: 8px;
    overflow: visible;
  }

  .chat-conversation-items {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 78vw);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .chat-room,
  .chat-flash {
    padding: 14px;
    border-radius: 24px;
  }

  .chat-profile-panel {
    display: none;
  }

  .chat-room-idle {
    padding: 0;
  }

  .chat-idle-state {
    padding: 24px;
  }

  .chat-message,
  .chat-empty {
    max-width: 92%;
  }

  .chat-media-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chat-compose-row {
    align-items: stretch;
    gap: 8px;
  }

  .chat-toolbar-actions-inline {
    align-self: flex-end;
  }

  .chat-send-button {
    align-self: flex-end;
  }

  .chat-room {
    min-height: 0;
  }

  .chat-room-head {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
  }

  .chat-room-head-actions {
    width: auto;
    justify-content: flex-end;
    margin-left: auto;
  }

  .chat-room-head-main {
    min-width: 0;
    width: min(100%, calc(100% - 152px));
  }

  .chat-room-head-copy strong {
    font-size: 0.94rem;
  }

  .chat-log {
    padding: 12px 10px 12px 8px;
  }

  .chat-lightbox {
    padding: 16px;
  }

  .chat-lightbox-dialog,
  .chat-lightbox-dialog img {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
  }

  .chat-call-modal {
    padding: 16px;
  }

  .chat-call-modal[data-call-minimized="true"] {
    right: 12px;
    bottom: 12px;
    width: min(300px, calc(100vw - 24px));
  }

  .chat-call-dialog {
    padding: 14px;
    border-radius: 24px;
  }

  .chat-call-modal[data-call-minimized="true"] .chat-call-dialog {
    max-width: none;
  }

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

  .chat-call-remote-wrap {
    min-height: 44vh;
  }

  .chat-call-local-wrap {
    min-height: 180px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .chat-layout,
  .chat-layout-active {
    grid-template-columns: minmax(228px, 278px) minmax(0, 1fr);
  }

  .chat-profile-panel {
    display: none;
  }

  .chat-global-blocked {
    top: auto;
    bottom: 18px;
    right: 14px;
  }
}

.chat-sidebar-rail {
  display: none;
}

.chat-sidebar-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.chat-sidebar-searchbar,
.chat-conversation-list-head {
  display: none;
}

.chat-sidebar-viewer {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid rgba(111, 100, 88, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 238, 228, 0.82));
}

.chat-sidebar-viewer-avatar {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(111, 92, 170, 0.12);
  color: #6e56b7;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.chat-sidebar-viewer-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-sidebar-viewer-copy span,
.chat-sidebar-viewer-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-sidebar-viewer-copy span {
  color: #7d6d96;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chat-sidebar-viewer-copy strong {
  color: #3a3147;
  font-size: 0.96rem;
  font-weight: 800;
}

.chat-sidebar-primary-action {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(87, 103, 96, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #32403b;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(106, 94, 82, 0.08);
}

@media (min-width: 1181px) {
  body.chat-page {
    background: #ffffff;
  }

  .chat-sidebar-searchbar,
  .chat-conversation-list-head {
    display: flex;
  }

  .chat-sidebar-viewer {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    min-height: 62px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .chat-shell {
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    gap: 0;
    grid-template-rows: minmax(0, 1fr);
  }

  .chat-global-blocked {
    top: 24px;
    right: 18px;
  }

  .chat-global-blocked-panel {
    width: 312px;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
  }

  .chat-shell.chat-shell-with-flash {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
  }

  .chat-hero {
    display: none;
  }

  .chat-layout,
  .chat-layout-active {
    grid-template-columns: 396px minmax(0, 1fr) 306px;
    gap: 0;
    border-radius: 0;
    overflow: hidden;
    border: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .chat-sidebar,
  .chat-room,
  .chat-profile-panel {
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-sidebar {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    gap: 0;
    background: linear-gradient(180deg, #523575 0%, #472f67 100%);
  }

  .chat-sidebar-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 18px 10px;
    background: linear-gradient(180deg, #472d67 0%, #3f285e 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
  }

  .chat-sidebar-logo {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(180deg, #7d57bf, #6b4bab);
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    box-shadow: 0 10px 22px rgba(16, 7, 29, 0.24);
  }

  .chat-sidebar-rail-group,
  .chat-sidebar-rail-logout {
    display: grid;
    gap: 12px;
    width: 100%;
    justify-items: center;
  }

  .chat-sidebar-rail-action {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    box-shadow: none;
  }

  .chat-sidebar-rail-action svg {
    width: 18px;
    height: 18px;
  }

  .chat-sidebar-rail-action-active,
  .chat-sidebar-rail-action:hover {
    background: rgba(255, 255, 255, 0.12);
  }

  .chat-sidebar-main {
    display: grid;
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding: 18px 16px 18px 14px;
  }

  .chat-sidebar-viewer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 1rem;
  }

  .chat-sidebar-viewer-copy span {
    color: rgba(221, 209, 240, 0.7);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .chat-sidebar-viewer-copy strong {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 800;
  }

  .chat-sidebar-search-label {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(26, 14, 42, 0.22);
    color: rgba(234, 226, 247, 0.68);
  }

  .chat-sidebar-search-label svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

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

  .chat-sidebar-search::placeholder {
    color: rgba(221, 209, 240, 0.68);
  }

  .chat-sidebar-search-action,
  .chat-friend-panel-close {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
  }

  .chat-sidebar-search-action:hover,
  .chat-friend-panel-close:hover {
    background: rgba(255, 255, 255, 0.14);
  }

  .chat-sidebar-search-badge {
    background: #ffffff;
    color: #5d3ea2;
  }

  .chat-friend-search-panel,
  .chat-friend-requests-panel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .chat-friend-panel-head strong {
    color: #ffffff;
  }

  .chat-friend-search-feedback,
  .chat-friend-request-feedback,
  .chat-friend-search-hint {
    color: #ffffff;
  }

  .chat-friend-search-empty,
  .chat-friend-request-empty {
    color: rgba(221, 209, 240, 0.84);
  }

  .chat-friend-search-item,
  .chat-friend-request-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .chat-friend-search-avatar,
  .chat-friend-request-avatar {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }

  .chat-friend-search-copy strong,
  .chat-friend-request-copy strong {
    color: #ffffff;
  }

  .chat-friend-search-copy span,
  .chat-friend-request-copy span {
    color: rgba(221, 209, 240, 0.78);
  }

  .chat-friend-search-action,
  .chat-friend-request-action {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  .chat-friend-search-action:hover:not(:disabled),
  .chat-friend-request-action:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
  }

  .chat-friend-search-action:disabled {
    opacity: 0.72;
    cursor: default;
  }

  .chat-friend-request-action-accept {
    background: rgba(122, 86, 199, 0.4);
  }

  .chat-match-controls {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .chat-sidebar-primary-action {
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    box-shadow: none;
  }

  .chat-sidebar-primary-action:hover {
    background: rgba(255, 255, 255, 0.13);
  }

  .chat-conversation-waiting {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
  }

  .chat-conversation-waiting .chat-conversation-copy strong,
  .chat-conversation-waiting .chat-conversation-preview {
    color: #ffffff;
  }

  .chat-conversation-waiting .chat-conversation-avatar-search {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.96);
  }

  .chat-match-cancel-button {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .chat-conversation-list {
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
  }

  .chat-conversation-list-head {
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 0 6px;
    color: rgba(221, 209, 240, 0.72);
    font-size: 0.9rem;
    font-weight: 700;
  }

  .chat-conversation-items {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
  }

  .chat-conversation {
    min-height: 74px;
    border-radius: 18px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
  }

  .chat-conversation-delete {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
  }

  .chat-conversation-delete:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }

  .chat-conversation:hover,
  .chat-conversation-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.06);
  }

  .chat-conversation-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
  }

  .chat-conversation-copy strong {
    color: #ffffff;
    font-size: 1rem;
  }

  .chat-friend-badge {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
  }

  .chat-conversation-preview {
    color: rgba(221, 209, 240, 0.78);
    font-size: 0.86rem;
  }

  .chat-conversation-unread .chat-conversation-copy strong,
  .chat-conversation-unread .chat-conversation-preview {
    color: #ffffff;
  }

  .chat-conversation-empty p {
    color: rgba(221, 209, 240, 0.84);
  }

  .chat-room {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 0;
    gap: 0;
    background: #ffffff;
  }

  .chat-room-head {
    padding: 18px 24px;
    border: 0;
    border-bottom: 1px solid #efeaf7;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .chat-room-head-avatar {
    border: 0;
    background: #f4eefc;
    color: #4c356f;
  }

  .chat-room-head-copy strong {
    color: #322444;
    font-size: 1.05rem;
  }

  .chat-friend-badge-head {
    background: #f1ebfb;
    color: #6b4bab;
  }

  .chat-room-head-action {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: #8d80a4;
  }

  .chat-room-head-action:hover {
    background: #f5f1fb;
    color: #6e4faf;
  }

  .chat-room-head-action-call {
    color: #6e4faf;
    background: #f6f1ff;
  }

  .chat-room-head-action-call:hover {
    background: #efe7ff;
    box-shadow: none;
  }

  .chat-log {
    padding: 24px;
    border: 0;
    border-radius: 0;
    background-color: #f6fbff;
    background-image: url("/static/chat-wallpaper.svg");
    background-size: 560px 560px;
    background-repeat: repeat;
    background-position: 0 0;
    background-attachment: local;
    box-shadow: none;
  }

  .chat-log::before {
    display: none;
  }

  .chat-message,
  .chat-log.chat-log-sparse .chat-message {
    max-width: min(72%, 620px);
  }

  .chat-message-bubble,
  .chat-empty {
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid #efe9f7;
    background: #f7f5fb;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .chat-message-self .chat-message-bubble {
    background: #7a56c7;
    border-color: #7a56c7;
  }

  .chat-message-attachment .chat-message-bubble,
  .chat-message-media-only .chat-message-bubble {
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    display: grid;
    gap: 8px;
  }

  .chat-message-media-only .chat-message-bubble {
    display: contents;
  }

  .chat-message-attachment .chat-message-bubble > p {
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid #efe9f7;
    background: #f7f5fb;
  }

  .chat-message-self.chat-message-attachment .chat-message-bubble > p {
    background: #7a56c7;
    border-color: #7a56c7;
  }

  .chat-message-bubble p,
  .chat-empty p {
    color: #514763;
  }

  .chat-message-self .chat-message-bubble p {
    color: #ffffff;
  }

  .chat-message-photo img {
    border: 0;
    box-shadow: none;
  }

  .chat-message-menu-toggle {
    background: #ffffff;
    border: 1px solid #eee6f8;
    box-shadow: 0 8px 16px rgba(72, 55, 107, 0.08);
    color: #8d80a4;
  }

  .chat-message-menu {
    background: #ffffff;
    border: 1px solid #efe8f8;
    box-shadow: 0 18px 30px rgba(53, 39, 82, 0.1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .chat-composer {
    gap: 10px;
    padding: 16px 22px;
    border: 0;
    border-top: 1px solid #efeaf7;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .chat-compose-status {
    display: none;
  }

  .chat-compose-row {
    align-items: center;
    gap: 12px;
  }

  .chat-toolbar-actions {
    gap: 10px;
  }

  .chat-tool-icon,
  .chat-photo-trigger,
  .chat-photo-clear {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #a093b8;
  }

  .chat-tool-icon:hover,
  .chat-photo-trigger:hover,
  .chat-photo-clear:hover {
    background: #f6f1ff;
    color: #6e4faf;
    box-shadow: none;
  }

  .chat-input-stack {
    gap: 8px;
    padding: 6px 14px;
    border-radius: 22px;
    border: 1px solid #efe8f8;
    background: #f9f7fd;
  }

  .chat-photo-preview,
  .chat-voice-preview {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .chat-composer textarea {
    min-height: 38px;
    padding: 8px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #3d3450;
  }

  .chat-composer textarea:focus {
    outline: none;
    border: 0;
  }

  .chat-send-button {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #7a56c7;
    box-shadow: none;
  }

  .chat-send-button:hover {
    background: #6845b6;
  }

  .chat-profile-panel {
    padding: 0;
    border-left: 1px solid #efeaf7;
    background: #ffffff;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .chat-profile-card,
  .chat-media-card,
  .chat-blocked-card {
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
  }

  .chat-profile-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 14px;
    padding: 24px 18px 18px;
    border-bottom: 1px solid #efeaf7;
  }

  .chat-profile-avatar {
    width: 88px;
    height: 88px;
    font-size: 2.2rem;
    border: 0;
    background: #f5f0fc;
    color: #503776;
  }

  .chat-profile-copy {
    justify-items: center;
  }

  .chat-profile-copy strong {
    color: #322444;
    font-size: 1.1rem;
  }

  .chat-profile-status {
    background: #f7f4fb;
  }

  .chat-side-toolbar {
    padding: 0 18px 18px;
  }

  .chat-side-toolbar-idle {
    padding-top: 18px;
  }

  .chat-side-tool {
    width: 44px;
    height: 44px;
    border: 1px solid #eee7f8;
    border-radius: 14px;
    background: #fbf9fe;
    color: #8a7da2;
    box-shadow: none;
  }

  .chat-side-tool:hover,
  .chat-side-tool-active {
    background: #f2ebff;
    border-color: #e7dbfb;
    color: #6e4faf;
  }

  .chat-side-tool-badge {
    background: #7a56c7;
    box-shadow: none;
  }

  .chat-media-card {
    padding: 18px;
  }

  .chat-blocked-card {
    padding: 18px;
  }

  .chat-side-drawer {
    border-top: 1px solid #efeaf7;
  }

  .chat-side-drawer-head {
    padding-bottom: 12px;
  }

  .chat-side-drawer-close {
    border: 1px solid #efe8f8;
    background: #ffffff;
    color: #8d80a4;
  }
}
