:root {
  --bg: #0b0e14;
  --surface: #12161f;
  --surface-2: #171d29;
  --surface-3: #1d2431;
  --border: #232b3a;
  --border-strong: #303a4d;
  --text: #e6eaf2;
  --muted: #8b95a9;
  --faint: #626d80;
  --accent: #4c8dff;
  --accent-soft: #4c8dff1f;
  --ok: #22c55e;
  --warn: #f5a524;
  --danger: #f4506a;
  --info: #38bdf8;
  --radius: 10px;
  --radius-sm: 7px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-3);
  border-radius: 4px;
  padding: 1px 5px;
  color: #cbd5e5;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.brand-text small { font-size: 11px; color: var(--faint); }

.run-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.status-dot.is-running { background: var(--ok); box-shadow: 0 0 0 3px #22c55e26; }
.status-dot.is-paused { background: var(--warn); box-shadow: 0 0 0 3px #f5a52426; }

.topbar-spacer { flex: 1; }
.topbar-hits { font-size: 12px; color: var(--muted); white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-warn { background: #f5a5241a; border-color: #f5a52440; color: var(--warn); }
.pill-ok { background: #22c55e1a; border-color: #22c55e40; color: var(--ok); }
.pill-muted { background: var(--surface-3); border-color: var(--border); color: var(--faint); }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 32vw) minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  max-height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  min-width: 400px;
}

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 10px 0 16px; }

.sidebar-actions {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

/* ---------- Collapsible groups ---------- */

.group { border-bottom: 1px solid var(--border); }

.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.group-head::-webkit-details-marker { display: none; }

.group-head::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s ease;
  flex: none;
}

.group[open] > .group-head { color: var(--text); }
.group[open] > .group-head::after { transform: rotate(-135deg) translate(-2px, -2px); }
.group-head:hover { color: var(--text); background: var(--surface-2); }

.group-body {
  padding: 4px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack { display: flex; flex-direction: column; gap: 14px; }

.is-dimmed { opacity: 0.5; }

/* ---------- Form controls ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }

.field > label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
input:not([type]),
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea { resize: vertical; font-family: var(--mono); font-size: 12px; line-height: 1.6; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder, textarea::placeholder { color: var(--faint); }
input:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%),
    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field-pair-wide { grid-template-columns: 1fr 96px; }

.field-highlight {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.field-highlight label {
  color: var(--text);
  font-weight: 600;
}

.fb-reaction-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong, var(--border));
  background: color-mix(in srgb, var(--surface-2, var(--surface)) 88%, var(--accent) 12%);
}
.fb-reaction-box-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.fb-reaction-box-head strong {
  font-size: 13px;
  color: var(--text);
}
.fb-reaction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.fb-reaction-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.fb-reaction-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fb-reaction-input input {
  width: 100%;
  min-height: 38px;
  font-size: 15px;
  font-weight: 600;
}
.fb-reaction-input > span {
  color: var(--muted);
  font-weight: 600;
  min-width: 1em;
}
.fb-reaction-total-ok { color: var(--ok); }
.fb-reaction-total-bad { color: var(--danger); font-weight: 700; }

.hint { font-size: 11.5px; color: var(--faint); line-height: 1.5; }

.switch {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.switch input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: none; cursor: pointer; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:hover:not(:disabled) { background: #262f3f; border-color: #3c4759; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3d7ff5; border-color: #3d7ff5; }

.btn-secondary { background: var(--surface-3); }

.btn-danger { background: #f4506a1a; border-color: #f4506a40; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #f4506a2b; border-color: #f4506a70; }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; }

.btn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Callouts ---------- */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-line;
}

.callout-ok { border-left-color: var(--ok); color: #b6f0cb; background: #22c55e12; }
.callout-warn { border-left-color: var(--warn); color: #f6d9a4; background: #f5a52412; }
.callout-danger { border-left-color: var(--danger); color: #f8c0cb; background: #f4506a12; }

/* ---------- Cards & tabs ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 320px;
}

.feed-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border);
}
.feed-toolbar .hint {
  margin: 0;
  flex: 1;
  min-width: 180px;
}
.feed-toolbar .switch {
  margin: 0;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 14px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.tab-panel { display: none; padding: 16px; }

.tab-panel.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.panel-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.panel-title + .code-block { margin-bottom: 18px; }

.code-block {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: #9fc3ff;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- Metrics ---------- */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
}

.metric-val {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.metric-lbl {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 3px;
}

.metric-sub { margin-top: 7px; font-size: 11px; color: var(--muted); line-height: 1.45; }

.metric-card--ok .metric-val { color: var(--ok); }
.metric-card--blocked .metric-val { color: var(--warn); }
.metric-card--error .metric-val { color: var(--danger); }
.metric-card--timeout .metric-val { color: var(--info); }

.parallel-runs-panel {
  margin-bottom: 0;
  padding: 14px 16px 12px;
  flex: none;
  min-height: 0;
  overflow: visible;
}

.parallel-runs-panel.card {
  flex: none;
  min-height: 0;
}

.parallel-runs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.parallel-runs-head .panel-title {
  margin: 0;
}

.parallel-runs-mode {
  color: var(--faint);
  font-size: 11px;
}

.parallel-runs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.parallel-run-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.parallel-run-card.is-running { border-color: rgba(46, 204, 113, 0.35); }
.parallel-run-card.is-queued { border-color: rgba(52, 152, 219, 0.35); opacity: 0.92; }
.parallel-run-card.is-visit { border-color: rgba(149, 165, 166, 0.35); opacity: 0.78; }
.parallel-run-card.is-stopped { opacity: 0.72; }

.parallel-run-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--info);
  background: rgba(52, 152, 219, 0.12);
}

.parallel-run-tag.is-visit {
  color: #95a5a6;
  background: rgba(149, 165, 166, 0.14);
}

.parallel-run-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.parallel-run-url {
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 8px;
}
.parallel-run-url .feed-post-link { font-size: inherit; }

.parallel-run-meta-line {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(46, 204, 113, 0.08);
  border: 1px solid rgba(46, 204, 113, 0.2);
}
.parallel-run-card.is-visit .parallel-run-meta-line {
  background: rgba(149, 165, 166, 0.1);
  border-color: rgba(149, 165, 166, 0.25);
}
.parallel-run-meta-hint {
  color: var(--muted);
  font-size: 10px;
}

.parallel-run-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.parallel-run-stats strong {
  color: var(--text);
  font-weight: 600;
}

.page-watch-analytics {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.timing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.timing-summary strong {
  color: var(--text);
  font-weight: 600;
}

.timing-summary--panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.timing-stat {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.timing-stat-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.timing-subtitle {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.timing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 10px;
}

.timing-table th,
.timing-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.timing-table th {
  color: var(--muted);
  font-weight: 600;
}

.timing-panel {
  min-height: 120px;
}

.feed-post-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(52, 152, 219, 0.14);
  color: #7ec8ff;
  font-size: 10px;
  font-weight: 600;
}

.feed-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  max-width: 100%;
}

.feed-avatar-wrap {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.feed-avatar,
.feed-avatar-fallback {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  display: block;
}

.feed-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.feed-avatar-fallback.is-icon {
  color: rgba(255, 255, 255, 0.72);
}

.feed-avatar-icon {
  width: 14px;
  height: 14px;
  display: block;
}

.feed-avatar-wrap.is-auth-alert .feed-avatar,
.feed-avatar-wrap.is-auth-alert .feed-avatar-fallback {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.95);
}

.feed-auth-signal {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--surface, #12161c);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.45);
  animation: feed-auth-pulse 1.4s ease-in-out infinite;
}

@keyframes feed-auth-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.75; }
}

.feed-profile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.feed-profile-chip.is-auth-alert .feed-profile-name {
  color: #fecaca;
}

.feed-auth-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 999px;
}

