:root { --radius: 16px; --market-width: 1220px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(850px 420px at 72% -8%, color-mix(in srgb, var(--teal) 12%, transparent), transparent 68%), var(--bg);
  color: var(--ink);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.skip-link:focus { top: 12px; }

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px max(22px, calc((100vw - var(--market-width)) / 2));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 18px; font-weight: 780; text-decoration: none; white-space: nowrap; }
.brand span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--teal), var(--blue)); }
.topbar nav { display: flex; align-items: center; gap: 20px; margin-right: auto; }
.topbar nav a, .nav-group summary, footer a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a[aria-current='page'], .topbar nav a.active, .nav-group summary:hover, .nav-group.active > summary, footer a:hover { color: var(--ink); }
.topbar nav a[aria-current='page'], .topbar nav a.active, .nav-group.active > summary { font-weight: 750; }
.nav-group { position: relative; }
.nav-group summary { cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '⌄'; display: inline-block; margin-left: 6px; font-size: 11px; transition: transform .15s ease; }
.nav-group[open] summary::after { transform: rotate(180deg); }
.nav-menu { position: absolute; left: -12px; top: calc(100% + 13px); z-index: 30; min-width: 190px; display: grid; gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 45px color-mix(in srgb, var(--shadow) 35%, transparent); }
.nav-menu a { padding: 9px 10px; border-radius: 8px; }
.nav-menu a:hover, .nav-menu a[aria-current='page'] { background: var(--surface2); }
.nav-group:last-of-type .nav-menu { right: 0; left: auto; }
.wallet-actions { display: flex; align-items: center; gap: 9px; }
.wallet-label { font: 12px ui-monospace, SFMono-Regular, monospace; color: var(--muted); white-space: nowrap; }

main, footer { width: min(var(--market-width), calc(100% - 40px)); margin: auto; }
.page-head { min-height: 210px; display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 48px 0 32px; }
.page-head h1 { margin: 0; font-size: clamp(32px, 4.2vw, 46px); line-height: 1; letter-spacing: -.045em; }
.page-head p:last-child { margin: 12px 0 0; color: var(--muted); }
.eyebrow, .step, .mini-label { margin: 0 0 10px; color: var(--teal); font: 750 10px/1.2 ui-monospace, SFMono-Regular, monospace; letter-spacing: .12em; }
.service-state { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-left: 1px solid var(--line); }
.service-state small { display: block; color: var(--muted); }
.service-state strong { display: block; margin-top: 2px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 6px color-mix(in srgb, var(--muted) 12%, transparent); }
.pulse.online { background: var(--ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 12%, transparent); }
.pulse.offline { background: var(--bad); box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 12%, transparent); }

.notice { position: fixed; z-index: 80; right: max(20px, calc((100vw - var(--market-width)) / 2)); bottom: 24px; width: min(390px, calc(100vw - 40px)); padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--blue) 7%, var(--surface)); box-shadow: 0 12px 32px color-mix(in srgb, var(--shadow) 28%, transparent); color: var(--text-subtle); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .16s ease, transform .16s ease; }
.notice.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.notice.error { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); color: var(--bad); }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok) 8%, var(--surface)); color: var(--ok); }
.primary, .quiet { display: inline-flex; justify-content: center; align-items: center; border-radius: 10px; padding: 9px 13px; font-weight: 740; text-decoration: none; }
.primary { border: 1px solid var(--teal); background: var(--teal); color: var(--accent-contrast); }
.primary:hover { filter: brightness(1.08); }
.quiet { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.quiet:hover { border-color: color-mix(in srgb, var(--teal) 55%, var(--line)); }
.primary:disabled, .quiet:disabled { opacity: .45; cursor: not-allowed; }
.text-button, .text-link { border: 0; background: transparent; color: var(--teal); padding: 4px; text-decoration: none; }
.full { width: 100%; margin-top: 12px; }

input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); color: var(--ink); padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 10%, transparent); }
.field-label { display: block; color: var(--muted); font-size: 12px; margin: 0 0 7px; }
.fineprint, .empty { color: var(--muted); font-size: 13px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-subtle); background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 13px; font: 12px/1.6 ui-monospace, SFMono-Regular, monospace; margin: 0 0 10px; }

