:root {
  color-scheme: light;
  --ink: #15191e;
  --muted: #68717c;
  --line: #e6e9ee;
  --line-strong: #d4dae1;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --blue: #1769e0;
  --blue-soft: #edf4ff;
  --green: #16835f;
  --green-soft: #e9f7f1;
  --red: #c03245;
  --red-soft: #fff0f2;
  --note: #f5f6f8;
  --note-line: #e1e5ea;
  --shadow-soft: 0 10px 30px rgba(18, 27, 38, .06);
  --radius: 12px;
  --radius-sm: 9px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  letter-spacing: 0;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }

.app-shell {
  width: min(1120px, 100%);
  height: 100dvh;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
  border-inline: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.app-header {
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(226, 231, 236, .86);
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}

.proxy-login-banner {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 22px;
  border-bottom: 1px solid #f0c36d;
  background: #fff8e7;
  color: #6f4700;
  font-size: 13px;
  font-weight: 800;
}
.proxy-login-banner span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.proxy-login-banner small {
  color: #8b6a2f;
  font-weight: 700;
}
.proxy-login-banner button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid #e2aa45;
  border-radius: 999px;
  background: #fff;
  color: #8a5700;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  border: 0;
  background: transparent;
  padding: 0;
}
.logo-lockup[data-action="home"] {
  cursor: pointer;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}
.brand-mark span {
  display: block;
  border-radius: 3px;
  background: var(--green);
}
.brand-mark span:last-child {
  width: 68%;
  background: var(--blue);
}
.brand-word { line-height: 1; }
.header-spacer { min-width: 0; }

