:root {
  color-scheme: dark;
  --bg: #18191a;
  --elevated: #242526;
  --card: #242526;
  --ink: #e4e6eb;
  --muted: #b0b3b8;
  --line: #3a3b3c;
  --header: #18191a;
  --accent: #1877f2;
  --accent-hover: #166fe5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(24, 119, 242, 0.16);
  --danger: #f02849;
  --ok: #31a24c;
  --warn: #ffd400;
  --focus: #1877f2;
  --chip: #202327;
  --rail: 275px;
  --column: 600px;
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  min-height: 100vh;
  font-size: 15px;
}

img,
svg {
  max-width: 100%;
}

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

a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--elevated);
  color: var(--ink);
  padding: 0.5rem 0.75rem;
  z-index: 2;
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: min(100% - 2rem, 72rem);
  margin-inline: auto;
}

.site-header {
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand:hover,
.x-brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.45rem;
  flex: 0 0 auto;
}

.brand-text span,
.brand span,
.x-brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  align-items: center;
}

.nav a,
.text-button {
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.nav a:hover,
.text-button:hover {
  color: var(--accent);
}

.site-footer {
  color: var(--muted);
  font-size: 0.82rem;
  padding: 1.5rem 0 2rem;
  text-align: center;
}

/* —— Desk shell (X-like) —— */
.x-app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100vh;
  width: min(100%, 1280px);
  margin-inline: auto;
}

.x-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-right: 1px solid var(--line);
}

.x-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  padding: 0.65rem 0.75rem;
}

.x-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.5rem;
}

.x-rail-link {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 500;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
}

.x-rail-link:hover,
.x-rail-link.is-active {
  background: var(--chip);
  text-decoration: none;
}

.x-rail-link.is-active {
  font-weight: 700;
}

.x-compose-btn {
  margin: 0.85rem 0.4rem 0;
  width: calc(100% - 0.8rem);
  justify-content: center;
}

.x-rail-user {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem;
  border-radius: 999px;
}

.x-rail-user:hover {
  background: var(--chip);
}

.x-rail-user strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
}

.x-rail-user span {
  color: var(--muted);
  font-size: 0.82rem;
}

.x-column {
  min-width: 0;
  border-right: 1px solid var(--line);
  max-width: var(--column);
}

.x-main {
  min-height: 100vh;
}

.x-page-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.x-page-head h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.x-profile-card {
  border-bottom: 1px solid var(--line);
}

.x-banner {
  height: 8.5rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(29, 155, 240, 0.45), transparent 45%),
    linear-gradient(120deg, #0f1419, #1a2330 55%, #0b3a55);
}

.x-profile-body {
  padding: 0 1rem 1.1rem;
  margin-top: -3rem;
}

.x-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  min-height: 2.5rem;
  margin-bottom: 0.35rem;
}

.x-profile-body h2 {
  margin: 0.35rem 0 0.1rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.x-handle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.x-bio {
  margin: 0.75rem 0 0;
  color: var(--ink);
  white-space: pre-wrap;
}

.x-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.x-stat-row strong {
  color: var(--ink);
  margin-right: 0.25rem;
}

.x-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  object-fit: cover;
  background: var(--chip);
  border: 3px solid var(--bg);
  flex-shrink: 0;
}

.x-avatar-sm { width: 40px; height: 40px; border-width: 0; }
.x-avatar-md { width: 40px; height: 40px; border-width: 0; }
.x-avatar-xl { width: 88px; height: 88px; }

.x-avatar-fallback {
  font-weight: 700;
  color: var(--ink);
}

.x-feed-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

.x-feed-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.x-feed-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.x-feed-sync {
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.x-empty-soft {
  border: none;
  background: transparent;
  padding: 1.25rem 1rem;
}

.x-empty-soft p {
  margin: 0;
  color: var(--muted);
}

.x-post {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.x-post:hover {
  background: rgba(255, 255, 255, 0.02);
}

.x-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.9rem;
}

.x-post-meta strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.x-post-text {
  display: block;
  margin: 0.2rem 0 0.45rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  text-decoration: none;
  font-size: 0.98rem;
  line-height: 1.45;
}

.x-post-text:hover {
  text-decoration: none;
}

.x-post-text-lg {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-top: 0.45rem;
}

.x-post-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.x-external {
  color: var(--accent);
}

.x-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
  max-width: 28rem;
}

