.nx-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.nx-icon.end { margin-left: auto; }
.nx-slot { display: inline-flex; color: var(--text-dim); }

/* Settings overlay */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--bg-deep);
  display: flex;
  animation: fadeIn 0.15s ease;
}
.settings-app {
  display: grid;
  grid-template-columns: 232px 1fr;
  width: min(1080px, 100%);
  margin: 0 auto;
  height: 100%;
  position: relative;
}
.settings-side {
  background: var(--bg-0);
  padding: 20px 12px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}
.settings-user-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  margin-bottom: 12px;
}
.su-name { font-weight: 700; font-size: 14px; }
.linkish {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.settings-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 0 10px;
  margin-bottom: 16px;
}
.settings-search .input {
  border: none;
  background: transparent;
  padding: 10px 0;
  box-shadow: none;
}
.snav-group { margin-bottom: 14px; }
.snav-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 4px 10px 8px;
}
.snav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: left;
  position: relative;
}
.snav:hover { background: var(--bg-hover); color: var(--text); }
.snav.active {
  background: var(--bg-active);
  color: var(--text);
}
.snav.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #fff;
}
.snav.danger { color: var(--danger); margin-top: 12px; }
.settings-main {
  overflow-y: auto;
  padding: 40px 48px 64px;
  max-width: 740px;
}
.settings-main h1 {
  font-family: var(--font-display);
  font-size: 28px;
  margin-bottom: 6px;
}
.settings-sub { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.h-section {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 24px 0 12px;
}
.settings-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  color: var(--text-muted);
  display: grid;
  place-items: center;
}
.settings-close:hover { color: var(--text); border-color: var(--text); }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.layout-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.layout-pick {
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.layout-pick strong {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
}
.layout-pick span {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-dim);
}
.layout-pick:hover { border-color: var(--bg-hover); background: var(--bg-2); }
.layout-pick.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.layout-pick.active span { color: var(--text-muted); }
@media (max-width: 720px) {
  .layout-pick-grid { grid-template-columns: 1fr; }
}
.theme-card {
  background: var(--bg-1);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.theme-card.active { border-color: var(--accent); color: var(--text); }
.theme-swatch {
  width: 100%;
  height: 48px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.color-theme-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.color-theme {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid transparent;
}
.color-theme.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row p { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border-radius: 999px;
  transition: 0.15s;
  cursor: pointer;
}
.toggle span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
}
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(20px); }

