.explorer-header { width: min(1320px, calc(100% - 48px)); }
.theme-toggle { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: .78rem; font-weight: 700; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent-strong); }
.explorer-main { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.explorer-hero { display: flex; min-height: 250px; align-items: center; justify-content: space-between; gap: 40px; padding: 52px 0 40px; }
.hero-copy-column { max-width: 730px; }
.explorer-hero h1 { margin: 0; font-size: clamp(2.8rem, 6vw, 4.7rem); letter-spacing: -.07em; line-height: 1.02; }
.explorer-hero h1 span { color: var(--accent); }
.explorer-hero .hero-copy { max-width: 630px; margin-top: 17px; font-size: 1rem; }
.eyebrow-dot { display: inline-block; width: 7px; height: 7px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hero-mark { position: relative; display: grid; width: 142px; height: 142px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 36px; background: linear-gradient(145deg, var(--surface), var(--accent-soft)); color: var(--accent); font-size: 5.3rem; font-weight: 300; transform: rotate(3deg); }
.hero-mark span { transform: rotate(-3deg) translateY(-5px); }
.hero-mark i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.hero-mark i:nth-of-type(1) { top: 29px; right: 30px; }
.hero-mark i:nth-of-type(2) { right: 20px; bottom: 40px; width: 5px; height: 5px; background: var(--accent); }
.hero-mark i:nth-of-type(3) { left: 26px; bottom: 30px; width: 6px; height: 6px; background: var(--accent); }

.import-panel, .dataset-summary, .filter-panel, .presets-panel, .results-panel { border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.import-panel { padding: clamp(20px, 4vw, 30px); }
.import-heading-row, .dataset-summary-main, .panel-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.import-heading-row { margin-bottom: 18px; }
.import-panel h2, .dataset-summary h2, .filter-panel h2, .presets-panel h2, .results-panel h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.04em; }
.local-badge, .snapshot-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .73rem; font-weight: 750; white-space: nowrap; }
.local-badge span { font-size: .55rem; }
.dropzone { display: flex; min-height: 103px; align-items: center; gap: 17px; padding: 18px; border: 1px dashed #9fbcc1; border-radius: 13px; background: color-mix(in srgb, var(--accent-soft) 46%, var(--surface)); transition: background .16s ease, border-color .16s ease; }
.dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.upload-icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--accent); font-size: 1.3rem; font-weight: 600; }
.dropzone-copy { display: grid; gap: 5px; margin-right: auto; }
.dropzone-copy strong { font-size: .9rem; }
.dropzone-copy span { color: var(--muted); font-size: .77rem; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-size: .78rem; font-weight: 750; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
:root[data-theme="dark"] .button-primary { color: #102024; }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button-secondary:hover:not(:disabled) { border-color: var(--accent); }
.button-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.button-quiet:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); }
.danger-text { color: var(--warning); }
.file-button { cursor: pointer; }
.dropzone:has(#dataset-file:focus-visible) .file-button { outline: 3px solid var(--blue); outline-offset: 3px; }
.privacy-copy { max-width: 980px; margin: 14px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.import-message, .import-error { min-height: 0; margin: 12px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.5; }
.import-message:empty { display: none; }
.import-error { padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--warning); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.sr-unit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.empty-state { display: grid; justify-items: center; margin: 24px 0 0; padding: 55px 20px 60px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: center; }
.empty-glyph { display: grid; width: 45px; height: 45px; margin-bottom: 16px; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 1.55rem; }
.empty-state h2 { margin: 0 0 9px; font-size: 1.15rem; letter-spacing: -.03em; }
.empty-state p { max-width: 470px; margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.explorer-workspace { display: grid; gap: 18px; margin-top: 20px; }
.explorer-workspace > * { min-width: 0; }
.dataset-summary, .filter-panel, .presets-panel, .results-panel { padding: clamp(19px, 3vw, 27px); }
.dataset-summary-main { align-items: start; }
.snapshot-badge { background: var(--surface-soft); color: var(--muted); }
.source-details { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 16px 22px; margin: 21px 0 0; }
.source-detail { min-width: 0; }
.source-detail dt { margin: 0 0 5px; color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.source-detail dd { overflow-wrap: anywhere; margin: 0; color: var(--ink); font-size: .8rem; line-height: 1.45; }
.source-detail a { font-weight: 650; }
.dataset-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line); }
.panel-heading { margin-bottom: 20px; }
.filter-top-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(170px, .6fr) minmax(250px, 1fr); gap: 16px; align-items: start; }
.field-block label, .facet-field legend, .range-section > legend { display: block; margin-bottom: 8px; font-size: .78rem; font-weight: 750; }
.field-block input, .field-block select, .preset-save-form input, .preset-load-form select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: .82rem; }
.field-block input::placeholder, .preset-save-form input::placeholder { color: var(--muted); opacity: .8; }
.facet-field, .range-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.field-hint { margin-left: 5px; color: var(--muted); font-size: .69rem; font-weight: 450; }
.provider-options { display: flex; max-height: 162px; flex-wrap: wrap; gap: 7px; overflow: auto; padding: 2px 3px 4px 1px; }
.provider-choice, .column-choice { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: .72rem; cursor: pointer; }
.provider-choice:has(input:checked), .column-choice:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); background: var(--accent-soft); color: var(--accent-strong); }
.provider-choice input, .column-choice input, .check-row input { accent-color: var(--accent); }
.provider-choice span { overflow-wrap: anywhere; }
.muted-copy { margin: 0; color: var(--muted); font-size: .75rem; }
.range-section { margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.range-section > legend { float: left; width: 100%; margin-bottom: 12px; }
.range-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); clear: both; gap: 10px; }
.range-card { min-width: 0; margin: 0; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--page); }
.range-card legend { max-width: 100%; padding: 0 3px; font-size: .74rem; font-weight: 750; line-height: 1.4; }
.range-unit { display: inline-block; margin-left: 5px; color: var(--muted); font-size: .64rem; font-weight: 500; }
.range-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-input-label { min-width: 0; color: var(--muted); font-size: .65rem; font-weight: 650; line-height: 1.4; }
.range-input-label input { display: block; width: 100%; min-width: 0; height: 36px; margin-top: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: .79rem; }
.filter-options { display: flex; flex-wrap: wrap; gap: 12px 25px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.check-row { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; flex: 0 0 auto; margin: 2px 0 0; }
.check-row span { display: grid; gap: 3px; }
.check-row strong { font-size: .75rem; }
.check-row small { color: var(--muted); font-size: .67rem; line-height: 1.4; }
.filter-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--warning); font-size: .78rem; }
.criteria-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.criteria-live { min-width: 0; }
.criteria-footer p { margin: 0; color: var(--muted); font-size: .77rem; }
.active-criteria { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.criteria-chip { display: inline-flex; padding: 4px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); font-size: .66rem; line-height: 1.35; }
.text-button { padding: 5px 0 5px 10px; border: 0; background: none; color: var(--accent-strong); font-size: .75rem; font-weight: 750; white-space: nowrap; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.presets-panel { display: grid; grid-template-columns: minmax(200px, .8fr) minmax(220px, 1fr) minmax(270px, 1.15fr); align-items: center; gap: 17px; }
.presets-description h2 { margin-bottom: 5px; font-size: 1.08rem; }
.presets-description .eyebrow { margin-bottom: 8px; }
.presets-description p:last-child { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.preset-save-form, .preset-load-form { display: flex; gap: 7px; }
.preset-save-form input, .preset-load-form select { min-width: 0; }
.preset-load-form select { flex: 1; }
.ranking-panel { padding: clamp(19px, 3vw, 27px); border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.ranking-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ranking-header h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.04em; }
.ranking-mode-field { width: min(250px, 42%); }
.ranking-mode-field label { display: block; margin-bottom: 7px; font-size: .76rem; font-weight: 750; }
.ranking-mode-field select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: .82rem; }
.ranking-guidance { margin: 15px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.priority-panel, .weighted-panel { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.priority-panel-heading h3, .weighted-panel-heading h3 { margin: 0 0 4px; font-size: .95rem; }
.priority-panel-heading p, .weighted-panel-heading p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.priority-list { display: grid; gap: 7px; margin: 13px 0; padding: 0; list-style: none; counter-reset: priority-counter; }
.priority-item { display: flex; min-height: 48px; align-items: center; gap: 12px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--page); }
.priority-number { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); font-size: .7rem; font-weight: 800; }
.priority-name { flex: 1; font-size: .78rem; font-weight: 700; }
.priority-name small { margin-left: 6px; color: var(--muted); font-size: .65rem; font-weight: 500; }
.priority-direction-label, .weight-control-label { display: grid; gap: 4px; color: var(--muted); font-size: .66rem; font-weight: 700; }
.priority-direction-label select, .priority-add-row select, .weight-control-label select, .weight-control-label input { min-height: 34px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: .74rem; }
.priority-actions { display: flex; gap: 4px; }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: .9rem; font-weight: 700; }
.icon-button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.priority-add-row { display: flex; align-items: end; gap: 8px; }
.priority-add-row label { color: var(--muted); font-size: .68rem; font-weight: 700; }
.priority-add-row select { min-width: 0; }
.priority-add-row select:first-of-type { flex: 1; }
.weighted-explanation, .weighted-missing-note { margin: 12px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.weighted-explanation strong { color: var(--ink); }
.weighted-missing-note { color: var(--warning); }
.weighted-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.weighted-card { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--page); }
.weighted-card legend { max-width: 100%; font-size: .7rem; font-weight: 750; line-height: 1.4; }
.weighted-card-controls { display: grid; grid-template-columns: .7fr 1.3fr; gap: 8px; }
.weight-control-label input { width: 100%; min-width: 0; }
.weight-control-label select { width: 100%; min-width: 0; }
.weighted-summary { margin: 13px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.ranking-error { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--warning); font-size: .78rem; }

