.workspace-catalog-hero, .market-page-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(150px, 25%, 370px);
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
  padding: clamp(24px, 4vw, 52px);
  border-radius: 21px;
  overflow: hidden;
  background: radial-gradient(ellipse at 90% 10%, var(--stage-glow), transparent 62%), var(--stage-gradient);
  color: var(--stage-ink);
}
.workspace-catalog-hero h2, .market-page-hero h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(1.85rem, 3.9vw, 3.75rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.workspace-catalog-hero p { max-width: 53ch; margin: .85rem 0 0; color: var(--stage-muted); }
.workspace-catalog-art { position: relative; display: grid; place-items: center; min-height: 140px; }
.catalog-art-sheet {
  width: 112px;
  padding: 17px;
  border: 1px solid #ede5ff;
  border-radius: 12px;
  background: linear-gradient(155deg, #ffffff, #cbbcff);
  transform: rotate(-12deg);
  box-shadow: 10px 12px 0 #9d82df55, 20px 22px 0 #a990ed30, 0 16px 32px #10112890;
}
.catalog-art-line { display: block; width: 54%; height: 5px; margin-bottom: 12px; border-radius: 4px; background: #6654a9; }
.catalog-art-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.catalog-art-choices i { justify-self: center; width: 12px; aspect-ratio: 1; border: 1px solid #786bab; border-radius: 50%; }
.catalog-art-choices i:nth-child(4n + 2) { background: #6251a6; }
.catalog-art-check {
  position: absolute;
  inset: auto 12% 4px auto;
  display: grid;
  place-items: center;
  width: 47px;
  aspect-ratio: 1;
  border-radius: 13px;
  background: #b7f5e8;
  color: #143a42;
  box-shadow: 0 8px 20px #10112870;
  transform: rotate(12deg);
}
.catalog-art-check svg { width: 24px; height: 24px; }
.workspace-catalog-controls { margin-top: 15px; padding: 14px; }
.workspace-catalog .market-filters {
  display: grid;
  grid-template-columns: minmax(175px, 2fr) repeat(3, minmax(0, 1fr)) auto;
  align-items: start;
}
.catalog-search-field {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding-inline: .65rem;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}
.catalog-search-field:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.catalog-search-field > svg, .catalog-clear-search svg { width: 20px; height: 20px; flex: none; }
.catalog-search-field .market-search {
  width: 100%;
  padding-inline: 0;
  min-height: 46px;
  border: 0;
  outline: none;
  background: transparent;
}
.catalog-search-field .market-search::-webkit-search-cancel-button { display: none; }
.catalog-clear-search { display: grid; flex: none; place-items: center; min-width: 30px; min-height: 40px; color: var(--accent); }
.workspace-catalog .filter-picker { width: auto; }
.workspace-catalog .filter-picker summary { gap: 6px; padding-inline: 10px; overflow-wrap: anywhere; }
.workspace-catalog .filter-options { min-width: 100%; max-height: min(50vh, 300px); overflow-y: auto; overflow-wrap: anywhere; }
.workspace-catalog .market-filters button { white-space: normal; }
.workspace-catalog-results { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 23px 0 13px; color: var(--muted); }
.workspace-catalog-results strong { color: var(--ink); font-size: 1.15em; }
.workspace-catalog-results a, .test-creator-link { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: .22em; }
.workspace-catalog-empty { display: grid; justify-items: center; gap: 12px; padding-block: 2.5rem; text-align: center; }
.workspace-catalog-empty p { margin: 0; }

:is(.workspace-catalog, .market-author-list) .grid {
  justify-content: start;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 252px), 1fr));
  gap: 15px;
}
:is(.workspace-catalog, .market-author-list) .card {
  position: relative;
  padding: 0;
  border-top-width: 1px;
  border-radius: 17px;
  overflow: hidden;
}
:is(.workspace-catalog, .market-author-list) .card:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
:is(.workspace-catalog, .market-author-list) .card-top {
  position: relative;
  min-height: 114px;
  padding: 14px;
  align-items: flex-start;
  background: radial-gradient(circle, var(--subject-edge) .7px, transparent .9px) 2px 2px / 13px 13px, var(--subject-tint);
}
:is(.workspace-catalog, .market-author-list) .card-symbol { align-self: center; background: var(--surface); box-shadow: var(--shadow); }
:is(.workspace-catalog, .market-author-list) .card-price { background: var(--surface); }
:is(.workspace-catalog, .market-author-list) .catalog-card-with-cover .market-cover { position: static; aspect-ratio: 16 / 9; object-fit: contain; margin: 0; border-radius: 0; background: var(--stage); }
:is(.workspace-catalog, .market-author-list) .catalog-card-with-cover .card-top { min-height: 0; justify-content: flex-end; padding: .5rem .85rem 0; background: none; }
:is(.workspace-catalog, .market-author-list) .catalog-card-with-cover .card-symbol { display: none; }
:is(.workspace-catalog, .market-author-list) .card-body { margin: 0; padding: 15px 16px; }
:is(.workspace-catalog, .market-author-list) .card-body h3 { margin: 4px 0 7px; }
:is(.workspace-catalog, .market-author-list) .market-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
:is(.workspace-catalog, .market-author-list) .card-link { border-radius: 0; border-width: 1px 0 0; padding: 10px 16px; background: var(--surface); }
:is(.workspace-catalog, .market-author-list) .card-link:hover { background: var(--selected); }

.test-page-hero { grid-template-columns: minmax(0, 1fr) clamp(165px, 33%, 500px); }
.market-page-hero .eyebrow { margin: 0 0 .7rem; color: var(--stage-muted); overflow-wrap: anywhere; }
.market-page-hero .meta { margin-top: 1.1rem; color: var(--stage-ink); }
.market-page-hero .meta span { padding: .35rem .6rem; border: 1px solid #ffffff40; border-radius: 8px; background: #ffffff12; }
.test-page-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; border: 1px solid #ffffff36; border-radius: 15px; background: var(--stage); }
.test-page-symbol {
  display: grid;
  justify-self: center;
  place-items: center;
  width: min(100%, 145px);
  aspect-ratio: 1;
  border: 1px solid #d9cdfb80;
  border-radius: 23px;
  background: #c9b3ff24;
  color: var(--stage-ink);
  font: 700 clamp(2rem, 7vw, 4rem)/1 Georgia, serif;
}
.test-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 320px); align-items: start; gap: 18px; margin-top: 18px; }
.test-page-main, .test-page-sidebar { display: grid; gap: 15px; min-width: 0; }
.market-page-panel { min-width: 0; padding: clamp(16px, 2.4vw, 27px); border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.market-page-panel h2 { margin: 0 0 .65rem; font-size: 1.25rem; }
.market-page-panel .market-detail-description { margin: 0; max-width: 75ch; overflow-x: auto; overflow-wrap: anywhere; }
.market-detail-description p { margin: 0 0 .65rem; }
.market-detail-description img { max-width: 100%; height: auto; }
.market-detail-description table { border-collapse: collapse; max-width: 100%; }
.market-detail-description :is(td, th) { padding: .35rem .55rem; border: 1px solid var(--line); }
.market-detail-description [data-align="center"] { text-align: center; }
.market-detail-description [data-align="right"] { text-align: right; }
.market-detail-description [data-align="justify"] { text-align: justify; }
.market-detail-description [data-size="small"] { max-width: min(100%, 10rem); }
.market-detail-description [data-size="medium"] { max-width: min(100%, 19rem); }
.market-detail-description img[data-layout="left"] { display: block; margin: .5rem auto .5rem 0; }
.market-detail-description img[data-layout="center"] { display: block; margin: .5rem auto; }
.market-detail-description img[data-layout="right"] { display: block; margin: .5rem 0 .5rem auto; }
.market-detail-description img[data-layout="wrap-left"] { float: left; margin: .25rem .75rem .4rem 0; }
.market-detail-description img[data-layout="wrap-right"] { float: right; margin: .25rem 0 .4rem .75rem; }
.market-detail-description img:is([data-layout="wrap-left"], [data-layout="wrap-right"]) { max-width: 55%; }
.market-page-panel .market-facts { margin: 0; }
.market-page-panel .market-primary { justify-content: center; width: 100%; text-align: center; }
.test-creator-card { display: flex; align-items: flex-start; gap: .85rem; }
.test-creator-card:hover { border-color: var(--accent); }
.test-creator-card > span:last-child { display: grid; gap: .2rem; min-width: 0; overflow-wrap: anywhere; }
.test-creator-card small { color: var(--muted); }
.test-creator-link { margin-top: .3rem; font-size: .9rem; }
.market-creator-avatar { display: grid; flex: none; place-items: center; width: 48px; aspect-ratio: 1; border-radius: 14px; background: var(--selected); color: var(--accent); font-weight: 800; }
.market-creator-avatar svg { width: 22px; height: 22px; }
.market-author-hero { grid-template-columns: auto minmax(0, 1fr); justify-content: start; }
.market-author-hero .market-creator-avatar { width: clamp(52px, 10vw, 100px); font-size: clamp(1.15rem, 3vw, 2.2rem); }
.market-author-list { margin-top: 25px; }
.market-author-list h2 { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin: 0 0 13px; }
.market-author-list h2 span { padding: .2rem .55rem; border-radius: 10px; background: var(--selected); color: var(--accent); font-size: .9rem; }
@media (max-width: 1080px) {
  .workspace-catalog .market-filters { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
  .catalog-search-field { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .test-page-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 535px) {
  .workspace-catalog-hero, .test-page-hero { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .workspace-catalog-art, .test-page-symbol { display: none; }
  .workspace-catalog .market-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

.test-description-panel { border-block-start: 3px solid var(--accent); }
.test-description-clip { position: relative; margin-top: .65rem; }
.test-description-clip.is-collapsed { max-height: 12rem; overflow: hidden; }
.test-description-clip.is-collapsed::after {
  position: absolute;
  inset: auto 0 0;
  height: 2.5rem;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
  content: "";
}
.test-description-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: .65rem;
  min-height: 44px;
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--selected);
  color: var(--accent);
  font-weight: 750;
  cursor: pointer;
}
.test-description-toggle[hidden] { display: none; }
.test-description-toggle svg { width: 1rem; height: 1rem; }
.test-description-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.test-description-toggle:hover { border-color: var(--accent); }
.test-profile-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  padding: .85rem 1rem;
  border: 1px solid #d7ab59;
  border-inline-start: 4px solid #a56712;
  border-radius: 14px;
  background: #fff2d6;
  color: #503407;
}
[data-theme="dark"] .test-profile-notice { border-color: #b78a48; background: #3c2b16; color: #ffe5b7; }
.test-profile-notice > div { flex: 1 1 14rem; min-width: 0; }
.test-profile-notice h2 { margin: 0; font-size: 1rem; }
.test-profile-notice p { margin: .15rem 0 0; }
.test-profile-notice-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 8px; background: #bc8e3929; }
.test-profile-notice-icon svg { width: 1.12rem; height: 1.12rem; }
.test-profile-notice a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .4rem .75rem;
  border: 1px solid currentColor;
  border-radius: 9px;
  font-weight: 750;
}
.test-profile-notice a:hover { background: #bc8e3929; }
