:root {
  --accent: #F97316;
  --accent-soft: #FDBA74;
  --accent-ink: #9A3412;

  --bg: #FFF8F1;
  --bg-paper: #FFFFFF;
  --bg-sunk: #FBF2E7;
  --ink: #1A1410;
  --ink-2: #3C322A;
  --ink-3: #6B5D52;
  --ink-4: #A4968A;
  --line: #EADFD1;
  --line-2: #F2E8DA;

  --card-shadow: 0 1px 0 rgba(20,14,10,.04), 0 12px 28px -18px rgba(120,60,20,.16);
  --card-shadow-hover: 0 2px 0 rgba(20,14,10,.05), 0 22px 40px -20px rgba(120,60,20,.28);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --font-sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

html[data-theme="dark"] {
  --accent: #FB923C;
  --accent-soft: #9A3412;
  --accent-ink: #FED7AA;

  --bg: #141110;
  --bg-paper: #1C1917;
  --bg-sunk: #0F0D0C;
  --ink: #FAF4EC;
  --ink-2: #E6DDD1;
  --ink-3: #A39485;
  --ink-4: #6B6057;
  --line: #2A2420;
  --line-2: #221D19;

  --card-shadow: 0 1px 0 rgba(0,0,0,.3), 0 16px 32px -20px rgba(0,0,0,.7);
  --card-shadow-hover: 0 2px 0 rgba(0,0,0,.35), 0 28px 50px -20px rgba(0,0,0,.85);
}

/* -- Editorial variant (Tweak) -- */
html[data-aesthetic="editorial"] {
  --accent: #1A1410;
  --accent-soft: #E8E0D4;
  --bg: #FDFBF7;
  --bg-paper: #FFFFFF;
  --radius: 4px;
  --radius-sm: 3px;
  --radius-lg: 6px;
  --font-sans: "Fraunces", "Space Grotesk", serif;
}
html[data-aesthetic="editorial"][data-theme="dark"] {
  --accent: #FAF4EC;
  --accent-soft: #3C322A;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  transition: background-color .3s ease, color .3s ease;
  min-height: 100vh;
}

.mono { font-family: var(--font-mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

a { color: inherit; }

button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* === Topbar === */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  backdrop-filter: blur(14px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand-sub { color: var(--ink-3); font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.iconbtn {
  width: 38px; height: 38px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--bg-paper);
  transition: all .2s ease;
}
.iconbtn:hover { color: var(--accent); border-color: var(--accent-soft); transform: translateY(-1px); }

/* === Logo mark === */
.logo-mark {
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), oklch(from var(--accent) calc(l - 0.1) c h));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--accent) 50%, transparent), inset 0 -2px 0 rgba(0,0,0,.12);
  position: relative;
  overflow: hidden;
}
.logo-inner { display: flex; align-items: center; gap: 2px; font-size: 14px; }
.logo-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #fff;
  display: inline-block;
}

/* === Hero === */
.hero {
  padding: 70px 40px 24px;
  max-width: 1320px;
  margin: 0 auto;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding: 40px 24px 8px; }
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
  font-family: var(--font-mono);
}
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  font-size: clamp(40px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 22px 0 20px;
  font-weight: 700;
}
.hero-title .ink { color: var(--accent); }
.hero-title .underlined {
  position: relative;
  display: inline-block;
}
.hero-title .underlined::after {
  content: "";
  position: absolute; left: -2%; right: -2%; bottom: 6%;
  height: 22%;
  background: var(--accent);
  opacity: .28;
  z-index: -1;
  border-radius: 4px;
  transform: skew(-8deg);
}

html[data-aesthetic="editorial"] .hero-title { font-weight: 500; font-style: italic; }
html[data-aesthetic="editorial"] .hero-title .underlined::after { display: none; }
html[data-aesthetic="editorial"] .hero-title .underlined { border-bottom: 2px solid var(--ink); padding-bottom: 2px; }

.hero-sub {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 0 28px;
}
.hero-sub strong { color: var(--ink); }

.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Hero visual */
.hero-visual {
  position: relative;
  height: 420px;
  perspective: 1400px;
}
.hv-card {
  position: absolute;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow-hover);
  overflow: hidden;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.hv-card-back {
  top: 10px; right: 20px;
  width: 62%;
  transform: rotate(4deg);
}
.hv-card-back:hover { transform: rotate(2deg) translateY(-4px); }