.x-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.x-metric svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.x-metric b {
  font-weight: 500;
  color: var(--muted);
}

.x-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

/* —— Direct Messages —— */
.x-dm-reconnect {
  margin: 1rem;
  max-width: 32rem;
}

.x-dm-steps {
  color: var(--muted);
  padding-left: 1.2rem;
  margin: 0 0 1.1rem;
}

.x-dm-inbox .x-dm-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease;
}

.x-dm-inbox .x-dm-row:hover {
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.x-dm-row-avatar .avatar,
.x-dm-row-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
}

.x-dm-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  align-items: baseline;
  font-size: 0.92rem;
}

.x-dm-row-meta span,
.x-dm-row-meta time {
  color: var(--muted);
  font-size: 0.85rem;
}

.x-dm-preview {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-dm-thread {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  min-height: 18rem;
  max-height: min(55vh, 32rem);
  overflow-y: auto;
  border-bottom: 1px solid var(--line);
}

.x-dm-bubble {
  max-width: min(85%, 28rem);
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--elevated);
}

.x-dm-bubble.is-mine {
  align-self: flex-end;
  background: rgba(29, 155, 240, 0.14);
  border-color: rgba(29, 155, 240, 0.35);
}

.x-dm-bubble.is-theirs {
  align-self: flex-start;
}

.x-dm-bubble-meta {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.x-dm-bubble-meta time {
  color: var(--muted);
}

.x-dm-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

.x-dm-compose {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.x-dm-compose-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 4.5rem;
}


.x-compose {
  margin: 0;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

.x-compose-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  padding: 0.85rem 1rem 1rem;
}

.x-compose textarea {
  width: 100%;
  min-height: 8rem;
  resize: vertical;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.2rem;
  line-height: 1.4;
  padding: 0.25rem 0;
}

.x-compose textarea:focus {
  outline: none;
}

.x-compose-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}

.x-settings {
  margin: 1rem;
  max-width: none;
}

