:root {
  --wa-green: #25d366;
  --wa-green-dark: #1fb955;
  --wa-deep: #075e54;
  --wa-teal: #128c7e;
  --wa-light: #e7f8ee;
  --bg: #eef4f2;
  --bg-2: #f7faf9;
  --ink: #12211d;
  --muted: #64766f;
  --line: #dbe8e3;
  --card: #ffffff;
  --danger: #d64545;
  --warning: #b7791f;
  --shadow-sm: 0 2px 10px rgba(18, 33, 29, 0.06);
  --shadow-md: 0 14px 40px rgba(18, 33, 29, 0.12);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(37, 211, 102, 0.12), transparent 32rem),
    radial-gradient(circle at 90% 22%, rgba(7, 94, 84, 0.08), transparent 28rem),
    var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  color: var(--wa-deep);
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.18);
  border-radius: 5px;
  padding: 1px 5px;
}

.hidden {
  display: none !important;
}

.view {
  min-height: 100vh;
}

/* ===== lab strip ===== */
.lab-strip {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 22px;
  background: #0b2926;
  color: #cfe9e1;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.lab-links {
  display: flex;
  gap: 14px;
}

.lab-links a {
  color: #8ef0ba;
  text-decoration: none;
}

.lab-links a:hover {
  text-decoration: underline;
}

/* ===== landing ===== */
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--wa-green), var(--wa-green-dark));
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.28);
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.brand-mark.large {
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
}

.brand-mark.large svg {
  width: 46px;
  height: 46px;
}

.brand-mark.xl {
  width: 92px;
  height: 92px;
  margin-bottom: 22px;
}

.brand-mark.xl svg {
  width: 58px;
  height: 58px;
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text em {
  color: var(--wa-teal);
  font-style: normal;
}

.lab-chip {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #0b5b34;
  background: #c9f7d9;
  border: 1px solid #9fe8b8;
  border-radius: 999px;
  padding: 3px 8px;
}

.topnav {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--muted);
}

.topnav a {
  text-decoration: none;
}

.topnav a:hover {
  color: var(--wa-teal);
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 28px 36px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--wa-teal);
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero h1 .dot {
  color: var(--wa-green);
}

.hero-lead {
  max-width: 590px;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

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

.btn.primary {
  color: #fff;
  background: linear-gradient(145deg, var(--wa-green), var(--wa-green-dark));
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.24);
}

.btn.primary:hover {
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.32);
}

.btn.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: #9ed9bc;
  color: var(--wa-deep);
}

.btn.full {
  width: 100%;
}

.btn.wide {
  width: 100%;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.hero-points b {
  color: var(--wa-teal);
  margin-right: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.hero-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: rotate(1.2deg);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 211, 102, 0.16), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(231, 248, 238, 0.35));
  pointer-events: none;
}

.mock-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  background: var(--wa-deep);
  color: #fff;
}

.mock-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--wa-green);
  font-weight: 800;
}

.mock-head b {
  display: block;
  font-size: 13px;
}

.mock-head small {
  display: block;
  font-size: 11px;
  color: #b8dfd4;
}

.mock-online {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--wa-green);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.18);
}

.mock-chat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 260px;
  padding: 22px 18px;
  background:
    linear-gradient(rgba(7, 94, 84, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 94, 84, 0.035) 1px, transparent 1px),
    #f3f8f5;
  background-size: 26px 26px;
}

.mock-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: #35453f;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 33, 29, 0.06);
}

.mock-bubble.visitor {
  align-self: flex-end;
  color: #fff;
  background: var(--wa-green);
  border-bottom-right-radius: 3px;
}

.mock-bubble.admin {
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}

.mock-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #fff;
}

.mock-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9bb1a8;
  animation: blink 1.2s infinite;
}

.mock-typing i:nth-child(2) {
  animation-delay: 0.16s;
}

.mock-typing i:nth-child(3) {
  animation-delay: 0.32s;
}

