:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #eef2f7;
  --text: #172033;
  --muted: #647084;
  --line: #dce3ed;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #168356;
  --danger: #c43838;
  --warning: #d97706;
  --shadow: 0 18px 45px rgba(24, 34, 58, 0.1);
  --own-message-bg: #dbeafe;
  --own-message-line: #93c5fd;
  --scroll-thumb: #a8b7cc;
  --scroll-track: #edf2f8;
}

.theme-dark {
  --bg: #111827;
  --surface: #1f2937;
  --surface-soft: #273447;
  --text: #f8fafc;
  --muted: #aeb8c8;
  --line: #3b485d;
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  --own-message-bg: #1e3a5f;
  --own-message-line: #3b82f6;
  --scroll-thumb: #4b607c;
  --scroll-track: #1a2535;
}

.theme-dark-purple {
  --bg: #0b0b10;
  --surface: #181820;
  --surface-soft: #242432;
  --surface-raised: rgba(24, 24, 32, 0.9);
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #f59e0b;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
  --own-message-bg: #2f2158;
  --own-message-line: #8b5cf6;
  --scroll-thumb: #6d5ba8;
  --scroll-track: #171722;
}

.theme-ocean {
  --bg: #eef8fb;
  --surface: #ffffff;
  --surface-soft: #dff1f6;
  --text: #12313d;
  --muted: #597381;
  --line: #bddbe5;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --success: #0f9f6e;
  --danger: #d94141;
  --warning: #b45309;
  --shadow: 0 18px 45px rgba(2, 89, 126, 0.12);
  --own-message-bg: #c9edf7;
  --own-message-line: #7dd3fc;
  --scroll-thumb: #7bb9cc;
  --scroll-track: #dff1f6;
}

.theme-forest {
  --bg: #f2f8f3;
  --surface: #ffffff;
  --surface-soft: #e2f1e4;
  --text: #17351f;
  --muted: #607666;
  --line: #c6ddcb;
  --primary: #2f855a;
  --primary-dark: #276749;
  --success: #168356;
  --danger: #c24141;
  --warning: #92400e;
  --shadow: 0 18px 45px rgba(38, 103, 73, 0.12);
  --own-message-bg: #d9f5df;
  --own-message-line: #86efac;
  --scroll-thumb: #8cbe98;
  --scroll-track: #e2f1e4;
}

.theme-rose {
  --bg: #fff5f7;
  --surface: #ffffff;
  --surface-soft: #fde8ee;
  --text: #3d1f2b;
  --muted: #826273;
  --line: #f4c7d5;
  --primary: #db2777;
  --primary-dark: #be185d;
  --success: #168356;
  --danger: #dc2626;
  --warning: #b45309;
  --shadow: 0 18px 45px rgba(190, 24, 93, 0.12);
  --own-message-bg: #fce7f3;
  --own-message-line: #f9a8d4;
  --scroll-thumb: #e79ab9;
  --scroll-track: #fde8ee;
}

.theme-mino {
  --bg: #fbf6ea;
  --surface: #fffdf7;
  --surface-soft: #f2eadc;
  --text: #211f1c;
  --muted: #756b5c;
  --line: #e3d7c6;
  --primary: #e97983;
  --primary-dark: #c95763;
  --success: #5f8f72;
  --danger: #b9414c;
  --warning: #92400e;
  --shadow: 0 18px 45px rgba(92, 72, 48, 0.12);
  --own-message-bg: #ffe5e8;
  --own-message-line: #f3a1a8;
  --scroll-thumb: #d3bfa4;
  --scroll-track: #f3eadb;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 35%, transparent) 1px, transparent 1px),
    linear-gradient(0deg, color-mix(in srgb, var(--line) 28%, transparent) 1px, transparent 1px),
    var(--bg);
  background-size: 58px 58px, 58px 58px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

body.embedded-view {
  min-height: 100vh;
}

main {
  flex: 1;
}

.embedded-view main {
  display: block;
  padding: 14px;
}

.embedded-view .chat-layout,
.embedded-view .profile-layout {
  width: 100%;
  height: calc(100vh - 28px);
  margin: 0;
}

.embedded-view .admin-layout,
.embedded-view .admin-shell,
.embedded-view .legal-page,
.embedded-view .notifications-page,
.embedded-view .friends-page {
  width: 100%;
  margin: 0;
}

.embedded-view .call-panel,
.embedded-view .site-footer {
  display: none;
}

.embedded-view .chat-sidebar {
  padding: 14px;
}

.embedded-view .chat-sidebar > div:first-child p.muted:last-child {
  display: none;
}

.embedded-view .room-list {
  max-height: 148px;
  overflow-y: auto;
}

.embedded-view .chat-sidebar > .button {
  display: none;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.theme-dark .brand img {
  filter: hue-rotate(25deg) brightness(1.2);
}

.theme-dark-purple .brand img {
  filter: hue-rotate(190deg) saturate(1.12) brightness(1.05);
}

.theme-forest .brand img {
  filter: hue-rotate(95deg) saturate(0.9);
}

.theme-rose .brand img {
  filter: hue-rotate(135deg) saturate(1.1);
}

.theme-ocean .brand img {
  filter: hue-rotate(20deg);
}

.theme-mino .site-header {
  background: color-mix(in srgb, var(--surface) 92%, #f7dfe1);
}

.theme-mino .brand img {
  filter: none;
}

.mino-home-helper,
.mino-helper,
.mino-chat-watermark,
.mino-page-corner {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-toggle {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  align-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, var(--primary) 14%);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 10%, transparent);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease, width 160ms ease;
}

.nav-toggle span:nth-child(2) {
  width: 15px;
  justify-self: end;
}

.site-header.nav-open .nav-toggle span:first-child {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle strong {
  position: absolute;
  right: -6px;
  top: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 900;
}

.nav a,
.link-button,
.call-nav-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 700;
}

.nav a:hover,
.link-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.call-nav-status {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary);
}

.call-nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-badge,
.unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
}

.nav-cta {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.flash {
  width: min(760px, calc(100% - 32px));
  margin: 8px auto 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff7e6;
  color: #7a4f00;
}

.flash.success {
  background: #e8f7ef;
  color: #0f6b45;
}

.flash.error {
  background: #fdecec;
  color: #9a2323;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
  gap: 48px;
  align-items: center;
  width: min(1120px, calc(100% - 32px));
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero h1,
.auth-card h1,
.page-heading h1,
.chat-sidebar h1 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 720px;
  font-size: clamp(2.4rem, 5.6vw, 5rem);
}

.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.button.full {
  width: 100%;
}

.status-panel,
.auth-card,
.chat-sidebar,
.chat-room,
.admin-section,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.status-panel div {
  padding: 18px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.status-panel p,
.auth-card p,
.muted {
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.status-dot.blue {
  background: var(--primary);
}

.status-dot.green {
  background: var(--success);
}

.hero-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-mini-stats span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.home-chat-preview,
.home-feature-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-feature-wrap {
  position: relative;
}

.mino-home-helper {
  position: absolute;
  right: -118px;
  top: 46px;
  z-index: 3;
  width: 150px;
  pointer-events: none;
  filter: drop-shadow(0 18px 20px rgba(33, 31, 28, 0.14));
}

.home-feature-panel article {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.home-feature-panel p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.feature-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 48px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 150px);
  margin: 0 auto;
  padding: 42px 0;
}

.app-hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.7rem, 5.8vw, 5.8rem);
  line-height: 0.98;
}

