:root {
  --ps-ink: #0A0A0A;
  --ps-ink-2: #171717;
  --ps-text: #171717;
  --ps-text-2: #404040;
  --ps-ink-soft: #525252;
  --ps-muted: #737373;
  --ps-muted-2: #A3A3A3;
  --ps-line: #E5E5E5;
  --ps-line-2: #D4D4D4;
  --ps-border: #E5E5E5;
  --ps-border-2: #D4D4D4;
  --ps-bg: #FAFAFA;
  --ps-bg-2: #F5F5F5;
  --ps-surface: #FFFFFF;
  --ps-white: #FFFFFF;
  --ps-navy: #1D4ED8;
  --ps-navy-2: #2563EB;
  --ps-blue: #1D4ED8;
  --ps-blue-2: #2563EB;
  --ps-blue-light: #DBEAFE;
  --ps-blue-tint: #EFF6FF;
  --ps-success: #047857;
  --ps-success-bg: #ECFDF5;
  --ps-success-dark: #065F46;
  --ps-warning: #B45309;
  --ps-warning-bg: #FFFBEB;
  --ps-warning-bd: #FDE68A;
  --ps-warning-border: #FDE68A;
  --ps-error: #B91C1C;
  --ps-gold: #B45309;
  --ps-gold-dark: #92400E;
  --ps-msg-time: #A3A3A3;

  --ps-radius: 8px;
  --ps-radius-sm: 6px;
  --ps-shadow-sm: none;
  --ps-shadow: none;
  --ps-shadow-lg: none;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, "SF Mono", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-tap-highlight-color: transparent;
}

*::-webkit-scrollbar { display: none; }

html, body {
  touch-action: manipulation;
  height: 100%;
  height: -webkit-fill-available;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

body {
  background: var(--ps-bg);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  color: var(--ps-ink);
}

body.presell-active .app,
body.presell-active .embed-overlay { display: none !important; }

body.presell-active {
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--ps-white);
}

/* ===================================================
   PRESELL
   =================================================== */
.presell {
  display: none;
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--ps-white);
  font-family: var(--font-body);
  color: var(--ps-text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.presell-active .presell { display: block; }
.presell *, .presell *::before, .presell *::after { box-sizing: border-box; }

.ps-section { padding: 56px 24px; }
.ps-section-inner { max-width: 640px; margin: 0 auto; }
.ps-section.bordered { border-bottom: 1px solid var(--ps-border); }
.ps-section.white { background: transparent; }
.ps-section.gray { background: var(--ps-bg); }

.ps-top-accent {
  position: relative;
  height: 3px;
  background: var(--ps-navy);
}

.ps-section-num {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ps-muted);
  margin: 0 0 18px;
}
.ps-section-num::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--ps-navy);
  display: inline-block;
  flex-shrink: 0;
}
.ps-section-num .num { color: var(--ps-navy); font-weight: 600; }
.ps-section-num .lbl { color: var(--ps-ink-soft); font-weight: 500; }

.ps-hero {
  background: transparent;
  padding: 72px 24px 56px;
  position: relative;
  overflow: hidden;
}
.ps-hero .ps-section-inner { position: relative; z-index: 2; }

.ps-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 18px;
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ps-navy);
  max-width: 100%;
  flex-wrap: wrap;
}
.ps-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--ps-success);
  border-radius: 50%;
  flex-shrink: 0;
}
.ps-eyebrow .sep { color: var(--ps-border-2); font-weight: 400; }

.ps-ornament { display: none; }

.ps-hero h1 {
  font-size: clamp(26px, 5.8vw, 38px);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.18;
  color: var(--ps-ink);
  margin: 0 0 20px;
}
.ps-hero-sub {
  font-size: 15.5px;
  color: var(--ps-text-2);
  margin: 0 0 36px;
  max-width: 540px;
  line-height: 1.62;
  font-weight: 400;
}

.ps-cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--ps-navy);
  color: #fff;
  border: 1px solid var(--ps-navy);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-appearance: none;
  text-transform: none;
  border-radius: var(--ps-radius);
}
.ps-cta:hover {
  background: var(--ps-navy-2);
  border-color: var(--ps-navy-2);
}
.ps-cta:focus-visible { outline: 2px solid var(--ps-blue); outline-offset: 2px; }
.ps-cta i { font-size: 11px; opacity: 0.9; }

.ps-cta-note {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ps-muted);
  margin-top: 16px;
  font-weight: 500;
  letter-spacing: 0.005em;
}
.ps-cta-note i { color: var(--ps-success); font-size: 11px; }

.ps-section-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ps-blue);
  margin: 0 0 10px;
  padding: 0 10px 0 0;
  position: relative;
}
.ps-section-eyebrow::after {
  content: "";
  position: absolute;
  right: -28px;
  top: 50%;
  width: 22px;
  height: 1px;
  background: var(--ps-border-2);
}
.ps-title {
  font-size: clamp(20px, 4.4vw, 26px);
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ps-ink);
  line-height: 1.28;
  margin: 0 0 14px;
}
.ps-lead {
  font-size: 15px;
  color: var(--ps-text-2);
  margin: 0 0 28px;
  max-width: 560px;
  line-height: 1.62;
  font-weight: 400;
}

.ps-alert {
  background: var(--ps-bg);
  border: 1px solid var(--ps-border);
  border-left: 3px solid var(--ps-navy);
  padding: 16px 18px;
  display: flex; gap: 14px;
  border-radius: var(--ps-radius-sm);
}
.ps-alert-icon {
  color: var(--ps-navy); font-size: 16px;
  margin-top: 1px;
  flex-shrink: 0;
}
.ps-alert .t {
  font-size: 14px; font-weight: 600;
  color: var(--ps-ink); margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.ps-alert .s {
  font-size: 13.5px; color: var(--ps-text-2); line-height: 1.55;
}

.ps-cat-list {
  background: #fff;
  border: 1px solid var(--ps-border);
  margin-top: 22px;
  border-radius: var(--ps-radius);
  overflow: hidden;
}
.ps-cat-row {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ps-border);
  font-size: 14px;
  transition: background 0.18s ease;
}
.ps-cat-row:last-child { border-bottom: none; }
.ps-cat-row:hover { background: var(--ps-bg); }
.ps-cat-icon {
  width: 32px; height: 32px;
  background: transparent;
  color: var(--ps-navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  border: 1px solid var(--ps-border);
  border-radius: 8px;
}
.ps-cat-row .label {
  flex: 1; min-width: 0;
  color: var(--ps-ink);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.ps-cat-row .tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ps-success-dark);
  background: transparent;
  border: 1px solid #A7F3D0;
  padding: 3px 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  border-radius: 999px;
}

