:root {
  --ink: #101828;
  --muted: #667085;
  --line: #d8e0ea;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --cyan: #00a7c7;
  --green: #15b97a;
  --blue: #2563eb;
  --coral: #ff6b5f;
  --yellow: #f4b740;
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.14);
  --shell-gap: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --keyboard-bottom: 0px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(0, 167, 199, 0.24), transparent 30rem),
    radial-gradient(circle at 86% 18%, rgba(37, 99, 235, 0.18), transparent 28rem),
    radial-gradient(circle at 80% 88%, rgba(255, 107, 95, 0.15), transparent 26rem),
    linear-gradient(135deg, #f8fbff 0%, #eef6f7 45%, #f9fbf4 100%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(780px, 92vw) auto;
  mix-blend-mode: multiply;
  transition: opacity 180ms ease;
}

body[data-ui-theme="superhero"]::before {
  opacity: 0.115;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 560'%3E%3Cpath d='M450 34 724 132 650 420 450 528 250 420 176 132Z' fill='none' stroke='%23e11d48' stroke-width='26'/%3E%3Cpath d='M496 74 356 294h116l-66 196 158-256H452Z' fill='%232563eb'/%3E%3Cpath d='M48 474h804v44H48zM94 396h52v78H94zm92-52h62v130h-62zm108 22h52v108h-52zm306-42h68v150h-68zm112 68h58v82h-58z' fill='%230f172a'/%3E%3C/svg%3E"),
    radial-gradient(circle at 24% 24%, rgba(225, 29, 72, 0.42), transparent 22rem),
    radial-gradient(circle at 78% 70%, rgba(37, 99, 235, 0.3), transparent 26rem);
}

body[data-ui-theme="business"]::before {
  opacity: 0.12;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 560'%3E%3Crect x='126' y='76' width='648' height='408' rx='34' fill='none' stroke='%230f766e' stroke-width='24'/%3E%3Cpath d='M194 402h512M236 338l108-96 96 62 156-176 76 74' fill='none' stroke='%23334155' stroke-width='28' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='344' cy='242' r='26' fill='%230f766e'/%3E%3Ccircle cx='440' cy='304' r='26' fill='%230f766e'/%3E%3Ccircle cx='596' cy='128' r='26' fill='%230f766e'/%3E%3Cpath d='M254 446h392v38H254z' fill='%23334155'/%3E%3C/svg%3E"),
    radial-gradient(circle at 18% 20%, rgba(15, 118, 110, 0.28), transparent 24rem),
    radial-gradient(circle at 76% 76%, rgba(51, 65, 85, 0.18), transparent 26rem);
}

body[data-ui-theme="mystic"]::before {
  opacity: 0.22;
  background-size: cover;
  mix-blend-mode: screen;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 980'%3E%3Crect width='1440' height='980' fill='%23030712'/%3E%3Ccircle cx='720' cy='490' r='336' fill='none' stroke='%238b5cf6' stroke-width='22' opacity='.68'/%3E%3Ccircle cx='720' cy='490' r='210' fill='none' stroke='%2306b6d4' stroke-width='16' opacity='.56'/%3E%3Cpath d='M720 118 814 386 1100 392 872 558 954 832 720 672 486 832 568 558 340 392 626 386Z' fill='none' stroke='%238b5cf6' stroke-width='20' stroke-linejoin='round' opacity='.7'/%3E%3Cpath d='M720 274 846 490 720 706 594 490Z' fill='%2306b6d4' opacity='.36'/%3E%3Cg fill='%23ffffff' opacity='.6'%3E%3Ccircle cx='208' cy='154' r='7'/%3E%3Ccircle cx='1188' cy='212' r='5'/%3E%3Ccircle cx='1228' cy='744' r='8'/%3E%3Ccircle cx='296' cy='782' r='5'/%3E%3Ccircle cx='1012' cy='92' r='4'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 26% 18%, rgba(124, 58, 237, 0.34), transparent 24rem),
    radial-gradient(circle at 72% 76%, rgba(8, 145, 178, 0.25), transparent 28rem);
}

body[data-ui-theme="mystic"] {
  background:
    linear-gradient(145deg, rgba(2, 6, 23, 0.98), rgba(3, 7, 18, 0.96)),
    radial-gradient(circle at 50% 10%, rgba(139, 92, 246, 0.26), transparent 32rem),
    #030712;
}

body[data-ui-theme="world"]::before,
body[data-ui-theme="humanity"]::before,
body[data-ui-theme="robot"]::before,
body[data-ui-theme="apocalypse"]::before,
body[data-ui-theme="cosmic-ai"]::before {
  background-size: cover;
  mix-blend-mode: multiply;
}

body[data-ui-theme="world"]::before {
  opacity: 0.15;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 980'%3E%3Crect width='1440' height='980' fill='%23eaf8ff'/%3E%3Ccircle cx='720' cy='490' r='330' fill='none' stroke='%230ea5e9' stroke-width='22'/%3E%3Cpath d='M404 426c98-136 250-174 392-136 128 34 226 118 260 240-118 62-254 78-376 36-104-36-190-94-276-140Z' fill='%2322c55e'/%3E%3Cpath d='M304 610c164-70 278-48 402 32 114 74 224 86 392 18' fill='none' stroke='%230ea5e9' stroke-width='28' stroke-linecap='round'/%3E%3Cpath d='M136 278h1168M136 702h1168M720 116v748' stroke='%230f172a' stroke-width='12' opacity='.34'/%3E%3C/svg%3E");
}

body[data-ui-theme="humanity"]::before {
  opacity: 0.14;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 980'%3E%3Crect width='1440' height='980' fill='%23fff7ed'/%3E%3Cg fill='none' stroke-linecap='round' stroke-width='28'%3E%3Cpath d='M376 670c84-146 196-220 344-220s260 74 344 220' stroke='%23f97316'/%3E%3Cpath d='M476 414c34-94 116-154 244-154s210 60 244 154' stroke='%23db2777'/%3E%3C/g%3E%3Cg fill='%23f97316' opacity='.84'%3E%3Ccircle cx='514' cy='330' r='54'/%3E%3Ccircle cx='720' cy='248' r='68'/%3E%3Ccircle cx='926' cy='330' r='54'/%3E%3C/g%3E%3Cpath d='M250 742c160 74 310 108 470 108s310-34 470-108' fill='none' stroke='%23db2777' stroke-width='24' opacity='.76'/%3E%3C/svg%3E");
}

body[data-ui-theme="robot"]::before {
  opacity: 0.16;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 980'%3E%3Crect width='1440' height='980' fill='%23eef6ff'/%3E%3Crect x='462' y='206' width='516' height='430' rx='76' fill='none' stroke='%232563eb' stroke-width='24'/%3E%3Ccircle cx='626' cy='390' r='46' fill='%2314b8a6'/%3E%3Ccircle cx='814' cy='390' r='46' fill='%2314b8a6'/%3E%3Cpath d='M604 520h232M720 206v-92M384 330H228M1056 330h156M398 590H262M1042 590h176M502 702v116M938 702v116' stroke='%232563eb' stroke-width='28' stroke-linecap='round'/%3E%3Cg stroke='%2314b8a6' stroke-width='10' opacity='.7'%3E%3Cpath d='M120 150h260M1060 166h250M96 820h328M1018 802h316'/%3E%3C/g%3E%3C/svg%3E");
}

body[data-ui-theme="apocalypse"] {
  background:
    linear-gradient(145deg, rgba(26, 8, 8, 0.98), rgba(5, 8, 18, 0.96)),
    #160b0b;
}

body[data-ui-theme="apocalypse"]::before {
  opacity: 0.2;
  mix-blend-mode: screen;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 980'%3E%3Crect width='1440' height='980' fill='%23160b0b'/%3E%3Ccircle cx='1050' cy='214' r='156' fill='%23ef4444' opacity='.72'/%3E%3Cpath d='M0 760 188 578 350 688 548 460 742 702 936 512 1140 712 1440 428v552H0Z' fill='%230f172a'/%3E%3Cpath d='M120 724c216-66 374-66 590 0s374 66 610 0' fill='none' stroke='%23f59e0b' stroke-width='24' opacity='.72'/%3E%3Cpath d='M520 140 392 412h172l-96 318 298-404H596l108-186Z' fill='%23f59e0b' opacity='.58'/%3E%3C/svg%3E");
}

body[data-ui-theme="cosmic-ai"] {
  background:
    linear-gradient(145deg, rgba(8, 17, 31, 0.98), rgba(15, 23, 42, 0.96)),
    #08111f;
}

body[data-ui-theme="cosmic-ai"]::before {
  opacity: 0.19;
  mix-blend-mode: screen;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 980'%3E%3Crect width='1440' height='980' fill='%2308111f'/%3E%3Cg fill='none' stroke='%236366f1' stroke-width='12' opacity='.72'%3E%3Ccircle cx='720' cy='490' r='250'/%3E%3Cellipse cx='720' cy='490' rx='410' ry='130'/%3E%3Cellipse cx='720' cy='490' rx='130' ry='410' transform='rotate(36 720 490)'/%3E%3C/g%3E%3Cg fill='%2322d3ee'%3E%3Ccircle cx='720' cy='490' r='48'/%3E%3Ccircle cx='390' cy='312' r='14'/%3E%3Ccircle cx='1088' cy='376' r='18'/%3E%3Ccircle cx='514' cy='782' r='12'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.65'%3E%3Ccircle cx='150' cy='130' r='4'/%3E%3Ccircle cx='1250' cy='160' r='5'/%3E%3Ccircle cx='1190' cy='820' r='4'/%3E%3Ccircle cx='250' cy='720' r='6'/%3E%3Ccircle cx='860' cy='104' r='4'/%3E%3C/g%3E%3C/svg%3E");
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input,
label,
select,
textarea {
  touch-action: manipulation;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 24px);
}

.hidden {
  display: none !important;
}