.results-heading { margin-bottom: 17px; }
.results-heading h2 { display: flex; align-items: center; gap: 9px; }
.result-count { padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .68rem; letter-spacing: 0; }
.results-actions { display: flex; gap: 8px; }
.column-picker { position: relative; margin-bottom: 12px; }
.column-picker summary { width: fit-content; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: .75rem; font-weight: 700; cursor: pointer; }
.column-picker summary:hover { border-color: var(--accent); color: var(--accent-strong); }
.column-options { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 0 4px; }
.table-help { margin: 0 0 8px; color: var(--muted); font-size: .7rem; }
.table-frame { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.results-table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0; font-size: .76rem; }
.results-table th { position: sticky; top: 0; z-index: 1; padding: 0; border-bottom: 1px solid var(--line); background: var(--surface-soft); text-align: left; white-space: nowrap; }
.results-table th:first-child { border-top-left-radius: 9px; }
.results-table th:last-child { border-top-right-radius: 9px; }
.sort-button { display: flex; min-height: 49px; align-items: center; gap: 8px; padding: 9px 11px; border: 0; background: transparent; color: var(--ink); text-align: left; font-size: .72rem; font-weight: 780; }
.sort-button:hover { color: var(--accent-strong); }
.sort-button small { color: var(--muted); font-size: .63rem; font-weight: 500; }
.sort-indicator { color: var(--accent); font-size: .75rem; }
.results-table td { max-width: 280px; padding: 11px; border-bottom: 1px solid var(--line); color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.results-table .numeric-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-empty { height: 100px; color: var(--muted) !important; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 17px; padding-top: 15px; }
.pagination span { min-width: 94px; color: var(--muted); font-size: .75rem; text-align: center; }
.explorer-footer { width: min(1320px, calc(100% - 48px)); margin-top: 34px; }

@media (max-width: 990px) {
  .range-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-top-grid { grid-template-columns: minmax(210px, 1fr) minmax(170px, .7fr); }
  .facet-field { grid-column: 1 / -1; }
  .presets-panel { grid-template-columns: 1fr 1.2fr; }
  .presets-description { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .explorer-header, .explorer-main, .explorer-footer { width: calc(100% - 32px); }
  .explorer-hero { min-height: 0; padding: 48px 0 28px; }
  .hero-mark { width: 85px; height: 85px; border-radius: 23px; font-size: 3.4rem; }
  .hero-mark i:nth-of-type(1) { top: 16px; right: 18px; }
  .hero-mark i:nth-of-type(2) { right: 13px; bottom: 24px; }
  .hero-mark i:nth-of-type(3) { left: 16px; bottom: 18px; }
  .header-links { gap: 11px; }
  .header-links a { font-size: .75rem; }
  .theme-toggle { padding: 7px 8px; font-size: .7rem; }
  .source-details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .range-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .presets-panel { grid-template-columns: 1fr; }
  .presets-description { grid-column: auto; }
  .preset-save-form, .preset-load-form { width: 100%; }
  .weighted-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .priority-item { gap: 8px; }
  .priority-item { flex-wrap: wrap; }
  .priority-name { min-width: 0; flex-basis: calc(100% - 37px); }
  .priority-add-row { flex-wrap: wrap; }
  .priority-actions { margin-left: auto; }
}
@media (max-width: 500px) {
  .explorer-header { min-height: 66px; }
  .wordmark { gap: 7px; font-size: .85rem; }
  .wordmark-mark { width: 27px; height: 27px; }
  .header-links { gap: 8px; }
  .header-links a span { display: none; }
  .explorer-hero { align-items: start; gap: 10px; }
  .explorer-hero h1 { font-size: 2.75rem; }
  .hero-mark { width: 58px; height: 58px; border-radius: 17px; font-size: 2.35rem; }
  .hero-mark i { display: none; }
  .explorer-hero .hero-copy { font-size: .9rem; }
  .import-heading-row { align-items: start; }
  .local-badge { padding: 6px 8px; font-size: .65rem; }
  .dropzone { flex-wrap: wrap; gap: 11px; padding: 14px; }
  .dropzone-copy { width: calc(100% - 58px); margin-right: 0; }
  .dropzone-copy strong { font-size: .8rem; }
  .dropzone-copy span { font-size: .68rem; }
  .file-button { width: 100%; }
  .filter-top-grid { grid-template-columns: 1fr; }
  .facet-field { grid-column: auto; }
  .range-grid { grid-template-columns: 1fr; }
  .range-card { padding: 9px 11px; }
  .filter-options { display: grid; }
  .panel-heading, .results-heading { align-items: flex-start; }
  .results-heading { flex-direction: column; }
  .results-actions, .results-actions button { width: 100%; }
  .criteria-footer { align-items: flex-start; }
  .criteria-footer p { line-height: 1.45; }
  .source-details { grid-template-columns: 1fr 1fr; }
  .site-footer { font-size: .7rem; }
}