.app-showcase {
  position: relative;
}

.app-showcase::before {
  content: "";
  position: absolute;
  inset: 10% -5% -8% 8%;
  border-radius: 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 24%, transparent), color-mix(in srgb, var(--surface-soft) 80%, transparent));
  filter: blur(34px);
  opacity: 0.7;
}

.app-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
}

.app-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
}

.app-window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #ef6f7f;
}

.app-window-bar span:nth-child(2) {
  background: #e6ba58;
}

.app-window-bar span:nth-child(3) {
  background: #62be83;
}

.app-window-bar strong {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}

.app-window-body {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: 420px;
}

.app-window-body aside {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.app-window-body aside b {
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  font-size: 0.88rem;
}

.app-window-main {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 26px;
}

.preview-message {
  width: min(360px, 88%);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.preview-message strong,
.preview-message span {
  display: block;
}

.preview-message span {
  margin-top: 4px;
  color: var(--muted);
}

.preview-message.right {
  justify-self: end;
  background: var(--own-message-bg);
  border-color: var(--own-message-line);
}

.preview-call-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
  padding: 18px;
  border-radius: 14px;
  background: #1f2937;
  color: white;
}

.preview-call-card small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 800;
  text-transform: uppercase;
}

.preview-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 42px;
}

.preview-wave i {
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  animation: wavePulse 1.2s infinite ease-in-out;
}

.preview-wave i:nth-child(2) { height: 32px; animation-delay: 0.12s; }
.preview-wave i:nth-child(3) { height: 24px; animation-delay: 0.24s; }
.preview-wave i:nth-child(4) { height: 36px; animation-delay: 0.36s; }

@keyframes wavePulse {
  0%, 100% { transform: scaleY(0.62); }
  50% { transform: scaleY(1); }
}

.app-feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  width: min(1180px, calc(100% - 32px));
  margin: -18px auto 56px;
}

.app-feature-strip article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.app-feature-strip span {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 900;
}

.app-feature-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.why-teaser {
  width: min(1120px, calc(100% - 32px));
  margin: -44px auto 44px;
  text-align: center;
}

.why-teaser a {
  color: var(--muted);
  font-weight: 800;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.preview-header span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
}

.preview-header small {
  margin-left: auto;
  color: var(--muted);
  font-weight: 800;
}

.preview-message {
  max-width: 86%;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.preview-message.mine {
  justify-self: end;
  background: var(--own-message-bg);
  border: 1px solid var(--own-message-line);
}

.preview-message p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 110px);
  padding: 32px 16px;
}

.auth-card {
  width: min(430px, 100%);
  padding: 28px;
}

.auth-card.wide-card {
  width: min(620px, 100%);
}

.error-card {
  width: min(520px, 100%);
  text-align: left;
}

.error-card .actions {
  margin-top: 18px;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.confirm-dialog {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.confirm-dialog h2 {
  margin: 0;
}

.confirm-dialog p {
  color: var(--muted);
}

.prompt-dialog textarea {
  width: 100%;
  min-height: 120px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.source-dialog {
  width: min(840px, 100%);
}

.source-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.source-dialog-head p {
  margin: 7px 0 0;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-height: min(58vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.source-option {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.source-option:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.source-option img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface);
}

.source-option span {
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.auth-card label {
  display: block;
  margin: 18px 0 8px;
  font-weight: 800;
}

.auth-card input,
.message-form input,
.profile-form input,
.profile-form textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
}

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

.auth-card input:focus,
.message-form input:focus,
.profile-form input:focus,
.profile-form textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.16);
}

.small-text {
  font-size: 0.95rem;
  text-align: center;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  height: calc(100vh - 116px);
  margin: 8px auto 32px;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.chat-room {
  display: grid;
  grid-template-rows: 1fr auto auto;
  min-height: 0;
  overflow: hidden;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 22px;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
  position: relative;
  z-index: 1;
}

.messages::-webkit-scrollbar {
  width: 10px;
}

.messages::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
}

.messages::-webkit-scrollbar-thumb {
  border: 2px solid var(--scroll-track);
  border-radius: 999px;
  background: var(--scroll-thumb);
}

.messages::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.message {
  display: flex;
}

.message.mine {
  justify-content: flex-end;
}

.message.mine .message-body {
  background: var(--own-message-bg);
  border: 1px solid var(--own-message-line);
}

.message-body {
  max-width: 760px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
}

.message-meta span,
.admin-message span {
  color: var(--muted);
  font-size: 0.86rem;
}

.message-meta .admin-name {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 900;
}

.message p,
.admin-message p {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.message p {
  padding-right: 26px;
}

.message-body {
  position: relative;
}

.message-menu {
  position: absolute;
  right: 8px;
  bottom: 6px;
}

.message-menu-trigger {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
}

.message-menu-trigger:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.message-menu-items {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 5;
  display: none;
  min-width: 120px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.message:first-child .message-menu-items,
.message:nth-child(2) .message-menu-items {
  top: 28px;
  bottom: auto;
}

.message-menu.open .message-menu-items {
  display: grid;
  gap: 4px;
}

.message-menu-items button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-weight: 800;
}

.message-menu-items button:hover {
  background: var(--surface-soft);
}

.typing-indicator {
  min-height: 22px;
  margin: 0;
  padding: 0 18px 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}


.chat-notice {
  min-height: 22px;
  margin: 0;
  padding: 0 16px 14px;
  color: var(--danger);
}

.chat-notice.success {
  color: var(--success);
}

.call-panel {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.call-panel .eyebrow,
.call-panel p {
  margin: 0;
}

.call-actions {
  display: grid;
  gap: 8px;
}

.call-actions .button {
  min-height: 40px;
  padding: 0 12px;
}

.call-actions .icon-button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 0;
}

.call-actions .icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.call-actions .icon-button .button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.video-fullscreen-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.video-fullscreen-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-fullscreen-button .button-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.call-room-page {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(380px, 1fr) minmax(460px, 1.15fr);
  align-items: stretch;
  gap: 20px;
  width: min(1380px, calc(100% - 32px));
  min-height: calc(100vh - 120px);
  margin: 24px auto 40px;
}

.call-room-page.media-active {
  grid-template-columns: minmax(560px, 1.45fr) minmax(340px, 0.85fr);
}

.call-room-page.media-active .call-browse-card {
  display: none;
}

.call-room-page.media-active .call-card {
  width: 100%;
}

.call-room-page.video-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.call-room-page.video-expanded .call-chat-card,
.call-room-page.video-expanded .call-browse-card {
  display: none;
}

.call-room-page.video-expanded .call-card {
  min-height: calc(100vh - 150px);
}

.call-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(380px, 100%);
  min-height: 520px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.call-card h1 {
  margin: 0;
}

.call-card.speaking {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow);
}

.call-card.speaking .profile-avatar {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 24%, transparent);
}

.call-card .call-actions {
  width: 100%;
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}

.video-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #050816;
}