.auth-screen {
  height: calc(100vh - 48px);
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(370px, 480px);
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(241, 250, 249, 0.84)),
    linear-gradient(90deg, rgba(16, 24, 40, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 24, 40, 0.04) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.brand-panel,
.login-card,
.sidebar,
.conversation {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.brand-panel {
  min-height: 640px;
  padding: clamp(24px, 3.2vw, 46px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(circle at 50% 19%, rgba(0, 168, 132, 0.16), transparent 18rem),
    radial-gradient(circle at 14% 78%, rgba(37, 99, 235, 0.1), transparent 17rem),
    linear-gradient(rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.36)),
    linear-gradient(90deg, rgba(16, 24, 40, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 24, 40, 0.045) 1px, transparent 1px);
  background-size: auto, auto, auto, 48px 48px, 48px 48px;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: auto 7% 7% auto;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(0, 167, 199, 0.28);
  transform: rotate(18deg);
  opacity: 0.72;
}

.signal-card {
  width: min(330px, 40vw);
  aspect-ratio: 1;
  margin-bottom: clamp(14px, 2.2vw, 22px);
  position: relative;
  display: grid;
  place-items: center;
}

.ai-grid {
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background:
    linear-gradient(90deg, rgba(0, 167, 199, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(37, 99, 235, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle, black 38%, transparent 72%);
  opacity: 0.9;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 50%;
}

.orbit-one {
  width: 94%;
  height: 94%;
}

.orbit-two {
  width: 68%;
  height: 68%;
  border-color: rgba(21, 185, 122, 0.26);
}

.orbit-three {
  width: 46%;
  height: 46%;
  border-color: rgba(255, 107, 95, 0.22);
  transform: rotate(32deg) scaleX(1.52);
}

.pulse-node {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 9px rgba(255, 107, 95, 0.15);
}

.node-a {
  top: 16%;
  right: 22%;
}

.node-b {
  bottom: 22%;
  left: 10%;
  background: var(--green);
  box-shadow: 0 0 0 9px rgba(21, 185, 122, 0.15);
}

.node-c {
  right: 8%;
  bottom: 33%;
  background: var(--yellow);
  box-shadow: 0 0 0 9px rgba(244, 183, 64, 0.18);
}

.node-d {
  top: 42%;
  left: 7%;
  background: var(--blue);
  box-shadow: 0 0 0 9px rgba(37, 99, 235, 0.14);
}

.ai-core {
  width: 50%;
  min-width: 178px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.3), transparent 17%),
    radial-gradient(circle at 50% 50%, rgba(0, 230, 190, 0.38), transparent 33%),
    conic-gradient(from 140deg, #08111f, #004c68, #00a884, #2f5bff, #101828, #08111f);
  box-shadow:
    0 30px 70px rgba(16, 24, 40, 0.28),
    0 0 42px rgba(0, 168, 132, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.ai-core::before,
.ai-core::after {
  content: "";
  position: absolute;
  inset: 17%;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  pointer-events: none;
}

.ai-core::before {
  transform: rotate(90deg) scaleX(0.38);
}

.ai-core::after {
  transform: rotate(18deg) scaleY(0.38);
}

.core-ring {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  box-shadow:
    inset 0 0 28px rgba(0, 167, 199, 0.22),
    0 0 34px rgba(0, 168, 132, 0.25);
}

.core-chip {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.55), transparent 24%),
    linear-gradient(135deg, #00e0bd, #00a7c7 44%, #465dff);
  color: white;
  font-size: 1.65rem;
  font-weight: 900;
  box-shadow:
    0 18px 40px rgba(0, 167, 199, 0.36),
    inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.data-line {
  position: absolute;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.88), transparent);
  opacity: 0.52;
}

.line-a {
  width: 70%;
  top: 24%;
}

.line-b {
  width: 58%;
  bottom: 25%;
}

.line-c {
  width: 42%;
  transform: rotate(90deg);
}

.floating-panel {
  position: absolute;
  min-width: 126px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 16px 32px rgba(16, 24, 40, 0.12);
  backdrop-filter: blur(18px);
}

.floating-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.floating-panel strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 1.1rem;
}

.panel-a {
  top: 17%;
  left: 1%;
}

.panel-b {
  right: 0;
  top: 42%;
}

.panel-c {
  left: 13%;
  bottom: 5%;
}

.eyebrow {
  margin: 0 auto 12px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(3rem, 6.2vw, 5.6rem);
  line-height: 0.9;
  letter-spacing: 0;
  max-width: 760px;
  text-align: center;
}

.lead {
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  color: #344054;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.55;
  text-align: center;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.trust-row span {
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.62);
  color: #344054;
  font-size: 0.9rem;
  font-weight: 700;
}

.digital-metrics {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
  margin-left: auto;
  margin-right: auto;
}

.digital-metrics div {
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.58);
}

.digital-metrics strong,
.digital-metrics span {
  display: block;
}

.digital-metrics strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.digital-metrics span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.login-card {
  align-self: stretch;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(88px, 12vh, 132px) clamp(30px, 3.4vw, 46px) clamp(30px, 3.4vw, 46px);
  border: 0;
  border-left: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 0;
  position: relative;
  overflow: hidden;
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 250, 0.88)),
    linear-gradient(90deg, rgba(16, 24, 40, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 24, 40, 0.035) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid rgba(0, 168, 132, 0.42);
  background:
    radial-gradient(circle at 88% 16%, rgba(0, 168, 132, 0.16), transparent 13rem),
    radial-gradient(circle at 8% 92%, rgba(0, 167, 199, 0.12), transparent 14rem);
  background-size: auto;
  pointer-events: none;
}