.hv-card-front {
  bottom: 10px; left: 0;
  width: 68%;
  transform: rotate(-3deg);
}
.hv-card-front:hover { transform: rotate(-1deg) translateY(-4px); }

.hv-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-sunk);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.r { background: #FF5F57; }
.dot.y { background: #FEBC2E; }
.dot.g { background: #28C840; }
.hv-title {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.hv-tree, .hv-term {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}
.hv-folder { color: var(--accent); font-weight: 600; }
.hv-term .prompt { color: var(--accent); margin-right: 8px; }
.hv-term .muted { color: var(--ink-4); }
.hv-term .ok { color: #10B981; margin-right: 6px; }
.blinker { color: var(--accent); animation: blink 1.1s infinite step-end; display: inline-block; margin-top: 4px; }
@keyframes blink { 50% { opacity: 0; } }

/* === Copy command === */
.copy-cmd {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 16px 12px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 14px;
  transition: transform .15s ease, box-shadow .2s ease;
  box-shadow: 0 8px 18px -10px rgba(0,0,0,.4);
}
html[data-theme="dark"] .copy-cmd { background: var(--bg-paper); border: 1px solid var(--line); }
.copy-cmd:hover { transform: translateY(-1px); }
.copy-cmd-lg { padding: 16px 22px 16px 20px; font-size: 15px; }
.copy-cmd-dollar { color: var(--accent); font-weight: 700; }
.copy-cmd-text { color: #fff; }
html[data-theme="dark"] .copy-cmd-text { color: var(--ink); }
.copy-cmd-btn {
  margin-left: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  display: inline-flex; align-items: center;
}
html[data-theme="dark"] .copy-cmd-btn { background: var(--line); color: var(--ink-3); }

/* === Buttons === */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s ease;
}
.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); transform: translateY(-1px); }
.btn-ghost-sm { padding: 8px 12px; font-size: 13px; }

/* === Gallery === */
.gallery {
  padding: 48px 40px 80px;
  max-width: 1320px;
  margin: 0 auto;
}
@media (max-width: 960px) { .gallery { padding: 24px; } }

.gallery-toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-bottom: 28px;
}

.searchbar {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px 0 42px;
  min-width: 320px;
  flex: 1;
  max-width: 440px;
  transition: border-color .2s ease;
}
.searchbar:focus-within { border-color: var(--accent); }
.search-icon { position: absolute; left: 16px; color: var(--ink-4); display: flex; }
.searchbar input {
  flex: 1; background: transparent; border: 0; outline: 0;
  padding: 13px 0;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
}
.searchbar input::placeholder { color: var(--ink-4); }
.search-clear {
  font-size: 12px;
  color: var(--ink-3);
  padding: 4px 10px;
  border-radius: 999px;
}
.search-clear:hover { color: var(--ink); background: var(--bg-sunk); }

.specialty-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.spec-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .18s ease;
}
.spec-tab:hover { color: var(--ink); }
.spec-tab.is-active {
  background: var(--ink);
  color: var(--bg-paper);
}
.spec-tab.is-active .spec-count { background: rgba(255,255,255,.16); color: inherit; }
.spec-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg-sunk);
  color: var(--ink-4);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* === Card grid === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 14px;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, border-color .22s;
  box-shadow: var(--card-shadow);
  outline: 0;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px 200px at var(--mx, 50%) 0%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent-soft);
}
.card:hover::before { opacity: 1; }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.card-author { display: flex; align-items: center; gap: 10px; }
.card-author-name {
  font-weight: 600; font-size: 14px; line-height: 1.2;
}
.card-author-handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
}
.card-specialty {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-sunk);
  color: var(--ink-3);
  font-size: 11.5px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  white-space: nowrap;
}

.avatar {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-sans);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.1);
  flex-shrink: 0;
}

.card-title {
  margin: 2px 0 -2px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: pretty;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--accent);
  color: #fff;
}
.badge-muted { background: var(--bg-sunk); color: var(--ink-3); }
html[data-theme="dark"] .badge-muted { background: var(--line); color: var(--ink-2); }

.card-stats {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  margin-top: auto;
}
.stat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--bg-sunk);
  font-size: 12px;
  color: var(--ink-2);
}
html[data-theme="dark"] .stat-pill { background: var(--line-2); }
.stat-icon { color: var(--accent); font-size: 11px; }
.stat-n { font-family: var(--font-mono); font-weight: 600; }
.stat-label { color: var(--ink-3); font-size: 11px; }