.video-stage:fullscreen video {
  object-fit: contain;
}

.video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-stage #localVideo,
.video-stage #remotePipVideo {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 34%;
  max-width: 132px;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
  object-fit: cover;
}

.video-stage #localVideo {
  transform: scaleX(-1);
}

.screen-active .video-stage #localVideo {
  top: 10px;
  right: 10px;
  bottom: auto;
}

.video-stage #remotePipVideo {
  left: 10px;
  right: auto;
}

.video-stage:not(.has-remote-pip) #remotePipVideo {
  display: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
  text-align: center;
}

.video-placeholder .small-avatar,
.video-placeholder strong {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255, 255, 255, 0.36);
}

.video-placeholder strong {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.3rem;
}

.video-stage.has-remote-video .video-placeholder {
  display: none;
}

.video-stage:not(.has-local-video) #localVideo {
  display: none;
}

.media-active .video-stage {
  aspect-ratio: 16 / 9;
}

.video-expanded .video-stage {
  max-height: none;
  min-height: min(72vh, 760px);
}

.call-volume-strip {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  width: 100%;
}

.call-device-dock {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.device-picker {
  position: relative;
}

.device-picker-button {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.device-picker-button span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.device-picker-button strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: grid;
  max-height: 230px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.device-menu-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.device-menu-option:hover {
  background: var(--surface-soft);
}

.device-menu-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-menu-option strong {
  color: var(--primary);
}

.desktop-settings-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.desktop-settings-launcher:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.desktop-settings-launcher svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.call-audio-active .call-volume-strip {
  display: grid;
}

.volume-control {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: left;
}

.volume-control span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.volume-control input {
  width: 100%;
  accent-color: var(--primary);
}

.device-control select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.video-expanded .call-volume-strip {
  width: min(520px, 100%);
}

.connection-quality {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  min-width: 112px;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
}

.connection-quality strong {
  color: var(--text);
}

.connection-quality small {
  margin-left: 0;
  font-weight: 800;
}

.quality-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--muted);
}

.quality-good .quality-dot {
  background: var(--success);
}

.quality-ok .quality-dot {
  background: #d99528;
}

.quality-poor .quality-dot {
  background: var(--danger);
}

