/* Remora Design System — tokens + components
   Shared by apex landing + plan viewer
*/
:root {
  /* Brand */
  --rm-ink: #0a0a0b;
  --rm-ink-elevated: #121214;
  --rm-ink-soft: #1a1a1e;
  --rm-line: rgba(255, 255, 255, 0.08);
  --rm-line-strong: rgba(255, 255, 255, 0.14);
  --rm-fog: rgba(255, 255, 255, 0.62);
  --rm-mist: rgba(255, 255, 255, 0.82);
  --rm-paper: #f4f2ee;
  --rm-paper-2: #ebe7e0;
  /* High-contrast text on near-black (prefer these over fog for body copy) */
  --rm-text: #ffffff;
  --rm-text-soft: rgba(255, 255, 255, 0.92);
  --rm-text-dim: rgba(255, 255, 255, 0.78);
  --rm-charcoal: #1c1b19;
  --rm-accent: #c8f542;
  --rm-accent-dim: rgba(200, 245, 66, 0.14);
  --rm-accent-2: #7dd3fc;
  --rm-danger: #fb7185;
  --rm-ok: #4ade80;
  --rm-code-bg: #0e0e11;
  --rm-code-fg: #f2f0eb;
  --rm-code-border: rgba(255, 255, 255, 0.12);

  /* Type */
  --rm-font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --rm-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --rm-display: "Fraunces", "Instrument Serif", Georgia, serif;

  --rm-fs-xs: 0.75rem;
  --rm-fs-sm: 0.9375rem;
  --rm-fs-md: 1.0625rem;
  --rm-fs-lg: 1.2rem;
  --rm-fs-xl: 1.4rem;
  --rm-fs-2xl: clamp(1.85rem, 3.2vw, 2.35rem);
  --rm-fs-hero: clamp(3rem, 12vw, 6.5rem);
  --rm-fs-code: 0.9rem;
  --rm-fs-lead: clamp(1.05rem, 1.6vw, 1.2rem);

  --rm-lh: 1.55;
  --rm-tracking: -0.02em;
  --rm-doc-max: 68rem;
  --rm-host-icon: 1.25rem;

  /* Space / radius / shadow */
  --rm-space-1: 0.25rem;
  --rm-space-2: 0.5rem;
  --rm-space-3: 0.75rem;
  --rm-space-4: 1rem;
  --rm-space-5: 1.5rem;
  --rm-space-6: 2rem;
  --rm-space-8: 3rem;
  --rm-radius: 12px;
  --rm-radius-sm: 8px;
  --rm-radius-pill: 999px;
  --rm-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --rm-sidebar: 300px;
  --rm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  font-family: var(--rm-font);
  font-size: var(--rm-fs-md);
  line-height: var(--rm-lh);
  color: var(--rm-paper);
  background: var(--rm-ink);
}

a { color: inherit; }

/* ——— Surfaces ——— */
.rm-surface {
  background: linear-gradient(180deg, var(--rm-ink-elevated), var(--rm-ink));
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius);
}

.rm-grain::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 50;
}

/* ——— Type ——— */
.rm-eyebrow {
  font-family: var(--rm-mono);
  font-size: var(--rm-fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rm-fog);
}

.rm-title {
  font-family: var(--rm-display);
  font-weight: 500;
  letter-spacing: var(--rm-tracking);
  line-height: 1.15;
}

.rm-muted { color: var(--rm-fog); }
.rm-mono { font-family: var(--rm-mono); font-size: 0.85em; }

/* ——— Buttons ——— */
.rm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: inherit;
  font-size: var(--rm-fs-sm);
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border-radius: var(--rm-radius-pill);
  border: 1px solid var(--rm-line-strong);
  background: transparent;
  color: var(--rm-paper);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s var(--rm-ease), border-color 0.2s var(--rm-ease), transform 0.2s var(--rm-ease);
}
.rm-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}
.rm-btn:active { transform: translateY(1px); }
.rm-btn-primary {
  background: var(--rm-accent);
  color: #0a0a0b;
  border-color: transparent;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 6px 20px rgba(200, 245, 66, 0.16);
}
.rm-btn-primary:hover {
  background: #d6ff5c;
  border-color: transparent;
  color: #0a0a0b;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28) inset,
    0 10px 28px rgba(200, 245, 66, 0.28);
  transform: translateY(-1px);
}
.rm-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12) inset;
  background: #c2ef3a;
}
.rm-btn-ghost {
  border-color: transparent;
  color: var(--rm-mist);
}
.rm-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