.app-menu {
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.app-version-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.language-control {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.desktop-language-control {
  display: none;
}
.chat-language-control {
  justify-self: end;
}
.chat-language-control select {
  max-width: 150px;
}
.language-control label { font-weight: 750; }
select {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 0 34px 0 10px;
}

.account-menu {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.account-trigger {
  min-width: 0;
  max-width: 260px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  padding: 0 14px 0 18px;
}
.account-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-trigger svg {
  width: 19px;
  height: 19px;
  color: var(--muted);
  flex: 0 0 auto;
}
.account-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: max-content;
  min-width: 210px;
  max-width: calc(100vw - 28px);
  z-index: 50;
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 22px 45px rgba(24,32,42,.16);
}
.account-menu-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.account-menu-item + .account-menu-item {
  border-top: 1px solid var(--line);
}
.account-menu-item:hover {
  background: #f6f8fa;
}
.account-menu-item.danger {
  color: var(--red);
}
.header-scan-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.header-scan-button svg {
  width: 18px;
  height: 18px;
}
@media (min-width: 801px) {
  .header-scan-button {
    display: none;
  }
}

.workspace { padding: 24px; }
.workspace.chat-workspace,
.workspace.contacts-workspace,
.workspace.profile-workspace,
.workspace.moments-workspace {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace.profile-workspace {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.chat-workspace .alert,
.chat-workspace .setup-panel,
.contacts-workspace .alert,
.contacts-workspace .setup-panel {
  flex: 0 0 auto;
}

.bottom-tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  min-height: 60px;
  padding: 6px max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border-top: 1px solid rgba(230, 233, 238, .9);
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(14px);
}
.bottom-tabs button {
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.bottom-tabs button svg {
  width: 18px;
  height: 18px;
}
.tab-icon-wrap {
  position: relative;
  display: inline-flex;
}
.tab-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.bottom-tabs button.active {
  background: var(--green-soft);
  color: var(--ink);
}
.app-shell.view-chat .bottom-tabs,
.app-shell.chat-composer-open .bottom-tabs {
  display: none;
}

.moments-view {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}
.events-view {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  touch-action: pan-y;
}
.my-events-view {
  grid-template-rows: auto auto minmax(0, 1fr);
}
.event-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.event-compose.free-event-compose {
  grid-template-columns: minmax(0, 1fr);
}
.event-language-filter,
.event-language-select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
}
.event-compose .primary,
.event-form .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.event-pro-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}
.event-pro-note .text-button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.event-feed {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  background: #fbfcfd;
}
.event-feed.empty-event-feed {
  align-content: center;
  justify-items: center;
  padding: 24px 18px;
}
.event-empty-state {
  width: min(100%, 360px);
  display: grid;
  gap: 7px;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}
.event-empty-state strong {
  color: var(--ink);
  font-size: 16px;
}
.event-empty-state span {
  font-size: 13px;
  line-height: 1.45;
}
.my-events-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.my-events-tabs button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
}
.my-events-tabs button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.event-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.event-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.event-card-head strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}
.event-card.highlighted-event {
  border-color: rgba(22, 131, 95, .46);
  box-shadow: 0 0 0 3px rgba(22, 131, 95, .12);
  scroll-margin: 92px;
}
.event-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.event-language-pill {
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.event-card-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.event-card-head small.event-status-alert {
  color: var(--red);
}
.event-card-head time {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.event-host-chip {
  min-height: 22px;
  border: 1px solid rgba(18, 145, 102, .18);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}
.event-host-chip:active {
  transform: translateY(1px);
}
.event-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.event-meta-pill,
.event-capacity-pill {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.event-meta-pill {
  background: #eef2f6;
  color: var(--muted);
}
.event-capacity-pill {
  background: #eef2f6;
  color: var(--muted);
}
.event-tool-note {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  background: #f1f3f5;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}
.event-tool-note span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.event-participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfcfd;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}
.event-participant-list strong {
  flex: 0 0 100%;
  color: var(--ink);
  font-size: 13px;
}
.event-participant-chip {
  min-height: 30px;
  border: 1px solid rgba(18, 145, 102, .18);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}
.event-participant-chip:active {
  transform: translateY(1px);
}
.event-join-button {
  justify-self: end;
  min-width: 104px;
}
.event-full-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.event-full-row .event-join-button {
  justify-self: stretch;
  min-width: 0;
  width: 100%;
}
.event-join-button.danger {
  border-color: rgba(192, 50, 69, .28);
  color: var(--red);
}
.full-status-button {
  border-color: #d7dde3;
  background: #eef2f6;
  color: var(--muted);
}
.check-more-button {
  color: var(--green);
}
.event-join-button:disabled {
  opacity: .72;
  cursor: default;
}
.event-edit-view {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  touch-action: pan-y;
}
.event-form {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  background: #fbfcfd;
  touch-action: pan-y;
}
.event-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.event-title-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
}
.event-form input:not([type="radio"]):not([type="range"]),
.event-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
}
.event-time-combo {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  background: transparent;
}
.event-time-combo input[name="startsDate"] {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
  min-inline-size: 0;
  inline-size: 100%;
}
.event-time-combo input,
.event-time-combo select {
  min-width: 0;
  max-width: 100%;
  min-inline-size: 0;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  padding: 0 10px;
  font: inherit;
  font-size: 16px;
  box-shadow: none;
}
.event-time-combo select {
  width: 100%;
  padding-right: 28px;
}
.event-time-stack {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.event-timezone-inline {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.event-time-combo input:focus,
.event-time-combo select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23,105,224,.12);
  outline: none;
}
.event-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.event-form-row.single {
  grid-template-columns: 1fr;
}
.event-option-group {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}
.event-option-group.compact {
  align-content: end;
}
.event-option-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.segmented-options,
.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.segmented-option,
.tool-option {
  min-width: 0;
  display: inline-flex;
  position: relative;
}
.segmented-option input,
.tool-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented-option span,
.tool-option span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.segmented-option input:checked + span,
.tool-option input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.segmented-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.segmented-options.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.tool-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.segmented-option span {
  width: 100%;
  border-radius: 5px;
}
.tool-option span {
  width: 100%;
  min-height: 44px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}
.event-range-field {
  opacity: 1;
}
.event-range-field.disabled {
  opacity: .45;
}
.event-range-field.disabled input[type="range"] {
  cursor: default;
}
.event-range-field input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
  accent-color: var(--green);
}
.event-range-field output {
  color: var(--green);
  font-weight: 900;
}
.moment-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.moment-post-trigger {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  padding: 0 11px;
  text-align: left;
  font-weight: 500;
}
.moment-post-trigger:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--ink);
}
.moment-compose .primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.moment-reply-notice {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid rgba(194, 47, 74, .25);
  border-radius: 7px;
  background: #fff4f6;
  color: var(--red);
  padding: 0 12px;
  font-weight: 800;
  text-align: left;
}
.moment-reply-notice svg {
  width: 18px;
  height: 18px;
}
.moment-filter-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.moment-filter-head .secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.moment-filter-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.moment-feed {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  background: #fbfcfd;
}
.moment-feed-status {
  padding: 8px 0 2px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.reply-notice-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow: auto;
}
.reply-notice-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 12px;
  text-align: left;
}
.reply-notice-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.reply-notice-meta strong {
  color: var(--ink);
}
.moment-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 27, 38, .03);
}
.moment-card.just-posted {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,131,95,.16);
}
.moment-card.mine {
  background: #e8f7f0;
  border-color: #cbe9dc;
}
.moment-card.theirs {
  background: #fff;
}
.moment-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.moment-head strong,
.moment-comment-main strong,
.author-link {
  display: block;
  color: var(--ink);
  font-size: 14px;
}
.author-link {
  width: fit-content;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.author-link:active {
  color: var(--green);
}
.comment-author-link {
  margin-bottom: 2px;
}
.moment-head time,
.moment-comment-main time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.moment-body {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
}
.original-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
}
.original-footer time {
  min-width: 0;
  color: #8b949e;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
}
.original-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.original-actions .note-action-button {
  width: 22px;
  height: 22px;
}
.original-actions .note-action-button svg {
  width: 12px;
  height: 12px;
}
.moment-note {
  width: 100%;
  background: var(--note);
  border-color: var(--note-line);
}
.moment-comments {
  display: grid;
  gap: 8px;
}
.moment-comment {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
}
.moment-comment.mine {
  background: var(--green-soft);
  border-color: #c9e6d8;
}
.moment-comment.theirs {
  background: #fff;
}
.moment-comment.just-posted {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,131,95,.16);
}
.moment-comment-main p {
  margin: 4px 0 0;
  line-height: 1.45;
}
.moment-reply-trigger {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  padding: 0 11px;
  text-align: left;
  font-weight: 500;
}
.moment-reply-trigger:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--ink);
}
.moment-reply-trigger svg {
  width: 17px;
  height: 17px;
  color: var(--blue);
  flex: 0 0 auto;
}
.moment-reply-view,
.moment-edit-view {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 12px;
  padding: 16px;
  background: #fbfcfd;
  overflow: auto;
}
.moment-reply-head {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.moment-reply-head .secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.moment-reply-head .secondary svg {
  width: 17px;
  height: 17px;
}
.moment-reply-head strong {
  font-size: 18px;
}
.moment-reply-context {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.moment-reply-context.mine {
  background: var(--green-soft);
  border-color: #c9e6d8;
}
.moment-reply-form,
.moment-edit-form {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 12px;
}
.moment-reply-form textarea,
.moment-edit-form textarea {
  width: 100%;
  height: 132px;
  min-height: 0;
  resize: none;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}
.moment-edit-form textarea {
  height: 156px;
}
.moment-reply-form .primary,
.moment-edit-form .primary {
  justify-self: end;
  align-self: start;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.moment-reply-form .primary svg,
.moment-edit-form .primary svg {
  width: 18px;
  height: 18px;
}

.profile-view {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
  overflow: visible;
}
.profile-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-head h1 {
  margin: 0;
  font-size: 24px;
}
.profile-panel {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}
.user-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #e8f7f0;
  color: var(--green);
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  user-select: none;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  font-size: 28px;
}
.avatar-contact {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 17px;
}
.avatar-message {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
}
.tone-mint { background: #e4f6ee; color: #16835f; }
.tone-blue { background: #e8f1ff; color: #226ad6; }
.tone-violet { background: #f0eafd; color: #6c48c5; }
.tone-amber { background: #fff4df; color: #a76512; }
.tone-rose { background: #ffe9ef; color: #bd3e62; }
.tone-slate { background: #eef2f6; color: #53606d; }
.profile-avatar-card,
.friend-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.friend-profile-card {
  grid-template-columns: auto minmax(0, 1fr);
}
.profile-avatar-card strong,
.friend-profile-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
}
.profile-avatar-card small,
.friend-profile-card small {
  display: block;
  min-width: 0;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.avatar-upload-button {
  position: relative;
  cursor: pointer;
  min-height: 38px;
}
.avatar-upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.profile-field {
  display: grid;
  gap: 7px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.profile-field:last-child {
  border-bottom: 0;
}
.profile-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.profile-field strong {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.profile-upgrade-link {
  flex: 0 0 auto;
  padding: 0;
  color: var(--green);
  font-size: 15px;
  font-weight: 800;
  text-align: right;
}
.profile-upgrade-link:disabled {
  opacity: 0.65;
}
.profile-plan-notes {
  display: grid;
  gap: 4px;
}
.profile-plan-notes small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.profile-notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.profile-notification-row small {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}
.profile-notification-row .compact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.profile-notification-row svg {
  width: 16px;
  height: 16px;
}
.notification-switch {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.notification-switch:disabled {
  cursor: default;
  opacity: 0.55;
}
.notification-switch-track {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d4d9df;
  border: 1px solid #c4cbd3;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.notification-switch-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transform: translateX(0);
  transition: transform 0.18s ease;
}
.notification-switch.on {
  color: var(--green);
}
.notification-switch.on .notification-switch-track {
  background: var(--green);
  border-color: var(--green);
}
.notification-switch.on .notification-switch-thumb {
  transform: translateX(20px);
}
.push-diagnostics {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
}
.push-diagnostics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.push-diagnostic-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1 1 auto;
}
.push-diagnostics-head strong {
  font-size: 14px;
}
.push-diagnostics dl {
  display: grid;
  gap: 6px;
  margin: 0;
}
.diagnostic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  font-size: 13px;
}
.diagnostic-row dt {
  color: var(--muted);
  font-weight: 750;
}
.diagnostic-row dd {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.diagnostic-row.ok dd { color: var(--green); }
.diagnostic-row.warn dd { color: var(--muted); }
.diagnostic-row.bad dd { color: var(--red); }
.push-diagnostics p {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.4;
}
.profile-field select {
  width: min(260px, 100%);
}
.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.profile-name-row .small {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}
.profile-name-row svg {
  width: 16px;
  height: 16px;
}
.profile-email-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-name-input {
  width: min(360px, 100%);
}
.icon-button.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-toggle-field {
  gap: 10px;
}
.profile-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}
.profile-toggle-row small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}
.profile-toggle-row input {
  width: 22px;
  height: 22px;
  padding: 0;
}
.friend-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.friend-info-actions .primary,
.friend-info-actions .secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.friend-info-actions svg {
  width: 18px;
  height: 18px;
}
.add-friend-panel {
  gap: 0;
}
.add-friend-panel input {
  width: min(420px, 100%);
}
.add-friend-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.add-friend-actions .primary,
.add-friend-actions .secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.add-friend-actions .primary svg,
.add-friend-actions .secondary svg {
  width: 18px;
  height: 18px;
}
.add-friend-panel > .full-width {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.add-friend-panel > .full-width svg {
  width: 18px;
  height: 18px;
}
.friend-qr-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.friend-qr-card strong {
  display: block;
  margin-bottom: 5px;
}
.friend-qr-card p,
.qr-scanner p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
.friend-qr-card img {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.qr-scanner {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.qr-video {
  width: 100%;
  max-height: 280px;
  border-radius: 7px;
  background: #101820;
  object-fit: cover;
}
.qr-scan-view .profile-panel {
  gap: 14px;
}
.qr-scan-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.discover-panel {
  gap: 0;
}
.discover-heading {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.discover-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.discover-filters label {
  min-width: 0;
  display: grid;
  gap: 6px;
}
.discover-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.discover-filters select {
  width: 100%;
}
.discover-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.discover-row:last-child {
  border-bottom: 0;
}
.discover-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.discover-main strong,
.discover-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.discover-main small,
.discover-languages {
  color: var(--muted);
}
.discover-languages {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13px;
}
.discover-avatar {
  align-self: start;
}
.discover-add-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.discover-add-button svg {
  width: 16px;
  height: 16px;
}
.discover-add-button:disabled {
  opacity: 0.65;
  cursor: default;
}
.discover-loading {
  padding: 14px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
textarea {
  -webkit-user-select: text;
  user-select: text;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23,105,224,.12);
}

.primary,
.secondary,
.provider-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-weight: 750;
}
.primary { background: var(--green); color: #fff; }
.secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.primary:hover { background: #106d4e; }
.secondary:hover { background: #f6f8fa; }

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-weight: 700;
}
.text-button:hover { text-decoration: underline; }

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--blue);
}
.icon-button:hover { background: var(--blue-soft); }
.icon-button svg { width: 17px; height: 17px; }

.alert {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.alert.error { color: var(--red); border-color: #efbdc5; background: var(--red-soft); }
.alert.success { color: var(--green); border-color: #b8dfd0; background: var(--green-soft); }

.guidance-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #bdd6f5;
  border-radius: var(--radius);
  background: #f4f8ff;
}
.guidance-card strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}
.guidance-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.guidance-details {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.guidance-details summary {
  width: max-content;
  cursor: pointer;
  color: var(--blue);
  font-weight: 750;
}
.guidance-details p {
  margin-top: 6px;
}
.guidance-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}
.guidance-actions .secondary,
.guidance-card > .text-button {
  min-height: 34px;
  white-space: nowrap;
}

.pro-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #b8dfd0;
  border-radius: 7px;
  background: var(--green-soft);
}
.pro-banner strong {
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}
.pro-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.pro-banner .primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.pro-banner .primary svg {
  width: 17px;
  height: 17px;
}

.setup-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.setup-panel h2 {
  margin: 3px 0 0;
  font-size: 18px;
}
.setup-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.setup-form {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
}
.setup-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.setup-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.setup-field select {
  min-width: 0;
  max-width: 180px;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 28px;
  background: #fff;
}
.auth-panel {
  width: min(400px, 100%);
  padding: 28px 0 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.auth-restore-panel {
  min-height: 60vh;
  display: grid;
  align-content: center;
  gap: 14px;
  text-align: center;
}
.auth-restore-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}
.app-loading-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 24px max(18px, env(safe-area-inset-bottom));
  background: #fff;
}
.app-loading-card {
  width: min(320px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  transform: translateY(-4vh);
}
.app-loading-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
}
.app-loading-brand .brand-mark {
  width: 42px;
  height: 42px;
  padding: 9px;
  border-radius: 9px;
}
.app-loading-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}
.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
  opacity: .35;
  animation: loading-dot 1.15s ease-in-out infinite;
}
.loading-dots span:nth-child(2) {
  animation-delay: .16s;
}
.loading-dots span:nth-child(3) {
  animation-delay: .32s;
}
.loading-bar {
  width: min(170px, 58vw);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f4;
}
.loading-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
  animation: loading-bar 1.25s ease-in-out infinite;
}
.daily-warmup-view {
  min-height: 100%;
  display: grid;
  place-items: start center;
  overflow-y: auto;
  padding: max(14px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom));
  background: #fff;
}
.daily-warmup-card {
  width: min(560px, 100%);
  display: grid;
  gap: 12px;
  margin: auto 0;
  transform: translateY(-1vh);
}
.daily-warmup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.daily-warmup-skip-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  text-transform: none;
  letter-spacing: 0;
}
.daily-warmup-skip-actions .text-button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 11px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.daily-warmup-skip-actions .text-button:hover,
.daily-warmup-skip-actions .text-button:focus-visible {
  border-color: #b8dfd0;
  background: var(--green-soft);
  color: var(--green);
}
.daily-warmup-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}
.warmup-meaning {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafb;
}
.warmup-meaning small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.warmup-meaning p {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.36;
}
.warmup-answer,
.warmup-token-bank {
  min-height: 50px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.warmup-answer span {
  color: var(--muted);
  font-weight: 750;
}
.warmup-answer button,
.warmup-token-bank button {
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
}
.warmup-answer button {
  border-color: #b8dfd0;
  background: var(--green-soft);
  color: var(--green);
}
.warmup-answer-token {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border: 1px solid #b8dfd0;
  border-radius: 999px;
  background: var(--green-soft);
  touch-action: none;
  user-select: none;
  will-change: transform;
}
.warmup-answer-token.dragging {
  position: relative;
  z-index: 5;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .16);
  opacity: .96;
}
.warmup-answer-token .warmup-word {
  min-height: 34px;
  border: 0;
  padding: 0 7px;
  background: transparent;
}
.warmup-answer-token .warmup-move {
  width: 28px;
  min-height: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(22, 131, 95, .18);
  padding: 0;
  background: #fff;
}
.warmup-answer-token .warmup-move svg {
  width: 15px;
  height: 15px;
}
.warmup-answer-token .warmup-move:disabled {
  opacity: .28;
}
.warmup-token-bank button:active,
.warmup-answer button:active {
  transform: translateY(1px);
}
.warmup-prompt-card,
.warmup-listen-card,
.warmup-quote-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.warmup-prompt-card small,
.warmup-listen-card small,
.warmup-quote-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.warmup-prompt-card p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 800;
  line-height: 1.42;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: pretty;
}
.warmup-quote-card {
  border-color: #b8dfd0;
  background: var(--green-soft);
}
.warmup-quote-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.warmup-quote-card p {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 850;
  line-height: 1.35;
}
.warmup-listen-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
}
.warmup-listen-card button {
  min-height: 40px;
}
.warmup-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.warmup-choice-grid button {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
.warmup-choice-grid.sentence-options {
  grid-template-columns: 1fr;
}
.warmup-choice-grid.sentence-options button {
  text-align: left;
}
.warmup-choice-grid button.selected {
  border-color: #7ac4aa;
  background: var(--green-soft);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(22, 131, 95, .08);
}
.warmup-feedback {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
}
.warmup-feedback.success {
  color: var(--green);
}
.warmup-answer-card,
.warmup-complete-card {
  border: 1px solid #b8dfd0;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--green-soft);
}
.warmup-answer-card {
  border-color: var(--note-line);
  background: var(--note);
}
.warmup-answer-card small,
.warmup-complete-card small {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.warmup-answer-card small {
  color: var(--muted);
}
.warmup-answer-card div,
.warmup-complete-card div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.warmup-answer-card p,
.warmup-complete-card p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.36;
}
.warmup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.warmup-actions.completed {
  grid-template-columns: 1fr;
  position: sticky;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 3;
  padding-top: 2px;
  background: #fff;
}
.warmup-actions button {
  min-height: 42px;
}
@keyframes loading-dot {
  0%, 80%, 100% {
    opacity: .32;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}
@keyframes loading-bar {
  0% {
    transform: translateX(-115%);
  }
  100% {
    transform: translateX(260%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-dots span,
  .loading-bar span {
    animation: none;
  }
}
.auth-panel .logo-lockup {
  justify-content: center;
}
.auth-panel h1 {
  margin: 46px 0 10px;
  font-size: 28px;
  text-align: center;
}
.auth-panel p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.auth-panel > p {
  text-align: center;
}
.auth-use-cases {
  display: grid;
  gap: 8px;
  margin: 22px 0 0;
}
.auth-use-case {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  padding: 12px 13px;
}
.auth-use-case strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 850;
}
.auth-use-case p {
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
}
.auth-core-idea {
  margin: 2px 0 0 !important;
  padding: 10px 12px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  color: var(--ink) !important;
  font-size: 13px;
  line-height: 1.5 !important;
}
.auth-pwa-guidance {
  width: calc(100% + 48px);
  align-items: stretch;
  flex-direction: column;
  gap: 0;
  margin: 0 -24px;
  padding: 0 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.auth-pwa-guidance p {
  margin-bottom: 0;
}
.auth-pwa-guidance strong,
.auth-pwa-guidance > div > p {
  display: none;
}
.auth-pwa-guidance .guidance-details {
  margin: 0;
}
.auth-pwa-guidance .guidance-details summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--blue);
  font-weight: 750;
}
.auth-pwa-guidance .guidance-details p {
  padding: 0 0 14px;
}
.auth-pwa-guidance .install-steps {
  display: grid;
  gap: 12px;
  padding: 0 0 14px;
}
.auth-pwa-guidance .install-steps section {
  display: grid;
  gap: 4px;
}
.auth-pwa-guidance .install-steps strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}
.auth-pwa-guidance .install-steps p {
  padding: 0;
  color: var(--muted);
}
.android-apk-download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0 16px;
  border-top: 1px solid var(--line);
}
.android-apk-download strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}
.android-apk-download p {
  margin: 4px 0 0;
  padding: 0;
  color: var(--muted);
}
.android-apk-download .secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.android-apk-download svg {
  width: 16px;
  height: 16px;
}
.auth-pwa-guidance > .text-button {
  display: none;
}
.install-device-guidance {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 16px;
}
.install-device-guidance .install-device-head,
.install-gate-device .install-device-head {
  display: grid;
  gap: 4px;
}
.auth-pwa-guidance .install-device-head strong,
.install-device-head strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}
.auth-pwa-guidance .install-device-head p,
.install-device-head p {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.install-device-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.install-device-selector button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}
.install-device-selector button.active {
  border-color: rgba(22,131,95,.36);
  background: var(--green-soft);
  color: #0f684b;
}
.install-device-selector svg {
  width: 16px;
  height: 16px;
}
.install-option-intro {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.install-option-list {
  display: grid;
  gap: 10px;
}
.install-option-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.install-option-card.recommended {
  border-color: rgba(22,131,95,.28);
}
.install-option-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.auth-pwa-guidance .install-option-head strong,
.install-option-head strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}
.install-option-head span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green-soft);
  color: #0f684b;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
}
.auth-pwa-guidance .install-option-card p,
.install-option-card p {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.install-option-card ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}
.ios-install-steps {
  display: grid;
  gap: 8px;
}
.ios-install-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  padding: 9px 10px;
}
.ios-step-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.ios-step-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}
.ios-install-step b {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.28;
}
.ios-install-step small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.home-add-icon,
.safari-menu-icon,
.ios-share-icon {
  color: var(--ink);
}
.sidenote-home-icon {
  position: relative;
}
.sidenote-home-icon {
  border-color: transparent;
  background: transparent;
}
.sidenote-home-icon .brand-mark {
  width: 42px;
  height: 42px;
  gap: 3px;
  padding: 8px;
  border-radius: 10px;
}
.install-option-card .secondary {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
.install-download-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
}
.install-download-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.install-gate-device {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}
.auth-display-language {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 18px 0 0;
}
.auth-display-language select {
  width: auto;
  max-width: 180px;
  height: 28px;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #858b93;
  padding: 0 8px;
  font-size: 14px;
  text-align: center;
  text-align-last: center;
}
.install-gate-panel h1 {
  margin-top: 34px;
}
.install-visual-grid {
  display: grid;
  gap: 14px;
  margin: 22px 0 14px;
}
.install-step-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.install-step-card strong {
  align-self: end;
  font-size: 15px;
  font-weight: 850;
}
.install-step-card ol {
  grid-column: 2;
  margin: -4px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.install-phone-visual {
  grid-row: span 2;
  width: 86px;
  height: 132px;
  border: 2px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(#fff, #f7fafb);
  display: grid;
  place-items: center;
  position: relative;
}
.install-phone-top {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
}
.install-phone-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--blue);
}
.install-phone-icon svg,
.install-phone-arrow svg {
  width: 18px;
  height: 18px;
}
.install-phone-arrow {
  position: absolute;
  bottom: 34px;
  color: var(--muted);
}
.install-home-icon {
  position: absolute;
  bottom: 9px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.install-home-icon .brand-mark {
  width: 20px;
  height: 20px;
}
.install-home-icon .brand-word {
  display: none;
}
.install-gate-note {
  margin-top: 10px !important;
  text-align: center;
  font-size: 13px;
}
.push-permission-view {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.push-permission-card {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}
.push-permission-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--green-soft);
  color: var(--green);
}
.push-permission-icon svg {
  width: 27px;
  height: 27px;
}
.push-permission-card h1 {
  margin: 0;
  font-size: 25px;
}
.push-permission-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.push-permission-actions {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.push-permission-actions .primary,
.push-permission-actions .secondary {
  width: 100%;
  min-height: 48px;
}
.email-auth-form {
  display: grid;
  gap: 14px;
  margin: 0 0 20px;
}
.email-auth-form input,
.email-auth-form .primary {
  width: 100%;
}
.email-auth-form input {
  height: 62px;
  border-radius: 18px;
  padding-inline: 22px;
  font-size: 16px;
}
.email-auth-form input::placeholder {
  color: #9aa2aa;
}
.email-auth-form .primary {
  height: 56px;
  border-radius: 999px;
  font-size: 16px;
}
.auth-reset { justify-self: center; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 12px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.auth-actions { display: grid; gap: 10px; }
.provider-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}
.provider-button:hover { background: #f6f8fa; }
.apple-button {
  border-color: #111;
  background: #111;
  color: #fff;
}
.apple-button:hover { background: #272727; }
.apple-symbol {
  font-size: 13px;
  line-height: 1;
}
.google-g { color: var(--blue); font-weight: 900; }
.pc-qr-login {
  display: none;
}
@media (min-width: 801px) {
  .pc-qr-login {
    display: block;
    margin-top: 6px;
  }
  .pc-qr-login-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
    background: #fff;
  }
  .pc-qr-login-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
  }
  .pc-qr-login-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
  }
  .pc-qr-login-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }
  .pc-qr-login-card .error-text {
    color: var(--red);
  }
  .pc-qr-code-box {
    width: 226px;
    height: 226px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fafc;
  }
  .pc-qr-code-box img {
    width: 210px;
    height: 210px;
    border-radius: 8px;
  }
  .pc-qr-placeholder {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
  }
}