.call-chat-card {
  display: grid;
  grid-template-rows: auto minmax(380px, 1fr) auto auto;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.call-chat-card > div:first-child {
  padding: 20px 20px 0;
}

.call-chat-card h2 {
  margin: 0 0 12px;
}

.call-messages {
  min-height: 0;
}

.call-browse-card {
  display: grid;
  grid-template-rows: auto minmax(560px, 1fr);
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.call-browse-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.call-browse-header.compact {
  padding: 14px;
}

.call-browse-header .inline-actions {
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.call-browse-header .small-button {
  min-width: 112px;
  justify-content: center;
}

.call-browse-header h2,
.call-browse-header p {
  margin: 0;
}

.call-browse-frame {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: var(--bg);
}

.call-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100% - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: toastIn 180ms ease-out;
}

.call-toast p {
  margin: 2px 0 0;
  color: var(--muted);
}

.call-toast .small-button {
  flex: 0 0 auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty-state {
  margin: auto;
  color: var(--muted);
}

.admin-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.page-heading {
  margin-bottom: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.admin-message-center {
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
}

.admin-section {
  padding: 22px;
  overflow: hidden;
}

.admin-section h2 {
  margin-top: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.message-list {
  display: grid;
  gap: 12px;
}

.admin-message {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.compact-message-list {
  gap: 8px;
}

.contact-message-card {
  align-items: center;
}

.plain-row-button {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.plain-row-button span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.contact-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
}

.contact-detail-dialog {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(560px, 100%);
  max-height: min(80vh, 620px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contact-detail-dialog .message-menu-trigger {
  position: absolute;
  top: 10px;
  right: 10px;
}

.inline-mute-form {
  display: grid;
  grid-template-columns: 86px minmax(120px, 1fr) auto;
  gap: 8px;
  width: min(100%, 430px);
  margin-top: 8px;
}

.inline-mute-form input,
.profile-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.admin-action-details {
  position: relative;
}

.admin-action-details summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}

.admin-action-details summary::-webkit-details-marker {
  display: none;
}

.admin-action-details[open] {
  flex-basis: 100%;
}

.status-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  margin-top: 4px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-section .profile-form select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 16px, calc(100% - 12px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.small-button.danger {
  border-color: transparent;
  background: var(--danger);
  color: white;
}

.friend-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 18px;
}

.friend-code-card {
  position: relative;
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface-soft));
}

.mino-friend-code {
  min-height: 118px;
  padding-right: 112px;
  overflow: hidden;
}

.mino-helper {
  position: absolute;
  right: -18px;
  bottom: -28px;
  width: 148px;
  max-height: 148px;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  opacity: 0.9;
}

.theme-mino .mino-friend-code {
  background: linear-gradient(135deg, #fffdf8, #f5ead9);
  border-color: #ead8c2;
}

.chat-room {
  position: relative;
}

.mino-chat-watermark {
  position: absolute;
  right: 18px;
  bottom: 70px;
  z-index: 0;
  width: 160px;
  opacity: 0.12;
  pointer-events: none;
}

.theme-mino .mino-chat-watermark {
  opacity: 0.2;
}

.friend-code-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.friend-code-card strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--primary);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}

.profile-friend-code {
  margin-top: 6px;
}

.profile-card .profile-friend-code {
  padding: 10px;
}

.profile-card .profile-friend-code strong {
  font-size: 0.94rem;
}

.friend-search input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
}

.friend-list {
  display: grid;
  gap: 12px;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.friend-card p {
  margin: 4px 0 0;
  color: var(--muted);
  word-break: break-word;
}

.unread-pill {
  width: fit-content;
  margin-top: 8px;
  background: var(--primary);
}

.presence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.presence span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a8b3c4;
}

.presence.online {
  color: var(--success);
}

.presence.online span {
  background: var(--success);
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lower-grid {
  margin-top: 20px;
}

.security-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.security-metrics div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.security-metrics strong {
  font-size: 1.35rem;
  color: var(--primary);
}

.security-metrics span,
.security-checklist small {
  color: var(--muted);
  font-size: 0.85rem;
}

.security-checklist p {
  display: grid;
  gap: 3px;
}

.room-list {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.room-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}

.room-link.active {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.user-check-grid {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.user-check {
  margin: 0;
}

.profile-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.profile-card {
  align-self: start;
  padding: 26px;
}

.profile-card h1 {
  margin: 14px 0 4px;
  line-height: 1.1;
}

.profile-card p {
  color: var(--muted);
  word-break: break-word;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 2rem;
  font-weight: 900;
}

.image-avatar {
  display: block;
  object-fit: cover;
}

.compact-avatar {
  width: 60px;
  height: 60px;
  margin-bottom: 14px;
  font-size: 1.5rem;
}

.friend-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.small-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  object-fit: cover;
  font-weight: 900;
}

.profile-badge {
  display: inline-flex;
  margin-top: 8px;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-bio {
  margin-top: 18px;
  line-height: 1.6;
}

.profile-meta-list,
.profile-detail-grid div {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-meta-list span,
.profile-detail-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.report-box {
  display: grid;
  gap: 8px;
}

.report-box summary {
  list-style: none;
}

.report-box summary::-webkit-details-marker {
  display: none;
}

.report-box form {
  display: grid;
  gap: 8px;
  min-width: min(280px, 100%);
}

.report-box textarea {
  width: 100%;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.contact-card textarea,
.profile-form textarea,
.auth-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}

.contact-card {
  width: min(540px, 100%);
}

.profile-panels {
  display: grid;
  gap: 20px;
}

.profile-form {
  display: grid;
  gap: 10px;
}

.profile-form label {
  margin-top: 8px;
  font-weight: 800;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.profile-summary p {
  margin: 4px 0;
  color: var(--muted);
}

.admin-actions {
  margin-top: 14px;
}

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

.section-title-row h2 {
  margin: 0;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 10px;
}

.theme-option {
  position: relative;
  display: grid;
  place-items: center;
  align-items: center;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option span {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0 50%, #2563eb 50% 100%);
}

.theme-option strong {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: none;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.78rem;
  white-space: nowrap;
}

.theme-option:hover strong,
.theme-option:focus-within strong {
  display: block;
}

.theme-option:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.avatar-upload {
  position: relative;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 128px;
  margin-top: 8px;
  padding: 18px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.avatar-upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
}

.avatar-upload small {
  color: var(--muted);
  font-weight: 700;
}

.avatar-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.compact-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.icon-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
}

.icon-toggle input {
  position: absolute;
  opacity: 0;
}

.icon-toggle span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-weight: 900;
}

.icon-toggle strong {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: none;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-size: 0.78rem;
  white-space: nowrap;
}

.icon-toggle:hover strong,
.icon-toggle:focus-within strong {
  display: block;
}

.icon-toggle:has(input:checked) {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.profile-card-notifications {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.autosave-state {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.bell-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-swatch-dark span {
  background: linear-gradient(135deg, #111827 0 50%, #60a5fa 50% 100%);
}

.theme-swatch-dark-purple span {
  background: linear-gradient(135deg, #0b0b10 0 38%, #242432 38% 68%, #8b5cf6 68% 100%);
}

.theme-swatch-ocean span {
  background: linear-gradient(135deg, #eef8fb 0 50%, #0284c7 50% 100%);
}

.theme-swatch-forest span {
  background: linear-gradient(135deg, #f2f8f3 0 50%, #2f855a 50% 100%);
}

.theme-swatch-rose span {
  background: linear-gradient(135deg, #fff5f7 0 50%, #db2777 50% 100%);
}

.theme-swatch-mino span {
  background: linear-gradient(135deg, #fbf6ea 0 50%, #e97983 50% 100%);
}

.legal-page {
  width: min(920px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.legal-page .admin-section {
  position: relative;
  display: grid;
  gap: 10px;
}

.mino-page-corner {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 72px;
  opacity: 0.18;
  pointer-events: none;
}

.legal-page h2 {
  margin: 18px 0 0;
}

.legal-page p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.why-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.why-grid strong {
  display: block;
  margin-bottom: 6px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  gap: 14px;
  font-weight: 800;
}

.code-pill {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.status-list {
  display: grid;
  gap: 10px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px) minmax(120px, 160px) auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-filter-bar.compact {
  grid-template-columns: minmax(180px, 1fr) auto auto;
}

.admin-filter-bar label {
  display: grid;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-filter-bar input,
.admin-filter-bar select {
  min-height: 42px;
}

.admin-result-note {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

.pagination span {
  min-width: 72px;
  text-align: center;
  color: var(--muted);
  font-weight: 900;
}

.small-button.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.status-list p {
  margin: 0;
  color: var(--muted);
}

.code-list {
  display: grid;
  gap: 6px;
}

.code-list code {
  display: block;
  width: 100%;
  overflow-x: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.82rem;
}

.status-ok,
.status-warn,
.status-bad {
  font-weight: 900;
}

.status-ok {
  color: var(--success);
}

.status-warn {
  color: #b7791f;
}

.status-bad {
  color: var(--danger);
}

@media (max-width: 820px) {
  .admin-filter-bar,
  .admin-filter-bar.compact {
    grid-template-columns: 1fr;
  }

  .pagination {
    justify-content: stretch;
  }

  .pagination .small-button {
    flex: 1;
  }

  .mino-friend-code {
    min-height: 112px;
    padding-right: 96px;
  }

  .mino-helper {
    width: 128px;
  }

  .app-hero,
  .hero,
  .chat-layout,
  .admin-grid,
  .admin-dashboard-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    min-height: auto;
    padding-top: 28px;
  }

  .app-hero {
    gap: 28px;
    min-height: auto;
    padding-top: 28px;
  }

  .app-feature-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .mino-home-helper {
    right: 8px;
    top: -52px;
    width: 104px;
  }

  .chat-layout {
    height: auto;
  }

  .embedded-view .chat-layout {
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100vh - 20px);
    gap: 10px;
  }

  .chat-sidebar {
    gap: 18px;
  }

  .embedded-view .chat-sidebar {
    gap: 10px;
    max-height: 178px;
    overflow: hidden;
  }

  .embedded-view .chat-sidebar h1 {
    font-size: 1.15rem;
  }

  .embedded-view .chat-sidebar .eyebrow,
  .embedded-view .chat-sidebar p {
    margin: 0 0 4px;
  }

  .chat-room {
    min-height: 68vh;
  }

  .embedded-view .chat-room {
    min-height: 0;
  }

  .embedded-view .messages {
    padding: 14px;
  }

  .call-room-page {
    grid-template-columns: 1fr;
    gap: 14px;
    width: min(100% - 20px, 680px);
    min-height: auto;
    margin: 12px auto 28px;
  }

  .call-room-page.media-active,
  .call-room-page.video-expanded {
    grid-template-columns: 1fr;
  }

  .call-room-page.media-active .call-browse-card {
    display: none;
  }

  .call-card,
  .call-chat-card,
  .call-browse-card {
    width: 100%;
    min-height: auto;
  }

  .call-card {
    gap: 10px;
    padding: 16px;
  }

  .call-card .compact-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
  }

  .call-card h1 {
    font-size: 1.25rem;
  }

  .call-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .call-actions .button.full {
    width: 100%;
  }

  .volume-control {
    font-size: 0.86rem;
  }

  .call-chat-card {
    grid-template-rows: auto minmax(340px, 58vh) auto auto;
    min-height: 520px;
  }

  .call-browse-card {
    grid-template-rows: auto minmax(420px, 70vh);
    min-height: auto;
  }

  .call-browse-header {
    flex-direction: row;
    padding: 10px;
  }

  .call-browse-header .small-button {
    min-width: 96px;
    padding: 8px 10px;
  }
}

@media (max-width: 560px) {
  .mino-friend-code {
    min-height: 112px;
    padding-right: 86px;
    padding-bottom: 14px;
  }

  .mino-helper {
    right: -14px;
    transform: none;
    width: 112px;
  }

  .mino-home-helper {
    right: -4px;
    top: -44px;
    width: 88px;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: min(100% - 16px, 1120px);
    margin-top: 8px;
    padding: 9px 10px;
  }

  .nav-toggle {
    display: grid;
  }

  .brand {
    font-size: 1rem;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-hero-copy h1 {
    font-size: clamp(2.15rem, 14vw, 3.4rem);
  }

  .app-window-body {
    grid-template-columns: 1fr;
  }

  .app-window-body aside {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-window-main {
    padding: 18px;
  }

  .app-feature-strip {
    grid-template-columns: 1fr;
  }

  .source-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .site-header.nav-open .nav {
    display: flex;
    padding-top: 8px;
  }

  .nav a,
  .link-button,
  .call-nav-status {
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: 0.92rem;
  }

  .nav form {
    margin: 0;
  }

  .nav form .link-button {
    width: 100%;
  }

  .call-room-page {
    width: min(100% - 12px, 560px);
    margin-top: 8px;
  }

  .call-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .call-card {
    padding: 12px;
  }

  .call-card .eyebrow {
    display: none;
  }

  .call-card .compact-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.15rem;
  }

  .video-stage {
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  .call-card #callStatus {
    margin: 0;
    font-size: 0.9rem;
  }

  .video-stage #localVideo {
    right: 6px;
    bottom: 6px;
    width: 30%;
    min-width: 78px;
  }

  .screen-active .video-stage #localVideo {
    top: 6px;
    right: 6px;
    bottom: auto;
  }

  .video-stage #remotePipVideo {
    left: 6px;
    bottom: 6px;
    width: 30%;
    min-width: 78px;
  }

  .call-chat-card {
    grid-template-rows: auto minmax(300px, 54vh) auto auto;
    min-height: 470px;
  }

  .call-chat-card > div:first-child {
    padding: 14px 14px 0;
  }

  .call-browse-card {
    grid-template-rows: auto minmax(360px, 64vh);
  }

  .call-browse-header .inline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .call-browse-header .small-button {
    min-width: 0;
  }

  .message-form {
    grid-template-columns: 1fr;
  }

  .embedded-view main {
    padding: 8px;
  }

  .embedded-view .chat-layout {
    height: calc(100vh - 16px);
    gap: 8px;
  }

  .embedded-view .chat-sidebar {
    max-height: 136px;
    padding: 10px;
  }

  .embedded-view .chat-sidebar > div:first-child {
    display: none;
  }

  .embedded-view .room-list {
    display: flex;
    gap: 8px;
    max-height: none;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .embedded-view .room-link {
    flex: 0 0 auto;
    min-width: 138px;
    padding: 8px 10px;
  }

  .embedded-view .chat-sidebar .button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  .embedded-view .message-form {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
  }

  .embedded-view .message-form input {
    min-height: 42px;
  }

  .embedded-view .message-form .button {
    min-height: 42px;
    padding: 0 12px;
  }

  .admin-message,
  .friend-card {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Chat UI — Modern Redesign
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes msg-in {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* ── Messages container ─────────────────────────────────────────── */
.messages {
  gap: 3px;
  padding: 20px 20px 6px;
}

/* ── Message row ────────────────────────────────────────────────── */
.message {
  align-items: flex-end;
  gap: 9px;
  animation: msg-in 0.16s ease-out both;
}

.message.group-start {
  margin-top: 18px;
}

/* ── Avatar ─────────────────────────────────────────────────────── */
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
  user-select: none;
}

.message.grouped .msg-avatar {
  visibility: hidden;
}

/* ── Bubble ─────────────────────────────────────────────────────── */
.message-body {
  max-width: clamp(200px, 70%, 580px);
  padding: 8px 14px 10px;
  border-radius: 4px 18px 18px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.message.mine .message-body {
  border-radius: 18px 4px 18px 18px;
  background: var(--own-message-bg);
  border-color: var(--own-message-line);
}

.message.grouped .message-body,
.message.grouped.mine .message-body {
  border-radius: 18px;
}

/* ── Meta (name / time) ─────────────────────────────────────────── */
.message-meta {
  align-items: baseline;
  gap: 5px;
  margin-bottom: 2px;
}

.message-meta span {
  font-size: 0.80rem;
}

.admin-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--warning);
  letter-spacing: 0.01em;
}

.edited-tag {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* ── Text ───────────────────────────────────────────────────────── */
.message p {
  line-height: 1.52;
  padding-right: 24px;
}

/* ── Dropdown menu ──────────────────────────────────────────────── */
.message-menu-items {
  border-radius: 12px;
}

/* ── Typing indicator ───────────────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 20px 10px;
  font-size: 0.86rem;
  font-style: italic;
  min-height: 28px;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}

.typing-dots span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: dot-bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.30s; }

/* ── Input area ─────────────────────────────────────────────────── */
.message-form {
  padding: 10px 14px 14px;
  gap: 8px;
  align-items: center;
}

.message-form input {
  border-radius: 22px;
  background: var(--surface-soft);
  border-color: transparent;
  padding: 10px 18px;
  min-height: 44px;
}

.message-form input:focus {
  background: var(--surface);
  border-color: var(--primary);
}

.message-form .button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.chat-sidebar {
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0;
}

.room-link {
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 700;
  transition: background 0.12s, color 0.12s;
}

.room-link:hover {
  background: color-mix(in srgb, var(--line) 55%, transparent);
}

.room-link.active {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  border: none;
}

/* ── Mobile overrides ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .message-form input {
    min-height: 42px;
  }

  .message-form .button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.84rem;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .message-body {
    max-width: 85%;
  }
}

/* Modern product UI refresh - May 2026 */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f1f5fb;
  --surface-raised: rgba(255, 255, 255, 0.86);
  --text: #121827;
  --muted: #667085;
  --line: #dce4ef;
  --primary: #3157e8;
  --primary-dark: #253fbb;
  --primary-soft: #e9edff;
  --accent: #8b5cf6;
  --success: #15956d;
  --danger: #d6425c;
  --warning: #d88a18;
  --own-message-bg: #e9edff;
  --own-message-line: #b8c4ff;
  --scroll-thumb: #a9b6c8;
  --scroll-track: #eaf0f7;
  --container: min(1180px, calc(100% - 32px));
  --container-wide: min(1420px, calc(100% - 32px));
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.10);
  --shadow-soft: 0 10px 26px rgba(16, 24, 40, 0.07);
  --ring: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

.theme-dark {
  --bg: #0d111c;
  --surface: #151b28;
  --surface-soft: #1d2636;
  --surface-raised: rgba(21, 27, 40, 0.88);
  --text: #f7f9fc;
  --muted: #a7b0c0;
  --line: #2c374a;
  --primary: #7aa2ff;
  --primary-dark: #5f83e8;
  --primary-soft: #1d2b4d;
  --accent: #b99bff;
  --own-message-bg: #213257;
  --own-message-line: #385798;
  --scroll-thumb: #546276;
  --scroll-track: #151d2c;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.theme-dark-purple {
  --bg: #0b0b10;
  --surface: #181820;
  --surface-soft: #242432;
  --surface-raised: rgba(24, 24, 32, 0.9);
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-soft: #21163a;
  --accent: #a78bfa;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #f59e0b;
  --own-message-bg: #2f2158;
  --own-message-line: #8b5cf6;
  --scroll-thumb: #6d5ba8;
  --scroll-track: #171722;
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.3);
  --ring: 0 0 0 4px rgba(139, 92, 246, 0.18);
}

.theme-mino {
  --bg: #fbf6ea;
  --surface: #fffdf7;
  --surface-soft: #f4ecdf;
  --surface-raised: rgba(255, 253, 247, 0.88);
  --text: #211f1c;
  --muted: #746958;
  --line: #e4d6c2;
  --primary: #e76f7d;
  --primary-dark: #c95763;
  --primary-soft: #ffe6ea;
  --accent: #9271d9;
  --own-message-bg: #ffe5e8;
  --own-message-line: #f1a7ae;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 44%, transparent) 0, transparent 360px),
    linear-gradient(135deg, color-mix(in srgb, var(--surface-soft) 60%, transparent), transparent 44%),
    var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(color-mix(in srgb, var(--line) 36%, transparent) 1px, transparent 1px);
  background-size: 100% 96px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.24), transparent 62%);
}

main {
  width: 100%;
}

a,
button,
input,
textarea,
select {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 50;
  width: var(--container);
  min-height: 68px;
  margin-top: 12px;
  padding: 10px 12px 10px 14px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(1.2);
}

.brand {
  gap: 12px;
  min-height: 46px;
  padding: 4px 10px 4px 4px;
  border-radius: 16px;
  font-size: 1rem;
  letter-spacing: 0;
}

.brand:hover {
  background: var(--surface-soft);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 15%, transparent);
}

.nav {
  gap: 4px;
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.nav a,
.link-button,
.call-nav-status {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.nav a:hover,
.link-button:hover,
.nav a.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--line) 52%, transparent);
}

.nav a.active {
  color: var(--primary);
}

.nav-cta {
  border: 0;
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--primary) 28%, transparent);
}

.nav-cta:hover {
  background: var(--primary-dark) !important;
}

.lang-toggle {
  min-width: 44px;
  justify-content: center;
  gap: 4px !important;
}

.lang-toggle span {
  opacity: 0.48;
}

.lang-toggle span.active {
  opacity: 1;
  color: var(--primary);
}

.lang-toggle i {
  color: var(--muted);
  font-style: normal;
  opacity: 0.55;
}

.nav-badge,
.unread-pill {
  min-width: 20px;
  min-height: 20px;
  padding: 2px 7px;
  border: 2px solid var(--surface);
  font-size: 0.72rem;
  line-height: 1;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--danger) 28%, transparent);
}

.nav-toggle {
  border-radius: 16px;
  background: var(--surface-soft);
}

.button,
.small-button,
.link-button {
  user-select: none;
}

.button {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 850;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--accent) 58%, var(--primary)));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 28%, transparent);
}

.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px color-mix(in srgb, var(--primary) 34%, transparent);
}

.button.secondary,
.small-button {
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--line) 34%, transparent);
}

.button.secondary:hover,
.small-button:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
  color: var(--primary);
  transform: translateY(-1px);
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 850;
}

.small-button.danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 24%, var(--line));
}

