:root {
  color-scheme: dark;
  --bg: #080b10;
  --surface: #111822;
  --surface-strong: #172231;
  --surface-soft: #0d131b;
  --panel-bg: rgba(17, 24, 34, 0.94);
  --text: #eaf0f6;
  --muted: #96a6b7;
  --line: #273545;
  --accent: #f4cf57;
  --accent-strong: #ffe58b;
  --good: #69d48f;
  --bad: #ff7676;
  --button-active-text: #16130a;
  --input-placeholder: #657789;
  --code-bg: #070a0f;
  --code-text: #dbe7f2;
  --image-bg: #f5f7f9;
  --swatch-border: rgba(255, 255, 255, 0.35);
  --tag-text: #ccd7e3;
  --tag-type-text: #bae6fd;
  --tag-article-text: #e5edf5;
  --tag-year-text: #fde68a;
  --tag-theme-text: #ddd6fe;
  --tag-quantity-text: #bbf7d0;
  --tag-role-text: #fed7aa;
  --tag-version-text: #fbcfe8;
  --tag-color-text: #ccfbf1;
  --tag-link-text: #f8df86;
  --tag-source-text: #bfd0df;
  --tag-usage-text: #c7d2fe;
  --badge-bg: rgba(15, 23, 42, 0.9);
  --badge-border: rgba(148, 163, 184, 0.32);
  --badge-text: #f8df86;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --surface-soft: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.96);
  --text: #1f2933;
  --muted: #5d6b7c;
  --line: #d6e0ea;
  --accent: #d3a91b;
  --accent-strong: #846200;
  --good: #247a45;
  --bad: #be3434;
  --button-active-text: #1f2933;
  --input-placeholder: #78889a;
  --code-bg: #f3f6fa;
  --code-text: #1f2933;
  --image-bg: #f8fafc;
  --swatch-border: rgba(31, 41, 51, 0.22);
  --tag-text: #35465a;
  --tag-type-text: #075985;
  --tag-article-text: #334155;
  --tag-year-text: #7a5700;
  --tag-theme-text: #5b21b6;
  --tag-quantity-text: #146c43;
  --tag-role-text: #9a3412;
  --tag-version-text: #9d174d;
  --tag-color-text: #0f766e;
  --tag-link-text: #7a5700;
  --tag-source-text: #526276;
  --tag-usage-text: #3730a3;
  --badge-bg: rgba(255, 255, 255, 0.92);
  --badge-border: rgba(132, 98, 0, 0.24);
  --badge-text: #7a5700;
  --shadow: 0 18px 40px rgba(72, 88, 108, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 24px;
  line-height: 1.16;
}

h3 {
  font-size: 17px;
}

h4 {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.api-status {
  align-self: end;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  justify-content: center;
  justify-self: start;
  min-height: 40px;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
  width: 74px;
}

.theme-toggle {
  align-items: center;
  align-self: end;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 6px;
  color: var(--tag-year-text);
  display: inline-flex;
  height: 40px;
  justify-content: center;
  justify-self: start;
  min-height: 40px;
  min-width: 40px;
  padding: 0;
  width: 40px;
}

.theme-toggle svg {
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 19px;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: 2px solid rgba(244, 207, 87, 0.18);
  outline-offset: 1px;
}

.theme-toggle[data-active-theme="light"] {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.28);
  color: var(--tag-usage-text);
}

.api-status.ok {
  color: var(--good);
}

.api-status.bad {
  color: var(--bad);
}

.catalog-shell {
  margin: 0 auto;
  max-width: 1840px;
  padding: 14px clamp(12px, 3vw, 34px) 42px;
}

.search-panel,
.detail-panel,
.catalog-card,
.source-block,
.media-card,
.metric,
.kv,
.row,
.raw-item,
.source-summary-row {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  margin-bottom: 16px;
  padding: 14px;
}

.search-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns:
    80px
    minmax(130px, 170px)
    minmax(150px, 220px)
    minmax(100px, 130px)
    minmax(140px, 190px)
    minmax(160px, 300px)
    max-content
    74px
    40px;
}

.search-form button[type="submit"] {
  justify-self: start;
}

.search-logo-link {
  align-self: center;
  display: block;
  height: 80px;
  transform: translateY(8px);
  width: 80px;
}