.login-card::after {
  content: "";
  position: absolute;
  right: 34px;
  bottom: 34px;
  width: 116px;
  height: 116px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(16, 24, 40, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 24, 40, 0.08) 1px, transparent 1px),
    rgba(255, 255, 255, 0.42);
  background-size: 14px 14px;
  opacity: 0.28;
  pointer-events: none;
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.copyright-brand,
.sidebar-copyright {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.copyright-brand {
  width: fit-content;
  margin-top: 16px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.copyright-brand img {
  width: 88px;
  height: 46px;
  object-fit: contain;
}

.xpay-hero-logo {
  width: min(250px, 70%);
  height: auto;
  margin: 20px auto 0;
}

.login-card h2 {
  margin-bottom: 18px;
  font-size: clamp(1.9rem, 2.8vw, 2.45rem);
  line-height: 1.14;
}

label {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
  color: #344054;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 167, 199, 0.14);
}

.primary-btn,
.secondary-btn,
.send-btn,
.icon-btn,
.tab,
.quick-action {
  border: 0;
}

.primary-btn {
  width: 100%;
  min-height: 52px;
  border-radius: 8px;
  background: #101828;
  color: white;
  font-weight: 800;
}

.primary-btn:hover {
  background: #00a884;
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 13px;
  background: #e7f8f5;
  color: #08795f;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  background: #fee4e2;
  color: #b42318;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
}

.hidden-file {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 22px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 5px;
  background: rgba(237, 243, 247, 0.78);
}

.auth-tab {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font-size: 0.88rem;
  font-weight: 900;
}

.auth-tab.active {
  background: #101828;
  color: white;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.14);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.otp-panel {
  margin-top: 4px;
}

.otp-local-code {
  margin-top: -6px;
  border: 1px dashed rgba(0, 167, 199, 0.42);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(231, 248, 245, 0.72);
  color: #08795f;
  font-weight: 900;
}

.auth-status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.fine-print {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.fine-print a {
  display: inline-block;
  margin-left: 6px;
  color: #08795f;
  font-weight: 900;
  text-decoration: none;
}

.chat-app {
  height: calc(100vh - 48px);
  min-height: 680px;
  display: grid;
  grid-template-columns: clamp(320px, 29vw, 390px) minmax(0, 1fr);
  gap: var(--shell-gap);
}

.zalo-shell {
  --zalo-blue: #0a78ff;
  --zalo-blue-dark: #075bcc;
  --zalo-surface: rgba(255, 255, 255, 0.92);
}

.sidebar,
.conversation {
  border-radius: 8px;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 255, 0.9)),
    linear-gradient(90deg, rgba(10, 120, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 36px 36px;
}

.profile-strip,
.conversation-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.zalo-shell .profile-strip {
  background: linear-gradient(135deg, rgba(10, 120, 255, 0.95), rgba(0, 168, 132, 0.9));
  color: white;
}

.zalo-shell .profile-strip span {
  color: rgba(255, 255, 255, 0.78);
}

.zalo-shell .profile-strip .icon-btn {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.profile-button,
.profile-strip div:nth-child(2),
.conversation-header > div:not(.avatar):not(.header-actions) {
  min-width: 0;
  flex: 1;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.profile-strip strong,
.conversation-header h2 {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-strip span,
.conversation-header span,
.nearby-tools span {
  color: var(--muted);
  font-size: 0.86rem;
}

.e2ee-status {
  width: fit-content;
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(21, 185, 122, 0.1);
  color: #08795f !important;
  font-size: 0.74rem !important;
  font-weight: 900;
}

.e2ee-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #15b97a;
  box-shadow: 0 0 0 4px rgba(21, 185, 122, 0.14);
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #00a7c7, #15b97a);
  background-size: cover;
  background-position: center;
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(0, 167, 199, 0.22);
}

.avatar-me {
  background: linear-gradient(135deg, #2563eb, #ff6b5f);
  background-size: cover;
  background-position: center;
}

.icon-btn,
.send-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0f5f8;
  color: #344054;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.icon-btn:hover,
.send-btn:hover,
.tab:hover,
.auth-tab:hover,
.friend-tab:hover {
  transform: translateY(-1px);
}

.icon-btn:disabled,
.send-btn:disabled,
.call-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.icon-btn svg,
.send-btn svg,
.search-box svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
}

.search-box input {
  border: 0;
  padding-left: 0;
  box-shadow: none;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 14px;
}

.quick-action {
  min-width: 0;
  min-height: 68px;
  display: grid;
  place-items: center;
  gap: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #344054;
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.07);
}

.quick-action svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--zalo-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quick-action span {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.1;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
}

.tab-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 0 12px 12px;
}

.tab {
  min-height: 42px;
  border-radius: 8px;
  background: #edf3f7;
  color: #344054;
  min-width: 0;
  overflow: hidden;
  padding: 0 5px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  background: var(--zalo-blue);
  color: white;
  box-shadow: 0 10px 22px rgba(10, 120, 255, 0.18);
}

.panel-list {
  min-height: 0;
  overflow: auto;
  padding: 0 12px 12px;
  scrollbar-width: thin;
}

.assistant-hub,
.assistant-brief,
.assistant-toggle,
.assistant-prompts,
.assistant-rules {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.assistant-hub {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 14px 12px;
  text-align: center;
}

.assistant-orb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #101828, #2563eb 48%, #15b97a);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

.assistant-hub strong {
  color: var(--ink);
  font-size: 1rem;
}

.assistant-hub span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.assistant-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 10px;
  color: var(--ink);
  font-weight: 800;
}

.assistant-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--zalo-blue);
}

.assistant-rules {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
}

.assistant-rules label {
  display: grid;
  gap: 6px;
}

.assistant-rules span,
.assistant-rules small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.assistant-rules textarea {
  min-height: 76px;
  padding: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.assistant-rules .secondary-btn {
  min-height: 34px;
  padding: 7px 9px;
  font-size: 0.76rem;
}

.assistant-brief {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
}

.assistant-brief div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.assistant-brief div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.assistant-brief span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.assistant-brief strong {
  max-width: 58%;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-prompts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 8px;
  padding: 10px;
}

.assistant-prompts .secondary-btn {
  min-height: 36px;
  padding: 8px 10px;
}

.assistant-agent {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

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

.agent-action-grid .secondary-btn {
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.74rem;
}

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

.agent-metric,
.agent-feed {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.agent-metric span,
.agent-feed span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-metric strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.05rem;
}

.agent-feed {
  grid-column: 1 / -1;
}

.agent-feed ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.agent-feed li {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-copyright {
  flex-direction: column;
  gap: 7px;
  justify-content: center;
  margin: auto 18px 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  text-align: center;
}

.sidebar-copyright img {
  width: 118px;
  height: 68px;
  object-fit: contain;
}

.sidebar-copyright span {
  white-space: nowrap;
}

.chat-row-shell {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
  touch-action: pan-y;
}

.chat-row,
.person-row {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: transparent;
  text-align: left;
  color: inherit;
}

.chat-row-shell .chat-row {
  position: relative;
  z-index: 2;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chat-row-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: #dc2626;
  color: #ffffff;
  font-weight: 900;
}

.chat-row-delete:active {
  background: #b91c1c;
}

.chat-row-shell.is-delete-open .chat-row {
  transform: translateX(-76px);
  pointer-events: none;
}

.chat-row-shell.is-delete-open .chat-row-delete {
  z-index: 3;
}

@media (min-width: 861px) {
  .chat-row-shell {
    overflow: visible;
  }

  .chat-row-delete {
    display: none;
  }

  .chat-row-shell.is-delete-open .chat-row {
    transform: none;
    pointer-events: auto;
  }
}

.chat-row.active {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.chat-row:hover,
.chat-row.active,
.person-row:hover {
  background: rgba(255, 255, 255, 0.82);
}

.zalo-shell .chat-row.active {
  box-shadow: inset 4px 0 0 var(--zalo-blue);
}

.row-main {
  min-width: 0;
  flex: 1;
}

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.row-top strong,
.row-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#myName,
#activeName,
.row-top strong,
.info-profile h3 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.account-badges {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  vertical-align: middle;
}

.account-badge {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
}

.account-badge.verified {
  background: linear-gradient(135deg, #22c55e, #059669);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.22);
}

.account-badge.vip {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.row-top span,
.distance {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.row-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.unread-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 6px;
  background: #0ea5a5;
  color: #ffffff !important;
  font-size: 0.68rem !important;
  font-weight: 900 !important;
}

.chat-row.unread {
  background: #ecfeff;
  box-shadow: inset 3px 0 0 #0ea5a5;
}

.chat-row.unread .row-top strong,
.chat-row.unread .row-main p {
  color: var(--ink);
  font-weight: 900;
}

.row-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 7px;
  margin: 18px 4px;
  border: 1px dashed rgba(10, 120, 255, 0.24);
  border-radius: 8px;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.conversation .empty-state {
  max-width: 360px;
  margin: auto;
}

.nearby-tools {
  display: grid;
  grid-template-columns: minmax(0, 150px) 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 10px;
  margin: 4px 4px 12px;
  background: rgba(255, 255, 255, 0.8);
}

.journal-composer {
  display: grid;
  gap: 10px;
  margin: 4px 4px 14px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.business-composer,
.business-featured {
  display: grid;
  gap: 10px;
  margin: 4px 4px 14px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.88);
}

.business-intro,
.business-section-title {
  display: grid;
  gap: 3px;
}

.business-toggle {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.business-toggle > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.business-toggle small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.business-toggle-icon {
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--primary);
  background: rgba(20, 184, 166, 0.1);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.business-toggle:focus-visible {
  outline: 2px solid rgba(20, 184, 166, 0.45);
  outline-offset: 4px;
  border-radius: 6px;
}

.business-composer-body {
  display: grid;
  gap: 10px;
}

.business-composer-body[hidden] {
  display: none;
}

.business-section-title.compact {
  margin-top: 2px;
}

.business-intro strong,
.business-section-title strong {
  font-size: 0.98rem;
}

.business-intro span,
.business-section-title span,
.business-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.business-form {
  display: grid;
  gap: 8px;
}

.business-terms {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px;
  background: #fffbeb;
  color: #713f12;
  font-size: 0.8rem;
  line-height: 1.45;
}

.business-terms input {
  margin-top: 3px;
}

.business-form textarea {
  min-height: 82px;
}

.business-hours-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.business-hours-row:has(.business-checkbox) {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.business-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.business-location-panel {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.business-location-panel small,
.business-meta-row {
  color: var(--muted);
  font-size: 0.8rem;
}

.business-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.business-meta-row span,
.business-filter-row select {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  color: #0f766e;
  font-weight: 800;
}

.business-upload-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.business-upload-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.business-upload-panel input {
  width: 100%;
  font: inherit;
}

.business-logo-preview {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #ffffff;
  font-weight: 900;
}

.business-logo-preview img,
.business-logo.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-gallery,
.business-gallery-preview .business-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.business-gallery-preview small {
  color: var(--muted);
}

.business-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: #ffffff;
}

.business-search-panel,
.global-business-results {
  display: grid;
  gap: 8px;
}

.business-search-panel {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.business-search-panel input {
  width: 100%;
  border: 1px solid rgba(16, 24, 40, 0.12);
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  font: inherit;
}

.business-search-panel small {
  color: var(--muted);
  line-height: 1.4;
}

.business-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.business-filter-row button {
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 7px 9px;
  background: #ffffff;
  color: #0f766e;
  font-weight: 800;
}

.business-owner-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: #f8fffc;
}

.business-owner-tools,
.business-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.business-owner-tools button,
.business-actions button,
.business-actions a,
.business-customer-card button,
.business-customer-card select {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #1d4ed8;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
}

.business-actions button:first-child {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.business-customer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.business-customer-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.business-customer-card span,
.business-customer-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.global-business-results {
  margin: 10px 4px 4px;
}

.business-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.business-card.compact {
  padding: 10px;
}

.business-card.compact header {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.business-card.compact .business-logo {
  width: 38px;
  height: 38px;
}

.business-card.mine {
  border-color: rgba(15, 118, 110, 0.26);
  background: linear-gradient(180deg, #ffffff, #f0fdfa);
}

.business-card header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.business-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #ffffff;
  font-weight: 900;
}

.business-card strong,
.business-card span,
.business-card small,
.business-card em,
.business-card a {
  min-width: 0;
}

.business-card header span,
.business-card small,
.business-card em {
  color: var(--muted);
  font-size: 0.8rem;
}

.business-card p {
  margin: 0;
  line-height: 1.45;
}

.business-badge,
.business-offer {
  border-radius: 8px;
  padding: 6px 8px;
  background: #ecfdf3;
  color: #08795f;
  font-size: 0.76rem;
  font-weight: 900;
}

.business-badge.soft {
  background: #eff6ff;
  color: #1d4ed8;
}

.business-offer {
  background: #fff7ed;
  color: #9a3412;
}

.journal-composer textarea {
  min-height: 92px;
}

.journal-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.journal-privacy-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.journal-privacy-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.journal-privacy-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 700;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.journal-privacy-tabs button.active {
  border-color: rgba(8, 121, 95, 0.28);
  background: linear-gradient(135deg, #0c8f78, #10b3b8);
  color: #fff;
  box-shadow: 0 10px 22px rgba(7, 120, 112, 0.16);
}

.journal-privacy-tabs button:active,
.media-picker:active,
.delete-journal-btn:active {
  transform: translateY(1px) scale(0.99);
}

.media-picker {
  min-height: 42px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #e7f8f5;
  color: #08795f;
  font-weight: 900;
}

.media-picker input {
  display: none;
}

.journal-preview,
.message-media {
  overflow: hidden;
  border-radius: 8px;
}

.journal-preview img,
.message-media img,
.message-media video {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}

.journal-post {
  display: grid;
  gap: 10px;
  margin: 0 4px 10px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.journal-post header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.journal-post header > div:not(.avatar) {
  flex: 1;
  min-width: 0;
}

.journal-post strong,
.journal-post span {
  display: block;
}

.journal-post span,
.journal-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.journal-post p {
  margin: 0;
  line-height: 1.5;
}

.journal-post-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.journal-post-body.has-media {
  grid-template-columns: minmax(0, 1fr) 82px;
}

.journal-copy {
  min-width: 0;
}

.journal-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

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

.journal-media-thumb {
  width: 82px;
  height: 82px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: #f3f7f8;
}

.journal-media-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.delete-journal-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff0f0;
  color: #c0262d;
  font-weight: 900;
}

.journal-empty {
  margin: 8px 4px;
  text-align: center;
}

.conversation {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.conversation-header {
  min-height: 86px;
  display: grid;
  grid-template-columns: auto minmax(0, auto) minmax(0, 1fr) auto;
}

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

.message-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: clamp(18px, 2.4vw, 28px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0.58)),
    repeating-linear-gradient(90deg, rgba(16, 24, 40, 0.04) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgba(16, 24, 40, 0.04) 0 1px, transparent 1px 48px);
}

.message {
  max-width: min(620px, 78%);
  margin-bottom: 14px;
  display: grid;
  gap: 5px;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: pan-y;
}

.message-body {
  display: grid;
  gap: 5px;
}

.bubble {
  width: fit-content;
  max-width: 100%;
  border-radius: 18px;
  padding: 12px 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
}

.message.them .bubble {
  background: white;
  border-top-left-radius: 6px;
}

.message.me {
  margin-left: auto;
  justify-items: end;
}

.message.me .bubble {
  background: #101828;
  color: white;
  border-top-right-radius: 6px;
}

.assistant-message .bubble {
  display: grid;
  gap: 10px;
}

.assistant-message .bubble p {
  margin: 0;
}

.assistant-message .bubble code {
  border-radius: 6px;
  padding: 1px 5px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 0.92em;
}

.ai-table-wrap {
  max-width: min(100%, 760px);
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
}

.ai-answer-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.35;
}

.ai-answer-table th,
.ai-answer-table td {
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.ai-answer-table th {
  background: rgba(16, 24, 40, 0.05);
  color: var(--text);
  font-weight: 800;
}

.ai-answer-table tr:last-child td {
  border-bottom: 0;
}

.ai-visual-block {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ai-visual-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 8px;
  padding: 9px;
  background: rgba(236, 253, 245, 0.78);
}

.ai-visual-item span,
.ai-visual-item small {
  color: var(--muted);
  font-size: 0.75rem;
}

.ai-visual-item strong {
  color: #0f766e;
  overflow-wrap: anywhere;
}

.message.recalled .bubble {
  background: rgba(231, 248, 245, 0.92);
  color: #08795f;
  font-style: italic;
}

.assistant-message.is-pending .bubble {
  color: var(--muted);
  font-style: italic;
}

.message time {
  color: var(--muted);
  font-size: 0.76rem;
}

.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}

.message-reaction {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.82rem;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.07);
}

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

.message-reaction.is-mine {
  border-color: rgba(0, 167, 199, 0.5);
  background: rgba(231, 248, 245, 0.96);
}

.message-reaction b {
  font-size: 0.72rem;
}

.nearby-action {
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  background: rgba(16, 24, 40, 0.08);
  color: #101828;
  font-size: 0.74rem;
  font-weight: 900;
}

.message-media {
  max-width: min(360px, 100%);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
}

.message-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(8px);
}

.message-action-panel {
  width: min(460px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.message-action-title {
  display: grid;
  gap: 2px;
  padding: 6px 8px 8px;
}

.message-action-title strong {
  color: var(--ink);
  font-size: 1rem;
}

.message-action-title span,
.message-action-row small,
.message-action-empty {
  color: var(--muted);
  font-size: 0.8rem;
}

.message-reaction-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.message-reaction-choice {
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: #f6f8fb;
  font-size: 1.25rem;
}

.message-reaction-choice.active {
  border-color: rgba(0, 167, 199, 0.5);
  background: rgba(231, 248, 245, 0.98);
}

.message-action-row,
.message-action-cancel {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: #f6f8fb;
  color: var(--ink);
  text-align: left;
  font: inherit;
}

.message-action-row {
  display: grid;
  gap: 2px;
}

.message-action-row span {
  font-weight: 900;
}

.message-action-row.warning {
  background: #fff7ed;
  color: #b45309;
}

.message-action-row.danger {
  background: #fff1f2;
  color: #be123c;
}

.message-action-row:disabled {
  opacity: 0.45;
}

.message-action-cancel {
  text-align: center;
  font-weight: 900;
}

.message-forward-list {
  max-height: min(48vh, 360px);
  overflow: auto;
  display: grid;
  gap: 8px;
}

.message-action-empty {
  margin: 4px 8px 10px;
}

.message.me .message-media {
  justify-self: end;
}

.message-location {
  width: min(300px, 100%);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
}

.message.me .message-location {
  justify-self: end;
  background: rgba(255, 255, 255, 0.96);
}

.location-pin {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7f8f5;
  color: #08795f;
}

.location-pin svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-location strong,
.message-location small,
.message-location em {
  display: block;
}

.message-location small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.message-location em {
  margin-top: 4px;
  color: #08795f;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.media-caption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nearby-action {
  align-self: center;
  background: #e7f8f5;
  color: #08795f;
  white-space: nowrap;
}

.composer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.emoji-panel {
  position: absolute;
  left: 108px;
  bottom: calc(100% + 10px);
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(5, 38px);
  gap: 6px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.16);
  backdrop-filter: blur(18px);
}

.emoji-panel button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: #f6fafb;
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 150ms ease, background 150ms ease;
}

.emoji-panel button:hover {
  transform: translateY(-1px);
  background: #e7f8f5;
}

.composer #messageInput {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  line-height: 1.35;
  background: white;
}

.send-btn {
  background: var(--cyan);
  color: white;
}

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.54);
  backdrop-filter: blur(18px);
}

.call-card {
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: #101828;
  color: white;
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.36);
}

.call-video-stage {
  min-height: 280px;
  position: relative;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(16, 24, 40, 0.62), rgba(16, 24, 40, 0.62)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 44px);
}

.remote-video,
.local-video {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.remote-audio,
#remoteAudio {
  display: none;
}

.remote-video {
  background: #07111f;
}

.local-video:not(.hidden) {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  width: min(34%, 150px);
  height: auto;
  min-height: 96px;
  aspect-ratio: 3 / 4;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.remote-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.call-avatar {
  width: 84px;
  height: 84px;
  border-radius: 28px;
  font-size: 2rem;
}

.call-info {
  padding: 24px;
  text-align: center;
}

.call-info h2 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.call-info span {
  display: inline-flex;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.call-info p:last-child {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
}

.call-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 18px 20px;
}

.call-overlay.voice-call .call-controls {
  grid-template-columns: repeat(3, minmax(0, 112px));
  justify-content: center;
}

.call-btn {
  min-height: 72px;
  display: grid;
  place-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 800;
}

.call-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.call-btn.is-off {
  background: rgba(244, 183, 64, 0.2);
  color: #ffd27a;
}

.call-btn.is-active {
  background: rgba(21, 185, 122, 0.24);
  color: #b8f7db;
}

.answer-call {
  background: #15b97a;
}

.end-call {
  background: #e5484d;
}

.call-overlay.incoming-call .call-controls {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
}

.friend-overlay,
.profile-overlay,
.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.5);
  backdrop-filter: blur(18px);
}

.friend-card,
.profile-card,
.info-card {
  width: min(470px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(16, 24, 40, 0.24);
}

.profile-card {
  width: min(520px, 100%);
}

.info-card {
  width: min(430px, 100%);
}

.friends-card {
  width: min(520px, 100%);
}

.settings-card {
  width: min(560px, 100%);
}

.account-delete-card {
  width: min(520px, 100%);
}

.force-password-card {
  width: min(520px, 100%);
}

.force-password-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.app-admin-card {
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 36px));
}

.friends-directory {
  display: grid;
  gap: 8px;
  padding: 16px 18px 18px;
}

.app-admin-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px 18px 0;
}

