:root {
  color-scheme: dark;

  /* Dark, warm-neutral surfaces with a faint green undertone */
  --bg: #0a0c0b;
  --bg-soft: #0e1110;
  --surface: #131715;
  --surface-2: #1a201d;
  --border: #262d29;
  --border-soft: #1d2421;

  --text: #e9ece8;
  --text-dim: #c2c8c2;
  --muted: #899189;

  /* Refined emerald accent that reads premium on near-black */
  --accent: #4fd1a5;
  --accent-strong: #6fe7c4;
  --accent-ink: #04140e;
  --glow: rgba(79, 209, 165, 0.16);

  --error: #f08585;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);

  --font: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient gradient glow behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 78% -8%, var(--glow), transparent 60%),
    radial-gradient(48rem 36rem at -8% 6%, rgba(79, 209, 165, 0.07), transparent 55%);
  pointer-events: none;
}

.page {
  max-width: 940px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
}

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

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

/* ── Header ───────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2.75rem;
}

.brand h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.18);
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 1rem 0 2.5rem;
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(2.3rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.accent-text {
  color: var(--accent);
  font-style: italic;
}

.hero-sub {
  margin: 1.25rem 0 0;
  max-width: 56ch;
  font-size: 1.08rem;
  color: var(--text-dim);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.85rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin: 2.25rem 0 0;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--border-soft);
  list-style: none;
  font-size: 0.9rem;
  color: var(--muted);
}

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

/* ── Feature cards ────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2.75rem;
}

.feature-card {
  padding: 1.4rem;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(79, 209, 165, 0.4);
  transform: translateY(-2px);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(79, 209, 165, 0.12);
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.feature-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font);
  font-size: 1.08rem;
  font-weight: 600;
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Panels ───────────────────────────────────────────── */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}

.panel-kicker {
  display: inline-block;
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ── Forms ────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 0.5rem;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form-stack label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input::placeholder {
  color: #5f665f;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 209, 165, 0.16);
}

.form-row input {
  flex: 1;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  padding: 0.58rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-lg {
  padding: 0.78rem 1.4rem;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 0.32rem 0.66rem;
  font-size: 0.78rem;
}

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

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

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--muted);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Feedback ─────────────────────────────────────────── */
.error {
  margin: 0.75rem 0 0;
  color: var(--error);
  font-size: 0.875rem;
}

.status {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.hidden {
  display: none !important;
}

/* ── Request access ───────────────────────────────────── */
.interest-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.interest-form label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  font-size: 0.82rem;
  color: var(--muted);
}

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

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Key minting ──────────────────────────────────────── */
.key-mint {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-soft);
}

.key-mint summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--muted);
  user-select: none;
}

.key-mint summary:hover {
  color: var(--text);
}

.key-mint[open] summary {
  margin-bottom: 0.25rem;
  color: var(--text);
}

.mint-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mint-warning {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--error);
}

.mint-result code {
  display: block;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-strong);
  word-break: break-all;
}

.mint-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Catalogue ────────────────────────────────────────── */
.catalogue-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.catalogue-head h2 {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
}

.catalogue-count {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.catalogue-toolbar {
  margin-bottom: 0.85rem;
}

.search-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-input-wrap {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--muted);
  pointer-events: none;
}

.search-row input[type="search"] {
  width: 100%;
  padding-left: 2.3rem;
}

.filter-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.filter-trigger-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-trigger-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(79, 209, 165, 0.08);
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}

.filter-count-badge.hidden {
  display: none;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.5rem 2.1rem 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%23a4b3ab' d='M3 4.5l3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 10px;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.sort-select:hover {
  border-color: var(--accent);
  color: var(--text);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent);
}

.filters-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.filters-panel.hidden {
  display: none;
}

.filters-body {
  /* no separate header anymore — body is the whole panel */
}

.filter-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-soft);
}

.filter-dates label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 130px;
}

.filter-dates input[type="date"] {
  color-scheme: dark;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}

.filter-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem 0.7rem;
}

