:root {
  --maxw: 720px;
  --header-h: 64px;

  --bg0: #f6f7ff;
  --bg1: #eef2ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 45px rgba(2, 6, 23, 0.08);
  --primary: #4f46e5;
  --primary2: #7c3aed;
  --danger: #b00020;
  --success: #0b9156;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 18px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% 0%, var(--bg1), transparent 60%),
    radial-gradient(900px 500px at 100% 10%, #e0e7ff, transparent 55%),
    linear-gradient(180deg, var(--bg0), #ffffff 60%);
  position: relative;
}

.page {
  padding-top: calc(var(--header-h) + 14px);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  z-index: 20;
  background: rgba(246, 247, 255, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.site-header-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.site-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

/* Mobile: allow nav to scroll instead of wrapping awkwardly */
@media (max-width: 560px) {
  .brand-link { min-width: 0; }
  .brand-title { min-width: 0; }
  .brand-title span { display: none; }
  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background-size: 20px 20px;
  }

  .site-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    justify-content: flex-start;
    max-width: 100%;
    min-width: 0;
    padding: 0 2px;
    scroll-padding-left: 2px;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-link {
    white-space: nowrap;
    padding: 7px 9px;
    font-size: 12px;
  }
}

.nav-link {
  color: rgba(15, 23, 42, 0.78);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.6);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.65;
  background-image: url("/static/chat/pattern.svg");
  background-size: 220px 220px;
  mix-blend-mode: multiply;
  z-index: 0;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  background: var(--card);
  background-image: url("/static/chat/watermark.svg");
  background-repeat: no-repeat;
  background-position: right -260px top -200px;
  background-size: 720px auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.site-footer {
  margin-top: 16px;
  padding: 18px 0 26px;
}

.site-footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}

.footer-brand {
  font-weight: 950;
  color: rgba(15, 23, 42, 0.92);
}

.footer-muted {
  margin-top: 2px;
  font-size: 13px;
}

.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links a {
  color: rgba(15, 23, 42, 0.72);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.footer-links a:hover {
  text-decoration: underline;
  color: rgba(15, 23, 42, 0.92);
}

.footer-share {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.65);
  color: rgba(15, 23, 42, 0.78);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.04s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
}

.social-icon:active {
  transform: translateY(1px);
}

h1 { margin: 0 0 12px; font-size: 24px; letter-spacing: -0.02em; }

h2 { margin: 0 0 10px; font-size: 16px; letter-spacing: -0.01em; }

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

.btn-link { text-decoration: none; }

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    url("/static/chat/logo_mark.svg") center/22px 22px no-repeat,
    linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.22);
}

.brand-title {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.brand-title strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-title span {
  font-size: 12px;
  color: var(--muted);
}

.top-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.top-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  font-size: 13px;
}

.top-links a:hover {
  color: rgba(15, 23, 42, 0.9);
  text-decoration: underline;
}

.hero-illustration {
  width: 100%;
  max-width: 780px;
  display: block;
  margin: 12px auto 6px;
  border-radius: 18px;
}

.hero {
  padding: 6px 2px 2px;
}

.landing-stack > * + * {
  margin-top: 14px;
}

.landing-card {
  padding: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(79, 70, 229, 0.08);
  color: rgba(15, 23, 42, 0.78);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.hero-subtitle {
  margin: 0 0 14px;
  font-size: 14px;
}

.hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.8));
}

.hero-h2 {
  margin-bottom: 8px;
}

.hero-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-footnote {
  margin: 14px 0 0;
  font-size: 13px;
}

/* Small spacing utilities */
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }

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

.search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-weight: 900;
}

/* --- Landing layout --- */
.landing-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: center;
  margin-top: 6px;
}

.landing-title {
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.landing-hero-graphic {
  position: relative;
  min-height: 260px;
}

.hero-blob {
  position: absolute;
  inset: -30px -22px -22px -22px;
  background:
    radial-gradient(260px 180px at 20% 20%, rgba(79, 70, 229, 0.34), transparent 65%),
    radial-gradient(260px 180px at 80% 30%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(220px 160px at 70% 90%, rgba(14, 165, 233, 0.14), transparent 60%);
  filter: blur(2px);
  border-radius: 26px;
}

.preview-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.10);
  overflow: hidden;
  padding: 12px;
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.9);
  background: rgba(11, 145, 86, 0.12);
  border: 1px solid rgba(11, 145, 86, 0.22);
}

.preview-muted {
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.66);
}

.preview-messages {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm-name {
  font-size: 11px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.62);
  margin-bottom: 4px;
}

.pm-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  color: rgba(15, 23, 42, 0.92);
}

.pm-me {
  align-self: flex-end;
  text-align: right;
}

.pm-me .pm-bubble {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.18);
}

.preview-composer {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.preview-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: rgba(15, 23, 42, 0.55);
  font-size: 13px;
}

.preview-send {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.18);
}

.landing-hero-art .hero-illustration {
  margin: 0;
}