.slider {
  width: 100%;
  accent-color: var(--accent);
}
.mic-test-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0 8px;
}
.mic-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
}
.mic-meter i {
  width: 4px;
  height: 8px;
  background: var(--bg-active);
  border-radius: 2px;
  display: block;
  transition: height 0.05s;
}
.radio-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.radio { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.row-2 { display: grid; grid-template-columns: 1fr 120px; gap: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.info-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.preview-chat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 8px;
}
.profile-preview.large { margin-bottom: 20px; }
.profile-preview .profile-banner.editable-media {
  position: relative;
  height: 120px;
  display: block;
  cursor: pointer;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(120deg, #1a3a2a, #16304a);
}
.profile-banner .banner-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.profile-banner .banner-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, #1a3a2a, #16304a);
}
.editable-media .media-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.editable-media:hover .media-overlay,
.editable-media:focus-within .media-overlay {
  opacity: 1;
}
.avatar-ring.editable-media {
  cursor: pointer;
  display: inline-block;
}
.avatar-overlay {
  border-radius: 50%;
  inset: 4px !important;
}
.hint-muted {
  color: var(--text-dim);
  font-size: 12px;
}
.avatar-ring {
  width: fit-content;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  position: relative;
}
.avatar-ring .avatar {
  border: 4px solid var(--bg-1);
  box-shadow: none;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  margin: 8px 0;
}
.tag-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.tag { color: var(--text-dim); font-size: 13px; }
.badge-dev {
  background: #5865f2;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}
.badge-you {
  background: rgba(62, 207, 142, 0.18);
  color: #3ecf8e;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}
.badge-muted {
  opacity: 0.55;
  border: 1px dashed var(--border);
  background: transparent;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.badge-since {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.dev-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dev-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
}
.dev-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-meta strong { font-size: 14px; }
.dev-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.field-actions { display: flex; align-items: flex-end; padding-bottom: 2px; }

/* Profile popout */
.profile-popout {
  position: fixed;
  width: 340px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1600;
  overflow: hidden;
  animation: rise 0.18s ease;
}
.pp-banner {
  height: 72px;
  background: linear-gradient(120deg, #1a3a2a, #16304a);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.pp-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-gif {
  content-visibility: auto;
}
html[data-animated-media="off"] .media-gif {
  /* fallback se freeze ainda não rodou */
  image-rendering: auto;
}
.pp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.badge-you {
  background: rgba(62, 207, 142, 0.18);
  color: #3ecf8e;
}
.badge-muted {
  opacity: 0.55;
  border: 1px dashed var(--border);
  background: transparent;
}
.badge-since {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.pp-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pp-date-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.pp-date-val {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-transform: capitalize;
}
.pp-section { margin: 12px 0; }
.pp-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.pp-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.role-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.status-pill.dim { opacity: 0.75; }
.profile-popout.user-card {
  max-height: min(560px, calc(100vh - 24px));
  overflow-y: auto;
}
.pp-body { padding: 0 14px 14px; }
.pp-avatar-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: -36px;
}
.pp-body h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-top: 10px;
}
.pp-about {
  margin: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}
.pp-voice-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(62, 207, 142, 0.12);
  color: #3ecf8e;
  font-size: 13px;
  font-weight: 600;
}
.pp-menu {
  background: var(--bg-2);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.pp-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  color: var(--text);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.pp-menu button:last-child { border-bottom: none; }
.pp-menu button:hover { background: var(--bg-hover); }

.call-ctrl.active-share {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Theme variants */
html[data-theme="light"] {
  --bg-deep: #e3e5e8;
  --bg-0: #e3e5e8;
  --bg-1: #f2f3f5;
  --bg-2: #ffffff;
  --bg-3: #ebecef;
  --bg-hover: #e0e2e5;
  --bg-active: #d7d9dc;
  --text: #060607;
  --text-muted: #4e5058;
  --text-dim: #6d6f78;
  --border: rgba(0,0,0,0.08);
}
html[data-theme="amoled"] {
  --bg-deep: #000;
  --bg-0: #000;
  --bg-1: #0a0a0a;
  --bg-2: #111;
  --bg-3: #1a1a1a;
}
html[data-theme="dark"] {
  --bg-deep: #1e1f22;
  --bg-0: #1e1f22;
  --bg-1: #2b2d31;
  --bg-2: #313338;
  --bg-3: #383a40;
}
html[data-color="ocean"] { --accent: #3b82f6; --accent-2: #2563eb; --accent-soft: rgba(59,130,246,0.14); }
html[data-color="sunset"] { --accent: #fb923c; --accent-2: #f97316; --accent-soft: rgba(251,146,60,0.14); }
html[data-color="violet"] { --accent: #a78bfa; --accent-2: #8b5cf6; --accent-soft: rgba(167,139,250,0.14); }
html[data-color="rose"] { --accent: #fb7185; --accent-2: #f43f5e; --accent-soft: rgba(251,113,133,0.14); }
html[data-color="cyan"] { --accent: #22d3ee; --accent-2: #06b6d4; --accent-soft: rgba(34,211,238,0.14); }
html[data-color="aurora"] { --accent: #a78bfa; --accent-2: #ec4899; --accent-soft: rgba(167,139,250,0.14); }

html.underline-links a { text-decoration: underline; }
.messages, .msg-body { font-size: var(--chat-font-size, 15px); }

.donate-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin: 12px 0 18px;
}
.donate-card-emphasis {
  border-color: rgba(251, 113, 133, 0.35);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.12), rgba(62, 207, 142, 0.08));
}
.donate-card .donate-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.donate-card-emphasis .donate-ico {
  background: rgba(251, 113, 133, 0.2);
  color: #fb7185;
}
.donate-card strong { display: block; margin-bottom: 4px; }
.donate-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}
.badge-supporter {
  background: rgba(251, 113, 133, 0.2);
  color: #fb7185;
  border: 1px solid rgba(251, 113, 133, 0.35);
}
.donation-modal {
  max-width: 440px;
  text-align: center;
}
.donation-modal .donation-hero {
  width: 64px;
  height: 64px;
  margin: 4px auto 12px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(251, 113, 133, 0.18);
  color: #fb7185;
}
.donation-modal h2 {
  font-family: var(--font-display);
  margin-bottom: 8px;
}
.donation-lead {
  text-align: left;
  line-height: 1.5;
  margin-bottom: 8px;
}
.donation-lead .badge { vertical-align: middle; }
.donation-hint { text-align: left; }
.donation-actions {
  flex-wrap: wrap;
  justify-content: stretch;
}
.donation-actions .btn { flex: 1; min-width: 140px; }
.donation-modal .field,
.donation-modal .donate-card {
  text-align: left;
}
.donate-key-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.donate-key-row .input {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}
.donate-key-row .btn {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 800px) {
  .settings-app { grid-template-columns: 1fr; }
  .settings-side { display: none; }
  .color-theme-grid { grid-template-columns: repeat(4, 1fr); }
}