.flash-desk {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

/* —— Shared components —— */
.panel {
  background: var(--elevated);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.15rem;
  box-shadow: none;
}

.panel.narrow {
  max-width: 32rem;
}

.identity {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1rem;
}

.identity h1 {
  margin: 0;
  font-size: 1.45rem;
}

.account-line,
.fine,
.lede {
  color: var(--muted);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--chip);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-head h1,
.section-head h2 {
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary,
.btn-ghost {
  background: #1e242b;
  color: var(--ink);
  border-color: #4a5560;
}

.btn-ghost {
  font-weight: 600;
  background: transparent;
}

.btn-soft {
  background: var(--accent-soft);
  color: #c8e7fc;
  border-color: rgba(29, 155, 240, 0.45);
}

.btn-soft:hover {
  background: rgba(29, 155, 240, 0.28);
  color: #fff;
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-stamp {
  background: var(--accent);
  color: #fff;
}

.stack {
  display: grid;
  gap: 0.65rem;
}

label {
  font-size: 0.88rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b0c0e;
  color: var(--ink);
  font: inherit;
  padding: 0.7rem 0.8rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

#char-count[data-over="true"] {
  color: var(--danger);
}

.form-error {
  color: #ff7a82;
  margin: 0.35rem 0;
}

.flash {
  margin: 0.85rem 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.flash-success {
  background: rgba(0, 186, 124, 0.12);
  border-color: rgba(0, 186, 124, 0.35);
}

.flash-error {
  background: rgba(244, 33, 46, 0.12);
  border-color: rgba(244, 33, 46, 0.35);
}

.flash-info {
  background: rgba(29, 155, 240, 0.12);
  border-color: rgba(29, 155, 240, 0.35);
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-draft { background: rgba(255, 212, 0, 0.18); color: #ffe566; }
.status-posted { background: rgba(61, 214, 140, 0.22); color: #7dffbf; }
.status-failed { background: rgba(244, 33, 46, 0.22); color: #ff8a93; }
.status-deleted { background: #2a2e33; color: #c5ccd3; }
.status-unknown { background: #2a2e33; color: #c5ccd3; }
.status-x-live { background: rgba(29, 155, 240, 0.22); color: #8ecdf8; }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.post-link,
.post-text {
  color: var(--ink);
  white-space: pre-wrap;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.confirm summary {
  cursor: pointer;
  list-style: none;
}

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

.confirm[open] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
  background: var(--chip);
}

.admin-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.8rem;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.admin-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid #4a5560;
  background: #1a1f26;
  color: #e8eef4;
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.admin-nav a:hover {
  text-decoration: none;
  background: #24303a;
  border-color: #6b7a88;
  color: #fff;
}

.admin-nav a.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(29, 155, 240, 0.35);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}

.admin-grid .panel {
  text-align: center;
}

.admin-grid h2 {
  margin: 0;
  font-size: 1.8rem;
}

.admin-grid p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.admin-manage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.manage-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.manage-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0.85rem 0 0;
}

.manage-stats dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.manage-stats dd {
  margin: 0.1rem 0 0;
  font-weight: 700;
}

.manage-actions {
  flex-wrap: wrap;
}

.manage-danger {
  border-color: rgba(244, 33, 46, 0.35);
}

.domain-start-link {
  margin: 0.65rem 0 0.35rem;
}

.domain-start-input {
  width: 100%;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.user-table th,
.user-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.user-table th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.user-table a {
  font-weight: 650;
  text-decoration: none;
}

/* —— User management (admin tabs) —— */
.um-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(22, 24, 28, 0.85);
}

.um-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.um-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.um-tab.is-active {
  color: var(--ink);
  background: rgba(29, 155, 240, 0.16);
  box-shadow: inset 0 0 0 1px rgba(29, 155, 240, 0.35);
}

.um-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.um-tab.is-active .um-count {
  background: rgba(29, 155, 240, 0.25);
  color: #8ecdf8;
}

.um-create {
  margin-bottom: 1rem;
}

.um-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.55rem 0.65rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #14181d;
}

.um-toolbar label {
  display: grid;
  gap: 0.28rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.um-toolbar-search {
  flex: 1 1 12rem;
  min-width: 10rem;
}

.um-toolbar input,
.um-toolbar select {
  min-width: 7rem;
  width: 100%;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #3a4148;
  background: #1a1f26;
  color: #f0f3f5;
  font-size: 0.84rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.um-toolbar .btn {
  padding: 0.42rem 0.8rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.um-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  background: #12161b;
}

.um-sort-th {
  padding: 0 !important;
}

.um-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.um-sort-link:hover,
.um-sort-link.is-active {
  color: #e7e9ea;
}

.um-sort-dir {
  color: #1877f2;
  font-size: 0.85rem;
}

.um-create-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.um-create-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
  margin-top: 0.85rem;
}

.um-create-form label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.um-create-form input {
  width: 100%;
}

.um-create-note {
  padding-bottom: 1rem;
}

.um-panel {
  padding: 0;
  overflow: hidden;
}

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

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

.um-table th,
.um-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.um-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

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

.um-table tr.is-blocked {
  opacity: 0.72;
}

.mod-filters {
  margin-bottom: 0.25rem;
}

.mod-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.mod-filters-grid label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.mod-filters-grid input,
.mod-filters-grid select {
  width: 100%;
  color: var(--ink);
}

.mod-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.mod-bulk-bar select {
  min-width: 11rem;
}

.um-avatar-fallback {
  background: rgba(29, 155, 240, 0.2);
  color: #8ecdf8;
  font-weight: 700;
  font-size: 0.85rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.section-head h2 {
  margin: 0;
}

.um-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 12rem;
}

.um-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1877f2, #0f5f96);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.um-name {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.um-name:hover {
  color: var(--accent);
}

.um-sub,
.um-x {
  color: var(--muted);
  font-size: 0.85rem;
}

.um-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.um-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.um-inline-form {
  display: contents;
  margin: 0;
}

.um-btn {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  min-height: 1.9rem;
  white-space: nowrap;
}

.um-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--muted);
}

.um-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100vw - 2rem);
}

.um-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.um-dialog-card {
  width: min(26rem, 100%);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #16181c;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.um-dialog-head,
.um-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.um-dialog-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.um-dialog-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.um-dialog-body {
  padding: 1rem 1.1rem 1.15rem;
}

.um-dialog-body label {
  margin-top: 0.35rem;
}

@media (max-width: 900px) {
  .um-create-form {
    grid-template-columns: 1fr;
  }

  .um-actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .um-actions-cell {
    min-width: 14rem;
  }
}

@media (max-width: 900px) {
  .x-app {
    grid-template-columns: 1fr;
  }

  .x-rail {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
  }

  .x-rail-nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 0;
  }

  .x-rail-link {
    font-size: 0.95rem;
    padding: 0.45rem 0.7rem;
  }

  .x-compose-btn,
  .x-rail-user {
    display: none;
  }

  .x-column {
    border-right: 0;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    align-items: flex-start;
  }

  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .section-head .btn {
    width: 100%;
  }

  .actions,
  .section-head,
  .x-profile-actions,
  .x-compose-bar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .identity h1 {
    font-size: 1.45rem;
  }
}

/* —— Auth / login shell (centered card) —— */
body.auth-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.auth-shell main.wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  padding: 2.5rem 1.25rem;
}

body.auth-shell .site-footer {
  border-top: 1px solid var(--line);
  padding-block: 1rem;
  text-align: center;
}

/* Cinematic login */
body.login-cinema {
  position: relative;
  overflow-x: hidden;
  background: #000;
}

body.login-cinema .site-header,
body.login-cinema .site-footer {
  display: none;
}

body.login-cinema main.wrap {
  position: relative;
  z-index: 2;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
  min-height: 100vh;
}

.login-cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #000;
}

.login-cosmos-earth {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 42%, rgba(0, 0, 0, 0.55) 100%),
    url("/static/brand/optinfb-login-earth.jpg") center bottom / cover no-repeat;
  transform: scale(1.04);
  animation: login-earth-drift 48s ease-in-out infinite alternate;
}

.login-cosmos-nebula {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 50% 35% at 75% 18%, rgba(90, 120, 255, 0.22), transparent 70%),
    radial-gradient(ellipse 40% 30% at 18% 30%, rgba(40, 180, 220, 0.14), transparent 65%),
    radial-gradient(ellipse 45% 40% at 55% 8%, rgba(160, 80, 220, 0.1), transparent 70%);
  filter: blur(8px);
  animation: login-nebula-shift 36s ease-in-out infinite alternate;
  opacity: 0.9;
}