.feed-auth-badge.is-nologin,
.feed-auth-badge.is-checkpoint {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.feed-item.is-auth-issue .feed-row {
  border-left: 3px solid rgba(239, 68, 68, 0.85);
  padding-left: 8px;
}

.feed-item.is-auth-issue .feed-status {
  color: #f87171;
  font-weight: 700;
}

/* ---------- Live feed ---------- */

.feed-body { flex: 1; overflow-y: auto; margin: -16px; }

.feed-item { border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }

.feed-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 104px;
  gap: 12px;
  padding: 11px 16px;
  align-items: start;
}

.feed-time { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.feed-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.feed-url { color: var(--text); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-post-link {
  color: var(--info, #60a5fa);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.feed-post-link:hover {
  color: var(--text);
  border-bottom-color: currentColor;
  text-decoration: none;
}
.feed-meta { color: var(--faint); font-size: 11px; line-height: 1.5; word-break: break-word; }

.feed-status {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--muted);
}

.feed-row.is-ok .feed-status { color: var(--ok); }
.feed-row.is-blocked .feed-status { color: var(--warn); }
.feed-row.is-error .feed-status { color: var(--danger); }
.feed-row.is-timeout .feed-status { color: var(--info); }

.feed-empty, .ipv6-health-empty { padding: 22px 16px; color: var(--faint); font-size: 13px; text-align: center; }

.feed-pw-live {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08), transparent 72%);
  padding: 12px 16px 10px;
}

