:root {
  color-scheme: light;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #f7f9fc;
  --panel: #ffffff;
  --accent: #0d9488;
  --accent-dark: #0f5f5a;
  --accent-2: #f97316;
  --accent-soft: #e7f8f5;
  --rose: #db2777;
  --blue: #2563eb;
  --gold: #facc15;
  --shadow: 0 22px 70px rgba(16, 24, 40, 0.18);
  --soft-shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 10%, rgba(13, 148, 136, 0.2), transparent 27rem),
    radial-gradient(circle at 88% 18%, rgba(249, 115, 22, 0.2), transparent 25rem),
    linear-gradient(135deg, #eaf0f8 0%, #fffdf8 54%, #e8f7f3 100%);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.phone-shell {
  position: relative;
  width: min(430px, 100vw);
  height: min(900px, 100vh);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 249, 252, 0.96) 34%),
    var(--paper);
  box-shadow: var(--shadow);
}

.screen {
  display: none;
  height: 100%;
  padding: 24px 18px 96px;
  overflow-y: auto;
}

.screen.is-active {
  display: block;
}

.topbar,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-header {
  align-items: flex-start;
}

.topbar.compact {
  margin-bottom: 18px;
}

.eyebrow,
.small-label {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 300px;
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.02;
  letter-spacing: 0;
}

.sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 10px 0 0;
  padding: 0 9px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 850;
}

.sync-status.is-online {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #047857;
}

.sync-status.is-offline {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.auth-gate {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: center;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(247, 249, 252, 0.72), rgba(247, 249, 252, 0.96)),
    radial-gradient(circle at 15% 12%, rgba(13, 148, 136, 0.2), transparent 16rem);
  backdrop-filter: blur(12px);
}

.auth-gate.is-hidden {
  display: none;
}

.auth-card {
  padding: 22px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: block;
  width: 172px;
  height: auto;
  margin-bottom: 16px;
}

.brand-lockup-small {
  width: 132px;
  margin-bottom: 10px;
}

.auth-card h1 {
  max-width: none;
  font-size: 1.85rem;
}

.auth-copy {
  margin: 10px 0 18px;
  color: var(--muted);
  line-height: 1.4;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 850;
}

.auth-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.auth-form {
  display: grid;
  gap: 11px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.auth-form .auth-consent {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 9px;
  line-height: 1.35;
  padding: 10px 11px;
}

.auth-form .auth-consent input {
  min-height: 18px;
  width: 18px;
}

.auth-gate[data-mode="login"] .register-only {
  display: none;
}

.auth-error {
  min-height: 18px;
  margin: 0;
  color: #be123c;
  font-size: 0.84rem;
  font-weight: 800;
}

.auth-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 2px 0 0;
  color: #98a2b3;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-legal-links a {
  color: var(--accent-dark);
  text-decoration: none;
}

.legal-page {
  display: block;
  min-height: 100vh;
  padding: 24px;
}

.legal-shell {
  width: min(920px, 100%);
  margin: 0 auto;
}

.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.legal-nav div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-nav a {
  color: var(--accent-dark);
  font-weight: 850;
  text-decoration: none;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.legal-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.legal-card {
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 6vw, 4rem);
}

.legal-card h2 {
  margin: 30px 0 10px;
  font-size: 1.15rem;
}

.legal-card p,
.legal-card li {
  color: #475467;
  font-size: 1rem;
  line-height: 1.65;
}

.legal-card a {
  color: var(--accent-dark);
  font-weight: 850;
}

.legal-updated {
  color: #667085;
  font-weight: 800;
}

.legal-lede {
  max-width: 760px;
  margin-bottom: 26px;
  color: #344054;
  font-size: 1.12rem;
}

.legal-card ul {
  padding-left: 1.2rem;
}

.legal-card ol {
  padding-left: 1.35rem;
}

.legal-card table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  overflow-wrap: break-word;
}

