/* ==========================================================================
   NeonForge · Vercel design layer (loaded last)
   --------------------------------------------------------------------------
   Strict monochrome system inspired by vercel.com / Geist:
     canvas     #000 / #0a0a0a
     borders    1px #1f1f23 (hover #3f3f46)
     text       #ededed titles, #a1a1aa secondary, #71717a tertiary
     accent     pure white (primary buttons, active states, focus rings)
     semantics  green dot = ready/online/live, amber = review, red = error
   Geist / Geist Mono typography, 8–12px radii, hairline grid + light cone.
   Every component keeps its behaviour; only the visual language changes.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Canvas & surfaces */
  --bg: #000000;
  --bg-2: #0a0a0a;
  --surface: #0a0a0a;
  --surface-2: #111113;
  --surface-solid: #0a0a0a;
  --surface-raised: #161618;
  --surface-hover: #18181b;
  --border: #1f1f23;
  --border-strong: #27272a;
  --border-hover: #3f3f46;

  /* Text */
  --text: #ededed;
  --text-dim: #d4d4d8;
  --muted: #a1a1aa;
  --subtle: #71717a;

  /* Monochrome accent: white */
  --accent: #ffffff;
  --accent-rgb: 255, 255, 255;
  --accent-text: #ffffff;

  /* Every former neon hue resolves to white/zinc; semantics stay readable */
  --cyan: #ededed;
  --cyan-rgb: 237, 237, 237;
  --magenta: #ededed;
  --magenta-rgb: 237, 237, 237;
  --violet: #d4d4d8;
  --violet-rgb: 212, 212, 216;
  --lime: #50e3c2;
  --lime-rgb: 80, 227, 194;
  --green: #50e3c2;
  --amber: #f5a623;
  --amber-rgb: 245, 166, 35;
  --red: #ff4444;
  --red-rgb: 255, 68, 68;

  --primary: #ffffff;
  --primary-rgb: 255, 255, 255;
  --gradient: linear-gradient(180deg, #ffffff, #d4d4d8);

  /* Shape & depth */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 12px;
  --shadow: none;
  --shadow-pop: 0 0 0 1px var(--border-strong), 0 16px 48px -12px rgba(0, 0, 0, 0.9);
  --glow: 0 0 0 1px var(--border-hover), 0 0 0 4px rgba(255, 255, 255, 0.06);
  --blur: saturate(180%) blur(16px);

  /* Type */
  --font: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --nav-h: 64px;
  --fast: 150ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Canvas: black, hairline grid, light cone from the header ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  letter-spacing: -0.006em;
  font-feature-settings: 'liga', 'calt';
}

::selection {
  background: rgba(255, 255, 255, 0.9);
  color: var(--on-hi);
}

h1,
h2,
h3 {
  color: var(--hi-strong);
  letter-spacing: -0.03em;
}

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

a:hover {
  color: var(--hi-strong);
}

.bg-fx {
  background:
    conic-gradient(from 180deg at 50% -6%, transparent 155deg, rgba(255, 255, 255, 0.07) 180deg, transparent 205deg),
    radial-gradient(ellipse 50% 32% at 50% -4%, rgba(255, 255, 255, 0.09), transparent 70%);
}

.bg-orb {
  display: none;
}

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 50% at 50% 0%, #000 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 75% 50% at 50% 0%, #000 15%, transparent 72%);
}