.search-logo {
  display: block;
  height: 80px;
  object-fit: contain;
  width: 80px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.filter-field {
  min-width: 0;
  position: relative;
}

.filter-combobox {
  min-width: 0;
  position: relative;
}

.filter-trigger {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
  padding: 7px 8px;
  text-align: left;
  width: 100%;
}

.filter-trigger.active {
  border-color: rgba(244, 207, 87, 0.42);
}

.filter-trigger-value {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.filter-trigger-value .filter-option-count {
  display: none;
}

.filter-trigger-caret {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

.filter-menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  gap: 4px;
  left: 0;
  max-height: min(340px, 58vh);
  min-width: min(280px, 86vw);
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.filter-combobox.open .filter-menu {
  display: grid;
}

.filter-menu[hidden] {
  display: none;
}

.filter-option {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: 34px;
  padding: 5px;
  text-align: left;
}

.filter-option:hover,
.filter-option:focus-visible,
.filter-option.selected {
  background: var(--surface-soft);
  border-color: var(--line);
}

.filter-option-chip {
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  color: var(--tag-text);
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  gap: 5px;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  padding: 4px 7px;
}

.filter-option-chip span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-option-chip .swatch {
  flex: 0 0 12px;
  height: 12px;
  width: 12px;
}

.filter-option-count {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  color: var(--badge-text);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1;
  min-width: 26px;
  padding: 4px 7px;
  text-align: center;
}

.filter-option-mark {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.filter-option-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}

input,
select,
button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
}

button {
  cursor: pointer;
}

button:hover,
button:focus-visible,
input:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(244, 207, 87, 0.18);
  outline-offset: 1px;
}

::placeholder {
  color: var(--input-placeholder);
}

.catalog-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
}

.catalog-layout.browse-mode {
  grid-template-columns: minmax(0, 1fr);
}

.catalog-layout.browse-mode .detail-panel {
  display: none;
}

.catalog-layout.detail-mode {
  grid-template-columns: 1fr;
}

.catalog-layout.detail-mode .catalog-results-panel {
  display: none;
}

.section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.muted,
.meta,
.breadcrumb {
  color: var(--muted);
}

.breadcrumb {
  overflow-wrap: anywhere;
}

.card-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.catalog-sections {
  display: grid;
  gap: 18px;
}