.app-admin-toolbar input {
  min-height: 40px;
}

.app-admin-meta {
  padding: 8px 18px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.app-admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.25fr);
  gap: 12px;
  min-height: 0;
  padding: 14px 18px 18px;
}

.app-admin-businesses {
  display: grid;
  gap: 10px;
  padding: 14px 18px 0;
}

.app-admin-business-title,
.app-admin-business-empty {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-admin-business-title strong,
.app-admin-business-empty strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.app-admin-business-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.app-admin-business-card strong,
.app-admin-business-card span,
.app-admin-business-card small {
  display: block;
}

.app-admin-business-card span,
.app-admin-business-card small {
  color: var(--muted);
  font-size: 0.8rem;
}

.app-admin-business-card p {
  margin: 6px 0;
  line-height: 1.4;
}

.app-admin-business-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.app-admin-business-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 800;
}

.app-admin-users,
.app-admin-detail {
  min-height: 420px;
  max-height: 540px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.app-admin-users {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.app-admin-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: inherit;
  text-align: left;
}

.app-admin-row.active,
.app-admin-row:hover {
  border-color: rgba(14, 165, 165, 0.28);
  background: #ecfeff;
}

.app-admin-row .avatar {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 12px;
  box-shadow: none;
}

.app-admin-row strong,
.app-admin-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-admin-row span,
.app-admin-row small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.app-admin-detail {
  padding: 12px;
}

.app-admin-profile {
  display: grid;
  justify-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px 14px;
  margin-bottom: 12px;
  text-align: center;
}

.app-admin-profile .avatar {
  width: 70px;
  height: 70px;
  flex-basis: 70px;
  border-radius: 18px;
}

.app-admin-profile h3 {
  margin: 0;
}

.app-admin-profile span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.friends-directory-row {
  width: 100%;
  text-align: left;
}

.settings-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.settings-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fafb;
}

.account-section .settings-action {
  width: 100%;
}

.account-danger-panel {
  border-color: rgba(180, 35, 24, 0.2);
  background: #fff8f7;
}

.account-danger-panel .settings-title strong {
  color: #b42318;
}

.settings-title {
  display: grid;
  gap: 3px;
  padding-bottom: 4px;
}

.settings-title strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.settings-title span,
.settings-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  border: 1px solid #edf2f7;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.settings-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #0ea5a5;
}

.settings-action {
  width: fit-content;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.settings-status {
  margin: 0;
}

.friend-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
}

.friend-header div {
  flex: 1;
  min-width: 0;
}

.friend-header h2 {
  margin: 0;
  font-size: 1.6rem;
}

.friend-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 18px 0;
}

.friend-tab {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #edf3f7;
  color: #344054;
  font-weight: 800;
}

.friend-tab.active {
  background: #101828;
  color: white;
}

.friend-panel {
  padding: 18px;
}

.qr-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 18px;
  background: #f8fbfc;
  text-align: center;
}

.qr-card canvas {
  width: 236px;
  height: 236px;
  max-width: 100%;
  border-radius: 8px;
  background: white;
}

.qr-card span,
.friend-status {
  color: var(--muted);
}

.scan-box {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  border-radius: 8px;
  background: #101828;
}

.scan-box video {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.scan-frame {
  position: absolute;
  inset: 48px;
  border: 2px solid rgba(0, 167, 199, 0.94);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(16, 24, 40, 0.34);
  pointer-events: none;
}

.scan-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.friend-status {
  margin: 0;
  padding: 0 18px 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.profile-editor {
  padding: 18px;
}

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-preview {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  border-radius: 24px;
  font-size: 1.8rem;
}

.avatar-upload {
  flex: 1;
  margin: 0;
  display: grid;
  min-height: 58px;
  place-items: center;
  border: 1px solid rgba(0, 168, 132, 0.24);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0, 168, 132, 0.09);
  color: #08795f;
  font-weight: 900;
  text-align: center;
}

.avatar-upload input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.profile-readonly-field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.profile-readonly-field input {
  background: #f3f4f6;
  color: #475467;
  cursor: not-allowed;
}

.birth-date-field input[type="date"] {
  min-height: 48px;
}

.birth-date-selects {
  display: grid;
  grid-template-columns: 0.92fr 1fr 1fr;
  gap: 8px;
}

.birth-date-selects select {
  min-height: 46px;
  padding: 12px 10px;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  -webkit-appearance: menulist;
  appearance: auto;
}

.privacy-panel {
  display: grid;
  gap: 10px;
  margin: 4px 0 18px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbfc;
}

.privacy-panel strong {
  display: block;
  margin-bottom: 4px;
}

.privacy-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.privacy-panel p::after {
  content: " Số điện thoại vẫn dùng để kết nối tài khoản, nhưng có thể ẩn trong màn hình thông tin.";
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 800;
}

.privacy-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  padding: 0;
  accent-color: var(--cyan);
}

.profile-account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 8px;
  padding: 13px;
  background: #fff7f6;
}

.profile-account-panel strong {
  display: block;
  color: #912018;
  font-size: 0.94rem;
}

.profile-account-panel p {
  margin: 3px 0 0;
  color: #7a271a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.profile-delete-account-btn {
  min-height: 42px;
  white-space: nowrap;
}

.info-profile {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 18px 16px;
  text-align: center;
}

.info-profile h3 {
  margin: 4px 0 0;
  font-size: 1.7rem;
}

.info-profile span {
  color: var(--muted);
  font-weight: 700;
}

.info-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.info-item {
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  background: #f8fbfc;
}

.info-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.info-item strong,
.info-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .app-shell {
    padding: 14px;
  }

  .auth-screen {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    gap: 18px;
  }

  .brand-panel {
    min-height: auto;
    padding: 34px;
  }

  .signal-card {
    width: min(340px, 54vw);
  }

  .login-card {
    min-height: 0;
  }

  .trust-row,
  .digital-metrics {
    max-width: 560px;
  }

  .chat-app {
    height: calc(100vh - 28px);
    min-height: 620px;
    grid-template-columns: clamp(300px, 33vw, 350px) minmax(0, 1fr);
    gap: 14px;
  }

  .profile-strip,
  .conversation-header {
    padding: 14px;
  }

  .header-actions {
    gap: 6px;
  }

  .message {
    max-width: min(560px, 82%);
  }
}

@media (max-width: 860px) {
  .auth-screen {
    height: auto;
    min-height: calc(100vh - 28px);
    min-height: calc(100dvh - 28px);
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand-panel {
    min-height: 0;
  }

  .signal-card {
    width: min(360px, 70vw);
  }

  .chat-app {
    height: calc(100vh - 28px);
    height: calc(100dvh - 28px);
    min-height: 620px;
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
  }

  .sidebar,
  .conversation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    transition: transform 220ms ease;
  }

  .sidebar {
    z-index: 1;
  }

  .conversation {
    z-index: 2;
    transform: translateX(100%);
  }

  .chat-app.conversation-open .sidebar {
    transform: translateX(-18%);
  }

  .chat-app.conversation-open .conversation {
    transform: translateX(0);
  }

  .back-btn {
    display: grid;
  }
}