.text-gradient {
  background: linear-gradient(180deg, #ffffff 35%, #71717a 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Surfaces ---------- */
.card,
.dir-card,
.side-section,
.side-user,
.side-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal,
.popover {
  background: var(--shade-0a);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

.modal-overlay {
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-header,
.menu-sep {
  border-color: var(--border);
}

.navbar {
  background: rgba(var(--tint-rgb), 0.7);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.navbar::before,
.navbar::after {
  display: none;
}

.side-nav,
.sidebar-left .side-section {
  background: transparent;
  border-color: transparent;
}

/* ---------- Buttons: white primary, hairline secondary ---------- */
.btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: background var(--fast), border-color var(--fast), color var(--fast), box-shadow var(--fast);
}

.btn:hover:not(:disabled) {
  transform: none;
  border-color: var(--border-hover);
}

.btn-primary {
  --btn-bg: var(--hi);
  --btn-fg: var(--on-hi);
  --btn-border: #ededed;
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  --btn-bg: var(--hi-strong);
  border-color: var(--hi-strong);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08), 0 0 24px -4px rgba(255, 255, 255, 0.35);
}

.btn-primary .icon,
.btn-primary .spinner {
  color: var(--on-hi);
}

.btn-outline {
  --btn-bg: var(--shade-0a);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  --btn-bg: var(--surface-hover);
  box-shadow: none;
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--muted);
  --btn-border: transparent;
}

.btn-ghost:hover:not(:disabled) {
  --btn-bg: var(--surface-hover);
  --btn-fg: var(--text);
}

.btn-danger {
  --btn-bg: var(--shade-0a);
  --btn-fg: var(--danger-strong);
  --btn-border: rgba(var(--red-rgb), 0.4);
  box-shadow: none;
}

.btn-danger:hover:not(:disabled) {
  --btn-bg: rgba(var(--red-rgb), 0.08);
  border-color: rgba(var(--red-rgb), 0.7);
}

.icon-btn {
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--hi-strong);
  box-shadow: none;
}

/* ---------- Inputs ---------- */
.input,
.nav-search,
.dir-search,
.people-search-box,
.chat-composer,
.add-friend-row {
  background: var(--shade-0a);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.nav-search {
  height: 36px;
}

.input::placeholder,
.nav-search input::placeholder {
  color: var(--subtle);
}

.input:hover,
.nav-search:hover {
  border-color: var(--border-hover);
}

.input:focus,
.input:focus-visible,
.nav-search:focus-within,
.people-search-box:focus-within,
.chat-composer:focus-within,
.dir-search:focus-within {
  border-color: var(--muted-border);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  outline: none;
}

kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 1px;
  border-radius: 4px;
  background: var(--well);
  color: var(--muted);
  font-family: var(--mono);
  box-shadow: none;
}

:focus-visible {
  outline-color: #fff;
}

/* ---------- Header / nav ---------- */
.brand-name {
  color: var(--hi-strong);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.brand-name span {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--subtle);
}

.logo-mark {
  filter: grayscale(1) brightness(1.6) contrast(1.2);
}

.nav-link {
  color: var(--subtle);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--hi-strong);
}

.nav-link-bar {
  height: 1px !important;
  background: var(--hi-strong) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.6) !important;
}

.nav-avatar,
.nav-bell {
  border-radius: 999px;
}

.badge-count,
.nav-dot,
.rail-badge,
.channel-unread,
.friends-tab b,
.icon-count {
  background: var(--hi);
  color: var(--on-hi);
  box-shadow: none;
}

.badge-count {
  border-color: #000;
}

/* System status pill: monochrome with a green dot */
.sys-status {
  height: 28px;
  border-color: var(--border-strong);
  background: var(--shade-0a);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.sys-status b {
  color: var(--text);
}

.sys-dot,
.sys-dot::after {
  background: var(--green);
  border-color: var(--green);
}

/* ---------- Sidebars ---------- */
.side-link,
.side-filter {
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 450;
}

.side-link .icon,
.side-filter .icon,
.side-filter.tag-red .icon,
.side-filter.engine-filter .icon {
  color: var(--subtle);
}

.side-link:hover,
.side-filter:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.side-link.is-active,
.side-filter.is-active,
.channel-link.is-active {
  background: var(--shade-18);
  color: var(--hi-strong);
  box-shadow: none;
}

.side-link.is-active .icon,
.side-filter.is-active .icon {
  color: var(--hi-strong);
}

.side-filter b,
.side-count {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--subtle);
  font-family: var(--mono);
  font-weight: 500;
}

.side-filter.is-active b {
  background: var(--hi);
  border-color: var(--hi);
  color: var(--on-hi);
}

.side-title {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.side-title .icon {
  color: var(--subtle);
}

.side-user {
  background: var(--surface);
}

.xp-bar {
  background: var(--shade-18);
}

.xp-bar span,
.progress-mini span {
  background: var(--hi);
  box-shadow: none;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse 60% 70% at 50% -20%, rgba(255, 255, 255, 0.08), transparent 70%),
    #000;
  border-color: var(--border);
}