.legal-card th,
.legal-card td {
  padding: 10px;
  border: 1px solid var(--line);
  color: #475467;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
  vertical-align: top;
  word-break: normal;
}

.legal-card th {
  background: #f8fafc;
  color: var(--ink);
  font-weight: 850;
}

.legal-table-scroll {
  overflow-x: auto;
}

.legal-table-scroll table {
  min-width: 680px;
}

.legal-callout {
  display: grid;
  gap: 6px;
  max-width: 420px;
  padding: 16px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 8px;
  background: var(--accent-soft);
}

.legal-callout strong {
  color: var(--accent-dark);
}

.legal-callout span {
  color: var(--ink);
  font-weight: 850;
}

@media (max-width: 640px) {
  .legal-page {
    padding: 12px;
  }

  .legal-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

.icon-button,
.send-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.send-button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.notification-button {
  position: relative;
}

.notification-button strong,
.nav-badge,
.unread-badge {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #be123c;
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
}

.notification-button strong {
  position: absolute;
  top: -7px;
  right: -7px;
  border: 2px solid white;
}

.notification-button strong[hidden],
.nav-badge[hidden] {
  display: none;
}

.practice-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
  padding: 18px;
  border: 1px solid rgba(13, 148, 136, 0.15);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.96) 0%, rgba(37, 99, 235, 0.86) 55%, rgba(249, 115, 22, 0.88) 100%);
  color: white;
  box-shadow: var(--soft-shadow);
}

.practice-card .small-label {
  color: rgba(255, 255, 255, 0.76);
}

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

.practice-copy strong {
  display: block;
  font-size: 1.1rem;
}

.practice-copy p {
  max-width: 245px;
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.88rem;
  line-height: 1.35;
}

.streak-ring {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 7px solid rgba(255, 255, 255, 0.34);
  border-top-color: var(--gold);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.streak-ring strong,
.streak-ring span {
  display: block;
  line-height: 1;
}

.streak-ring strong {
  font-size: 1.15rem;
}

.streak-ring span {
  font-size: 0.68rem;
  font-weight: 800;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.quick-stats div {
  padding: 11px 8px;
  border: 1px solid rgba(228, 231, 236, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.quick-stats strong,
.quick-stats span {
  display: block;
}

.quick-stats strong {
  font-size: 1.05rem;
}

.quick-stats span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.ghost-button,
.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 750;
}

.ghost-button {
  padding: 10px 12px;
}

.language-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.language-filters::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
}

.chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.18);
}

.profiles {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.profile-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 13px;
  padding: 12px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.06);
}

.avatar-wrap {
  position: relative;
  width: 74px;
  height: 74px;
}

.avatar {
  position: relative;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--photo);
  box-shadow: inset 0 -16px 24px rgba(16, 24, 40, 0.12);
}

.avatar-wrap .avatar {
  width: 74px;
  height: 74px;
}

.avatar::before {
  content: "";
  position: absolute;
  left: 20%;
  top: 15%;
  width: 42%;
  height: 42%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
}

.avatar::after {
  content: "";
  position: absolute;
  left: 12%;
  bottom: 0;
  width: 74%;
  height: 42%;
  border-radius: 42% 42% 0 0;
  background: rgba(255, 255, 255, 0.82);
}

.avatar-small {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

.online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 17px;
  height: 17px;
  border: 3px solid white;
  border-radius: 999px;
  background: #22c55e;
}

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

.profile-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-heading h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.profile-heading span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 8px;
  background: #fff7ed;
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 900;
}

.profile-copy p {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.3;
}

