:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --text: #1c2733;
  --muted: #66758a;
  --border: #d9e1e9;
  --border-light: #eef1f5;
  --hover: #f6f9fb;
  --accent: #0f766e;
  --accent-strong: #0b5d56;
  --accent-soft: #e0f2ef;
  --accent-text: #0f766e;
  --star: #d97706;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #16213a;
  --text: #e4ecf4;
  --muted: #93a5bd;
  --border: #2b3a52;
  --border-light: #223047;
  --hover: #1b2a45;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-text: #5eead4;
  --star: #fbbf24;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #ffffff;
  background: var(--accent);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  white-space: nowrap;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.stats {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
  min-width: 0;
}

.stat {
  min-width: 58px;
}

.stat b {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 12px;
  color: var(--muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* Controls */
.controls {
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) 1fr 0.8fr 1.4fr 1fr auto;
  gap: 14px 12px;
  align-items: end;
  padding: 18px 24px 4px;
}

.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

input[type="search"],
input[type="number"],
select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

#searchInput {
  padding-left: 36px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--muted);
}

.range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-inputs span {
  color: var(--muted);
  font-size: 12px;
}

.range-inputs input {
  min-width: 0;
  width: 100%;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.check svg {
  color: var(--muted);
}

.check input {
  display: none;
}

.check input:checked + svg {
  color: var(--star);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
}

.btn.ghost {
  background: transparent;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.pv-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pv-toggle.active svg {
  color: #ffffff;
}

/* Results */
.result-panel {
  margin: 12px 24px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-light);
}

.result-count {
  color: var(--muted);
  font-size: 13px;
}

.result-count b {
  color: var(--text);
}

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

.page-size select {
  width: auto;
  height: 32px;
  padding: 0 8px;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 300px);
}

.journal-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
}

.journal-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.journal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.journal-table tbody tr {
  cursor: pointer;
}

.journal-table tbody tr:hover {
  background: var(--hover);
}

.th-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-weight: inherit;
}

.th-btn.active {
  color: var(--accent-text);
}

.sort-arrow {
  width: 10px;
  font-size: 11px;
}

.th-fav {
  width: 44px;
}

.th-compare {
  width: 52px;
}

.th-action {
  width: 78px;
}

.compare-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.name-cell .journal-name {
  font-weight: 600;
  line-height: 1.35;
}

.journal-zh {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  color: var(--muted);
}

.if-cell {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.if-value {
  display: inline-block;
  min-width: 42px;
}

.trend {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend.up {
  color: #15803d;
}

.trend.down {
  color: #dc2626;
}

.trend.flat {
  color: var(--muted);
}

[data-theme="dark"] .trend.up {
  color: #4ade80;
}

[data-theme="dark"] .trend.down {
  color: #f87171;
}

.cat-cell {
  white-space: nowrap;
}

.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  vertical-align: 1px;
}

.q-badge {
  display: inline-block;
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.q-q1 {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.q-q2 {
  background: #e0f2fe;
  color: #0369a1;
}

.q-q3 {
  background: #fef3c7;
  color: #b45309;
}

.q-q4 {
  background: #ffe4e6;
  color: #be123c;
}

.q-na {
  background: #eef1f5;
  color: var(--muted);
}

[data-theme="dark"] .q-q2 {
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
}

[data-theme="dark"] .q-q3 {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

[data-theme="dark"] .q-q4 {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
}

[data-theme="dark"] .q-na {
  background: rgba(148, 163, 184, 0.16);
  color: #94a3b8;
}

.oa-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}

.fast-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}

.predict-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ede9fe;
  color: #6d28d9;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  white-space: nowrap;
}

[data-theme="dark"] .predict-badge {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

[data-theme="dark"] .fast-badge {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
}

.review-cell-wrap {
  white-space: nowrap;
}

.review-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.review-cell b {
  font-weight: 700;
}

.review-cell span {
  font-size: 12px;
  color: var(--muted);
}

.review-cell.fast b {
  color: #dc2626;
}

[data-theme="dark"] .review-cell.fast b {
  color: #f87171;
}

.risk-cell-wrap {
  white-space: nowrap;
}

.risk-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.risk-cell b {
  font-weight: 700;
}

.risk-cell span {
  font-size: 12px;
  color: var(--muted);
}

.warn-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

[data-theme="dark"] .warn-badge {
  background: rgba(220, 38, 38, 0.18);
  color: #fca5a5;
}

.risk-cell .warn-badge {
  margin-left: 4px;
  vertical-align: 1px;
}

.warn-block {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #dc2626;
  border-radius: 0 6px 6px 0;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 13px;
}

[data-theme="dark"] .warn-block {
  background: rgba(220, 38, 38, 0.16);
  color: #fca5a5;
}

.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #b6c2d0;
}

.fav-btn:hover {
  background: var(--hover);
  color: var(--star);
}

.fav-btn.active {
  color: var(--star);
}

.detail-btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
}

.detail-btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.pub-cell {
  color: var(--muted);
  white-space: nowrap;
}

.pv-cell {
  white-space: nowrap;
}

.pv-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--pv, #b45309);
}

.pv-metric b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pv-metric span {
  font-size: 12px;
  color: var(--muted);
}

.pv-na {
  color: var(--border);
}

.cas-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
}

[data-theme="dark"] .cas-badge {
  background: rgba(14, 165, 233, 0.16);
  color: #7dd3fc;
}