@media (max-width: 560px) {
  body {
    overflow: hidden;
    background: #f7fbff;
  }

  .app-shell {
    padding: 0;
    min-height: 100dvh;
  }

  .auth-screen,
  .chat-app {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .auth-screen {
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: minmax(320px, 44dvh) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    padding-bottom: var(--safe-bottom);
  }

  .chat-app {
    height: 100vh;
    height: 100dvh;
    display: block;
    position: relative;
    overflow: hidden;
    background: white;
  }

  .brand-panel,
  .login-card,
  .sidebar,
  .conversation {
    border-radius: 0;
  }

  .brand-panel {
    min-height: 0;
    height: 100%;
    padding: calc(7px + var(--safe-top)) 14px 7px;
    border-bottom: 0;
    box-shadow: none;
  }

  .brand-panel::after,
  .ai-grid,
  .orbit,
  .pulse-node,
  .floating-panel {
    display: none;
  }

  .signal-card {
    width: 72px;
    margin: 0 auto 4px;
  }

  .ai-core {
    width: 72px;
    min-width: 72px;
  }

  .core-chip {
    width: 36px;
    height: 36px;
    font-size: 0.86rem;
  }

  .core-ring {
    inset: 9%;
  }

  h1 {
    margin-bottom: 3px;
    text-align: center;
    font-size: clamp(1.85rem, 10vw, 2.3rem);
  }

  .lead {
    max-width: 340px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.22;
  }

  .digital-metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin-top: 5px;
  }

  .digital-metrics div {
    padding: 5px 6px;
  }

  .digital-metrics strong {
    font-size: 0.82rem;
  }

  .digital-metrics span {
    margin-top: 1px;
    font-size: 0.52rem;
  }

  .trust-row {
    justify-content: center;
    gap: 4px;
    margin-top: 5px;
  }

  .trust-row span {
    padding: 4px 6px;
    font-size: 0.56rem;
  }

  .copyright-brand {
    width: fit-content;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 5px auto 0;
    padding: 3px 7px;
    font-size: 0.56rem;
  }

  .copyright-brand img {
    width: 48px;
    height: 25px;
  }

  .login-card {
    min-height: 0;
    height: 100%;
    justify-content: start;
    border-left: 0;
    border-top: 1px solid rgba(16, 24, 40, 0.08);
    padding: 7px 16px calc(7px + var(--safe-bottom));
    box-shadow: none;
    overflow: hidden;
  }

  .login-card::after {
    display: none;
  }

  .login-card .eyebrow {
    margin-bottom: 3px;
    font-size: 0.56rem;
    text-align: left;
  }

  .login-card h2 {
    margin-bottom: 7px;
    font-size: 1.18rem;
    text-align: left;
  }

  .auth-tabs {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    padding: 4px;
  }

  .auth-tab {
    min-height: 29px;
    font-size: 0.64rem;
  }

  label {
    gap: 4px;
    margin-bottom: 7px;
    font-size: 0.72rem;
  }

  input,
  textarea {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 16px;
  }

  .auth-actions {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .primary-btn {
    min-height: 36px;
  }

  .secondary-btn {
    min-height: 36px;
    padding: 8px 11px;
  }

  .auth-status {
    margin-top: 6px;
    font-size: 0.66rem;
    line-height: 1.24;
  }

  .fine-print {
    margin-top: 5px;
    font-size: 0.63rem;
    line-height: 1.24;
  }

  .otp-local-code {
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  body[data-auth-mode="register"] .login-card,
  body[data-auth-mode="forgot"] .login-card {
    padding-top: 5px;
    padding-bottom: calc(5px + var(--safe-bottom));
  }

  body[data-auth-mode="register"] .login-card .eyebrow,
  body[data-auth-mode="forgot"] .login-card .eyebrow {
    margin-bottom: 2px;
    font-size: 0.52rem;
  }

  body[data-auth-mode="register"] .login-card h2,
  body[data-auth-mode="forgot"] .login-card h2 {
    margin-bottom: 4px;
    font-size: 0.98rem;
  }

  body[data-auth-mode="register"] .auth-tabs,
  body[data-auth-mode="forgot"] .auth-tabs {
    margin-bottom: 4px;
    padding: 3px;
  }

  body[data-auth-mode="register"] .auth-tab,
  body[data-auth-mode="forgot"] .auth-tab {
    min-height: 24px;
    font-size: 0.58rem;
  }

  body[data-auth-mode="register"] label,
  body[data-auth-mode="forgot"] label {
    gap: 3px;
    margin-bottom: 3px;
    font-size: 0.64rem;
  }

  body[data-auth-mode="register"] input,
  body[data-auth-mode="forgot"] input {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 16px;
  }

  body[data-auth-mode="register"] .primary-btn,
  body[data-auth-mode="forgot"] .primary-btn {
    min-height: 30px;
  }

  body[data-auth-mode="register"] .auth-status,
  body[data-auth-mode="forgot"] .auth-status {
    margin-top: 3px;
    font-size: 0.58rem;
    line-height: 1.14;
  }

  body[data-auth-mode="register"] .fine-print,
  body[data-auth-mode="forgot"] .fine-print {
    display: none;
  }

  .profile-strip,
  .conversation-header,
  .composer {
    padding: 14px;
  }

  .sidebar,
  .conversation {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    box-shadow: none;
  }

  .sidebar {
    display: flex;
    position: absolute;
    inset: 0;
    padding-top: var(--safe-top);
    transition: transform 220ms ease;
  }

  .conversation {
    display: flex;
    position: absolute;
    inset: 0;
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  .chat-app.conversation-open .sidebar {
    transform: translateX(-28%);
  }

  .chat-app.conversation-open .conversation {
    transform: translateX(0);
  }

  .back-btn {
    display: grid;
  }

  .conversation-header {
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 10px;
    padding-top: calc(12px + var(--safe-top));
  }

  .conversation-header .avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 14px;
  }

  .conversation-header h2 {
    font-size: 1.05rem;
  }

  .conversation-header span {
    font-size: 0.76rem;
  }

  .e2ee-status {
    max-width: 100%;
    font-size: 0.68rem !important;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .header-actions .icon-btn {
    width: 100%;
    flex-basis: auto;
  }

  .message-stage {
    padding: 18px 14px;
  }

  .message {
    max-width: 90%;
  }

  .composer {
    gap: 8px;
    padding-bottom: calc(12px + var(--safe-bottom));
  }

  .emoji-panel {
    left: 74px;
    right: 58px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .emoji-panel button {
    width: 100%;
  }

  .composer .icon-btn,
  .composer .send-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .composer #messageInput {
    min-height: 42px;
    padding: 11px 12px;
  }

  .panel-list {
    padding-bottom: calc(86px + var(--safe-bottom));
  }

  .search-box {
    margin: 12px 14px;
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 0 14px 10px;
  }

  .quick-action {
    min-height: 56px;
    gap: 4px;
    font-size: 0.65rem;
  }

  .quick-action svg {
    width: 18px;
    height: 18px;
  }

  .tab-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--safe-bottom);
    z-index: 3;
    padding: 10px 14px calc(10px + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(16, 24, 40, 0.08);
  }

  .sidebar-copyright {
    display: none;
  }

  .tab {
    min-height: 38px;
    font-size: 0.82rem;
  }

  .chat-row,
  .person-row {
    padding: 10px;
  }

  .journal-tools {
    grid-template-columns: 1fr;
  }

  .journal-composer,
  .journal-post {
    margin-left: 2px;
    margin-right: 2px;
  }

  .call-overlay {
    padding: 0;
  }

  .friend-overlay,
  .profile-overlay,
  .info-overlay {
    padding: 0;
  }

  .call-card {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .call-video-stage {
    flex: 1;
    min-height: 0;
  }

  .local-video {
    min-height: 0;
  }

  .local-video:not(.hidden) {
    width: min(36%, 132px);
    min-height: 84px;
    right: 12px;
    bottom: 12px;
  }

  .call-info {
    padding: 20px 18px 14px;
  }

  .call-controls {
    padding: 0 14px calc(16px + var(--safe-bottom));
  }

  .friend-card,
  .profile-card,
  .info-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

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

  .friend-tabs {
    grid-template-columns: 1fr;
  }

  .scan-actions {
    grid-template-columns: 1fr;
  }

  .profile-editor,
  .friend-panel {
    padding: 16px;
  }

  .birth-date-selects {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 7px;
  }

  .birth-date-selects select {
    min-height: 48px;
    padding: 12px 8px;
    font-size: 16px;
  }

  .avatar-editor {
    align-items: flex-start;
  }

  .privacy-panel {
    gap: 12px;
  }

  .profile-account-panel {
    grid-template-columns: 1fr;
  }

  .call-history-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .call-history-list {
    max-height: none;
  }

  .profile-delete-account-btn {
    width: 100%;
  }

  .friend-status {
    padding-bottom: calc(18px + var(--safe-bottom));
  }

  .settings-body {
    padding: 14px 16px calc(18px + var(--safe-bottom));
  }

  .settings-section {
    padding: 11px;
  }
}

@media (min-width: 861px) {
  .back-btn {
    display: none;
  }
}

/* Minimal fixed-frame interface */
:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --cyan: #0ea5a5;
  --green: #16a34a;
  --blue: #2563eb;
  --coral: #ef4444;
  --yellow: #d97706;
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
  --shell-gap: 10px;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  background: #f3f4f6;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 12px;
}

.brand-panel,
.login-card,
.sidebar,
.conversation,
.friend-card,
.profile-card,
.info-card,
.call-card,
.journal-post,
.journal-composer,
.nearby-tools,
.empty-state,
.qr-card,
.privacy-panel,
.info-item {
  border-color: var(--line);
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

.brand-panel,
.login-card,
.sidebar,
.conversation {
  border-radius: 8px;
}

.call-card {
  border-color: rgba(148, 163, 184, 0.26);
  background: #101828;
  color: #ffffff;
}

.call-card .call-info h2,
.call-card .call-info span,
.call-card .call-info p,
.call-card .remote-placeholder,
.call-card .remote-placeholder span {
  color: #ffffff;
}

.call-card .call-info span,
.call-card .call-info p:last-child {
  color: rgba(255, 255, 255, 0.78);
}

.call-card .call-btn:not(.answer-call):not(.end-call) {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #243244;
  color: #ffffff;
}

.call-card .call-btn:not(.answer-call):not(.end-call):hover {
  background: #334155;
}

.call-card .call-btn.is-off {
  border-color: rgba(245, 158, 11, 0.42);
  background: #5f3b10;
  color: #ffd27a;
}

.call-card .call-btn.is-active {
  border-color: rgba(34, 197, 94, 0.44);
  background: #14532d;
  color: #bbf7d0;
}

.auth-screen {
  height: calc(100dvh - 24px);
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 420px;
  border-color: var(--line);
  background: #ffffff;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.brand-panel {
  min-height: 0;
  padding: 32px;
  background: #f9fafb;
}

.brand-panel::after,
.ai-grid,
.orbit,
.pulse-node,
.floating-panel,
.data-line,
.trust-row,
.digital-metrics,
.login-card::before,
.login-card::after {
  display: none;
}

.signal-card {
  width: 132px;
  margin-bottom: 18px;
}

.ai-core {
  width: 112px;
  min-width: 112px;
  box-shadow: none;
}

.core-chip {
  width: 54px;
  height: 54px;
  font-size: 1rem;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 4vw, 4rem);
}

.lead {
  max-width: 560px;
  font-size: 0.98rem;
}

.copyright-brand {
  margin-top: 18px;
}

.login-card {
  min-height: 0;
  padding: 48px 36px;
  overflow: auto;
  background: #ffffff;
}

.login-card h2 {
  font-size: 1.75rem;
}

input,
textarea,
.auth-tabs,
.tab,
.quick-action,
.icon-btn,
.send-btn,
.primary-btn,
.secondary-btn,
.friend-tab,
.call-btn {
  border-radius: 8px;
}

.icon-btn:hover,
.send-btn:hover,
.tab:hover,
.auth-tab:hover,
.friend-tab:hover {
  transform: none;
}

.chat-app {
  height: calc(100dvh - 24px);
  min-height: 0;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 10px;
}

.sidebar {
  min-height: 0;
  display: grid;
  grid-template-rows: 64px 54px 66px 48px minmax(0, 1fr);
  overflow: hidden;
  background: #ffffff;
}

.zalo-shell .profile-strip,
.profile-strip,
.conversation-header,
.composer,
.tab-bar {
  background: #ffffff;
  border-color: var(--line);
}

.zalo-shell .profile-strip {
  color: var(--ink);
}

.zalo-shell .profile-strip span,
.profile-strip span {
  color: var(--muted);
}

.zalo-shell .profile-strip .icon-btn,
.icon-btn,
.send-btn {
  background: #f3f4f6;
  color: var(--ink);
}

.profile-strip {
  min-height: 64px;
  padding: 10px 12px;
}

.search-box {
  height: 42px;
  margin: 6px 12px;
  background: #f9fafb;
}

.quick-actions {
  min-height: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 0 12px 8px;
}

.quick-actions.has-app-admin {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-action {
  min-height: 48px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: #ffffff;
}

.quick-action.active {
  color: var(--zalo-blue);
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--zalo-blue) 42%, var(--line));
}

.app-admin-action {
  color: #047857;
  background: #ecfdf3;
}

.quick-action svg {
  width: 18px;
  height: 18px;
  stroke: var(--ink);
}

.tab-bar {
  min-height: 48px;
  gap: 5px;
  padding: 0 10px 8px;
}

.tab {
  min-height: 38px;
  background: #f3f4f6;
  min-width: 0;
  overflow: hidden;
  padding: 0 5px;
  font-size: 0.72rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  background: var(--ink);
  color: #ffffff;
  box-shadow: none;
}

.panel-list {
  min-height: 0;
  height: 100%;
  padding: 0 8px 8px;
  overflow: auto;
}

.sidebar-copyright {
  display: none;
}

.conversation {
  min-height: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) 66px;
  overflow: hidden;
  background: #ffffff;
}

.conversation-header {
  min-height: 72px;
  padding: 10px 12px;
}

.message-stage {
  min-height: 0;
  padding: 16px;
  background: #f9fafb;
}

.composer {
  min-height: 66px;
  padding: 10px 12px;
}

.avatar {
  box-shadow: none;
}

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

.chat-row,
.person-row {
  min-height: 64px;
  border-radius: 8px;
  padding: 10px;
}

.chat-row:hover,
.chat-row.active,
.person-row:hover {
  background: #f9fafb;
}

.zalo-shell .chat-row.active,
.chat-row.active {
  box-shadow: inset 3px 0 0 var(--ink);
}

.empty-state {
  background: #f9fafb;
}

.message {
  max-width: min(560px, 76%);
}

.bubble {
  box-shadow: none;
}

.message.them .bubble {
  border: 1px solid var(--line);
}

.message.me .bubble {
  background: var(--ink);
}

.message-actions {
  opacity: 1;
}

.call-overlay,
.friend-overlay,
.profile-overlay,
.info-overlay {
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: none;
}

.conversation {
  position: relative;
}

.ai-twin-btn {
  background: #eef6ff;
  color: #1d4ed8;
}