.profile-copy .location-line {
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.match-reason {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 8px;
  border-radius: 8px;
  background: #eef4fb;
  color: #344054;
  font-size: 0.74rem;
  font-weight: 750;
}

.connected-tag {
  background: #ecfdf3;
  color: #047857;
}

.real-user-tag {
  background: #ecfdf3;
  color: #047857;
}

.demo-user-tag {
  background: #f8fafc;
  color: #667085;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}

.primary-button,
.secondary-button {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 10px 18px rgba(13, 148, 136, 0.22);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.chat-header {
  justify-content: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(228, 231, 236, 0.9);
}

.chat-header h1 {
  font-size: 1.1rem;
}

.chat-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.conversation {
  display: flex;
  min-height: calc(100% - 152px);
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 92px;
}

.message {
  display: grid;
  gap: 6px;
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 8px;
  line-height: 1.35;
  box-shadow: 0 8px 16px rgba(16, 24, 40, 0.04);
}

.message.them {
  align-self: flex-start;
  border: 1px solid rgba(228, 231, 236, 0.95);
  background: white;
}

.message.me {
  align-self: flex-end;
  background: linear-gradient(135deg, #dff8f2, #e6efff);
  color: #073f3c;
}

.message.is-error {
  border: 1px solid rgba(190, 18, 60, 0.24);
  background: #fff1f2;
  color: #881337;
}

.message.is-pending {
  opacity: 0.88;
}

.translation {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.message-status {
  display: block;
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: right;
}

.message-status.is-pending {
  color: #64748b;
}

.message-status.is-seen {
  color: #0f766e;
}

.message.is-error .message-status,
.message-status.is-error {
  color: #be123c;
}

.chat-empty {
  display: grid;
  gap: 6px;
  align-self: center;
  max-width: 260px;
  margin-top: 24px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  text-align: center;
}

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

.chat-empty span {
  font-size: 0.86rem;
  line-height: 1.35;
}

.correction-button,
.retry-button {
  justify-self: end;
  min-height: 30px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 8px;
  padding: 0 9px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 850;
}

.message.is-error .retry-button {
  border-color: rgba(190, 18, 60, 0.24);
  color: #be123c;
}

.typing-indicator {
  position: absolute;
  left: 14px;
  bottom: 184px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 28px);
  padding: 9px 11px;
  border: 1px solid rgba(228, 231, 236, 0.95);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  box-shadow: 0 8px 16px rgba(16, 24, 40, 0.04);
}

.typing-indicator[hidden] {
  display: none;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  animation: typingPulse 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.14s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.28s;
}

.typing-indicator strong {
  margin-left: 4px;
  font-size: 0.78rem;
}

.chat-send-warning {
  position: absolute;
  right: 14px;
  bottom: 139px;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.96);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.chat-send-warning.is-error {
  border-color: rgba(190, 18, 60, 0.24);
  background: rgba(255, 241, 242, 0.98);
  color: #be123c;
}

.chat-send-warning[hidden] {
  display: none;
}

.chat-send-warning button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid currentColor;
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 900;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 72px;
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.composer input {
  min-width: 0;
  flex: 1;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  outline: none;
}

.composer input:focus {
  border-color: var(--accent);
}

.section-note {
  margin: -8px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.chat-inbox-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.chat-inbox-summary div {
  min-width: 0;
  padding: 11px 10px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.chat-inbox-summary span,
.chat-inbox-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inbox-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-inbox-summary strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 1rem;
}

.chat-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.chat-search {
  display: grid;
  gap: 6px;
}

.chat-search span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.chat-search input {
  width: 100%;
  height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  outline: none;
}

.chat-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.chat-filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.chat-filter-tabs button {
  height: 40px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.chat-filter-tabs button.is-selected {
  border-color: rgba(13, 148, 136, 0.55);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.match-list {
  display: grid;
  gap: 11px;
}

.match-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.05);
}

.match-row .avatar {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

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

.match-content {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.chat-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.chat-heading strong {
  display: block;
  min-width: 0;
  margin-bottom: 0;
}

.chat-heading span,
.chat-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.chat-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-meta-row .chat-meta {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-status {
  flex: 0 1 auto;
  max-width: 118px;
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf2f7;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-unread .chat-status {
  background: rgba(13, 148, 136, 0.13);
  color: var(--accent-dark);
}

.chat-status.is-error {
  background: #fff1f2;
  color: #be123c;
}

.chat-preview {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.has-unread {
  border-color: rgba(13, 148, 136, 0.34);
  background: rgba(236, 253, 245, 0.72);
}

.unread-badge {
  flex: 0 0 auto;
}

.empty-state {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
}

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

.practice-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 22px rgba(16, 24, 40, 0.05);
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title-row strong {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.82rem;
}

.ai-status {
  width: fit-content;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #ecfdf3;
  color: #047857;
  font-size: 0.76rem;
  font-weight: 850;
}

.latest-correction,
.vocabulary-list {
  display: grid;
  gap: 9px;
}

.correction-preview {
  display: grid;
  gap: 7px;
}

.correction-preview span,
.correction-result span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.correction-preview p,
.correction-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.correction-preview strong,
.correction-result strong {
  color: var(--ink);
  line-height: 1.35;
}

.correction-preview small {
  color: var(--accent-dark);
  line-height: 1.35;
}

.vocabulary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: #f8fafc;
}

.vocabulary-row div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.vocabulary-row strong,
.vocabulary-row span {
  overflow-wrap: anywhere;
}

.vocabulary-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.vocabulary-row small {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 8px;
  background: #fff7ed;
  color: #b45309;
  font-weight: 850;
}

.progress-panel {
  padding: 22px 16px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  box-shadow: var(--soft-shadow);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--blue), var(--accent-2));
  color: white;
  font-size: 2rem;
  font-weight: 900;
}

.progress-panel h2 {
  margin-bottom: 4px;
}

.progress-panel p {
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.stats-grid div {
  padding: 12px 6px;
  border-radius: 8px;
  background: #f5f8fb;
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.level-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: white;
}

.level-card strong {
  display: block;
  margin-bottom: 12px;
}

.profile-detail-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: white;
}

.profile-detail-card p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.profile-meta {
  margin-top: 12px;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 850;
}

.level-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.level-bar span {
  display: block;
  width: 66%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.settings-list button {
  min-height: 48px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-align: left;
  padding: 0 14px;
  font-weight: 800;
}

.settings-list button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.push-status {
  margin: -2px 0 2px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.push-status.is-ready {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #047857;
}

.push-status[hidden] {
  display: none;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 72px;
  border-top: 1px solid rgba(228, 231, 236, 0.9);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.nav-item {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.nav-item span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border-radius: 8px;
  font-size: 1.05rem;
}

.nav-item.is-active {
  color: var(--accent);
}

.nav-item.is-active span {
  background: var(--accent-soft);
}

.nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 32px);
  min-width: 18px;
  height: 18px;
  border: 2px solid white;
  font-size: 0.64rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  align-items: end;
  padding: 16px;
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  position: relative;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(228, 231, 236, 0.9);
  border-radius: 8px;
  background: white;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.24);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
}

.person-modal-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 42px;
}

.avatar-large {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
}

.person-modal-head h2,
.modal-sheet h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.person-modal-head p,
.modal-copy {
  color: var(--muted);
  line-height: 1.35;
}

.modal-copy {
  margin: 14px 0 12px;
}

.modal-tags {
  margin-bottom: 14px;
}

.modal-actions {
  display: flex;
  gap: 9px;
}

.modal-actions button:disabled,
.correction-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.correction-result {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.correction-vocabulary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.suggested-word {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: #eff6ff;
}

.suggested-word strong {
  color: #1e3a8a;
  font-size: 0.86rem;
}

.suggested-word small {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 760;
}

.profile-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.profile-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.profile-form input,
.profile-form select,
.profile-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  outline: none;
}

.profile-form textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

@media (max-width: 480px) {
  body {
    display: block;
    background: var(--paper);
  }

  .phone-shell {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    box-shadow: none;
  }
}