.chat-layout {
  height: calc(100vh - 112px);
  min-height: 520px;
  flex: 1 1 auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.chat-workspace .chat-layout {
  height: auto;
  min-height: 0;
}
.contacts-workspace .chat-layout {
  height: auto;
  min-height: 0;
}
.sidebar {
  min-width: 0;
  height: 100%;
  min-height: 0;
  background: #fff;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.contact-list {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  align-content: start;
}
.contact-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 4px 12px;
  align-items: center;
  min-height: 72px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid rgba(230, 233, 238, .86);
  background: transparent;
  text-align: left;
  transition: background .14s ease, box-shadow .14s ease;
}
.contact-row:hover,
.contact-row.active {
  background: #fafcfb;
}
.contact-row.active {
  box-shadow: inset 3px 0 0 rgba(22, 131, 95, .82);
}
.contact-row .contact-title {
  grid-column: 2;
  color: var(--ink);
  font-weight: 780;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.contact-row .user-avatar {
  grid-row: 1 / 3;
  grid-column: 1;
}
.contact-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unread-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}
.contact-row small {
  grid-column: 2;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.contact-language {
  grid-row: 1 / 3;
  grid-column: 3;
  align-self: center;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: #f2f5f7;
  color: #58626d;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}
.contact-row svg {
  grid-row: 1 / 3;
  grid-column: 4;
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.empty-list {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.conversation {
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) min-content;
  background: #fff;
}
.contact-open .conversation { display: none; }
.chat-open .sidebar { display: none; }
.conversation-head {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(230, 233, 238, .9);
  position: sticky;
  top: 0;
  z-index: 12;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(14px);
}
.back-button {
  color: var(--ink);
}
.conversation-head h2 {
  margin: 3px 0 0;
  font-size: 22px;
}
.conversation-title-button {
  min-width: 0;
  display: grid;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.conversation-title-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 800;
}
.conversation-title-button b {
  color: var(--red);
  font-size: 12px;
}
.conversation-head .secondary,
.composer .primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  align-self: start;
  min-height: 44px;
  max-height: 48px;
}
.composer .primary span {
  line-height: 1.2;
}
.conversation-head svg,
.composer svg {
  width: 16px;
  height: 16px;
}
.message-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #fbfcfd;
}
.chat-comprehension-card {
  display: grid;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.chat-comprehension-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}
.chat-comprehension-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.chat-comprehension-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.chat-comprehension-actions button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  text-align: center;
}
.chat-comprehension-actions button:hover {
  border-color: var(--green);
  background: #effaf5;
}
.chat-comprehension-actions b {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
.chat-comprehension-actions span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.load-older {
  align-self: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.load-older:hover {
  background: #f6f8fa;
  color: var(--ink);
}
.empty-state,
.conversation-empty {
  color: var(--muted);
  text-align: center;
}
.empty-state {
  margin: auto;
  padding: 34px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  width: min(380px, 100%);
}
.conversation-empty {
  align-self: center;
  justify-self: center;
  width: min(420px, 100%);
  padding: 24px;
}
.conversation-empty h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
}
.conversation-empty p {
  margin: 0;
  line-height: 1.55;
}
.message {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  justify-self: flex-start;
}
.message-stack {
  min-width: 0;
}
.message.mine {
  grid-template-columns: minmax(0, 1fr) auto;
  align-self: flex-end;
  justify-self: flex-end;
}
.message.mine .bubble {
  background: #e8f7f0;
  border-color: #cbe9dc;
}
.message.system-message {
  width: min(520px, 100%);
  grid-template-columns: minmax(0, 1fr);
  align-self: center;
  justify-self: center;
}
.message.system-message .bubble {
  border-color: var(--line);
  background: #f1f3f5;
  color: var(--muted);
  text-align: center;
}
.message.system-message .bubble p {
  font-size: 13px;
}
.system-pill {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  min-height: 26px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  margin: 0 2px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.system-user-pill {
  border-color: rgba(18, 145, 102, .18);
  background: var(--green-soft);
  color: var(--green);
}
.system-event-pill {
  background: #fff;
  color: var(--ink);
}
.system-pill:active {
  transform: translateY(1px);
}
.bubble,
.note {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
}
.bubble {
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 27, 38, .03);
}
.message.with-notes .bubble {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.message.with-notes .note {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.message.with-notes .notes .note:not(:first-child) {
  border-top: 0;
  border-radius: 0;
}
.message.with-notes .notes .note:last-child {
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}
.bubble p,
.note p {
  margin: 0;
  line-height: 1.48;
}
.inline-word-search {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 0 1px;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(25, 145, 101, .16);
}
.inline-word-search:active {
  background: rgba(25, 145, 101, .13);
  color: var(--green);
}
@media (hover: hover) {
  .inline-word-search:hover {
    background: rgba(25, 145, 101, .09);
  }
}

@media (min-width: 801px) {
  .app-shell {
    width: min(1320px, 100%);
  }
  .bottom-tabs {
    display: none;
  }
  .workspace.contacts-workspace,
  .workspace.chat-workspace {
    padding: 14px 18px 18px;
  }
  .chat-layout.desktop-chat {
    height: calc(100dvh - 118px);
    max-height: calc(100dvh - 118px);
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    border-radius: 10px;
  }
  .chat-layout.desktop-chat .conversation {
    min-height: 0;
    overflow: hidden;
  }
  .chat-layout.desktop-chat .sidebar,
  .chat-layout.desktop-chat.chat-open .sidebar {
    display: block;
    border-right: 1px solid var(--line);
  }
  .chat-layout.desktop-chat .conversation,
  .chat-layout.desktop-chat.contact-open .conversation {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }
  .chat-layout.desktop-chat .contact-row.active {
    background: var(--green-soft);
    box-shadow: inset 4px 0 0 rgba(22, 131, 95, .86);
  }
  .chat-layout.desktop-chat .contact-row:hover {
    background: #f5fbf8;
  }
  .chat-layout.desktop-chat .back-button {
    display: none;
  }
  .chat-layout.desktop-chat .conversation-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .chat-layout.desktop-chat .message-list {
    padding: 20px 24px 12px;
  }
  .chat-layout.desktop-chat .composer {
    position: static;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(230, 233, 238, .9);
    border-top: 0;
  }
  .chat-layout.desktop-chat .composer .primary {
    min-width: 120px;
  }
}

.bubble > time,
.note span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}
.note {
  background: var(--note);
  border-color: var(--note-line);
}
.notes {
  display: grid;
  gap: 0;
}
.note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.note-head span {
  margin: 0 0 6px;
  font-weight: 850;
  text-transform: uppercase;
}
.translation-meta {
  min-width: 0;
}
.translation-meta span,
.translation-meta time {
  display: block;
}
.translation-meta time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}
.note-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.note-action-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
}
.note-action-button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}
.pinyin-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: lowercase;
  padding: 0;
}
.note-action-button svg {
  width: 15px;
  height: 15px;
}
.pinyin-panel {
  margin-top: 6px;
  border-radius: 5px;
  background: #f6f8fa;
  color: var(--muted);
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble .pinyin-panel {
  background: rgba(255, 255, 255, .72);
}
.pinyin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(21, 25, 30, .26);
}
.pinyin-modal {
  width: min(420px, 100%);
  max-height: min(70dvh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(16, 24, 40, .18);
}
.pinyin-modal header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.pinyin-modal header strong {
  font-size: 17px;
  font-weight: 850;
}
.pinyin-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pinyin-reading-block {
  display: grid;
  gap: 8px;
  padding: 18px 16px 20px;
  background: #f6f8fa;
}
.pinyin-reading-block p {
  margin: 0;
  user-select: text;
  -webkit-user-select: text;
}
.pinyin-reading-pronunciation {
  color: var(--muted);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.pinyin-reading-original {
  color: var(--ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.admin-dashboard {
  display: grid;
  gap: 10px;
  padding-bottom: 24px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.admin-stat-card {
  min-width: 0;
  padding: 8px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: center;
}
.admin-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}
.admin-stat-card strong {
  display: block;
  margin-bottom: 2px;
  font-size: clamp(20px, 7vw, 30px);
  line-height: 1;
  letter-spacing: -.04em;
}
.admin-search,
.admin-subscription-form {
  display: grid;
  gap: 10px;
}
.admin-search {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--note);
}
.admin-search label,
.admin-subscription-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.admin-search input,
.admin-subscription-form input,
.admin-subscription-form select {
  font-size: 16px;
}
.admin-generated {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.admin-user-list {
  display: grid;
  gap: 12px;
}
.admin-user-card,
.admin-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.admin-user-result {
  width: 100%;
  color: var(--ink);
  text-align: left;
}
.admin-user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.admin-user-head strong,
.admin-user-head small {
  display: block;
}
.admin-user-head strong {
  font-size: 16px;
}
.admin-user-head small {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.admin-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}
.admin-subscription-status {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
}
.admin-subscription-status.compact {
  margin-bottom: 0;
}
.admin-back-results {
  min-height: 30px;
  justify-self: start;
  margin-top: 8px;
}
.admin-subscription-status span,
.admin-subscription-status small {
  color: var(--muted);
  font-size: 12px;
}
.admin-subscription-status b {
  font-size: 15px;
}
.admin-proxy-login {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.admin-proxy-login span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.pending-note {
  color: var(--muted);
  font-style: italic;
}
.message-status {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.message-status.failed {
  color: var(--red);
}
.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  align-content: start;
  height: auto;
  min-height: 0;
  max-height: max-content;
  padding: 12px 14px;
  border-top: 1px solid rgba(230, 233, 238, .9);
  background: #fff;
  position: sticky;
  bottom: 0;
  z-index: 12;
}
.composer input {
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 0 16px;
}
.composer .primary {
  border-radius: 999px;
  padding: 0 14px;
  min-width: 54px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(22, 131, 95, .18);
}
.composer-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 800px) {
  .app-shell { border: 0; }
  .app-header {
    grid-template-columns: 1fr auto;
    min-height: 64px;
    padding: 10px 16px;
    gap: 10px;
  }
  .header-spacer {
    display: none;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .brand-word {
    font-size: 22px;
  }
  .language-control {
    order: 3;
    grid-column: 1 / -1;
  }
  .chat-language-control {
    order: 0;
    grid-column: auto;
    justify-content: flex-end;
  }
  .chat-language-control label {
    display: none;
  }
  .chat-language-control select {
    width: 116px;
    max-width: 30vw;
    padding-inline: 9px 28px;
  }
  .chat-comprehension-card {
    padding: 12px 14px;
  }
  .chat-comprehension-actions {
    gap: 8px;
  }
  .chat-comprehension-actions button {
    min-height: 42px;
    padding: 9px 10px;
  }
  .account-menu {
    max-width: 44vw;
  }
  .account-trigger {
    height: 36px;
    max-width: 44vw;
    gap: 7px;
    padding: 0 10px 0 13px;
    font-size: 13px;
  }
  .account-trigger span {
    display: block;
    max-width: 32vw;
  }
  .account-trigger svg {
    width: 15px;
    height: 15px;
  }
  .account-popover {
    top: calc(100% + 10px);
    width: max-content;
    min-width: 190px;
    max-width: calc(100vw - 36px);
  }
  .account-menu-item {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }
  .workspace { padding: 14px; }
  .workspace.chat-workspace {
    padding: 0;
  }
  .workspace.contacts-workspace {
    padding: 0;
  }
  .workspace.profile-workspace {
    padding: 14px;
  }
  .admin-stat-card {
    padding: 7px 5px;
  }
  .add-friend-actions {
    justify-content: stretch;
  }
  .add-friend-actions .primary,
  .add-friend-actions .secondary {
    flex: 1 1 160px;
    justify-content: center;
  }
  .friend-qr-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .friend-qr-card img {
    width: 180px;
    height: 180px;
  }
  .friend-info-actions {
    justify-content: stretch;
  }
  .friend-info-actions .primary,
  .friend-info-actions .secondary {
    flex: 1 1 180px;
    justify-content: center;
  }
  .discover-filters {
    grid-template-columns: 1fr;
  }
  .discover-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .discover-languages,
  .discover-add-button {
    grid-column: 1 / -1;
  }
  .discover-add-button {
    width: 100%;
    justify-content: center;
  }
  .workspace.moments-workspace {
    padding: 0;
  }
  .guidance-card {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 12px;
  }
  .guidance-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .setup-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-inline: 0;
    border-radius: 0;
  }
  .setup-panel h2 {
    font-size: 18px;
  }
  .setup-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .setup-field select,
  .setup-form .primary {
    width: 100%;
    max-width: none;
  }
  .pro-banner {
    margin: 0;
    border-inline: 0;
    border-radius: 0;
    align-items: stretch;
    flex-direction: column;
  }
  .pro-banner .primary {
    justify-content: center;
  }
  .moments-view {
    border-inline: 0;
    border-radius: 0;
  }
  .events-view,
  .event-edit-view {
    border-inline: 0;
    border-radius: 0;
  }
  .moment-feed {
    padding: 10px;
  }
  .event-feed,
  .event-form {
    padding: 10px;
  }
  .event-card-head {
    grid-template-columns: 1fr;
  }
  .event-meta-pill {
    justify-self: start;
  }
  .event-form-row {
    grid-template-columns: 1fr;
  }
  .event-time-combo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .event-timezone-inline {
    max-width: 100%;
  }
  .event-join-button,
  .event-form .primary {
    width: 100%;
  }
  .chat-layout {
    height: calc(100dvh - 126px);
    min-height: 420px;
    border-radius: 0;
    border-inline: 0;
  }
  .chat-workspace .chat-layout {
    height: auto;
    min-height: 0;
  }
  .contacts-workspace .chat-layout {
    height: auto;
    min-height: 0;
  }
  .sidebar {
    border: 0;
  }
  .contact-row {
    border-right: 0;
    min-height: 70px;
    padding: 13px 16px;
  }
  .contact-row:hover,
  .contact-row.active {
    background: #fff;
  }
  .contact-row.active {
    box-shadow: none;
  }
  .contact-row.self {
    box-shadow: inset 3px 0 0 var(--green);
  }
  .conversation-head {
    min-height: 64px;
    padding: 10px 12px;
    gap: 10px;
    top: 0;
  }
  .conversation {
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }
  .conversation .composer {
    grid-row: 3;
    position: relative;
    bottom: auto;
    z-index: 11;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    background: #fff;
  }
  .conversation .message-list {
    grid-row: 4;
    padding-bottom: 18px;
  }
  .conversation-head h2 {
    font-size: 18px;
  }
  .conversation-head .secondary span {
    display: none;
  }
  .message,
  .message.mine {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .message.mine {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .message.mine .bubble,
  .message.mine .notes {
    grid-column: auto;
    grid-row: auto;
  }
  .composer {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-auto-rows: auto;
    align-content: start;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  }
  .composer .primary {
    width: auto;
    min-width: 48px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    padding: 0 13px;
  }
  .composer .primary span {
    display: none;
  }
  .app-shell.chat-composer-open .composer {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 11;
    height: auto;
    min-height: 0;
    max-height: calc(110px + env(safe-area-inset-bottom));
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    border-top: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
  }
  .app-shell.chat-composer-open .message-list {
    padding-bottom: 18px;
  }
  .app-shell.keyboard-open .bottom-tabs {
    display: none;
  }
}
