:root {
  --bg: #f5f8f9;
  --surface: #ffffff;
  --surface-soft: #f0f4f5;
  --ink: #18252b;
  --muted: #65757b;
  --line: #dce5e7;
  --accent: #006d77;
  --accent-strong: #006d77;
  --accent-soft: #e6f0f1;
  --theme-secondary: #ff6b6b;
  --theme-secondary-soft: #ffeded;
  --theme-on-secondary: #1c1c1c;
  --blue: var(--accent);
  --green: var(--blue);
  --green-strong: var(--accent-strong);
  --soft-green: var(--accent-soft);
  --gold: var(--accent-strong);
  --red: var(--accent-strong);
  --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;
  letter-spacing: 0;
}

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: 22px;
  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: 0;
  overflow: auto;
  padding: 0 10px 14px;
}

.chat-row {
  position: relative;
  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: var(--soft-green);
}

.chat-row:hover:not(.active) {
  background: var(--surface-soft);
}

.chat-row:active {
  background: var(--soft-green);
  transform: none;
}

.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: 600;
}

.chat-row.is-unread .row-title { font-weight: 700; }
.chat-row.is-unread .row-meta small { color: var(--blue); font-weight: 600; }
.row-indicators { display: flex; align-items: center; justify-content: end; gap: 5px; min-height: 20px; }
.row-pin { display: flex; color: var(--muted); }
.row-pin ion-icon { width: 13px; height: 13px; }

.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-top {
  position: relative;
  z-index: 3;
  min-width: 0;
  background: var(--surface);
}

.message-search-bar {
  min-height: 48px;
  display: grid;
  grid-template-columns: 20px minmax(120px, 1fr) auto 40px 40px 40px;
  gap: 6px;
  align-items: center;
  padding: 6px 12px 8px 18px;
  border-top: 1px solid rgba(18, 95, 123, 0.08);
  border-bottom: 1px solid rgba(18, 95, 123, 0.12);
  background: rgba(251, 253, 254, 0.98);
}

.message-search-bar[hidden] {
  display: none;
}

.message-search-bar input,
.message-search-bar select {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  outline: 1px solid rgba(18, 95, 123, 0.18);
  color: var(--ink);
  background: #fff;
}

.message-search-bar input:focus,
.message-search-bar select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent);
}

.message-search-bar select {
  grid-column: 2 / -1;
  width: 100%;
  text-overflow: ellipsis;
}

.message-search-bar > span {
  min-width: 68px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.chat-local-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.local-segments { display: flex; flex: 1; gap: 0; min-width: 0; }
.local-segments button {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
}
.local-segments button[aria-pressed="true"] { color: var(--green-strong); border-bottom-color: var(--blue); background: transparent; font-weight: 700; }
.message-kind-filter { grid-column: 2 / -1; }
.message-search-text {
  color: var(--theme-on-secondary);
  background: var(--theme-secondary);
  border-radius: 2px;
  padding: 0;
  font: inherit;
  text-decoration: inherit;
}
.message-search-current .message-search-text { background: var(--theme-secondary); }
.chat-draft-label { color: var(--accent-strong); font-weight: 700; }
.chat-local-tools .icon-button { position: relative; }
.local-followup-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  padding: 1px 3px;
  border-radius: 4px;
  color: #fff;
  background: var(--accent-strong);
  font-size: 10px;
}
.composer-local-status, .local-error { padding: 8px 12px; color: var(--accent-strong); font-size: 12px; overflow-wrap: anywhere; }
.communication-local-dialog {
  width: min(540px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 48px #16374333;
  overflow: auto;
}
.communication-local-dialog::backdrop { background: #112b3b66; }
.communication-local-dialog header { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.communication-local-dialog h2 { flex: 1; min-width: 0; margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.communication-local-row { display: flex; align-items: center; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.local-row-main { flex: 1; min-width: 0; padding: 4px; text-align: left; background: transparent; color: inherit; font: inherit; }
.local-row-main strong, .local-row-main span, .local-row-main small { display: block; overflow-wrap: anywhere; }
.local-row-main span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin-top: 4px; white-space: pre-wrap; font-size: 13px; }
.local-row-main small { margin-top: 4px; color: var(--muted); }
.communication-local-row .icon-button, .communication-local-dialog header .icon-button { flex: 0 0 36px; width: 36px; height: 36px; }
.local-empty { color: var(--muted); padding: 20px 4px; }
.quick-reply-editor { display: grid; gap: 14px; padding-top: 12px; }
.quick-reply-editor label { display: grid; gap: 6px; font-size: 13px; }
.quick-reply-editor .field { width: 100%; min-width: 0; box-sizing: border-box; }
.quick-reply-editor textarea { resize: vertical; }
.local-editor-actions { display: flex; justify-content: end; gap: 8px; }
.communication-local-dialog :focus-visible, .local-segments button:focus-visible { outline: 2px solid var(--green-strong); outline-offset: 2px; }

.conversation-scroll-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.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 {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 22px clamp(18px, 4vw, 56px);
}

.jump-latest {
  position: absolute;
  right: clamp(14px, 3vw, 32px);
  bottom: 14px;
  z-index: 4;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(18, 75, 100, 0.28);
  cursor: pointer;
}

.jump-latest[hidden] {
  display: none;
}

.jump-latest ion-icon {
  width: 21px;
  height: 21px;
}

.bubble {
  position: relative;
  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: var(--soft-green);
}

#messages .bubble.message-search-match {
  box-shadow: 0 0 0 2px rgba(236, 179, 58, 0.46), 0 3px 12px rgba(21, 66, 82, 0.08);
}

#messages .bubble.message-search-current {
  background: #fff4c9;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 58%, transparent), 0 8px 20px rgba(21, 66, 82, 0.13);
}

.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: color-mix(in srgb, var(--accent) 12%, transparent);
}

.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: color-mix(in srgb, var(--accent) 8%, transparent);
  text-decoration: none;
}

.media-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  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;
}

.bubble > .media-card {
  min-width: 0;
  min-height: 44px;
  gap: 8px;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
}

.bubble > .body-text + .media-card {
  margin-top: 6px;
}

.bubble > .media-card .media-file-icon {
  border-radius: 0;
  background: transparent;
}

.bubble > .media-card small {
  color: var(--muted);
  opacity: 1;
}

.media-preview {
  width: min(340px, 58vw);
  display: block;
  overflow: hidden;
  margin-top: 8px;
  border-radius: 8px;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  text-decoration: none;
}

.media-file-icon {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
}

.media-file-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

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: var(--bg);
}

.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: 0;
  max-height: 430px;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: var(--bg);
}

.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: color-mix(in srgb, var(--accent) 7%, transparent);
  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: color-mix(in srgb, var(--accent) 18%, transparent);
}

.view-once-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-strong);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.bubble.mine .view-once-icon {
  color: var(--green-strong);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.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);
}

.message-actions:focus-within {
  display: flex;
}

@media (hover: hover) and (pointer: fine) {
  .bubble:hover .message-actions { 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: color-mix(in srgb, var(--accent) 8%, transparent);
  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(0, 1fr) 40px 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(--accent);
}

.inline-priority {
  width: 36px;
  height: 40px;
  color: var(--muted);
}

.inline-priority.active {
  color: var(--red);
  background: var(--accent-soft);
}

.inline-view-once {
  width: 36px;
  height: 40px;
  color: var(--muted);
}

.inline-view-once.active {
  color: var(--red);
  background: var(--accent-soft);
}

.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: var(--green-strong);
}