.ps-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  overflow: hidden;
}
.ps-step {
  display: flex; gap: 18px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--ps-border);
  align-items: flex-start;
  position: relative;
}
.ps-step:last-child { border-bottom: none; }
.ps-step-num {
  width: 30px; height: 30px;
  background: transparent;
  color: var(--ps-navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--ps-navy);
  border-radius: 50%;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.ps-step-body { min-width: 0; flex: 1; padding-top: 2px; }
.ps-step-body .t {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ps-ink);
  margin-bottom: 5px;
  letter-spacing: -0.005em;
}
.ps-step-body .s {
  font-size: 13px;
  color: var(--ps-text-2);
  line-height: 1.55;
}

.ps-faq {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  overflow: hidden;
}
.ps-faq-item { border-bottom: 1px solid var(--ps-border); }
.ps-faq-item:last-child { border-bottom: none; }
.ps-faq-q {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ps-ink);
  user-select: none; gap: 12px;
  transition: color 0.12s;
  letter-spacing: -0.005em;
}
.ps-faq-q:hover { color: var(--ps-blue); }
.ps-faq-q i {
  color: var(--ps-muted-2);
  font-size: 12px;
  transition: transform 0.28s ease, color 0.18s ease;
  flex-shrink: 0;
}
.ps-faq-item.open .ps-faq-q { color: var(--ps-blue); }
.ps-faq-item.open .ps-faq-q i {
  transform: rotate(180deg);
  color: var(--ps-blue);
}
.ps-faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 22px;
  font-size: 13.5px;
  color: var(--ps-text-2);
  line-height: 1.6;
}
.ps-faq-item.open .ps-faq-a {
  max-height: 360px;
  padding: 0 22px 20px;
}

.ps-cta-section {
  background: var(--ps-bg);
  color: var(--ps-ink);
  padding: 56px 24px 60px;
  text-align: center;
  border-top: 1px solid var(--ps-border);
  position: relative;
}
.ps-cta-section h3 {
  font-size: clamp(20px, 4.6vw, 24px);
  font-weight: 600;
  color: var(--ps-ink);
  margin: 0 0 10px;
  letter-spacing: -0.024em;
}
.ps-cta-section p {
  font-size: 14px;
  color: var(--ps-text-2);
  margin: 0 0 28px;
  font-weight: 400;
}
.ps-cta-section .ps-cta { max-width: 420px; margin: 0 auto; }

.ps-footer {
  background: #fff;
  color: var(--ps-muted);
  padding: 36px 24px 40px;
  font-size: 12.5px;
  line-height: 1.6;
  border-top: 1px solid var(--ps-border);
}
.ps-footer-inner { max-width: 640px; margin: 0 auto; }
.ps-footer-mark {
  display: flex; align-items: center;
  gap: 10px; margin-bottom: 18px;
  color: var(--ps-ink); font-weight: 600; font-size: 14px;
  letter-spacing: -0.005em;
}
.ps-footer-mark i {
  color: var(--ps-navy);
  font-size: 14px;
  background: transparent;
  width: auto; height: auto;
  display: inline-flex; align-items: center; justify-content: center;
}
.ps-footer-links {
  display: flex; flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--ps-border);
}
.ps-footer-links a {
  color: var(--ps-text-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 12.5px;
  transition: color 0.12s ease;
  letter-spacing: 0;
}
.ps-footer-links a:hover { color: var(--ps-navy); }

.ps-cookie {
  position: fixed;
  left: 12px; right: 12px;
  bottom: 12px;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--ps-border);
  padding: 22px 22px 18px;
  box-shadow: none;
  max-width: 460px;
  margin: 0 auto;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.22,1,.36,1), opacity 0.4s ease;
  border-radius: var(--ps-radius);
}
.ps-cookie.open { transform: translateY(0); opacity: 1; }
.ps-cookie.hidden { display: none; }
.ps-cookie-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.ps-cookie-head .icon {
  width: auto; height: auto;
  background: transparent;
  color: var(--ps-navy);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.ps-cookie-head .t { font-size: 15px; font-weight: 600; color: var(--ps-ink); }
.ps-cookie-body {
  font-size: 13px; color: var(--ps-text-2);
  line-height: 1.55; margin-bottom: 14px;
}
.ps-cookie-body a { color: var(--ps-blue); font-weight: 600; text-decoration: underline; }

.ps-cookie-prefs {
  display: none;
  background: var(--ps-bg-2);
  border: 1px solid var(--ps-border);
  padding: 4px 16px;
  margin-bottom: 14px;
  border-radius: var(--ps-radius-sm);
}
.ps-cookie-prefs.open { display: block; }
.ps-cookie-pref {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--ps-border);
  gap: 12px;
}
.ps-cookie-pref:last-child { border-bottom: none; }
.ps-cookie-pref .l {
  font-size: 13.5px; font-weight: 600; color: var(--ps-ink);
  flex: 1; min-width: 0;
}
.ps-cookie-pref .l .s {
  display: block; font-size: 11.5px; color: var(--ps-muted);
  font-weight: 400; margin-top: 2px;
}

.ps-switch {
  position: relative;
  width: 38px; height: 22px;
  background: var(--ps-border-2);
  cursor: pointer;
  transition: background 0.18s;
  flex-shrink: 0;
  border-radius: 999px;
}
.ps-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  transition: transform 0.18s;
  box-shadow: none;
  border-radius: 50%;
}
.ps-switch.on { background: var(--ps-blue); }
.ps-switch.on::after { transform: translateX(16px); }
.ps-switch.disabled { opacity: 0.85; cursor: not-allowed; background: var(--ps-success); }

.ps-cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-btn {
  flex: 1; min-width: 110px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-appearance: none;
  border: 1px solid var(--ps-border-2);
  border-radius: var(--ps-radius-sm);
}
.ps-btn-ghost { background: #fff; color: var(--ps-text); }
.ps-btn-ghost:hover { background: var(--ps-bg-2); border-color: var(--ps-muted-2); }
.ps-btn-primary {
  background: var(--ps-navy);
  color: #fff;
  border-color: var(--ps-navy);
}
.ps-btn-primary:hover { background: var(--ps-navy-2); border-color: var(--ps-navy-2); }

.ps-cookie-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ps-blue);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

body:not(.presell-active) .ps-cookie { display: none; }