.small-button.danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.flash {
  width: min(760px, calc(100% - 32px));
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--warning) 10%, var(--surface));
  box-shadow: var(--shadow-soft);
  color: color-mix(in srgb, var(--warning) 78%, var(--text));
  font-weight: 750;
}

.flash.success {
  border-color: color-mix(in srgb, var(--success) 22%, var(--line));
  background: color-mix(in srgb, var(--success) 10%, var(--surface));
  color: color-mix(in srgb, var(--success) 78%, var(--text));
}

.flash.error {
  border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: color-mix(in srgb, var(--danger) 78%, var(--text));
}

.app-hero {
  width: var(--container-wide);
  min-height: calc(100vh - 142px);
  gap: 56px;
  padding: 64px 0 48px;
}

.app-hero-copy {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.app-hero-copy h1 {
  max-width: 740px;
  font-size: 4.6rem;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.8;
}

.hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.guest-language-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  margin-top: 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--line) 40%, transparent);
}

.guest-language-switch span {
  padding: 0 8px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.guest-language-switch a {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  min-height: 28px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.guest-language-switch a.active,
.guest-language-switch a:hover {
  background: var(--primary);
  color: #fff;
}

.hero-trust-row span {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.app-showcase::before {
  inset: 8% 3% -6% 3%;
  border-radius: 36px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, transparent), color-mix(in srgb, var(--accent) 16%, transparent));
  filter: blur(26px);
}

.app-window {
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.18);
  backdrop-filter: blur(20px);
}