.receipt.sending {
  color: var(--green-strong);
  opacity: 0.72;
}

.receipt.delivered {
  color: var(--accent-strong);
}

.receipt.read {
  color: var(--green-strong);
  opacity: 1;
}

.receipt.translated {
  color: var(--green-strong);
  opacity: 1;
}

.receipt.retry {
  color: var(--red);
  cursor: pointer;
  opacity: 1;
}

.receipt.retry:hover,
.receipt.retry:focus-visible {
  color: var(--accent-strong);
}

.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: 4px;
  padding: 16px 0;
  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;
}

.composer:not(.compact-composer) > .quick-replies-button { grid-column: 7; grid-row: 1; }
.composer:not(.compact-composer) > .send-button { grid-column: 8; grid-row: 1; }

.owner-controls {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.owner-metric {
  min-width: 0;
  min-height: 70px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 6px;
  padding: 9px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.owner-metric span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--green-strong);
}

.owner-metric strong {
  min-width: 0;
  font-size: 18px;
  line-height: 1.1;
}

.owner-metric small,
.owner-capability-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.owner-assignments summary {
  min-height: 48px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.owner-assignments summary::-webkit-details-marker { display: none; }
.owner-assignments summary > span strong,
.owner-assignments summary > span small { display: block; }
.owner-assignments summary > span small { color: var(--muted); font-size: 11px; }

.owner-user-search { margin: 8px 0; }
.owner-capability-note { margin: 0 2px 8px; }
.owner-feature-list { display: grid; }

.owner-feature-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 36px;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}

.owner-feature-row:last-child { border-bottom: 0; }
.owner-feature-platform { display: grid; justify-items: center; color: var(--green-strong); }
.owner-feature-platform small { color: var(--muted); font-size: 9px; }

.owner-feature-pagination {
  min-height: 42px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.owner-feature-pagination .status { margin: 0; text-align: center; }

@media (max-width: 460px) {
  .owner-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.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: var(--accent-strong);
  background: var(--accent-soft);
}

.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;
  width: 232px;
  min-width: 0;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(32 41 54 / 16%);
  animation: communicator-menu-in 100ms ease-out;
}

.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: var(--accent-soft);
}

.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: var(--bg);
}

.dw-main-window .sidebar {
  position: relative;
  z-index: 3;
  border-right: 1px solid rgba(18, 95, 123, 0.14);
  background: var(--surface);
  box-shadow: none;
}

.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: var(--soft-green);
  box-shadow: inset 2px 0 var(--blue);
}

.dw-main-window .chat-row.active .row-meta small {
  color: var(--muted);
}

.dw-main-window .avatar {
  background: var(--accent);
  box-shadow: none;
}

.dw-main-window .avatar.pinned {
  background: var(--blue);
}

.dw-main-window .detail {
  background: var(--bg);
}

.dw-main-window .chat-header {
  min-height: 70px;
  border-bottom: 1px solid rgba(18, 95, 123, 0.12);
  background: var(--surface);
  box-shadow: none;
}

.dw-main-window .messages {
  background: var(--bg);
  scrollbar-color: #bdc7d4 transparent;
}

.dw-main-window .bubble {
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(32 41 54 / 6%);
}

.dw-main-window .bubble.mine {
  background: var(--soft-green);
}

.dw-main-window .inspector {
  border-left: 1px solid rgba(18, 95, 123, 0.14);
  background: var(--surface);
  box-shadow: none;
}

.dw-main-window .composer {
  border-top: 1px solid rgba(18, 95, 123, 0.12);
  background: var(--surface);
  box-shadow: none;
}

.dw-main-window .composer-field {
  background: var(--surface-soft);
}

.dw-main-window .composer-field:focus-within {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgb(8 124 229 / 20%);
}

.dw-main-window .send-button {
  color: #ffffff;
  background: var(--blue);
  box-shadow: none;
}

.dw-main-window .badge {
  background: var(--blue);
}

.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: var(--accent-strong);
}

.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: var(--accent-soft);
}

.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: var(--accent-soft);
}

.notice-history-icon.theme-academy {
  color: var(--green-strong);
  background: var(--soft-green);
}

.notice-history-icon.theme-security {
  color: var(--green-strong);
  background: var(--soft-green);
}

.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: var(--accent-soft);
}

.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: 0;
  overflow: hidden;
  background: var(--bg);
  transition: inset 180ms ease, border-radius 180ms ease, box-shadow 180ms ease;
}

.miniapp-runtime.is-reduced {
  inset: max(58px, calc(var(--dw-titlebar-height, 0px) + 18px)) clamp(18px, 4vw, 64px) clamp(18px, 4vh, 48px);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(9, 35, 49, 0.34);
}

.miniapp-runtime iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

.miniapp-runtime-controls {
  position: absolute;
  z-index: 3;
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(8, 31, 43, 0.42);
  backdrop-filter: blur(10px);
}

.miniapp-runtime-controls button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #102938;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0.82;
  cursor: pointer;
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.miniapp-runtime-controls button:hover,
.miniapp-runtime-controls button:focus-visible {
  background: #fff;
  opacity: 1;
  transform: translateY(-1px);
}

.miniapp-runtime-controls ion-icon {
  width: 21px;
  height: 21px;
}