.ps-loader {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #fff;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.ps-loader.on { display: flex; }
.ps-loader-spin {
  width: 36px; height: 36px;
  border: 3px solid var(--ps-border);
  border-top-color: var(--ps-navy);
  animation: psSpin 0.9s linear infinite;
  border-radius: 50%;
}
@keyframes psSpin { to { transform: rotate(360deg); } }
.ps-loader-text {
  font-size: 13px;
  color: var(--ps-muted);
  letter-spacing: 0.02em;
}

.ps-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 10, 0.55);
  
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ps-modal.open { opacity: 1; pointer-events: auto; }
.ps-modal-content {
  background: #fff;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  padding: 40px 36px;
  box-shadow: none;
  border-radius: 12px;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s ease;
}
.ps-modal.open .ps-modal-content { transform: translateY(0) scale(1); }
.ps-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--ps-bg-2); border: none;
  font-size: 20px; color: var(--ps-muted);
  cursor: pointer; padding: 6px 12px;
  line-height: 1;
  border-radius: 999px;
  transition: background 0.12s ease, color 0.12s ease;
}
.ps-modal-close:hover { background: var(--ps-border); color: var(--ps-ink); }
.ps-modal-content h2 { margin: 0 0 10px; font-size: 26px; font-weight: 700; color: var(--ps-ink); letter-spacing: -0.022em; }
.ps-modal-content h3 { margin: 28px 0 12px; font-size: 17px; font-weight: 600; color: var(--ps-ink); }
.ps-modal-content p { margin: 0 0 16px; font-size: 14.5px; color: var(--ps-text-2); line-height: 1.65; }
.ps-modal-content ul { margin: 0 0 16px; padding-left: 22px; }
.ps-modal-content li { margin-bottom: 8px; font-size: 14.5px; color: var(--ps-text-2); line-height: 1.6; }
.ps-modal-content .date { font-size: 12.5px; color: var(--ps-muted); margin-bottom: 24px; display: block; }
.ps-modal-content strong { color: var(--ps-ink); font-weight: 600; }

/* ===================================================
   PRESELL — RESPONSIVE
   =================================================== */
@media (max-width: 360px) {
  .ps-hero { padding: 36px 16px 28px; }
  .ps-section { padding: 32px 16px; }
  .ps-cta-section { padding: 36px 16px 40px; }
  .ps-cookie { left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .ps-cookie-actions { flex-direction: column; }
  .ps-btn { width: 100%; }
  .ps-section-num { font-size: 9.5px; gap: 8px; }
  .ps-cat-row { padding: 16px; gap: 12px; }
  .ps-step { padding: 18px 16px; gap: 14px; }
  .ps-step-num { width: 28px; height: 28px; font-size: 11px; }
  .ps-faq-q { padding: 18px 16px; font-size: 13.5px; }
  .ps-faq-item.open .ps-faq-a { padding: 0 16px 18px; }
  .ps-modal-content { padding: 32px 22px 28px; }
  .ps-modal-content h2 { font-size: 22px; }
}

@media (min-width: 361px) and (max-width: 480px) {
  .ps-hero { padding: 44px 20px 36px; }
  .ps-section { padding: 36px 20px; }
  .ps-ornament { padding: 4px 20px 22px; }
}

@media (min-width: 481px) and (max-width: 767px) {
  .ps-hero { padding: 56px 28px 44px; }
  .ps-section { padding: 44px 28px; }
  .ps-cta-section { padding: 52px 28px; }
}

@media (min-width: 768px) and (max-width: 900px) {
  .ps-hero { padding: 64px 36px 52px; }
  .ps-hero h1 { font-size: 36px; }
  .ps-section { padding: 52px 36px; }
  .ps-cta-section { padding: 60px 36px; }
  .ps-modal-content { padding: 44px 40px; }
}

@media (min-width: 901px) {
  body.presell-active {
    background: var(--ps-bg);
    padding: 48px 16px;
  }
  .presell {
    max-width: 600px;
    margin: 0 auto;
    min-height: auto;
    overflow: hidden;
    background: var(--ps-white);
    border: 1px solid var(--ps-border);
    border-radius: 12px;
  }
  .ps-hero { padding: 64px 40px 52px; }
  .ps-section { padding: 52px 40px; }
  .ps-cta-section { padding: 56px 40px 60px; }
  .ps-footer { padding: 36px 40px 40px; }
  .ps-cookie {
    left: 50%;
    transform: translate(-50%, 140%);
    max-width: 460px;
    bottom: 32px;
  }
  .ps-cookie.open { transform: translate(-50%, 0); }
  .ps-top-accent { border-radius: 12px 12px 0 0; }
}

@media (min-width: 1280px) {
  body.presell-active { padding: 56px 16px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .ps-hero { padding: 32px 24px 28px; }
  .ps-section { padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .ps-cookie,
  .ps-loader-spin,
  .ps-faq-q i,
  .ps-cat-row,
  .ps-cta {
    transition: none !important;
    animation: none !important;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .ps-cat-list,
  .ps-steps,
  .ps-faq { border-width: 0.5px; }
}

/* ===================================================
   CHAT APP — full-screen layout
   =================================================== */
.app {
  width: 100%;
  max-width: 100%;
  margin: 0;
  height: 100%;
  height: 100dvh;
  background: var(--ps-bg-2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding-top: var(--safe-top);
}

.main-layout {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--ps-bg);
  min-height: 0;
}

.chat-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.chat-header {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ps-white);
  border-bottom: 1px solid var(--ps-line);
  z-index: 5;
}
.chat-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--ps-navy);
}

.ch-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.ch-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--ps-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.ch-avatar::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid var(--ps-line);
  pointer-events: none;
}
.ch-avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  background: var(--ps-success);
  border: 2px solid var(--ps-white);
  border-radius: 50%;
  z-index: 1;
}
.ch-profile-info {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.2;
  overflow: hidden;
}
.ch-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ps-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ps-ink-soft);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}
.ch-status-text {
  color: var(--ps-success-dark);
  font-weight: 600;
  flex-shrink: 0;
}
.ch-status-meta {
  color: var(--ps-ink-soft);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ch-status-sep {
  color: var(--ps-line-2);
  flex-shrink: 0;
}
.ch-status-ref {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ps-navy);
  font-weight: 600;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ch-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ch-action {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ps-ink-soft);
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-appearance: none;
  font-family: inherit;
}
.ch-action:hover {
  background: var(--ps-bg);
  color: var(--ps-navy);
}
.ch-action:active { background: var(--ps-bg-2); }

@media screen and (max-width: 600px) {
  .chat-header { padding: 11px 12px; gap: 8px; }
  .ch-profile { gap: 10px; }
  .ch-action { width: 34px; height: 34px; font-size: 13px; }
  .ch-actions { gap: 2px; }
}

@media screen and (max-width: 480px) {
  .chat-header { padding: 10px 12px; gap: 8px; }
  .ch-avatar { width: 38px; height: 38px; font-size: 14px; }
  .ch-avatar-status { width: 10px; height: 10px; border-width: 2px; }
  .ch-name { font-size: 13.5px; }
  .ch-status { font-size: 10.5px; gap: 5px; }
  .ch-status-ref { font-size: 9.5px; }
}