.app-window-bar {
  min-height: 52px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--surface) 80%, var(--surface-soft));
}

.app-window-body {
  grid-template-columns: 156px minmax(0, 1fr);
  min-height: 440px;
}

.app-window-body aside {
  gap: 8px;
  padding: 18px 14px;
}

.app-window-body aside b {
  border-radius: 14px;
  font-size: 0.84rem;
}

.app-window-main {
  gap: 14px;
  padding: 30px;
}

.preview-message {
  border-radius: 18px 18px 18px 6px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.preview-message.right {
  border-radius: 18px 18px 6px 18px;
}

.preview-call-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(49, 87, 232, 0.18), transparent),
    #111827;
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.28);
}

.preview-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-status-grid span {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.preview-status-grid strong {
  color: var(--text);
  font-size: 1rem;
}

.app-feature-strip {
  width: var(--container-wide);
  margin-top: -18px;
}

.app-feature-strip article,
.admin-section,
.auth-card,
.auth-aside,
.chat-sidebar,
.chat-room,
.profile-card,
.status-panel,
.call-card,
.call-chat-card,
.call-browse-card,
.legal-card,
.home-feature-panel,
.home-chat-preview {
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.app-feature-strip article {
  padding: 20px;
}

.app-feature-strip span,
.feature-icon {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--accent) 54%, var(--primary)));
}

.auth-shell {
  min-height: calc(100vh - 132px);
  padding: 42px 16px;
}

.compact-auth {
  display: grid;
  place-items: center;
  align-content: center;
  width: min(480px, calc(100% - 28px));
  min-height: calc(100vh - 154px);
  margin-inline: auto;
  padding: 28px 0;
}

.compact-auth .auth-card {
  width: 100%;
  max-width: 460px;
  padding: 26px;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 16px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.auth-brand-mark img {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.auth-split {
  grid-template-columns: minmax(260px, 390px) minmax(320px, 460px);
  gap: 18px;
  width: var(--container);
  margin-inline: auto;
  align-items: stretch;
  justify-content: center;
}

.auth-aside {
  display: grid;
  align-content: end;
  width: 100%;
  min-height: 520px;
  padding: 28px;
  overflow: hidden;
  position: relative;
}

.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 22%, transparent), transparent 46%),
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-soft) 86%, transparent));
  pointer-events: none;
}

.auth-aside > * {
  position: relative;
}

.auth-aside h2 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.auth-aside p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.75;
}

.auth-card {
  width: 100%;
  padding: 30px;
}

.auth-card h1 {
  margin-bottom: 8px;
  font-size: 2.25rem;
  letter-spacing: -0.025em;
}

.auth-card label,
.profile-form label,
.admin-filter-bar label span {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 850;
}