/* ——— Chips / badges ——— */
.rm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--rm-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.28rem 0.55rem;
  border-radius: var(--rm-radius-pill);
  border: 1px solid var(--rm-line);
  color: var(--rm-mist);
  background: rgba(255, 255, 255, 0.03);
}
.rm-chip-accent {
  border-color: rgba(200, 245, 66, 0.35);
  background: var(--rm-accent-dim);
  color: var(--rm-accent);
}

/* ——— Shell: plan app ——— */
.rm-app {
  height: 100vh;
  display: grid;
  grid-template-columns: var(--rm-sidebar) 1fr;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(200, 245, 66, 0.06), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(125, 211, 252, 0.05), transparent 50%),
    var(--rm-ink);
}

.rm-sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--rm-line);
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(16px);
}

.rm-sidebar-head {
  padding: var(--rm-space-4) var(--rm-space-4) var(--rm-space-3);
  border-bottom: 1px solid var(--rm-line);
  flex-shrink: 0;
}

.rm-sidebar-head h1 {
  font-family: var(--rm-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0.35rem 0 0.45rem;
  letter-spacing: var(--rm-tracking);
}

.rm-sidebar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--rm-space-3);
}

.rm-sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--rm-space-3) var(--rm-space-3) var(--rm-space-6);
}

.rm-sidebar-scroll::-webkit-scrollbar { width: 8px; }
.rm-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

/* Tree */
.rm-tree details { margin: 0.05rem 0; }
.rm-tree summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rm-mist);
  padding: 0.32rem 0.35rem;
  border-radius: var(--rm-radius-sm);
}
.rm-tree summary::-webkit-details-marker { display: none; }
.rm-tree summary::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.45rem;
  border-right: 1.5px solid var(--rm-fog);
  border-bottom: 1.5px solid var(--rm-fog);
  transform: rotate(-45deg) translateY(-1px);
  transition: transform 0.15s var(--rm-ease);
  opacity: 0.7;
}
.rm-tree details[open] > summary::before {
  transform: rotate(45deg) translateY(-2px);
}
.rm-tree summary:hover { background: rgba(255, 255, 255, 0.04); }
.rm-tree .rm-dir-body {
  padding-left: 0.7rem;
  margin-left: 0.35rem;
  border-left: 1px solid var(--rm-line);
}
.rm-tree .rm-file {
  display: block;
  font-size: 0.78rem;
  color: var(--rm-fog);
  text-decoration: none;
  padding: 0.28rem 0.4rem;
  border-radius: var(--rm-radius-sm);
  word-break: break-word;
  transition: background 0.15s var(--rm-ease), color 0.15s var(--rm-ease);
}
.rm-tree .rm-file:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--rm-paper);
}
.rm-tree .rm-file.is-active {
  background: var(--rm-accent-dim);
  color: var(--rm-accent);
}
.rm-tree .rm-file.is-md::before {
  content: "MD";
  font-family: var(--rm-mono);
  font-size: 0.6rem;
  margin-right: 0.4rem;
  opacity: 0.55;
  letter-spacing: 0.06em;
}

/* Main */
.rm-main {
  height: 100vh;
  overflow: auto;
  min-width: 0;
  padding: var(--rm-space-5) clamp(1.25rem, 4vw, 3rem) var(--rm-space-8);
}

.rm-filebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rm-space-3);
  flex-wrap: wrap;
  margin-bottom: var(--rm-space-4);
  padding-bottom: var(--rm-space-3);
  border-bottom: 1px solid var(--rm-line);
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(10, 10, 11, 0.95), rgba(10, 10, 11, 0.85));
  backdrop-filter: blur(10px);
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.rm-path {
  font-family: var(--rm-mono);
  font-size: var(--rm-fs-xs);
  color: var(--rm-fog);
  word-break: break-all;
}

.rm-err {
  color: var(--rm-danger);
  font-size: var(--rm-fs-sm);
  margin: 0 0 var(--rm-space-3);
}