@media screen and (max-width: 420px) {
  .ch-status-sep-ref,
  .ch-status-ref { display: none; }
}

@media screen and (max-width: 360px) {
  .chat-header { padding: 9px 10px; gap: 6px; }
  .ch-profile { gap: 8px; }
  .ch-avatar { width: 36px; height: 36px; font-size: 13px; }
  .ch-name { font-size: 13px; }
  .ch-action { width: 32px; height: 32px; font-size: 12px; }
  .ch-action[aria-label="Channel information"] { display: none; }
}

@media screen and (max-width: 320px) {
  .chat-header { padding: 8px 8px; }
  .ch-avatar { width: 32px; height: 32px; font-size: 12px; }
  .ch-name { font-size: 12.5px; }
  .ch-status { font-size: 10px; }
  .ch-action { width: 30px; height: 30px; font-size: 11px; }
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--ps-bg);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 320'%3E%3Cg fill='none' stroke='%231D4ED8' stroke-width='1' stroke-opacity='0.08' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg transform='translate(45 50)'%3E%3Cpath d='M0 -15 L14 -10 L14 9 C14 19 7 25 0 28 C-7 25 -14 19 -14 9 L-14 -10 Z'/%3E%3Cpath d='M-7 7 L-1 13 L10 1' stroke-width='1.3'/%3E%3C/g%3E%3Cg transform='translate(160 50)'%3E%3Cpath d='M-12 0 Q-15 -8 -10 -12'/%3E%3Cpath d='M12 0 Q15 -8 10 -12'/%3E%3Cellipse cx='-9' cy='-3' rx='1.6' ry='3.5' transform='rotate(-25 -9 -3)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cellipse cx='-7' cy='-7' rx='1.6' ry='3.5' transform='rotate(-15 -7 -7)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cellipse cx='9' cy='-3' rx='1.6' ry='3.5' transform='rotate(25 9 -3)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cellipse cx='7' cy='-7' rx='1.6' ry='3.5' transform='rotate(15 7 -7)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cpath d='M0 -3 L1.5 1.5 L6 1.5 L2.5 4 L4 8.5 L0 6 L-4 8.5 L-2.5 4 L-6 1.5 L-1.5 1.5 Z' fill='%231D4ED8' fill-opacity='0.13' stroke='none'/%3E%3C/g%3E%3Cg transform='translate(270 55)'%3E%3Ccircle r='17'/%3E%3Ccircle r='12' stroke-dasharray='2 3'/%3E%3Cpath d='M0 -7 L2 -2 L7 -2 L3 1 L4 6 L0 3 L-4 6 L-3 1 L-7 -2 L-2 -2 Z' fill='%231D4ED8' fill-opacity='0.12' stroke='none'/%3E%3C/g%3E%3Cg transform='translate(50 130)'%3E%3Ccircle r='6'/%3E%3Cpath d='M0 6 L0 18 M-3 13 L0 13 M-3 17 L0 17'/%3E%3C/g%3E%3Cg transform='translate(160 135)'%3E%3Cpath d='M-15 0 Q0 -11 15 0 Q0 11 -15 0 Z'/%3E%3Ccircle r='5.5'/%3E%3Ccircle r='2.5' fill='%231D4ED8' fill-opacity='0.16' stroke='none'/%3E%3C/g%3E%3Cg transform='translate(270 130)'%3E%3Ccircle r='17'/%3E%3Cpath d='M-7 -3 C-7 -7 -3 -10 0 -6 C3 -10 7 -7 7 -3 C7 4 0 9 0 9 C0 9 -7 4 -7 -3 Z'/%3E%3C/g%3E%3Cg transform='translate(50 215)'%3E%3Cpath d='M-14 7 Q0 0 14 -7'/%3E%3Cellipse cx='-9' cy='5' rx='2.5' ry='5' transform='rotate(-30 -9 5)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cellipse cx='-3' cy='2' rx='2.5' ry='5' transform='rotate(-15 -3 2)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cellipse cx='3' cy='-1' rx='2.5' ry='5' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3Cellipse cx='9' cy='-4' rx='2.5' ry='5' transform='rotate(15 9 -4)' fill='%231D4ED8' fill-opacity='0.10' stroke='none'/%3E%3C/g%3E%3Cg transform='translate(160 215)'%3E%3Cpath d='M0 -14 L0 16'/%3E%3Cpath d='M-13 -10 L13 -10'/%3E%3Cpath d='M-13 -10 L-16 -2 L-10 -2 Z'/%3E%3Cpath d='M13 -10 L10 -2 L16 -2 Z'/%3E%3Cpath d='M-6 16 L6 16'/%3E%3Ccircle cy='-14' r='1.5' fill='%231D4ED8' fill-opacity='0.12' stroke='none'/%3E%3C/g%3E%3Cg transform='translate(270 215)'%3E%3Cpath d='M-15 -14 L15 -14'/%3E%3Cpath d='M-15 -12 L15 -12'/%3E%3Cpath d='M-9 -12 L-9 12 M-3 -12 L-3 12 M3 -12 L3 12 M9 -12 L9 12'/%3E%3Cpath d='M-17 12 L17 12'/%3E%3Cpath d='M-17 14 L17 14'/%3E%3C/g%3E%3Cg transform='translate(105 285)'%3E%3Cpath d='M-12 8 L-12 -2 C-12 -5 -10 -7 -7 -7 L7 -7 C10 -7 12 -5 12 -2 L12 8'/%3E%3Cpath d='M-3 -2 C-3 -5 -1 -6 0 -4 C1 -6 3 -5 3 -2 C3 1 0 4 0 4 C0 4 -3 1 -3 -2 Z' fill='%231D4ED8' fill-opacity='0.13' stroke='none'/%3E%3C/g%3E%3Cg transform='translate(220 285)'%3E%3Ccircle r='13'/%3E%3Cpath d='M-6 0 L-1 5 L7 -4' stroke-width='1.3'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 320px 320px;
  background-position: 0 0;
}

/* ===== Watermark — responsive tile sizing ===== */
@media screen and (max-width: 900px) {
  .chat-area { background-size: 280px 280px; }
}
@media screen and (max-width: 600px) {
  .chat-area { background-size: 240px 240px; }
}
@media screen and (max-width: 480px) {
  .chat-area { background-size: 210px 210px; }
}
@media screen and (max-width: 380px) {
  .chat-area { background-size: 180px 180px; }
}
@media screen and (max-width: 320px) {
  .chat-area { background-size: 160px 160px; }
}

.chat-sep-line { display: none; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--ps-success);
  margin-left: 2px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 11px 14px;
  background: var(--ps-white);
  border: 1px solid var(--ps-line);
  width: fit-content;
  max-width: 64px;
  align-self: flex-start;
  position: relative;
  margin-bottom: 4px;
  border-radius: 8px 8px 8px 2px;
  box-shadow: none;
}