.filter-group-label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.filter-dropdown-trigger::after {
  content: "▾";
  font-size: 0.65rem;
  opacity: 0.7;
  flex-shrink: 0;
}

.filter-dropdown-trigger:hover,
.filter-dropdown.open .filter-dropdown-trigger {
  border-color: var(--accent);
  color: var(--text);
}

.filter-dropdown-trigger.has-selection {
  color: var(--accent-strong);
  border-color: rgba(79, 209, 165, 0.45);
}

.filter-dropdown-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  min-width: 240px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.filter-dropdown-menu.hidden {
  display: none;
}

.filter-dropdown-search {
  width: 100%;
  margin-bottom: 0.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

.filter-dropdown-search:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.filter-dropdown-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.45rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.filter-dropdown-option::before {
  content: "";
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  flex-shrink: 0;
}

.filter-dropdown-option.selected {
  color: var(--accent-strong);
  background: rgba(79, 209, 165, 0.08);
}

.filter-dropdown-option.selected::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  border-color: var(--accent);
  background: rgba(79, 209, 165, 0.2);
  color: var(--accent-strong);
}

.filter-dropdown-option:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.filter-dropdown-divider {
  margin: 0.35rem 0.45rem;
  border: none;
  border-top: 1px solid var(--border-soft);
  list-style: none;
}

.filter-dropdown-hint {
  margin: 0.35rem 0 0;
  padding: 0 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.filter-dropdown-hint.hidden {
  display: none;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: rgba(79, 209, 165, 0.05);
  border: 1px dashed rgba(79, 209, 165, 0.3);
}

.active-filters.hidden {
  display: none;
}

.active-filters-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.active-filters-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
}

.active-filters #filters-clear {
  margin-left: auto;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.35rem 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(79, 209, 165, 0.14);
  border: 1px solid rgba(79, 209, 165, 0.4);
  color: var(--accent-strong);
  font-size: 0.75rem;
}

.active-filter-pill-label {
  line-height: 1.2;
}

.active-filter-pill-remove {
  border: none;
  background: rgba(79, 209, 165, 0.18);
  color: inherit;
  cursor: pointer;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  font-size: 0.85rem;
  line-height: 1.1;
}

.active-filter-pill-remove:hover {
  background: rgba(255, 120, 120, 0.22);
  color: #ffb4b4;
}

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

.result-card {
  position: relative;
  padding: 1.1rem 1.15rem 1.1rem 1.25rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.result-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14%;
  bottom: 14%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  transition: background 0.15s;
}

.result-card:hover {
  background: var(--bg-soft);
  border-color: var(--border);
  transform: translateY(-1px);
}

.result-card:hover::before {
  background: var(--accent);
}

.result-title {
  margin: 0 0 0.35rem;
  font-family: var(--font);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.15s;
}

.result-card:hover .result-title {
  color: var(--accent);
}

.result-meta {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.result-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.65rem;
}

.tag {
  padding: 0.14rem 0.55rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text-dim);
  transition: color 0.15s, border-color 0.15s;
}

.result-card:hover .tag {
  border-color: rgba(79, 209, 165, 0.35);
  color: var(--accent-strong);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ── Footer ───────────────────────────────────────────── */
.footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  margin-bottom: 0.7rem;
}

.footer-links a {
  color: var(--text-dim);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Public trust pages ───────────────────────────────── */
.legal-page .page {
  max-width: 860px;
}

.top-link {
  display: inline-flex;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.legal-hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-soft);
}

.legal-hero h2 {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
}

.legal-hero p {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: var(--text-dim);
  font-size: 1rem;
}

.legal-content {
  max-width: 740px;
}

.legal-section {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.legal-section:last-child {
  border-bottom: none;
}

.legal-section h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 600;
}

.legal-section p,
.legal-section li {
  color: var(--text-dim);
}

.legal-section p {
  margin: 0.55rem 0;
}

.legal-section ul,
.legal-section ol {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}

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