.mock-compose {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: #9aaba4;
  font-size: 12px;
  background: #f0f4f2;
  border-top: 1px solid #e3ece8;
}

.mock-compose b {
  color: var(--wa-teal);
}

.features {
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 28px 40px;
}

.section-head {
  max-width: 760px;
  margin-bottom: 30px;
}

.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3.5vw, 40px);
  letter-spacing: -0.035em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(219, 232, 227, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(18, 33, 29, 0.09);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  border-radius: 11px;
  color: var(--wa-deep);
  background: var(--wa-light);
  font-size: 19px;
  font-weight: 800;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.site-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 40px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #8a9b94;
  font-size: 12px;
}

/* ===== splash ===== */
#downloadPage,
#phonePage,
#chatPage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 18px;
}

.splash-card {
  width: min(440px, 100%);
  padding: 42px 34px 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

.splash-card h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.splash-sub {
  margin: 10px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.progress {
  height: 8px;
  margin-bottom: 24px;
  overflow: hidden;
  background: #e2ece7;
  border-radius: 999px;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--wa-green), var(--wa-teal));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.splash-card .btn + .btn {
  margin-top: 10px;
}

.fineprint {
  margin: 18px 0 0;
  color: #8a9b94;
  font-size: 11px;
  line-height: 1.6;
}

/* ===== phone ===== */
.phone-shell {
  width: min(470px, 100%);
  overflow: hidden;
  background: #f0f5f2;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.phone-scroll {
  position: relative;
  max-height: 72vh;
  overflow-y: auto;
  padding: 22px 22px 26px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  color: #fff;
  background: var(--wa-deep);
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--wa-green), var(--wa-teal));
  font-weight: 800;
  font-size: 17px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agent-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.agent-meta strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-meta small {
  color: #b8dfd4;
  font-size: 11px;
}

.agent-meta .status.online {
  color: #9ef1bd;
}

.header-verified {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  margin-left: 3px;
  border-radius: 50%;
  color: #fff;
  background: #1da1f2;
  font-size: 8px;
  font-style: normal;
  vertical-align: 1px;
}

.sc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #b8dfd4;
  font-size: 9px;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.phone-shell .icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chat-banner {
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 14px;
}

.chat-banner img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: cover;
}

.security-warning {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  padding: 12px 13px;
  color: #7b5418;
  background: #fff8e8;
  border: 1px solid #f1dfb4;
  border-radius: 12px;
  font-size: 12px;
}

.warn-icon {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1.3;
}

.sw-text {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.phone-scroll h1 {
  margin: 0 0 8px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.welcome-desc {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  white-space: pre-wrap;
}

.phone-scroll label {
  display: block;
  margin-bottom: 7px;
  color: #40514a;
  font-size: 13px;
  font-weight: 700;
}

.required {
  color: var(--danger);
}

.phone-input-row {
  display: flex;
  gap: 8px;
}

.country-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 112px;
  height: 46px;
  padding: 0 11px;
  border: 1px solid #cfddd7;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.country-btn b {
  font-size: 13px;
}

.country-btn .caret {
  margin-left: auto;
  color: #8a9b94;
  font-size: 10px;
}

#phoneInput {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #cfddd7;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#phoneInput:focus {
  border-color: var(--wa-green);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.12);
}

.field-error {
  min-height: 20px;
  padding-top: 5px;
  color: var(--danger);
  font-size: 12px;
}

#phoneForm .btn {
  margin-top: 4px;
}

.country-dropdown {
  position: fixed;
  z-index: 200;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 36px));
  max-height: min(520px, 80vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(18, 33, 29, 0.24);
}

#countrySearch {
  margin: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

#countrySearch:focus {
  border-color: var(--wa-green);
}

.country-list {
  overflow-y: auto;
  padding: 0 8px 10px;
}

.country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.country-item:hover {
  background: #f0f8f4;
}