.typing-dot {
  width: 4px;
  height: 4px;
  background: var(--ps-muted-2);
  border-radius: 50%;
  animation: typingBounce 1.6s infinite ease-in-out;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.22s; }
.typing-dot:nth-child(3) { animation-delay: 0.44s; }

@keyframes typingBounce {
  0%, 65%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 0.95; }
}

.message {
  padding: 10px 14px 18px 14px;
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 100%;
  width: fit-content;
  min-width: 88px;
  position: relative;
  animation: msgSlideIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: bottom;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
  border: 1px solid var(--ps-line);
  background: var(--ps-white);
  color: var(--ps-ink);
  border-radius: 8px 8px 8px 2px;
  box-shadow: none;
  letter-spacing: -0.005em;
}
.message b, .message strong { word-break: break-word; overflow-wrap: anywhere; }
.message a { word-break: break-all; }

.message-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-self: flex-start;
  max-width: 86%;
  margin-bottom: 4px;
  min-width: 0;
}

.message-group.flat-group {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
}

.message-group.notice-group {
  align-self: center;
  margin: 6px 0;
  max-width: 95%;
  width: auto;
  min-width: 0;
}

.message.notice {
  background: transparent !important;
  color: var(--ps-ink-soft) !important;
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  font-weight: 500;
  border: none !important;
  padding: 6px 14px !important;
  max-width: 100% !important;
  width: auto !important;
  margin: 0 auto;
  line-height: 1.5;
  border-radius: 0 !important;
  box-shadow: none;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.message.notice::after { display: none !important; }
.notice-group .msg-sender-label,
.notice-group .msg-timestamp { display: none !important; }

.message-group.user-group { align-self: flex-end; }

.msg-sender-label { display: none; }
.msg-timestamp { display: none; }

.msg-meta-inline {
  position: absolute;
  right: 10px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  pointer-events: none;
}
.message.notice .msg-meta-inline,
.message.flat .msg-meta-inline { display: none !important; }

.msg-time-inline {
  font-size: 9.5px;
  color: var(--ps-msg-time);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  font-family: var(--font-mono);
  text-transform: uppercase;
  white-space: nowrap;
}

.msg-checks {
  display: inline-flex;
  align-items: center;
  color: var(--ps-blue);
  line-height: 1;
}

.message.notice .msg-meta-inline { display: none; }
.message::after { content: none; }
.msg-meta { display: none !important; }
.flat-group .msg-timestamp { display: none !important; }

.ai,
.agent,
.system {
  background: var(--ps-white);
  color: var(--ps-ink);
  align-self: flex-start;
  border: 1px solid var(--ps-line);
  border-radius: 8px 8px 8px 2px;
}

.message.flat {
  padding: 4px !important;
  background: var(--ps-white) !important;
  border: 1px solid var(--ps-line) !important;
  max-width: 100% !important;
  width: 100% !important;
  align-self: stretch !important;
  border-radius: 14px !important;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
}

.message.video-msg {
  max-width: 100% !important;
  width: 100% !important;
  padding: 4px !important;
  background: var(--ps-white) !important;
  border: 1px solid var(--ps-line) !important;
  align-self: stretch !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-sizing: border-box;
}

.video-container {
  position: relative;
  overflow: hidden;
  margin: 0;
  background: #000;
  line-height: 0;
  width: 100%;
  border-radius: 10px;
}

.video-container video {
  width: 100%;
  display: block;
}

.big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ps-navy);
  font-size: 22px;
  cursor: pointer;
  z-index: 10;
  border: none;
  border-radius: 50%;
  box-shadow: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.big-play-btn:hover {
  background-color: #fff;
  transform: translate(-50%, -50%) scale(1.05);
}

.unmute-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(10, 10, 10, 0.78);
  color: #fff;
  border: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 12;
  border-radius: 999px;
  
  animation: unmutePulse 2.2s ease-in-out infinite;
}
.unmute-badge i { font-size: 11px; }

@keyframes unmutePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: transparent;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 11;
}
.video-container:hover .custom-controls,
.video-container:active .custom-controls { opacity: 1; }

.control-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.volume-slider {
  flex: 1;
  max-width: 100px;
  height: 3px;
  cursor: pointer;
  accent-color: var(--ps-blue);
}