.feed-pw-live-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.feed-pw-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: var(--faint);
}

.feed-pw-live-dot.is-live {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: feed-pw-pulse 1.6s ease-out infinite;
}

.feed-pw-live-dot.is-idle { background: #f59e0b; }

@keyframes feed-pw-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.feed-pw-live-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.feed-pw-live-sub { font-size: 11px; color: var(--faint); margin-top: 2px; }

.feed-pw-queue {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-pw-queue-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.feed-pw-queue-tag {
  color: var(--accent, #38bdf8);
  font-weight: 600;
  text-transform: lowercase;
}

.feed-pw-queue-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.feed-pw-queue-label .feed-post-link { font-size: inherit; color: var(--accent, #38bdf8); }

.feed-pw-queue-progress { color: var(--text); font-variant-numeric: tabular-nums; }

.feed-pw-queue-bar {
  grid-column: 2 / -1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.feed-pw-queue-bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.feed-preview { padding: 0 16px 12px; }
.feed-preview--pending {
  min-height: 48px;
  display: flex;
  align-items: center;
  color: var(--muted, #8b93a7);
}

.feed-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  object-position: top;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

/* ---------- IPv6 health ---------- */

.ipv6-health-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
}

.ipv6-health-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 82px 64px;
  gap: 12px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.ipv6-health-row:last-child { border-bottom: 0; }
.ipv6-health-status { font-size: 10.5px; font-weight: 600; letter-spacing: 0.5px; }
.ipv6-health-row.is-healthy .ipv6-health-status { color: var(--ok); }
.ipv6-health-row.is-degraded .ipv6-health-status { color: var(--warn); }
.ipv6-health-row.is-cooldown .ipv6-health-status { color: var(--info); }
.ipv6-health-ip { color: var(--text); font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.ipv6-health-meta { color: var(--faint); font-size: 11px; line-height: 1.5; word-break: break-word; }
.ipv6-health-score { text-align: right; font-variant-numeric: tabular-nums; }
.ipv6-health-cooldown { text-align: right; color: var(--info); }

/* ---------- Technical log ---------- */

.log-panel {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  flex: 1;
  overflow-y: auto;
  margin: -16px;
  padding: 8px 16px;
}

.log-row { white-space: pre-wrap; padding: 4px 0; border-bottom: 1px solid var(--border); word-break: break-word; }
.log-row:last-child { border-bottom: 0; }
.log-row--muted { color: var(--faint); }

/* ---------- Modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #05070bd9;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 20px;
  overflow: auto;
}

.modal-card {
  width: 100%;
  max-width: 1180px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-full { padding: 8px; }
.modal-full .modal-card {
  max-width: none;
  width: min(100%, 100vw - 16px);
  height: calc(100dvh - 16px);
  max-height: calc(100dvh - 16px);
}

.profile-capture-card {
  min-height: 0;
  height: 100%;
}

.profile-capture-toolbar,
.profile-capture-bar,
.profile-capture-card > .modal-head {
  flex-shrink: 0;
}

.profile-capture-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  background: #0a0c10;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--border);
}

#profileCaptureCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  background: #000;
  cursor: crosshair;
}

#profileCaptureModal:not([hidden]) #profileCaptureCanvas {
  width: 100%;
  max-height: none;
}

#profileCaptureCanvas.is-mobile {
  width: min(390px, 100%);
  margin: 12px auto;
  border-radius: 18px;
  box-shadow: 0 0 0 8px #1a1a1a, 0 12px 40px rgba(0, 0, 0, 0.35);
}

.profile-capture-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profile-capture-upload .btn-row {
  flex-shrink: 1;
  flex-wrap: wrap;
  max-width: 100%;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.modal-head h2 { font-size: 14px; font-weight: 600; }

.modal-meta {
  padding: 12px 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  word-break: break-word;
}

.modal-meta pre { font-family: var(--mono); font-size: 11px; white-space: pre-wrap; color: var(--faint); }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-body img { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.profile-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-group {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.profile-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.profile-group-head-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-left: auto;
}

.profile-group-head-meta.is-warn {
  color: var(--warn);
}

.profile-group-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.profile-group-head-actions .btn {
  flex: 1 1 auto;
  min-width: 0;
}

.profile-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.profile-group-icon--youtube { background: #ff0000; }
.profile-group-icon--facebook { background: #1877f2; }

.profile-tabs-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
  min-width: 0;
  width: 100%;
}

.profile-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
  max-height: min(55vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.profile-tab {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.profile-tab.is-active {
  border-color: var(--accent);
  background: #3b82ff18;
}

.profile-tab.is-selected-for-run {
  box-shadow: inset 0 0 0 1px #22c55e66;
}

.profile-tab-check {
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
}

.profile-tab-label {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
  font-weight: 600;
  line-height: 1.25;
}

.profile-tab-account {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #22c55e22;
  color: #86efac;
  border: 1px solid #22c55e55;
  flex-shrink: 0;
}

.profile-tab-account.is-duplicate,
.profile-tab.is-duplicate-account {
  border-color: #f59e0b88;
}

.profile-tab-account.is-duplicate {
  background: #f59e0b22;
  color: #fcd34d;
  border-color: #f59e0b66;
}

.profile-tab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}

.profile-tab-actions .btn {
  flex: 1 1 auto;
  min-width: 72px;
}

.profile-tab-actions .profile-tab-remove,
.profile-tab-actions .profile-tab-remove-group {
  color: #fecaca;
  border-color: #ef444466;
}

.profile-tab-relogin {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.85;
}

.profile-tab-relogin:hover { opacity: 1; color: #60a5fa; }

.profile-tab-server,
.profile-tab-pc {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
}
.profile-tab-server:hover,
.profile-tab-pc:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.profile-tab-pc {
  background: #1d4ed826;
  border-color: #3b82f666;
  color: #93c5fd;
}

.profile-check-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-check-delete {
  min-width: 28px;
  color: var(--danger, #f4506a);
  font-size: 16px;
  line-height: 1;
  padding: 2px 8px;
}
.profile-check-delete:hover {
  background: #f4506a22;
}

.profile-tab-avatar-open {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex: 0 0 auto;
  line-height: 0;
}

.profile-tab-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-block;
}

.profile-tab--compact .profile-tab-avatar-wrap {
  width: 28px;
  height: 28px;
}

.profile-tab-avatar,
.profile-tab-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.08);
}

.profile-tab-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.profile-tab-avatar-fallback.is-icon {
  color: rgba(255, 255, 255, 0.7);
}

.profile-tab-avatar-fallback .feed-avatar-icon {
  width: 18px;
  height: 18px;
}

.profile-tab-avatar-wrap.is-offline .profile-tab-avatar,
.profile-tab-avatar-wrap.is-offline .profile-tab-avatar-fallback {
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.95);
  opacity: 0.92;
}

.profile-tab-avatar-wrap.is-online .profile-tab-avatar,
.profile-tab-avatar-wrap.is-online .profile-tab-avatar-fallback {
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.85);
}

.profile-tab-auth-signal {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface, #12161c);
}

.profile-tab-avatar-wrap.is-online .profile-tab-auth-signal {
  background: #22c55e;
}

.profile-tab-avatar-wrap.is-offline .profile-tab-auth-signal {
  background: #ef4444;
  animation: feed-auth-pulse 1.4s ease-in-out infinite;
}

.profile-tab-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-tab-sub {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.profile-tab--fb-card {
  width: 100%;
  border-radius: 12px;
  padding: 8px 10px;
  gap: 8px;
}

.profile-tab--fb-card.is-offline-tab,
.profile-tab--fb-card.has-creds {
  flex-wrap: wrap;
}

.profile-tab-creds {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.profile-cred-copy {
  appearance: none;
  border: 1px solid #ef444466;
  background: #7f1d1d44;
  color: #fecaca;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  text-align: left;
}

.profile-cred-copy:hover {
  background: #7f1d1d77;
}

.profile-cred-kind {
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.04em;
  opacity: 0.85;
  flex-shrink: 0;
}

.profile-cred-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #fff;
  word-break: break-all;
}

.profile-tab-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.profile-tab-status.is-online {
  color: #86efac;
  background: #14532d44;
  border-color: #22c55e55;
}

.profile-tab-status.is-guest {
  color: #93c5fd;
  background: #1e3a5f66;
  border-color: #3b82f655;
}

.profile-tab-status.is-offline {
  color: #fecaca;
  background: #7f1d1d55;
  border-color: #ef4444aa;
}

.profile-tab-status.is-checkpoint {
  color: #fff1f2;
  background: #991b1bcc;
  border-color: #f87171;
  font-weight: 700;
}

.profile-tab-ipv6 {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 2px 6px;
  border-radius: 6px;
  color: #86efac;
  background: #14532d33;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tab-ipv6.is-missing {
  color: #fcd34d;
  background: #78350f33;
}

.profile-tab-ipv6-btn {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #ffffff22;
  background: #1e293b;
  color: #e2e8f0;
  cursor: pointer;
}

.profile-tab-ipv6-btn:hover {
  border-color: #38bdf8;
  color: #7dd3fc;
}

.profile-tab.is-offline-tab {
  opacity: 0.92;
  border-style: dashed;
}

.profile-tab--compact {
  font-size: 12px;
}

.fb-account-group {
  border: 1px solid #ffffff12;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 8px;
  background: #0d1420;
}

.fb-account-group.is-offline {
  border-color: rgba(239, 68, 68, 0.35);
}

.fb-account-head-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.fb-account-group.has-find-pages .fb-account-head-row {
  grid-template-columns: 44px 36px minmax(0, 1fr);
}

.fb-account-find-pages {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-height: 44px;
  border: 1px solid #3b82f666;
  border-radius: 10px;
  background: #ffffff08;
  color: #93c5fd;
  cursor: pointer;
  padding: 4px;
}

.fb-account-find-pages:hover:not(:disabled) {
  background: #1877f233;
}

.fb-account-find-pages:disabled,
.fb-account-find-pages.is-offline-gen {
  opacity: 0.4;
  cursor: not-allowed;
}

.fb-account-find-pages.is-busy {
  opacity: 0.7;
  cursor: wait;
}

.fb-account-caret {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 44px;
  min-height: 44px;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  background: #ffffff08;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.fb-account-caret:hover {
  background: #ffffff12;
}

.fb-account-caret.is-generate {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
  color: #93c5fd;
  border-color: #3b82f666;
}

.fb-account-caret.is-generate:hover:not(:disabled) {
  background: #1877f233;
}

.fb-account-caret.is-generate:disabled,
.fb-account-caret.is-generate.is-offline-gen {
  opacity: 0.4;
  cursor: not-allowed;
}

.fb-account-caret.is-generate.is-busy {
  opacity: 0.7;
  cursor: wait;
}

.fb-account-generate-icon {
  width: 14px;
  height: 14px;
  position: relative;
  display: block;
}

.fb-account-generate-icon::before,
.fb-account-generate-icon::after {
  content: "";
  position: absolute;
  border: 1.5px solid #93c5fd;
  border-radius: 2px;
  background: #0d1420;
}

.fb-account-generate-icon::before {
  width: 9px;
  height: 11px;
  left: 0;
  top: 2px;
}

.fb-account-generate-icon::after {
  width: 9px;
  height: 11px;
  left: 4px;
  top: 0;
}

.fb-account-caret-icon {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent #dbe7ff;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.fb-account-group.is-open .fb-account-caret-icon {
  transform: rotate(90deg);
}

.fb-account-caret-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
}

.fb-account-personal {
  min-width: 0;
}

.fb-account-pages-label {
  margin: 6px 2px 4px;
  font-size: 11px;
  color: var(--faint);
}

.fb-accounts-block.is-collapsed {
  display: none;
}

.fb-guest-block {
  border: 1px solid #38bdf822;
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: #0b1220;
}

.fb-guest-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fb-guest-caret {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 44px;
  min-height: 40px;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  background: #ffffff08;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.fb-guest-block.is-open .fb-guest-caret .fb-account-caret-icon {
  transform: rotate(90deg);
}

.fb-guest-title {
  flex: 1;
  min-width: 140px;
  font-size: 12px;
  font-weight: 600;
}

.fb-guest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fb-guest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.fb-account-head {
  margin-bottom: 8px;
}

.fb-account-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fb-account-title {
  font-size: 13px;
}

.fb-account-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

.fb-account-status.is-online {
  color: #86efac;
  background: #14532d33;
}

.fb-account-status.is-offline {
  color: #fecaca;
  background: #7f1d1d55;
  border: 1px solid #ef4444aa;
}

.fb-auto-post-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #ffffff14;
  border-radius: 10px;
  background: #0b1220;
}

.fb-auto-post-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fb-auto-post-banner-text strong {
  font-size: 13px;
}

.fb-auto-post-pill {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: 999px;
}

.fb-auto-post-pill.is-on {
  color: #86efac;
  background: #14532d55;
}

.fb-auto-post-pill.is-off {
  color: #fca5a5;
  background: #7f1d1d44;
}

.fb-auto-post-pill.is-na {
  color: #93c5fd;
  background: #1e3a5f55;
}

.fb-page-watch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.fb-page-watch-summary {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-2));
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.fb-page-watch-summary strong {
  color: var(--text);
  font-weight: 600;
}

.fb-page-watch-advanced {
  margin-top: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px 8px;
  background: rgba(255, 255, 255, 0.02);
}

.fb-page-watch-advanced > summary {
  cursor: pointer;
  font-size: 11px;
  color: var(--faint);
  padding: 8px 0;
  user-select: none;
}

.fb-page-watch-advanced-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.fb-page-watch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 4px;
}

.fb-page-watch-grid .field {
  min-width: 0;
}

.fb-page-watch-grid .field > label {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.fb-page-watch-actions {
  margin-top: 0;
}

.host-live-meter {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.host-live-meter--main {
  margin: 0 0 12px;
}

.host-live-meter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.host-live-meter-stamp {
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
}

.host-live-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.host-live-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.host-live-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 70%, transparent);
  overflow: hidden;
}

.host-live-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #22c55e;
  transition: width 0.35s ease, background 0.35s ease;
}

.host-live-fill.is-warn {
  background: #f5a524;
}

.host-live-fill.is-hot {
  background: #ef4444;
}

.host-live-fill.is-ram {
  background: #38bdf8;
}

.host-live-fill.is-ram.is-warn {
  background: #f5a524;
}

.host-live-fill.is-ram.is-hot {
  background: #ef4444;
}

.host-live-val {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 7.5rem;
  text-align: right;
}

.host-live-meta {
  margin: 4px 0 0;
  font-size: 11px;
}

.host-live-meter.is-critical {
  border-color: #ef444466;
  box-shadow: inset 0 0 0 1px #ef444422;
}

.fb-page-watch-queue {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.fb-page-watch-queue-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.fb-page-watch .parallel-runs-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}

.fb-page-watch .parallel-runs-mode {
  line-height: 1.45;
  width: 100%;
}

.fb-page-watch .parallel-runs-grid {
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

.fb-page-watch .parallel-run-card {
  padding: 8px 10px;
}

.fb-page-watch .parallel-run-stats {
  flex-wrap: wrap;
  gap: 6px 10px;
}

.fb-account-hidden {
  margin: 6px 0 0;
  font-size: 12px;
}

.profile-tab-add {
  width: 100%;
  min-height: 40px;
  height: auto;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  border-color: #3b82ff55;
  background: #3b82ff12;
  flex: none;
  order: 20;
}

.facebook-pages-sync {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.facebook-pages-sync-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.facebook-pages-sync-row select,
.facebook-pages-sync-row input {
  width: 100%;
  min-width: 0;
}

.facebook-pages-sync-row .btn {
  width: 100%;
  white-space: nowrap;
}

/* Checklist de status das contas */
.profile-checklist {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #1a2230 0%, var(--surface-2) 100%);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-checklist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profile-checklist-head strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.profile-checklist-head .hint {
  margin: 2px 0 0;
}

.profile-checklist-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#profileGroupFacebook .profile-checklist {
  margin: 0 0 10px;
  padding: 10px 12px;
}

#profileGroupFacebook .profile-checklist-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-fb-toolbar {
  flex-wrap: wrap;
  gap: 6px;
}

.profile-check-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 8px 10px;
  min-width: 0;
}

.profile-check-stat .val {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.profile-check-stat .lbl {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.profile-check-stat.is-ok .val { color: var(--ok); }
.profile-check-stat.is-warn .val { color: var(--warn); }
.profile-check-stat.is-danger .val { color: var(--danger); }
.profile-check-stat.is-muted .val { color: var(--faint); }

.profile-checklist-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  max-height: min(50vh, 480px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.profile-check-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}

.profile-check-item .actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}

.profile-check-item .mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.profile-check-item.is-ok .mark { background: #22c55e26; color: var(--ok); }
.profile-check-item.is-warn .mark { background: #f5a52426; color: var(--warn); }
.profile-check-item.is-danger .mark { background: #f4506a26; color: var(--danger); }
.profile-check-item.is-todo .mark { background: #4c8dff26; color: var(--accent); }

.profile-check-item .body { min-width: 0; }
.profile-check-item .body strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}
.profile-check-item .body span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-word;
}

.profile-check-item .actions .btn { white-space: nowrap; }

.fb-account-pages {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 0 52px;
  padding: 8px 0 2px 10px;
  border-left: 2px solid #1877f266;
  max-width: 100%;
  min-width: 0;
}

.fb-account-pages .profile-tab {
  width: 100%;
  max-width: 100%;
  flex: none;
}

.profile-tab.is-virtual-parent {
  background: transparent;
  border-style: dashed;
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: minmax(380px, 36vw) minmax(0, 1fr);
  }
  .sidebar { min-width: 360px; }
}

.profile-capture-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr minmax(220px, 360px);
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  align-items: end;
  background: var(--surface-2);
}

.profile-capture-actions .field-label-spacer {
  display: block;
  height: 18px;
  font-size: 12px;
}

.profile-capture-save-row {
  width: 100%;
}

.profile-capture-save-row .btn-primary {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.profile-capture-ipv6-switch {
  margin-top: 8px;
  font-size: 13px;
}

.profile-capture-ipv6-switch span {
  color: #cbd5e1;
}

#profileCaptureModal.is-guest-public #profileCaptureNameField,
#profileCaptureModal.is-guest-public .profile-capture-save-row,
#profileCaptureModal.is-guest-public #profileCaptureIpv6Wrap,
#profileCaptureModal.is-guest-public #profileCaptureCreds,
#profileCaptureModal.is-guest-public #profileCaptureChromePcBtn,
#profileCaptureModal.is-guest-public #profileCaptureMyProfileBtn,
#profileCaptureModal.is-guest-public #profileCaptureEditProfileBtn,
#profileCaptureModal.is-guest-public #profileCaptureAddPhotoBtn,
#profileCaptureModal.is-guest-public #profileCaptureUploadBtn {
  display: none !important;
}

@media (max-width: 960px) {
  .profile-capture-toolbar { grid-template-columns: 1fr 1fr; }
  .profile-capture-actions { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .profile-capture-toolbar { grid-template-columns: 1fr; }
}

.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.profile-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px #3b82ff33;
}

.profile-card-main { min-width: 0; flex: 1; }
.profile-card-name { font-size: 13px; font-weight: 600; }
.profile-card-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }
.profile-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.profile-capture-bar {
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-capture-login {
  font-family: inherit;
  font-size: 12px;
  color: var(--warn, #d4a017);
}

.profile-capture-login.is-ok {
  color: var(--ok, #3fb950);
}

.profile-capture-creds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  white-space: normal;
  background: rgba(127, 29, 29, 0.2);
  color: #fecaca;
  overflow: visible;
}

.profile-capture-creds-label {
  font-size: 11px;
  font-weight: 600;
}

.profile-capture-creds-row {
  flex: 1 1 auto;
}

.profile-capture-upload {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  white-space: normal;
  font-family: inherit;
  font-size: 12px;
  color: var(--faint);
}

.profile-capture-upload.is-waiting {
  background: rgba(212, 160, 23, 0.12);
  color: var(--warn, #d4a017);
  border-color: rgba(212, 160, 23, 0.35);
}

.profile-capture-drop {
  position: absolute;
  inset: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: rgba(8, 12, 20, 0.88);
  color: #f3f6fb;
  pointer-events: auto;
}

.profile-capture-drop[hidden] {
  display: none !important;
}

.profile-capture-drop strong {
  font-size: 16px;
}

.profile-capture-drop span {
  font-size: 12px;
  color: rgba(243, 246, 251, 0.75);
  max-width: 420px;
}

.profile-capture-stage.is-dragover .profile-capture-drop {
  border-color: #4ea1ff;
  background: rgba(20, 40, 70, 0.92);
}

.modal.is-mobile-capture .modal-card {
  max-width: min(520px, 100%);
  margin: 0 auto;
}

#remoteBrowserIframe { flex: 1; width: 100%; border: 0; background: #000; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 720px) {
  .topbar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .topbar-hits { display: none; }
  .content { padding: 14px; }
  .feed-row { grid-template-columns: 1fr; gap: 4px; }
  .feed-status { text-align: left; }
  .ipv6-health-row { grid-template-columns: 1fr; gap: 4px; }
  .ipv6-health-score, .ipv6-health-cooldown { text-align: left; }
}

/* ---------- Criação FB ---------- */

.fb-create-host-block {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.12);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.fb-create-panel { display: flex; flex-direction: column; gap: 16px; }
.fb-create-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fb-create-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-create-form { gap: 12px; }
.fb-create-preview {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.5;
}
.fb-create-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.fb-create-metric {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.fb-create-metric-val { font-size: 22px; font-weight: 700; line-height: 1.1; }
.fb-create-metric-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px; }
.fb-create-queue { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.fb-create-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr 0.6fr 0.5fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  align-items: center;
}
.fb-create-row.is-active {
  background: rgba(24, 119, 242, 0.08);
  border-left: 3px solid #1877f2;
}
.fb-create-row:last-child { border-bottom: 0; }
.fb-create-row--head { font-weight: 600; background: var(--surface-2); position: sticky; top: 0; }
.fb-create-live-badge {
  font-size: 12px;
  font-weight: 600;
  color: #1877f2;
  margin-bottom: 8px;
}
.fb-create-live-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: 12px;
}
.fb-create-live-grid .lbl {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.fb-create-batch-hint {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.fb-create-status--ok { color: #22c55e; }
.fb-create-status--fail { color: #ef4444; }
.fb-create-status--run { color: #f59e0b; }
.fb-create-status--wait { color: var(--muted); }

.fb-create-mailbox {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  max-height: 220px;
  overflow: auto;
}
.fb-create-mail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
}
.fb-create-mail-list { display: flex; flex-direction: column; gap: 6px; }
.fb-create-mail-row {
  display: grid;
  grid-template-columns: 52px 1fr 90px;
  gap: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
}
.fb-create-mail-row.is-warn { background: rgba(239, 68, 68, 0.12); }
.fb-create-mail-time { color: var(--muted); }
.fb-create-mail-code { text-align: right; }

.fb-create-scheduler {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
}
.fb-create-scheduler-head { font-size: 13px; margin-bottom: 10px; }
.fb-create-strat-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-create-strat {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.fb-create-strat.is-on {
  background: rgba(24, 119, 242, 0.15);
  border-color: #1877f2;
  color: #1877f2;
  font-weight: 600;
}

.fb-create-progress-wrap {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fb-create-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}
.fb-create-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.fb-create-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1877f2, #22c55e);
  transition: width 0.45s ease;
  min-width: 0;
}
.fb-create-steps {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 12px;
  font-size: 12px;
}
.fb-create-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.fb-create-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.fb-create-step.is-active { color: var(--text); font-weight: 600; }
.fb-create-step.is-active::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
.fb-create-step.is-done { color: #22c55e; }
.fb-create-step.is-done::before { background: #22c55e; }