.catalog-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.catalog-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.catalog-matrix {
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

.pager {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  grid-column: 1 / -1;
  justify-content: center;
  padding: 8px 0;
}

.pager button {
  min-width: 92px;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.page-size-control {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 6px;
}

.page-size-control span {
  white-space: nowrap;
}

.page-size-control select {
  min-height: 34px;
  width: auto;
}

.catalog-card {
  cursor: pointer;
  display: grid;
  gap: 9px;
  min-height: 0;
  padding: 10px;
  text-align: left;
}

.catalog-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.thumb,
.placeholder {
  align-items: center;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(244, 207, 87, 0.16), rgba(87, 199, 178, 0.08)),
    var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.thumb img {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.placeholder {
  color: var(--muted);
  font-weight: 700;
  padding: 8px;
}

.card-title {
  display: grid;
  gap: 4px;
}

.card-title strong {
  overflow-wrap: anywhere;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 8px;
}

.detail-panel {
  align-self: start;
  min-height: 560px;
  padding: 14px;
}

.entity-head {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 380px) minmax(0, 1fr);
}

.hero-thumb {
  aspect-ratio: 1 / 1;
}

.entity-head-media {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.entity-head-media-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entity-head-media-grid.media-count-1 {
  grid-template-columns: 1fr;
}

.entity-head-media-grid.media-count-3 .entity-head-media-slot:first-child {
  grid-row: span 2;
}

.entity-head-thumb,
.entity-head-placeholder,
.entity-head-viewer {
  aspect-ratio: 1 / 1;
  border-radius: 7px;
  min-height: 0;
  width: 100%;
}

.entity-head-placeholder {
  grid-column: 1 / -1;
}

.entity-head-content {
  align-content: start;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.entity-head-content h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.entity-head-facts {
  max-width: 100%;
}

.entity-head-facts .entity-info-tag {
  font-size: 11px;
  min-height: 24px;
}

.entity-fact-detail {
  display: inline-flex;
  min-width: 0;
  position: relative;
}

.entity-fact-detail > summary {
  cursor: pointer;
  display: inline-flex;
  list-style: none;
}

.entity-fact-detail > summary::-webkit-details-marker {
  display: none;
}

.entity-fact-detail[open] {
  z-index: 5;
}

.entity-fact-popover {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 12px;
  left: 0;
  line-height: 1.35;
  max-width: min(360px, 80vw);
  min-width: 180px;
  padding: 8px 10px;
  position: absolute;
  top: calc(100% + 6px);
  white-space: normal;
}

.entity-fact-popover-tags {
  max-height: 220px;
  min-width: min(260px, 74vw);
  overflow: auto;
}

.entity-fact-popover-tags .entity-info-tag {
  font-size: 11px;
}

.entity-head-media-more {
  align-self: start;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  padding: 5px 8px;
  width: fit-content;
}

.entity-head-media-more:hover,
.entity-head-media-more:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(244, 207, 87, 0.18);
  outline-offset: 1px;
  text-decoration: none;
}

.entity-head-media-drawer {
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  padding-top: 12px;
}

.entity-head-media-drawer[hidden] {
  display: none;
}

.entity-head-drawer-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.entity-head-drawer-head h3 {
  margin: 0;
}

.entity-head-drawer-close {
  min-height: 30px;
  padding: 5px 9px;
}

.entity-head-media-drawer .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.detail-media {
  margin: 12px 0;
}

.detail-grid,
.row-list,
.raw-list {
  display: grid;
  gap: 8px;
}

.dense-list {
  max-height: 620px;
  overflow: auto;
}

.kv-grid,
.metric-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 12px;
}

.kv-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.metric {
  padding: 10px;
}

.metric strong {
  display: block;
  font-size: 19px;
}

.metric span {
  color: var(--muted);
}

.kv,
.row,
.raw-item,
.source-summary-row {
  box-shadow: none;
  padding: 9px;
}

.row strong,
.kv strong,
.raw-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.kv span,
.row span {
  overflow-wrap: anywhere;
}

.detail-section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 14px;
}

.detail-section h3 {
  margin-bottom: 10px;
}

.instruction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.instruction-action {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  display: grid;
  gap: 2px;
  min-height: 40px;
  min-width: min(100%, 220px);
  padding: 8px 10px;
}

.instruction-action:hover,
.instruction-action:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(244, 207, 87, 0.18);
  outline-offset: 1px;
  text-decoration: none;
}

.instruction-action span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.section-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-line h3 {
  margin-bottom: 0;
}

.tab-bar {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-bottom: 10px;
}

.tab-button {
  min-height: 34px;
  padding: 6px 10px;
}

.tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--button-active-text);
  font-weight: 800;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.color-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.color-row {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 9px;
}

.color-row .meta {
  grid-column: 2;
}

.swatch {
  border: 1px solid var(--swatch-border);
  border-radius: 50%;
  display: inline-block;
  height: 24px;
  width: 24px;
}

.id-strip {
  margin-top: 10px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  padding: 6px 10px;
}

.tag span {
  color: var(--muted);
  margin-left: 6px;
}

.media-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.version-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.version-button {
  align-items: start;
  display: grid;
  gap: 3px;
  min-height: 48px;
  min-width: 130px;
  text-align: left;
}

.version-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--button-active-text);
  font-weight: 800;
}

.version-button span {
  color: inherit;
  font-size: 12px;
  opacity: 0.82;
}

.inventory-version-panel {
  display: none;
}

.inventory-version-panel.active {
  display: block;
}

.inventory-version-summary {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 8px 10px;
}

.inventory-version-summary span {
  color: var(--muted);
}

.inventory-role-block {
  display: grid;
  gap: 10px;
}

.spare-section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.spare-section h4 {
  color: var(--text);
  font-size: 15px;
  margin: 0;
  text-transform: none;
}

.inventory-grid,
.entity-card-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}

.entity-card-grid.technical-matrix {
  grid-template-columns: repeat(auto-fill, minmax(208px, 1fr));
}

.inventory-card,
.entity-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 8px;
}

.entity-card-grid.technical-matrix .entity-card {
  grid-template-rows: auto 1fr;
}

.catalog-mini-card .entity-thumb {
  background:
    linear-gradient(135deg, rgba(245, 247, 249, 0.96), rgba(221, 228, 235, 0.96)),
    #f5f7f9;
}

.entity-card-image-link {
  color: inherit;
  display: block;
}

.entity-card-image-link:hover {
  text-decoration: none;
}