.user {
  background: var(--ps-navy);
  color: #fff;
  align-self: flex-end;
  border: 1px solid var(--ps-navy);
  border-radius: 8px 8px 2px 8px;
  font-size: 14.5px;
  width: fit-content;
  white-space: normal;
  max-width: 100%;
  box-shadow: none;
}
.user .msg-time-inline { color: rgba(255, 255, 255, 0.75); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.input-area {
  padding: 12px 14px 14px 14px;
  padding-bottom: max(14px, var(--safe-bottom));
  background: var(--ps-white);
  border-top: 1px solid var(--ps-line);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.chat-input-container {
  display: flex;
  gap: 8px;
  background: transparent;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
}

.input-box {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--ps-bg);
  border: 1px solid var(--ps-line);
  min-height: 44px;
  padding: 0 6px 0 0;
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.input-box:focus-within {
  background: var(--ps-white);
  border-color: var(--ps-navy);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ps-ink-soft);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 10px;
}

.input-emoji { padding: 0 6px 0 12px; font-size: 19px; }
.input-attach { font-size: 18px; transform: rotate(45deg); padding: 0 6px; }
.input-camera { font-size: 17px; padding: 0 10px 0 4px; }

.chat-input {
  flex: 1;
  padding: 11px 6px;
  border: none;
  font-size: 16px;
  font-family: var(--font-body);
  color: var(--ps-ink);
  background: transparent;
  outline: none;
  transition: none;
  min-height: 44px;
  line-height: 20px;
  -webkit-appearance: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.chat-input::placeholder {
  color: var(--ps-ink-soft);
  font-style: normal;
  opacity: 0.7;
}

input.chat-input,
input[type="text"].chat-input,
input[type="number"].chat-input,
input[type="tel"].chat-input,
input[type="email"].chat-input,
input[type="search"].chat-input {
  font-size: 16px !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.chat-input:focus { border: none; background: transparent; }

.send-btn {
  padding: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--ps-navy);
  color: #fff;
  border: 1px solid var(--ps-navy);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-appearance: none;
  border-radius: 10px;
  box-shadow: none;
}
.send-btn:hover { background: var(--ps-navy-2); }
.send-btn:active { background: var(--ps-blue); transform: translateY(1px); }
.send-btn:disabled { background: var(--ps-navy); cursor: pointer; opacity: 0.55; }
.send-btn.has-text:disabled,
.send-btn.has-text { opacity: 1; }

.dropdown-container {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.chat-select {
  flex: 1;
  min-width: 0;
  padding: 11px 38px 11px 14px;
  border: 1px solid var(--ps-line-2);
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ps-ink);
  background: var(--ps-white);
  outline: none;
  min-height: 44px;
  cursor: pointer;
  max-width: 100%;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%230F2A4F' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  border-radius: 10px;
}

.chat-select:focus {
  border-color: var(--ps-blue);
  box-shadow: none;
}

.dropdown-confirm-btn {
  width: auto !important;
  min-width: 88px !important;
  height: 44px !important;
  padding: 0 20px !important;
  background: var(--ps-navy) !important;
  color: #fff !important;
  border: 1px solid var(--ps-navy) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.005em;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
  -webkit-appearance: none;
  border-radius: 8px !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropdown-confirm-btn:hover:not(:disabled) { background: var(--ps-navy-2) !important; }
.dropdown-confirm-btn:disabled {
  background: var(--ps-line) !important;
  color: var(--ps-ink-soft) !important;
  cursor: not-allowed;
}

.mini-footer,
.ai-brand-bar { display: none; }

.mobile-navbar {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  padding-bottom: max(8px, var(--safe-bottom));
  border-top: 1px solid var(--ps-line);
  background: var(--ps-white);
  flex-shrink: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ps-ink-soft);
  cursor: pointer;
  padding: 6px 8px;
  position: relative;
  flex: 1;
  transition: color 0.15s ease;
}
.nav-item i { font-size: 16px; position: relative; z-index: 1; opacity: 0.75; }
.nav-item span {
  font-size: 9.5px;
  font-weight: 500;
  position: relative;
  z-index: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.nav-item.active { color: var(--ps-navy); }
.nav-item.active i { opacity: 1; }
.nav-item.active span { font-weight: 600; }

.progress-bar-container,
.progress-bar { display: none !important; }

.hidden { display: none !important; }

.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 8px 4px;
  width: 100%;
  box-sizing: border-box;
}

.chat-action-btn {
  background: var(--ps-navy);
  color: var(--ps-white);
  border: 1px solid var(--ps-navy);
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  letter-spacing: 0.005em;
  -webkit-appearance: none;
  white-space: normal;
  word-break: break-word;
  text-align: center;
  font-family: var(--font-body);
  border-radius: 8px;
  box-shadow: none;
  min-height: 42px;
  max-width: 100%;
  flex: 0 1 auto;
}
.chat-action-btn:hover {
  background: var(--ps-navy-2);
  border-color: var(--ps-navy-2);
  box-shadow: none;
}
.chat-action-btn:active {
  background: var(--ps-blue);
  border-color: var(--ps-blue);
  transform: translateY(1px);
}
.chat-action-btn.secondary {
  background: var(--ps-white);
  color: var(--ps-navy);
  border-color: var(--ps-line-2);
}
.chat-action-btn.secondary:hover {
  background: var(--ps-bg-2);
  color: var(--ps-navy);
  border-color: var(--ps-navy);
}

/* ===================================================
   EMBEDS — chat-attached cards
   =================================================== */
.embed-loader-container,
.embed1-loader-container,
.embed2-loader-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  background: var(--ps-white);
  border: 1px solid var(--ps-line);
  padding: 16px 18px;
  width: 100%;
  max-width: 100%;
  margin: 4px 0;
  position: relative;
  border-radius: 12px;
  box-shadow: none;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.embed-loader-container::before,
.embed1-loader-container::before,
.embed2-loader-container::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 3px;
  background: var(--ps-navy);
}

.embed-loader-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ps-line);
  border-top-color: var(--ps-navy);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  border-radius: 50%;
}

.embed-loader-checkmark {
  display: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ps-success);
  background: var(--ps-success-bg);
  color: var(--ps-success);
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  border-radius: 50%;
  animation: scaleIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.embed-loader-container.success {
  background: var(--ps-white);
  border-color: var(--ps-line);
}
.embed-loader-container.success::before { background: var(--ps-success); }
.embed-loader-container.success .embed-loader-spinner { display: none; }
.embed-loader-container.success .embed-loader-checkmark { display: flex; }

.embed-loader-status-text {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ps-ink);
  letter-spacing: -0.005em;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.embed-loader-container.success .embed-loader-status-text {
  color: var(--ps-success-dark);
  font-weight: 600;
}
.embed-loader-status-text::before {
  content: "Processing";
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--ps-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.embed-loader-container.success .embed-loader-status-text::before {
  color: var(--ps-success);
  content: "Complete";
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.info-box {
  padding: 14px 16px;
  border: 1px solid var(--ps-line);
  margin: 4px 0;
  font-size: 13.5px;
  line-height: 1.6;
  background: var(--ps-white);
  color: var(--ps-ink);
  width: 100%;
  max-width: 100%;
  position: relative;
  border-radius: 14px;
  box-shadow: none;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.info-box h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ps-navy);
  letter-spacing: 0;
}
.info-box h3 i { font-size: 12px; flex-shrink: 0; color: var(--ps-blue); }
.info-box p {
  margin: 0 0 4px;
  color: var(--ps-ink);
  font-size: 13px;
  line-height: 1.55;
}
.info-box p:last-child { margin-bottom: 0; }
.info-box p b { color: var(--ps-navy); font-weight: 700; }

.audio-player {
  background: var(--ps-white);
  padding: 8px 12px 8px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  margin: 4px 0;
  border: 1px solid var(--ps-line);
  border-radius: 14px;
  box-shadow: none;
  box-sizing: border-box;
  min-width: 0;
}

.message.flat:has(.audio-player) {
  width: auto !important;
  max-width: 360px !important;
  align-self: flex-start !important;
}
.message-group.flat-group:has(.audio-player) {
  align-self: flex-start;
  max-width: 360px;
}

.audio-control {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--ps-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease;
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
  border-radius: 50%;
}
.audio-control:hover { background: var(--ps-navy-2); }

.audio-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}

.audio-waveform-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1px;
  height: 20px;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
}

.audio-bar {
  flex: 1;
  min-width: 1.5px;
  max-width: 2.5px;
  background: var(--ps-line-2);
  transition: height 0.1s, background 0.15s;
  align-self: center;
  border-radius: 2px;
}
.audio-bar.played { background: var(--ps-navy); }

.audio-time {
  font-size: 9px;
  font-weight: 500;
  color: var(--ps-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.premium-card {
  background: #fff;
  overflow: hidden;
  margin-bottom: 6px;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--ps-line);
  border-radius: 16px;
  box-shadow: none;
  box-sizing: border-box;
  min-width: 0;
}

.card-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ps-line);
  background: #fff;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ps-ink-soft);
  letter-spacing: 0.02em;
}

.card-hero {
  background: var(--ps-navy);
  color: #fff;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
}