/* Empty state & pagination */
.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state svg {
  margin: 0 auto 12px;
  color: #b6c2d0;
}

.empty-state p {
  margin: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
}

.pagination:empty {
  display: none;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent-text);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  cursor: default;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.footer {
  padding: 0 24px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 17, 28, 0.55);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal h2 {
  margin: 0 40px 4px 0;
  font-size: 21px;
  line-height: 1.3;
}

.modal-zh {
  margin: 0 0 12px;
  color: var(--muted);
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 24px;
}

.detail-item {
  padding: 10px 0;
  border-top: 1px solid var(--border-light);
  min-width: 0;
}

.detail-item span {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  color: var(--muted);
}

.detail-item b {
  font-weight: 600;
  word-break: break-word;
}

.detail-item b .trend {
  margin-left: 0;
  font-size: 14px;
}

.note-block {
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pv-detail {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
}

.pv-detail-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
}

[data-theme="dark"] .pv-detail {
  background: rgba(217, 119, 6, 0.12);
}

[data-theme="dark"] .pv-detail-title {
  color: #fbbf24;
}

.pv-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pv-detail-stats div {
  padding: 10px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border-light);
}

.pv-detail-stats b {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  color: #b45309;
}

[data-theme="dark"] .pv-detail-stats b {
  color: #fbbf24;
}

.pv-detail-stats span {
  font-size: 12px;
  color: var(--muted);
}

.pv-detail p {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Charts */
.chart-block {
  margin-top: 16px;
}

.chart-block-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.line-chart {
  width: 100%;
  height: auto;
}

.chart-grid {
  stroke: var(--border-light);
  stroke-dasharray: 3 3;
}

.chart-y {
  fill: var(--muted);
  font-size: 10px;
  text-anchor: end;
}

.chart-x {
  fill: var(--muted);
  font-size: 11px;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--accent);
}

.chart-dot.last {
  fill: #dc2626;
}

.chart-val {
  fill: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.chart-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Compare */
.compare-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 75;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 28px);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.compare-bar[hidden] {
  display: none;
}

.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 560px;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
}

.compare-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}

.compare-chip button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.compare-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-hint {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.compare-hint.flash {
  color: #dc2626;
  font-weight: 600;
}

.modal-panel-wide {
  max-width: 980px;
}

.compare-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 20px;
  align-items: start;
}

.radar-wrap {
  display: flex;
  justify-content: center;
}

.radar-chart {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.radar-grid {
  fill: none;
  stroke: var(--border);
  stroke-dasharray: 3 3;
}

.radar-axis {
  stroke: var(--border);
}

.radar-label {
  fill: var(--muted);
  font-size: 12px;
}

.radar-poly {
  fill-opacity: 0.16;
  stroke-width: 2;
}

.compare-table-wrap {
  overflow: auto;
}

.compare-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  white-space: nowrap;
}

.compare-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.compare-table tbody tr:hover {
  background: var(--hover);
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.legend-item i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Perovskite drawer */
.pv-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #b45309;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(180, 83, 9, 0.35);
}

.pv-fab:hover {
  background: #92400e;
}

[data-theme="dark"] .pv-fab {
  background: #f59e0b;
  color: #1c1917;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 17, 28, 0.5);
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.18);
}

.drawer[hidden] {
  display: none;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

.drawer-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 12px;
}

.pv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
}

.pv-item:hover {
  border-color: rgba(217, 119, 6, 0.6);
  background: var(--hover);
}

.pv-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .pv-rank {
  color: #fbbf24;
}

.pv-item-main {
  flex: 1;
  min-width: 0;
}

.pv-item-main b {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}

.pv-item-main span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.pv-item-stat {
  flex: 0 0 auto;
  text-align: right;
}

.pv-item-stat b {
  display: block;
  font-size: 15px;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .pv-item-stat b {
  color: #fbbf24;
}

.pv-item-stat span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.drawer-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
}

.drawer-foot .btn {
  width: 100%;
  justify-content: center;
}

mark {
  background: #fde68a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

[data-theme="dark"] mark {
  background: #92400e;
  color: #fef3c7;
}

body.modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 1150px) {
  .controls {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }

  .search-wrap {
    grid-column: 1 / -1;
  }

  .range-field {
    grid-column: span 2;
  }

  .actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }

  .brand {
    flex: 1 1 auto;
  }

  .stats {
    order: 3;
    width: 100%;
    gap: 14px;
    justify-content: space-between;
  }

  .stat {
    min-width: 0;
  }

  .stat span {
    display: block;
  }

  .controls {
    grid-template-columns: 1fr;
    padding: 14px 14px 4px;
  }

  .search-wrap,
  .range-field,
  .actions {
    grid-column: 1;
  }

  .actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .result-panel {
    margin: 10px 14px 16px;
  }

  .pv-fab {
    right: 14px;
    bottom: 14px;
    height: 42px;
    padding: 0 14px;
    font-size: 13px;
  }

  .compare-bar {
    left: 14px;
    right: 14px;
    transform: none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .compare-chips {
    max-width: none;
  }

  .compare-actions {
    justify-content: flex-end;
  }

  .compare-layout {
    grid-template-columns: 1fr;
  }

  .result-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    padding: 0 14px 22px;
  }

  .modal-panel {
    padding: 18px;
  }

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