:root {
  color-scheme: light;
  --brand: #9068f0;
  --brand-strong: #7c55e0;
  --brand-soft: #f4f0ff;
  --brand-border: #d8ccff;
  --text: #1f2937;
  --ink: #1f2937;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d8ccff;
  --page: #f8f7fc;
  --panel: #ffffff;
  --soft: #f4f0ff;
  --soft-2: #f9fafb;
  --accent: #9068f0;
  --accent-strong: #7c55e0;
  --accent-dark: #6f48d9;
  --customer: #f3f4f6;
  --success: #147a61;
  --danger: #a33f55;
  --warn: #805313;
  --warn-bg: #fff8df;
  --shadow: 0 1px 4px rgba(124, 58, 237, 0.06);
  --shadow-strong: 0 14px 36px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

button,
summary,
label[for] {
  cursor: pointer;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--brand-strong);
  background: #fff;
  font-weight: 700;
}

button:hover {
  border-color: var(--brand);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-size: 16px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(144, 104, 240, 0.12);
}

textarea {
  resize: vertical;
  line-height: 1.58;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

p {
  color: var(--muted);
  line-height: 1.58;
}

.chat-app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 28px));
  height: 100vh;
  min-height: 720px;
  margin: 0 auto;
  padding: 14px 0 16px;
  gap: 14px;
}

.topbar,
.chat-shell,
.user-center,
.pending-area,
.confirm-panel,
.payment-panel,
.composer {
  border: 1px solid rgba(144, 104, 240, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-color: #ede9fe;
  padding: 14px 18px;
}

.brand-lockup,
.topbar-usage {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.brand-lockup strong {
  overflow: hidden;
  color: var(--brand);
  font-size: 20px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-usage {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.topbar-login {
  min-height: 34px;
  padding: 6px 10px;
  white-space: nowrap;
}

.topbar-usage span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(144, 104, 240, 0.14);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--brand-strong);
  background: rgba(144, 104, 240, 0.07);
  font-weight: 760;
}

.topbar-usage .usage-meter {
  overflow: hidden;
  width: min(156px, 28vw);
  min-width: 96px;
  padding: 0;
  background: rgba(144, 104, 240, 0.11);
}

.topbar-usage .usage-meter i {
  display: block;
  height: 100%;
  min-height: 24px;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

#myCustomersBtn,
#ordersSettingsBtn,
#paymentBackBtn,
#ordersSettingsBackBtn,
.upgrade-entry,
.account-primary-action,
#refreshOrdersBtn {
  min-height: 38px;
  padding: 8px 12px;
}

.account-primary-action,
.upgrade-entry {
  border-color: rgba(124, 58, 237, 0.2);
  color: #fff;
  background: var(--brand);
  white-space: nowrap;
}

.upgrade-inline {
  width: 100%;
  min-height: 36px;
  margin: 2px 0 10px;
  color: var(--brand);
  background: #f5f3ff;
  border-color: rgba(124, 58, 237, 0.18);
}

.home-install-guide {
  position: fixed;
  inset: auto 16px calc(88px + env(safe-area-inset-bottom)) auto;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  color: var(--ink);
}

.home-install-toast,
.home-install-panel {
  border: 1px solid rgba(144, 104, 240, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(31, 41, 55, 0.16);
}

.home-install-toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.home-install-toast strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.home-install-toast p,
.home-install-panel p,
.home-install-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.home-install-link,
.home-install-close {
  min-height: 34px;
  padding: 6px 10px;
}

.home-install-close {
  width: 34px;
  border-radius: 999px;
  padding: 0;
  color: var(--muted);
}

.home-install-guide.is-open {
  inset: 0;
  display: grid;
  width: auto;
  place-items: end center;
  padding: 16px 16px calc(22px + env(safe-area-inset-bottom));
}

.home-install-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.28);
}

.home-install-panel {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  padding: 18px;
}

.home-install-panel h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.home-install-primary {
  width: 100%;
  margin-top: 14px;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.install-steps {
  display: grid;
  gap: 10px;
  margin: 14px 0 2px;
}

.install-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid #ede9fe;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fbfaff;
}

.install-steps b {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 13px;
}

.install-steps span {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}

.ios-install-panel {
  padding-bottom: 46px;
}

.ios-share-pointer {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 2px;
  height: 28px;
  background: var(--brand);
  animation: installArrowFloat 1.1s ease-in-out infinite;
}

.ios-share-pointer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: translateX(-50%) rotate(45deg);
}