.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}
.card-open {
  color: var(--accent);
  font-weight: 500;
  transition: transform .2s ease;
}
.card:hover .card-open { transform: translateX(4px); }

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-3);
}
.empty-emoji {
  font-size: 48px;
  color: var(--ink-4);
  font-family: var(--font-mono);
}
.empty p { margin: 12px 0 20px; font-size: 16px; }

.gallery-footnote {
  margin-top: 60px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--bg-paper);
  border: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
  color: var(--ink-3);
  font-size: 15px;
}

/* === View page === */
.view {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 40px 80px;
}
@media (max-width: 960px) { .view { padding: 20px 24px 60px; } }

.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 14px;
  transition: color .2s ease, background .2s ease;
}
.backlink:hover { color: var(--ink); background: var(--bg-paper); }

.view-hero {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 860px) { .view-hero { grid-template-columns: 1fr; } }

.view-author-row {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.view-author-row > div:nth-child(2) { flex: 1; }
.view-author-name { font-weight: 600; font-size: 15px; }
.view-author-handle { color: var(--ink-3); font-size: 13px; font-family: var(--font-mono); }

.view-title {
  font-size: clamp(34px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
  font-weight: 700;
}
html[data-aesthetic="editorial"] .view-title { font-weight: 500; font-style: italic; }

.view-desc {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 18px;
  max-width: 640px;
  text-wrap: pretty;
}

.view-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }

.view-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.view-mirrors {
  color: var(--ink-3);
  font-size: 13.5px;
  font-family: var(--font-mono);
}

.view-stats-card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  align-self: start;
}
.vsc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.vsc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.vsc-grid > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px;
  background: var(--bg-sunk);
  border-radius: var(--radius-sm);
}
html[data-theme="dark"] .vsc-grid > div { background: var(--line-2); }
.vsc-n {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.vsc-l {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: lowercase;
}

.vsection { margin-top: 44px; }
.vsection-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.vsection-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.vsection-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-4);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-sunk);
}
html[data-theme="dark"] .vsection-count { background: var(--line-2); }

/* === Overview (markdown) === */
.overview {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 780px;
}
.docs-article { max-width: 860px; margin-top: 24px; }
.docs-article .md-h1 { font-size: clamp(28px, 3.5vw, 38px); margin-top: 0; }
.docs-article .md-h2 { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.docs-article .md-h2:first-of-type { border-top: 0; padding-top: 0; }
.docs-article .md-h3 { text-transform: none; letter-spacing: -0.01em; font-size: 15px; color: var(--ink-2); }
.overview > *:first-child { margin-top: 0; }
.overview > *:last-child { margin-bottom: 0; }
.overview .md-h1 { font-size: 26px; letter-spacing: -0.02em; color: var(--ink); margin: 26px 0 12px; font-weight: 700; }
.overview .md-h2 { font-size: 20px; letter-spacing: -0.015em; color: var(--ink); margin: 26px 0 10px; font-weight: 600; }
.overview .md-h3 { font-size: 16px; color: var(--ink); margin: 22px 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.overview .md-h4 { font-size: 14px; color: var(--ink-2); margin: 18px 0 6px; font-weight: 600; }
.overview .md-p { margin: 0 0 14px; text-wrap: pretty; }
.overview .md-ul, .overview .md-ol { margin: 0 0 16px; padding-left: 22px; }
.overview .md-ul li, .overview .md-ol li { margin: 4px 0; }
.overview .md-ul { list-style: none; padding-left: 0; }
.overview .md-ul li { position: relative; padding-left: 20px; }
.overview .md-ul li::before {
  content: ""; position: absolute; left: 2px; top: 0.7em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.overview .md-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-sunk);
  color: var(--accent);
  border-radius: 4px;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
html[data-theme="dark"] .overview .md-code { background: var(--line-2); }
.overview .md-pre {
  background: var(--bg-sunk);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 16px;
}
html[data-theme="dark"] .overview .md-pre { background: var(--line-2); }
.overview strong { color: var(--ink); font-weight: 600; }
.overview a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent); }
.overview a:hover { text-decoration-color: var(--accent); }