.auth-card input,
.message-form input,
.profile-form input,
.profile-form textarea,
.profile-form select,
.admin-filter-bar input,
.admin-filter-bar select,
.prompt-dialog textarea,
.device-control select,
select {
  min-height: 46px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-soft));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.auth-card input:focus,
.message-form input:focus,
.profile-form input:focus,
.profile-form textarea:focus,
.admin-filter-bar input:focus,
.admin-filter-bar select:focus,
.prompt-dialog textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--ring);
}

.password-toggle {
  border-radius: 12px;
}

.chat-layout {
  width: var(--container-wide);
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 122px);
  min-height: 620px;
  margin-top: 16px;
}

.chat-sidebar {
  gap: 16px;
  justify-content: start;
  padding: 18px;
  border-right: 0;
  background: var(--surface-raised);
}

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

.chat-sidebar h1 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--success) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 850;
}

.live-chip i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--success) 16%, transparent);
}

.room-list {
  gap: 6px;
  margin: 0;
  overflow: auto;
  padding-right: 4px;
}

.room-link {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
}

.room-link span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.room-link:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.room-link.active {
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  background: var(--primary-soft);
  color: var(--primary);
}

.chat-sidebar-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.chat-room {
  grid-template-rows: minmax(0, 1fr) auto auto;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.messages {
  gap: 4px;
  padding: 22px 22px 8px;
}

.message-body {
  max-width: min(640px, 76%);
  padding: 9px 13px 10px;
  border-radius: 6px 18px 18px 18px;
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.05);
}

.message.mine .message-body {
  border-radius: 18px 6px 18px 18px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 10%, transparent);
}

.msg-avatar,
.small-avatar,
.profile-avatar {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ffffff 32%, transparent), 0 8px 18px color-mix(in srgb, var(--primary) 14%, transparent);
}

.message-meta span {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}

.message-menu-trigger:hover {
  background: var(--surface);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--line) 48%, transparent);
}

.message-menu-items {
  top: auto;
  bottom: calc(100% + 6px);
  border-radius: 14px;
}

.message:first-child .message-menu-items,
.message:nth-child(2) .message-menu-items {
  top: calc(100% + 6px);
  bottom: auto;
}

.message-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.message-form input {
  min-height: 48px;
  border-radius: 999px;
  padding-inline: 18px;
}

.message-form .button {
  min-width: 104px;
  border-radius: 999px;
}

.admin-layout,
.profile-layout,
.legal-page,
.notifications-page,
.friends-page {
  width: var(--container-wide);
  margin: 28px auto 64px;
}

.page-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 0 4px;
}

.page-heading h1 {
  margin: 0;
  font-size: 2.45rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.page-heading .muted {
  max-width: 760px;
  margin: 0;
}

.admin-grid,
.admin-dashboard-grid,
.lower-grid {
  gap: 16px;
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-section {
  padding: 20px;
}

.admin-section h2 {
  margin: 0 0 12px;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}

.message-list,
.friend-list {
  display: grid;
  gap: 10px;
}

.admin-message,
.friend-card,
.admin-notice-card {
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.friend-card {
  padding: 13px;
  gap: 12px;
}

.friend-info {
  min-width: 0;
}

.friend-info strong,
.friend-info a {
  color: var(--text);
}

.inline-actions {
  gap: 8px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(150px, 0.42fr)) auto auto;
  align-items: end;
  gap: 12px;
}

.admin-filter-bar label {
  display: grid;
  gap: 7px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--primary-soft) 44%, transparent);
}

.profile-layout {
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 16px;
}

.profile-card {
  position: sticky;
  top: 100px;
  align-self: start;
  padding: 24px;
}

.profile-card h1 {
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.profile-badge,
.status-chip,
.code-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.friend-code-card {
  border-radius: 18px;
  border-color: color-mix(in srgb, var(--primary) 18%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 58%, var(--surface)), var(--surface));
}

.profile-panels {
  display: grid;
  gap: 16px;
}

.theme-grid {
  gap: 10px;
}

.theme-option {
  border-radius: 16px;
}