@keyframes installArrowFloat {
  0%,
  100% {
    transform: translate(-50%, -4px);
  }
  50% {
    transform: translate(-50%, 3px);
  }
}

.usage-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.usage-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.usage-list dt {
  color: var(--muted);
  font-size: 12px;
}

.usage-list dd {
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
}

.identity-state-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.identity-state {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--soft-2);
  font-size: 12px;
}

.identity-state strong {
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.identity-state small {
  color: var(--muted);
}

.account-overview,
.account-usage-line {
  display: grid;
  gap: 12px;
}

.account-usage-rule,
.usage-notice {
  color: var(--muted);
  font-size: 12px;
}

.account-usage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.account-usage-summary span,
.mini-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(144, 104, 240, 0.14);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--brand-strong);
  background: rgba(144, 104, 240, 0.07);
  font-size: 12px;
  font-weight: 740;
}

.mini-note {
  justify-self: start;
  color: var(--warn);
  background: var(--warn-bg);
}

.account-actions {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 8px;
}

.account-actions button {
  min-width: 0;
  white-space: nowrap;
}

.identity-login {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 10px;
  padding: 10px;
  background: #fff;
}

.identity-login label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.identity-login input {
  width: 100%;
  min-width: 0;
}

.identity-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: center;
}

.identity-login-row button,
#identityLogoutBtn {
  min-height: 36px;
  padding: 7px 9px;
  white-space: nowrap;
}

#identityLogoutBtn {
  align-self: stretch;
  min-width: 64px;
  border-color: rgba(144, 104, 240, 0.26);
  color: var(--brand-strong);
  background: #fff;
}

.menu-controls,
.settings-grid {
  display: grid;
  gap: 12px;
}

.menu-controls label,
.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
}

#resetCommercialBtn,
#resetBtn {
  color: var(--danger);
}

.menu-settings {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 10px;
}

.menu-settings summary {
  list-style: none;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 800;
}

.menu-settings summary::-webkit-details-marker {
  display: none;
}

.menu-settings .settings-grid {
  margin-top: 10px;
}

.secondary-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.app-view {
  min-width: 0;
  min-height: 0;
}

.app-view[hidden] {
  display: none !important;
}

.user-center {
  min-height: 0;
  overflow: hidden;
}

.user-center-scroll {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.user-center-card {
  display: grid;
  align-self: start;
  gap: 12px;
  border: 1px solid rgba(144, 104, 240, 0.16);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  box-shadow: none;
}

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

.section-head h2 {
  color: var(--ink);
  font-size: 18px;
}

.section-kicker {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.bottom-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(144, 104, 240, 0.16);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.bottom-nav button {
  min-height: 42px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.bottom-nav button.is-active {
  color: var(--brand-strong);
  background: rgba(144, 104, 240, 0.1);
}

.order-list {
  display: grid;
  gap: 8px;
}

.order-list p {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft-2);
  font-size: 13px;
}

.order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft-2);
}

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

.order-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card span,
.order-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.order-card em {
  flex: 0 0 auto;
  color: var(--success);
  font-weight: 760;
}

.orders-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content));
  gap: 8px;
  justify-content: start;
}

.orders-actions button {
  min-width: 0;
  white-space: nowrap;
}

.customer-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.manual-copy-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.drawer-backdrop,
.manual-copy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 41, 55, 0.28);
}

.drawer-panel,
.manual-copy-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  gap: 12px;
  width: min(390px, 100vw);
  height: 100%;
  padding: 18px;
  background: var(--panel);
  box-shadow: -16px 0 36px rgba(31, 41, 55, 0.14);
}

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

.manual-copy-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.drawer-head,
.manual-copy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-kicker {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 820;
}

.drawer-head h2 {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.28;
}

#closeCustomerDrawerBtn,
#closeManualCopyBtn {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--muted);
  background: var(--soft-2);
  font-size: 22px;
  line-height: 1;
}

.manual-copy-tip {
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 10px;
  color: var(--accent-dark);
  background: var(--brand-soft);
  font-size: 13px;
  line-height: 1.65;
}

#manualCopyText {
  min-height: 0;
  resize: none;
  overflow: auto;
  -webkit-user-select: text;
  user-select: text;
  line-height: 1.72;
}

.manual-copy-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.manual-copy-actions #selectManualCopyBtn {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
}