.trust-row {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.trust-item {
  font-weight: 750;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.78);
}

.trust-dot {
  color: rgba(15, 23, 42, 0.35);
}

.fineprint {
  margin: 10px 0 0;
  font-size: 13px;
}

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

.plain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.plain {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

.plain-title {
  font-weight: 900;
  font-size: 13px;
}

.plain-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.stat-bar {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

.stat-k {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: rgba(15, 23, 42, 0.72);
}

.stat-v {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 850;
  color: rgba(15, 23, 42, 0.92);
}

.usecases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.usecase {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
}

.usecase-title {
  font-weight: 900;
  font-size: 13px;
}

.usecase-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.sec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.sec {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}

.sec-title {
  font-weight: 900;
  font-size: 13px;
}

.sec-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(79, 70, 229, 0.22);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(124, 58, 237, 0.10));
}

.cta-title {
  font-weight: 950;
  letter-spacing: -0.01em;
}

.cta-text {
  margin-top: 3px;
  color: rgba(15, 23, 42, 0.78);
  font-size: 13px;
}

.cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(15, 23, 42, 0.92);
  font-weight: 750;
  font-size: 13px;
  text-decoration: none;
  transition: transform 0.04s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.social-btn:hover {
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
}

.social-btn:active {
  transform: translateY(1px);
}

.social-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  padding-left: 4px;
}

.feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

.feature-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(79, 70, 229, 0.95);
  flex: 0 0 auto;
}

.feature-title {
  font-weight: 850;
  font-size: 13px;
}

.feature-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.compare {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
}

.compare-row {
  display: contents;
}

.compare-cell {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: rgba(15, 23, 42, 0.82);
}

.compare-head .compare-cell {
  border-top: 0;
  font-weight: 900;
  background: rgba(79, 70, 229, 0.07);
}

.compare-row .compare-cell:first-child {
  font-weight: 850;
  color: rgba(15, 23, 42, 0.92);
}

.faq {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.faq-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
}

.faq-q {
  font-weight: 900;
  font-size: 13px;
}

.faq-a {
  margin-top: 4px;
  font-size: 13px;
}

.step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.02);
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.22);
  flex: 0 0 auto;
}

.step-title {
  font-weight: 850;
  font-size: 13px;
}

.step-text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 860px) {
  .landing-hero-grid {
    grid-template-columns: 1fr;
  }
  .landing-hero-graphic {
    min-height: 0;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .plain-grid {
    grid-template-columns: 1fr;
  }
  .cta-card {
    flex-direction: column;
    align-items: stretch;
  }
  .steps {
    grid-template-columns: 1fr;
  }
  .compare {
    grid-template-columns: 1fr;
  }
  .compare-cell {
    border-top: 0;
    border-bottom: 1px solid var(--border);
  }
}

/* Cleaner landing FAQ accordion */
.faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
}

.faq-q {
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  list-style: none;
}

.faq-q::-webkit-details-marker { display: none; }

.faq-a {
  margin-top: 8px;
  font-size: 13px;
}

/* Reduce visual noise on small screens */
@media (max-width: 560px) {
  body::before { opacity: 0.35; }
  .container {
    background-position: right -300px top -240px;
    background-size: 620px auto;
  }
}

#status { margin: 8px 0 12px; }

.chat-header {
  margin-top: 12px;
}

.chat-header #status {
  margin: 0;
}

.chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-header-left {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.chat-stepper {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chat-stepper .step-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.75);
  color: #475569;
  user-select: none;
}

.chat-stepper .step-pill.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
  color: #1d4ed8;
}

.chat-stepper .step-pill.done {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.28);
  color: #166534;
}

.chat-stepper .step-pill.warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.30);
  color: #7c2d12;
}

.chat-stepper .step-pill.blocked {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.30);
  color: #7f1d1d;
}

.chat-stepper .step-sep {
  color: rgba(15, 23, 42, 0.45);
  font-weight: 900;
  font-size: 12px;
}

.row { margin-top: 12px; }

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
}

.sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
  background: #fff;
}

.input:focus {
  border-color: rgba(79, 70, 229, 0.55);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.messages {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px;
  height: min(420px, 55vh);
  overflow-y: auto;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

.modal-card {
  position: relative;
  width: min(560px, calc(100% - 24px));
  margin: 10vh auto 0;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 22px 60px rgba(2, 6, 23, 0.25);
}

.modal-title {
  font-weight: 800;
  font-size: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

textarea.input {
  resize: vertical;
  min-height: 90px;
}

.safety-banner {
  border-left: 6px solid rgba(59, 130, 246, 0.9);
}

.safety-banner-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  align-items: start;
}

.chat-main {
  min-width: 0;
}

.chat-side {
  position: sticky;
  top: 12px;
}

.online-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(420px, 55vh);
  overflow: auto;
  padding-right: 4px;
}

.online-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
}

.online-name {
  font-weight: 800;
  font-size: 13px;
}