.catalog-section { padding: 22px 0 64px; }
.catalog-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 17px; }
.catalog-counts { display: flex; gap: 13px; align-items: baseline; }
.catalog-counts span { color: var(--muted); font-size: 13px; }
.filters { display: grid; grid-template-columns: 1fr 280px auto; gap: 12px; align-items: end; margin-bottom: 23px; }
.filters label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.market-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.market-layout.catalog-empty { grid-template-columns: 1fr; }
.skill-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skill-card { position: relative; min-height: 190px; display: flex; flex-direction: column; padding: 16px; background: var(--surface); }
.skill-card:hover, .skill-card.selected { background: var(--surface2); }
.skill-card.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 65%, transparent); }
.skill-select { position: absolute; right: 15px; top: 15px; width: 17px; height: 17px; accent-color: var(--teal); }
.skill-title { padding-right: 29px; color: var(--ink); font-size: 16px; font-weight: 760; text-decoration: none; }
.skill-title:hover { color: var(--teal); }
.skill-cap { margin-top: 4px; color: var(--teal); font: 11px ui-monospace, monospace; text-transform: uppercase; }
.skill-summary { flex: 1; margin: 13px 0; color: var(--text-subtle); font-size: 13px; }
.skill-stats { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 11px; }
.skill-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.skill-buy { margin-left: auto; }
.empty-state { grid-column: 1 / -1; min-height: 400px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(28px, 7vw, 76px); background: linear-gradient(125deg, color-mix(in srgb, var(--teal) 6%, var(--surface)), var(--surface)); }
.empty-state h2 { max-width: 520px; margin: 0; font-size: clamp(26px, 4vw, 40px); line-height: 1.08; letter-spacing: -.035em; }
.empty-state p { max-width: 560px; margin: 13px 0 0; color: var(--muted); }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cart { position: sticky; top: 98px; padding: 20px; border-top: 2px solid var(--teal); background: var(--surface); }
.cart-items { max-height: 260px; overflow: auto; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.cart-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 9px; align-items: center; padding: 7px 0; }
.cart-remove { border: 0; background: transparent; color: var(--muted); padding: 3px; font-size: 12px; }
.cart-summary { margin: 11px 0 0; color: var(--muted); font-size: 13px; }
.cart-total { display: flex; justify-content: space-between; gap: 10px; padding: 16px 0; }
.cart-total span { color: var(--muted); }
.cart-total strong { color: var(--teal); }
.marketplace-paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0 0 72px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.marketplace-paths a { min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; background: var(--surface); text-decoration: none; }
.marketplace-paths a:hover { background: var(--surface2); }
.marketplace-paths span { color: var(--teal); font: 700 10px ui-monospace, monospace; letter-spacing: .1em; }
.marketplace-paths strong { font-size: 16px; }