/* Plugin list */
.plugin-list, .mcp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.plugin-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.plugin-icon { color: var(--accent); text-align: center; }
.plugin-name { font-size: 14px; font-weight: 600; text-decoration: none; color: inherit; transition: color .2s ease; }
a.plugin-name:hover { color: var(--accent); }
.plugin-version { font-size: 12px; color: var(--ink-4); }
.plugin-from {
  font-size: 11.5px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-sunk);
  color: var(--ink-3);
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
a.plugin-from:hover { background: var(--accent); color: #fff; }
html[data-theme="dark"] .plugin-from { background: var(--line-2); }
html[data-theme="dark"] a.plugin-from:hover { background: var(--accent); color: var(--bg); }

/* MCP list */
.mcp-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
@media (max-width: 720px) { .mcp-row { grid-template-columns: 1fr; gap: 4px; } }
.mcp-name-wrap { display: flex; align-items: center; gap: 10px; }
.mcp-bullet { color: var(--accent); }
.mcp-name { font-size: 14px; font-weight: 600; }
.mcp-cmd {
  font-size: 12.5px;
  color: var(--ink-3);
  background: var(--bg-sunk);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  white-space: nowrap;
}
html[data-theme="dark"] .mcp-cmd { background: var(--line-2); }

/* Bundle / file tree + viewer */
.bundle {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 380px;
}
@media (max-width: 760px) { .bundle { grid-template-columns: 1fr; } }

.filetree {
  padding: 14px 10px;
  background: var(--bg-sunk);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  max-height: 560px;
}
html[data-theme="dark"] .filetree { background: var(--line-2); }

.ft-file {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.ft-file:hover { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--ink); }
.ft-file.is-active {
  background: var(--accent);
  color: #fff;
}
.ft-file.is-active .ft-icon { color: #fff; }
.ft-icon { color: var(--ink-4); display: inline-flex; flex-shrink: 0; }
.ft-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ft-file-nested { padding-left: 24px; }

.ft-dir { margin-top: 4px; }
.ft-dir-label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: lowercase;
  letter-spacing: .02em;
}
.ft-dir-label .ft-icon { color: var(--accent); }
.ft-dir-count {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-4);
  padding: 0 6px;
  background: var(--bg-paper);
  border-radius: 999px;
}

.fileviewer { display: flex; flex-direction: column; min-width: 0; }
.fv-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-paper);
}
.fv-path { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.fv-meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--ink-4); font-family: var(--font-mono); }
.fv-kind {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-sunk);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
}
html[data-theme="dark"] .fv-kind { background: var(--line-2); }

.fv-code {
  margin: 0;
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  min-width: 0;
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
}
.fv-code code { font-family: inherit; white-space: inherit; word-break: inherit; }

/* syntax tokens */
.tok-com { color: var(--ink-4); font-style: italic; }
.tok-kw { color: var(--accent); font-weight: 600; }
.tok-var { color: #0EA5E9; }
html[data-theme="dark"] .tok-var { color: #7DD3FC; }
.tok-str { color: #059669; }
html[data-theme="dark"] .tok-str { color: #6EE7B7; }
.tok-head { color: var(--accent); font-weight: 700; }
.tok-code { color: var(--ink); background: var(--bg-sunk); padding: 0 4px; border-radius: 3px; }
html[data-theme="dark"] .tok-code { background: var(--line); }
.tok-list { color: var(--ink-2); }
.tok-bold { color: var(--ink); font-weight: 700; }

.fv-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: 14px;
}

.notfound {
  text-align: center;
  padding: 100px 20px;
  color: var(--ink-3);
}
.notfound p { font-size: 18px; margin-bottom: 20px; }

/* === Tweaks panel === */
.tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.25);
  padding: 14px 16px;
  min-width: 240px;
}
.tweaks-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-4);
  margin-bottom: 10px;
}
.tweak-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.tweak-label { font-size: 13px; color: var(--ink-2); }
.tweak-seg {
  display: flex;
  padding: 2px;
  background: var(--bg-sunk);
  border-radius: 999px;
}
html[data-theme="dark"] .tweak-seg { background: var(--line-2); }
.tweak-seg button {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-3);
}
.tweak-seg button.is-active {
  background: var(--bg-paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* footer */
.footer {
  padding: 32px 40px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
}
.footer a { color: var(--ink-3); text-decoration: underline; text-decoration-color: var(--line); }
.footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }
