body:has(.um-shell.is-display-dark) {
  background: #16171b;
  color: #f4f1f2;
}

.um-shell {
  min-height: 100vh;
  background: var(--um-bg);
}

.um-tab,
.um-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--um-radius);
  background: transparent;
  color: var(--um-muted);
  padding: 4px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

/* Icon-only by default, like Facebook's own topbar - the label stays in the
   DOM (for screen readers) but is visually hidden; hovering/focusing a
   button shows its native title tooltip instead. The :not() guards matter:
   a button whose only child is the icon span (the modal close button) would
   otherwise have its icon clipped to 1x1px as if it were the label. */
.um-tab > span:last-child:not(.um-tab-icon),
.um-action > span:last-child:not(.um-action-icon) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.um-tab.is-active,
.um-action.is-active,
.um-action:hover,
.um-tab:hover {
  background: var(--um-chip-active-bg, #ffe4e6);
  color: var(--um-primary-dark);
}

.um-layout {
  display: grid;
  grid-template-columns: 300px minmax(360px, 680px) 320px;
  gap: 24px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 18px;
}

.um-sidebar,
.um-rightbar {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.um-sidebar .um-navitem > span:first-child:has(img) {
  background: transparent;
}

.um-mini-avatar {
  width: 34px;
  height: 34px;
}

.um-tool,
.um-btn {
  min-height: 38px;
  padding: 9px 12px;
}

.um-tool {
  border: 0;
  border-radius: var(--um-radius);
  background: transparent;
  color: var(--um-muted);
  font-weight: 800;
  cursor: pointer;
}

.um-tool.is-selected,
.um-tool:hover {
  background: var(--um-chip-active-bg, #ffe4e6);
  color: var(--um-accent);
}

.um-visibility-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--um-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.um-visibility-toggle input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.um-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: var(--um-chip-bg, #f3f4f6);
  border: 1px solid var(--um-line);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.um-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--um-surface-strong);
  box-shadow: 0 2px 6px rgba(24, 33, 31, 0.18);
  transition: transform 0.2s ease;
}

.um-visibility-toggle input:checked + .um-switch {
  background: var(--um-primary);
  border-color: var(--um-primary);
}

.um-visibility-toggle input:checked + .um-switch::after {
  transform: translateX(18px);
}

.um-bars {
  display: grid;
  gap: 10px;
}

.um-bars span {
  display: grid;
  gap: 6px;
  color: var(--um-muted);
  font-weight: 800;
}

.um-bars span::after {
  content: "";
  display: block;
  height: 10px;
  width: var(--value);
  max-width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--um-primary), var(--um-accent));
}

.um-tool-list {
  display: grid;
  gap: 8px;
}

.um-tool-list button {
  border: 1px solid var(--um-line);
  border-radius: var(--um-radius);
  background: var(--um-chip-bg, #fff7f8);
  padding: 10px 12px;
  text-align: left;
  color: var(--um-text);
  font: 600 14px/1.35 "Nunito Sans", ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
}

.um-tool-list button:hover {
  background: var(--um-chip-active-bg, #ffe4e6);
}

.um-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--um-primary);
  margin: 0 auto;
}

.um-shell.is-density-compact .um-card,
.um-shell.is-density-compact .um-module,
.um-shell.is-density-compact .um-friend-card,
.um-shell.is-density-compact .um-suggestion-card {
  padding: 10px;
}

.um-shell.is-display-dark {
  --um-bg: #16171b;
  --um-surface: #1e2024;
  --um-surface-strong: #25272c;
  --um-text: #f4f1f2;
  --um-muted: #a89ba1;
  --um-line: #34363c;
  --um-primary-dark: #fb7185;
  --um-accent: #60a5fa;
  --um-teal: #2dd4bf;
  --um-ink: #f4f1f2;
  --um-chip-bg: #2a2c31;
  --um-chip-bg-strong: #303339;
  --um-chip-active-bg: #3a2a30;
  --um-topbar-bg: rgba(22, 23, 27, 0.92);
}

.um-shell.is-reduced-motion *,
.um-shell.is-reduced-motion *::before,
.um-shell.is-reduced-motion *::after {
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}

.um-toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 25;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: min(320px, calc(100vw - 32px));
}

.um-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--um-radius);
  background: #1c1c1c;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  text-align: left;
  border: 0;
  cursor: default;
  font: inherit;
}

button.um-toast {
  cursor: pointer;
}

.um-toast-copy strong {
  display: block;
  font-size: 0.9rem;
}

.um-toast-copy small {
  display: block;
  opacity: 0.8;
  font-size: 0.8rem;
}
