/* Components explorer — page styles. Tokens and primitives come from assets/css/site.css. */
.cx-controls { display: grid; gap: 14px; }
.cx-bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.cx-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cx-group[hidden] { display: none; }
.cx-label { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.cx-actions { margin-left: auto; }
.cx-controls .chip, .cx-controls .btn { min-height: 40px; }
.cx-cats-group { align-items: flex-start; }
.cx-cats-group .cx-label { padding-top: 10px; }
.cx-cats { flex: 1 1 300px; min-width: 0; }
.cx-cats.collapsed { max-height: 90px; overflow: hidden; }
.cx-cats .chip.cx-zero { opacity: .5; }
/* while searching, hide empty categories instead of collapsing the list */
.cx-cats.cx-filtered { max-height: none; }
.cx-cats.cx-filtered .chip.cx-zero { display: none; }
.cx-linkbtn { background: none; border: 0; padding: 10px 4px; min-height: 40px; color: var(--link); font: 600 .85rem var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cx-linkbtn[hidden] { display: none; }

.cx-sel { display: inline-flex; align-items: center; gap: 8px; }
.cx-sel select { min-height: 44px; padding: 8px 12px; font: 600 1rem var(--font); color: var(--text-1); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); max-width: 100%; }
.cx-swap { min-width: 44px; justify-content: center; font-size: 1.2rem; }

.cx-status { margin: 18px 0 8px; min-height: 1.5em; }
.cx-status .result-count { margin: 0; }
.cx-warn { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-md); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); color: var(--text-1); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.cx-warn[hidden], #cx-suggest[hidden] { display: none; }
.cx-suggest { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }

/* table */
.cx-table { min-width: 100%; }
.cx-table th[scope="row"] { font-weight: 600; min-width: 150px; max-width: 240px; background: var(--surface); position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--border); }
.cx-table thead th:first-child { position: sticky; left: 0; z-index: 2; }
.cx-table td { min-width: 120px; word-break: break-word; }
.cx-table-tr td.cx-big { min-width: 200px; }
.cx-big { font-size: 1.12rem; font-weight: 600; }
.cx-none { color: var(--text-3); }
.cx-na { color: var(--text-3); opacity: .6; }
.cx-fw { display: inline-block; font-size: .68rem; font-weight: 700; padding: 0 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-3); vertical-align: middle; }
.cx-sub { font-size: .76rem; font-weight: 500; color: var(--text-3); margin-top: 2px; }
.cx-hint { font-size: .78rem; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.cx-name { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; text-align: left; background: none; border: 0; padding: 6px 0; min-height: 40px; font: inherit; font-weight: 650; color: var(--text-1); cursor: pointer; }
.cx-name:hover { color: var(--link); }
.cx-chev { flex: none; width: 7px; height: 7px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; }
.cx-name[aria-expanded="true"] .cx-chev { transform: rotate(45deg); }

/* detail */
.cx-detail > td { background: var(--surface-2); padding: 14px 16px; }
.cx-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; }
.cx-d-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; word-break: break-word; }
.cx-detail-more { margin: 12px 0 0; }
.cx-card > .cx-detail { margin: 12px -16px -16px; padding: 14px 16px; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* cards */
.cx-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.cx-card-head { display: flex; justify-content: space-between; gap: 8px; }
.cx-card .cx-name { font-size: 1.05rem; }
.cx-dl { margin: 8px 0 0; display: grid; gap: 6px; }
.cx-dl-row { display: grid; grid-template-columns: 10em 1fr; gap: 8px; align-items: baseline; }
.cx-dl dt, .cx-dl dd { margin: 0; }
.cx-dl dd { min-width: 0; word-break: break-word; }
.cx-tr { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 10px; }
.cx-tr > div { min-width: 0; word-break: break-word; }
.cx-arrow { font-size: 1.4rem; color: var(--text-3); }

.cx-more { margin: 18px 0 0; text-align: center; }
.cx-more:empty { display: none; }

/* skeleton */
.cx-skels { display: grid; gap: 10px; }
.cx-skel-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.cx-skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .cx-skel { animation: cx-shimmer 1.2s linear infinite; }
}
@keyframes cx-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 560px) {
  .cx-actions { margin-left: 0; }
  .cx-sel { width: 100%; }
  .cx-sel select { flex: 1; }
  .cx-swap { align-self: flex-end; }
  .cx-tr { grid-template-columns: 1fr; }
  .cx-arrow { transform: rotate(90deg); justify-self: start; }
}
