/* Preserve the reference layout while inheriting the shared console theme. */
.content[data-route="market"] {
  padding:18px 22px 30px;
  min-height:calc(100dvh - 102px);
  background:var(--bg);
}
[data-route="market"] .market-banner {
  padding:26px 28px 20px; border:0; border-radius:18px; color:var(--ink);
  background:var(--primary-soft);
  box-shadow:inset 0 0 0 1px var(--primary-border);
}
[data-route="market"] .market-top {gap:28px; margin-bottom:20px}
[data-route="market"] .market-intro {min-width:0; flex:1}
[data-route="market"] .market-banner .label {
  min-height:24px; padding:2px 10px; border-color:var(--primary-border);
  color:var(--primary-ink); background:var(--primary-soft); font-size:11px; line-height:18px;
}
.market-label-dot {width:6px; height:6px; border-radius:50%; background:var(--primary)}
[data-route="market"] .market-banner h2 {font-size:28px; line-height:42px; font-weight:700; color:var(--ink); margin:10px 0 8px}
[data-route="market"] .market-banner p {font-size:12px; line-height:20px; color:var(--text)}
[data-route="market"] .market-counters {
  width:max-content; max-width:100%; min-height:72px; flex-wrap:nowrap; gap:0;
  margin-top:20px; padding:10px 0; border:1px solid var(--line); border-radius:12px;
  background:var(--surface-subtle);
}
[data-route="market"] .market-counters>div {min-width:78px; padding:0 16px}
[data-route="market"] .market-counters>div+div {border-left:1px solid var(--line)}
[data-route="market"] .market-counters strong {font-size:24px; line-height:30px; color:var(--ink)}
[data-route="market"] .market-counters small {font-size:11px; line-height:20px; color:var(--muted)}
[data-route="market"] .market-aside {flex:0 0 34%; width:auto; display:grid; gap:12px}
[data-route="market"] .market-feature {
  min-height:70px; padding:14px 16px; gap:14px; border:1px solid var(--line);
  border-radius:12px; background:var(--surface-subtle); font-size:14px; line-height:22px;
}
[data-route="market"] .market-feature>.icon {
  width:38px; height:38px; padding:9px; border-radius:10px; color:var(--primary); background:var(--primary-soft);
}
[data-route="market"] .market-feature b {color:var(--ink)}
[data-route="market"] .market-feature small {font-size:12px; line-height:20px; color:var(--muted)}
[data-route="market"] .market-search {
  min-height:58px; margin:0; padding:8px; gap:8px; border:1px solid var(--line);
  border-radius:12px; background:var(--surface); color:var(--text);
}
[data-route="market"] .market-search .search-wrap {min-width:200px; max-width:none; flex:1}
[data-route="market"] .market-search .search-wrap>.icon {color:var(--muted)}
[data-route="market"] .market-search input {height:40px; min-height:40px; font-size:13px; line-height:20px; border-color:transparent; background:transparent}
[data-route="market"] .market-search input:hover {border-color:var(--field-hover)}
[data-route="market"] .market-search input:focus {border-color:var(--field-focus)}
[data-route="market"] .market-search .select-control {flex:0 1 112px; min-width:90px; font-size:12px}
[data-route="market"] .market-search .select-trigger {height:38px; padding:5px 8px; border-color:transparent; background:transparent}
[data-route="market"] .market-search .select-trigger:hover {background:var(--primary-soft)}
[data-route="market"] .market-search .select-trigger:focus,
[data-route="market"] .market-search .select-trigger[aria-expanded=true] {border-color:var(--field-focus)}
[data-route="market"] .market-search .btn {min-height:38px; padding:5px 9px; background:var(--surface); border-color:var(--line)}
[data-route="market"] .market-search .btn:hover {background:var(--primary-soft); border-color:var(--primary-focus); color:var(--primary-ink)}
[data-route="market"] .hot-strip {
  align-items:center; flex-wrap:nowrap; min-height:56px; padding:12px 14px; gap:8px;
  margin:18px 0 16px; border:1px solid var(--line); border-radius:8px;
  background:var(--surface-subtle); font-size:11px; line-height:20px;
}
.market-strip-title {display:flex; align-items:center; gap:5px; flex-shrink:0; color:var(--primary-ink); font-size:12px}
.market-strip-title .icon {width:14px; height:14px}
[data-route="market"] .hot-pill {
  display:inline-flex; align-items:center; min-width:0; max-width:220px; flex:0 0 auto;
  min-height:28px; padding:3px 8px; border:1px solid var(--line); border-radius:18px;
  background:var(--surface); font-size:11px; line-height:20px; color:var(--text);
}
[data-route="market"] .hot-pill>span {min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
[data-route="market"] .hot-pill b {width:18px; height:18px; flex-shrink:0; background:var(--primary-soft); color:var(--primary-ink); font-size:11px}
[data-route="market"] .hot-pill:nth-child(n+5) b {background:var(--surface-subtle); color:var(--muted)}
[data-route="market"] .hot-pill:hover {background:var(--primary-soft); color:var(--primary-ink)}
[data-route="market"] .market-tags {gap:8px; align-items:center}
[data-route="market"] .chip {
  max-width:100%; min-height:28px; padding:3px 11px; border:1px solid var(--line);
  background:var(--surface); color:var(--text); font-size:12px; line-height:20px; overflow-wrap:anywhere;
}
[data-route="market"] .chip.active {border-color:var(--primary); background:var(--primary); color:#fff}
[data-route="market"] .market-layout {margin-top:16px; gap:16px; grid-template-columns:184px minmax(0,1fr)}
[data-route="market"] .categories {min-width:0; padding:12px 10px; border-color:var(--line); box-shadow:none}
[data-route="market"] .categories>small {font-size:12px; line-height:20px; color:var(--muted)}
[data-route="market"] .category {min-height:38px; padding:8px; border-radius:8px; gap:8px; font-size:13px; line-height:20px; color:var(--text)}
[data-route="market"] .category>span {min-width:0; overflow-wrap:anywhere}
[data-route="market"] .category .icon {width:15px; height:15px; color:var(--muted)}
[data-route="market"] .category.active {background:var(--primary-soft); color:var(--primary-ink); border-left:2px solid var(--primary)}
[data-route="market"] .category.active .icon {color:var(--primary-ink)}
[data-route="market"] .category-count {display:grid; place-items:center; min-width:24px; height:22px; padding:0 5px; border-radius:12px; background:var(--surface-subtle); color:var(--muted)}
[data-route="market"] .category.active .category-count {background:var(--primary-border); color:var(--primary-ink)}
[data-route="market"] #market-results {min-width:0; container:market-directory / inline-size}
[data-route="market"] .tool-grid {
  display:block; border:1px solid var(--line); border-radius:8px; background:var(--surface); overflow:hidden;
}
[data-route="market"] .tool-list-header,
[data-route="market"] .tool-card {display:grid; grid-template-columns:minmax(0,1fr) 80px 112px 132px 128px; align-items:center; column-gap:20px}
[data-route="market"] .tool-list-header {
  min-height:42px; padding:10px 20px; border-bottom:1px solid var(--line);
  background:var(--surface-subtle); color:var(--muted); font-size:12px; line-height:20px; font-weight:500;
}
[data-route="market"] .tool-list-header>span:first-child {padding-left:52px}
[data-route="market"] .tool-list-header>span:last-child {text-align:right}
[data-route="market"] .tool-card {
  grid-template-areas:"identity status category updated actions"; align-items:center; gap:20px;
  min-height:112px; padding:20px; border:0; border-radius:0; background:transparent;
  transition:background .18s;
}
[data-route="market"] .tool-card+.tool-card {border-top:1px solid var(--line)}
[data-route="market"] .tool-card:hover {background:var(--surface-subtle); box-shadow:none; transform:none}
[data-route="market"] .tool-card-top {grid-area:identity; align-items:flex-start; gap:12px; flex-wrap:nowrap; margin:0}
[data-route="market"] .tool-identity {min-width:0; flex:1}
[data-route="market"] .tool-avatar {width:40px; height:40px; font-size:12px; border-radius:8px; color:#fff}
[data-route="market"] .tool-avatar.tone-0 {background:var(--primary)}
[data-route="market"] .tool-avatar.tone-1 {background:#4d5ce6}
[data-route="market"] .tool-avatar.tone-2 {background:#8848e9}
[data-route="market"] .tool-avatar.tone-3 {background:#0498c2}
[data-route="market"] .tool-avatar.tone-4 {background:#e86b13}
[data-route="market"] .tool-service-meta {grid-area:status; display:flex; align-items:center; min-width:0}
[data-route="market"] .tool-card>.tool-category {grid-area:category}
[data-route="market"] .tool-card .badge {min-height:0; padding:2px 8px; border-radius:4px; font-size:11px; line-height:18px; white-space:nowrap}
[data-route="market"] .tool-card.is-running .badge.green {background:#ecfdf3; color:var(--green)}
[data-route="market"] .tool-card.is-stopped .badge {background:var(--surface-subtle); color:var(--muted)}
.tool-category {min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; line-height:20px; color:var(--muted)}
[data-route="market"] .tool-card h3 {font-size:14px; line-height:22px; margin:0 0 2px; color:var(--ink)}
[data-route="market"] .tool-card .key {font-size:11px; line-height:18px; color:var(--muted); font-weight:400}
[data-route="market"] .tool-desc {font-size:12px; line-height:20px; min-height:0; margin:5px 0 0; color:var(--text); -webkit-line-clamp:2}
[data-route="market"] .function-tags {min-width:0; min-height:0; max-height:48px; margin-top:8px; font-size:11px; line-height:20px; gap:4px; align-content:start; color:var(--muted)}
[data-route="market"] .function-tags span {max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0 6px; border:1px solid var(--line); border-radius:4px; background:var(--surface-subtle)}
[data-route="market"] .tool-updated {grid-area:updated; font-size:11px; line-height:18px; color:var(--muted)}
[data-route="market"] .tool-updated time {white-space:nowrap}
[data-route="market"] .tool-row-actions {grid-area:actions; display:flex; align-items:center; justify-content:flex-end; gap:8px}
[data-route="market"] .tool-row-actions .icon-btn {width:var(--compact-height); height:var(--compact-height); min-height:var(--compact-height); margin:0; padding:6px; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--muted)}
[data-route="market"] .tool-row-actions .icon-btn:hover {border-color:var(--primary-focus); color:var(--primary-ink)}
[data-route="market"] .tool-row-actions .icon-btn .icon {width:16px; height:16px}
[data-route="market"] .tool-row-actions .text-btn {min-height:var(--compact-height); padding:6px 0 6px 4px; gap:4px; font-size:12px; line-height:20px; flex-direction:row-reverse; white-space:nowrap; color:var(--primary-ink); background:transparent}
[data-route="market"] .tool-row-actions .text-btn .icon {width:14px; height:14px}
[data-route="market"] .market-virtual {margin-top:28px; container:market-virtual / inline-size}
[data-route="market"] .market-virtual-heading {display:flex; align-items:center; justify-content:space-between; gap:16px}
[data-route="market"] .market-virtual-heading h2 {font-size:16px; line-height:24px}
[data-route="market"] .market-virtual-heading p {font-size:12px; line-height:20px; margin-top:3px; color:var(--muted)}
[data-route="market"] .market-virtual-items {display:block; margin-top:14px; border:1px solid var(--line); border-radius:8px; background:var(--surface); overflow:hidden}
[data-route="market"] .market-virtual-item {display:grid; grid-template-columns:minmax(0,1fr) 168px 96px 128px; grid-template-areas:"identity summary status actions"; align-items:center; gap:20px; min-height:88px; padding:18px 20px; border:0; border-radius:0; background:transparent}
[data-route="market"] .market-virtual-item+.market-virtual-item {border-top:1px solid var(--line)}
[data-route="market"] .market-virtual-identity {grid-area:identity; display:flex; align-items:center; gap:12px; min-width:0}
[data-route="market"] .market-virtual-identity>div {min-width:0}
[data-route="market"] .market-virtual-icon {display:grid; place-items:center; width:40px; height:40px; flex-shrink:0; border:1px solid var(--primary-border); border-radius:8px; background:var(--primary-soft); color:var(--primary-ink)}
[data-route="market"] .market-virtual-icon .icon {width:20px; height:20px}
[data-route="market"] .market-virtual-item h3 {font-size:14px; line-height:22px; margin:0 0 2px}
[data-route="market"] .market-virtual-item code {display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; line-height:18px; color:var(--muted)}
[data-route="market"] .market-virtual-summary {grid-area:summary; display:flex; flex-wrap:wrap; gap:8px 16px; font-size:12px; line-height:20px; color:var(--muted)}
[data-route="market"] .market-virtual-summary strong {font-weight:600; color:var(--text)}
[data-route="market"] .market-virtual-status {grid-area:status}
[data-route="market"] .market-virtual-status .badge {border-radius:4px; font-size:11px}
[data-route="market"] .market-virtual-item>.btn {grid-area:actions; justify-self:end; margin:0; white-space:nowrap}
[data-route="market"] .market-virtual-empty {display:flex; align-items:center; gap:10px; min-height:76px; margin-top:12px; border-top:1px solid var(--line); color:var(--muted); font-size:13px}
[data-route="market"] .market-virtual-empty .icon {width:20px; height:20px}

@container market-directory (max-width:800px) {
  [data-route="market"] .tool-list-header {grid-template-columns:minmax(0,1fr)}
  [data-route="market"] .tool-list-header>span:first-child {padding-left:0}
  [data-route="market"] .tool-list-header>span:not(:first-child) {display:none}
  [data-route="market"] .tool-card {grid-template-columns:minmax(0,1fr) 128px; grid-template-areas:"identity status" "identity category" "updated actions"; gap:14px 20px}
  [data-route="market"] .tool-service-meta,
  [data-route="market"] .tool-card>.tool-category {justify-self:end; max-width:128px}
  [data-route="market"] .tool-updated {padding-left:52px}
}
@container market-directory (max-width:440px) {
  [data-route="market"] .tool-list-header {padding:10px 16px}
  [data-route="market"] .tool-card {grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"identity identity" "status category" "updated actions"; padding:16px; gap:12px}
  [data-route="market"] .tool-avatar {width:36px; height:36px}
  [data-route="market"] .tool-service-meta {justify-self:start; max-width:100%; padding-left:48px}
  [data-route="market"] .tool-updated {padding:0; font-size:10px; line-height:16px}
  [data-route="market"] .tool-row-actions {gap:6px}
}
@container market-virtual (max-width:800px) {
  [data-route="market"] .market-virtual-item {grid-template-columns:minmax(0,1fr) 128px; grid-template-areas:"identity status" "summary actions"; gap:14px 20px}
  [data-route="market"] .market-virtual-status {justify-self:end}
  [data-route="market"] .market-virtual-summary {padding-left:52px}
}
@container market-virtual (max-width:440px) {
  [data-route="market"] .market-virtual-item {grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"identity identity" "summary status" "actions actions"; padding:16px; gap:12px}
  [data-route="market"] .market-virtual-summary {padding:0; gap:8px}
  [data-route="market"] .market-virtual-item>.btn {justify-self:stretch}
}

@media (max-width:1250px) {
  [data-route="market"] .market-search .search-wrap {flex-basis:100%}
  [data-route="market"] .market-search .select-control {flex:1; min-width:100px}
}
@media (max-width:1020px) {
  .content[data-route="market"] {padding:18px}
  [data-route="market"] .market-aside {display:none}
  [data-route="market"] .market-layout {grid-template-columns:140px minmax(0,1fr)}
}
@media (max-width:760px) {
  .content[data-route="market"] {padding:14px 12px 24px}
  [data-route="market"] .market-banner {padding:18px 14px 14px; border-radius:12px}
  [data-route="market"] .market-banner h2 {font-size:24px; line-height:36px}
  [data-route="market"] .market-banner p {font-size:12px}
  [data-route="market"] .market-top {margin-bottom:16px}
  [data-route="market"] .market-counters {margin-top:16px}
  [data-route="market"] .market-counters>div {min-width:72px; padding:0 12px}
  [data-route="market"] .market-counters strong {font-size:22px}
  [data-route="market"] .market-search {padding:6px; border-radius:8px}
  [data-route="market"] .market-search .search-wrap {min-width:0}
  [data-route="market"] .market-search input {font-size:12px}
  [data-route="market"] .market-search .select-control {flex:1 1 calc(50% - 8px); min-width:0}
  [data-route="market"] .market-search .select-trigger {height:36px}
  [data-route="market"] .market-search .btn {flex:1; min-height:36px}
  [data-route="market"] .hot-strip {margin:14px 0 12px; padding:10px; min-height:50px}
  [data-route="market"] .market-tags {flex-wrap:nowrap; overflow-x:auto; padding:2px 0}
  [data-route="market"] .market-tags .chip {flex-shrink:0; white-space:nowrap}
  [data-route="market"] .market-layout {grid-template-columns:minmax(0,1fr); gap:12px; margin-top:12px}
  [data-route="market"] .categories {padding:5px; gap:4px; max-width:100%; box-shadow:none}
  [data-route="market"] .category {min-height:36px; padding:6px 8px; font-size:12px}
  [data-route="market"] .category>span {white-space:nowrap}
  [data-route="market"] .market-virtual-heading {align-items:flex-start; flex-wrap:wrap; gap:8px}
}
