:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-strong: #d9e4ec;
  --text: #0f172a;
  --muted: #475569;
  --primary: #0f766e;
  --secondary: #d97706;
  --danger: #b91c1c;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 22px;
  --admin-bg: #09111d;
  --admin-panel: #101b2c;
  --admin-border: #243246;
  --space-1: .5rem;
  --space-2: .75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --font-display: 2rem;
  --font-h1: 1.45rem;
  --font-h2: 1.2rem;
  --font-h3: 1rem;
  --font-body: .96rem;
  --font-caption: .82rem;
  --theme-brand-primary: #0d9488;
  --theme-brand-secondary: #ea580c;
  --theme-brand-gradient: linear-gradient(135deg, #0f766e, #f97316);
  --theme-font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  --theme-browser-tab-color: #0f172a;
  --theme-surface-background: #f8fafc;
  --theme-surface-card: #ffffff;
  --theme-surface-card-soft: #ecfdf5;
  --theme-badge-background: #ef4444;
  --theme-badge-text: #ffffff;
  --theme-qr-foreground: #111827;
  --theme-qr-background: #ffffff;
  --chat-background-color: #f8fafc;
  --chat-message-bubble-self-color: #0f766e;
  --chat-message-bubble-other-color: #e2e8f0;
  --chat-text-color: #0f172a;
  --chat-font-size: 0.96rem;
  --chat-border-radius: 20px;
  --chat-spacing: 0.85rem;
  --chat-timestamp-style: #64748b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(13, 148, 136, 0.14), transparent 28%),
    linear-gradient(180deg, var(--theme-surface-background), #edf2f7 55%, #e2e8f0);
  color: var(--text);
  font-family: var(--theme-font-family);
  font-size: var(--font-body);
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
textarea { width: 100%; resize: vertical; }

.shell { width: min(1120px, calc(100vw - 2rem)); margin: 0 auto; padding: var(--space-4) 0 calc(var(--space-5) + 1rem); }
.shell-public { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.shell-public.narrow { width: min(620px, calc(100vw - 2rem)); }
.shell-public > * { width: 100%; }
.dashboard-shell {
  min-height: 100dvh;
  padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
}
.dashboard-content {
  width: min(760px, calc(100vw - 1.25rem));
  margin: 0 auto;
  padding: 5.5rem 0 1.5rem;
}
.hero-card, .panel {
  background: color-mix(in srgb, var(--theme-surface-card) 90%, transparent);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}
.hero-card {
  width: 100%;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1.1fr 1fr;
  padding: var(--space-4);
}
.panel { padding: var(--space-4); }
.panel h1,
.panel h2,
.panel h3,
.panel p,
.panel form,
.panel table,
.panel .stat-grid,
.panel .card-grid,
.panel .chart-list,
.panel .simple-list,
.panel .table-toolbar,
.panel .table-footer,
.panel .danger-banner {
  margin-top: 0;
  margin-bottom: var(--space-3);
}
.panel > :last-child { margin-bottom: 0; }
h1 { font-size: var(--font-h1); line-height: 1.2; }
h2 { font-size: var(--font-h2); line-height: 1.25; }
h3 { font-size: var(--font-h3); line-height: 1.3; }
.eyebrow {
  margin: 0 0 var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: var(--font-caption);
  color: var(--secondary);
}
.lede, .breadcrumbs { color: var(--muted); }
.form-grid, .inline-form { display: grid; gap: var(--space-3); }
.inline-form { grid-auto-flow: row; }
.full-span { grid-column: 1 / -1; }
label { display: grid; gap: .35rem; font-weight: 600; }
.field-hint {
  font-size: var(--font-caption);
  color: #94a3b8;
  line-height: 1.55;
  font-weight: 500;
}
input, select, textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: .8rem .9rem;
  min-width: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border-radius: 999px;
  padding: .8rem 1.1rem;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}
.btn-primary { background: var(--theme-brand-primary); color: white; }
.btn-secondary { background: #e2e8f0; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.icon-btn {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 14px;
  font-size: 1rem;
}
.icon-stack {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  color: #94a3b8;
  font-size: var(--font-caption);
}
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: inherit;
}
.sort-link .sort-indicator {
  color: #94a3b8;
  font-size: .8rem;
}
.word-grid, .checkbox-grid, .card-grid, .stat-grid, .grid, .pill-list {
  display: grid;
  gap: var(--space-3);
}
.word-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.card-grid-auth { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.card-grid-auth-compact { grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); }
.word-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem;
  border-radius: 16px;
  background: #f1f5f9;
}
.auth-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 108px;
  padding: 1rem;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(236,253,245,.94));
  border: 1px solid rgba(13, 148, 136, .22);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.auth-card-compact {
  min-height: 82px;
  padding: .7rem .5rem;
  border-radius: 20px;
}
.username-status {
  min-height: 1.4rem;
  font-size: var(--font-caption);
}
.input-valid {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.input-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.signup-avatar {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
}
.avatar-shell {
  position: relative;
  width: 6rem;
  height: 6rem;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: rgba(148, 163, 184, 0.2);
}
.signup-avatar img,
.signup-avatar .placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.signup-avatar img {
  object-fit: cover;
}
.signup-avatar .placeholder {
  display: grid;
  place-items: center;
  background: var(--theme-brand-gradient);
  color: white;
  font-size: 2rem;
  font-weight: 800;
}
.selection-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
  color: var(--muted);
  font-size: var(--font-caption);
}
.auth-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.auth-card span {
  font-weight: 800;
  font-size: .94rem;
  line-height: 1.05;
  word-break: break-word;
}
.emoji-card span {
  font-size: 2rem;
}
.auth-card:has(input:checked) {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(15,118,110,.14), rgba(249,115,22,.16));
  border-color: rgba(15,118,110,.6);
}
.auth-card-large {
  min-height: 122px;
}
.memory-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0 1.5rem;
}
.memory-card {
  padding: 1rem;
  border-radius: 22px;
  font-weight: 800;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, rgba(15,118,110,.95), rgba(234,88,12,.98));
  box-shadow: var(--shadow);
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.35);
}
.admin-login-hero {
  align-items: center;
  width: min(920px, calc(100vw - 2rem));
}
.inner-panel {
  margin: 1rem 0;
}
.chat-layout { display: grid; gap: 1rem; }
.user-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: .85rem 1rem;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.user-brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  font-weight: 800;
}
.user-brand-mark,
.header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.user-brand-mark {
  background: var(--theme-brand-gradient);
  color: white;
}
.header-avatar {
  background: rgba(15, 118, 110, 0.12);
  color: var(--theme-brand-primary);
  font-weight: 800;
}
.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-header-actions {
  display: flex;
  align-items: center;
  gap: .7rem;
}
.header-icon-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.dashboard-section {
  margin-bottom: var(--space-4);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.activity-pill {
  display: inline-flex;
  margin-bottom: var(--space-3);
  padding: .75rem 1rem;
  border-radius: 999px;
  background: rgba(15,118,110,.12);
  color: var(--theme-brand-primary);
  font-weight: 700;
}
.chat-card-list {
  display: grid;
  gap: .85rem;
}
.chat-card {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-card) 98%, transparent), color-mix(in srgb, var(--theme-surface-card-soft) 94%, transparent));
  border: 1px solid rgba(13, 148, 136, .16);
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.chat-card-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .9rem;
  align-items: center;
  padding: 1rem;
  background: inherit;
  transition: transform .2s ease;
}
.chat-card-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
}
.chat-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.chat-card-copy {
  min-width: 0;
}
.swipe-card-actions {
  position: absolute;
  inset: 0 0 0 auto;
  width: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .75rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, .16), rgba(249, 115, 22, .18));
}
.swipe-card.is-revealed .chat-card-body {
  transform: translateX(-6.4rem);
}
@media (hover: hover) {
  .swipe-card:hover .chat-card-body {
    transform: translateX(-6.4rem);
  }
}
.chat-card-row {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: baseline;
}
.chat-card-row time {
  color: var(--muted);
  font-size: var(--font-caption);
  white-space: nowrap;
}
.chat-card-message {
  margin: .35rem 0 0 !important;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-card-meta {
  display: grid;
  justify-items: end;
  gap: .5rem;
}
.chat-card-arrow {
  color: var(--theme-brand-primary);
  font-weight: 800;
}
.dashboard-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.5rem;
  padding: 1rem 1.2rem;
  border-radius: 999px;
  background: var(--theme-brand-primary);
  color: white;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(13, 148, 136, 0.24);
}
.module-grid-user {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
.module-card-user {
  position: relative;
  display: grid;
  gap: .55rem;
  padding: 1rem;
  border-radius: 22px;
  background: color-mix(in srgb, var(--theme-surface-card) 92%, transparent);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow);
}
.module-card-user-primary {
  background: linear-gradient(135deg, rgba(15,118,110,.16), rgba(249,115,22,.15));
  border-color: rgba(13, 148, 136, .26);
}
.module-icon {
  font-size: 1.5rem;
}
.module-label {
  font-weight: 700;
}
.notification-badge {
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 .35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-badge-background);
  color: var(--theme-badge-text);
  font-size: .72rem;
  font-weight: 800;
}
.header-badge,
.bottom-nav-badge,
.module-badge {
  position: absolute;
  top: -.2rem;
  right: -.2rem;
}
.module-badge {
  top: .7rem;
  right: .7rem;
}
.bottom-nav {
  position: fixed;
  left: .75rem;
  right: .75rem;
  bottom: .75rem;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  padding: .55rem;
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}
.bottom-nav a {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .22rem;
  min-height: 3.35rem;
  border-radius: 18px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
}
.bottom-nav a img {
  width: 1.3rem;
  height: 1.3rem;
  object-fit: contain;
}
.nav-icon-fallback {
  width: 1.3rem;
  height: 1.3rem;
  display: inline-grid;
  place-items: center;
}
.nav-icon-fallback svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bottom-nav a.active {
  background: rgba(15,118,110,.12);
  color: var(--theme-brand-primary);
}
.placeholder-panel {
  min-height: 50vh;
  display: grid;
  align-content: center;
}
.ios-homescreen-prompt {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at top, rgba(45, 212, 191, 0.32), transparent 34%),
    rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(14px);
}
.ios-homescreen-card {
  width: min(420px, calc(100vw - 1.5rem));
  padding: 1.7rem 1.35rem 1.25rem;
  border-radius: 30px;
  background:
    radial-gradient(circle at top, rgba(45, 212, 191, 0.25), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 1rem;
  text-align: center;
}
.homescreen-app-mark {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}
.homescreen-app-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.homescreen-app-mark span {
  font-size: 2rem;
  font-weight: 900;
  color: var(--theme-brand-primary);
}
.ios-homescreen-card h2 {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2rem);
}
.ios-homescreen-card p {
  margin: 0;
  line-height: 1.7;
}
.homescreen-instruction {
  font-weight: 700;
  color: #111827;
}
.share-glyph {
  color: var(--theme-brand-primary);
  font-weight: 900;
}
.prompt-open {
  overflow: hidden;
}
.empty-state {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: 24px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-card-soft) 95%, transparent), color-mix(in srgb, var(--theme-surface-background) 98%, transparent));
  border: 1px dashed rgba(148,163,184,.5);
  text-align: center;
}
.chat-room-shell {
  background: color-mix(in srgb, var(--chat-background-color) 94%, white);
}
.chat-room-head {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.chat-room-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  object-fit: cover;
}
.chat-panel {
  background: color-mix(in srgb, var(--chat-background-color) 94%, white);
}
.chat-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: var(--font-caption);
}
.message-list {
  display: grid;
  gap: var(--chat-spacing);
  max-height: 56vh;
  overflow: auto;
  padding-right: .25rem;
  scroll-behavior: smooth;
}
.message-bubble {
  max-width: min(84%, 34rem);
  padding: .85rem 1rem;
  border-radius: var(--chat-border-radius);
  display: grid;
  gap: .45rem;
  font-size: var(--chat-font-size);
  color: var(--chat-text-color);
  animation: messageIn .16s ease;
}
.message-bubble.is-own {
  margin-left: auto;
  background: color-mix(in srgb, var(--chat-message-bubble-self-color) 18%, white);
}
.message-bubble.is-other {
  margin-right: auto;
  background: color-mix(in srgb, var(--chat-message-bubble-other-color) 88%, white);
}
.message-meta-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
}
.message-time,
.message-status {
  color: var(--chat-timestamp-style);
}
.message-bubble.is-read .message-status {
  color: var(--theme-brand-primary);
  font-weight: 800;
}
.message-content {
  white-space: pre-wrap;
  word-break: break-word;
}
.message-reply-snippet {
  display: grid;
  gap: .2rem;
  padding: .55rem .7rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
  border-inline-start: 3px solid var(--theme-brand-primary);
  font-size: .88em;
}
.message-reply-snippet span {
  color: var(--muted);
}
.message-image-link {
  display: block;
}
.message-image {
  width: min(16rem, 100%);
  border-radius: 16px;
}
.file-chip,
.message-game-chip {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
}
.reply-preview,
.upload-progress,
.chat-drawer {
  margin-top: .8rem;
}
.reply-preview {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  padding: .8rem .9rem;
  border-radius: 18px;
  background: rgba(15, 118, 110, 0.08);
}
.upload-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.16);
}
.upload-progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #14b8a6, #f97316);
}
.chat-drawer {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  padding: .75rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.emoji-pill {
  border: 0;
  border-radius: 16px;
  padding: .55rem .7rem;
  background: rgba(255,255,255,.85);
  cursor: pointer;
}
.composer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: .65rem;
  align-items: end;
}
.quick-action-sheet {
  display: grid;
  gap: 1rem;
}
.quick-action-list {
  display: grid;
  gap: .65rem;
}
.file-list {
  display: grid;
  gap: .85rem;
}
.file-card {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.08);
}
.file-card-meta {
  display: grid;
  justify-items: end;
  gap: .45rem;
}
.mini-state {
  font-size: var(--font-caption);
  color: var(--theme-brand-primary);
}
.message-tools {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.message-translate-btn {
  border: 0;
  border-radius: 999px;
  padding: .35rem .7rem;
  background: rgba(15, 118, 110, 0.12);
  color: var(--theme-brand-primary);
  font-weight: 700;
}
.message-translation-output {
  color: var(--muted);
  font-size: var(--font-caption);
}
.module-meta-panel {
  margin-bottom: var(--space-4);
}
.status-panel {
  display: grid;
  gap: .5rem;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(148, 163, 184, 0.08);
}
.status-ok {
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #bbf7d0;
}
.status-error {
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.endpoint-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: center;
}
.endpoint-light {
  width: .9rem;
  height: .9rem;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(255,255,255,.04);
}
.endpoint-light-ok { background: #22c55e; }
.endpoint-light-error { background: #ef4444; }
.endpoint-light-neutral { background: #94a3b8; }
.translator-panel,
.translator-result {
  display: grid;
  gap: var(--space-3);
}
.translator-form-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.translator-status {
  color: var(--muted);
  font-size: var(--font-caption);
}
.translator-two-up {
  display: grid;
  gap: var(--space-3);
}
.translator-card {
  padding: 1rem;
  border-radius: 20px;
  background: color-mix(in srgb, var(--theme-surface-card-soft) 92%, transparent);
  border: 1px solid rgba(13, 148, 136, .14);
}
.composer { display: grid; gap: .8rem; margin-top: 1rem; }
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(180deg, #09111d, #0d1423 55%, #111c2d);
  color: #e2e8f0;
}
.admin-header {
  position: sticky;
  top: 0;
  z-index: 5;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: var(--space-3) 1.25rem;
  background: rgba(9, 17, 29, 0.92);
  border-bottom: 1px solid var(--admin-border);
  backdrop-filter: blur(12px);
}
.header-block {
  display: grid;
  gap: .25rem;
}
.admin-identity {
  font-size: 1rem;
}
.admin-sidebar {
  display: grid;
  align-content: start;
  gap: .4rem;
  padding: 1rem;
  border-right: 1px solid var(--admin-border);
}
.admin-sidebar a {
  padding: .85rem 1rem;
  border-radius: 16px;
  color: #cbd5e1;
}
.admin-sidebar a.active,
.admin-sidebar a:hover {
  background: rgba(13, 148, 136, 0.18);
  color: white;
}
.admin-content {
  padding: var(--space-4);
  min-width: 0;
}
.admin-footer {
  grid-column: 1 / -1;
  padding: .8rem 1rem;
  text-align: center;
  color: #94a3b8;
  border-top: 1px solid var(--admin-border);
  background: rgba(9, 17, 29, 0.92);
  font-size: var(--font-caption);
}
.admin-content .panel {
  background: rgba(16, 27, 44, 0.95);
  border: 1px solid var(--admin-border);
  color: #e2e8f0;
}
.warning-ribbon, .danger-banner {
  padding: .8rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(185, 28, 28, .22), rgba(251, 146, 60, .15));
  color: #fecaca;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.dismiss-warning-btn {
  border: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}
.danger-surface {
  background: linear-gradient(135deg, rgba(127, 29, 29, .88), rgba(69, 10, 10, .95)) !important;
}
.grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.module-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(15, 118, 110, .2), rgba(16, 27, 44, .98));
  border: 1px solid var(--admin-border);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.module-card-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 46px rgba(15, 23, 42, 0.28);
  border-color: rgba(20, 184, 166, 0.45);
  background: linear-gradient(180deg, rgba(20, 184, 166, .26), rgba(16, 27, 44, .98));
}
.module-card-link:active {
  transform: translateY(-1px) scale(.995);
}
.metric-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  font-size: 1.15rem;
}
.module-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin: 0;
}
.module-card dt,
.module-card dd {
  margin: 0;
  text-align: center;
}
.module-card dt {
  font-size: var(--font-caption);
  color: #94a3b8;
}
.module-card dd {
  font-size: 1.15rem;
  font-weight: 800;
}
.chip {
  width: fit-content;
  padding: .3rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
}
.chip-ok { background: rgba(16, 185, 129, .18); color: #86efac; }
.chip-muted { background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.chip-danger { background: rgba(239, 68, 68, .18); color: #fecaca; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  border-spacing: 0;
}
.data-table th,
.data-table td {
  padding: .8rem;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  font-size: var(--font-caption);
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.simple-list {
  display: grid;
  gap: var(--space-2);
}
.simple-list li,
.simple-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border-radius: 16px;
  background: rgba(148, 163, 184, 0.08);
}
.chart-list { display: grid; gap: var(--space-2); }
.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  min-height: 2rem;
}
.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
  width: 100%;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #f97316);
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}
.health-card {
  padding: var(--space-3);
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(148,163,184,.14);
}
.health-card strong {
  display: block;
  font-size: 1.4rem;
  margin-bottom: .25rem;
}
.health-card span {
  color: #94a3b8;
  font-size: var(--font-caption);
}
.media-thumb {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 14px;
  object-fit: cover;
  background: rgba(148,163,184,.14);
}
.entity-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pagination {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}
.preview-frame img,
.preview-frame video,
.preview-frame audio {
  width: 100%;
  border-radius: 18px;
}
.confirm-modal::backdrop {
  background: rgba(2, 6, 23, 0.72);
}
@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.modal-actions {
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
}
.flash-stack {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 20;
  display: grid;
  gap: .6rem;
}
.flash {
  padding: .9rem 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  background: white;
}
.module-intro-card {
  margin-bottom: var(--space-4);
}
.module-intro-card .eyebrow {
  color: #5eead4;
}
.theme-groups {
  display: grid;
  gap: var(--space-4);
}
.theme-group-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-error { color: #ef4444; font-weight: 700; }

@media (max-width: 900px) {
  .hero-card,
  .admin-shell,
  .grid.two-up,
  .user-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    grid-auto-flow: column;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--admin-border);
  }
  .admin-content {
    padding: var(--space-3);
  }
  .bar-row {
    grid-template-columns: 1fr;
  }
  .dashboard-content {
    width: min(720px, calc(100vw - 1rem));
    padding-top: 5rem;
  }
  .translator-two-up {
    grid-template-columns: 1fr;
  }
  .card-grid-auth-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
  }
  .auth-card-compact {
    min-height: 72px;
    padding: .55rem .35rem;
  }
  .auth-card span {
    font-size: 1rem;
  }
  .emoji-card span {
    font-size: 1.85rem;
  }
  .theme-group-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .translator-two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 1rem, 1120px);
    padding: var(--space-3) 0 calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  }
  .dashboard-content {
    width: min(100vw - 1rem, 760px);
    padding-top: 5.15rem;
  }
  .panel,
  .hero-card,
  .chat-card,
  .module-card-user,
  .ios-homescreen-card {
    border-radius: 20px;
  }
  .panel {
    padding: 1rem;
  }
  .data-table th,
  .data-table td {
    padding: .72rem .64rem;
  }
  .word-grid,
  .checkbox-grid,
  .card-grid,
  .stat-grid,
  .grid,
  .pill-list,
  .chat-card-list,
  .module-grid-user {
    gap: .75rem;
  }
  .bottom-nav {
    left: .5rem;
    right: .5rem;
    bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
  }
  .composer-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .composer-row > :last-child {
    display: none;
  }
  .message-bubble {
    max-width: 92%;
  }
  .file-card {
    align-items: start;
    flex-direction: column;
  }
  .swipe-card-actions {
    width: 6.3rem;
    gap: .35rem;
    padding: .6rem;
  }
  .swipe-card.is-revealed .chat-card-body {
    transform: translateX(-5.8rem);
  }
}