.avatar-upload {
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.confirm-dialog,
.source-dialog {
  border-radius: 22px;
}

.source-option {
  border-radius: 18px;
}

.call-room-page {
  width: var(--container-wide);
  gap: 16px;
}

.call-card,
.call-chat-card,
.call-browse-card {
  border-radius: var(--radius-lg);
}

.video-stage {
  border-radius: 18px;
}

.call-actions .icon-button {
  border-radius: 16px;
}

.site-footer {
  width: var(--container);
  margin: auto auto 22px;
  padding: 18px 4px 0;
  color: var(--muted);
}

.site-footer nav a {
  color: var(--muted);
}

.site-footer nav a:hover {
  color: var(--primary);
}

@media (max-width: 1180px) {
  .app-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 48px;
  }

  .app-hero-copy h1 {
    font-size: 3.7rem;
  }

  .app-showcase {
    width: min(760px, 100%);
  }

  .app-feature-strip,
  .admin-dashboard-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .call-room-page,
  .call-room-page.media-active {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --container: min(100% - 20px, 760px);
    --container-wide: min(100% - 20px, 760px);
  }

  .site-header {
    top: 8px;
    border-radius: 20px;
  }

  .nav-toggle {
    display: grid;
  }

  .nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: none;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
    border-radius: 20px;
    background: var(--surface-raised);
    box-shadow: var(--shadow);
  }

  .site-header.nav-open .nav {
    display: grid;
  }

  .nav a,
  .link-button,
  .nav form,
  .nav form button,
  .profile-menu,
  .profile-menu > summary {
    width: 100%;
    justify-content: center;
  }

  .profile-menu-panel {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .nav-download-link {
    margin-left: 0;
  }

  .app-hero-copy h1,
  .page-heading h1 {
    font-size: 2.8rem;
  }

  .app-window-body {
    grid-template-columns: 1fr;
  }

  .app-window-body aside {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-window-body aside b {
    flex: 0 0 auto;
  }

  .app-feature-strip,
  .admin-dashboard-grid,
  .admin-grid,
  .profile-layout,
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    min-height: 260px;
  }

  .profile-card {
    position: static;
  }

  .admin-filter-bar {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .chat-sidebar {
    position: static;
  }

  .room-list {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .room-link {
    flex: 0 0 min(210px, 72vw);
  }

  .chat-room {
    min-height: 68vh;
  }

  .messages {
    min-height: 54vh;
    max-height: 62vh;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .site-header {
    width: calc(100% - 16px);
    min-height: 62px;
    margin-top: 8px;
    padding: 8px;
  }

  .brand span {
    font-size: 0.95rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .app-hero {
    width: calc(100% - 18px);
    padding: 34px 0 28px;
  }

  .app-hero-copy h1,
  .page-heading h1 {
    font-size: 2.25rem;
    line-height: 1.04;
  }

  .lead {
    font-size: 1rem;
    line-height: 1.68;
  }

  .actions,
  .inline-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button,
  .small-button {
    width: 100%;
  }

  .app-window-main {
    padding: 16px;
  }

  .preview-status-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 24px 10px;
  }

  .auth-card,
  .auth-aside,
  .admin-section,
  .profile-card {
    padding: 18px;
    border-radius: 20px;
  }

  .compact-auth .auth-card {
    padding: 20px;
  }

  .auth-aside h2 {
    font-size: 1.7rem;
  }

  .chat-layout,
  .admin-layout,
  .profile-layout {
    width: calc(100% - 16px);
    margin-top: 16px;
  }

  .chat-sidebar {
    padding: 14px;
  }

  .chat-room {
    min-height: 70vh;
  }

  .messages {
    padding: 14px 12px 8px;
  }

  .message-body {
    max-width: 86%;
  }

  .message-form {
    grid-template-columns: minmax(0, 1fr) 48px;
    padding: 10px;
  }

  .message-form .button {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }

  .message-form .button svg {
    margin: 0;
  }

  .message-form .button {
    font-size: 0;
  }

  .message-form .button svg {
    width: 18px;
    height: 18px;
  }

  th,
  td {
    padding: 12px;
  }

  .site-footer {
    width: calc(100% - 20px);
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Shared compact form system. */
.form-page {
  min-height: calc(100vh - 152px);
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 0;
}

.form-card {
  width: 100%;
  max-width: 500px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.form-card-wide {
  max-width: 680px;
}

.form-title {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.08;
}

.form-description {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label,
.form-card label {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.form-input,
.form-textarea,
.form-card input,
.form-card textarea,
.form-card select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, var(--bg));
  color: var(--text);
  padding: 0 14px;
  font: inherit;
}

.form-textarea,
.form-card textarea {
  min-height: 132px;
  padding-top: 13px;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-card input:focus,
.form-card textarea:focus,
.form-card select:focus {
  border-color: var(--primary);
  box-shadow: var(--ring);
  outline: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.form-link {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.form-alert {
  padding: 13px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
  line-height: 1.55;
}

.form-status-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}

.contact-card {
  max-width: 540px;
}

.profile-panels .profile-form {
  max-width: 680px;
}

/* Web download and desktop-only product surfaces. */
.web-only {
  display: revert;
}

.desktop-only {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.download-section,
.desktop-mode-card {
  width: min(100% - 32px, 1120px);
  margin: 28px auto;
}

.download-card,
.desktop-mode-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--primary)), var(--surface));
  box-shadow: var(--shadow-soft);
}

.download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 20px;
  align-items: center;
  padding: 24px;
}

.download-card h2,
.desktop-mode-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
}

.download-card p,
.desktop-mode-card p {
  color: var(--muted);
  line-height: 1.65;
}

.download-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.download-feature-list span,
.desktop-version-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
}

.download-options {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
}

.download-platform-label {
  display: inline-flex;
  width: fit-content;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.download-soon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.download-soon-grid span {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 86%, var(--bg));
  font-weight: 900;
}

.download-soon-grid small,
.desktop-mode-actions small {
  color: var(--muted);
  font-weight: 700;
}

.desktop-mode-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.is-desktop-app .desktop-mode-card.desktop-only,
.electron-app .desktop-mode-card.desktop-only {
  display: grid !important;
}

.desktop-mode-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.is-desktop-app .web-only,
.electron-app .web-only,
.is-desktop-app [data-desktop-download],
.electron-app [data-desktop-download] {
  display: none !important;
}

/* Compact navbar and download polish. */
.site-header {
  gap: 12px;
}

.nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.link-button,
.call-nav-status,
.profile-menu > summary {
  white-space: nowrap;
}

.nav-download-link {
  order: 99;
  margin-left: 6px;
  border: 0 !important;
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 22%, transparent);
}

.nav-download-link::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
}

.profile-menu {
  position: relative;
}

.profile-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.profile-menu > summary::-webkit-details-marker {
  display: none;
}

.profile-menu > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.65;
}

.profile-menu[open] > summary,
.profile-menu > summary:hover,
.profile-menu > summary.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--line) 52%, transparent);
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: grid;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.profile-menu-panel a,
.profile-menu-panel .link-button {
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--text);
  text-align: left;
}

.profile-menu-panel form {
  margin: 4px 0 0;
}

.profile-menu-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 56%, transparent);
}

.profile-menu-group > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-menu-group a {
  min-height: 32px;
  justify-content: center;
  padding: 6px 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
}

.profile-menu-group a.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: none;
}

.profile-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.profile-nav-link:hover,
.profile-nav-link.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--line) 52%, transparent);
}

.profile-logout-form {
  width: 100%;
  margin: 12px 0;
}

.profile-menu-avatar,
.msg-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-menu-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.profile-menu-avatar.initial {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 900;
}

.msg-avatar {
  overflow: hidden;
}

.profile-language-card {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 62%, transparent);
}

.profile-language-card > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-language-card div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.profile-language-card a {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 850;
}

.profile-language-card a.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--line) 45%, transparent);
}

.theme-dark-purple .site-header,
.theme-dark-purple .download-card,
.theme-dark-purple .desktop-mode-card,
.theme-dark-purple .form-card,
.theme-dark-purple .admin-section,
.theme-dark-purple .chat-sidebar,
.theme-dark-purple .chat-room,
.theme-dark-purple .profile-card {
  border-color: rgba(255, 255, 255, 0.08);
}

.theme-dark-purple .nav,
.theme-dark-purple .download-options {
  background: rgba(255, 255, 255, 0.035);
}

.theme-dark-purple .button.primary,
.theme-dark-purple .nav-cta {
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.24);
}

@media (max-width: 760px) {
  .form-page {
    width: min(100% - 24px, 1120px);
    align-items: flex-start;
    padding: 22px 0;
  }

  .form-card {
    padding: 22px;
    border-radius: 20px;
  }

  .download-card,
  .desktop-mode-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .download-options {
    padding: 14px;
  }

  .download-feature-list {
    gap: 7px;
  }

  .desktop-mode-actions {
    justify-content: stretch;
  }

  .desktop-mode-actions .button,
  .desktop-version-pill {
    width: 100%;
    justify-content: center;
  }
}

/* Performance tuning - keep the modern look, reduce expensive paint work. */
:root {
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.08);
}

a,
button {
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 120ms ease, opacity 120ms ease;
}

input,
textarea,
select {
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

body::before {
  opacity: 0.28;
}

.site-header,
.app-window,
.modal-panel,
.admin-section,
.chat-sidebar,
.chat-room,
.profile-card,
.settings-panel,
.stat-card,
.auth-card,
.auth-aside,
.desktop-settings-launcher {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-showcase::before,
.home-hero .app-showcase::before {
  filter: none;
  opacity: 0.24;
}

.app-window {
  box-shadow: 0 18px 46px rgba(16, 24, 40, 0.13);
}

.message {
  animation: none;
}

.preview-wave i,
.typing-indicator span {
  animation-duration: 1.6s;
}

.is-desktop-app body::before,
.is-desktop-app .app-showcase::before,
.is-desktop-app .home-hero .app-showcase::before {
  display: none;
}

.is-desktop-app .desktop-download,
.is-desktop-app .download-section,
.is-desktop-app [data-desktop-download] {
  display: none !important;
}

@media (max-width: 860px) {
  body::before,
  .app-showcase::before,
  .home-hero .app-showcase::before {
    display: none;
  }

  .preview-wave i,
  .typing-indicator span {
    animation: none;
  }

  .site-header,
  .app-window,
  .auth-card,
  .auth-aside {
    box-shadow: var(--shadow-soft);
  }
}