.country-item .dial {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.country-item.selected {
  background: #f0f8f4;
}

.country-item .country-check {
  width: 12px;
  margin-left: 4px;
  color: var(--wa-green);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

/* ===== chat ===== */
.chat-shell {
  width: min(760px, 100%);
  height: min(820px, calc(100vh - 96px));
  min-height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #eaf2ee;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px;
  background:
    linear-gradient(rgba(7, 94, 84, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 94, 84, 0.028) 1px, transparent 1px),
    #eef5f1;
  background-size: 30px 30px;
}

.msg-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 12px;
}

.msg-row.visitor {
  align-items: flex-end;
}

.msg-row.system {
  align-items: center;
}

.msg-agent-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px 4px;
  color: var(--wa-teal);
  font-size: 11px;
  font-weight: 700;
}

.msg-agent-row .mini-avatar {
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: var(--wa-green);
  font-size: 9px;
}

.msg-agent-row .mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.verified-dot {
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  color: #fff;
  background: #1da1f2;
  font-size: 8px;
}

.bubble {
  max-width: min(78%, 560px);
  padding: 9px 12px 7px;
  border-radius: 13px;
  color: #24342e;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 33, 29, 0.07);
  overflow-wrap: anywhere;
}

.msg-row.admin .bubble {
  border-bottom-left-radius: 3px;
}

.msg-row.visitor .bubble {
  color: #fff;
  background: var(--wa-green);
  border-bottom-right-radius: 3px;
}

.msg-row.system .bubble {
  max-width: 90%;
  color: #6f5b36;
  background: #fff8e8;
  border: 1px solid #f1dfb4;
  font-size: 12px;
}

.bubble.extra-bold .msg-line {
  font-weight: 800;
}

.msg-line {
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.msg-line + .msg-line {
  margin-top: 2px;
}

.msg-image {
  display: block;
  width: min(280px, 100%);
  max-height: 300px;
  margin: 2px 0 6px;
  object-fit: cover;
  border-radius: 9px;
  cursor: zoom-in;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 3px;
  color: rgba(36, 52, 46, 0.48);
  font-size: 10px;
}

.msg-row.visitor .msg-meta {
  color: rgba(255, 255, 255, 0.7);
}

.ticks {
  letter-spacing: -3px;
  font-size: 11px;
}

.ticks.read {
  color: #c7f8dd;
}

.countdown {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.msg-copy {
  padding: 0 4px;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.system-label {
  margin-bottom: 5px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 800;
}

.code-label {
  margin-bottom: 5px;
  color: var(--wa-teal);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.notice-title {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--danger);
  font-weight: 800;
}

.notice-icon {
  margin-right: 4px;
}

.message-options {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.option-btn {
  padding: 7px 11px;
  border: 1px solid #bfe8d0;
  border-radius: 999px;
  color: var(--wa-deep);
  background: #f5fcf8;
  font-size: 12px;
  cursor: pointer;
}

.option-btn:hover {
  border-color: var(--wa-green);
  background: #e6f9ee;
}

.option-btn.selected,
.option-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.option-btn.selected {
  color: #fff;
  background: var(--wa-teal);
  border-color: var(--wa-teal);
}

.code-request-btn {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid #f0c7c7;
  border-radius: 8px;
  color: var(--danger);
  background: #fff5f5;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 22px 10px;
  color: #7b8d85;
  font-size: 11px;
  background: #eef5f1;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9bb1a8;
  animation: blink 1.2s infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing span:nth-child(3) {
  animation-delay: 0.32s;
}

.typing em {
  margin-left: 5px;
  font-style: normal;
}

.composer {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  background: #f0f4f2;
  border-top: 1px solid #dfe9e4;
}

.composer .icon-btn {
  color: #60736d;
}

.composer .icon-btn:hover {
  background: #e0eae5;
}

.message-input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  outline: none;
  font-size: 14px;
}

.send-btn {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--wa-green);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.composer.locked {
  opacity: 0.6;
  pointer-events: none;
}

.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--wa-green);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.35);
  font-size: 24px;
  cursor: pointer;
}

.chat-fab i {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--danger);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

/* ===== image viewer ===== */
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 12, 10, 0.9);
}