/* Markdown prose */
.rm-prose {
  max-width: 46rem;
  color: rgba(244, 242, 238, 0.92);
}
.rm-prose > :first-child { margin-top: 0; }
.rm-prose h1,
.rm-prose h2,
.rm-prose h3,
.rm-prose h4 {
  font-family: var(--rm-display);
  font-weight: 500;
  letter-spacing: var(--rm-tracking);
  line-height: 1.2;
  color: #fff;
  margin: 1.6em 0 0.55em;
}
.rm-prose h1 { font-size: var(--rm-fs-2xl); }
.rm-prose h2 {
  font-size: 1.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rm-line);
}
.rm-prose h3 { font-size: 1.1rem; }
.rm-prose p,
.rm-prose li { color: var(--rm-mist); }
.rm-prose a { color: var(--rm-accent-2); text-decoration: underline; text-underline-offset: 3px; }
.rm-prose code {
  font-family: var(--rm-mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12em 0.35em;
  border-radius: 5px;
}
.rm-prose pre {
  background: #0e0e11;
  border: 1px solid var(--rm-line);
  border-radius: var(--rm-radius);
  padding: 1rem 1.1rem;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.rm-prose pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: #e8e6e1;
}
.rm-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--rm-fs-sm);
  margin: 1.1em 0;
  overflow: hidden;
  border-radius: var(--rm-radius-sm);
  border: 1px solid var(--rm-line);
}
.rm-prose th,
.rm-prose td {
  border-bottom: 1px solid var(--rm-line);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.rm-prose th {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-weight: 600;
}
.rm-prose tr:last-child td { border-bottom: 0; }
.rm-prose blockquote {
  margin: 1em 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--rm-accent);
  color: var(--rm-fog);
}
.rm-prose hr {
  border: 0;
  border-top: 1px solid var(--rm-line);
  margin: 2rem 0;
}