.inventory-card:hover,
.entity-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.inventory-image,
.entity-card-image {
  position: relative;
}

.inventory-thumb,
.entity-thumb {
  aspect-ratio: 1 / 1;
  background: var(--image-bg);
}

.part-color-card .entity-thumb,
.print-card .entity-thumb {
  background:
    linear-gradient(135deg, rgba(245, 247, 249, 0.96), rgba(221, 228, 235, 0.96)),
    #f5f7f9;
}

.color-thumb {
  align-items: center;
  display: flex;
  justify-content: center;
}

.color-thumb-swatch {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(8, 11, 16, 0.18);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 8px 18px rgba(8, 11, 16, 0.18);
  display: block;
  width: 62%;
}

.qty-badge {
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 6px;
  color: var(--badge-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
  position: absolute;
  right: 6px;
  box-shadow: 0 6px 14px rgba(8, 11, 16, 0.28);
  top: 6px;
}

.inventory-card-body,
.entity-card-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.inventory-card-body strong,
.entity-card-body strong {
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.22;
  min-height: 30px;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.entity-card-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.2;
  min-width: 0;
}

.entity-card-title-link {
  color: var(--text);
}

.entity-card-title-link:hover {
  color: var(--accent-strong);
}

.inventory-meta,
.entity-card-meta {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr);
}

.inventory-meta .swatch,
.entity-card-meta .swatch {
  height: 16px;
  width: 16px;
}

.inventory-meta span,
.entity-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.entity-info-tags {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.entity-card-tags {
  align-content: flex-start;
}

.seo-link-facts.entity-info-tags {
  display: inline-flex;
  margin-left: 6px;
  vertical-align: middle;
}

.entity-info-tag {
  align-items: center;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  color: var(--tag-text);
  display: inline-flex;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.15;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 4px 7px;
}

.tag-tone-0 {
  background: rgba(148, 163, 184, 0.13);
  border-color: rgba(148, 163, 184, 0.28);
}

.tag-tone-1 {
  background: rgba(156, 163, 175, 0.13);
  border-color: rgba(156, 163, 175, 0.28);
}

.tag-tone-2 {
  background: rgba(161, 161, 170, 0.13);
  border-color: rgba(161, 161, 170, 0.28);
}

.tag-tone-3 {
  background: rgba(120, 113, 108, 0.13);
  border-color: rgba(120, 113, 108, 0.28);
}

.tag-tone-4 {
  background: rgba(100, 116, 139, 0.13);
  border-color: rgba(100, 116, 139, 0.28);
}

.tag-tone-5 {
  background: rgba(115, 115, 115, 0.13);
  border-color: rgba(115, 115, 115, 0.28);
}

.entity-card-tags .entity-info-tag.type,
.entity-card-tags .entity-info-tag.article {
  font-size: 10.5px;
  padding: 3px 6px;
}

.entity-info-tag.type {
  background: rgba(56, 189, 248, 0.13);
  border-color: rgba(56, 189, 248, 0.28);
  color: var(--tag-type-text);
}

.entity-info-tag.article {
  background: rgba(226, 232, 240, 0.11);
  border-color: rgba(226, 232, 240, 0.24);
  color: var(--tag-article-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.entity-info-tag.year {
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.3);
  color: var(--tag-year-text);
}

.entity-info-tag.theme {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.32);
  color: var(--tag-theme-text);
}

.entity-info-tag.quantity {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
  color: var(--tag-quantity-text);
}

.entity-info-tag.role {
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.28);
  color: var(--tag-role-text);
}

.entity-info-tag.version {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.26);
  color: var(--tag-version-text);
}

.entity-info-tag.color {
  align-items: center;
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.24);
  color: var(--tag-color-text);
  display: inline-flex;
  gap: 5px;
  overflow-wrap: normal;
}

.entity-info-tag.color .swatch {
  flex: 0 0 12px;
  height: 12px;
  width: 12px;
}

.entity-info-tag.color span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-info-tag-link {
  border-color: rgba(244, 207, 87, 0.38);
  color: var(--tag-link-text);
}

.entity-info-tag-link:hover,
.entity-info-tag-link:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(244, 207, 87, 0.18);
  outline-offset: 1px;
  text-decoration: none;
}

.search-active-filters {
  display: inline-flex;
  margin-left: 8px;
  vertical-align: middle;
}

