.catalog {
  --background: #0b0f0d;
  --surface: #111713;
  --surface-hover: #182019;
  --line: #29332b;
  --text: #e5e9e3;
  --muted: #aab5a9;
  --primary: #829879;
  min-height: 100dvh;
  font-size: 14px;
  color: var(--text);
  background: var(--background);
}
.catalog :is(button, a, label) { -webkit-tap-highlight-color: rgb(130 152 121 / 22%); }
.catalog svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.catalog-header { min-height: 56px; padding: 8px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.catalog-brand { display: flex; align-items: center; gap: 10px; }
.catalog-brand span { display: grid; line-height: 1.35; }
.catalog-brand small { color: var(--muted); font-size: 11px; }
.connection { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.connection::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--loading); }
.connection[data-state="ready"]::before { background: var(--primary); }
.connection[data-state="error"]::before { background: var(--error); }
.catalog-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100dvh - 56px); }
.catalog-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.catalog-nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border-radius: 8px; color: var(--muted); }
.catalog-nav a:hover { background: var(--surface-hover); }
.catalog-nav a[aria-current] { background: #1c241d; color: #bfcdb9; font-weight: 600; }
.catalog-content { width: min(100%, 1280px); margin: 0 auto; padding: 32px; min-width: 0; }
.catalog-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.catalog-title h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.catalog-title p { margin: 5px 0 0; color: var(--muted); }
.catalog-actions { display: flex; align-items: center; gap: 8px; }
.catalog .button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 12px; font-size: 13px; }
.catalog .button:not(:disabled):hover { border-color: var(--primary); }
.catalog-icon { width: 40px; padding: 0; }
.catalog-filters { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.catalog-filters input { max-width: 384px; min-width: 0; background: var(--surface-hover); font-size: 13px; }
.catalog-filters .muted { font-size: 12px; white-space: nowrap; }
.view-toggle { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-hover); }
.view-toggle button { display: grid; place-items: center; width: 36px; height: 34px; border-radius: 6px; color: var(--muted); }
.view-toggle button[aria-pressed="true"] { color: var(--background); background: var(--primary); }
.catalog-message { margin: 20px 0 0; padding: 28px 16px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.asset-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.asset-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.asset-card:hover { border-color: var(--primary); }
.asset-preview { position: relative; min-height: 118px; display: grid; place-items: center; border-bottom: 1px solid var(--line); background: #0b0f0d; }
.asset-preview img { position: absolute; width: 100%; height: 100%; object-fit: contain; }
.asset-preview svg { width: 36px; height: 36px; color: var(--primary); }
.asset-type { position: absolute; top: 8px; right: 8px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); font-size: 10px; text-transform: uppercase; }
.asset-card-body { flex: 1; padding: 14px; overflow-wrap: anywhere; }
.asset-card-body h2 { margin: 0; font-size: 16px; }
.asset-card-body p { margin: 8px 0 0; }
.asset-details { color: var(--muted); font-size: 12px; }
.asset-status { color: #bfcdb9; font-size: 12px; }
.asset-status[data-status="processing"] { color: var(--loading); }
.asset-card-footer { padding: 10px 14px; border-top: 1px solid var(--line); }
.asset-results.is-table { display: block; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.asset-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13px; }
.asset-table :is(th, td) { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.asset-table th { color: var(--muted); background: var(--surface-hover); font-weight: 600; white-space: nowrap; }
.asset-table tr:last-child td { border-bottom: 0; }
.job-list { display: grid; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.job { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.job p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.job h2 { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.catalog dialog { width: min(540px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: var(--surface); box-shadow: 0 20px 64px rgb(0 0 0 / 48%); }
.catalog dialog::backdrop { background: rgb(0 0 0 / 58%); backdrop-filter: blur(3px); }
.catalog dialog form { display: block; }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; }
.dialog-header { border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 17px; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-body { display: grid; gap: 8px; padding: 16px 18px; }
.dialog-body p { margin: 2px 0 0; }
.dialog-body select { min-height: 40px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); background: var(--surface-hover); font: inherit; }
.file-drop { display: grid; justify-items: center; gap: 4px; padding: 20px 10px; border: 1px dashed var(--primary); border-radius: 8px; background: var(--surface-hover); text-align: center; cursor: pointer; }
.file-drop span { color: var(--muted); overflow-wrap: anywhere; }
.file-drop[data-dragging="true"], .file-drop:has(+ input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-drop[aria-disabled="true"] { opacity: .5; cursor: default; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: 17px; min-height: 17px; accent-color: var(--primary); }
.dialog-body progress { width: 100%; accent-color: var(--primary); }
.dialog-body [data-error="true"] { color: var(--error); }
@media (max-width: 1100px) { .asset-results { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) {
  .catalog-shell { grid-template-columns: minmax(0, 1fr); }
  .catalog-nav { flex-direction: row; flex-wrap: wrap; background: var(--background); padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .catalog-header, .catalog-content { padding-inline: 14px; }
  .catalog-content { padding-block: 18px; }
  .catalog-header small, #asset-count { display: none; }
}
@media (max-width: 490px) { .asset-results { grid-template-columns: minmax(0, 1fr); } }