/* Catalog page */
.rm-catalog {
  min-height: 100vh;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.25rem, 4vw, 3rem);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(200, 245, 66, 0.08), transparent 55%),
    radial-gradient(700px 400px at 90% 20%, rgba(125, 211, 252, 0.06), transparent 50%),
    var(--rm-ink);
}
.rm-catalog-inner { max-width: 720px; margin: 0 auto; }
.rm-card-list { list-style: none; padding: 0; margin: var(--rm-space-6) 0 0; display: grid; gap: var(--rm-space-3); }
.rm-card {
  display: block;
  padding: var(--rm-space-5);
  border-radius: calc(var(--rm-radius) + 2px);
  border: 1px solid var(--rm-line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  text-decoration: none;
  transition: border-color 0.2s var(--rm-ease), transform 0.2s var(--rm-ease), background 0.2s var(--rm-ease);
}
.rm-card:hover {
  border-color: rgba(200, 245, 66, 0.35);
  background: linear-gradient(145deg, rgba(200, 245, 66, 0.06), rgba(255, 255, 255, 0.02));
  transform: translateY(-2px);
}
.rm-card h2 {
  font-family: var(--rm-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.4rem;
}
.rm-card-meta {
  font-family: var(--rm-mono);
  font-size: var(--rm-fs-xs);
  color: var(--rm-fog);
  margin-bottom: var(--rm-space-3);
}
.rm-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Apex hero */
.rm-apex {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: var(--rm-ink);
  color: var(--rm-paper);
}
.rm-apex-orb {
  position: absolute;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(200, 245, 66, 0.22), transparent 58%);
  filter: blur(8px);
  animation: rm-float 12s var(--rm-ease) infinite alternate;
}
.rm-apex-orb-2 {
  position: absolute;
  width: min(50vw, 380px);
  height: min(50vw, 380px);
  right: 8%;
  bottom: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(125, 211, 252, 0.12), transparent 60%);
  filter: blur(12px);
  animation: rm-float 16s var(--rm-ease) infinite alternate-reverse;
}
@keyframes rm-float {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.05); }
}
.rm-apex-mark {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: var(--rm-space-6);
}
.rm-apex-mark h1 {
  font-family: var(--rm-display);
  font-weight: 450;
  font-size: var(--rm-fs-hero);
  letter-spacing: 0.14em;
  text-transform: lowercase;
  margin: 0;
  background: linear-gradient(180deg, #fff 20%, rgba(244, 242, 238, 0.72));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.rm-apex-sub {
  margin-top: var(--rm-space-4);
  font-family: var(--rm-mono);
  font-size: var(--rm-fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rm-fog);
}
.rm-apex-links {
  position: fixed;
  bottom: var(--rm-space-5);
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0 var(--rm-space-4);
}

@media (max-width: 860px) {
  .rm-app {
    grid-template-columns: 1fr;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
  }
  .rm-sidebar {
    height: min(42dvh, 340px);
    max-height: 42dvh;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid var(--rm-line);
  }
  .rm-sidebar-head {
    padding: 0.75rem 0.85rem 0.55rem;
  }
  .rm-sidebar-head h1 {
    font-size: 1rem;
  }
  .rm-sidebar-actions {
    gap: 0.35rem;
  }
  .rm-sidebar-actions .rm-btn {
    font-size: 0.75rem;
    padding: 0.45rem 0.7rem;
  }
  .rm-main {
    height: auto;
    min-height: 0;
    flex: 1;
    overflow: auto;
    padding: 1rem 1rem 2.5rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  .rm-filebar {
    position: sticky;
    top: 0;
    gap: 0.5rem;
  }
  .rm-prose {
    max-width: 100%;
    font-size: 0.95rem;
  }
  .rm-prose pre {
    font-size: 0.72rem;
    padding: 0.75rem;
  }
  .rm-prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .rm-catalog {
    padding: 1.5rem 1rem 2.5rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }
  .rm-card {
    padding: 1.1rem 1rem;
  }
  .rm-card-actions {
    flex-direction: column;
  }
  .rm-card-actions .rm-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .rm-chip {
    font-size: 0.62rem;
  }
  .rm-title {
    font-size: 1.45rem !important;
  }
}

/* ========== Docs / install / MCPs (dense, high-contrast) ========== */
.rm-doc {
  color: var(--rm-text);
  background:
    radial-gradient(900px 480px at 12% 0%, rgba(200, 245, 66, 0.07), transparent 55%),
    radial-gradient(700px 380px at 92% 10%, rgba(125, 211, 252, 0.05), transparent 50%),
    var(--rm-ink);
}
.rm-doc .rm-muted { color: var(--rm-text-soft); font-size: var(--rm-fs-lead); }
.rm-doc .rm-eyebrow { color: var(--rm-text-dim); font-size: 0.8rem; }
.rm-doc strong { color: var(--rm-text); font-weight: 600; }
.rm-doc code {
  font-family: var(--rm-mono);
  font-size: 0.92em;
  color: var(--rm-accent);
  background: rgba(200, 245, 66, 0.08);
  padding: 0.08em 0.35em;
  border-radius: 5px;
}

.rm-doc-dense {
  /* Content-sized (no empty stretched voids). Still fills viewport when short. */
  min-height: 100dvh;
  max-height: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: var(--rm-space-3);
  max-width: min(var(--rm-doc-max), 56rem);
  margin: 0 auto;
  padding: clamp(1rem, 2.4vw, 1.6rem) clamp(1rem, 2.5vw, 1.75rem)
    max(1rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.rm-doc-head { flex-shrink: 0; min-width: 0; }
.rm-doc-head h1 {
  font-family: var(--rm-display);
  font-weight: 500;
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  letter-spacing: var(--rm-tracking);
  margin: 0.2rem 0 0.35rem;
  color: var(--rm-text);
  line-height: 1.15;
}
.rm-doc-lead {
  margin: 0;
  max-width: 48rem;
  font-size: var(--rm-fs-lead);
  line-height: 1.45;
  color: var(--rm-text-soft);
}

.rm-doc-main {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: var(--rm-space-3);
  align-items: start; /* auto-height panels — no stretched dead space */
}

.rm-panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rm-line-strong);
  border-radius: calc(var(--rm-radius) + 2px);
  background: rgba(255, 255, 255, 0.03);
  overflow: visible;
  height: auto;
  min-height: 0;
}
.rm-panel-title {
  font-family: var(--rm-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rm-text-dim);
  margin: 0;
}

/* Command / code blocks — height = content (not flex-fill) */
.rm-code {
  font-family: var(--rm-mono);
  font-size: var(--rm-fs-code);
  background: var(--rm-code-bg);
  border: 1px solid var(--rm-code-border);
  border-radius: var(--rm-radius-sm);
  padding: 0.75rem 0.9rem;
  overflow: auto;
  color: var(--rm-code-fg);
  margin: 0;
  line-height: 1.5;
  flex: 0 0 auto;
  height: auto;
  max-height: min(38vh, 16rem);
  white-space: pre;
}
.rm-code-sm {
  font-size: 0.88rem;
  padding: 0.65rem 0.8rem;
  max-height: min(28vh, 12rem);
}

/* Step chips (compact) */
.rm-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rm-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: var(--rm-radius-pill);
  border: 1px solid var(--rm-line-strong);
  background: transparent;
  color: var(--rm-text-soft);
  font-size: var(--rm-fs-sm);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.rm-step-chip[aria-selected="true"] {
  background: var(--rm-accent-dim);
  border-color: rgba(200, 245, 66, 0.45);
  color: var(--rm-text);
}
.rm-step-chip .rm-step-n {
  font-family: var(--rm-mono);
  font-size: 0.75rem;
  color: var(--rm-accent);
}

/* Host adapters: Claude / Grok — equal, logo-only icon + white label */
.rm-host-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}
.rm-host-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: inherit;
  font-size: var(--rm-fs-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--rm-text);
  background: transparent;
  border: 1px solid var(--rm-line-strong);
  border-radius: var(--rm-radius-pill);
  padding: 0.55rem 1rem 0.55rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s var(--rm-ease), background 0.15s var(--rm-ease), box-shadow 0.15s var(--rm-ease);
}
.rm-host-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.28);
}
.rm-host-tab[aria-selected="true"] {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.rm-host-tab svg {
  width: var(--rm-host-icon);
  height: var(--rm-host-icon);
  flex-shrink: 0;
  display: block;
  color: var(--rm-text); /* isotipo white on dark */
  fill: currentColor;
}
.rm-host-tab svg[data-stroke="1"] {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.rm-host-pane {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 0 0 auto;
  min-height: 0;
}
.rm-host-pane[hidden] { display: none !important; }
.rm-host-hint {
  margin: 0;
  font-size: var(--rm-fs-sm);
  color: var(--rm-text-soft);
  line-height: 1.4;
}

/* Compact pack cards (MCPs) */
.rm-pack-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  min-height: 0;
  overflow: auto;
}
.rm-pack {
  padding: 0.75rem 0.85rem;
  border-radius: var(--rm-radius);
  border: 1px solid var(--rm-line);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}
.rm-pack h2 {
  font-family: var(--rm-font);
  font-size: var(--rm-fs-md);
  font-weight: 600;
  margin: 0 0 0.2rem;
  color: var(--rm-text);
}
.rm-pack .rm-card-meta {
  color: var(--rm-text-dim);
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
}
.rm-pack p {
  margin: 0 0 0.45rem;
  font-size: var(--rm-fs-sm);
  color: var(--rm-text-soft);
  line-height: 1.4;
}
.rm-pack code {
  font-size: 0.78rem;
  color: var(--rm-code-fg);
  background: var(--rm-code-bg);
  border: 1px solid var(--rm-code-border);
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.rm-doc-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  flex: 0 0 auto;
  padding-top: 0.35rem;
}
.rm-doc-foot .rm-btn {
  font-size: var(--rm-fs-sm);
  color: var(--rm-text);
  min-height: 2.55rem;
  padding: 0.6rem 1.15rem;
}
.rm-doc-foot .rm-btn-primary {
  color: #0a0a0b;
  min-width: 9.5rem;
  justify-content: center;
}
.rm-doc-foot .rm-btn-ghost { color: var(--rm-text-soft); }
.rm-sep-line {
  margin: 0;
  font-size: var(--rm-fs-sm);
  color: var(--rm-text-soft);
  line-height: 1.4;
}
.rm-sep-line code { font-size: 0.88em; }

.rm-warn {
  font-size: var(--rm-fs-sm);
  color: var(--rm-text-soft);
  border-left: 3px solid var(--rm-accent);
  padding: 0.15rem 0 0.15rem 0.7rem;
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 860px) {
  .rm-doc-dense {
    justify-content: flex-start;
    min-height: 100dvh;
  }
  .rm-doc-main {
    grid-template-columns: 1fr;
  }
  .rm-pack-grid {
    grid-template-columns: 1fr;
  }
  .rm-code,
  .rm-code-sm {
    max-height: none;
  }
}
@media (max-width: 480px) {
  .rm-host-tab { font-size: var(--rm-fs-sm); padding: 0.5rem 0.8rem 0.5rem 0.65rem; }
  .rm-doc-head h1 { font-size: 1.5rem; }
}