/* 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: var(--accent-strong);
  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: var(--accent-strong);
  background: var(--accent-soft);
  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: var(--accent-soft);
}

.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: var(--green-strong);
  background: var(--soft-green);
}

.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: var(--accent-strong);
}

.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: var(--accent-strong);
  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: var(--accent-soft);
}

.onboarding-choice-icon ion-icon {
  font-size: 22px;
}

.onboarding-choice-icon.ready {
  color: var(--green-strong);
  background: var(--soft-green);
}

.onboarding-choice-icon.installed {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.onboarding-choice-icon.working ion-icon {
  animation: model-status-spin 1.1s linear infinite;
}

.onboarding-choice-icon.error {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.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: var(--accent-strong);
  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: var(--accent-strong);
  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: var(--accent-strong);
  font-size: 15px;
}

.tutorial-translation ion-icon {
  flex: 0 0 auto;
  margin-top: 2px;
}

.tutorial-receipt {
  width: min(520px, 86%);
  margin-top: 7px;
  color: var(--accent-strong);
  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: var(--accent-strong);
  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: var(--accent-strong);
  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: var(--accent-strong);
}

.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: var(--accent-strong);
  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: var(--accent-strong);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--accent) 22%, transparent);
}

.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), (max-width: 1100px) and (pointer: coarse) {
  html,
  body,
  #app,
  body.dw-window.dw-web-platform > #app {
    width: 100%;
    min-height: 0;
    height: var(--app-viewport-height, 100dvh);
  }

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

  .shell,
  .shell.with-inspector {
    width: 100%;
    height: 100%;
    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));
  }

  .message-search-bar {
    grid-template-columns: 18px minmax(80px, 1fr) auto 40px 40px 40px;
    gap: 3px;
    padding: 6px max(6px, env(safe-area-inset-right)) 7px max(9px, env(safe-area-inset-left));
  }

  .message-search-bar > span {
    min-width: 54px;
    font-size: 11px;
  }

  .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 quick 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:not(.compact-composer) > :nth-child(1) { grid-area: attach; }
  .composer:not(.compact-composer) > :nth-child(2) { grid-area: poll; }
  .composer:not(.compact-composer) > :nth-child(3) { grid-area: form; }
  .composer-field { grid-area: field; }
  .composer:not(.compact-composer) > :nth-child(5) { grid-area: voice; }
  .composer:not(.compact-composer) > :nth-child(6) { grid-area: location; }
  .composer:not(.compact-composer) > :nth-child(7) { grid-area: send; }
  .composer > .quick-replies-button { grid-area: quick; justify-self: center; }

  .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 36px 36px 40px;
  }

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

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

/* One visible viewport: the header and composer never belong to the message scroller. */
@media (max-width: 760px), (max-width: 1100px) and (pointer: coarse) {
  body.dw-window.dw-web-platform { min-height: 0; }
  body.dw-window.dw-web-platform > #app {
    position: fixed; top: var(--app-viewport-top, 0px); left: 0; padding: 0;
    height: var(--app-viewport-height, 100dvh); min-height: 0;
  }
  .dw-main-window .detail { grid-template-rows: auto minmax(0, 1fr) auto; }
  .conversation-top { z-index: 4; min-width: 0; }
  .conversation-scroll-stage, .messages { min-height: 0; }
  .shell.with-inspector .inspector {
    position: absolute; inset: 0; height: 100%; max-height: 100%;
    padding: 0 max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .inspector-heading {
    top: 0; min-height: 56px; gap: 4px;
    margin: 0 calc(-1 * max(12px, env(safe-area-inset-right))) 8px calc(-1 * max(12px, env(safe-area-inset-left)));
    padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  }
  .inspector-heading h2 { font-size: 18px; margin: 0; }
  .inspector-heading p { display: none; }
  .inspector[data-view="group-create"] > .group-composer,
  .inspector[data-view="group-invite"] > .group-composer { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .inspector[data-view="group-create"] > .group-composer > .admin-title > div h3 { display: none; }
  .dw-main-window .topbar, .dw-main-window .chat-header {
    min-height: 56px; padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) 6px max(6px, env(safe-area-inset-left));
  }
  .topbar h2 { font-size: 18px; }
  .topbar p { margin: 2px 0 0; font-size: 11px; }
  .topbar-actions .icon-button, .topbar-actions .admin-entry, .mobile-chat-back,
  .inspector .icon-button { width: 44px; height: 44px; min-width: 44px; flex: 0 0 44px; }
  .topbar-actions ion-icon, .mobile-chat-back ion-icon, .inspector .icon-button ion-icon { width: 20px; height: 20px; font-size: 20px; }
  .chat-row { min-height: 64px; padding-top: 8px; padding-bottom: 8px; grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .chat-row .avatar { width: 44px; height: 44px; }
  .conversation-identity { gap: 6px; }
  .conversation-identity .avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .conversation-identity h2 { font-size: 15px; }
  .conversation-identity p { font-size: 11px; }
  body.dw-main-window input:not([type="checkbox"]):not([type="radio"]),
  body.dw-main-window textarea, body.dw-main-window select, body.dw-main-window [contenteditable="true"] { font-size: 16px; }
  .dw-main-window .modal-backdrop, .dw-main-window .rich-notice-backdrop {
    top: var(--app-viewport-top, 0px); bottom: auto; min-height: 0; height: var(--app-viewport-height, 100dvh);
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .dw-main-window dialog[open] {
    position: fixed; top: var(--app-viewport-top, 0px); bottom: auto; margin-top: 8px;
    max-height: calc(var(--app-viewport-height, 100dvh) - 16px);
  }
  .dw-main-window .discovery-body { max-height: calc(var(--app-viewport-height, 100dvh) - 160px); }
  .dw-main-window .chat-tools-menu { max-height: min(420px, calc(var(--app-viewport-height, 100dvh) - 160px)); }
  .dw-keyboard-open .compact-composer { padding-bottom: 6px; }
  .dw-keyboard-open .compact-composer .composer-input { max-height: 72px; }
  .dw-keyboard-open .draft-translation, .dw-keyboard-open .writing-review { max-height: 64px; overflow-y: auto; }
  .rich-toolbar { flex-wrap: wrap; }
}

/* Chat commands share one glyph scale; touch increases the hit area, not the icon. */
.compact-composer { grid-template-columns: 36px minmax(0, 1fr) 36px 36px; grid-template-areas: "tools field voice send"; gap: 6px; align-items: end; }
.compact-composer > .composer-tools-anchor { grid-area: tools; }
.compact-composer > .composer-field { grid-area: field; }
.compact-composer > [data-action="voice-note"] { grid-area: voice; }
.compact-composer > .send-button { grid-area: send; }
.compact-composer .composer-row { display: flex; align-items: end; }
.compact-composer .composer-input { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 10px 12px; }
.compact-composer .composer-field { border-radius: 8px; }
.compact-composer .icon-button, .compact-composer > .send-button,
.chat-header .header-actions .icon-button { width: 32px; height: 32px; min-width: 32px; flex: 0 0 32px; border-radius: 6px; }
.compact-composer .icon-button[hidden] { display: none; }
.compact-composer ion-icon, .chat-header .header-actions ion-icon,
.chat-tools-menu ion-icon, .chat-catch-up ion-icon { width: 18px; height: 18px; flex: 0 0 18px; font-size: 18px; }
.chat-header .header-actions { gap: 2px; }
.conversation-identity > div { min-width: 0; }
.chat-menu-anchor { position: relative; }
.chat-tools-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 50; width: 228px; max-width: calc(100vw - 24px); max-height: min(420px, 60dvh); overflow: auto; padding: 4px; border: 1px solid #c9d8df; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #102e3d26; }
.chat-tools-menu[hidden] { display: none; }
.chat-more-menu { top: calc(100% + 8px); bottom: auto; right: 0; left: auto; }
.chat-tools-menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 4px; color: var(--ink); background: transparent; font: inherit; font-size: 13px; text-align: left; }
.chat-tools-menu button span { min-width: 0; overflow-wrap: anywhere; }
.chat-tools-menu button:hover, .chat-tools-menu button:focus-visible { background: var(--accent-soft); }
.chat-tools-menu [aria-checked="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.chat-tools-menu button:focus-visible, .compact-composer button:focus-visible,
.chat-catch-up a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: -2px; }
.composer-modes { padding: 5px 10px 0; color: var(--accent-strong); font-size: 11px; font-weight: 600; }
.composer-modes[hidden] { display: none; }
.chat-catch-up { width: min(540px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 32px)); padding: 0; border: 1px solid #c9d8df; border-radius: 8px; color: var(--ink); background: var(--surface); }
.chat-catch-up[open] { display: flex; flex-direction: column; }
.chat-catch-up::backdrop { background: #132b4166; }
.chat-catch-up header { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-catch-up header > div { flex: 1; min-width: 0; }
.chat-catch-up h2 { margin: 0; font-size: 18px; }
.chat-catch-up header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.catch-up-body { min-height: 0; overflow-y: auto; padding: 0 16px; }
.catch-up-body section { padding: 12px 0; }
.catch-up-body section + section { border-top: 1px solid var(--line); }
.catch-up-body h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.catch-up-body h3 span { color: var(--muted); font-weight: 400; }
.catch-up-body ul { list-style: none; margin: 0; padding: 0; }
.catch-up-body li + li { border-top: 1px solid var(--line); }
.catch-up-body a { display: block; padding: 10px 4px; color: inherit; text-decoration: none; border-radius: 4px; }
.catch-up-body a:hover { background: var(--surface-soft); }
.catch-up-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.catch-up-meta time { margin-left: auto; font-size: 10px; }
.catch-up-meta ion-icon { margin-left: auto; }
.catch-up-excerpt { display: block; margin-top: 4px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.catch-up-empty, .catch-up-status { color: var(--muted); font-size: 12px; line-height: 1.45; }
.catch-up-empty { margin: 4px 0; }
.catch-up-status { flex: 0 0 auto; margin: 0; padding: 8px 16px; overflow-wrap: anywhere; }
.catch-up-status:empty { display: none; }
.chat-catch-up .icon-button { width: 32px; height: 32px; min-width: 32px; flex-basis: 32px; border-radius: 6px; }
.chat-conversation-tools { width: min(560px, calc(100vw - 24px)); max-height: min(780px, calc(100dvh - 24px)); padding: 0; border: 1px solid #c9d8df; border-radius: 8px; color: var(--ink); background: var(--surface); }
.chat-conversation-tools[open] { display: flex; flex-direction: column; }
.chat-conversation-tools::backdrop { background: #132b4166; }
.chat-conversation-tools > header { display: flex; align-items: center; gap: 4px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-conversation-tools header > div { flex: 1; min-width: 0; }
.chat-conversation-tools h2 { margin: 0; font-size: 18px; }
.chat-conversation-tools header p { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chat-conversation-tools .icon-button, .chat-conversation-tools .send-button { width: 32px; height: 32px; min-width: 32px; flex: 0 0 32px; border-radius: 6px; }
.chat-conversation-tools ion-icon { width: 18px; height: 18px; font-size: 18px; }
.conversation-tools-status { margin: 0; padding: 8px 16px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.conversation-tools-status:empty { display: none; }
.conversation-tools-status.is-error, .schedule-error { color: var(--accent-strong); }
.conversation-tools-retry { margin: 0 16px 8px; align-self: start; }
.conversation-tools-body { min-height: 40px; overflow-y: auto; padding: 0 16px; }
.topic-root { padding: 12px 0; border-bottom: 2px solid var(--line); }
.topic-message-meta { margin: 0 0 6px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.topic-message-text, .scheduled-list p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.topic-replies, .scheduled-list { list-style: none; margin: 0; padding: 0; }
.topic-replies li, .scheduled-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.topic-reply-form { display: flex; gap: 8px; align-items: end; padding: 12px 16px; border-top: 1px solid var(--line); }
.topic-reply-form textarea { flex: 1; min-width: 0; resize: vertical; max-height: 150px; }
.chat-conversation-tools textarea, .chat-conversation-tools input { box-sizing: border-box; max-width: 100%; border: 1px solid #becdd5; border-radius: 6px; padding: 8px 10px; color: var(--ink); background: var(--surface); font: inherit; font-size: 14px; }
.schedule-form { padding: 12px 16px; border-top: 1px solid var(--line); overflow-y: auto; }
.schedule-form label { display: grid; gap: 5px; margin-bottom: 10px; font-size: 12px; }
.schedule-form textarea { width: 100%; min-height: 76px; max-height: 160px; resize: vertical; }
.chat-conversation-tools footer { display: flex; justify-content: end; gap: 8px; padding: 8px 16px; }
.schedule-form footer { padding: 0; }
.scheduled-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
.scheduled-actions { display: flex; justify-content: end; gap: 4px; margin-top: 6px; }
.conversation-tools-empty { color: var(--muted); font-size: 12px; }
.chat-conversation-tools button:focus-visible, .chat-conversation-tools input:focus-visible, .chat-conversation-tools textarea:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.voice-transcribe-button { display: inline-grid; vertical-align: middle; width: 28px; height: 28px; min-width: 28px; margin-left: 6px; border-radius: 6px; }
.voice-transcribe-button ion-icon, .private-voice-transcript ion-icon, .chat-voice-transcript ion-icon { width: 18px; height: 18px; font-size: 18px; }
.private-voice-transcript { margin-top: 6px; border-top: 1px solid var(--line); }
.private-voice-transcript summary { padding: 8px 0 2px; color: var(--green-strong); cursor: pointer; font-size: 12px; }
.private-voice-transcript summary ion-icon { vertical-align: middle; }
.voice-local-text { margin: 6px 0; max-height: 220px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.chat-voice-transcript { width: min(520px, calc(100vw - 24px)); max-height: min(740px, calc(100dvh - 24px)); padding: 0; border: 1px solid #c9d8df; border-radius: 8px; color: var(--ink); background: var(--surface); }
.chat-voice-transcript[open] { display: flex; flex-direction: column; }
.chat-voice-transcript::backdrop { background: #132b4166; }
.chat-voice-transcript header { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-voice-transcript header > div { flex: 1; min-width: 0; }
.chat-voice-transcript h2 { margin: 0; font-size: 18px; }
.chat-voice-transcript header p { margin: 4px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chat-voice-transcript .icon-button { width: 32px; height: 32px; min-width: 32px; flex-basis: 32px; border-radius: 6px; }
.voice-transcript-body { padding: 12px 16px; min-height: 0; overflow-y: auto; }
.voice-transcript-body > label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.voice-transcript-body select { max-width: 55%; padding: 5px; border: 1px solid #becdd5; border-radius: 4px; color: var(--ink); background: var(--surface); }
.voice-transcript-body h3 { font-size: 12px; margin: 16px 0 6px; }
.voice-transcript-body h3 span { color: var(--muted); float: right; font-weight: 400; }
.voice-transcript-text { margin: 0; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-transcript-status, .voice-model-prompt { color: var(--muted); font-size: 12px; }
.voice-transcript-status:empty, .voice-transcript-body progress[hidden] { display: none; }
.voice-transcript-body progress { width: 100%; }
.chat-voice-transcript footer { display: flex; justify-content: end; gap: 6px; padding: 8px 16px; border-top: 1px solid var(--line); }
.chat-voice-transcript button:focus-visible, .voice-transcribe-button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
@media (max-width: 760px), (pointer: coarse) {
  .compact-composer { grid-template-columns: 44px minmax(0, 1fr) 44px 44px; grid-template-areas: "tools field voice send"; padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .compact-composer .icon-button, .compact-composer > .send-button,
  .chat-header .header-actions .icon-button { width: 44px; height: 44px; min-width: 44px; flex-basis: 44px; }
  .compact-composer .composer-input { min-height: 44px; padding-top: 12px; }
  .chat-tools-menu button { min-height: 44px; }
  .compact-composer .rich-tool { width: 36px; height: 44px; }
  .chat-header .header-actions { gap: 0; }
  .chat-conversation-tools .icon-button, .chat-conversation-tools .send-button { width: 44px; height: 44px; min-width: 44px; flex-basis: 44px; }
  .voice-transcribe-button, .chat-voice-transcript .icon-button { width: 44px; height: 44px; min-width: 44px; flex-basis: 44px; }
  .chat-catch-up .icon-button { width: 44px; height: 44px; min-width: 44px; flex-basis: 44px; }
}
.app-startup {min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:#f7fcff;color:#355362;font-size:14px;}
.app-startup img {width:96px;height:96px;object-fit:contain;}
.contact-form.discovery-directory-form {grid-template-columns:minmax(0,1fr) 44px 44px;}

.chat-discovery {
  width:min(560px,calc(100% - 24px));max-height:min(780px,calc(100dvh - 32px));padding:0;
  color:var(--ink, #163745);background:var(--surface, #ffffff);border:1px solid #b9cdd6;border-radius:8px;
}
.chat-discovery::backdrop {background:#061b2b80;}
.chat-discovery > header {display:flex;align-items:center;gap:4px;padding:12px 14px;border-bottom:1px solid #dbe6eb;}
.chat-discovery h2 {font-size:18px;line-height:1.3;margin:0;flex:1;min-width:0;overflow-wrap:anywhere;}
.chat-discovery h3 {font-size:14px;margin:14px 0 6px;}
.chat-discovery .icon-button {width:32px;height:32px;min-width:32px;flex-shrink:0;padding:5px;}
.chat-discovery ion-icon {width:20px;height:20px;flex-shrink:0;}
.discovery-body {max-height:calc(100dvh - 200px);overflow-y:auto;padding:0 14px 14px;}
.discovery-status {margin:0;padding:6px 14px;min-height:28px;font-size:13px;color:#416575;}
.discovery-status.is-error {color:var(--accent-strong);}
.discovery-tabs {display:flex;gap:4px;border-bottom:1px solid #dbe6eb;margin-bottom:10px;}
.discovery-tabs button {flex:1;min-width:0;padding:8px 4px;border:0;border-bottom:2px solid transparent;background:none;font-size:13px;color:inherit;cursor:pointer;}
.discovery-tabs [aria-selected="true"] {border-color:var(--accent-strong);color:var(--accent-strong);font-weight:650;}
.discovery-search {display:flex;align-items:center;gap:6px;}
.chat-discovery input:not([type="checkbox"]),.chat-discovery select {width:100%;min-width:0;padding:8px 10px;border:1px solid #b9cdd6;border-radius:4px;font:inherit;font-size:14px;background:#fff;color:#163745;}
.discovery-list {list-style:none;margin:0;padding:0;}
.discovery-list > li {display:flex;gap:10px;align-items:center;min-height:62px;padding:10px 0;border-bottom:1px solid #e1e9ed;}
.discovery-avatar {display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;color:var(--accent-strong);background:var(--accent-soft);border-radius:50%;}
.discovery-copy {display:grid;gap:4px;flex:1;min-width:0;overflow-wrap:anywhere;}
.discovery-copy strong {font-size:14px;line-height:1.35;}
.discovery-copy small {font-size:12px;color:#58707a;}
.discovery-actions {display:flex;align-items:center;justify-content:center;gap:4px;flex-shrink:0;}
.discovery-empty {font-size:13px;color:#58707a;padding:14px 0;margin:0;}
.discovery-more,.discovery-retry {margin:10px 0;}
.discovery-retry {margin-left:14px;}
.discovery-visibility {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 0 14px;font-size:14px;}
.discovery-visibility input {width:18px;height:18px;accent-color:var(--accent-strong);}
.discovery-invite-create {display:flex;align-items:end;gap:10px;padding:8px 0;}
.discovery-invite-create label {flex:1;min-width:0;}
.discovery-link label,.discovery-invite-create label {display:grid;gap:6px;font-size:13px;}
.discovery-invite-create button {display:flex;align-items:center;justify-content:center;gap:6px;min-height:36px;}
.discovery-qr {display:grid;justify-items:center;gap:8px;margin:14px 0;}
.discovery-qr img {display:block;width:min(240px,100%);aspect-ratio:1;image-rendering:pixelated;}
.discovery-qr figcaption {font-size:12px;color:#58707a;}
.discovery-preview {padding:16px 0;text-align:center;}
.discovery-preview > ion-icon {width:32px;height:32px;color:var(--accent-strong);}
.discovery-preview p {font-size:13px;overflow-wrap:anywhere;}
.discovery-link {display:grid;gap:14px;padding:10px 0;}
.chat-discovery > footer {display:flex;justify-content:flex-end;padding:10px 14px;border-top:1px solid #dbe6eb;}
@media (max-width:600px),(pointer:coarse) {
  .chat-discovery .icon-button {width:44px;height:44px;min-width:44px;padding:10px;}
  .chat-discovery button:not(.icon-button),.chat-discovery input:not([type="checkbox"]),.chat-discovery select {min-height:44px;}
  .chat-discovery > header {padding:10px;}
  .chat-discovery {width:calc(100% - 16px);max-height:calc(100dvh - 16px);}
  .discovery-body {padding-right:10px;padding-left:10px;}
}

@media (min-width: 761px) and (max-width: 1100px) and (pointer: coarse) {
  .compact-composer { grid-template-areas: "tools field voice send"; align-items: end; }
  .compact-composer .composer-input { max-height: 72px; }
}

/* Shared communicator surfaces, without changing desktop or phone navigation. */
.topbar > div:first-child { min-width: 0; }
.topbar h2, .dw-main-window .topbar h2 { font-size: 18px; overflow-wrap: anywhere; }
.topbar p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { flex: 0 0 auto; gap: 0; }
.topbar-actions ion-icon { width: 20px; height: 20px; font-size: 20px; }
.topbar-actions > .icon-button[data-action="new-chat"] { color: var(--blue); }
.topbar-actions > .chat-menu-anchor > .icon-button { color: var(--muted); }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.search-field { gap: 8px; }
.search-clear { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; padding: 0; color: var(--muted); background: transparent; }
.search-clear ion-icon { width: 18px; height: 18px; }
.search-clear[hidden] { display: none; }
.invitation-count-badge { position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; clip-path: none; color: var(--blue); background: transparent; box-shadow: none; }
.invitation-count-badge span { position: absolute; top: 0; right: 0; min-width: 16px; padding: 2px; border-radius: 8px; color: #fff; background: var(--blue); font-size: 10px; }
.invitation-count-badge:hover, .invitation-count-badge:focus-visible { color: var(--blue); background: var(--soft-green); transform: none; }
.dw-main-window .topbar::after { display: none; }
.chat-row { border-radius: 4px; }
.chat-row > span:nth-child(2) { min-width: 0; }
.chat-row::after { content: ""; position: absolute; left: 67px; right: 8px; bottom: 0; height: 1px; background: var(--line); }
.local-segments button { flex: 1; border-bottom: 2px solid transparent; border-radius: 0; }
.chat-local-tools { border-bottom: 1px solid var(--line); gap: 4px; }
.chat-local-tools > .local-segments { flex: 0 1 auto; gap: 8px; }
.chat-local-tools > .local-segments button { flex: 0 1 auto; min-width: 64px; padding-inline: 14px; }
.chat-local-tools > .icon-button { margin-left: auto; }
.chat-local-tools > .local-segments button { transition: color var(--motion-fast), border-color var(--motion-fast); }
.chat-local-tools > .local-segments button:not([aria-pressed="true"]) { font-weight: 500; }
.conversation-identity { min-height: 44px; padding: 0; border-radius: 4px; color: var(--ink); background: transparent; text-align: left; }
.conversation-identity:hover { background: var(--surface-soft); }
.conversation-identity .avatar { flex-shrink: 0; }
.conversation-identity:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.inspector-heading { align-items: center; background: var(--surface); backdrop-filter: none; }
.inspector-heading h2 { font-size: 18px; overflow-wrap: anywhere; }
.inspector-context-heading h2 { flex: 1; }
.inspector-context-heading .inspector-dismiss { order: 2; }
.inspector-back-icon { display: none; }
.inspector-close-icon { display: flex; }
.inspector-navigation { width: 100%; display: grid; grid-template-columns: 24px minmax(0, 1fr) 20px; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; }
.inspector-navigation ion-icon { width: 20px; height: 20px; color: var(--blue); }
.inspector-navigation:hover { background: var(--surface-soft); }
.inspector > .group-details-panel, .inspector > .group-composer, .inspector > .contact-panel { margin: 0; padding: 8px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.inspector[data-view="group-create"] > .group-composer > .admin-title { display: none; }
.group-panel-identity, .group-panel-identity > div, .member-identity, .admin-user > div:first-child { min-width: 0; }
.group-panel-identity h3, .member-identity strong, .member-identity small, .contact-panel .admin-user p, .contact-panel .admin-user strong { overflow-wrap: anywhere; }
.group-detail-member .member-actions { justify-self: end; }
.group-join-action { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-radius: 6px; background: var(--soft-green); color: var(--green-strong); font-size: 13px; font-weight: 600; }
.group-join-action ion-icon { width: 20px; height: 20px; }
.inspector > .group-details-panel .admin-title { margin-bottom: 0; }
.inspector > .group-details-panel { gap: 6px; }
.inspector > .group-details-panel .group-detail-members { max-height: none; overflow: visible; }
.contact-panel .admin-title { flex-wrap: wrap; margin-bottom: 8px; }
.contact-panel-actions { gap: 2px; }
.contact-panel .admin-user { flex-wrap: wrap; gap: 6px; padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }
.contact-panel .user-actions { margin-left: auto; }
.contact-detail-identity { display: flex; gap: 12px; align-items: center; padding: 12px 0; }
.contact-detail-identity > div { min-width: 0; overflow-wrap: anywhere; }
.contact-detail-identity .avatar { flex-shrink: 0; }
.contact-detail-fields { margin: 0; }
.contact-detail-fields > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-detail-fields dt { margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.contact-detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.contact-detail-actions { display: flex; gap: 6px; padding: 12px 0; }
.profile-settings { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-settings > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 0; list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; }
.profile-settings > summary::-webkit-details-marker { display: none; }
.profile-settings > summary ion-icon { width: 20px; height: 20px; color: var(--blue); }
.profile-settings > summary span { flex: 1; }
.profile-settings > summary ion-icon:last-child { width: 16px; height: 16px; color: var(--muted); transition: transform var(--motion-fast); }
.profile-settings[open] > summary ion-icon:last-child { transform: rotate(90deg); }
.profile-settings > .form-field, .profile-settings > .setting-toggle { margin-bottom: 12px; }
.profile-settings > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.account-preferences .privacy-entry { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; background: transparent; color: var(--ink); text-align: left; }
.account-preferences .privacy-entry > span { flex: 1; }
.account-preferences .privacy-entry ion-icon { color: var(--accent); width: 20px; height: 20px; }
.setting-toggle input[type="checkbox"] { appearance: none; position: relative; flex: 0 0 38px; width: 38px; height: 24px; margin: 0; border: 1px solid var(--theme-control-border, var(--line)); border-radius: 12px; background: var(--surface-soft); cursor: pointer; }
.setting-toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform var(--motion-fast); }
.setting-toggle input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.setting-toggle input[type="checkbox"]:checked::after { background: var(--theme-on-primary, white); transform: translateX(14px); }
.setting-toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .setting-toggle input[type="checkbox"]::after { transition: none; } }
@media (forced-colors: active) {
  .setting-toggle input[type="checkbox"] { appearance: auto; }
  .setting-toggle input[type="checkbox"]::after { display: none; }
}

/* Professional content stays in the conversation's visual language. */
.authoring-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.authoring-fields > .form-field + .form-field { margin-top: 16px; }
.form-builder-sheet { width: min(700px, 100%); }
.poll-builder-sheet { width: min(560px, 100%); }
.form-sheet { max-height: calc(var(--app-viewport-height, 100dvh) - 32px); }
/* Authoring is refreshed in place; repeated entry fades obscure active fields. */
.modal-backdrop:has(.form-builder-sheet, .resources-sheet, [aria-labelledby="activeFormTitle"]),
.form-builder-sheet, .resources-sheet, [aria-labelledby="activeFormTitle"] { animation: none; }
.form-sheet-header h2 { font-size: 19px; line-height: 1.3; }
.form-sheet-header > div { min-width: 0; }
.form-sheet-header .muted { font-size: 13px; overflow-wrap: anywhere; }
.form-sheet-header .icon-button { flex-shrink: 0; }
.form-sheet-body .field { min-width: 0; width: 100%; font-size: 16px; }
.form-sheet button { min-height: 44px; }
.form-sheet .icon-button { width: 44px; min-width: 44px; height: 44px; }
.form-sheet ion-icon { width: 20px; height: 20px; flex-shrink: 0; }
.form-sheet input { accent-color: var(--accent); }
.form-sheet .form-field { color: var(--ink); font-size: 13px; font-weight: 600; }
.form-sheet .form-description { min-height: 76px; }
.choice-heading { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 10px; }
.choice-heading small, .choice-number { color: var(--muted); font-size: 13px; }
.authoring-choices { display: grid; gap: 8px; margin: 10px 0; }
.authoring-choice { display: grid; grid-template-columns: 20px minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.authoring-choice .icon-button { color: var(--muted); background: transparent; }
.authoring-choice button:disabled { opacity: .35; cursor: default; }
.choice-add { min-height: 44px; margin-bottom: 12px; padding-left: 0; background: transparent; }
.poll-preview-options { margin-top: 20px; }
.form-settings-disclosure { margin: 16px 0; padding: 10px 0; border-block: 1px solid var(--line); }
.form-settings-disclosure summary { min-height: 32px; cursor: pointer; font-weight: 600; color: var(--green-strong); }
.form-settings-disclosure .form-setting-label > span { white-space: normal; }
.form-settings-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-settings-row .compact-toggle { background: transparent; padding: 4px 0; }
.form-question-heading { grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) 44px; }
.form-question-heading > strong { font-size: 14px; }
.form-options label { min-height: 48px; border: 1px solid var(--line); background: var(--surface); }
.form-options label:has(input:checked) { border-color: var(--accent); background: var(--soft-green); }
.form-options label span { overflow-wrap: anywhere; }
.form-options input { flex-shrink: 0; }
.form-sheet-footer { flex-wrap: wrap; gap: 8px; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); }
.form-sheet-footer .status:empty { display: none; }
.form-sheet-footer .status:not(:empty) { flex-basis: 100%; font-size: 13px; overflow-wrap: anywhere; }
.form-sheet-footer button { min-width: 0; }
.form-sheet-footer .primary, .form-sheet-footer .secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.form-description-disclosure { margin-top: 12px; }
.form-description-disclosure summary { padding-block: 10px; font-size: 13px; cursor: pointer; }
.quiz-answer-choices { min-width: 0; margin: 0; padding: 0; border: 0; font-size: 13px; }
.quiz-answer-choices legend { font-weight: 600; margin-bottom: 6px; }
.quiz-answer-choices .checkrow { min-height: 44px; overflow-wrap: anywhere; }
.form-message { width: 100%; max-width: 390px; min-width: 0; grid-template-columns: 32px minmax(0, 1fr) 20px; gap: 10px; padding: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.form-message-icon { width: 32px; height: 32px; color: var(--accent); background: transparent; }
.form-message strong { line-height: 1.4; font-size: 15px; color: var(--ink); }
.form-message small { color: var(--muted); font-size: 12px; }
.form-message .form-message-kind { color: var(--green-strong); margin: 0 0 4px; font-weight: 600; }
.form-message-copy { min-width: 0; overflow-wrap: anywhere; }
.form-message > ion-icon { color: var(--accent); width: 18px; }
.form-builder-sheet:has(.authoring-layout) { width: min(940px, 100%); }
.poll-builder-sheet:has(.authoring-layout) { width: min(780px, 100%); }
.authoring-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); align-items: start; gap: 24px; }
.authoring-layout > * { min-width: 0; }
.authoring-live-preview { position: sticky; top: 0; border-block: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.authoring-live-preview > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 13px; font-weight: 600; cursor: pointer; }
.authoring-live-preview > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-live-recipient-preview] { max-height: min(470px, 55dvh); overflow: auto; overscroll-behavior: contain; padding-bottom: 8px; }
.recipient-preview-content h3 { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.recipient-preview-content > p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.recipient-preview-content .answer-question-heading { flex-wrap: wrap; gap: 6px; }
.recipient-preview-content .answer-question-heading strong { min-width: 0; overflow-wrap: anywhere; }
.authoring-live-preview .form-answer-question { padding-block: 12px; }
.authoring-live-preview :is(input, textarea):disabled { opacity: 1; color: var(--ink); -webkit-text-fill-color: var(--ink); cursor: default; }
.authoring-live-preview .field { border-bottom: 1px solid var(--ink); }
.authoring-live-preview .form-options label { min-height: 36px; padding: 7px; }
.question-order-actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 4px; }
.question-order-actions .icon-button { color: var(--ink); background: transparent; }
.question-order-actions .icon-button:disabled { opacity: .4; cursor: default; }
.form-message .form-message-excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; color: var(--ink); font-size: 13px; line-height: 1.45; }
.form-message-choices { display: grid; gap: 4px; margin-top: 8px; }
.form-message-choices > span { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.form-message-choices ion-icon { width: 12px; height: 12px; flex: 0 0 12px; }
.form-message .form-message-facts { display: block; margin-top: 8px; line-height: 1.5; }
.form-message .form-message-action { display: block; margin-top: 6px; font-weight: 600; }
.bubble .form-message { padding: 8px 0 4px; border: 0; border-radius: 0; background: transparent; grid-template-columns: 24px minmax(0, 1fr) 18px; gap: 8px; }
.bubble .form-message-icon { width: 24px; height: 24px; }
.form-sheet .form-glyph { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; background: currentColor; -webkit-mask: var(--form-glyph) center / contain no-repeat; mask: var(--form-glyph) center / contain no-repeat; }
.form-sheet-header { padding-block: 12px; background: var(--surface); }
.form-sheet-header h2 { color: var(--ink); font-weight: 650; }
.form-sheet-header .form-kicker { color: var(--muted); font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.form-sheet-body { padding-block: 14px; }
.form-sheet .form-question, .form-sheet .form-answer-question { padding-block: 12px; }
.form-sheet .form-options { gap: 8px; }
.form-sheet .form-options label { min-height: 44px; padding: 9px 12px; border-radius: 6px; }
.form-sheet .form-options label:has(input:checked) { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color: var(--accent); }
.form-sheet .form-options label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-sheet .form-field > input, .form-sheet select, .form-sheet textarea { font-size: 16px; min-height: 44px; }
.form-sheet .authoring-fields :is(input.field, textarea.field, select.field) { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 8px 10px; }
.form-sheet .authoring-fields :is(input.field, textarea.field, select.field):focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-sheet .form-question-outline { padding-block: 0; }
.form-question-outline > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; cursor: pointer; list-style: none; }
.form-question-outline > summary::-webkit-details-marker { display: none; }
.form-question-outline > summary > span { min-width: 0; flex: 1; }
.form-question-outline > summary small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.form-question-outline > summary strong { display: block; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.form-question-outline > summary .form-glyph { color: var(--accent); }
.form-question-outline[open] > summary .form-glyph { transform: rotate(90deg); }
.form-question-outline > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.form-question-outline > .form-question-editor { padding: 4px 0 12px; }
.form-sheet .form-settings-disclosure { margin-block: 10px; padding-block: 0; }
.form-sheet :is(.form-settings-disclosure, .form-description-disclosure, .template-picker) > summary { min-height: 44px; display: flex; align-items: center; }
.form-sheet .form-settings-row { margin-top: 4px; }
.form-sheet .compact-toggle, .form-sheet .form-question-settings .checkrow { min-height: 44px; }
.form-sheet .choice-heading { margin-top: 14px; }
.form-sheet .answer-question-heading { align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.form-sheet .answer-question-heading > strong { min-width: 0; flex: 1 1 180px; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.form-sheet .required-mark { color: var(--muted); font-size: 12px; font-weight: 500; }
.form-sheet .form-field-error { margin: 8px 0 0; color: var(--red, #a02529); font-size: 14px; overflow-wrap: anywhere; }
.form-sheet [aria-invalid="true"] { border-color: var(--red, #a02529); outline-color: var(--red, #a02529); }
.form-sheet .form-unit { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.form-response-sheet { width: min(720px, 100%); }
.modal-backdrop:has(> .form-response-sheet[data-response-expanded="true"]) { padding: 0; min-height: 0; height: var(--app-viewport-height, 100dvh); top: var(--app-viewport-top, 0px); bottom: auto; }
.form-response-sheet[data-response-expanded="true"] { width: 100%; height: 100%; max-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.form-response-sheet[data-response-expanded="true"] .form-sheet-body { width: 100%; max-width: 700px; justify-self: center; }
.form-response-sheet[data-response-expanded="true"] .form-sheet-footer { padding-inline: max(20px, calc((100% - 660px) / 2)); }
.form-response-sheet .form-sheet-body { overscroll-behavior: contain; scroll-padding-block: 20px; padding-block: 24px; }
.form-response-sheet .form-question-step .form-answer-question { padding: 20px 0; border-bottom: 0; }
.form-response-sheet .form-question-step .answer-question-heading { margin-bottom: 20px; gap: 8px 16px; }
.form-response-sheet .form-question-step .answer-question-heading > strong { font-size: 20px; line-height: 1.4; font-weight: 600; }
.form-response-sheet .form-options { gap: 10px; }
.form-response-sheet .form-options label { min-height: 52px; padding: 12px 14px; font-size: 16px; color: var(--ink); border-color: var(--theme-control-border, var(--line)); }
.form-response-sheet .form-options input { width: 20px; height: 20px; margin: 0 4px 0 0; }
.form-response-sheet .field { border-radius: 6px; padding: 12px; }
.form-response-sheet .form-sheet-footer { background: var(--surface); }
.form-response-sheet .form-sheet-footer > .primary { min-width: 128px; padding-inline: 20px; min-height: 48px; }
.form-response-sheet .form-sheet-footer > .secondary { min-height: 48px; padding-inline: 12px; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .modal-backdrop:has(> .form-response-sheet) { padding: 0; min-height: 0; height: var(--app-viewport-height, 100dvh); top: var(--app-viewport-top, 0px); bottom: auto; }
  .form-response-sheet { width: 100%; height: 100%; max-height: 100% !important; border: 0; border-radius: 0; box-shadow: none; }
  .form-response-sheet .form-expand-button { display: none; }
  .form-response-sheet .form-sheet-header { padding-top: max(12px, env(safe-area-inset-top)); }
  .form-response-sheet .form-sheet-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .form-response-sheet .form-sheet-body { min-height: 0; padding-inline: max(16px, env(safe-area-inset-left)); }
}
.form-response-sheet .form-question-step[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .form-response-sheet .form-question-step:not([hidden]), .form-response-review { animation: form-question-arrive 140ms ease-out; }
}
@keyframes form-question-arrive { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.form-response-sheet .form-answer-list:has(> .form-question-step[hidden]) { border-top: 0; margin-top: 8px; }
.form-response-progress { margin: 0 0 10px; }
.form-response-progress > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.form-response-progress > div > strong { font-weight: 500; }
.form-response-progress > div > span { color: var(--muted); font-size: 13px; }
.form-response-progress progress { display: block; appearance: none; width: 100%; height: 4px; margin-top: 8px; border: 0; border-radius: 2px; overflow: hidden; accent-color: var(--accent); background: var(--line); }
.form-response-progress progress::-webkit-progress-bar { background: var(--line); }
.form-response-progress progress::-webkit-progress-value { background: var(--accent); }
.form-response-progress progress::-moz-progress-bar { background: var(--accent); }
.form-response-review h3 { margin: 0 0 8px; font-size: 17px; }
.form-response-progress ~ .form-response-review h3 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-response-review ol { list-style: none; padding: 0; margin: 0; }
.form-response-review li { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form-response-review li strong { font-size: 14px; overflow-wrap: anywhere; }
.form-response-review li p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.form-response-review .icon-button { background: transparent; color: var(--accent); }
.form-response-sheet .form-sheet-footer > [data-response-nav="back"] { margin-right: auto; }
.form-sheet .rating-options { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-sheet .rating-options label { min-width: 0; padding-inline: 4px; justify-content: center; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .authoring-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .authoring-live-preview { order: -1; position: static; }
  [data-live-recipient-preview] { max-height: min(150px, 24dvh); }
}
.result-bar-row { grid-template-columns: minmax(0, 2fr) minmax(60px, 3fr) 32px; }
.result-bar-row > span { overflow-wrap: anywhere; }
.resources-sheet { grid-template-rows: auto auto minmax(0, 1fr) auto; width: min(680px, 100%); }
.resource-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 16px; }
.resource-tabs button { flex: 1; padding: 8px; background: transparent; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.resource-tabs button[aria-selected="true"] { color: var(--green-strong); border-bottom-color: var(--accent); font-weight: 600; }
.resource-search { margin-bottom: 14px; }
.resource-list .form-message { max-width: none; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.resource-empty { padding: 32px 8px; text-align: center; color: var(--muted); }
.training-library-entry { display: grid; grid-template-columns: 72px minmax(0, 1fr) 20px; align-items: center; gap: 14px; width: 100%; padding: 12px 0; text-align: left; background: transparent; color: var(--ink); }
.training-library-entry img { object-fit: cover; border-radius: 6px; }
.training-library-entry strong, .training-library-entry small { display: block; }
.training-library-entry small { color: var(--muted); line-height: 1.5; margin-top: 4px; }
.training-library-entry ion-icon { color: var(--accent); }
@media (max-width: 600px) {
  .form-sheet { max-height: calc(var(--app-viewport-height, 100dvh) - 16px); }
  .form-sheet-header { padding: 12px 14px; }
  .form-sheet-body { padding: 16px 14px; }
  .form-sheet-footer { padding-inline: 14px; }
  .form-question-heading { grid-template-columns: minmax(0, 1fr) 44px; }
  .form-question-heading > strong { grid-column: 1; }
  .form-question-heading > .question-type { grid-column: 1; grid-row: 2; }
  .form-question-heading > .icon-button { grid-column: 2; grid-row: 1 / 3; }
  .form-message { max-width: 100%; }
}
.message-context-menu button { font-size: 13px; }
.message-context-menu button span { overflow-wrap: anywhere; }
.message-context-menu ion-icon, .chat-tools-menu ion-icon { color: var(--blue); }
.message-context-menu button:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.message-context-menu [data-context-action="delete"] { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; color: var(--red); }
.message-context-menu [data-context-action="delete"] ion-icon { color: currentColor; }
.chat-tools-menu { border-color: var(--line); box-shadow: 0 8px 24px rgb(32 41 54 / 16%); overscroll-behavior: contain; animation: communicator-menu-in 100ms ease-out; }
.chat-tools-menu button:hover, .chat-tools-menu button:focus-visible, .chat-tools-menu [aria-checked="true"] { color: var(--green-strong); background: var(--soft-green); }
.chat-discovery, .chat-catch-up, .chat-conversation-tools, .chat-voice-transcript { border-color: var(--line); }
.discovery-tabs [aria-selected="true"] { color: var(--green-strong); border-color: var(--blue); }
.discovery-avatar { color: var(--blue); background: var(--soft-green); }
.discovery-status, .discovery-copy small, .discovery-empty { color: var(--muted); }
.discovery-visibility input { accent-color: var(--blue); }
.discovery-status.is-error { color: var(--red); }
@keyframes communicator-menu-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 760px), (pointer: coarse) {
  .search-clear { width: 44px; height: 44px; flex-basis: 44px; }
  .group-join-action { min-height: 44px; }
  .message-context-menu button { min-height: 44px; }
  .inspector button { min-width: 44px; min-height: 44px; }
  .local-segments button, .sidebar-language, .group-member-tools .secondary { min-height: 44px; }
  .contact-icon-action, .inspector .icon-button, .chat-local-tools .icon-button { width: 44px; height: 44px; min-width: 44px; flex: 0 0 44px; }
  .group-member, .setting-toggle { min-height: 44px; }
  .group-rename-row { grid-template-columns: minmax(0, 1fr) 44px 44px; }
  .group-detail-member { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 8px 0; }
  .group-detail-member .member-actions:not(:empty) { grid-column: 2 / -1; }
  .chat-discovery input:not([type="checkbox"]), .chat-discovery select, .inspector .field { font-size: 16px; }
}
@media (max-width: 760px), (max-width: 1100px) and (pointer: coarse) {
  .shell.mobile-list .chat-row.active { background: transparent; box-shadow: none; }
  .sidebar > .search-wrap { padding-bottom: 6px; }
  .sidebar .chat-local-tools { margin-top: 2px; }
  .sidebar > .chat-list { padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .chat-row { min-height: 76px; padding: 10px 4px; grid-template-columns: 48px minmax(0, 1fr) 44px; gap: 12px; }
  .chat-row .avatar { width: 48px; height: 48px; }
  .chat-row::after { left: 64px; right: 4px; }
  .row-title { font-size: 15px; }
  .row-subtitle { font-size: 14px; }
  .inspector-context-heading .inspector-dismiss { order: 0; }
  .inspector-back-icon { display: flex; }
  .inspector-close-icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .profile-settings > summary ion-icon, .chat-local-tools > .local-segments button { transition: none; }
}