.drawer-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--soft-2);
  font-size: 13px;
  line-height: 1.5;
}

.drawer-status strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 14px;
}

.customer-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
}

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

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

.customer-card-head strong {
  color: var(--ink);
  font-size: 15px;
}

.customer-card-head span {
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.customer-card p {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.customer-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.customer-card small {
  color: var(--muted);
  font-size: 12px;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
}

.conversation-stream {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 12px;
  scroll-behavior: smooth;
}

.deal-session-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 9px 24px;
  background: #fff;
}

.session-select-wrap {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.session-select-wrap select {
  min-width: 0;
  max-width: 280px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
}

.deal-session-bar button {
  min-height: 34px;
  padding: 6px 10px;
  border-color: var(--line);
  color: var(--ink-soft);
  background: #fff;
  font-size: 13px;
}

#saveDealMemoryBtn {
  border-color: var(--brand-border);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.empty-state {
  width: min(720px, 100%);
  margin: 0 auto 10px;
  text-align: center;
}

.empty-kicker {
  margin-bottom: 6px;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.empty-state h1 {
  margin-bottom: 8px;
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.dialogue-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 12px 0;
}

.assistant-row,
.customer-row {
  justify-content: flex-start;
}

.user-row {
  justify-content: flex-end;
}

.avatar {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink-soft);
  background: #fff;
  font-size: 12px;
  font-weight: 820;
}

.assistant-avatar {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
}

.me-avatar,
.identity-chip {
  border-color: var(--brand-border);
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.identity-toggle:hover,
.identity-chip:hover {
  transform: translateY(-1px);
}

.dialogue-body {
  display: grid;
  width: fit-content;
  max-width: min(74%, 640px);
  gap: 7px;
}

.wide-dialogue {
  width: min(86%, 820px);
  max-width: min(86%, 820px);
}

.align-right {
  justify-items: end;
}

.identity-chip {
  width: auto;
  min-height: 28px;
  border: 0;
  padding: 4px 9px;
  font-size: 12px;
}

.dialogue-bubble {
  width: fit-content;
  max-width: 100%;
  height: auto;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.58;
}

.assistant-bubble {
  border: 1px solid var(--line);
  background: #fff;
}

.starter-bubble {
  text-indent: 0;
  white-space: normal;
}

.customer-bubble {
  border-color: #eaecf0;
  background: var(--customer);
}

.me-bubble {
  border-color: var(--brand-border);
  color: var(--ink);
  background: #fff;
}

.sent-turn-bubble {
  display: grid;
  gap: 10px;
  width: fit-content;
  max-width: min(520px, 100%);
  border-color: var(--brand-border);
  background: #fff;
}

.sent-turn-bubble p {
  color: var(--ink);
}

.sent-attachments {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sent-attachment {
  width: min(280px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.sent-screenshot {
  display: grid;
  gap: 0;
  min-height: 0;
  padding: 0;
  color: var(--ink-soft);
  text-align: left;
}

.sent-screenshot img {
  display: block;
  width: 100%;
  max-height: 220px;
  aspect-ratio: 4 / 3;
  background: var(--soft-2);
  object-fit: cover;
}

.sent-screenshot span,
.sent-document {
  color: var(--ink-soft);
  font-size: 12px;
}

.sent-screenshot span {
  overflow: hidden;
  padding: 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sent-document {
  display: grid;
  gap: 4px;
  width: min(240px, 100%);
  padding: 9px;
  text-align: left;
}

.sent-document span {
  opacity: 0.82;
}

.sent-screenshot:hover {
  border-color: var(--brand-border);
  box-shadow: 0 0 0 3px rgba(144, 104, 240, 0.12);
}

.editable-bubble:hover {
  box-shadow: 0 0 0 2px rgba(144, 104, 240, 0.16);
}

.dialogue-row.is-active .editable-bubble,
.recognized-message.is-active .editable-bubble {
  box-shadow: 0 0 0 2px rgba(144, 104, 240, 0.2);
}

.bubble-editor {
  display: grid;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(52, 38, 88, 0.08);
}

.bubble-editor textarea {
  max-width: 100%;
  min-height: 40px;
  max-height: 180px;
  resize: none;
  overflow: auto;
  border-color: transparent;
  padding: 8px 9px;
  background: var(--soft-2);
  line-height: 1.48;
}

.bubble-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.bubble-actions button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.bubble-actions .bubble-confirm {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 12px rgba(144, 104, 240, 0.18);
}

.bubble-actions [data-remove-bubble] {
  border-color: transparent;
  color: var(--danger);
  background: transparent;
}

.bubble-actions [data-cancel-edit] {
  color: var(--muted);
  background: var(--soft-2);
}

.recognition-action-card {
  display: grid;
  gap: 8px;
}

.recognition-action-card strong {
  color: var(--accent-dark);
}

.recognition-action-card p {
  font-size: 13px;
}

.recognition-action-card [data-analyze] {
  justify-self: start;
  margin-top: 2px;
}

.recognition-review-card {
  display: grid;
  gap: 10px;
}

.recognition-review-head {
  display: grid;
  gap: 3px;
}

.recognition-review-head strong,
.recognition-review-footer strong {
  color: var(--accent-dark);
}

.recognition-review-head span,
.recognition-review-footer p {
  color: var(--muted);
  font-size: 13px;
}

.recognized-message-list {
  display: grid;
  gap: 8px;
}

.recognized-message {
  display: flex;
  align-items: start;
  gap: 8px;
}

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

.recognized-message.is-me .identity-chip {
  order: 2;
}

.recognized-message.is-me .recognized-message-content {
  align-items: flex-end;
}

.recognized-message-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  max-width: 72%;
}

.recognized-message .editable-bubble {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: left;
  line-height: 1.55;
  font-size: 15px;
  font-weight: 500;
}

.recognition-review-footer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.recognition-review-footer [data-analyze] {
  justify-self: start;
}

.media-boundary-guide {
  display: grid;
  gap: 8px;
  border: 1px solid #f0d9a7;
  border-radius: 12px;
  padding: 12px;
  background: #fffaf0;
}

.media-boundary-guide strong {
  color: #7a4b00;
}

.media-boundary-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.media-boundary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.media-boundary-actions button {
  min-height: 34px;
  border: 1px solid #e3c680;
  border-radius: 999px;
  padding: 6px 11px;
  background: #fff;
  color: #604000;
  font: inherit;
  cursor: pointer;
}

.followup-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: #fff;
}

.followup-head {
  display: grid;
  gap: 3px;
}

.followup-head strong {
  color: var(--accent-dark);
}

.followup-head span,
.followup-list {
  color: var(--muted);
  font-size: 13px;
}

.followup-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.followup-answer {
  min-height: 82px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--soft-2);
  line-height: 1.55;
}

.followup-actions,
.session-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.followup-actions button:first-child,
.session-history-actions button {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}

.history-script {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.history-script pre {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--soft-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.history-script button {
  justify-self: start;
}

.pending-area {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.input-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--brand-strong);
  background: var(--soft);
  font-size: 12px;
}

.screenshot-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.screenshot-item,
.document-item {
  position: relative;
  flex: 0 0 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.screenshot-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
}

.file-name,
.screenshot-item span {
  display: block;
  overflow: hidden;
  padding: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding: 6px 7px;
}

.file-actions small,
.document-item small {
  color: var(--success);
  font-size: 11px;
  font-weight: 760;
}

.file-actions button,
.document-item button {
  display: grid;
  width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--danger);
  background: var(--soft-2);
  font-size: 16px;
  line-height: 1;
}

.document-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

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

.document-item span,
.document-item small {
  display: block;
}

.document-item span {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-item small {
  margin-top: 4px;
}

.confirm-panel,
.composer {
  margin: 0 16px 12px;
  padding: 13px;
  box-shadow: none;
}

.confirm-panel {
  border-color: #ecd18a;
  color: var(--warn);
  background: linear-gradient(180deg, #fff9e7, var(--warn-bg));
}

.confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.confirm-head button {
  min-height: 34px;
  color: var(--warn);
}

.confirm-panel p {
  margin-top: 8px;
  color: var(--warn);
  font-size: 13px;
}

.confirm-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  margin: 10px 0 12px;
  color: var(--warn);
  font-size: 13px;
  line-height: 1.46;
}

.confirm-check input {
  width: auto;
  margin-top: 2px;
}

#authorizeCustomerDataBtn,
[data-analyze],
[data-copy-script],
#saveCustomerBtn,
.send-button {
  border-color: transparent;
  color: #fff;
  background: var(--brand);
}

.payment-panel {
  display: grid;
  gap: 12px;
  margin: 0 16px 12px;
  padding: 13px;
  box-shadow: none;
}

.user-center .payment-panel {
  margin: 0;
  max-height: none;
  overflow: visible;
}

.payment-panel p {
  font-size: 13px;
}

.payment-products {
  display: grid;
  gap: 10px;
}

.payment-period-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: var(--soft-2);
}

.payment-period-tabs button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
}

.payment-period-tabs button.is-active {
  color: #fff;
  background: var(--brand);
}

.payment-product-section {
  display: grid;
  gap: 8px;
}

.payment-experience-section {
  border: 1px solid rgba(144, 104, 240, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.payment-subscription-section {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.payment-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
}

.payment-section-head span {
  color: var(--muted);
  font-size: 12px;
}

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

.payment-experience-grid {
  grid-template-columns: minmax(0, 1fr);
}

.payment-agreement {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--soft-2);
}

.payment-rules-link summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 760;
}

.payment-rules-link ul {
  margin: 8px 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.agreement-rule-version {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.agreement-confirmed {
  margin-top: 6px;
  color: var(--success);
  font-size: 12px;
}

.redemption-box {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(20, 122, 97, 0.22);
  border-radius: 10px;
  padding: 12px;
  background: #f4fbf8;
}

.home-redeem-entry {
  margin-top: 10px;
  border: 1px solid rgba(144, 104, 240, 0.28);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(144, 104, 240, 0.1);
}

.home-redeem-entry:hover,
.home-redeem-entry:focus-visible {
  border-color: rgba(144, 104, 240, 0.48);
  background: var(--soft);
  outline: 0;
}

.identity-login.login-attention {
  border-color: rgba(144, 104, 240, 0.42);
  box-shadow: 0 0 0 3px rgba(144, 104, 240, 0.16);
}

.terms-agreement {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(144, 104, 240, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: #fbf9ff;
}

.terms-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.terms-check input {
  flex: 0 0 auto;
  width: auto;
}

.terms-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.terms-links button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-strong);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.terms-links button:hover,
.terms-links button:focus-visible {
  text-decoration: underline;
  outline: 0;
}

.terms-accept-btn {
  justify-self: start;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 7px 12px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.terms-accept-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.terms-dialog[hidden] {
  display: none;
}

.terms-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
}

.terms-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 19, 31, 0.34);
}

.terms-dialog-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(680px, 100%);
  max-height: min(76vh, 720px);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(36, 24, 70, 0.22);
}

.terms-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.terms-dialog-head h2 {
  margin: 0;
  font-size: 18px;
}

.terms-dialog-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.terms-dialog-body {
  overflow: auto;
  padding: 14px 16px 18px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.75;
}

.terms-dialog-body p {
  margin: 0 0 12px;
}

.redemption-box strong {
  display: block;
  margin-bottom: 2px;
  color: var(--success);
}

.redemption-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.redemption-row input {
  text-transform: uppercase;
  letter-spacing: 0;
}

.agreement-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 720;
}

.agreement-check input {
  flex: 0 0 auto;
  width: auto;
}

.payment-product-grid button {
  display: grid;
  justify-items: start;
  gap: 5px;
  min-height: 118px;
  text-align: left;
}

.payment-experience-grid button {
  min-height: 102px;
}

.payment-product-grid button.is-disabled,
.payment-product-grid button:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: #f6f4fb;
  cursor: default;
  opacity: 0.82;
}