.viewer-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 24px;
  cursor: pointer;
}

.image-viewer img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
}

@keyframes blink {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 34px;
  }

  .hero-card {
    max-width: 520px;
    transform: none;
  }

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

  .topnav {
    display: none;
  }
}

@media (max-width: 620px) {
  .lab-strip {
    padding: 7px 12px;
    font-size: 10px;
  }

  .lab-links {
    gap: 8px;
  }

  .topbar,
  .hero,
  .features {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero-lead {
    font-size: 14px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .site-foot {
    flex-direction: column;
    padding-left: 16px;
    padding-right: 16px;
  }

  #downloadPage,
  #phonePage,
  #chatPage {
    padding: 0;
  }

  .splash-card {
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 0;
  }

  .phone-shell,
  .chat-shell {
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .phone-scroll {
    max-height: none;
    height: calc(100vh - 62px);
  }

  .chat-shell {
    height: 100dvh;
  }

  .chat-fab {
    right: 16px;
    bottom: 16px;
  }
}

/* ===== remote-parity flow ===== */
.brand-mark.small {
  width: 32px;
  height: 32px;
  box-shadow: none;
}

.brand-mark.small svg {
  width: 20px;
  height: 20px;
}

.splash-screen {
  min-height: calc(100vh - 33px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 211, 102, 0.28), transparent 24rem),
    linear-gradient(160deg, #064b44, #075e54 54%, #128c7e);
}

.splash-inner {
  text-align: center;
  animation: splashIn 0.5s ease both;
}

.splash-inner .brand-mark {
  margin-bottom: 22px;
}

.splash-inner h1 {
  margin: 0 0 6px;
  font-size: 36px;
  letter-spacing: -0.03em;
}

.splash-inner p {
  margin: 0;
  color: #b8dfd4;
  font-size: 13px;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#downloadPage {
  padding: 0;
  background: #fff;
}

.dl-page {
  width: 100%;
  min-height: calc(100vh - 33px);
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  background: #fff;
}

.dl-nav {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 22px 0;
}

.dl-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--wa-deep);
  font-size: 20px;
  font-weight: 800;
}

.dl-body {
  width: min(560px, 100%);
  margin: auto;
  padding: 18px 0 42px;
  text-align: center;
}

.dl-hero {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 22px;
  object-fit: contain;
}

.dl-body h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: #1a1a1a;
}

.dl-body h1 {
  margin: 24px 0 10px;
  font-size: clamp(26px, 5vw, 34px);
  line-height: 1.18;
  letter-spacing: -0.035em;
  color: #111;
}

.dl-desc {
  margin: 0 auto 18px;
  max-width: 460px;
  color: var(--muted);
  font-size: 14px;
}

.dl-tip {
  margin: 24px 0 16px;
  color: #3d5048;
  font-size: 14px;
  font-weight: 700;
}

.dl-start-btn {
  position: relative;
  width: 100%;
  height: 52px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--wa-green);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.dl-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: linear-gradient(135deg, #1fb955, #128c7e);
  transition: width 0.15s linear;
}

.dl-btn-text {
  position: relative;
  z-index: 1;
}

.dl-footer {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 18px 0 26px;
  color: #a9a9a9;
  font-size: 11px;
  text-align: center;
}

.conn-status {
  padding: 7px 14px;
  color: var(--muted);
  background: #eef5f1;
  border-bottom: 1px solid #dfe9e4;
  font-size: 11px;
  text-align: center;
}