.hero-label {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.hero-value {
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.018em;
  line-height: 1.1;
  color: #fff;
  word-break: break-word;
}

.hero-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 14px;
  position: relative;
  z-index: 1;
  gap: 12px;
}

.stat-item span {
  display: block;
  font-size: 10.5px;
  opacity: 0.85;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.stat-item {
  min-width: 0;
  flex: 1;
}
.stat-item b {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  color: #fff;
  word-break: break-word;
  display: block;
}

.card-content { padding: 16px; }

.data-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dotted var(--ps-line);
  min-width: 0;
}
.data-item:last-child { border-bottom: none; padding-bottom: 0; }

.data-label {
  font-size: 12px;
  color: var(--ps-ink-soft);
  font-weight: 500;
  flex-shrink: 0;
  letter-spacing: 0;
  min-width: 0;
}

.data-value {
  font-size: 13px;
  color: var(--ps-ink);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  overflow-wrap: anywhere;
  letter-spacing: 0;
  min-width: 0;
  flex: 1;
}
.data-value.success { color: var(--ps-success-dark); }
.data-value.warning { color: var(--ps-warning); }

.card-footer { padding: 0 16px 16px; }

.confirm-panel-btn {
  width: 100%;
  background: var(--ps-navy);
  color: #fff;
  border: none;
  padding: 14px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  border-radius: 24px;
}
.confirm-panel-btn:hover { background: var(--ps-navy-2); }
.confirm-panel-btn:active { background: var(--ps-blue); }

.embed-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: #fff;
  z-index: 1001;
  display: none;
  overflow: hidden;
}
.embed-overlay.active { display: block; }
.embed-overlay iframe {
  width: 100%;
  height: 100%;
  height: 100dvh;
  border: none;
  display: block;
  -webkit-overflow-scrolling: touch;
}

/* ===================================================
   CHAT — RESPONSIVE (full-screen on every viewport)
   =================================================== */
@media screen and (max-width: 600px) {
  .app { max-width: 100%; }
  .message-group { max-width: 88%; }
  .message { font-size: 14.5px; line-height: 1.5; padding: 10px 13px 17px 13px; }
  .message.flat,
  .message.video-msg {
    max-width: 100% !important;
    width: 100% !important;
  }
  .message-group.flat-group {
    width: 100%;
    max-width: 100%;
  }
  .typing-indicator { padding: 10px 14px; }
  .info-box,
  .embed-loader-container,
  .embed1-loader-container,
  .embed2-loader-container,
  .audio-player,
  .premium-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .embed-overlay iframe {
    width: 100%;
    height: 100%;
    height: 100dvh;
  }
  .video-container video {
    max-height: 65vh;
    object-fit: contain;
  }
  .premium-card .card-hero { padding: 18px 16px; }
  .premium-card .hero-value { font-size: clamp(20px, 6.5vw, 26px); }
  .premium-card .card-content { padding: 14px; }
  .premium-card .data-item { gap: 8px; }
}

@media screen and (max-width: 480px) {
  .chat-area { padding: 14px 12px 16px 12px; gap: 4px; }
  .message { font-size: 14px; padding: 9px 13px 17px 13px; min-width: 80px; }
  .msg-meta-inline { right: 9px; bottom: 4px; }
  .message-group { max-width: 90%; }
  .typing-indicator { padding: 9px 13px; max-width: 64px; }
  .typing-dot { width: 4.5px; height: 4.5px; }
  .embed-loader-container,
  .embed1-loader-container,
  .embed2-loader-container {
    padding: 13px 14px;
    gap: 12px;
    border-radius: 12px;
  }
  .embed-loader-spinner,
  .embed-loader-checkmark { width: 20px; height: 20px; }
  .embed-loader-checkmark { font-size: 11px; }
  .embed-loader-status-text { font-size: 13px; line-height: 1.4; }
  .embed-loader-status-text::before { font-size: 8.5px; }
  .info-box { padding: 13px 14px; font-size: 13px; border-radius: 12px; }
  .info-box h3 { font-size: 12.5px; gap: 8px; }
  .info-box p { font-size: 12.5px; line-height: 1.55; }
  .msg-time-inline { font-size: 9.5px; }
  .audio-player { padding: 7px 11px 7px 7px; gap: 9px; border-radius: 13px; max-width: 320px; }
  .audio-control { width: 30px; height: 30px; min-width: 30px; font-size: 12px; }
  .audio-waveform-container { height: 18px; }
  .message.flat:has(.audio-player) { max-width: 320px !important; }
  .message-group.flat-group:has(.audio-player) { max-width: 320px; }
  .premium-card { border-radius: 14px; }
  .premium-card .card-header { padding: 10px 14px; }
  .premium-card .card-title { font-size: 11px; }
  .premium-card .card-hero { padding: 16px 14px; }
  .premium-card .card-content { padding: 12px 14px; }
  .premium-card .hero-stats { gap: 8px; padding-top: 12px; }
  .stat-item span { font-size: 9.5px; }
  .stat-item b { font-size: 12px; }
  .data-label { font-size: 11.5px; }
  .data-value { font-size: 12.5px; }
  .data-grid { gap: 10px; }
  .video-container video { max-height: 60vh; }
}

@media screen and (max-width: 360px) {
  .chat-area { padding: 12px 10px 14px 10px; }
  .message {
    font-size: 13.5px;
    line-height: 1.5;
    padding: 9px 12px 16px 12px;
    border-radius: 7px 7px 7px 2px;
    min-width: 76px;
  }
  .user { border-radius: 7px 7px 2px 7px; }
  .message-group { max-width: 93%; }
  .typing-indicator { padding: 8px 11px; max-width: 58px; gap: 4px; }
  .typing-dot { width: 4px; height: 4px; }
  .chat-action-btn { padding: 8px 12px; font-size: 11.5px; }
  .options-container { gap: 5px; }
  .msg-time-inline { font-size: 9px; letter-spacing: 0.04em; }
  .msg-meta-inline { gap: 3px; right: 8px; bottom: 4px; }
  .embed-loader-container,
  .embed1-loader-container,
  .embed2-loader-container {
    padding: 11px 12px;
    gap: 10px;
  }
  .embed-loader-spinner,
  .embed-loader-checkmark { width: 18px; height: 18px; }
  .embed-loader-status-text { font-size: 12px; }
  .info-box { padding: 11px 12px; font-size: 12px; }
  .info-box h3 { font-size: 11.5px; }
  .info-box p { font-size: 12px; }
  .audio-player { padding: 6px 10px 6px 6px; gap: 8px; max-width: 280px; }
  .audio-control { width: 28px; height: 28px; min-width: 28px; font-size: 11px; }
  .audio-waveform-container { height: 16px; }
  .audio-time { font-size: 8.5px; }
  .message.flat:has(.audio-player) { max-width: 280px !important; }
  .message-group.flat-group:has(.audio-player) { max-width: 280px; }
  .premium-card .card-hero { padding: 14px 12px; }
  .premium-card .card-content { padding: 10px 12px; }
  .premium-card .card-header { padding: 9px 12px; }
  .premium-card .card-title { font-size: 10px; }
  .premium-card .card-footer { padding: 0 12px 12px; }
  .hero-value { font-size: clamp(18px, 6vw, 22px); }
  .stat-item b { font-size: 11px; }
  .stat-item span { font-size: 9px; }
  .data-label { font-size: 11px; }
  .data-value { font-size: 11.5px; }
  .video-container video { max-height: 55vh; }
}