.payment-product-grid button.is-disabled .plan-action-label,
.payment-product-grid button:disabled .plan-action-label {
  color: var(--muted);
  background: #e7e2f5;
}

.payment-product-grid span {
  color: var(--muted);
  font-size: 12px;
}

.payment-product-grid .plan-benefit {
  color: var(--ink);
  line-height: 1.45;
}

.payment-product-grid .plan-price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  line-height: 1.35;
}

.payment-product-grid .plan-price b {
  color: var(--brand-strong);
  font-size: 14px;
}

.payment-product-grid .plan-price s {
  color: var(--muted);
}

.payment-product-grid .plan-price em {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(144, 104, 240, 0.2);
  border-radius: 999px;
  color: var(--brand-strong);
  background: rgba(144, 104, 240, 0.08);
  font-style: normal;
  font-weight: 700;
}

.payment-product-grid .member-price-label {
  width: 100%;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.payment-product-grid .launch-price-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.payment-product-grid .plan-action-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 3px;
  border-radius: 999px;
  padding: 4px 10px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.payment-product-grid .product-inline-message {
  width: 100%;
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--danger);
  background: #fff1f2;
  font-size: 12px;
  line-height: 1.45;
}

.payment-recovery-bar {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 75;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: min(720px, calc(100vw - 28px));
  border: 1px solid #d8c7ff;
  border-radius: 8px;
  padding: 9px 10px;
  color: #312e81;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(55, 48, 163, 0.14);
  transform: translateX(-50%);
}