.hero-glow,
.entity-hero-glow {
  display: none;
}

.hero h1 {
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--hi-strong);
}

.hero p,
.view-header p {
  color: var(--muted);
}

.hero-eyebrow {
  border: 1px solid var(--border-strong);
  background: var(--shade-0a);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: none;
}

.hero-eyebrow .icon {
  color: var(--hi-strong);
}

.hero-stats b {
  font-family: var(--mono);
  color: var(--hi-strong);
}

.view-header-icon,
.chat-welcome-icon,
.pl-sent-icon,
.side-cta-icon {
  background: var(--shade-0a);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: none;
  color: var(--hi-strong);
}

.view-header-icon .icon,
.chat-welcome-icon .icon,
.pl-sent-icon .icon,
.side-cta-icon .icon {
  color: var(--hi-strong);
}

/* ---------- Terminal prompt (feed composer) ---------- */
.prompt-terminal {
  position: relative;
  padding: 10px;
  background: var(--shade-0a);
  border-color: var(--border);
  transition: border-color var(--fast), box-shadow var(--fast);
}

.prompt-terminal:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px -24px rgba(255, 255, 255, 0.18);
}

.prompt-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 6px 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--shade-000);
  transition: border-color var(--fast);
}

.prompt-terminal:focus-within .prompt-bar {
  border-color: #52525b;
}

.prompt-caret {
  color: var(--green);
  font-family: var(--mono);
  font-weight: 600;
}

.prompt-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--hi-strong);
  font-family: var(--mono);
  font-size: 13.5px;
  outline: none;
  caret-color: #fff;
}

.prompt-input::placeholder {
  color: var(--subtle);
}

.prompt-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--subtle);
  font-size: 12px;
  white-space: nowrap;
}

.prompt-submit {
  display: grid;
  place-items: center;
  height: 30px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
}

.prompt-submit:hover kbd {
  border-color: var(--muted-border);
  color: var(--hi-strong);
}

.prompt-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 64px;
  z-index: 20;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--shade-0a);
  box-shadow: var(--shadow-pop);
  animation: menu-in 140ms var(--ease);
}

.prompt-menu[hidden] {
  display: none;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.prompt-option {
  display: grid;
  grid-template-columns: 18px 110px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.prompt-option .icon {
  width: 16px;
  height: 16px;
}

.prompt-option-cmd {
  color: var(--hi-strong);
  font-family: var(--mono);
  font-size: 12.5px;
}

.prompt-option small {
  color: var(--subtle);
  font-size: 12px;
}

.prompt-option:hover,
.prompt-option.is-active {
  background: var(--shade-18);
  color: var(--hi-strong);
}

.composer-prompt .composer-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}

.quick-btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
}

.quick-btn .icon {
  color: var(--subtle) !important;
}

.quick-btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  color: var(--hi-strong);
}

/* ---------- Toolbar: underline tabs + segmented control ---------- */
.feed-toolbar {
  padding: 0;
  background: transparent;
  border: 0;
}

.feed-toolbar .toolbar-row {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.sort-tabs {
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.sort-tab {
  position: relative;
  height: 40px;
  padding: 0 12px;
  border-radius: 0;
  background: transparent !important;
  color: var(--subtle);
  font-weight: 450;
  box-shadow: none !important;
}

.sort-tab:hover {
  color: var(--text);
}

.sort-tab.is-active {
  color: var(--hi-strong);
  border: 0;
}

.sort-tab.is-active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  background: var(--hi-strong);
}

.filter-toggle {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--shade-0a);
  color: var(--muted);
  box-shadow: none !important;
}

.filter-toggle b {
  background: var(--hi);
  color: var(--on-hi);
}

.kind-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin-top: 12px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--shade-0a);
}

.filter-pill {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--subtle);
  font-weight: 450;
  box-shadow: none !important;
}

.filter-pill:hover {
  color: var(--text);
  background: transparent;
}

.filter-pill.is-active {
  background: var(--well-2) !important;
  color: var(--hi-strong);
  border: 0;
  box-shadow: inset 0 0 0 1px #2e2e33 !important;
}

.filter-pill span {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 11px;
}

.filter-pill .icon {
  color: currentColor;
}

/* ---------- Chips & badges: monochrome, hairline ---------- */
.tag-chip,
.engine-chip,
.kind-chip,
.role-chip,
.mini-tag,
.skill,
.hash-chip,
.engine-badge,
.stage-chip,
.pill,
.srole,
.squad-role,
.level-chip,
.badge-chip,
.role-badge,
.op-badge {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--shade-0a);
  color: var(--muted);
  font-weight: 500;
  box-shadow: none !important;
  text-shadow: none;
}

.tag-chip .icon,
.engine-chip .icon,
.kind-chip .icon,
.badge-chip .icon,
.role-badge .icon,
.level-chip .icon,
.srole .icon,
.engine-badge .icon {
  color: var(--subtle);
}

.kind-chip {
  height: 24px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11.5px;
}

.hash-chip {
  height: 24px;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 12px;
  transition: border-color var(--fast), color var(--fast);
}

.hash-chip:hover {
  border-color: var(--border-hover);
  color: var(--hi-strong);
}

button.tag-chip:hover,
.engine-chip:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--hi-strong);
  box-shadow: none;
}

.tag-chip.is-active,
.engine-chip.is-active,
.engine-tab.is-active,
.friends-tab.is-active {
  background: var(--hi);
  border-color: var(--hi);
  color: var(--on-hi);
  box-shadow: none;
}

.tag-chip.is-active .icon,
.engine-chip.is-active .icon,
.engine-tab.is-active .icon {
  color: var(--on-hi);
}

.engine-tab {
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.verified-mark .icon {
  color: var(--text);
}

/* Deployment status (● Ready / Scanning / Review / Blocked) */
.deploy-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.deploy-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(var(--lime-rgb), 0.55);
}

.deploy-status.is-building i {
  background: var(--amber);
  box-shadow: none;
  animation: deploy-pulse 1.2s ease-in-out infinite;
}

.deploy-status.is-warning i {
  background: var(--amber);
  box-shadow: none;
}

.deploy-status.is-error i {
  background: var(--red);
  box-shadow: none;
}

@keyframes deploy-pulse {
  50% {
    opacity: 0.35;
  }
}

/* Scan badges: neutral with a semantic dot colour on the icon */
.scan-badge {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--shade-0a);
  color: var(--muted);
}

.scan-safe .icon {
  color: var(--green);
}

.scan-warning .icon,
.scan-pending .icon {
  color: var(--amber);
}

.scan-quarantined .icon {
  color: var(--red);
}

/* ---------- Post cards = deployment cards ---------- */
.post.card {
  padding: 20px;
  background: var(--shade-0a);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.post.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 24px 60px -32px rgba(255, 255, 255, 0.14);
}