.chat-top-notice {
  align-self: center;
  max-width: 88%;
  margin: 0 auto 16px;
  padding: 7px 12px;
  border: 1px solid #cfe6da;
  border-radius: 8px;
  color: #587068;
  background: #f5fbf7;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

/* remote message decorations */
.num-badge {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin: 0 2px;
  border-radius: 50%;
  color: #fff;
  background: var(--wa-deep);
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.check-badge {
  display: inline-flex;
  width: 15px;
  height: 15px;
  margin: 0 2px;
  vertical-align: middle;
}

.check-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.code-arrow {
  display: inline-block;
  color: #e74c3c;
  font-weight: 800;
  animation: arrowUp 0.9s ease-in-out infinite;
}

.code-arrow-down {
  display: inline-block;
  color: #e74c3c;
  font-weight: 800;
  transform: rotate(180deg);
}

.code-flip {
  display: inline-block;
  animation: codeFlip 1.4s ease-in-out infinite;
}

.code-clock {
  display: inline-block;
  animation: clockShake 0.9s ease-in-out infinite;
}

.msg-red-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background: #e74c3c;
  vertical-align: middle;
}

.fail-exclamation {
  color: #e74c3c;
  font-weight: 800;
}

@keyframes arrowUp {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes clockShake {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-9deg);
  }
  75% {
    transform: rotate(9deg);
  }
}

@keyframes codeFlip {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(180deg);
  }
}

.code-trigger-text {
  font-family: "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
}

/* image viewer toolbar */
.image-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.iv-toolbar {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.iv-toolbar #ivCount {
  margin-right: auto;
  color: #dce9e3;
  font-size: 12px;
}

.iv-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 18px;
  cursor: pointer;
}

.iv-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.image-viewer img {
  transform: scale(1);
  transition: transform 0.15s ease;
  cursor: zoom-in;
  touch-action: none;
}

.image-viewer img.zoomed {
  cursor: zoom-out;
}

@media (max-width: 620px) {
  .dl-page {
    padding: 0 18px;
  }

  .dl-body {
    padding-top: 8px;
  }

  .splash-screen {
    min-height: 100vh;
  }

  .dl-page {
    min-height: 100vh;
  }
}

/* ===== single-container remote structure ===== */
.connect-section {
  min-height: calc(100vh - 33px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 50% 42%, rgba(37, 211, 102, 0.28), transparent 24rem),
    linear-gradient(160deg, #064b44, #075e54 54%, #128c7e);
}

.connect-section.chat-hidden {
  display: none;
}

.dl-page {
  display: none;
}

.dl-page.show {
  display: flex;
}

.chat-window {
  display: none;
  flex-direction: column;
  margin: auto;
  width: min(760px, 100%);
  height: min(820px, calc(100vh - 96px));
  min-height: 520px;
  overflow: hidden;
  background: #eaf2ee;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.chat-window.active {
  display: flex;
}

.chat-window.phone-mode {
  width: min(470px, 100%);
  height: min(720px, calc(100vh - 96px));
  background: #f0f5f2;
}

.contact-form {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 22px 26px;
}

.chat-window.phone-mode .contact-form {
  display: flex;
  flex-direction: column;
}

.chat-window.phone-mode .chat-messages,
.chat-window.phone-mode .chat-input,
.chat-window.phone-mode .typing {
  display: none;
}

.chat-window:not(.phone-mode) .contact-form {
  display: none;
}

.chat-window:not(.phone-mode) .chat-messages {
  display: flex;
  flex-direction: column;
}

.chat-window:not(.phone-mode) .chat-input {
  display: flex;
}

.chat-window.phone-mode .conn-status {
  display: block;
}

.chat-window:not(.phone-mode) .conn-status {
  display: none;
}

.chat-window .chat-header {
  flex: 0 0 auto;
}

.chat-window .chat-messages {
  flex: 1;
  min-height: 0;
}

.chat-window .chat-input {
  flex: 0 0 auto;
}

.chat-window .typing {
  flex: 0 0 auto;
}

.chat-window .contact-form h1 {
  margin: 0 0 8px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.chat-window .contact-form .welcome-desc {
  margin-bottom: 22px;
}

.chat-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
}

@media (max-width: 620px) {
  .connect-section {
    min-height: 100vh;
  }

  .chat-window,
  .chat-window.phone-mode {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .contact-form {
    padding: 18px 18px 24px;
  }

  .chat-toggle {
    right: 16px;
    bottom: 16px;
  }
}