.section { padding: 54px 0; border-top: 1px solid var(--line); }
main > .notice:first-child { margin-top: 28px; }
.section-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: end; margin-bottom: 27px; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(29px, 3.8vw, 42px); line-height: 1.05; letter-spacing: -.035em; }
.section-heading > p { margin: 0; color: var(--muted); }
.agent-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.endpoint-block, .grant-block { padding: 24px; }
.grant-block { border-left: 1px solid var(--line); }
.endpoint-heading, .inline-heading, .content-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.endpoint-heading { margin-bottom: 19px; }
.endpoint-heading h2, .inline-heading h2 { margin: 0; font-size: 19px; }
.endpoint-badge { flex: none; border: 1px solid color-mix(in srgb, var(--teal) 42%, var(--line)); border-radius: 999px; color: var(--teal); background: color-mix(in srgb, var(--teal) 8%, var(--surface)); padding: 3px 8px; font: 700 10px ui-monospace, monospace; }
.copy-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.copy-row code { min-width: 0; flex: 1; overflow-wrap: anywhere; color: var(--teal); font: 13px ui-monospace, monospace; }
.connect-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 22px 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--line); list-style: none; counter-reset: connect-step; }
.connect-steps li { min-height: 72px; padding: 14px; background: var(--surface2); color: var(--text-subtle); font-size: 12px; counter-increment: connect-step; }
.connect-steps li::before { content: counter(connect-step); display: block; margin-bottom: 7px; color: var(--teal); font: 750 10px ui-monospace, monospace; }
.connection-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.connection-preview { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.connection-preview summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.connection-preview[open] summary { margin-bottom: 16px; color: var(--ink); }
.grant { padding: 16px 0; border-bottom: 1px solid var(--line); }
.grant:last-child { border-bottom: 0; }
.grant-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.grant-meta { margin-top: 7px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.grant-status, .grant-cap, .grant-limits { display: inline-flex; margin: 9px 6px 0 0; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--text-subtle); background: var(--surface2); font: 11px ui-monospace, monospace; }
.grant-status { color: var(--ok); }
.grant-status.expired, .grant-status.revoked { color: var(--bad); }
.grant progress { width: 100%; height: 5px; margin-top: 11px; accent-color: var(--teal); }
.agent-logo-marquee { overflow: hidden; padding: 1px; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.agent-logo-track { width: max-content; display: flex; gap: 12px; animation: agent-logo-scroll 30s linear infinite; }
.agent-logo-set { display: flex; gap: 12px; }
.agent-logo-tile { width: 178px; min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; }
.agent-logo-tile img { width: 32px; height: 32px; flex: none; object-fit: contain; opacity: .86; filter: invert(1); transition: opacity .18s ease, transform .18s ease; }
.agent-logo-tile strong { font-size: 15px; white-space: nowrap; }
html[data-theme='light'] .agent-logo-tile img { filter: none; }
.agent-logo-tile img.brand-colour { filter: none; opacity: 1; }
.agent-logo-tile:hover img { opacity: 1; transform: scale(1.08); }
@keyframes agent-logo-scroll { to { transform: translateX(calc(-50% - 6px)); } }
.agent-logo-marquee:hover .agent-logo-track, .agent-logo-marquee:focus-within .agent-logo-track { animation-play-state: paused; }
.agent-environments-heading h2 { font-size: clamp(23px, 2.8vw, 31px); }
.publish-agent-section { scroll-margin-top: 92px; }
.publish-agent-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.publish-agent-steps { margin: 0; padding: 0; list-style: none; counter-reset: publish-step; background: var(--surface); }
.publish-agent-steps li { min-height: 100px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-content: center; padding: 18px 21px; border-bottom: 1px solid var(--line); counter-increment: publish-step; }
.publish-agent-steps li:last-child { border-bottom: 0; }
.publish-agent-steps li::before { content: counter(publish-step); grid-row: 1 / 3; color: var(--teal); font: 750 11px ui-monospace, monospace; }
.publish-agent-steps strong { font-size: 15px; }
.publish-agent-steps span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.publish-agent-actions { padding: 24px; background: color-mix(in srgb, var(--teal) 6%, var(--surface)); }
.publish-agent-actions h3 { margin: 0; font-size: 21px; }
.publish-agent-actions > p:not(.mini-label) { margin: 9px 0 18px; color: var(--muted); }

.history-tools { margin-bottom: 15px; color: var(--muted); }
.account-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.account-summary > div:first-child { display: grid; gap: 4px; }
.account-summary span, .account-summary small { color: var(--muted); }
.account-summary strong { font-size: 25px; }
.account-summary-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.fund-prepaid { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.fund-prepaid label { color: var(--muted); font-size: 12px; }
.fund-prepaid input { width: 120px; }
.library-empty { min-height: 230px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; }
.purchase-history { border-top: 1px solid var(--line); }
.purchase { display: grid; grid-template-columns: 190px 1fr auto; gap: 23px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.receipt-id { color: var(--muted); font: 11px ui-monospace, monospace; overflow-wrap: anywhere; }
.purchase-main h2 { margin: 0 0 5px; font-size: 19px; }
.purchase-main p { margin: 3px 0; color: var(--muted); }
.purchase-actions { display: flex; justify-content: flex-end; align-items: start; gap: 8px; }
.content-panel { grid-column: 2 / -1; margin-top: 12px; padding: 15px; border-radius: 12px; background: var(--surface); }
.content-panel pre { max-height: 320px; overflow: auto; margin-top: 12px; }
.review-form { display: grid; grid-template-columns: 110px 1fr auto; gap: 9px; margin-top: 13px; }
.review-form textarea { min-height: 45px; resize: vertical; }
.reviewed-note { margin: 12px 0 0; color: var(--ok); font-size: 13px; }

.studio-actions, .studio-toolbar, .studio-filters, .owned-skill-facts, .owned-skill-actions { display: flex; align-items: center; gap: 10px; }
.studio-actions { flex-wrap: wrap; justify-content: flex-end; }
.studio-section { padding-top: 26px; }
.studio-toolbar { justify-content: space-between; padding-bottom: 18px; }
.studio-toolbar > strong { margin-right: auto; }
.studio-filters { padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.studio-filters .text-button { padding: 6px 9px; border-radius: 7px; color: var(--muted); }
.studio-filters .text-button.active { background: var(--surface2); color: var(--ink); }
.owned-skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.owned-skill { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.owned-skill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.owned-skill h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.skill-identity { margin: 4px 0 0; color: var(--teal); font: 10px ui-monospace, monospace; text-transform: uppercase; }
.portfolio-status { flex: none; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font: 700 10px ui-monospace, monospace; }
.portfolio-status.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.portfolio-status.warning { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.portfolio-status.muted { color: var(--muted); }
.owned-skill-facts { flex-wrap: wrap; margin: 14px 0; }
.owned-skill-facts span { padding: 4px 8px; border-radius: 999px; background: var(--surface2); color: var(--muted); font: 10px ui-monospace, monospace; }
.owned-skill-summary { min-height: 44px; margin: 0; color: var(--text-subtle); font-size: 13px; }
.owned-skill-actions { justify-content: space-between; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.studio-empty { grid-column: 1 / -1; min-height: 300px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(26px, 7vw, 70px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.studio-empty h2 { margin: 0; font-size: clamp(25px, 4vw, 36px); }
.studio-empty p { margin: 10px 0 20px; color: var(--muted); }

.detail-back { padding: 34px 0 18px; }
.skill-detail { padding-bottom: 72px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 56px; align-items: start; padding: 44px 0; border-top: 1px solid var(--line); }
.detail-copy h1 { max-width: 820px; margin: 0; font-size: clamp(42px, 6vw, 68px); line-height: .98; letter-spacing: -.045em; overflow-wrap: anywhere; }
.detail-summary { max-width: 760px; margin: 22px 0 0; color: var(--text-subtle); font-size: 19px; }
.detail-identity { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 18px; margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.detail-identity dt { color: var(--muted); font-size: 12px; }
.detail-identity dd { margin: 0; font: 12px/1.55 ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; }
.detail-lineage { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.detail-lineage strong, .detail-lineage span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }
.detail-lineage span { color: var(--muted); }
.detail-purchase { position: sticky; top: 104px; padding: 24px; border-top: 2px solid var(--teal); background: var(--surface); }
.detail-price { margin: 8px 0 18px; font-size: 32px; font-weight: 800; letter-spacing: -.035em; }
.detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.detail-metric { min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; background: var(--surface); }
.detail-metric span { color: var(--muted); font-size: 12px; }
.detail-metric strong { font-size: 19px; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 27px 0 40px; border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar nav { order: 3; width: 100%; padding-top: 9px; border-top: 1px solid var(--line); }
  .wallet-actions { margin-left: auto; }
  .market-layout { grid-template-columns: 1fr; }
  .cart { position: static; }
  .skill-results, .owned-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .page-head { min-height: 170px; align-items: flex-start; flex-direction: column; gap: 18px; }
  .service-state { padding-left: 0; border-left: 0; }
  .filters, .section-heading, .agent-grid, .publish-agent-grid { grid-template-columns: 1fr; }
  .grant-block { border-left: 0; border-top: 1px solid var(--line); }
  .connect-steps { grid-template-columns: 1fr; }
  .skill-results, .owned-skills, .marketplace-paths { grid-template-columns: 1fr; }
  .purchase { grid-template-columns: 1fr; }
  .account-summary { align-items: flex-start; flex-direction: column; }
  .account-summary-actions { justify-content: flex-start; }
  .content-panel { grid-column: 1; }
  .purchase-actions { justify-content: flex-start; }
  .review-form { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-purchase { position: static; }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-toolbar { align-items: flex-start; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-logo-marquee { overflow-x: auto; mask-image: none; }
  .agent-logo-track { animation: none; }
  .agent-logo-set[aria-hidden='true'] { display: none; }
}
  @media (max-width: 560px) {
  main, footer { width: min(var(--market-width), calc(100% - 28px)); }
  .wallet-label { display: none; }
      .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; position: static; padding-right: 14px; padding-left: 14px; }
      .topbar .brand { grid-row: 1; grid-column: 1; }
      .topbar > .theme-toggle { grid-row: 1; grid-column: 2; margin-left: 0; }
      .wallet-actions { grid-row: 2; grid-column: 1 / -1; width: auto; margin-left: 0; justify-content: flex-end; }
      .topbar nav { grid-row: 3; grid-column: 1 / -1; order: initial; width: auto; flex-wrap: wrap; gap: 8px 14px; }
      .catalog-bar, footer { align-items: flex-start; flex-direction: column; }
      .studio-head { align-items: flex-start; }
      .studio-actions { justify-content: flex-start; }
      .studio-filters { order: 3; width: 100%; justify-content: space-between; }
      .detail-metrics { grid-template-columns: 1fr; }
  }