.payment-recovery-bar strong,
.payment-recovery-bar span {
  display: block;
}

.payment-recovery-bar strong {
  font-size: 13px;
}

.payment-recovery-bar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.payment-recovery-action,
.payment-recovery-close {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.payment-recovery-action {
  padding: 8px 10px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
}

.payment-recovery-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: #f8fafc;
  font-size: 18px;
  line-height: 1;
}

.payment-recovery-close:hover {
  color: var(--ink);
  background: #eef2ff;
}

.payment-panel textarea {
  min-height: 74px;
  margin-top: 8px;
  font-size: 12px;
}

#paymentStatus.notice:not(:empty) {
  position: relative;
  width: 100%;
  padding: 12px 44px 12px 12px;
  box-shadow: none;
}

#paymentStatus .toast-body {
  display: grid;
  gap: 5px;
}

#paymentStatus .toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 18px;
  line-height: 1;
}

#paymentStatus .toast-close:hover {
  color: var(--ink);
  background: #fff;
}

#paymentStatus .toast-countdown {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

#paymentStatus.notice strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

#paymentStatus.notice p {
  margin: 4px 0 0;
}

.notice {
  flex-basis: 100%;
  border: 1px solid #efd58e;
  border-radius: 8px;
  padding: 10px;
  color: var(--warn);
  background: var(--warn-bg);
  line-height: 1.5;
}

.notice:empty {
  display: none;
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}

.settings-grid {
  border-top: 1px solid var(--line);
  padding: 13px;
}

#supplement,
#priceBook {
  min-height: 72px;
}

.composer {
  display: grid;
  gap: 8px;
  border-color: #ede9fe;
  background: #fff;
}

.composer.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

#pasteText {
  min-height: 54px;
  max-height: 160px;
  resize: none;
}

.send-button {
  min-width: 76px;
  min-height: 54px;
}

.upload-menu-wrap {
  position: relative;
  align-self: end;
}

.plus-upload {
  display: grid;
  width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border-color: var(--brand-border);
  border-radius: 999px;
  padding: 0;
  color: var(--brand-strong);
  background: #fff;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.plus-upload:hover,
.plus-upload[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.upload-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  width: 172px;
  overflow: hidden;
  border: 1px solid #ede9fe;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-strong);
}

.upload-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.upload-option + .upload-option {
  border-top: 1px solid var(--line);
}

.upload-option span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 13px;
}

.upload-option:hover,
.upload-option.is-dragover {
  background: var(--soft-2);
}

.composer-hint {
  padding-left: 48px;
  color: var(--muted);
  font-size: 12px;
}

.result-summary {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.result-summary strong {
  color: var(--accent-dark);
}

.result-summary span {
  color: var(--muted);
  font-size: 13px;
}

.result-actions {
  display: flex;
  justify-content: flex-start;
}

.result-actions:empty {
  display: none;
}

.direct-script-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.direct-script-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.direct-script-head strong {
  color: var(--accent-dark);
  font-size: 16px;
}

.direct-script-head span {
  color: var(--muted);
  font-size: 13px;
}

.direct-script-card pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font: inherit;
  line-height: 1.72;
}

.advisor-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.advisor-details summary {
  padding: 12px 14px;
  color: var(--ink-soft);
  font-weight: 700;
}

.advisor-details .script-list {
  padding: 0 14px 14px;
}

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

.script-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.script-section h3 {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 15px;
}

.script-section pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font: inherit;
  line-height: 1.62;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(17, 24, 39, 0.68);
}

.image-lightbox figure {
  display: grid;
  gap: 10px;
  max-width: min(920px, 100%);
  max-height: 88vh;
  margin: 0;
}

.image-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-strong);
}

.image-lightbox figcaption {
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  width: 40px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  padding: 0;
  color: #fff;
  background: rgba(17, 24, 39, 0.52);
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 760px) {
  .home-install-guide {
    left: 10px;
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: auto;
  }

  .home-install-toast {
    grid-template-columns: minmax(0, 1fr) auto 34px;
    padding: 10px;
  }

  .home-install-toast strong {
    font-size: 13px;
  }

  .home-install-guide.is-open {
    padding: 12px 10px calc(16px + env(safe-area-inset-bottom));
  }

  .home-install-panel {
    width: 100%;
    padding: 16px;
  }

  button,
  summary {
    min-height: 44px;
  }

  .chat-app {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    gap: 0;
  }

  .topbar {
    align-items: center;
    border-width: 0 0 1px;
    border-radius: 0;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    box-shadow: none;
  }

  .brand-lockup {
    width: 100%;
  }

  .brand-mark {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .brand-lockup strong {
    max-width: none;
    font-size: 16px;
  }

  .topbar-usage {
    display: flex;
    flex: 0 0 auto;
    max-width: 42%;
    gap: 4px;
  }

  .topbar-actions {
    flex: 0 1 auto;
  }

  .topbar-usage span {
    min-height: 24px;
    padding: 2px 6px;
    font-size: 11px;
  }

  #myCustomersBtn,
  #ordersSettingsBtn,
  #paymentBackBtn,
  #ordersSettingsBackBtn,
  .upgrade-entry,
  .account-primary-action,
  #refreshOrdersBtn {
    min-width: 0;
    min-height: 42px;
    padding: 8px 9px;
    font-size: 13px;
    white-space: nowrap;
  }

  .upgrade-entry,
  .account-primary-action {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-shell,
  .user-center {
    border-width: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .user-center-scroll {
    padding: 12px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .user-center-card {
    border-radius: 10px;
    padding: 13px;
  }

  .account-actions,
  .orders-actions {
    grid-template-columns: 1fr;
  }

  .identity-state-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .account-actions button,
  .orders-actions button {
    width: 100%;
  }

  .section-head h2 {
    font-size: 17px;
  }

  .bottom-nav {
    border-width: 1px 0 0;
    border-radius: 0;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 18px rgba(31, 41, 55, 0.06);
  }

  .conversation-stream {
    padding: 12px 10px 10px;
  }

  .deal-session-bar {
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 10px;
  }

  .session-select-wrap {
    flex-basis: 100%;
  }

  .session-select-wrap select {
    max-width: none;
    flex: 1 1 auto;
  }

  .deal-session-bar button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    padding-inline: 8px;
  }

  .empty-state {
    margin-bottom: 8px;
    text-align: left;
  }

  .empty-state h1 {
    font-size: 22px;
  }

  .dialogue-body {
    width: fit-content;
    max-width: calc(100% - 42px);
  }

  .wide-dialogue {
    width: calc(100% - 42px);
    max-width: calc(100% - 42px);
  }

  .avatar {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    min-height: 32px;
  }

  .script-list {
    grid-template-columns: 1fr;
  }

  .direct-script-card {
    padding: 13px;
  }

  .direct-script-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .recognition-review-footer [data-analyze],
  .result-actions [data-copy-script] {
    width: 100%;
  }

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

  .confirm-panel,
  .composer {
    margin: 0 10px 10px;
  }

  .payment-product-grid {
    grid-template-columns: 1fr;
  }

  .payment-recovery-bar {
    top: calc(8px + env(safe-area-inset-top));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: calc(100vw - 20px);
    padding: 8px;
  }

  .payment-recovery-bar .payment-recovery-close {
    grid-column: 2;
    grid-row: 1;
  }

  .payment-recovery-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .payment-product-grid button {
    min-height: 76px;
  }

  .composer-row {
    grid-template-columns: 42px minmax(0, 1fr) 62px;
    gap: 7px;
    align-items: end;
  }

  #pasteText {
    min-height: 52px;
    max-height: 118px;
    padding: 11px 10px;
  }

  .send-button {
    min-width: 0;
    min-height: 52px;
    padding-inline: 10px;
  }

  .plus-upload {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .composer-hint {
    display: none;
    padding-left: 0;
  }

  #batchHint {
    display: block;
    font-size: 11px;
    line-height: 1.45;
  }

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

  .drawer-panel {
    width: 100vw;
    padding: 16px 14px;
  }

  .manual-copy-panel {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(78dvh, 620px);
    border-radius: 16px 16px 0 0;
    padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
  }

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

  .screenshot-item,
  .document-item {
    flex-basis: 96px;
    width: 96px;
  }

  .sent-attachment {
    width: min(240px, 100%);
  }

  .sent-screenshot img {
    max-height: 190px;
  }

  .image-lightbox {
    padding: 16px;
  }

  .customer-card footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  #myCustomersBtn,
  #ordersSettingsBtn,
  #paymentBackBtn,
  #ordersSettingsBackBtn,
  .upgrade-entry,
  .account-primary-action,
  #refreshOrdersBtn {
    padding-inline: 7px;
    font-size: 12px;
  }

  .dialogue-row,
  .recognized-message {
    gap: 7px;
  }

  .avatar {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    min-height: 30px;
  }

  .dialogue-body,
  .wide-dialogue {
    max-width: calc(100% - 37px);
  }

  .dialogue-bubble,
  .recognized-message .editable-bubble {
    padding: 9px 11px;
    font-size: 14px;
  }

  .recognized-message-content {
    max-width: calc(100% - 40px);
  }

  .bubble-editor {
    width: 100%;
  }

  .bubble-editor textarea {
    width: 100% !important;
  }

  .composer {
    margin-inline: 8px;
    padding: 10px;
  }

  .composer-row {
    grid-template-columns: 40px minmax(0, 1fr) 56px;
  }

  .plus-upload {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .send-button {
    padding-inline: 8px;
  }
}
.chat-shell {
  grid-template-rows: minmax(0, 1fr) auto;
}

.plus-upload {
  width: auto;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 750;
  white-space: nowrap;
}

.advisor-chat-bubble {
  white-space: pre-wrap;
  line-height: 1.72;
}

.advisor-chat-bubble :is(h1, h2, h3, h4, h5, h6) {
  margin: 0 0 7px;
  font-size: 1em;
  line-height: 1.5;
}

.advisor-chat-bubble :is(p, ul, ol) {
  margin: 0;
}

.advisor-chat-bubble :is(p, ul, ol) + :is(p, ul, ol, h1, h2, h3, h4, h5, h6) {
  margin-top: 8px;
}

.advisor-chat-bubble :is(ul, ol) {
  padding-left: 1.35em;
}

.advisor-chat-row {
  margin-top: 10px;
}

.commerce-account-summary {
  margin: 0;
  color: #554b68;
  line-height: 1.65;
}

.commerce-selection-guidance {
  margin: 10px 0 0;
  color: #554b68;
  line-height: 1.65;
}

.commerce-offers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.commerce-offer {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid #e7e0f3;
  border-radius: 16px;
  background: #fff;
  color: #322b3d;
  text-align: left;
}

.commerce-offer.is-selected {
  border-color: #8f68ef;
  box-shadow: 0 0 0 2px rgb(143 104 239 / 12%);
  background: #fbf9ff;
}

.commerce-offer-current {
  border-style: dashed;
  background: #fbf9ff;
}

.commerce-login-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e7e0f3;
  border-radius: 12px;
  background: #fbf9ff;
}