.login-cosmos-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-cosmos-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 40%, transparent 20%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 28%, transparent 62%, rgba(0, 0, 0, 0.5) 100%);
}

@keyframes login-earth-drift {
  from { transform: scale(1.03) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(0, -1.5%, 0); }
}

@keyframes login-nebula-shift {
  from { transform: translate3d(-2%, 0, 0) scale(1); opacity: 0.75; }
  to { transform: translate3d(2%, 1%, 0) scale(1.08); opacity: 1; }
}

.login-stage {
  position: relative;
  z-index: 2;
  width: min(100%, 26rem);
  display: grid;
  gap: 1.6rem;
  justify-items: center;
}

.login-brand {
  text-align: center;
  color: #fff;
  animation: login-brand-in 0.9s ease-out both;
}

.login-brand-kicker {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #b7c4d0;
}

.login-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 40px rgba(120, 180, 255, 0.35);
}

.login-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.7rem;
}

.login-wordmark-optin {
  font-size: clamp(2rem, 7vw, 2.75rem);
}

.login-wordmark-x {
  position: relative;
  font-size: clamp(2rem, 7vw, 2.75rem);
  color: #1877f2;
}

.login-brand-tag {
  margin: 0.85rem 0 0;
  color: #c5d0da;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

@keyframes login-brand-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card {
  width: 100%;
  max-width: 24rem;
  margin: 0;
  padding: 1.75rem 1.5rem 1.5rem;
  background: rgba(12, 16, 22, 0.72);
  border: 1px solid rgba(180, 200, 220, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: login-card-in 0.95s ease-out 0.12s both;
}

@keyframes login-card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth-card .lede {
  margin: 0 0 1.35rem;
  text-align: center;
  font-size: 0.95rem;
}

.auth-card .stack {
  gap: 0.55rem;
}

.auth-card label {
  margin-top: 0.35rem;
}

.auth-card .auth-submit {
  width: 100%;
  margin-top: 0.75rem;
  justify-content: center;
}

body.login-cinema .flash {
  position: relative;
  z-index: 3;
}

@media (max-width: 640px) {
  body.auth-shell main.wrap,
  body.login-cinema main.wrap {
    padding: 1.5rem 1rem 2rem;
    align-items: flex-start;
  }

  .auth-card,
  .login-card {
    max-width: none;
  }

  .login-brand-tag {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-cosmos-earth,
  .login-cosmos-nebula,
  .login-brand,
  .login-card {
    animation: none !important;
  }
}

.x-rank-stats dd {
  font-size: 1.15rem;
  color: var(--ink);
}

/* —— Overview dashboards (admin / moderator) —— */
.ov-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ov-kpi {
  background: linear-gradient(180deg, #1a1f26 0%, #14181d 100%);
  border: 1px solid #3a4148;
  border-radius: 14px;
  padding: 1rem 1.05rem;
  display: grid;
  gap: 0.25rem;
}

.ov-kpi-accent {
  border-color: rgba(29, 155, 240, 0.45);
  background: linear-gradient(180deg, rgba(29, 155, 240, 0.14) 0%, #14181d 100%);
}

.ov-kpi-ok {
  border-color: rgba(61, 214, 140, 0.4);
  background: linear-gradient(180deg, rgba(61, 214, 140, 0.12) 0%, #14181d 100%);
}

.ov-kpi-label {
  color: #c5ccd3;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ov-kpi-value {
  font-size: 1.75rem;
  line-height: 1.1;
  color: #fff;
  font-weight: 750;
}

.ov-kpi-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.ov-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 1.15rem;
}

.ov-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
}

.ov-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.ov-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #24303a;
  color: #d7dee5;
  font-size: 0.75rem;
  font-weight: 700;
}

.ov-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  min-height: 11rem;
  margin-top: 1rem;
}

.ov-bar-col {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 0.2rem;
  align-items: end;
  min-height: 10rem;
}

.ov-bar-track {
  height: 8.5rem;
  display: flex;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px 8px 4px 4px;
  overflow: hidden;
}

.ov-bar-fill {
  width: 100%;
  min-height: 0;
  background: linear-gradient(180deg, #4db5f7 0%, #1877f2 100%);
  border-radius: 8px 8px 2px 2px;
}

.ov-bar-val {
  text-align: center;
  font-size: 0.68rem;
  color: #d7dee5;
  font-weight: 700;
}

.ov-bar-lbl {
  text-align: center;
  font-size: 0.62rem;
  color: var(--muted);
}

.ov-donut-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin-top: 1rem;
}

.ov-donut {
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 50%;
  mask: radial-gradient(circle at center, transparent 48%, #000 49%);
  -webkit-mask: radial-gradient(circle at center, transparent 48%, #000 49%);
  flex: 0 0 auto;
}

.ov-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  flex: 1 1 10rem;
}

.ov-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
}

.ov-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
}

.ov-leg-label {
  text-transform: capitalize;
  color: #e8eef4;
  font-weight: 600;
}

.ov-hbar {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.ov-hbar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.3rem;
  color: #e8eef4;
}

.ov-hbar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ov-hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1877f2, #3dd68c);
}

