:root {
  --bg: #edf4f6;
  --surface: #fbfdfe;
  --surface-soft: #e8f1f3;
  --ink: #102934;
  --muted: #61747c;
  --line: #cddde1;
  --green: #148bb5;
  --green-strong: #0d6d8e;
  --soft-green: #dff2f6;
  --blue: #148bb5;
  --gold: #c88d2b;
  --red: #c3433d;
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-soft: 0 10px 30px rgba(17, 62, 78, 0.1);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 60%, white);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.08;
}

h2 {
  font-size: 22px;
  line-height: 1.15;
}

h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.muted {
  color: var(--muted);
}

.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--bg);
}

.login-card {
  width: min(400px, 100%);
  padding: 24px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-tab {
  min-height: 36px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(25, 42, 38, 0.12);
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.auth-links .ghost {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.group-composer {
  display: grid;
  gap: 10px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}

.group-members {
  max-height: 220px;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.group-member-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.group-member-tools .secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.group-member-source {
  margin: 0;
  padding: 10px 2px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.group-member {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.group-member:last-child {
  border-bottom: 0;
}

.group-member input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.group-member span,
.group-member strong,
.group-member small {
  min-width: 0;
  display: block;
}

.group-member small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-details-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.group-panel-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.group-logo-button {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.group-logo-button:disabled {
  cursor: default;
}

.group-logo-button .group-panel-avatar {
  width: 54px;
  height: 54px;
}

.group-logo-camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 13px;
}

.group-toolbar,
.member-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.group-toolbar .icon-button {
  width: 34px;
  height: 34px;
}

.group-rename-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 6px;
}

.group-rename-row .icon-button {
  width: 38px;
  height: 42px;
}

.group-detail-members {
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.group-detail-member {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.member-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--soft-green);
  font-size: 11px;
  font-weight: 800;
}

.member-identity,
.member-identity strong,
.member-identity small {
  min-width: 0;
  display: block;
}

.member-identity small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-icon {
  width: 30px;
  height: 30px;
}

.danger-icon {
  color: var(--red);
}

.mark {
  width: 48px;
  height: 48px;
  display: block;
}

.stack,
.settings,
.user-form,
.contact-form,
.admin-list {
  display: grid;
  gap: 10px;
}

.field {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  transition: background-color var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out);
}

.field:focus {
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 22%, transparent);
}

.phone-input {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(124px, 0.9fr) minmax(0, 1.1fr);
  gap: 6px;
}

.phone-country,
.phone-number {
  min-width: 0;
}

.phone-country {
  padding-right: 5px;
}

.primary,
.secondary,
.ghost,
.icon {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 8px;
  font-weight: 700;
  transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}

.primary {
  color: white;
  background: var(--green);
}

.primary:hover,
.send-button:hover {
  background: var(--green-strong);
}

.secondary,
.icon {
  color: var(--green);
  background: var(--soft-green);
}

.ghost {
  color: var(--green);
  background: transparent;
}

.shell {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: 340px minmax(480px, 1fr);
  overflow: hidden;
}

.shell.with-inspector {
  grid-template-columns: 340px minmax(480px, 1fr) 320px;
}

.sidebar,
.detail,
.inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: grid;
  grid-template-rows: auto auto 1fr;
  background: var(--surface);
}

.topbar,
.chat-header,
.conversation-identity,
.header-actions,
.topbar-actions,
.split,
.checkrow,
.admin-title,
.admin-user,
.user-actions {
  display: flex;
  align-items: center;
}

.topbar {
  min-height: 74px;
  justify-content: space-between;
  padding: 16px 16px 10px 20px;
}

.topbar p {
  margin-top: 3px;
  font-size: 13px;
}

.topbar-actions,
.header-actions,
.user-actions,
.split {
  gap: 6px;
}

.topbar-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-unread {
  min-width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  color: #fff;
  background: var(--green);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.invitation-count-badge {
  min-width: 23px;
  height: 21px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid #a66a00;
  border-radius: 0;
  clip-path: polygon(22% 0, 78% 0, 100% 50%, 78% 100%, 22% 100%, 0 50%);
  color: #253644;
  background: #dfa628;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(166, 106, 0, 0.22);
}

.invitation-count-badge:hover,
.invitation-count-badge:focus-visible {
  color: #182733;
  background: #edbe4b;
  transform: translateY(-1px);
}

.icon-button,
.send-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--green);
  background: transparent;
  transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}

.admin-entry {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--soft-green);
}

.admin-entry ion-icon {
  width: 21px;
  height: 21px;
}

