.marketplace, .spark-detail {
  --background: #111112;
  --surface: #19191c;
  --ink: #f6f2ee;
  --muted: #b0aaab;
  --line: #322d2b;
  --accent: #ff8d5d;
  background: var(--background);
}
.market-wrap { max-width: 1280px; width: calc(100% - 96px); margin-inline: auto; }
.marketplace .topbar { height: 64px; }
.market-nav { height: 100%; display: flex; align-items: center; }
.market-language { margin-left: auto; font-size: 14px; color: var(--muted); }
.market-language a:hover { color: var(--ink); }
.marketplace .outline, .spark-detail .outline { border-color: #524039; }
.marketplace .outline:hover, .spark-detail .outline:hover { background: #2d211c; }
.spark-detail .primary { color: #201510; }
.spark-detail .primary:hover { background: #ffab88; }
.spark-detail .detail-media, .spark-detail .use-panel, .spark-detail .prompt-card { background: #1c1918; border-color: #45362e; }
.spark-detail .after-tag { color: #201510; }
.spark-detail .compare-shell { border-color: #49372e; }
.spark-detail .play { background: #31241e; border-color: #594035; }
.spark-detail .play:hover { background: #4a3022; }
.spark-detail .filters button { border-color: #473b35; }

.market-hero {
  display: grid;
  grid-template-columns: minmax(290px,.9fr) minmax(0,1.22fr);
  gap: clamp(28px,5vw,80px);
  align-items: center;
  padding-block: 58px 46px;
}
.market-kicker { font-size: 14px; color: var(--accent); margin-bottom: 14px; font-weight: 740; }
.market-hero h1 { font-size: clamp(42px,5.5vw,77px); line-height: 1.12; letter-spacing: -.07em; font-weight: 870; }
.market-hero h1 span { color: var(--accent); }
.market-hero .market-intro { max-width: 38ch; margin-top: 16px; line-height: 1.75; color: var(--muted); }
.market-spotlight {
  min-width: 0;
  padding: 17px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #191818;
}
.market-spotlight h2, .market-spotlight h3 { font-size: 14px; font-weight: 690; color: #e6dbd6; }
.agent-example {
  display: flex; gap: 10px; align-items: center;
  margin: 10px 0 15px; padding: 8px;
  border: 1px solid #503b30; border-radius: 8px; background: #2a211d;
}
.agent-example img { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; }
.agent-example p { font-size: 14px; color: #f0e5df; line-height: 1.5; }
.market-spotlight-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.marketplace .template { background: transparent; border: 0; border-radius: 0; }
.marketplace .thumb { border-radius: 7px; aspect-ratio: 1.42; background: #282321; }
.marketplace .template:hover .thumb { outline: 1px solid var(--accent); outline-offset: 1px; }
.marketplace .card-tag { background: #211713ea; color: #f3e4dc; }
.marketplace .card-copy { padding: 8px 1px 1px; gap: 3px; min-width: 0; }
.marketplace .card-copy strong { font-size: 16px; }
.marketplace .card-copy small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.marketplace .template.spot-card { position: relative; border-radius: 7px; overflow: visible; }
.marketplace .spot-card .thumb { aspect-ratio: 1.16; position: relative; }
.marketplace .spot-card .card-tag { display: none; }
.marketplace .spot-card .card-copy strong { font-size: 15px; }
.marketplace .spot-card .card-copy small { display: none; }
.marketplace .spot-card::after {
  content: "▶"; position: absolute; z-index: 3; top: 6px; right: 6px;
  width: 23px; height: 23px; display: grid; place-items: center;
  background: #181312da; border: 1px solid #f1e4dc66; border-radius: 50%;
  font-size: 9px; color: white; pointer-events: none;
}
.marketplace .spot-card.has-detail::after { content: none; }
.card-intent { display: none; }
.marketplace .spot-card.has-detail .card-intent {
  position: absolute; z-index: 3; display: block;
  top: 6px; right: 6px; padding: 3px 5px; border-radius: 4px;
  color: #1f140e; background: var(--accent); font-size: 11px; font-weight: 740;
}

.market-section { border-top: 1px solid var(--line); padding-top: 26px; scroll-margin-top: 16px; }
.market-library-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.market-library-heading h2 { font-size: clamp(25px,3vw,34px); letter-spacing: -.04em; }
.market-toolbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin: 15px 0 17px; }
.market-toolbar .filters { margin: 0; }
.market-toolbar .filters button { border-color: #413633; border-radius: 999px; min-height: 36px; }
.market-toolbar .filters button[aria-pressed="true"] { background: #3a261d; color: #ffc1a4; border-color: #9e5b40; }
.market-search { width: min(290px,100%); display: flex; align-items: center; gap: 11px; background: #211e1d; padding: 0 13px; min-height: 39px; border-radius: 7px; border: 1px solid #453832; }
.market-search:focus-within { border-color: var(--accent); }
.market-search i { width: 12px; height: 12px; flex: 0 0 12px; border: 1.5px solid #c6b6ae; border-radius: 50%; position: relative; }
.market-search i::after { content: ""; width: 5px; height: 1.5px; background: #c6b6ae; position: absolute; right: -3px; bottom: -2px; rotate: 45deg; }
.market-search input { min-width: 0; width: 100%; color: var(--ink); background: transparent; border: 0; outline: none; font-size: 15px; min-height: 37px; }
.market-search input:focus-visible { outline: none; }
.marketplace .card-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 21px 13px; }
.market-empty { grid-column: 1/-1; padding: 30px 10px; color: var(--muted); }
.market-empty .button { margin-top: 12px; }
.marketplace .footer { margin-top: 38px; }
.marketplace dialog { background: #221d1b; border-color: #574038; }

@media (max-width: 1050px) {
  .market-wrap { width: calc(100% - 52px); }
  .market-hero { gap: 26px; padding-block: 43px 34px; }
  .marketplace .card-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .market-wrap { width: calc(100% - 32px); }
  .marketplace .topbar { height: 56px; }
  .market-hero { grid-template-columns: minmax(0,1fr); gap: 20px; padding-block: 25px; }
  .market-hero h1 { font-size: clamp(38px,9.5vw,57px); }
  .market-kicker { margin-bottom: 8px; }
  .market-hero .market-intro { margin-top: 11px; }
  .market-spotlight { padding: 10px; }
  .agent-example { margin-block: 7px 12px; }
  .market-section { padding-top: 17px; }
  .market-toolbar { align-items: stretch; flex-direction: column; margin-block: 10px 13px; }
  .market-toolbar .filters { gap: 5px; }
  .market-toolbar .filters button { min-height: 33px; padding-inline: 9px; }
  .market-search { width: 100%; }
  .marketplace .card-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 10px; }
}

.market-hero { align-items: start; padding-block: 38px 32px; }
.market-hero h1 { font-size: clamp(39px,4.6vw,62px); }
.market-hero .market-intro { margin-top: 12px; }
.market-hero .primary, .modal-guide .primary { color: #23150f; }
.market-hero .primary:hover, .modal-guide .primary:hover { background: #ffab88; }
.setup-steps { padding-left: 1.4em; line-height: 1.62; margin: 12px 0 15px; color: var(--muted); }
.setup-steps li + li { margin-top: 5px; }
.setup-steps li::marker { color: var(--accent); font-weight: 700; }
.setup-steps code { color: var(--ink); overflow-wrap: anywhere; }
.market-spotlight h2 { font-size: 21px; font-weight: 780; }
.market-spotlight .setup-steps { font-size: 15px; }
.tutorial-note { font-size: 14px; line-height: 1.55; color: var(--muted); }
.mcp-config { margin-top: 12px; }
.mcp-config summary { color: var(--accent); cursor: pointer; width: fit-content; min-height: 32px; line-height: 32px; }
.mcp-config pre { background: #1f1b19; border: 1px solid var(--line); border-radius: 7px; padding: 12px; max-width: 100%; overflow: auto; font-size: 13px; }
.inline-copy-status { color: var(--accent); align-self: center; margin-inline: 8px; font-size: 14px; }
.modal-guide { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.modal-guide blockquote { margin: 12px 0; padding: 9px 11px; background: #2b211c; border-left: 2px solid var(--accent); line-height: 1.6; }
.marketplace dialog video { max-height: min(44vh,400px); }
@media (max-width: 760px) {
  .market-hero { padding-block: 24px; }
  .market-hero h1 { font-size: clamp(33px,8.7vw,52px); }
  .market-spotlight h2 { font-size: 18px; }
}

.agent-example + .tutorial-note { margin-bottom: 13px; }

.mcp-demo-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.mcp-demo-badge { color: #d5b6a7; font: 650 12px/1.4 system-ui,sans-serif; }
.mcp-message { margin: 12px 0 8px; padding: 9px 10px; gap: 11px; }
.mcp-message img { width: 50px; height: 53px; flex: 0 0 50px; }
.mcp-filename { color: #d2ada0; font-size: 12px; display: block; margin-bottom: 2px; }
.mcp-demo-action { display: flex; justify-content: flex-end; }
.mcp-demo-action button:disabled { opacity: .66; cursor: progress; }
.mcp-demo-status { min-height: 1.5em; margin-top: 8px; font-size: 14px; color: var(--muted); }
.mcp-demo-log { list-style: none; padding: 0; margin: 8px 0 0; }
.mcp-demo-log li { border-top: 1px solid var(--line); padding-block: 9px; }
.mcp-step-line { display: grid; grid-template-columns: max-content minmax(0,1fr) max-content; align-items: baseline; gap: 8px; font-size: 14px; }
.mcp-step-line code { min-width: 0; overflow-wrap: anywhere; color: #c8a695; font-size: 12px; }
.mcp-step-status { font-size: 12px; color: var(--muted); }
.mcp-demo-log [data-state="running"] .mcp-step-status { color: var(--accent); }
.mcp-demo-log [data-state="done"] .mcp-step-status { color: #a9d4ad; }
.mcp-step-result { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 4px; }
.mcp-demo-output { display: grid; grid-template-columns: minmax(88px,118px) minmax(0,1fr); align-items: center; gap: 13px; border: 1px solid #503b30; background: #241c19; padding: 8px; border-radius: 8px; }
.mcp-demo-output[hidden] { display: none; }
.mcp-demo-output video { display: block; width: 100%; aspect-ratio: 9/16; max-height: 180px; border-radius: 5px; background: #111; }
.mcp-demo-output h3 { font-size: 16px; }
.mcp-demo-output p { margin-block: 4px 9px; font-size: 13px; color: var(--muted); }
.mcp-agent-reply { margin: 12px 0; padding: 11px 13px; border-left: 2px solid var(--accent); background: #211e1c; border-radius: 0 8px 8px 0; }
.mcp-agent-reply > span { color: var(--accent); font: 700 10px/1.4 ui-monospace,monospace; letter-spacing: .08em; }
.mcp-agent-reply p { margin: 5px 0 0; color: var(--ink); font-size: 14px; line-height: 1.6; }
.mcp-demo-log li { margin-top: 8px; padding: 11px 13px; border: 1px solid #45362e; border-radius: 8px; background: #211e1c; }
.mcp-demo-log [data-state="running"] { border-color: var(--accent); animation: mcp-step-in .28s ease-out both; }
.mcp-step-line strong { color: var(--ink); font-size: 13px; }
.mcp-step-result b { color: #a9d4ad; font-weight: 650; }
@keyframes mcp-step-in { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .mcp-demo-log [data-state="running"] { animation: none; } }

.spark-detail #use > h2 { margin: 0 0 20px; font-size: clamp(27px,4vw,38px); }
.use-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.use-option { display: flex; flex-direction: column; gap: 9px; padding: clamp(17px,2.6vw,28px); background: #1c1918; border: 1px solid #45362e; border-radius: 12px; }
.use-option > .eyebrow { margin: 0; color: var(--accent); }
.use-option h3 { margin: 0; font-size: 20px; }
.use-option ol { margin: 0; padding-left: 1.35em; color: var(--muted); line-height: 1.75; }
.use-option .prompt-card { margin-top: auto; background: #241c19; border-color: #503b30; }
.use-option .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.use-option .actions .button { font-size: 14px; }
.spark-detail #use > .runtime { margin-top: 15px; }
@media (max-width:760px) { .use-options { grid-template-columns: 1fr; } }