.post-title {
  color: var(--hi-strong);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.post-title-link:hover .post-title {
  text-decoration: underline;
  text-decoration-color: #52525b;
  text-underline-offset: 4px;
}

.post-body,
.rich-text {
  color: var(--muted);
}

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

.rich-text code {
  border: 1px solid var(--border-strong);
  background: var(--well);
  color: var(--text);
}

.hashtag {
  color: var(--text);
}

.post-author-name {
  color: var(--text);
  font-weight: 550;
}

.post-meta-line,
.xp-text {
  color: var(--subtle);
}

.post-tags {
  gap: 6px;
}

.post-stats {
  color: var(--subtle);
  font-family: var(--mono);
  font-size: 12px;
  border-color: var(--border);
}

.post-actions {
  border-color: var(--border);
}

.action-btn {
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.action-btn:hover {
  background: var(--surface-hover);
  color: var(--hi-strong);
}

.action-btn.is-active,
.action-save.is-active {
  color: var(--hi-strong);
}

.vote-box {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--shade-000);
}

.vote-btn.is-active,
.vote-btn[aria-pressed='true'] {
  color: var(--hi-strong);
  background: var(--well-2);
}

.vote-score {
  color: var(--hi-strong);
  font-family: var(--mono);
}

/* ---------- Code blocks: terminal style + monochrome syntax ---------- */
.code-block,
.playground,
.pg-console,
.pg-body {
  background: var(--shade-000);
  border-color: var(--border);
  border-radius: var(--radius);
}

.code-head,
.pg-toolbar,
.pg-status,
.pg-console-head {
  background: var(--shade-0a);
  border-color: var(--border);
  color: var(--subtle);
}

.code-dots span,
.code-dots i {
  background: var(--well-3) !important;
  box-shadow: none !important;
}

.code-lang,
.code-head .icon {
  color: var(--muted) !important;
}

.code-tool,
.pg-icon,
.pg-view,
.pg-tab {
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.code-tool {
  border: 1px solid var(--border-strong);
  background: var(--shade-0a);
}

.code-tool:hover,
.pg-view:hover,
.pg-tab:hover {
  border-color: var(--border-hover);
  color: var(--hi-strong);
  background: var(--shade-18);
}

.code-tool.is-copied {
  border-color: rgba(var(--lime-rgb), 0.5);
  color: var(--green);
}

.pg-tab.is-active,
.pg-view.is-active {
  background: var(--well-2);
  color: var(--hi-strong);
  box-shadow: none;
}

.pg-run {
  color: var(--green) !important;
}

.pg-test {
  border-color: var(--border-strong);
  color: var(--text);
}

.code-content,
.pg-highlight,
.pg-input {
  font-family: var(--mono);
}

.line-numbers,
.code-gutter {
  color: var(--gutter-fg);
  border-color: var(--border);
}

.code-content,
.pg-highlight code {
  color: var(--code-fg);
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata,
.tok-comment {
  color: var(--tok-comment);
  font-style: italic;
}

.token.keyword,
.token.boolean,
.token.important,
.token.atrule,
.tok-keyword {
  color: var(--tok-keyword);
  font-weight: 500;
}

.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.url,
.tok-string {
  color: var(--tok-string);
}

.token.function,
.token.class-name,
.token.builtin,
.tok-fn {
  color: var(--tok-fn);
}

.token.number,
.token.constant,
.token.symbol,
.tok-number {
  color: var(--tok-number);
}

.token.tag,
.token.selector,
.token.property,
.token.attr-name {
  color: var(--tok-tag);
}

.token.punctuation,
.token.operator,
.tok-punct,
.tok-op {
  color: var(--tok-punct);
}

/* ---------- Live indicator (feed live strip) ---------- */

.live-now-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  box-shadow: none !important;
}

.live-now-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52525b;
  box-shadow: none;
}

.live-now-indicator.is-on .live-now-dot {
  background: var(--green);
}

.live-now-indicator.is-on .live-now-dot::after,
.activity-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--green);
  animation: sys-ping 2s var(--ease) infinite;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--shade-0a);
  color: var(--text);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  box-shadow: none;
}

.live-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(var(--lime-rgb), 0.8);
}

.avatar.is-live::before {
  inset: -3px;
  border: 1.5px solid var(--green);
  background: none;
  animation: none;
}

.avatar.is-live::after {
  display: none;
}

.live-toggle {
  border: 1px solid var(--border-strong);
  background: var(--shade-0a);
  color: var(--muted);
  box-shadow: none;
  white-space: nowrap;
}

.live-toggle:hover {
  border-color: var(--border-hover);
  color: var(--hi-strong);
  box-shadow: none;
}

.live-toggle .live-dot {
  background: #52525b;
  box-shadow: none;
}

.live-toggle.is-live {
  border-color: rgba(var(--lime-rgb), 0.45);
  background: rgba(var(--lime-rgb), 0.06);
  color: var(--hi-strong);
  box-shadow: none;
}

.live-toggle.is-live .live-dot {
  background: var(--green);
}

.live-strip {
  background: var(--shade-0a);
}

.live-strip-item {
  border-color: var(--border-strong);
  background: var(--shade-000);
}

.activity-feed .side-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.activity-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item {
  position: relative;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.45;
}

.activity-item:first-child {
  border-top: 0;
}

.activity-dot {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: #52525b;
}

.activity-item.is-post .activity-dot {
  background: var(--hi);
}

.activity-item.is-live .activity-dot {
  background: var(--green);
  box-shadow: 0 0 6px rgba(var(--lime-rgb), 0.8);
}

.activity-item a {
  color: var(--subtle);
  text-decoration: none !important;
}