.online-meta {
  font-size: 12px;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.25);
}

.status-dot.available { background: rgba(11, 145, 86, 0.85); }
.status-dot.waiting { background: rgba(79, 70, 229, 0.85); }
.status-dot.in_chat { background: rgba(15, 23, 42, 0.35); }

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

.msg {
  display: flex;
  margin: 8px 0;
}

.msg .bubble {
  max-width: min(520px, 88%);
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.03);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.self {
  justify-content: flex-end;
}

.msg.self .bubble {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(124, 58, 237, 0.14));
  border-color: rgba(79, 70, 229, 0.22);
}

.msg.system {
  justify-content: center;
}

.msg.system .bubble {
  max-width: min(620px, 92%);
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.02);
  border-style: dashed;
}

.msg.media .bubble {
  padding: 10px;
}

.media-title {
  font-weight: 800;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.9);
}

.media-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.media-link {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.9);
  text-decoration: none;
}

.media-link:hover {
  text-decoration: underline;
}

.media-thumb {
  display: block;
  margin-top: 8px;
  max-width: 260px;
  max-height: 260px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.composer-row {
  align-items: flex-end;
}

.composer-row textarea.input {
  flex: 1 1 260px;
  min-height: 44px;
  max-height: 140px;
  line-height: 1.35;
}

.attach-menu {
  display: none;
  min-width: 210px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.16);
  padding: 6px;
}

.attach-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 750;
  text-align: left;
}

.attach-item:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.14);
  box-shadow: none;
}

.attach-item:active {
  transform: none;
}

.attach-ic {
  width: 22px;
  display: inline-flex;
  justify-content: center;
}

.controls input[type="text"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.controls input[type="file"] {
  flex: 1 1 260px;
  min-width: 0;
}

button {
  padding: 11px 12px;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: transform 0.04s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:hover { box-shadow: 0 10px 22px rgba(2, 6, 23, 0.08); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn {
  font-weight: 700;
}

.btn.cta {
  font-weight: 850;
  letter-spacing: -0.01em;
  border-color: rgba(79, 70, 229, 0.18);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.08);
}

.btn.cta:hover {
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.12);
}

.btn.pulse {
  animation: btnPulse 1.2s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .btn.pulse { animation: none; }
  button { transition: none; }
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.92);
}

.btn.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
}

.btn.success {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--success), #22c55e);
}

.btn.danger {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--danger), #ef4444);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
  font-size: 13px;
}

.pill.you-pill {
  font-weight: 900;
  color: rgba(15, 23, 42, 0.92);
  border-color: rgba(79, 70, 229, 0.22);
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(124, 58, 237, 0.10));
}

.pill.status-pill.waiting {
  font-weight: 850;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
}

.pill.status-pill.in_chat {
  font-weight: 850;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--success), #22c55e);
}

.pill.status-pill.offline {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.8);
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.04);
}

.typing-pill {
  background: rgba(79, 70, 229, 0.08);
  color: rgba(15, 23, 42, 0.78);
  border-color: rgba(79, 70, 229, 0.18);
}

.typing-hint {
  margin: 6px 0 8px;
  padding: 0 2px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  min-height: 16px;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 650;
}

.chip.active {
  border-color: rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.10);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.error {
  color: var(--danger);
  margin-top: 10px;
  font-weight: 600;
}

#emoji-panel {
  margin-top: 8px;
  display: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  max-width: 100%;
}

video, img {
  max-width: 100%;
  height: auto;
}

.video {
  width: 100%;
  max-width: 520px;
  background: #111;
  border-radius: 12px;
}

.preview {
  width: 100%;
  max-width: 260px;
  display: none;
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* Small screens: keep tap targets and stacking nice */
@media (max-width: 480px) {
  body { padding: 12px; }
  .container { padding: 14px; }
  .site-header-inner { padding: 0 12px; }
  .site-footer-inner { padding: 0 12px; }

  /* Avoid iOS zoom-on-focus by keeping inputs >= 16px */
  .input,
  .controls input[type="text"] {
    font-size: 16px;
  }

  /* Keep most actions large, but allow the composer to stay compact */
  .btn { width: 100%; }
  .social-icon { width: 40px; }

  .composer-row {
    flex-wrap: wrap;
  }
  .composer-row textarea.input {
    flex-basis: 100%;
    max-height: 160px;
  }
  .composer-row .btn {
    width: auto;
    min-width: 44px;
    padding: 10px 10px;
  }

  .controls { gap: 10px; }
  .controls input[type="text"],
  .controls input[type="file"] { flex-basis: 100%; }

  /* On mobile, show header actions as a tidy 2-column grid */
  .chat-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .chat-header-row {
    align-items: stretch;
  }
  .chat-header-actions {
    width: 100%;
  }
  .chat-header-actions .btn {
    width: 100%;
  }

  .messages {
    height: min(520px, 60vh);
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .online-item {
    flex-direction: column;
    align-items: stretch;
  }
}