.trust-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.trust-item h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.trust-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── MCP panel ────────────────────────────────────────── */
.mcp-subheading {
  margin: 1.4rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.mcp-details {
  margin: 0;
}

.mcp-row {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.mcp-row:last-child {
  border-bottom: none;
}

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

.mcp-row dd {
  margin: 0;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.mcp-row dd code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent-strong);
  word-break: break-all;
}

.code-block {
  margin: 0.5rem 0;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Detail dialog ────────────────────────────────────── */
.detail-dialog {
  width: min(720px, 92vw);
  max-height: 85vh;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.detail-dialog::backdrop {
  background: rgba(4, 6, 5, 0.7);
  backdrop-filter: blur(3px);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.4rem 1.4rem 0;
}

.detail-header h2 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.3rem;
}

.detail-meta {
  padding: 0.5rem 1.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.detail-summary {
  padding: 0 1.4rem;
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.detail-text {
  margin: 0;
  padding: 1rem 1.4rem;
  max-height: 45vh;
  overflow: auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-source {
  display: inline-block;
  padding: 0.85rem 1.4rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── App nav (Explore | Catalogue) ────────────────────── */
.app-nav {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.app-nav-tab {
  padding: 0.42rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

.app-nav-tab[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* ── Explore: header + stats ──────────────────────────── */
.explore-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.explore-head h2 {
  margin: 0;
}

.explore-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin: 0 0 1.4rem;
  padding: 0.95rem 0;
  list-style: none;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.explore-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.explore-stats .stat-value {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

.explore-stats .stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Sources toolbar + segmented control ──────────────── */
.sources-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.segmented {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
}

.seg {
  padding: 0.35rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

.seg.active {
  background: rgba(79, 209, 165, 0.16);
  color: var(--accent-strong);
}

.sources-toolbar .search-input-wrap {
  flex: 1 1 220px;
  max-width: 320px;
}

/* ── Sources grid + cards ─────────────────────────────── */
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}

.source-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.source-card:hover {
  background: var(--bg-soft);
  border-color: rgba(79, 209, 165, 0.4);
  transform: translateY(-2px);
}

.source-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.source-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(79, 209, 165, 0.12);
  color: var(--accent);
}

.source-name {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  transition: color 0.15s;
}

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

.source-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.source-monitored {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-strong);
}

.source-monitored .session-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(79, 209, 165, 0.18); }
  50% { box-shadow: 0 0 0 5px rgba(79, 209, 165, 0.04); }
}

/* ── Activity (being fetched now / recently added) ────── */
.activity-block {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-soft);
}

.activity-heading {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1.2rem 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.activity-heading:first-child {
  margin-top: 0;
}

.activity-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.activity-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.85rem;
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-row .spinner {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.activity-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-dim);
}

.activity-recent-row {
  cursor: pointer;
}

.activity-recent-row:hover .activity-title {
  color: var(--accent);
}

.activity-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.activity-status.done {
  color: var(--accent-strong);
}

.activity-empty {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Catalogue source scope banner ────────────────────── */
.catalogue-scope {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: rgba(79, 209, 165, 0.07);
  border: 1px solid rgba(79, 209, 165, 0.3);
}

.catalogue-scope-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.catalogue-scope-name {
  font-weight: 600;
  color: var(--accent-strong);
}

/* ── Add-source dialog ────────────────────────────────── */
.add-dialog {
  width: min(560px, 92vw);
}

.add-body {
  padding: 0.5rem 1.4rem 1.4rem;
}

.add-url-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.add-url-row input {
  flex: 1;
}

.add-preview {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.add-preview.hidden {
  display: none;
}

.add-preview-type {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(79, 209, 165, 0.14);
  border: 1px solid rgba(79, 209, 165, 0.4);
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.add-preview-recent {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.add-preview-recent li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.add-preview-progress {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 720px) {
  .features {
    grid-template-columns: 1fr;
  }

  .interest-grid {
    grid-template-columns: 1fr;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
  }

  .form-row {
    flex-direction: column;
  }

  .mcp-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