@media screen and (max-width: 320px) {
  .chat-area { padding: 10px 8px 12px 8px; }
  .message {
    font-size: 13px;
    padding: 8px 10px 15px 10px;
    border-radius: 6px 6px 6px 2px;
    min-width: 70px;
  }
  .user { border-radius: 6px 6px 2px 6px; }
  .message-group { max-width: 96%; }
  .msg-meta-inline { right: 7px; bottom: 3px; }
  .typing-indicator { padding: 7px 10px; max-width: 52px; gap: 3px; }
  .typing-dot { width: 3.5px; height: 3.5px; }
  .chat-input { font-size: 16px; min-height: 38px; padding: 8px 4px; }
  .input-box { min-height: 38px; }
  .input-emoji { font-size: 17px; padding: 0 4px 0 8px; }
  .input-attach { font-size: 16px; padding: 0 4px; }
  .input-camera { font-size: 16px; padding: 0 6px 0 4px; }
  .send-btn { width: 38px; height: 38px; min-width: 38px; font-size: 15px; }
  .input-area { padding: 6px 6px 8px 6px; }
  .nav-item i { font-size: 15px; }
  .nav-item span { font-size: 8.5px; }
  .embed-loader-container,
  .embed1-loader-container,
  .embed2-loader-container { padding: 10px; gap: 9px; border-radius: 10px; }
  .embed-loader-spinner,
  .embed-loader-checkmark { width: 16px; height: 16px; border-width: 2px; }
  .embed-loader-status-text { font-size: 11.5px; }
  .info-box { padding: 10px; font-size: 11.5px; border-radius: 10px; }
  .info-box h3 { font-size: 11px; }
  .info-box p { font-size: 11.5px; }
  .audio-player { padding: 5px 8px 5px 5px; gap: 7px; border-radius: 12px; max-width: 240px; }
  .audio-control { width: 26px; height: 26px; min-width: 26px; font-size: 10px; }
  .audio-time { font-size: 8px; }
  .message.flat:has(.audio-player) { max-width: 240px !important; }
  .message-group.flat-group:has(.audio-player) { max-width: 240px; }
  .premium-card { border-radius: 12px; }
  .premium-card .card-hero { padding: 12px 10px; }
  .premium-card .hero-value { font-size: 18px; margin-bottom: 12px; }
  .premium-card .card-content { padding: 10px; }
  .premium-card .card-header { padding: 8px 10px; }
  .premium-card .card-title { font-size: 9px; }
  .premium-card .data-label { font-size: 10px; }
  .premium-card .data-value { font-size: 11px; }
  .premium-card .card-footer { padding: 0 10px 10px; }
  .confirm-panel-btn { font-size: 11.5px; padding: 11px; }
  .video-container video { max-height: 50vh; }
  .big-play-btn { width: 46px; height: 46px; font-size: 18px; }
  .msg-time-inline { font-size: 9px; }
}

@media screen and (min-width: 321px) and (max-width: 375px) {
  .message { font-size: 14px; line-height: 20px; }
  .chat-action-btn { padding: 9px 14px; font-size: 12.5px; }
  .chat-input { font-size: 16px; min-height: 42px; padding: 10px 4px; }
  .input-box { min-height: 42px; }
  .send-btn { width: 42px; height: 42px; min-width: 42px; font-size: 16px; }
  .hero-value { font-size: 24px; }
}

@media screen and (min-width: 431px) and (max-width: 600px) {
  .message { font-size: 15.5px; line-height: 22px; }
  .chat-area { padding: 14px 14px 16px 14px; }
  .chat-input { font-size: 16px; }
}

@media screen and (min-width: 601px) {
  body:not(.presell-active) {
    background: var(--ps-bg);
  }
  body:not(.presell-active) .app {
    max-width: 100%;
    width: 100%;
    height: 100dvh;
    margin: 0;
    background: var(--ps-bg);
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }
  .message { font-size: 15.5px; line-height: 22px; }
  .message-group { max-width: 720px; }
  .message-group.flat-group { max-width: 720px; }
  .chat-area {
    padding: 18px 20px 20px 20px;
    align-items: stretch;
  }
  .chat-input { font-size: 16px; min-height: 46px; }
  .send-btn { width: 46px; height: 46px; min-width: 46px; }
  .chat-header { padding: 14px 24px; }
  .input-area { padding: 14px 20px; padding-bottom: max(14px, var(--safe-bottom)); }
  .input-box { max-width: 880px; margin: 0 auto; width: 100%; }
  .chat-input-container { max-width: 880px; margin: 0 auto; width: 100%; }
}

@media screen and (min-width: 901px) {
  .chat-area { padding: 22px 24px 24px 24px; }
  .message-group { max-width: 760px; }
  .message-group.flat-group { max-width: 760px; }
  .chat-header { padding: 16px 28px; }
  .input-area { padding: 16px 24px; }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
  .mobile-navbar { padding: 3px 0; }
  .nav-item {
    flex-direction: row;
    gap: 5px;
    padding: 4px 8px;
  }
  .nav-item i { font-size: 14px; }
  .nav-item span { font-size: 9.5px; }
  .chat-input { min-height: 36px; padding: 8px 4px; font-size: 16px; }
  .input-box { min-height: 36px; }
  .input-emoji { font-size: 17px; padding: 0 4px 0 8px; }
  .input-attach { font-size: 15px; padding: 0 4px; }
  .input-camera { font-size: 14px; padding: 0 5px 0 3px; }
  .send-btn { width: 36px; height: 36px; min-width: 36px; font-size: 14px; }
  .input-area { padding: 4px 6px; }
}

@media screen and (max-width: 290px) {
  .message { font-size: 12.5px; padding: 6px 8px; }
  .options-container {
    flex-direction: column;
    align-items: stretch;
  }
  .chat-action-btn {
    text-align: center;
    font-size: 11px;
    padding: 7px 10px;
  }
}

@supports (padding-top: env(safe-area-inset-top)) {
  .mobile-navbar { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .input-area { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .embed-overlay iframe { padding-top: env(safe-area-inset-top); }
}