.empty-conversation {
  min-height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.empty-conversation img {
  width: 54px;
  height: 54px;
  margin-bottom: 5px;
  object-fit: contain;
  opacity: 0.72;
}

.empty-conversation h2 {
  color: var(--ink);
  font-size: 18px;
}

.empty-conversation p {
  max-width: 320px;
  font-size: 13px;
}

.icon-button:hover {
  background: var(--soft-green);
}

.icon-button:active,
.send-button:active,
.incoming-action:active,
.message-actions button:active {
  transform: scale(0.92);
}

.primary:active,
.secondary:active,
.ghost:active,
.admin-entry:active {
  transform: scale(0.97);
}

.icon-button ion-icon,
.send-button ion-icon {
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.search-wrap {
  padding: 0 14px 12px;
}

.sidebar-language {
  width: 100%;
  min-height: 32px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 16px;
  gap: 7px;
  align-items: center;
  margin-top: 6px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--green-strong);
  background: transparent;
  text-align: left;
}

.sidebar-language:hover {
  background: var(--soft-green);
}

.sidebar-language span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-field {
  height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.search-field ion-icon {
  width: 19px;
  height: 19px;
}

.search-field input {
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.chat-list {
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: auto;
  padding: 0 10px 14px;
}

.chat-row {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  gap: 11px;
  align-items: center;
  padding: 9px 8px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
  transition: background-color var(--motion-base) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}

.chat-row.active {
  background: #ddf3fc;
}

.chat-row:hover:not(.active) {
  background: #f2f9fc;
}

.chat-row:active {
  transform: scale(0.99);
}

.avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.avatar.pinned {
  background: var(--blue);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-title,
.row-subtitle {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title {
  margin-bottom: 4px;
  font-weight: 700;
}

.row-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.row-meta {
  min-width: 0;
  height: 44px;
  display: grid;
  justify-items: end;
  align-content: space-between;
  color: var(--muted);
}

.row-meta small {
  max-width: 42px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  min-width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 11px;
  color: white;
  background: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.detail {
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
}

.chat-header {
  position: relative;
  z-index: 2;
  min-height: 72px;
  justify-content: space-between;
  padding: 12px 14px 12px 18px;
  background: var(--surface);
  box-shadow: 0 7px 22px rgba(24, 82, 110, 0.045);
}

.conversation-identity {
  min-width: 0;
  gap: 11px;
}

.conversation-identity h2,
.conversation-identity p {
  max-width: min(42vw, 440px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-identity h2 {
  font-size: 17px;
}

.conversation-identity p {
  margin-top: 3px;
  font-size: 12px;
}

.messages {
  overflow: auto;
  padding: 22px clamp(18px, 4vw, 56px);
}

.bubble {
  width: fit-content;
  max-width: 72%;
  margin: 0 0 8px;
  padding: 9px 11px;
  border: 0;
  border-radius: 17px 17px 17px 5px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(24, 82, 110, 0.055);
}

.bubble.mine {
  margin-left: auto;
  border-radius: 17px 17px 5px 17px;
  color: var(--ink);
  background: #ddf3fc;
}

.bubble.image-bubble {
  width: min(390px, 72%);
  padding: 3px;
  overflow: hidden;
}

.image-bubble > .meta,
.image-bubble > .forwarded-marker,
.image-bubble > .reply,
.image-bubble > .body-text,
.image-bubble > .translation {
  margin-left: 8px;
  margin-right: 8px;
}

.image-bubble > .meta:first-child {
  margin-top: 5px;
}

.meta {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.forwarded-marker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.forwarded-marker ion-icon {
  width: 13px;
  height: 13px;
}

.mine .meta,
.mine .translation,
.mine .reply {
  color: var(--green-strong);
}

.body-text {
  font-size: 15px;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.translation,
.reply {
  margin-top: 7px;
  padding: 7px 0 1px 9px;
  border-left: 2px solid var(--green);
  border-radius: 0;
  color: var(--green-strong);
  background: transparent;
  line-height: 1.35;
}

.translation.has-speech {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.translation-text {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.translation-speak {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  margin: -4px -3px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: currentColor;
  background: transparent;
}

.translation-speak:hover,
.translation-speak:focus-visible,
.translation-speak.speaking {
  background: rgba(20, 127, 184, 0.12);
}

.translation-speak.speaking ion-icon {
  animation: dw-voice-pulse 900ms ease-in-out infinite alternate;
}

.translation-speak ion-icon {
  width: 17px;
  height: 17px;
}

@keyframes dw-voice-pulse {
  to { transform: scale(1.12); opacity: 0.68; }
}

button.translation {
  display: block;
  font-size: 13px;
  text-align: left;
}

.translation.translating,
.draft-translation.translating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.translation.translating ion-icon,
.draft-translation.translating ion-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  animation: dw-translation-turn 900ms linear infinite;
}

@keyframes dw-translation-turn {
  to { transform: rotate(360deg); }
}

.media-card {
  min-width: min(300px, 60vw);
  min-height: 56px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--green-strong);
  background: rgba(20, 127, 184, 0.08);
  text-decoration: none;
}

.media-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(20, 127, 184, 0.12);
  font-size: 10px;
  font-weight: 900;
}

.media-card strong,
.media-card small {
  display: block;
  overflow-wrap: anywhere;
}

.media-card small {
  margin-top: 3px;
  opacity: 0.74;
}

.media-card audio {
  width: min(260px, 100%);
  margin-top: 8px;
}

.media-preview {
  width: min(340px, 58vw);
  display: block;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(20, 127, 184, 0.07);
  text-decoration: none;
}

button.media-preview {
  padding: 0;
  border: 0;
  font: inherit;
  text-align: left;
}

.image-bubble .media-preview.image-media {
  width: 100%;
  margin-top: 2px;
  cursor: zoom-in;
  background: #10232d;
}

.media-preview img,
.media-preview video {
  width: 100%;
  max-height: 340px;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #10232d;
}

.image-bubble .media-preview img {
  min-height: 190px;
  max-height: 430px;
  aspect-ratio: auto;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(2, 8, 12, 0.97);
  animation: image-viewer-in 160ms ease-out;
}

.image-viewer section {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.image-viewer-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.image-viewer-actions .icon-button {
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(15, 28, 36, 0.74);
  text-decoration: none;
  backdrop-filter: blur(10px);
}

@keyframes image-viewer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.media-video video {
  cursor: pointer;
}

.media-preview-caption {
  display: block;
  min-width: 0;
  padding: 8px 10px 9px;
}

.media-preview-caption strong,
.media-preview-caption small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview-caption small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.form-message {
  width: min(330px, 60vw);
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(20, 127, 184, 0.07);
  text-align: left;
}

.form-message-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: var(--green);
}

.form-message strong,
.form-message small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-message small {
  margin-top: 3px;
  color: var(--muted);
}

.view-once-message {
  width: min(330px, 60vw);
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 2px 5px 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.view-once-message:disabled {
  opacity: 1;
}

.view-once-message:not(:disabled):hover .view-once-icon {
  background: rgba(20, 127, 184, 0.18);
}

.view-once-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: rgba(20, 127, 184, 0.1);
}

.bubble.mine .view-once-icon {
  color: var(--green-strong);
  background: rgba(20, 127, 184, 0.1);
}

.view-once-message strong,
.view-once-message small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-once-message small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.bubble.mine .view-once-message small {
  color: var(--green-strong);
}

.media-open {
  display: inline-block;
  margin-top: 7px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.message-actions {
  position: absolute;
  z-index: 3;
  top: calc(100% - 2px);
  left: 0;
  display: none;
  flex-wrap: wrap;
  gap: 5px;
  width: max-content;
  max-width: min(420px, 70vw);
  padding: 5px;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(24, 82, 110, 0.13);
}

.bubble:hover .message-actions,
.message-actions:focus-within {
  display: flex;
}

.bubble.mine .message-actions {
  right: 0;
  left: auto;
}

.bubble:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 58%, white);
  outline-offset: 3px;
}

.message-actions button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  color: var(--green-strong);
  background: rgba(20, 127, 184, 0.08);
  font-size: 11px;
  font-weight: 700;
  transition: color var(--motion-fast) var(--ease-out), background-color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
}

.message-actions button ion-icon {
  width: 15px;
  height: 15px;
}

.message-actions button:disabled {
  display: none;
}

.composer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 40px 40px 40px minmax(180px, 1fr) 40px 40px 44px;
  gap: 7px;
  align-items: end;
  padding: 10px 14px 12px;
  background: var(--surface);
  box-shadow: 0 -7px 22px rgba(24, 82, 110, 0.045);
}

.composer-field {
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface-soft);
  transition: background-color var(--motion-base) var(--ease-out), box-shadow var(--motion-base) var(--ease-out);
}

.composer-field:focus-within {
  background: #f3f9fc;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 18%, transparent);
}

.composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px 36px 36px 40px;
  align-items: end;
}

.rich-toolbar {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 9px 0;
}

.rich-toolbar[hidden] {
  display: none;
}

.rich-tool {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.rich-tool:hover,
.rich-tool:focus-visible {
  color: var(--green-strong);
  background: var(--soft-green);
  outline: 0;
}

.rich-tool ion-icon {
  width: 16px;
  height: 16px;
}

.draft-translation {
  padding: 8px 12px 2px;
  color: var(--green-strong);
  font-size: 13px;
  line-height: 1.35;
}

.composer-input {
  width: 100%;
  min-height: 42px;
  max-height: 116px;
  overflow-y: auto;
  padding: 10px 6px 9px 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 15px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.composer-input:empty::before {
  color: var(--muted);
  content: attr(data-placeholder);
  pointer-events: none;
}

.inline-format {
  width: 32px;
  height: 40px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-format.active {
  color: var(--green-strong);
  background: var(--soft-green);
}

.inline-translate {
  color: var(--green-strong);
}

.inline-writing {
  width: 34px;
  height: 40px;
  color: var(--gold);
}

.inline-priority {
  width: 36px;
  height: 40px;
  color: var(--muted);
}

.inline-priority.active {
  color: var(--red);
  background: #f8e8e6;
}

.inline-view-once {
  width: 36px;
  height: 40px;
  color: var(--muted);
}

.inline-view-once.active {
  color: var(--red);
  background: #f8e8e6;
}

.body-text code,
.view-once-text code {
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(18, 36, 31, 0.09);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

.bubble.mine .body-text code {
  background: rgba(255, 255, 255, 0.16);
}

.body-text a,
.view-once-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.priority-marker,
.star-marker,
.receipt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
}

.priority-marker,
.star-marker {
  margin-right: 4px;
}

.priority-marker {
  color: var(--red);
}

.star-marker {
  color: var(--green-strong);
}

.priority-marker ion-icon,
.star-marker ion-icon,
.receipt ion-icon {
  width: 16px;
  height: 16px;
}

.receipt-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-height: 18px;
  margin-top: 2px;
  float: right;
}

.receipt {
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  line-height: 1;
  opacity: 0.9;
}

.receipt.sent {
  color: #146f9b;
}

.receipt.sending {
  color: #146f9b;
  opacity: 0.72;
}

.receipt.delivered {
  color: #a86e00;
}

.receipt.read {
  color: #087a67;
  opacity: 1;
}

.receipt.translated {
  color: #7254a8;
  opacity: 1;
}

.receipt.retry {
  color: var(--red);
  cursor: pointer;
  opacity: 1;
}

.receipt.retry:hover,
.receipt.retry:focus-visible {
  color: #9f342d;
}

.receipt.sending.receipt-animate {
  animation: dw-receipt-pending 440ms ease-out both;
}

.receipt.sent.receipt-animate {
  animation: dw-receipt-arrive 300ms ease-out both;
}

.receipt.delivered.receipt-animate {
  animation: dw-receipt-arrive 420ms ease-out both;
}

.receipt.read.receipt-animate,
.receipt.translated.receipt-animate {
  animation: dw-receipt-seen 360ms ease-out both;
}

@keyframes dw-receipt-pending {
  from { opacity: 0.25; transform: rotate(-45deg); }
  to { opacity: 0.72; transform: rotate(0); }
}

@keyframes dw-receipt-arrive {
  0% { opacity: 0.35; transform: scale(0.72); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.9; transform: scale(1); }
}

@keyframes dw-receipt-seen {
  from { opacity: 0.3; transform: scale(0.72); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .receipt.receipt-animate { animation: none; }
}

.icon-button.recording {
  color: white;
  background: var(--red);
}

.send-button {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  color: white;
  background: var(--green);
}

.inspector {
  padding: 20px;
  overflow: auto;
  background: var(--surface);
  box-shadow: -10px 0 30px rgba(24, 82, 110, 0.055);
}

.inspector-heading {
  position: sticky;
  top: -20px;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding: 20px 20px 12px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.miniapp-message-card {
  width: 100%;
  min-height: 118px;
  margin-top: 7px;
  padding: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 34px;
  align-items: stretch;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 88%, var(--soft-green));
  text-align: left;
  cursor: pointer;
}

.miniapp-message-card > img {
  width: 112px;
  height: 100%;
  min-height: 118px;
  object-fit: cover;
}

.miniapp-message-copy {
  min-width: 0;
  padding: 12px 10px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.miniapp-message-copy small {
  color: var(--green-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.miniapp-message-copy strong,
.miniapp-message-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.miniapp-message-copy strong {
  font-size: 15px;
}

.miniapp-message-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.miniapp-message-open {
  display: grid;
  place-items: center;
  color: var(--green-strong);
  font-size: 24px;
}

.miniapp-message-card:hover,
.miniapp-message-card:focus-visible {
  background: var(--soft-green);
}

.inspector-heading p {
  margin-top: 4px;
  font-size: 12px;
}

.settings {
  margin-top: 12px;
}

.account-preferences {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.language-pack-panel {
  display: grid;
  gap: 10px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.web-capability-list {
  display: grid;
}

.web-capability-list > div {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.web-capability-list > div:last-child {
  border-bottom: 0;
}

.web-capability-list > div > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--soft-green);
}

.web-capability-list p,
.web-capability-list strong,
.web-capability-list small {
  min-width: 0;
  display: block;
  margin: 0;
}

.web-capability-list strong {
  font-size: 12px;
}

.web-capability-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.compact-action {
  min-width: 62px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  color: white;
  background: var(--blue);
  font-weight: 700;
}

.local-model-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.local-model-card > span:nth-child(2) strong,
.local-model-card > span:nth-child(2) small {
  display: block;
}

.local-model-card > span:nth-child(2) strong {
  font-size: 12px;
}

.local-model-card > span:nth-child(2) small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.local-model-card .icon-text-button {
  min-height: 34px;
  padding-inline: 10px;
}

.subsection-heading {
  margin-top: 8px;
}

.local-model-progress {
  grid-column: 2 / -1;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #d7e5ea;
}

.local-model-progress b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width 180ms var(--ease-out);
}

.language-pack-list,
.nearby-pack-list {
  display: grid;
}

.language-pack-row {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  gap: 9px;
  align-items: center;
  padding: 5px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.language-pack-row > span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--soft-green);
}

.language-pack-row strong,
.language-pack-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-pack-row strong {
  font-size: 12px;
}

.language-pack-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.language-pack-row > ion-icon:last-child {
  color: var(--green);
}

.language-pack-actions {
  display: flex;
  gap: 8px;
}

.primary-soft {
  color: white;
  background: var(--green);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--soft-green);
}

.section-heading strong,
.section-heading small,
.setting-toggle span strong,
.setting-toggle span small {
  display: block;
}

.section-heading small,
.setting-toggle span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.compact-primary {
  width: auto;
  min-width: 88px;
  min-height: 38px;
  justify-self: end;
  padding: 0 16px;
}

.setting-toggle {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink);
  font-size: 14px;
}

.setting-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.advanced-settings {
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.advanced-settings summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary ion-icon {
  width: 20px;
  height: 20px;
  color: var(--green-strong);
}

.inspector-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.status {
  min-height: 20px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.admin-panel,
.contact-panel {
  margin-top: 22px;
  padding-top: 8px;
}

.contact-panel.invitation-focus {
  animation: invitation-focus 1.4s ease-out;
}

.admin-user.contact-invitation {
  background: #fff8e2;
  box-shadow: inset 3px 0 0 #d69b16;
}

@keyframes invitation-focus {
  0% { box-shadow: 0 0 0 0 rgba(214, 155, 22, 0.42); }
  55% { box-shadow: 0 0 0 5px rgba(214, 155, 22, 0.16); }
  100% { box-shadow: 0 0 0 0 rgba(214, 155, 22, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .contact-panel.invitation-focus { animation: none; }
}

.empty-chats {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 36px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-chats .primary {
  width: auto;
  min-width: 128px;
}

.admin-title,
.admin-user {
  justify-content: space-between;
  gap: 10px;
}

.admin-title {
  margin-bottom: 13px;
}

.user-form,
.contact-form {
  margin-bottom: 15px;
}

.contact-form {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
}

.contact-form .icon-only {
  width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.contact-panel-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.user-actions {
  display: flex;
  align-items: center;
}

.contact-icon-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--green-strong);
  background: var(--green-soft);
}

.contact-icon-action.accept {
  color: #fff;
  background: var(--green);
}

.contact-icon-action.danger {
  color: #b33a32;
  background: #fcebea;
}

.contact-icon-action ion-icon {
  width: 18px;
  height: 18px;
}

.invite-share-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: -3px 0 12px;
  padding: 6px 0 9px;
  border-bottom: 1px solid var(--line);
}

.invite-share-bar button {
  min-width: 0;
  height: 54px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.invite-share-bar button:hover,
.invite-share-bar button:focus-visible {
  color: var(--green-strong);
  background: var(--surface-soft);
}

.invite-share-bar ion-icon {
  width: 21px;
  height: 21px;
}

.invite-share-bar span {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-results {
  max-height: 260px;
  margin: -4px 0 14px;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.directory-user {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  gap: 9px;
  align-items: center;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.directory-user:last-child {
  border-bottom: 0;
}

.directory-user:hover,
.directory-user:focus-visible {
  background: var(--surface-soft);
}

.directory-copy,
.directory-copy strong,
.directory-copy small {
  min-width: 0;
  display: block;
}

.directory-copy small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-state {
  display: grid;
  place-items: center;
  color: var(--green);
}

.directory-state.muted {
  color: var(--muted);
}

.message-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 184px;
  max-width: 240px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 14px 34px rgb(10 44 63 / 18%);
  backdrop-filter: blur(16px);
}

.message-context-menu button {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.message-context-menu button:hover,
.message-context-menu button:focus-visible {
  color: var(--green-strong);
  background: var(--soft-green);
}

.message-context-menu ion-icon {
  width: 18px;
  height: 18px;
}

.release-notes {
  min-height: 74px;
  resize: vertical;
}

.release-file {
  margin: -2px 0 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkrow {
  height: 44px;
  gap: 8px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
}

.admin-user {
  padding: 10px 0;
}

.admin-user strong,
.admin-user p {
  overflow-wrap: anywhere;
}

.account-table {
  display: grid;
  gap: 2px;
}

.account-table-head,
.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 66px;
  gap: 7px;
  align-items: center;
}

.account-table-head {
  padding: 5px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.account-table-head span:nth-child(2),
.account-table-head span:nth-child(3) {
  text-align: center;
}

.account-row {
  min-height: 62px;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background-color var(--motion-base) var(--ease-out);
}

.account-row:hover {
  background: var(--surface-soft);
}

.account-identity,
.account-identity strong,
.account-identity small {
  min-width: 0;
  display: block;
}

.account-identity strong,
.account-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.account-identity .account-active {
  color: var(--green-strong);
}

.account-identity .account-disabled {
  color: var(--red);
}

.password-private {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
}

.password-private ion-icon {
  width: 16px;
  height: 16px;
  color: var(--green-strong);
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.pill {
  min-width: 52px;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.pill.ok {
  color: var(--green-strong);
  background: var(--soft-green);
}

.pill.off {
  color: var(--red);
  background: #f8e8e6;
}

.mini {
  min-height: 34px;
  padding: 0 10px;
}

button:disabled {
  cursor: default;
  opacity: 0.42;
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 22, 20, 0.46);
}

.call-setup-sheet {
  width: min(440px, 100%);
  max-height: min(620px, calc(100vh - 48px));
}

.call-setup-body {
  gap: 13px;
}

.call-setup-sheet .form-sheet-footer {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.view-once-sheet {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 25, 21, 0.22);
}

.forward-sheet {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 25, 21, 0.22);
}

.forward-sheet > header,
.forward-sheet > footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.forward-sheet > header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.forward-sheet > header h2 {
  font-size: 19px;
}

.forward-sheet > header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.forward-preview {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 12px 18px 4px;
  padding: 9px 11px;
  border-radius: 7px;
  color: var(--green-strong);
  background: var(--soft-green);
}

.forward-preview p {
  max-height: 42px;
  overflow: hidden;
  line-height: 1.35;
}

.forward-chat-list {
  overflow: auto;
  padding: 8px 12px 14px;
}

.forward-chat-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 22px 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.forward-chat-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.forward-chat-row .avatar {
  width: 40px;
  height: 40px;
}

.forward-chat-row strong,
.forward-chat-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forward-chat-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.forward-sheet > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.forward-sheet > footer .status {
  flex: 1;
}

.forward-sheet > footer button {
  width: auto;
  min-width: 88px;
}

.view-once-sheet > header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.view-once-sheet h2 {
  font-size: 18px;
}

.view-once-sheet header p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.view-once-photo {
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #111513;
}

.view-once-photo img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.view-once-text {
  overflow: auto;
  padding: 24px;
}

.view-once-text > p {
  max-width: 60ch;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.view-once-text .translation {
  max-width: 60ch;
  margin-top: 16px;
}

.form-sheet {
  width: min(820px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 25, 21, 0.22);
}

.form-builder-sheet {
  width: min(880px, 100%);
}

.form-loading {
  width: min(360px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
}

.form-sheet-header,
.form-sheet-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
}

.form-sheet-header {
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.form-sheet-header h2 {
  font-size: 20px;
}

.form-sheet-header .muted {
  max-width: 620px;
  margin-top: 4px;
  white-space: pre-wrap;
}

.form-sheet-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.form-sheet-footer .status {
  flex: 1;
}

.form-sheet-footer button {
  width: auto;
  min-width: 94px;
}

.form-sheet-body {
  overflow: auto;
  padding: 18px 20px 24px;
}

.form-kicker {
  margin-bottom: 4px;
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.template-picker {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.template-picker summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-strong);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.template-picker summary::-webkit-details-marker {
  display: none;
}

.template-list {
  max-height: 160px;
  overflow: auto;
  padding-bottom: 10px;
}

.template-row {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  padding: 8px 2px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.template-row strong,
.template-row small {
  display: block;
}

.template-row small {
  margin-top: 2px;
  color: var(--muted);
}

.form-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-description,
.question-options,
.form-answer-textarea {
  min-height: 76px;
  resize: vertical;
}

.form-settings-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 4px;
}

.compact-toggle {
  min-height: 38px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--surface-soft);
}

.form-setting-label {
  min-width: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}

.form-setting-label ion-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--green);
}

.form-setting-label > span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-question-list,
.form-answer-list {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.form-question,
.form-answer-question {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.form-question-heading {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 180px 32px;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
}

.question-type {
  height: 38px;
}

.form-question-settings {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 90px;
  gap: 10px;
  align-items: end;
  margin-top: 9px;
}

.form-question-settings .checkrow {
  margin: 0;
}

.form-add-question {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}

.score-summary,
.results-heading,
.answer-question-heading,
.submitted-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-summary {
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--line);
}

.score-summary strong {
  font-size: 24px;
}

.score-summary span {
  color: var(--green-strong);
  font-weight: 800;
}

.submitted-note {
  justify-content: flex-start;
  margin-top: 12px;
  color: var(--green-strong);
}

.answer-question-heading {
  align-items: flex-start;
  margin-bottom: 10px;
}

.answer-question-heading > span,
.required-mark {
  flex: none;
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 800;
}

.form-options {
  display: grid;
  gap: 7px;
}

.form-options label {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.form-options input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.rating-options {
  grid-template-columns: repeat(5, 1fr);
}

.rating-options label {
  justify-content: center;
}

.form-results {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.result-score {
  text-align: right;
}

.result-score span,
.result-score strong {
  display: block;
}

.result-question {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.result-question h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.result-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(140px, 3fr) 34px;
  gap: 9px;
  align-items: center;
  margin-top: 7px;
  font-size: 13px;
}

.result-track {
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--soft-green);
}

.result-track i {
  display: block;
  height: 100%;
  background: var(--green);
}

.result-metrics {
  display: flex;
  gap: 26px;
}

.result-metrics span,
.result-metrics strong {
  display: block;
}

.result-metrics strong {
  font-size: 22px;
}

.response-list {
  margin-top: 14px;
}

.response-list summary {
  min-height: 38px;
  font-weight: 700;
  cursor: pointer;
}

.response-list > div {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.response-list small {
  display: block;
  color: var(--muted);
}

.form-viewer-footer {
  flex-wrap: wrap;
}

.icon-text-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--green-strong);
  background: var(--soft-green);
  font-weight: 700;
}

@media (max-width: 760px) {
  .modal-backdrop {
    padding: 10px;
  }

  .form-sheet {
    max-height: calc(100vh - 20px);
  }

  .view-once-sheet {
    max-height: calc(100vh - 20px);
  }

  .form-settings-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-question-settings {
    grid-template-columns: 1fr;
  }

  .form-question-heading {
    grid-template-columns: minmax(90px, 1fr) 150px 32px;
  }
}

.incoming-call {
  position: fixed;
  z-index: 40;
  top: 18px;
  left: 50%;
  width: min(470px, calc(100vw - 28px));
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 46px 46px;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 44px rgba(14, 64, 90, 0.22);
}

.incoming-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 14px;
  font-weight: 800;
}

.incoming-copy {
  min-width: 0;
}

.incoming-copy strong,
.incoming-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incoming-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.incoming-action {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
}

.incoming-action ion-icon {
  width: 21px;
  height: 21px;
}

.incoming-action.accept {
  background: var(--green);
}

.incoming-action.decline {
  background: var(--red);
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 310px minmax(430px, 1fr);
  }

  .shell.with-inspector {
    grid-template-columns: 310px minmax(430px, 1fr);
  }

  .shell.with-inspector .inspector {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    box-shadow: -16px 0 36px rgba(24, 82, 110, 0.13);
  }
}

@media (max-width: 980px) {
  .shell,
  .shell.with-inspector {
    grid-template-columns: 290px minmax(430px, 1fr);
  }

}

.shell-enter,
.conversation-enter {
  animation: dw-surface-in 220ms var(--ease-out) both;
}

.modal-backdrop {
  animation: dw-fade-in 160ms var(--ease-out) both;
}

.form-sheet,
.view-once-sheet,
.forward-sheet {
  animation: dw-sheet-in 220ms var(--ease-out) both;
}

.incoming-call {
  animation: dw-call-in 220ms var(--ease-out) both;
}

@keyframes dw-surface-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dw-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dw-sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dw-call-in {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Frameless Windows integration. The title rail carries the cinematic treatment;
   the communication workspace stays bright and readable for long sessions. */
.dw-main-window .login {
  background: #e8f1f3;
}

.dw-main-window .login-card {
  border: 1px solid rgba(20, 139, 181, 0.18);
  box-shadow: 0 20px 54px rgba(9, 48, 64, 0.13);
}

.dw-main-window .login-card .brand h1 {
  font-size: 22px;
  line-height: 1.16;
}

.dw-main-window .login-card .mark {
  width: 68px;
  height: 56px;
  object-fit: contain;
}

.dw-main-window .shell {
  background: #dce8eb;
}

.dw-main-window .sidebar {
  position: relative;
  z-index: 3;
  border-right: 1px solid rgba(18, 95, 123, 0.14);
  background: #f8fbfc;
  box-shadow: 10px 0 28px rgba(21, 64, 79, 0.045);
}

.dw-main-window .topbar {
  position: relative;
  min-height: 70px;
}

.dw-main-window .topbar::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 20px;
  height: 1px;
  background: rgba(20, 139, 181, 0.13);
  content: "";
}

.dw-main-window .topbar h2 {
  font-size: 19px;
}

.dw-main-window .chat-row.active {
  background: #dff1f4;
  box-shadow: inset 3px 0 #1fa6cf;
}

.dw-main-window .chat-row.active .row-meta small {
  color: var(--gold);
}

.dw-main-window .avatar {
  background: #1886b1;
  box-shadow: 0 0 0 1px rgba(13, 109, 142, 0.12);
}

.dw-main-window .avatar.pinned {
  background: #126f94;
}

.dw-main-window .detail {
  background: #edf4f6;
}

.dw-main-window .chat-header {
  min-height: 70px;
  border-bottom: 1px solid rgba(18, 95, 123, 0.12);
  background: rgba(251, 253, 254, 0.98);
  box-shadow: none;
}

.dw-main-window .messages {
  background: #edf4f6;
  scrollbar-color: #a9c4cd transparent;
}

.dw-main-window .bubble {
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(21, 66, 82, 0.07);
}

.dw-main-window .bubble.mine {
  background: #dcf1f3;
}

.dw-main-window .inspector {
  border-left: 1px solid rgba(18, 95, 123, 0.14);
  background: #f9fcfd;
  box-shadow: -12px 0 28px rgba(21, 64, 79, 0.05);
}

.dw-main-window .composer {
  border-top: 1px solid rgba(18, 95, 123, 0.12);
  background: #f9fcfd;
  box-shadow: 0 -9px 28px rgba(21, 64, 79, 0.04);
}

.dw-main-window .composer-field {
  background: #e7f0f2;
}

.dw-main-window .composer-field:focus-within {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(31, 166, 207, 0.2), 0 7px 20px rgba(21, 64, 79, 0.08);
}

.dw-main-window .send-button {
  color: #ffffff;
  background: #148bb5;
  box-shadow: 0 7px 18px rgba(20, 139, 181, 0.2);
}

.dw-main-window .badge {
  background: #148bb5;
}

.dw-main-window .incoming-call {
  top: calc(var(--dw-titlebar-height) + 14px);
}

.dw-main-window .modal-backdrop {
  top: var(--dw-titlebar-height);
}

.dw-main-window .status:not(:empty) {
  color: #9b671d;
}

.inspector-guide-entry {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--surface-soft);
}

.inspector-guide-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.inspector-guide-actions .inspector-guide-entry {
  margin-bottom: 0;
}

.notice-history {
  margin-bottom: 14px;
  padding: 11px 0 13px;
  border-bottom: 1px solid var(--line);
}

.notice-history > summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.notice-history > summary::-webkit-details-marker {
  display: none;
}

.notice-history > summary > ion-icon {
  width: 20px;
  height: 20px;
  padding: 7px;
  border-radius: 50%;
  color: var(--blue);
  background: #d7edf4;
}

.notice-history > summary strong,
.notice-history > summary small,
.notice-history-entry strong,
.notice-history-entry small {
  display: block;
}

.notice-history > summary small,
.notice-history-entry small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.notice-history-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.notice-history-entry {
  display: grid;
  min-width: 0;
  min-height: 52px;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  padding: 6px 7px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
}

.notice-history-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #d7edf4;
}

.notice-history-icon.theme-academy {
  color: #9a661c;
  background: #fff0c4;
}

.notice-history-icon.theme-security {
  color: #126d9f;
  background: #d8effa;
}

.notice-history-entry > ion-icon {
  color: var(--muted);
}

.notice-history-empty {
  margin: 7px 0 0 43px;
  color: var(--muted);
  font-size: 12px;
}

.inspector-guide-entry > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #d7edf4;
}

.inspector-guide-entry strong,
.inspector-guide-entry small {
  display: block;
}

.inspector-guide-entry small {
  margin-top: 2px;
  color: var(--muted);
}

.inspector-guide-entry > ion-icon {
  color: var(--muted);
}

.desktop-miniapps {
  display: grid;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.desktop-miniapp-list {
  display: grid;
  gap: 7px;
}

.desktop-miniapp-entry {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 46px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
}

.desktop-miniapp-entry img {
  width: 46px;
  height: 46px;
  border-radius: 7px;
  object-fit: cover;
}

.desktop-miniapp-entry strong,
.desktop-miniapp-entry small {
  display: block;
}

.desktop-miniapp-entry small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-miniapp-entry > ion-icon {
  color: var(--muted);
}

.miniapp-runtime {
  position: fixed;
  z-index: 1200;
  inset: var(--dw-titlebar-height, 0) 0 0;
  overflow: hidden;
  background: #edf8ff;
}

.miniapp-runtime iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #edf8ff;
}

.miniapp-runtime-close {
  position: absolute;
  z-index: 2;
  top: max(5px, env(safe-area-inset-top));
  left: max(5px, env(safe-area-inset-left));
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #102938;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.08;
  transition: opacity 140ms ease, background 140ms ease;
}

.miniapp-runtime-close:hover,
.miniapp-runtime-close:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.miniapp-runtime-close ion-icon {
  width: 23px;
  height: 23px;
}

/* First-run flow */
.desktop-onboarding {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 48px 3px minmax(0, 1fr) 66px;
  overflow: hidden;
  color: var(--ink);
  background: #fbfdfe;
}

.desktop-onboarding.welcome {
  grid-template-rows: minmax(0, 1fr) 66px;
}

.desktop-onboarding-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  color: var(--muted);
}

.desktop-onboarding-top strong {
  font-size: 14px;
}

.desktop-onboarding-top > span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.desktop-onboarding-top button {
  justify-self: end;
  min-width: 68px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--blue);
  background: transparent;
  font-weight: 750;
}

.desktop-onboarding-progress {
  overflow: hidden;
  background: #edf3f5;
}

.desktop-onboarding-progress span {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width 260ms var(--ease-out);
}

.desktop-onboarding-body {
  min-height: 0;
  overflow: auto;
  scrollbar-color: #bad0d8 transparent;
}

.desktop-onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 24px;
  border-top: 1px solid rgba(18, 95, 123, 0.1);
  background: rgba(251, 253, 254, 0.98);
}

.desktop-onboarding-footer .secondary {
  min-width: 88px;
}

.desktop-onboarding-footer .primary {
  min-width: 190px;
}

.desktop-onboarding.welcome .desktop-onboarding-footer .primary {
  width: min(360px, 100%);
  margin-inline: auto;
}

.desktop-onboarding-welcome {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 390px;
  overflow: hidden;
  background: #f6fbfd;
}

.desktop-onboarding-welcome > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  animation: desktop-hero-settle 2600ms var(--ease-out) both;
}

.desktop-onboarding-welcome-copy {
  position: absolute;
  left: 50%;
  bottom: 4%;
  width: min(700px, 82%);
  text-align: center;
  transform: translateX(-50%);
  animation: desktop-copy-in 520ms 180ms var(--ease-out) both;
}

.welcome-language,
.onboarding-eyebrow {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.welcome-language {
  min-height: 18px;
  margin: 0;
  letter-spacing: 0;
}

.desktop-onboarding-welcome-copy h1 {
  min-height: 50px;
  margin: 5px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 39px;
  line-height: 1.12;
  letter-spacing: 0;
}

.desktop-onboarding-welcome-copy .welcome-tagline {
  min-height: 50px;
  max-width: 620px;
  margin: 8px auto 0;
  color: #415d68;
  font-size: 18px;
  line-height: 1.38;
}

.desktop-onboarding-welcome-copy .welcome-promise {
  margin: 7px auto 0;
  color: #155f82;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.desktop-onboarding-welcome-copy .welcome-credit {
  margin: 8px auto 0;
  color: #617983;
  font-size: 10px;
  line-height: 1.35;
}

.desktop-onboarding-welcome-copy.identity-changing .welcome-language,
.desktop-onboarding-welcome-copy.identity-changing h1,
.desktop-onboarding-welcome-copy.identity-changing .welcome-tagline {
  animation: desktop-identity-cycle 320ms var(--ease-out) both;
}

.desktop-setup-stage,
.desktop-tutorial-stage {
  width: min(720px, calc(100% - 48px));
  min-height: 100%;
  margin: 0 auto;
  padding: 30px 0 24px;
  animation: desktop-stage-in 260ms var(--ease-out) both;
}

.desktop-setup-stage > h1,
.desktop-tutorial-heading h1 {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.14;
}

.onboarding-lead {
  max-width: 620px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.desktop-setup-control {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #edf5f7;
}

.desktop-setup-control > label {
  font-weight: 750;
}

.onboarding-language-regions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding: 2px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.onboarding-language-regions::-webkit-scrollbar {
  display: none;
}

.onboarding-region-tab {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  color: #126181;
  background: #e6f3f8;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: color 150ms var(--ease-out), background 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.onboarding-region-tab:hover {
  background: #d9edf5;
}

.onboarding-region-tab:active {
  transform: scale(0.98);
}

.onboarding-region-tab.active {
  color: #fff;
  background: var(--blue);
}

.onboarding-region-tab b {
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  color: var(--blue);
  background: #fff;
  font-size: 11px;
}

.onboarding-region-tab:focus-visible,
.onboarding-language-card:focus-visible,
.onboarding-selection-summary button:focus-visible {
  outline: 2px solid rgba(20, 139, 181, 0.42);
  outline-offset: 2px;
}

.onboarding-language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.onboarding-language-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 76px;
  align-content: center;
  justify-items: start;
  padding: 10px 42px 10px 14px;
  overflow: hidden;
  border: 1px solid #d7e2e7;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.onboarding-language-card:hover {
  border-color: #88bfd4;
  background: #f7fbfd;
}

.onboarding-language-card:active {
  transform: scale(0.99);
}

.onboarding-language-card.selected {
  border: 2px solid var(--blue);
  color: #0b6488;
  background: #e7f4fa;
}

.onboarding-language-native,
.onboarding-language-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.onboarding-language-native {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.onboarding-language-name {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.onboarding-language-card.selected .onboarding-language-name {
  color: #126b8e;
}

.onboarding-language-check {
  position: absolute;
  top: 50%;
  right: 13px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--blue);
  opacity: 0;
  transform: translateY(-50%) scale(0.72);
  transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.onboarding-language-check ion-icon {
  font-size: 21px;
}

.onboarding-language-card.selected .onboarding-language-check {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.onboarding-language-empty {
  margin-top: 12px;
  padding: 22px 12px;
  color: var(--muted);
  text-align: center;
}

.onboarding-inline-choice {
  margin-top: 18px;
}

.onboarding-selection-summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: #126181;
  font-size: 13px;
}

.onboarding-selection-summary button {
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.onboarding-selection-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.onboarding-language-plan {
  margin-top: 0;
}

.onboarding-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  margin-top: 12px;
  padding: 11px 16px;
  border-radius: 8px;
  background: #edf5f7;
}

.onboarding-choice-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #dceff5;
}

.onboarding-choice-icon ion-icon {
  font-size: 22px;
}

.onboarding-choice-icon.ready {
  color: #167a54;
  background: #d9f1e6;
}

.onboarding-choice-icon.installed {
  color: #725500;
  background: #f9edc8;
}

.onboarding-choice-icon.working ion-icon {
  animation: model-status-spin 1.1s linear infinite;
}

.onboarding-choice-icon.error {
  color: #a13b3b;
  background: #fae4e4;
}

.local-model-choice {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.local-model-action {
  min-width: 70px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #a9cbd8;
  border-radius: 6px;
  color: #0c6b93;
  background: #ffffff;
  font-size: 12px;
  font-weight: 760;
}

.local-model-action:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.78;
}

.local-model-choice .local-model-progress {
  grid-column: 2 / -1;
}

@keyframes model-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.onboarding-choice strong,
.onboarding-choice small {
  display: block;
}

.onboarding-choice strong {
  font-size: 15px;
}

.onboarding-choice small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.3;
}

.onboarding-choice input[type="checkbox"] {
  position: relative;
  width: 42px;
  height: 24px;
  margin: 0;
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: #b9c9cf;
  cursor: pointer;
  transition: background 150ms var(--ease-out);
}

.onboarding-choice input[type="checkbox"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(17, 45, 56, 0.2);
  content: "";
  transition: transform 150ms var(--ease-out);
}

.onboarding-choice input[type="checkbox"]:checked {
  background: var(--blue);
}

.onboarding-choice input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.onboarding-choice input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(20, 139, 181, 0.42);
  outline-offset: 2px;
}

.onboarding-readiness-list {
  margin-top: 22px;
}

.onboarding-choice.ready-state > ion-icon {
  color: #1b9565;
  font-size: 25px;
}

.desktop-tutorial-stage {
  display: grid;
  grid-template-rows: auto minmax(250px, 1fr) auto;
  gap: 14px;
  padding-top: 22px;
}

.tutorial-demo {
  position: relative;
  align-self: stretch;
  min-height: 260px;
  padding: 22px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf5f7;
}

.tutorial-person,
.call-demo-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tutorial-bubble {
  width: min(520px, 86%);
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(21, 64, 79, 0.07);
}

.tutorial-bubble p {
  font-size: 18px;
}

.tutorial-translation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #9b671d;
  font-size: 15px;
}

.tutorial-translation ion-icon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.tutorial-receipt {
  width: min(520px, 86%);
  margin-top: 7px;
  color: #168765;
  text-align: right;
  font-size: 12px;
}

.tutorial-receipt ion-icon {
  margin-left: 5px;
  font-size: 17px;
  vertical-align: middle;
}

.translator-demo {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.tutorial-language-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--blue);
  font-weight: 750;
}

.tutorial-language-pair span {
  min-width: 110px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.tutorial-wave {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  margin: 20px 0 10px;
}

.tutorial-wave i {
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: #55b4db;
  animation: desktop-wave 900ms ease-in-out infinite alternate;
}

.tutorial-wave i:nth-child(2n) { height: 36px; animation-delay: 120ms; }
.tutorial-wave i:nth-child(3n) { height: 26px; animation-delay: 240ms; }

.translator-demo > p {
  color: var(--muted);
}

.translator-demo > strong {
  margin-top: 6px;
  color: #9b671d;
  font-size: 19px;
}

.call-demo {
  display: grid;
  align-content: space-between;
  color: #fff;
  background: #173548;
}

.call-demo-person small {
  margin-left: auto;
  color: #bcd3dd;
}

.call-demo-source,
.call-demo-subtitle {
  width: fit-content;
  max-width: 80%;
  margin-inline: auto;
  padding: 7px 11px;
  border-radius: 6px;
  text-align: center;
  background: rgba(0, 0, 0, 0.42);
}

.call-demo-subtitle {
  font-size: 17px;
  font-weight: 750;
}

.call-demo-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.call-demo-controls ion-icon {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.call-demo-controls ion-icon:last-child {
  background: #c3433d;
}

.voice-demo {
  display: grid;
  align-content: center;
  gap: 2px;
}

.voice-demo > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.voice-demo > div:last-child {
  border-bottom: 0;
}

.voice-demo ion-icon {
  color: #1b9565;
  font-size: 28px;
}

.voice-demo span,
.voice-demo strong,
.voice-demo small {
  display: block;
}

.voice-demo small {
  margin-top: 3px;
  color: var(--muted);
}

.tools-demo {
  display: grid;
  align-content: center;
  gap: 16px;
}

.tools-demo > strong {
  font-size: 17px;
}

.tools-demo > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.tools-demo i {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #d3e2e7;
}

.tools-demo b {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--blue);
}

.tools-demo p {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.tools-demo ion-icon {
  color: var(--blue);
  font-size: 22px;
}

.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.tutorial-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  background: #b7cbd2;
  transition: width 160ms var(--ease-out), background 160ms var(--ease-out);
}

.tutorial-dots button.active {
  width: 24px;
  border-radius: 5px;
  background: var(--blue);
}

@keyframes desktop-hero-settle {
  from { opacity: 0.8; transform: scale(1.035); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes desktop-copy-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes desktop-stage-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes desktop-identity-cycle {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes desktop-wave {
  from { transform: scaleY(0.55); }
  to { transform: scaleY(1); }
}

@media (max-width: 760px) {
  .desktop-onboarding-welcome-copy {
    left: 50%;
    bottom: 6%;
    width: 78%;
  }

  .desktop-onboarding-welcome-copy h1 {
    min-height: 44px;
    font-size: 31px;
  }

  .desktop-onboarding-welcome-copy .welcome-tagline {
    min-height: 44px;
    font-size: 16px;
  }

  .desktop-setup-stage,
  .desktop-tutorial-stage {
    width: calc(100% - 32px);
  }

  .desktop-setup-control {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

@media (max-height: 620px) {
  .desktop-setup-stage,
  .desktop-tutorial-stage {
    padding-top: 18px;
  }

  .desktop-setup-stage > h1,
  .desktop-tutorial-heading h1 {
    font-size: 25px;
  }

  .tutorial-demo {
    min-height: 218px;
    padding: 16px;
  }
}

.rich-notice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(7, 32, 50, 0.52);
  backdrop-filter: blur(8px);
}

.mobile-chat-back {
  display: none;
}

.rich-notice-scroll {
  position: relative;
  width: min(92vw, 520px);
  max-height: 96vh;
  aspect-ratio: 941 / 1672;
  color: #152b3a;
  background: url("../assets/eagle-notice-scroll.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 24px 42px rgba(2, 31, 49, 0.3));
  transform-origin: top center;
}

.rich-notice-scroll.animation-unroll {
  animation: notice-unroll 520ms cubic-bezier(.22, .8, .24, 1) both;
}

.rich-notice-inner {
  position: absolute;
  inset: 18% 15% 11%;
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.rich-notice-kicker {
  align-self: center;
  color: #166c9e;
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.rich-notice-scroll h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.3rem, 4.8vw, 2rem);
  line-height: 1.12;
}

.rich-notice-copy {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px;
  color: #314453;
  font-size: clamp(0.9rem, 3.4vw, 1.05rem);
  line-height: 1.5;
  text-align: left;
  scrollbar-width: thin;
}

.rich-notice-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 74%);
  gap: 7px;
  min-height: 0;
  margin: 0 0 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.rich-notice-gallery::-webkit-scrollbar { display: none; }

.rich-notice-gallery figure {
  position: relative;
  min-height: 118px;
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
  background: #d7e9f2;
  scroll-snap-align: center;
}

.rich-notice-gallery img {
  width: 100%;
  height: 118px;
  object-fit: cover;
}

.rich-notice-gallery figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 8px 7px;
  color: #fff;
  background: linear-gradient(transparent, rgba(4, 20, 30, 0.88));
  text-align: left;
}

.rich-notice-gallery strong,
.rich-notice-gallery span { display: block; }
.rich-notice-gallery strong { font-size: 0.8rem; }
.rich-notice-gallery span { margin-top: 1px; font-size: 0.65rem; opacity: 0.86; }

.rich-notice-copy h2,
.rich-notice-copy h3 {
  margin: 0 0 8px;
  color: #19394e;
  font-size: 1.08em;
  text-align: center;
}

.rich-notice-copy p,
.rich-notice-copy ul,
.rich-notice-copy ol,
.rich-notice-copy blockquote {
  margin: 0 0 10px;
}

.rich-notice-copy ul,
.rich-notice-copy ol {
  padding-left: 22px;
}

.rich-notice-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.rich-notice-primary,
.rich-notice-secondary,
.rich-notice-close {
  min-height: 42px;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.rich-notice-primary,
.rich-notice-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 700;
}

.rich-notice-primary {
  color: #fff;
  background: #147fb8;
  box-shadow: 0 7px 16px rgba(20, 127, 184, 0.22);
}

.rich-notice-secondary {
  color: #315065;
  background: rgba(255, 255, 255, 0.66);
}

.rich-notice-close {
  position: absolute;
  z-index: 2;
  top: 10%;
  right: 9%;
  width: 42px;
  padding: 0;
  border-radius: 50%;
  color: #315065;
  background: rgba(255, 255, 255, 0.72);
}

.theme-security .rich-notice-kicker { color: #b0433d; }
.theme-security .rich-notice-primary { background: #b0433d; box-shadow-color: rgba(176, 67, 61, 0.24); }
.theme-academy .rich-notice-kicker,
.theme-celebration .rich-notice-kicker { color: #9b6e0e; }
.theme-academy .rich-notice-primary,
.theme-celebration .rich-notice-primary { background: #a77913; box-shadow-color: rgba(167, 121, 19, 0.24); }

.protected-media-pending {
  width: 100%;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.protected-media-pending .media-icon ion-icon {
  font-size: 1.2rem;
}

@media (orientation: landscape) and (min-width: 720px) {
  .rich-notice-scroll {
    width: min(92vw, 1180px);
    max-height: 92vh;
    aspect-ratio: 1792 / 1024;
    background-image: url("../assets/eagle-notice-scroll-landscape.png");
  }

  .rich-notice-inner {
    inset: 23% 15% 22%;
  }

  .rich-notice-scroll h1 {
    font-size: clamp(1.45rem, 3vw, 2.4rem);
  }

  .rich-notice-copy {
    font-size: clamp(0.9rem, 1.55vw, 1.12rem);
  }

  .rich-notice-gallery {
    grid-auto-columns: 1fr;
    grid-template-columns: repeat(3, 1fr);
  }

  .rich-notice-close {
    top: 12%;
    right: 9%;
  }
}

@media (max-height: 650px) and (orientation: portrait) {
  .rich-notice-scroll { width: min(78vw, 390px); }
  .rich-notice-inner { inset: 17% 15% 10%; }
  .rich-notice-copy { font-size: 0.82rem; line-height: 1.38; }
}

@keyframes notice-unroll {
  from { opacity: 0; transform: translateY(-18px) scaleY(0.72); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .rich-notice-scroll.animation-unroll { animation: none; }
}

@media (max-width: 760px) {
  html,
  body,
  #app,
  body.dw-window.dw-web-platform > #app {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
  }

  body {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .shell,
  .shell.with-inspector {
    width: 100%;
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .detail {
    grid-area: 1 / 1;
    width: 100%;
  }

  .shell.mobile-list .detail,
  .shell.mobile-detail .sidebar {
    display: none;
  }

  .shell.with-inspector .inspector {
    position: fixed;
    z-index: 30;
    inset: 0;
    width: 100%;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-shadow: none;
  }

  .inspector-heading {
    top: calc(-1 * max(16px, env(safe-area-inset-top)));
    margin: 0 calc(-1 * max(16px, env(safe-area-inset-right))) 0 calc(-1 * max(16px, env(safe-area-inset-left)));
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  }

  .topbar {
    min-height: 68px;
    padding: max(12px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  }

  .topbar h2 {
    font-size: 20px;
  }

  .topbar-actions,
  .header-actions {
    gap: 1px;
  }

  .topbar-actions .icon-button,
  .topbar-actions .admin-entry,
  .header-actions .icon-button,
  .mobile-chat-back {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .search-wrap {
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .chat-list {
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .chat-row {
    min-height: 72px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .mobile-chat-back {
    display: grid;
  }

  .chat-header {
    min-height: 64px;
    justify-content: initial;
    gap: 4px;
    padding: max(8px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) 8px max(5px, env(safe-area-inset-left));
  }

  .conversation-identity {
    flex: 1 1 auto;
    gap: 8px;
    overflow: hidden;
  }

  .conversation-identity .avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .conversation-identity h2,
  .conversation-identity p {
    max-width: none;
  }

  .conversation-identity h2 {
    font-size: 16px;
  }

  .messages {
    padding: 14px max(10px, env(safe-area-inset-right)) 12px max(10px, env(safe-area-inset-left));
    overscroll-behavior: contain;
  }

  .bubble {
    max-width: 88%;
  }

  .bubble.image-bubble {
    width: min(360px, 92%);
    max-width: 92%;
  }

  .composer {
    grid-template-columns: 36px 36px 36px minmax(0, 1fr) 36px 36px 42px;
    grid-template-areas:
      "field field field field field field field"
      "attach poll form spacer voice location send";
    gap: 4px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .composer > :nth-child(1) { grid-area: attach; }
  .composer > :nth-child(2) { grid-area: poll; }
  .composer > :nth-child(3) { grid-area: form; }
  .composer-field { grid-area: field; }
  .composer > :nth-child(5) { grid-area: voice; }
  .composer > :nth-child(6) { grid-area: location; }
  .composer > :nth-child(7) { grid-area: send; }

  .composer > .icon-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .composer > .send-button {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 32px 34px 34px 36px;
  }

  .composer-input {
    min-height: 44px;
    max-height: 92px;
  }

  .modal-backdrop,
  .rich-notice-backdrop {
    min-height: 100dvh;
  }
}