.commerce-login-hint button,
.commerce-rules-link {
  white-space: nowrap;
}

.commerce-rules-link {
  min-height: 32px;
  margin-top: 14px;
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.commerce-offer:disabled {
  opacity: 0.58;
}

.commerce-offer strong {
  font-size: 17px;
}

.commerce-offer span,
.commerce-offer small {
  color: #6c6279;
  line-height: 1.45;
}

.flex-topup-field,
.payment-rules-check {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: #554b68;
  line-height: 1.5;
}

.flex-topup-field input {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #d9d0e7;
  border-radius: 12px;
  font: inherit;
}

.payment-rules-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.commerce-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.commerce-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #8f68ef;
  color: #fff;
  font-weight: 750;
}

.commerce-actions button:disabled {
  opacity: 0.45;
}

.pending-payment-area {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f7f3ff;
  color: #554b68;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .commerce-offers,
  .commerce-actions {
    grid-template-columns: 1fr;
  }

  .composer-row {
    grid-template-columns: auto minmax(0, 1fr) 62px;
  }

  .plus-upload {
    width: auto;
    min-width: 92px;
    padding-inline: 10px;
  }
}

@media (max-width: 420px) {
  .topbar-actions {
    gap: 5px;
  }

  .topbar-login {
    min-height: 32px;
    padding-inline: 7px;
    font-size: 12px;
  }

  .commerce-login-hint {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-row {
    grid-template-columns: auto minmax(0, 1fr) 56px;
  }

  .plus-upload {
    min-width: 42px;
    padding-inline: 8px;
    font-size: 13px;
  }
}