.activity-item a b {
  color: var(--text);
  font-weight: 500;
}

.activity-item a span {
  color: var(--muted);
}

.activity-item a:hover span {
  color: var(--hi-strong);
}

.activity-item time {
  color: #52525b;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}

.hot-list li a {
  border-radius: var(--radius-sm);
}

.hot-rank {
  color: var(--subtle) !important;
  font-family: var(--mono);
  font-weight: 500;
}

.hot-title {
  color: var(--text-dim);
}

.hot-list small,
.leader-info small,
.leader-xp small {
  color: var(--subtle);
}

.leader-rank,
.leader-rank .icon,
.leader-xp {
  color: var(--muted) !important;
  font-family: var(--mono);
}

.pulse-grid span {
  border-color: var(--border);
  background: var(--shade-000);
}

.pulse-grid b,
.text-lime {
  color: var(--hi-strong) !important;
  font-family: var(--mono);
}

/* ---------- Avatars: monochrome gradient discs ---------- */
.avatar,
.hub-avatar {
  background:
    radial-gradient(circle at 30% 20%, hsl(var(--hue) 20% 60% / 0.5), transparent 65%),
    linear-gradient(145deg, hsl(var(--hue) 12% 30%), hsl(var(--hue) 8% 14%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  text-shadow: none;
  font-weight: 600;
}

.status-online,
.presence-online {
  background: var(--green);
  box-shadow: none;
}

.status-live {
  background: var(--green);
  box-shadow: 0 0 6px rgba(var(--lime-rgb), 0.8);
}

.status-dot,
.presence-dot {
  border-color: #000;
}

.hub-avatar.is-speaking {
  box-shadow: 0 0 0 2px #000, 0 0 0 3.5px var(--green), 0 0 14px rgba(var(--lime-rgb), 0.45);
}

/* ---------- Hub, directories, misc ---------- */
.hub {
  border-top-color: var(--border);
}

.hub-rail {
  background: var(--shade-000);
}

.hub-side,
.hub-members {
  background: var(--shade-0a);
}

.hub-main {
  background: var(--shade-000);
}

.rail-server,
.rail-home .rail-icon,
.squad-mark {
  background: var(--well);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  text-shadow: none;
}

.rail-item.is-active .rail-icon,
.rail-home:hover .rail-icon {
  box-shadow: inset 0 0 0 1px #a1a1aa;
}

.rail-item.is-active .rail-pill {
  background: var(--hi-strong);
  box-shadow: none;
}

.rail-action .rail-icon {
  color: var(--muted);
}

.msg.is-mention {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 2px 0 0 #ededed;
}

.mention,
.mention.is-me {
  background: var(--well-2);
  color: var(--hi-strong);
}

.reaction.is-mine {
  border-color: var(--muted-border);
  background: var(--shade-18);
  color: var(--hi-strong);
  box-shadow: none;
}

.chat-send,
.chat-jump,
.friends-tab.add {
  background: var(--hi);
  color: var(--on-hi);
  box-shadow: none;
}

.chat-send:disabled {
  background: var(--shade-18);
  color: var(--subtle);
}

.voice-tile {
  background: var(--shade-0a);
}

.voice-tile.is-speaking {
  border-color: rgba(var(--lime-rgb), 0.6);
  box-shadow: none;
}

.vc-btn.danger {
  background: var(--hi);
  color: var(--on-hi);
  box-shadow: none;
}

.project-banner {
  background:
    radial-gradient(ellipse 70% 120% at 50% -30%, rgba(255, 255, 255, 0.14), transparent 70%),
    #050505;
}

.project-banner-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

.dir-card:hover,
.person-card:hover,
.task:hover {
  transform: none;
  border-color: var(--border-hover);
  box-shadow: 0 24px 60px -32px rgba(255, 255, 255, 0.14);
}

.open-roles-label,
.col-done h3,
.col-doing h3 {
  color: var(--muted);
}

.qr-frame {
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 40px -10px rgba(255, 255, 255, 0.25) !important;
}

.side-invite,
.friend-qr-card,
.invite-banner,
.setup-banner {
  background: var(--shade-0a);
  border-color: var(--border-strong);
  box-shadow: none;
}

.setup-banner code {
  color: var(--hi-strong);
}

.toast {
  background: var(--shade-0a);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
}

.toast-icon {
  background: var(--shade-18);
  color: var(--hi-strong);
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-progress {
  background: var(--well-4);
}

.empty-state,
.empty-state .icon {
  color: var(--muted);
}

.form-error {
  border-color: rgba(var(--red-rgb), 0.35);
  background: rgba(var(--red-rgb), 0.06);
  color: #ff8080;
}

.checkbox input:checked + .checkbox-box,
.switch input:checked + .switch-track {
  background: var(--hi);
  border-color: var(--hi);
  color: var(--on-hi);
}

.auth-tab.is-active {
  color: var(--hi-strong);
}

.social-btn {
  border-color: var(--border-strong);
  background: var(--shade-0a);
}

.social-btn:hover {
  border-color: var(--border-hover);
  background: var(--shade-18);
}

.bottom-nav {
  background: rgba(var(--tint-rgb), 0.85);
  border-top-color: var(--border);
}

.bottom-create {
  background: var(--hi);
  color: var(--on-hi);
  box-shadow: none;
}

.bottom-link.is-active {
  color: var(--hi-strong);
}

/* ---------- System status pill ---------- */
.sys-status {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  white-space: nowrap;
}

.sys-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.sys-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid;
  opacity: 0;
  animation: sys-ping 2.4s var(--ease) infinite;
}

.sys-status.is-degraded .sys-dot,
.sys-status.is-degraded .sys-dot::after {
  background: var(--amber);
  border-color: var(--amber);
}

.sys-status.is-offline .sys-dot,
.sys-status.is-offline .sys-dot::after {
  background: var(--red);
  border-color: var(--red);
}

.sys-sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

/* ---------- Motion ---------- */
@keyframes sys-ping {
  0% {
    opacity: 0.8;
    transform: scale(0.5);
  }

  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

.main-view.is-entering {
  animation: view-in 260ms var(--ease);
}

.count-flash {
  animation: count-flash 700ms var(--ease);
}

@keyframes count-flash {
  0% {
    color: var(--green);
  }
}

@media (max-width: 1640px) {
  .sys-status .sys-prefix,
  .sys-status .sys-total {
    display: none;
  }
}

@media (max-width: 1240px) {
  .sys-status .sys-members,
  .sys-status .sys-sep {
    display: none;
  }
}

@media (max-width: 1100px) {
  .sys-status {
    display: none;
  }
}

@media (max-width: 640px) {
  .prompt-hint {
    display: none;
  }

  .prompt-option {
    grid-template-columns: 18px 96px 1fr;
  }

  .prompt-option small {
    display: none;
  }

  .post.card {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sys-dot::after,
  .live-now-indicator.is-on .live-now-dot::after,
  .activity-pulse::after,
  .deploy-status.is-building i {
    animation: none;
  }
}

/* Strict monochrome: no tinted icons in navigation, badges or quick actions */
.side-filter .icon,
.side-filter[class*='tag-'] .icon,
.badge-icon,
.badge-icon .icon,
.quick-btn[class*='quick-'] .icon,
.post-author-line .icon {
  color: var(--subtle) !important;
}

.verified-mark .icon,
.side-filter.is-active .icon {
  color: var(--text) !important;
}

/* Auth mode tabs (email link / password) */
.auth-mode-tabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--shade-0a);
}

.auth-mode-tab {
  height: 30px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--subtle);
  font-weight: 500;
}

.auth-mode-tab.is-active {
  background: var(--well-2);
  color: var(--hi-strong);
  box-shadow: inset 0 0 0 1px #2e2e33;
}

.auth-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.auth-switch .icon {
  width: 14px;
  height: 14px;
}

.auth-switch:hover {
  color: var(--hi-strong);
}

/* Loading skeleton for the activity stream */
.activity-loading {
  display: grid;
  gap: 10px;
  padding: 6px 0;
}

.activity-loading span {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--well) 0%, var(--well-2) 50%, var(--well) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

.activity-loading span:nth-child(2) {
  width: 80%;
}

.activity-loading span:nth-child(3) {
  width: 60%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.boot-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}