.ov-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ov-user-list,
.ov-activity {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.ov-user-list li,
.ov-activity li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.ov-user-list li:last-child,
.ov-activity li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ov-user-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.ov-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.ov-activity li {
  flex-direction: column;
  align-items: flex-start;
}

.ov-activity time {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-hero .lede {
  color: #c5ccd3;
}

.um-tabs {
  background: #14181d;
}

.um-tab {
  color: #d7dee5;
}

@media (max-width: 900px) {
  .ov-charts,
  .ov-split {
    grid-template-columns: 1fr;
  }

  .ov-bars {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .ov-bar-col:nth-child(n + 8) {
    display: none;
  }
}

/* —— Campaign stats —— */
.camp-kpis {
  margin: 0.65rem 0 0.4rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.camp-kpis .ov-kpi-value {
  font-size: 1.35rem;
}

.camp-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.inline-filter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.inline-filter select {
  min-width: 10rem;
}

.camp-list .domain-start-link {
  margin-top: 0.55rem;
}

.camp-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.camp-scope {
  margin-top: 0.25rem;
}

.camp-domain-chips {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.camp-domain-chips a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #3a4148;
  background: #1a1f26;
  color: #d7dee5;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.camp-domain-chips a:hover {
  border-color: rgba(29, 155, 240, 0.55);
  color: #fff;
}

.camp-domain-chips a.is-active {
  border-color: rgba(29, 155, 240, 0.7);
  background: rgba(29, 155, 240, 0.16);
  color: #fff;
}

.camp-detail-hero .camp-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8B98A5;
}

.camp-toolbar {
  margin-bottom: 1rem;
}

.camp-section .section-head {
  margin-bottom: 0.85rem;
}

.camp-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.camp-link-card {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #2f3336;
  background: #16181c;
}

.camp-link-card-accent {
  border-color: rgba(29, 155, 240, 0.35);
  background: linear-gradient(180deg, rgba(29, 155, 240, 0.1) 0%, #16181c 100%);
}

.camp-link-card label {
  display: block;
  margin-bottom: 0.4rem;
}

.camp-link-card .fine {
  margin: 0.45rem 0 0;
}

.camp-mix-card {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #2f3336;
  background: #16181c;
}

.camp-mix-card h3 {
  margin: 0 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8B98A5;
}

.camp-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.camp-activity-panel {
  overflow: hidden;
}

.camp-hero-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.camp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.camp-switch-label {
  display: block;
  width: 100%;
  margin: 0;
}

.camp-switch {
  min-width: 14rem;
  max-width: 22rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #3a4148;
  background: #1a1f26;
  color: #f0f3f5;
  font-size: 0.9rem;
}

/* Resend-style click / email activity list */
.rs-list {
  border: 1px solid #2f3336;
  border-radius: 12px;
  background: #0c0f12;
  overflow: hidden;
}

.rs-list-head,
.rs-row {
  display: grid;
  grid-template-columns: minmax(12rem, 2.2fr) 0.7fr 0.9fr 1.1fr 0.7fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1.1rem;
}

.rs-list-head {
  border-bottom: 1px solid #242a31;
  color: #8B98A5;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #12161b;
}

.rs-row {
  border-bottom: 1px solid #1c2228;
  transition: background 0.15s ease;
}

.rs-row:last-child {
  border-bottom: 0;
}

.rs-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.rs-row.is-connected {
  background: rgba(61, 214, 140, 0.04);
}

.rs-col-to {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.rs-mail-ico {
  flex: 0 0 auto;
  display: inline-flex;
  color: #3dd68c;
  margin-top: 0.1rem;
}

.rs-to-text {
  min-width: 0;
  display: grid;
  gap: 0.3rem;
}

.rs-email {
  color: #f0f3f5;
  font-weight: 600;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rs-email.is-anon {
  color: #8B98A5;
}

.rs-status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: #16a34a;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.rs-col-country,
.rs-col-browser,
.rs-col-device {
  color: #d7dee5;
  font-size: 0.9rem;
  text-transform: capitalize;
}

.rs-col-when {
  color: #8B98A5;
  font-size: 0.86rem;
  text-align: right;
  white-space: nowrap;
}

.rs-muted {
  color: #8B98A5;
  text-transform: none;
}

.camp-empty {
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed #2f3336;
  border-radius: 12px;
  background: #14181d;
}

.camp-empty p {
  margin: 0 0 0.35rem;
  color: #f0f3f5;
  font-weight: 650;
}

@media (max-width: 900px) {
  .camp-link-grid,
  .camp-breakdown {
    grid-template-columns: 1fr;
  }

  .rs-list-head {
    display: none;
  }

  .rs-list-head,
  .rs-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .rs-col-when {
    text-align: left;
  }

  .rs-col-country,
  .rs-col-browser,
  .rs-col-device,
  .rs-col-when {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.5rem;
  }

  .rs-col-country::before,
  .rs-col-browser::before,
  .rs-col-device::before,
  .rs-col-when::before {
    content: attr(data-label);
    color: #8B98A5;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

@media (max-width: 640px) {
  .camp-kpis {
    grid-template-columns: 1fr;
  }

  .camp-hero-actions {
    width: 100%;
  }

  .camp-switch {
    max-width: none;
    width: 100%;
  }
}

/* Moderator assignment — single horizontal line */
.mod-assign-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.mod-assign-form label {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.75rem;
}

.mod-assign-form input,
.mod-assign-form select {
  width: 100%;
  min-width: 0;
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  border: 1px solid #3a4148;
  background: #1a1f26;
  color: #f0f3f5;
  font-size: 0.82rem;
}

.mod-assign-form .btn {
  flex: 0 0 auto;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

.mod-assign-table {
  font-size: 0.88rem;
}

.mod-assign-table td,
.mod-assign-table th {
  vertical-align: middle;
  white-space: nowrap;
  padding: 0.7rem 0.85rem;
}

.mod-assign-table td:nth-child(4) {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod-tg-label {
  color: #7dffb5;
  font-weight: 650;
  font-size: 0.84rem;
}

.mod-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0;
}

.mod-row-actions .btn {
  padding: 0.32rem 0.65rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.mod-row-empty td {
  opacity: 0.85;
}

.dns-target-row {
  margin-top: 0.75rem;
}

.dns-target-field {
  flex: 1 1 16rem;
  min-width: 0;
  display: grid;
  gap: 0.28rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.dns-target-field input {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.88rem;
}

.dns-target-hint {
  flex: 1 1 14rem;
  align-self: center;
  padding-bottom: 0.15rem;
}

.cd-table td {
  white-space: nowrap;
}

.cd-check {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.2rem;
}

.cd-callback-cell {
  min-width: 11rem;
  max-width: 16rem;
}

.cd-callback-input {
  width: 100%;
  min-width: 0;
  padding: 0.32rem 0.45rem;
  border-radius: 8px;
  border: 1px solid #3a4148;
  background: #1a1f26;
  color: #c5ccd3;
  font-size: 0.72rem;
}

.tg-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid #242a31;
}

.tg-table-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.tg-table-head .fine {
  margin: 0;
}

.tg-table-head .actions {
  flex-wrap: nowrap;
}

.tg-table-head .btn {
  padding: 0.36rem 0.75rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .mod-assign-form {
    flex-wrap: wrap;
  }

  .mod-assign-form label {
    flex: 1 1 calc(50% - 0.55rem);
  }
}

.fb-gaps {
  margin-top: 1rem;
}

.fb-gaps ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.page-picker {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.page-choice {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.page-choice img {
  border-radius: 8px;
}

.page-choice.is-disabled {
  opacity: 0.55;
}