.ai-panel {
  position: absolute;
  top: 92px;
  right: 12px;
  bottom: 76px;
  z-index: 8;
  width: min(352px, calc(100% - 24px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.ai-panel-header div {
  min-width: 0;
  flex: 1;
}

.ai-panel-header span {
  display: block;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ai-panel-header strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
}

.ai-panel-body {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.ai-signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ai-signal-strip span {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 7px 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f9fafb;
}

.ai-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ai-card p {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ai-action-list {
  display: grid;
  gap: 6px;
}

.ai-action-list span {
  position: relative;
  display: block;
  padding-left: 15px;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.42;
}

.ai-action-list span::before {
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #15b97a;
  content: "";
}

.ai-reply-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ai-reply-btn {
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 0.78rem;
}

.ai-use-btn {
  min-height: 34px;
  justify-self: start;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.ai-use-btn:disabled,
.ai-reply-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.ai-refresh-btn {
  width: auto;
  min-height: 40px;
  margin: 12px;
}

@media (max-width: 1180px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 0;
  }

  .chat-app {
    height: calc(100dvh - 24px);
    min-height: 0;
    grid-template-columns: 340px minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 0;
  }

  .auth-screen,
  .chat-app {
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .auth-screen {
    grid-template-columns: 1fr;
    grid-template-rows: 33dvh minmax(0, 1fr);
    gap: 0;
  }

  .brand-panel,
  .login-card,
  .sidebar,
  .conversation {
    border-radius: 0;
  }

  .brand-panel {
    padding: calc(14px + var(--safe-top)) 18px 12px;
  }

  .signal-card {
    width: 78px;
    margin-bottom: 6px;
  }

  .ai-core {
    width: 68px;
    min-width: 68px;
  }

  .core-chip {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }

  h1 {
    margin-bottom: 4px;
    font-size: 2rem;
  }

  .lead {
    max-width: 340px;
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .copyright-brand {
    margin-top: 6px;
    font-size: 0.58rem;
  }

  .copyright-brand img {
    width: 48px;
    height: 25px;
  }

  .login-card,
  body[data-auth-mode="register"] .login-card,
  body[data-auth-mode="forgot"] .login-card {
    padding: 10px 16px calc(10px + var(--safe-bottom));
  }

  .login-card .eyebrow,
  body[data-auth-mode="register"] .login-card .eyebrow,
  body[data-auth-mode="forgot"] .login-card .eyebrow {
    margin-bottom: 2px;
    font-size: 0.56rem;
  }

  .login-card h2,
  body[data-auth-mode="register"] .login-card h2,
  body[data-auth-mode="forgot"] .login-card h2 {
    margin-bottom: 6px;
    font-size: 1.05rem;
  }

  .auth-tabs,
  body[data-auth-mode="register"] .auth-tabs,
  body[data-auth-mode="forgot"] .auth-tabs {
    margin-bottom: 7px;
    padding: 3px;
  }

  .auth-tab,
  body[data-auth-mode="register"] .auth-tab,
  body[data-auth-mode="forgot"] .auth-tab {
    min-height: 28px;
    font-size: 0.6rem;
  }

  label,
  body[data-auth-mode="register"] label,
  body[data-auth-mode="forgot"] label {
    gap: 3px;
    margin-bottom: 5px;
    font-size: 0.64rem;
  }

  input,
  textarea,
  body[data-auth-mode="register"] input,
  body[data-auth-mode="forgot"] input {
    min-height: 31px;
    padding: 6px 9px;
    font-size: 16px;
  }

  .auth-status,
  body[data-auth-mode="register"] .auth-status,
  body[data-auth-mode="forgot"] .auth-status,
  .fine-print,
  body[data-auth-mode="register"] .fine-print,
  body[data-auth-mode="forgot"] .fine-print {
    margin-top: 5px;
    font-size: 0.6rem;
    line-height: 1.22;
  }

  .chat-app {
    display: block;
    position: relative;
    overflow: hidden;
  }

  .sidebar {
    display: grid;
    grid-template-rows: calc(60px + var(--safe-top)) 52px 60px 48px minmax(0, 1fr);
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 180ms ease;
  }

  .conversation {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 180ms ease;
  }

  .profile-strip {
    min-height: 0;
    padding: calc(8px + var(--safe-top)) 12px 8px;
  }

  .search-box {
    margin: 6px 12px;
  }

  .quick-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 0 12px 7px;
  }

  .quick-action {
    min-height: 46px;
    font-size: 0.62rem;
  }

  .tab-bar {
    position: static !important;
    min-height: 48px;
    padding: 0 12px 8px;
    border-top: 0;
    background: #ffffff;
    backdrop-filter: none;
  }

  .panel-list {
    padding: 0 8px 8px;
  }

  .conversation-header {
    display: grid;
    grid-template-columns: auto 40px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: calc(8px + var(--safe-top)) 12px 8px;
  }

  .header-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .header-actions .icon-btn {
    width: 100%;
    height: 36px;
    min-width: 0;
    flex-basis: auto;
  }

  .ai-panel {
    inset: calc(110px + var(--safe-top)) 8px calc(70px + var(--safe-bottom));
    width: auto;
  }

  .message-stage {
    min-height: 0;
    padding: 12px;
  }

  .composer {
    min-height: 0;
    gap: 8px;
    padding: 8px 10px calc(8px + var(--safe-bottom));
  }

  .composer .icon-btn,
  .composer .send-btn {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .composer #messageInput {
    min-width: 0;
  }

  .call-overlay {
    padding: var(--safe-top) 0 var(--safe-bottom);
  }

  .call-card {
    max-height: 100dvh;
  }

  .call-info {
    padding: 14px 14px 10px;
  }

  .call-controls {
    gap: 8px;
    padding: 0 12px calc(12px + var(--safe-bottom));
  }

  .call-btn {
    min-height: 58px;
  }

  .chat-app.conversation-open .sidebar {
    transform: translateX(-24%);
  }

  .message {
    max-width: 88%;
  }

  .settings-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .settings-body {
    padding: 14px 16px calc(18px + var(--safe-bottom));
  }

  .app-admin-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .app-admin-toolbar {
    grid-template-columns: 1fr;
    padding: 12px 14px 0;
  }

  .app-admin-layout {
    grid-template-columns: 1fr;
    padding: 12px 14px calc(14px + var(--safe-bottom));
  }

  .app-admin-users,
  .app-admin-detail {
    min-height: 220px;
    max-height: none;
  }
}

/* Mobile chat polish inspired by native messenger ergonomics. */
.message-actions {
  display: none !important;
}

@media (max-width: 860px) {
  .chat-row,
  .person-row {
    min-height: 56px;
    gap: 10px;
    padding: 8px 10px;
  }

  .row-top {
    margin-bottom: 3px;
  }

  .row-main p {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .message {
    margin-bottom: 9px;
  }

  .bubble {
    padding: 10px 13px;
    line-height: 1.42;
  }

  .composer {
    position: relative;
    z-index: 6;
    align-items: flex-end;
    gap: 7px;
    border-top-color: rgba(16, 24, 40, 0.1);
    background: rgba(255, 255, 255, 0.98);
  }

  .composer #messageInput {
    min-height: 38px;
    max-height: 94px;
    border-radius: 8px;
  }

  .composer .icon-btn,
  .composer .send-btn {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .chat-app.keyboard-open .conversation {
    bottom: var(--keyboard-bottom);
    height: auto;
  }

  .chat-app.keyboard-open .ai-panel {
    bottom: calc(70px + var(--safe-bottom) + var(--keyboard-bottom));
  }

  .chat-app.keyboard-open .message-stage {
    overscroll-behavior: contain;
  }

  body.keyboard-open .auth-screen {
    height: calc(100dvh - var(--keyboard-bottom));
  }
}

/* Chuẩn 1: đồng bộ khung web với bản mobile/native. */
:root {
  --sync-primary: #00a884;
  --sync-secondary: #0e7490;
  --sync-surface: #ffffff;
  --sync-bg: #f8fafc;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.9)),
    var(--sync-bg);
}

.app-shell {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 12px;
}

.auth-screen {
  width: min(430px, 100%);
  height: min(820px, calc(100dvh - 24px));
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(230px, 31%) minmax(0, 1fr);
  border-color: rgba(216, 224, 234, 0.9);
  border-radius: 18px;
  background: var(--sync-surface);
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.13);
}

.auth-screen .brand-panel {
  min-height: 0;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(216, 224, 234, 0.84);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88)),
    radial-gradient(circle at 50% 12%, color-mix(in srgb, var(--sync-primary) 18%, transparent), transparent 14rem);
}

.auth-screen .signal-card {
  width: 128px;
  height: 128px;
  margin-bottom: 8px;
}

.auth-screen .floating-panel,
.auth-screen .trust-row,
.auth-screen .digital-metrics {
  display: none;
}

.auth-screen .eyebrow {
  color: var(--sync-primary);
  text-align: center;
  letter-spacing: 0;
}

.auth-screen .brand-panel h1 {
  margin: 3px 0;
  font-size: clamp(2.3rem, 9vw, 3.35rem);
  line-height: 1;
}

.auth-screen .lead {
  max-width: 360px;
  margin: 0 auto 8px;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
}

.auth-screen .copyright-brand {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-screen .login-card {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 18px;
  border: 0;
  border-radius: 0;
  background: var(--sync-surface);
  box-shadow: none;
}

.auth-tab.active,
.primary-btn,
.send-btn {
  background: var(--sync-primary);
  color: #ffffff;
}

.secondary-btn:active,
.icon-btn:active,
.quick-action:active,
.tab:active,
.auth-tab:active,
.send-btn:active,
.primary-btn:active {
  transform: scale(0.98);
}

.chat-app.native-sync-shell {
  width: min(430px, 100%);
  height: min(860px, calc(100dvh - 24px));
  min-height: 0;
  display: block !important;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(216, 224, 234, 0.9);
  border-radius: 18px;
  background: var(--sync-bg);
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.14);
}

.chat-app.native-sync-shell.hidden {
  display: none !important;
}

.native-sync-shell .sidebar,
.native-sync-shell .conversation {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.native-sync-shell .sidebar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--sync-bg);
  transition: transform 180ms ease;
}

.native-sync-shell .conversation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--sync-surface);
  transform: translateX(100%);
  transition: transform 180ms ease;
}

.chat-app.native-sync-shell.conversation-open .sidebar {
  transform: translateX(-24%);
}

.chat-app.native-sync-shell.conversation-open .conversation {
  transform: translateX(0);
}

.native-sync-shell .profile-strip {
  min-height: 0;
  margin: calc(8px + var(--safe-top)) 12px 10px;
  padding: 10px 10px 10px 12px;
  gap: 9px;
  border: 1px solid #e0e9f2;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.native-sync-shell .profile-button {
  min-width: 0;
}

.native-sync-shell .avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
}

.native-sync-shell .profile-button strong,
.native-sync-shell .row-top strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-sync-shell .profile-strip .icon-btn,
.native-sync-shell .header-actions .icon-btn,
.native-sync-shell .composer .icon-btn,
.native-sync-shell .send-btn {
  background: #f3f4f6;
  color: var(--ink);
}

.native-sync-shell #friendBtn,
.native-sync-shell #settingsBtn,
.native-sync-shell #logoutBtn {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #f8fafc;
}

.native-sync-shell #friendBtn {
  border-color: rgba(0, 168, 132, 0.34);
  background: rgba(0, 168, 132, 0.1);
  color: var(--sync-primary);
}

.native-sync-shell #settingsBtn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.native-sync-shell #logoutBtn {
  border-color: #fecaca;
  background: #fef2f2;
  color: #e15759;
}

.native-sync-shell .search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 12px 10px;
  padding: 0 14px;
  border: 1px solid #d3e0ec;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
}

.native-sync-shell .search-box svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  stroke: var(--sync-primary);
}