.entity-info-tag.source {
  background: rgba(148, 163, 184, 0.11);
  color: var(--tag-source-text);
}

.entity-info-tag.usage {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.28);
  color: var(--tag-usage-text);
}

.entity-fact-popover-tags .entity-info-tag.tag-tone-0,
.filter-option-chip.tag-tone-0 {
  background: rgba(148, 163, 184, 0.13);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--tag-text);
}

.entity-fact-popover-tags .entity-info-tag.tag-tone-1,
.filter-option-chip.tag-tone-1 {
  background: rgba(156, 163, 175, 0.13);
  border-color: rgba(156, 163, 175, 0.28);
  color: var(--tag-text);
}

.entity-fact-popover-tags .entity-info-tag.tag-tone-2,
.filter-option-chip.tag-tone-2 {
  background: rgba(161, 161, 170, 0.13);
  border-color: rgba(161, 161, 170, 0.28);
  color: var(--tag-text);
}

.entity-fact-popover-tags .entity-info-tag.tag-tone-3,
.filter-option-chip.tag-tone-3 {
  background: rgba(120, 113, 108, 0.13);
  border-color: rgba(120, 113, 108, 0.28);
  color: var(--tag-text);
}

.entity-fact-popover-tags .entity-info-tag.tag-tone-4,
.filter-option-chip.tag-tone-4 {
  background: rgba(100, 116, 139, 0.13);
  border-color: rgba(100, 116, 139, 0.28);
  color: var(--tag-text);
}

.entity-fact-popover-tags .entity-info-tag.tag-tone-5,
.filter-option-chip.tag-tone-5 {
  background: rgba(115, 115, 115, 0.13);
  border-color: rgba(115, 115, 115, 0.28);
  color: var(--tag-text);
}

.entity-info-tag.muted {
  opacity: 0.72;
}

.entity-relation-path {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.path-node {
  align-items: center;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 32px;
  font-size: 10px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  line-height: 1;
  overflow: hidden;
  padding: 0;
  width: 32px;
}

.path-node .thumb,
.path-node .placeholder,
.path-node-thumb {
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 5px;
  height: 100%;
  padding: 0;
  width: 100%;
}

.path-node-fallback {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(244, 207, 87, 0.16), rgba(87, 199, 178, 0.08)),
    var(--surface-soft);
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  height: 100%;
  justify-content: center;
  width: 100%;
}

.path-separator {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  margin: 0;
}

.media-card {
  box-shadow: none;
  display: grid;
  gap: 8px;
  grid-template-rows: auto 1fr;
  padding: 8px;
}

.media-thumb {
  aspect-ratio: 1 / 1;
}

.ldraw-viewer {
  background: var(--image-bg);
  position: relative;
}

.ldraw-viewer canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.ldraw-viewer-reset {
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 32px;
}

.ldraw-viewer-reset svg {
  fill: var(--text);
  height: 18px;
  width: 18px;
}

.ldraw-viewer-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  left: 10px;
  position: absolute;
  top: 10px;
}

.ldraw-viewer[data-ldraw-state="ready"] .ldraw-viewer-status {
  display: none;
}

.ldraw-viewer[data-ldraw-state="error"] {
  background:
    linear-gradient(135deg, rgba(221, 80, 80, 0.12), rgba(255, 255, 255, 0.4)),
    #f5f7f9;
}

.media-body {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.source-summary {
  display: grid;
  gap: 8px;
}

.source-summary-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) minmax(220px, 2fr);
}

.source-list {
  display: grid;
  gap: 12px;
}

.source-block {
  box-shadow: none;
  padding: 0;
}

.source-block > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 210px) minmax(180px, 1fr) minmax(240px, 2fr);
  padding: 12px;
}

.source-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 12px;
}

.source-wide {
  grid-column: 1 / -1;
}

.split-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.raw-item summary {
  cursor: pointer;
}

.raw-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--code-text);
  margin: 8px 0 0;
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty,
.error {
  color: var(--muted);
  padding: 14px 0;
}

.error {
  color: var(--bad);
}

@media (max-width: 1180px) {
  .catalog-layout,
  .entity-head,
  .source-grid,
  .split-grid,
  .search-form,
  .source-summary-row,
  .source-block > summary {
    grid-template-columns: 1fr;
  }

  .search-logo-link {
    transform: none;
  }
}
