/* DatasetsDB public catalog: dataset listing and dataset pages. Builds on tokens from app.css. */

/* listing layout */
.hub { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; align-items: start; max-width: 1400px; }
.hub-side { padding: 28px 28px 48px 0; border-right: 1px solid var(--line); min-height: calc(100vh - 64px); background: linear-gradient(to right, var(--bg), var(--panel-2)); display: grid; gap: 22px; align-content: start; }
.hub-main { padding: 28px 0 64px 28px; min-width: 0; }
.hub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.hub-top h1 { font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; }
.hub-top h1 span { color: var(--faint); font-weight: 400; font-size: 17px; }
.hub-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-filter .input { width: 200px; }
.hub-filter .sort { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.hub-filter .sort select { width: auto; }
@media (max-width: 900px) {
  .hub { grid-template-columns: minmax(0, 1fr); }
  .hub-side { padding: 20px 0 4px; border-right: 0; min-height: 0; background: none; gap: 14px; }
  .hub-main { padding: 16px 0 56px; }
  .hub-filter, .hub-filter .input { width: 100%; }
  .hub-filter .sort { width: 100%; } .hub-filter .sort select { flex: 1; }
}

/* facets + chips */
.facet h2 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 15px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; transition: border-color .12s, background .12s, color .12s; }
.chip:hover { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.chip small { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.chip em { font-style: normal; color: var(--faint); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--ink-text); }
.chip.on small { color: inherit; opacity: .7; }
.chip.c-task::before, .chip.c-kind::before, .chip.c-lang::before, .chip.c-lic::before { content: ""; width: 8px; height: 8px; border-radius: 3px; flex: none; }
.chip.c-task::before { background: #f59e0b; } .chip.c-kind::before { background: #3b82f6; }
.chip.c-lang::before { background: #10b981; border-radius: 50%; } .chip.c-lic::before { background: #9ca3af; }

/* dataset cards */
.ds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1100px) { .ds-grid { grid-template-columns: minmax(0, 1fr); } }
.ds-card { display: block; padding: 10px 14px 11px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(to right, var(--panel-2), var(--panel)); transition: box-shadow .15s, border-color .15s; min-width: 0; }
.ds-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.ds-card header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ds-card h3 { font: 500 15px/1.5 var(--mono); letter-spacing: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ds-card h3 b { color: var(--text); font-weight: 600; }
.ds-card:hover h3 b { color: #c2410c; }
:root[data-theme="dark"] .ds-card:hover h3 b { color: var(--yellow); }
.ds-ico { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; flex: none; background: #fee2e2; color: #dc2626; }
.ds-ico.k-site { background: #dbeafe; color: #2563eb; }
.ds-ico svg { width: 13px; height: 13px; }
.ds-meta { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; color: var(--faint); font-size: 14px; }
.ds-meta span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ds-meta svg { width: 13px; height: 13px; flex: none; }
.ds-meta .sep { color: var(--line-2); }
.ds-meta .viewer { color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; font-size: 15px; }
.pager a { color: var(--text); padding: 6px 10px; border-radius: 8px; } .pager a:hover { background: var(--panel-2); }
.pager span { color: var(--faint); padding: 6px 10px; } .pager b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* dataset page */
.ds-head { border-bottom: 1px solid var(--line); background: linear-gradient(var(--panel-2), var(--bg)); padding-top: 28px; }
.ds-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-title .ds-ico { width: 26px; height: 26px; border-radius: 7px; } .ds-title .ds-ico svg { width: 16px; height: 16px; }
.ds-title h1 { font: 500 22px/1.3 var(--mono); letter-spacing: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ds-title h1 a { color: var(--muted); } .ds-title h1 a:hover { color: var(--text); text-decoration: underline; }
.ds-title h1 span { color: var(--faint); } .ds-title h1 b { font-weight: 600; }
.like { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 0 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 15px; overflow: hidden; }
.like svg { width: 14px; height: 14px; }
.like b { height: 100%; display: grid; place-items: center; padding: 0 10px; border-left: 1px solid var(--line); background: var(--panel-2); font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.like:hover { border-color: var(--line-2); } .like.on svg { fill: #ef4444; color: #ef4444; }
.ds-name { margin-top: 8px; color: var(--muted); }
.ds-head .chips { margin-top: 14px; }
.ds-tabs { display: flex; gap: 4px; margin-top: 22px; overflow-x: auto; scrollbar-width: none; }
.ds-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.ds-tabs a svg { width: 15px; height: 15px; }
.ds-tabs a:hover { color: var(--text); }
.ds-tabs a.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.ds-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; padding-top: 28px; padding-bottom: 72px; align-items: start; }
.ds-body.wide { grid-template-columns: minmax(0, 1fr); max-width: 1400px; }
.ds-main { min-width: 0; }
@media (max-width: 980px) { .ds-body { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

.ds-card-body h2 { margin-top: 28px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.ds-card-body h2:first-child { margin-top: 0; }
.ds-card-body p { color: var(--text); overflow-wrap: anywhere; }
.facts { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; } .facts > div:nth-child(odd) { background: var(--panel-2); }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; font-variant-numeric: tabular-nums; }

.ds-side { display: grid; gap: 12px; min-width: 0; }
.ds-side h2 { font-size: 16px; margin-top: 12px; letter-spacing: 0; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kpis > div { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; } .kpis > div:last-child { border-right: 0; }
.kpis small { display: block; color: var(--faint); font-size: 13px; } .kpis b { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.snip small { display: block; font-family: var(--mono); font-size: 12px; color: var(--faint); margin-bottom: 4px; }
.snip pre.code { padding: 10px 12px; font-size: 12.5px; background: var(--panel-2); }
.side-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-files a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.side-files a:hover { color: var(--text); text-decoration: underline; } .side-files svg { width: 14px; height: 14px; }

.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 18px minmax(0, 220px) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.files li:last-child { border-bottom: 0; } .files li:hover { background: var(--panel-2); }
.files svg { width: 16px; height: 16px; color: var(--faint); } .files .btn svg { color: inherit; width: 14px; height: 14px; }
.files b { font: 500 14px var(--mono); } .files a:hover b { text-decoration: underline; }
.files .muted { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .files li { grid-template-columns: 18px minmax(0, 1fr) auto; } .files .muted { display: none; } }

/* viewer */
.viewer-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.viewer-bar form { flex: 1; min-width: 180px; max-width: 340px; }
.t.viewer { font-size: 14px; table-layout: auto; }
.t.viewer th { text-transform: none; letter-spacing: 0; font: 600 13px var(--mono); color: var(--text); background: var(--panel-2); border-right: 1px solid var(--line); padding: 8px 12px; }
.t.viewer th small { display: block; font-weight: 400; color: var(--faint); font-size: 12px; }
.t.viewer td { padding: 8px 12px; border-right: 1px solid var(--line); min-width: 110px; max-width: 460px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
.t.viewer th:last-child, .t.viewer td:last-child { border-right: 0; }
.cellclip { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.t.viewer .n { color: #2563eb; } .t.viewer .null { color: var(--faint); font-style: italic; }

/* trending strip on the landing page */
.trend-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.trend-head h2 { font-size: 22px; }

.verified-note { color: var(--ok); } .ds-title .badge { align-self: center; }