.native-sync-shell .search-box input {
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.native-sync-shell .quick-actions {
  min-height: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 0 10px 10px;
}

.native-sync-shell .quick-actions.has-app-admin {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.native-sync-shell .quick-action {
  min-width: 0;
  min-height: 74px;
  padding: 8px 2px 7px;
  border: 1px solid #e2ebf4;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.1;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.06);
}

.native-sync-shell .quick-action svg {
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  margin-bottom: 2px;
  padding: 8px;
  border: 1px solid rgba(0, 168, 132, 0.28);
  border-radius: 999px;
  background: rgba(0, 168, 132, 0.1);
  stroke: var(--sync-primary);
}

.native-sync-shell .quick-action span {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.08;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-sync-shell .quick-action:focus-visible,
.native-sync-shell .quick-action:hover {
  border-color: color-mix(in srgb, var(--sync-primary) 45%, var(--line));
  background: color-mix(in srgb, var(--sync-primary) 9%, #ffffff);
}

.native-sync-shell .quick-action.active {
  border-color: color-mix(in srgb, var(--sync-primary) 55%, var(--line));
  color: var(--sync-primary);
  background: color-mix(in srgb, var(--sync-primary) 11%, #ffffff);
}

.native-sync-shell .app-admin-action {
  color: #047857;
  background: #ecfdf3;
}

.native-sync-shell .tab-bar {
  min-height: 0;
  gap: 5px;
  margin: 0 12px 10px;
  padding: 4px;
  border: 1px solid #dde7f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.native-sync-shell .tab {
  min-width: 0;
  min-height: 48px;
  padding: 0 5px;
  border-radius: 15px;
  background: #f3f4f6;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-sync-shell .tab.active {
  background: var(--sync-primary);
  color: #ffffff;
}

.native-sync-shell .panel-list {
  min-height: 0;
  overflow: auto;
  padding: 8px 12px calc(12px + var(--safe-bottom));
  background: var(--sync-bg);
}

.native-sync-shell .empty-state {
  justify-items: start;
  gap: 8px;
  margin: 8px 0 14px;
  padding: 24px 14px;
  border: 1px solid #e6eef6;
  border-radius: 16px;
  background: #ffffff;
  text-align: left;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.native-sync-shell .empty-state strong {
  font-size: 1.06rem;
  line-height: 1.25;
}

.native-sync-shell .empty-state span {
  font-size: 0.92rem;
  line-height: 1.45;
}

.native-sync-shell .native-refresh-btn {
  width: auto;
  min-height: 44px;
  margin: 0 0 8px 2px;
  padding: 0 14px;
  border: 1px solid #e0e9f2;
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.native-sync-shell .chat-row,
.native-sync-shell .person-row {
  min-height: 54px;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
}

.native-sync-shell .row-main p {
  font-size: 0.8rem;
  line-height: 1.25;
}

.native-sync-shell .conversation-header {
  min-height: 0;
  display: grid;
  grid-template-columns: auto 40px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  border-bottom: 1px solid rgba(216, 224, 234, 0.76);
  background: #ffffff;
}

.native-sync-shell .conversation-header h2 {
  max-width: 100%;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.native-sync-shell .conversation-header span {
  font-size: 0.68rem;
}

.native-sync-shell .header-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.native-sync-shell .header-actions .icon-btn {
  width: 100%;
  height: 36px;
  min-width: 0;
  border-radius: 10px;
}

.native-sync-shell .message-stage {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.75), #ffffff 32%),
    #ffffff;
}

.native-sync-shell .message {
  max-width: 88%;
  margin-bottom: 9px;
}

.native-sync-shell .bubble {
  padding: 9px 12px;
  border-radius: 13px;
  line-height: 1.42;
}

.native-sync-shell .message.me .bubble {
  background: var(--sync-primary);
  color: #ffffff;
}

.native-sync-shell .composer {
  position: relative;
  z-index: 8;
  min-height: 0;
  align-items: flex-end;
  gap: 7px;
  padding: 8px 10px calc(8px + var(--safe-bottom));
  border-top: 1px solid rgba(216, 224, 234, 0.86);
  background: rgba(255, 255, 255, 0.98);
}

.native-sync-shell .composer #messageInput {
  min-width: 0;
  min-height: 38px;
  max-height: 94px;
  border-radius: 10px;
}

.native-sync-shell .composer .icon-btn,
.native-sync-shell .composer .send-btn {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 10px;
}

.native-sync-shell .send-btn {
  background: var(--sync-primary);
  color: #ffffff;
}

.native-sync-shell .assistant-hub {
  border: 1px solid color-mix(in srgb, var(--sync-primary) 18%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sync-primary) 10%, #ffffff), #ffffff),
    var(--sync-surface);
}

.native-sync-shell .assistant-orb {
  background: radial-gradient(circle at 38% 32%, #ffffff, var(--sync-primary) 42%, var(--sync-secondary));
}

.theme-card {
  width: min(390px, calc(100vw - 24px));
  max-height: min(640px, calc(100dvh - 24px));
}

.theme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 14px 16px 4px;
  overflow: auto;
}

.theme-option {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.theme-option.active {
  border-color: var(--sync-primary);
  background: color-mix(in srgb, var(--sync-primary) 8%, #ffffff);
}

.theme-option strong,
.theme-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-option small {
  color: var(--muted);
  font-size: 0.76rem;
}

.theme-swatch {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

.referral-panel {
  margin: 0 16px 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--sync-primary) 20%, var(--line));
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sync-primary) 9%, #ffffff), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.referral-panel .eyebrow {
  margin: 0 0 4px;
  color: var(--sync-primary);
}

.referral-panel strong {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
}

.referral-panel span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.referral-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.call-history-card {
  width: min(460px, calc(100vw - 24px));
  max-height: min(700px, calc(100dvh - 24px));
}

.call-history-note {
  margin: 0 16px 10px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--sync-primary) 20%, var(--line));
  border-radius: 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--sync-primary) 6%, #ffffff);
  font-size: 0.86rem;
  line-height: 1.35;
}

.call-history-list {
  display: grid;
  gap: 8px;
  max-height: min(470px, 56dvh);
  overflow: auto;
  padding: 0 16px 12px;
}

.call-history-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
}

.call-history-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #ffffff;
  background: var(--sync-primary);
  font-weight: 900;
}

.call-history-icon.missed,
.call-history-icon.rejected {
  background: #ef4444;
}

.call-history-icon.busy {
  background: #f59e0b;
}

.call-history-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.call-history-main strong,
.call-history-main span,
.call-history-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-history-main span,
.call-history-main small,
.call-history-row em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.call-history-row em {
  font-weight: 800;
}

.call-history-actions {
  padding: 0 16px 16px;
}

.call-history-actions .secondary-btn {
  width: 100%;
}

@media (max-width: 560px) {
  .app-shell {
    padding: 0;
  }

  .auth-screen,
  .chat-app.native-sync-shell {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-screen {
    grid-template-rows: minmax(220px, 30%) minmax(0, 1fr);
  }

  .auth-screen .brand-panel {
    padding: calc(10px + var(--safe-top)) 16px 8px;
  }

  .auth-screen .signal-card {
    width: 112px;
    height: 112px;
  }

  .auth-screen .brand-panel h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .auth-screen .lead {
    font-size: 0.82rem;
  }

  .auth-screen .login-card {
    padding: 14px 16px calc(18px + var(--safe-bottom));
  }

  .call-history-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .call-history-list {
    max-height: none;
  }
}

/* Desktop web: giữ chức năng/visual giống mobile nhưng dùng đúng không gian máy tính. */
@media (min-width: 861px) {
  body {
    overflow: hidden;
    background:
      radial-gradient(circle at 10% 12%, color-mix(in srgb, var(--sync-primary) 13%, transparent), transparent 28rem),
      radial-gradient(circle at 86% 16%, color-mix(in srgb, var(--sync-secondary) 12%, transparent), transparent 26rem),
      linear-gradient(180deg, #ffffff, var(--sync-bg));
  }

  .app-shell {
    place-items: stretch;
    padding: 20px;
  }

  .auth-screen {
    width: min(1180px, calc(100vw - 40px));
    height: min(760px, calc(100dvh - 40px));
    min-height: 620px;
    margin: auto;
    grid-template-columns: minmax(0, 1fr) minmax(390px, 450px);
    grid-template-rows: 1fr;
    border-radius: 18px;
  }

  .auth-screen .brand-panel {
    min-height: 0;
    justify-content: center;
    padding: clamp(28px, 3vw, 44px);
    border-right: 1px solid rgba(216, 224, 234, 0.84);
    border-bottom: 0;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)),
      radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--sync-primary) 18%, transparent), transparent 20rem);
  }

  .auth-screen .signal-card {
    width: min(300px, 26vw);
    height: min(300px, 26vw);
    margin-bottom: 16px;
  }

  .auth-screen .floating-panel {
    display: block;
  }

  .auth-screen .trust-row {
    display: flex;
    max-width: 640px;
    justify-content: center;
  }

  .auth-screen .digital-metrics {
    display: grid;
    max-width: 520px;
  }

  .auth-screen .lead {
    max-width: 620px;
    font-size: 1rem;
  }

  .auth-screen .copyright-brand {
    margin-top: 14px;
  }

  .auth-screen .login-card {
    padding: clamp(24px, 2.5vw, 34px);
    border-left: 0;
    overflow: auto;
  }

  .chat-app.native-sync-shell {
    width: min(1240px, calc(100vw - 40px));
    height: min(820px, calc(100dvh - 40px));
    min-height: 640px;
    margin: auto;
    display: grid !important;
    grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
    border-radius: 18px;
  }

  .native-sync-shell .sidebar {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    transform: none !important;
    grid-template-rows: 70px 54px 70px 56px minmax(0, 1fr);
    border-right: 1px solid rgba(216, 224, 234, 0.86);
  }

  .native-sync-shell .conversation {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    transform: none !important;
    border-left: 0;
  }

  .chat-app.native-sync-shell.conversation-open .sidebar,
  .chat-app.native-sync-shell.conversation-open .conversation {
    transform: none !important;
  }

  .native-sync-shell .profile-strip {
    padding: 12px 14px;
  }

  .native-sync-shell .search-box {
    height: 42px;
    margin: 5px 14px;
  }

  .native-sync-shell .quick-actions {
    gap: 7px;
    padding: 0 14px 8px;
  }

  .native-sync-shell .quick-action {
    min-height: 52px;
    font-size: 0.66rem;
  }

  .native-sync-shell .tab-bar {
    min-height: 0;
    gap: 7px;
    padding: 0 14px 9px;
  }

  .native-sync-shell .tab {
    min-height: 42px;
    font-size: 0.74rem;
  }

  .native-sync-shell .panel-list {
    padding: 8px 10px 12px;
  }

  .native-sync-shell .chat-row,
  .native-sync-shell .person-row {
    min-height: 62px;
    padding: 9px 10px;
  }

  .native-sync-shell .conversation-header {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: 78px;
    padding: 14px 16px;
  }

  .native-sync-shell .back-btn {
    display: none;
  }

  .native-sync-shell .conversation-header .avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .native-sync-shell .conversation-header h2 {
    font-size: 1.08rem;
  }

  .native-sync-shell .conversation-header span {
    font-size: 0.76rem;
  }

  .native-sync-shell .header-actions {
    grid-column: auto;
    display: flex;
    gap: 8px;
  }

  .native-sync-shell .header-actions .icon-btn {
    width: 42px;
    height: 42px;
  }

  .native-sync-shell .message-stage {
    padding: 18px 20px;
  }

  .native-sync-shell .message {
    max-width: min(650px, 78%);
  }

  .native-sync-shell .bubble {
    padding: 10px 14px;
  }

  .native-sync-shell .composer {
    padding: 12px 14px;
  }

  .native-sync-shell .composer #messageInput {
    min-height: 42px;
  }

  .native-sync-shell .composer .icon-btn,
  .native-sync-shell .composer .send-btn {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .theme-card {
    width: min(520px, calc(100vw - 48px));
  }

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

/* Web desktop refinement: app chiếm màn hình, đăng nhập gọn chữ hơn. */
.clear-chat-btn svg {
  stroke: #dc2626;
}

@media (max-width: 860px) {
  .native-sync-shell .header-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 861px) {
  .app-shell {
    padding: 10px;
  }

  .auth-screen {
    width: min(1040px, calc(100vw - 20px));
    height: min(640px, calc(100dvh - 20px));
    min-height: 0;
  }

  .auth-screen .brand-panel {
    justify-content: flex-start;
    padding: 38px 34px 22px;
  }

  .auth-screen .signal-card {
    width: min(206px, 18vw);
    height: min(206px, 18vw);
    margin: 0 0 10px;
  }

  .auth-screen .floating-panel,
  .auth-screen .trust-row,
  .auth-screen .digital-metrics {
    display: none;
  }

  .auth-screen .brand-panel h1 {
    margin: 3px 0 6px;
    font-size: clamp(2rem, 3.4vw, 2.65rem);
  }

  .auth-screen .lead {
    max-width: 500px;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  .auth-screen .eyebrow {
    font-size: 0.68rem;
  }

  .auth-screen .copyright-brand {
    margin-top: auto;
    margin-bottom: 2px;
    gap: 9px;
    font-size: 0.68rem;
  }

  .auth-screen .copyright-brand img {
    width: 62px;
    height: 32px;
  }

  .auth-screen .login-card {
    padding: 24px 28px;
  }

  .auth-screen .login-card h2 {
    font-size: 1.55rem;
    line-height: 1.1;
  }

  .auth-screen .login-card label span {
    font-size: 0.78rem;
  }

  .auth-screen .login-card input,
  .auth-screen .primary-btn,
  .auth-screen .secondary-btn,
  .auth-screen .auth-tab {
    min-height: 42px;
    font-size: 0.86rem;
  }

  .auth-screen .fine-print,
  .auth-screen .auth-status {
    font-size: 0.74rem;
    line-height: 1.35;
  }

  .chat-app.native-sync-shell {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
    min-height: 0;
    border-radius: 14px;
    grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
  }

  .native-sync-shell .sidebar {
    grid-template-rows: 70px 54px 70px 56px minmax(0, 1fr);
  }

  .native-sync-shell .conversation-header {
    min-height: 72px;
  }

  .native-sync-shell .message-stage {
    padding: 16px 18px;
  }
}

/* Minh Khuê Chat visual refresh - login and product shell. */
:root {
  --xpay-primary: #008f7a;
  --xpay-primary-dark: #05605a;
  --xpay-blue: #1d4ed8;
  --xpay-ink: #10202f;
  --xpay-soft: #f5faf8;
  --xpay-warm: #fff7ed;
}

body {
  background:
    linear-gradient(115deg, rgba(0, 143, 122, 0.09), transparent 34%),
    linear-gradient(245deg, rgba(29, 78, 216, 0.08), transparent 30%),
    linear-gradient(180deg, #f9fbfd 0%, #eef7f4 52%, #fff8f2 100%);
}

body::before {
  opacity: 0 !important;
}

.auth-screen {
  border: 1px solid rgba(196, 207, 219, 0.9);
  background: #ffffff;
  box-shadow: 0 24px 72px rgba(16, 32, 47, 0.14);
}

.auth-screen .brand-panel {
  align-items: flex-start;
  justify-content: space-between;
  color: var(--xpay-ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(243, 251, 248, 0.94)),
    linear-gradient(120deg, rgba(0, 143, 122, 0.13), transparent 38%),
    linear-gradient(90deg, rgba(16, 32, 47, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 32, 47, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px, 46px 46px;
}

.auth-screen .brand-panel::after {
  display: none;
}

.brand-mark {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0, 143, 122, 0.2);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 28px rgba(16, 32, 47, 0.08);
}

.brand-mark span {
  color: var(--xpay-primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-screen .xpay-hero-logo {
  width: 118px;
  margin: 0;
}

.auth-screen .brand-panel .eyebrow,
.auth-screen .login-card .eyebrow {
  margin: 22px 0 10px;
  color: var(--xpay-primary-dark);
  letter-spacing: 0;
  text-align: left;
}

.auth-screen .brand-panel h1 {
  max-width: 620px;
  margin: 0 0 12px;
  color: var(--xpay-ink);
  font-size: clamp(2.6rem, 5.4vw, 4.75rem);
  line-height: 0.98;
  text-align: left;
}

.auth-screen .lead {
  max-width: 620px;
  margin: 0;
  color: #425466;
  font-size: clamp(0.98rem, 1.3vw, 1.1rem);
  line-height: 1.58;
  text-align: left;
}

.login-feature-grid {
  width: min(660px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.login-feature-grid div {
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(16, 32, 47, 0.09);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(16, 32, 47, 0.07);
}

.login-feature-grid span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0, 143, 122, 0.1);
  color: var(--xpay-primary-dark);
  font-size: 0.68rem;
  font-weight: 900;
}

.login-feature-grid strong {
  color: var(--xpay-ink);
  font-size: 0.94rem;
}

.login-feature-grid small {
  color: #5c6f82;
  font-size: 0.78rem;
  line-height: 1.35;
}

.auth-screen .trust-row {
  justify-content: flex-start;
  margin-top: 22px;
}

.auth-screen .trust-row span {
  border-color: rgba(0, 143, 122, 0.16);
  background: rgba(239, 253, 246, 0.86);
  color: #16685d;
}

.auth-screen .digital-metrics {
  width: min(520px, 100%);
  margin: 16px 0 0;
}

.auth-screen .digital-metrics div {
  background: rgba(255, 255, 255, 0.78);
}

.auth-screen .digital-metrics strong {
  color: var(--xpay-primary-dark);
}

.auth-screen .copyright-brand {
  margin-top: auto;
  color: #536476;
  text-align: left;
}

.auth-screen .copyright-brand img {
  width: 74px;
  height: 38px;
}

.auth-screen .login-card {
  justify-content: center;
  padding: clamp(28px, 3.2vw, 44px);
  border-left: 1px solid rgba(196, 207, 219, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 252, 0.96)),
    linear-gradient(0deg, rgba(0, 143, 122, 0.06), transparent 34%);
}

.auth-screen .login-card::before,
.auth-screen .login-card::after {
  display: none;
}

.auth-screen .login-card h2 {
  color: var(--xpay-ink);
  font-size: clamp(1.75rem, 2.8vw, 2.2rem);
}

.auth-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 8px;
  background: #eef4f6;
}

.auth-tab.active,
.auth-screen .primary-btn,
.native-sync-shell .tab.active,
.native-sync-shell .send-btn,
.native-sync-shell .message.me .bubble {
  background: linear-gradient(135deg, var(--xpay-primary), var(--xpay-primary-dark));
  color: #ffffff;
}

.auth-screen .primary-btn {
  border-radius: 8px;
  box-shadow: 0 14px 26px rgba(0, 143, 122, 0.22);
}

.auth-status {
  border: 1px solid rgba(0, 143, 122, 0.16);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(239, 253, 246, 0.78);
  color: #315f58;
}

.fine-print a {
  color: var(--xpay-primary-dark);
}

.chat-app.native-sync-shell {
  border: 1px solid rgba(196, 207, 219, 0.9);
  background: #f3f7fa;
  box-shadow: 0 24px 72px rgba(16, 32, 47, 0.14);
}

.native-sync-shell .sidebar {
  background:
    linear-gradient(180deg, #ffffff, #f5faf8),
    linear-gradient(90deg, rgba(16, 32, 47, 0.035) 1px, transparent 1px);
  background-size: auto, 38px 38px;
}

.native-sync-shell .profile-strip {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #10202f, var(--xpay-primary-dark));
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(16, 32, 47, 0.18);
}

.native-sync-shell .profile-strip span {
  color: rgba(255, 255, 255, 0.76);
}

.native-sync-shell .avatar,
.native-sync-shell .avatar-me {
  border-radius: 12px;
  background: linear-gradient(135deg, #0ea5a5, var(--xpay-blue));
  box-shadow: 0 12px 24px rgba(0, 143, 122, 0.2);
}

.native-sync-shell #friendBtn,
.native-sync-shell #settingsBtn,
.native-sync-shell #logoutBtn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.native-sync-shell .search-box,
.native-sync-shell .tab-bar {
  border-color: rgba(196, 207, 219, 0.86);
  border-radius: 8px;
  box-shadow: none;
}

.native-sync-shell .search-box svg {
  stroke: var(--xpay-primary-dark);
}

.native-sync-shell .quick-action {
  border-color: rgba(196, 207, 219, 0.78);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16, 32, 47, 0.06);
}

.native-sync-shell .quick-action svg {
  border-color: rgba(0, 143, 122, 0.18);
  background: rgba(0, 143, 122, 0.08);
  stroke: var(--xpay-primary-dark);
}

.native-sync-shell .quick-action span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--xpay-ink);
  font-size: 0.64rem;
  line-height: 1.08;
  text-align: center;
  text-overflow: clip;
  white-space: normal;
}

.native-sync-shell .quick-action:hover,
.native-sync-shell .quick-action.active {
  border-color: rgba(0, 143, 122, 0.34);
  background: #f0fdfa;
}

.native-sync-shell .tab {
  border-radius: 8px;
  background: #eef4f6;
}

.native-sync-shell .panel-list {
  background: transparent;
}

.native-sync-shell .chat-row-shell,
.native-sync-shell .chat-row,
.native-sync-shell .person-row,
.native-sync-shell .empty-state {
  border-radius: 8px;
}

.native-sync-shell .chat-row,
.native-sync-shell .person-row {
  background: rgba(255, 255, 255, 0.68);
}

.native-sync-shell .chat-row:hover,
.native-sync-shell .person-row:hover,
.native-sync-shell .chat-row.active {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 32, 47, 0.08);
}

.native-sync-shell .chat-row.active {
  box-shadow:
    inset 4px 0 0 var(--xpay-primary),
    0 10px 24px rgba(16, 32, 47, 0.08);
}

.native-sync-shell .conversation {
  background: #ffffff;
}

.native-sync-shell .conversation-header {
  border-bottom-color: rgba(196, 207, 219, 0.78);
  background: rgba(255, 255, 255, 0.96);
}

.native-sync-shell .conversation-header h2 {
  color: var(--xpay-ink);
}

.native-sync-shell .e2ee-status {
  background: rgba(0, 143, 122, 0.09);
  color: var(--xpay-primary-dark) !important;
}

.native-sync-shell .header-actions .icon-btn,
.native-sync-shell .composer .icon-btn {
  border: 1px solid rgba(196, 207, 219, 0.82);
  background: #f6f9fb;
  color: #344054;
}

.native-sync-shell .header-actions .icon-btn:hover,
.native-sync-shell .composer .icon-btn:hover {
  background: #eefaf6;
  color: var(--xpay-primary-dark);
}

.clear-chat-btn svg {
  stroke: #dc2626;
}

.native-sync-shell .message-stage {
  background:
    linear-gradient(180deg, rgba(246, 250, 248, 0.9), rgba(255, 255, 255, 0.94)),
    linear-gradient(90deg, rgba(16, 32, 47, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(16, 32, 47, 0.03) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
}

.native-sync-shell .bubble {
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(16, 32, 47, 0.08);
}

.native-sync-shell .message.them .bubble {
  border: 1px solid rgba(196, 207, 219, 0.74);
  background: #ffffff;
}

.native-sync-shell .composer {
  border-top-color: rgba(196, 207, 219, 0.82);
  background: rgba(255, 255, 255, 0.98);
}

.native-sync-shell .composer #messageInput {
  border-color: rgba(196, 207, 219, 0.9);
  border-radius: 8px;
  background: #ffffff;
}

.native-sync-shell .send-btn {
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 143, 122, 0.2);
}

.sidebar-copyright {
  color: #64748b;
}

@media (min-width: 861px) {
  .auth-screen {
    width: min(1120px, calc(100vw - 28px));
    height: min(700px, calc(100dvh - 28px));
    grid-template-columns: minmax(0, 1fr) minmax(390px, 450px);
  }

  .auth-screen .brand-panel {
    padding: clamp(30px, 3.4vw, 48px);
  }

  .auth-screen .trust-row {
    display: flex;
  }

  .auth-screen .digital-metrics {
    display: grid;
  }

  .chat-app.native-sync-shell {
    width: calc(100vw - 28px);
    height: calc(100dvh - 28px);
    grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .auth-screen {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .auth-screen .brand-panel {
    gap: 8px;
    padding: calc(14px + var(--safe-top)) 18px 14px;
  }

  .brand-mark {
    padding: 7px 10px;
  }

  .auth-screen .xpay-hero-logo {
    width: 94px;
  }

  .brand-mark span {
    font-size: 0.7rem;
  }

  .auth-screen .brand-panel .eyebrow {
    margin-top: 8px;
    font-size: 0.66rem;
  }

  .auth-screen .brand-panel h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .auth-screen .lead {
    max-width: none;
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .login-feature-grid,
  .auth-screen .trust-row,
  .auth-screen .digital-metrics,
  .auth-screen .copyright-brand {
    display: none;
  }

  .auth-screen .login-card {
    justify-content: flex-start;
    padding: 18px 18px calc(20px + var(--safe-bottom));
    border-left: 0;
  }

  .auth-screen .login-card .eyebrow {
    margin-top: 0;
  }

  .native-sync-shell .profile-strip {
    margin: calc(8px + var(--safe-top)) 10px 10px;
  }

  .native-sync-shell .quick-action {
    min-height: 68px;
  }
}
