:root {
  --bg: #f5f7f4;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --ink: #16201b;
  --muted: #66736d;
  --line: #dfe6de;
  --line-strong: #c9d4cc;
  --green: #0f766e;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #be185d;
  --violet: #6d28d9;
  --soft-green: #e7f3ef;
  --soft-blue: #e8f0ff;
  --soft-amber: #fff5df;
  --soft-red: #fce7f1;
  --shadow: 0 12px 32px rgba(22, 32, 27, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  letter-spacing: 0;
}

body.has-fixed-x-scrollbar .table-wrap {
  max-height: calc(100vh - 176px);
}

body.has-fixed-x-scrollbar .workspace {
  padding-top: 50px;
}

body.has-fixed-x-scrollbar .pagination-bar:not([hidden]) {
  position: fixed;
  left: var(--pagination-left, auto);
  top: var(--pagination-top, 74px);
  z-index: 35;
  width: var(--pagination-width, 360px);
  min-height: 30px;
  padding: 0;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: none;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 760;
}

.meta {
  color: var(--muted);
  text-align: right;
  font-size: 13px;
}

.stats {
  display: none;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 1px;
  padding: 0 24px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.codex-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid #f3c2c2;
  background: #fff1f1;
  color: #991b1b;
}

.codex-alert[hidden] {
  display: none;
}

.codex-alert strong {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}

.codex-alert span {
  min-width: 0;
  color: #7f1d1d;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.stat {
  min-height: 70px;
  padding: 12px 16px;
  background: var(--panel);
}

.stat-label,
label span,
.subtle,
.scan-table td span,
.drawer-head p,
.source-note {
  color: var(--muted);
  font-size: 11px;
}

.stat-value {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 760;
}

.stat-note {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: end;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 244, 0.98);
  backdrop-filter: blur(10px);
}

.view-switch {
  display: flex;
  gap: 6px;
  padding: 0;
  background: transparent;
}

.view-switch button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #435049;
  font-weight: 720;
  cursor: pointer;
}

.view-switch button.active {
  border-color: var(--green);
  background: var(--soft-green);
  color: var(--green);
}

.view-switch span {
  color: inherit;
  font-size: 12px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 120px 120px 150px 180px 90px 156px;
  gap: 8px;
  align-items: end;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
}

.svip-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid #d7b76c;
  border-radius: 6px;
  background: linear-gradient(135deg, #fffaf0, #fff3d6);
  color: #765113;
  white-space: nowrap;
}

.svip-entry[hidden] {
  display: none;
}

.svip-entry:hover {
  border-color: #b58527;
  color: #5f3e08;
  text-decoration: none;
}

.svip-entry.active {
  border-color: #9bcbbf;
  background: var(--soft-green);
  color: var(--green);
}

.svip-entry-mark {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  place-items: center;
  border-radius: 50%;
  background: #8a6117;
  color: #fff8e6;
  font-size: 11px;
  font-weight: 850;
}

.svip-entry.active .svip-entry-mark {
  background: var(--green);
  color: #fff;
}

.svip-entry-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.svip-entry-copy strong,
.svip-entry-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.svip-entry-copy strong {
  font-size: 11px;
  line-height: 1.1;
}

.svip-entry-copy small {
  opacity: 0.76;
  font-size: 9px;
  line-height: 1.1;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

label.disabled {
  opacity: 0.45;
}

label.disabled input {
  cursor: not-allowed;
}

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

input,
select {
  padding: 0 10px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 32px;
  padding: 6px 24px 0;
  color: var(--muted);
  font-size: 12px;
}

.pagination-bar[hidden],
#page-size-label[hidden] {
  display: none;
}

.pagination-bar button {
  width: 30px;
  flex: 0 0 30px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--green);
  cursor: pointer;
  font-size: 18px;
  font-weight: 760;
  line-height: 1;
}

#page-jump {
  width: 72px;
  min-height: 28px;
  height: 28px;
  flex: 0 0 72px;
  padding: 0 22px 0 8px;
  border-color: var(--line);
  background-color: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
}

.pagination-bar button:disabled {
  color: var(--line-strong);
  cursor: not-allowed;
}

#page-status {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x-scrollbar {
  position: fixed;
  left: var(--x-scroll-left, 24px);
  top: var(--x-scroll-top, 74px);
  z-index: 34;
  width: var(--x-scroll-width, calc(100vw - 48px));
  height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(201, 212, 204, 0.86);
  border-radius: 999px;
  background: rgba(249, 250, 247, 0.96);
  box-shadow: 0 8px 20px rgba(22, 32, 27, 0.14);
  backdrop-filter: blur(8px);
  display: grid;
  align-items: center;
}

.x-scrollbar[hidden] {
  display: none;
}

#x-scroll-range {
  width: 100%;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--green) 0 var(--x, 0%), #dfe7df var(--x, 0%) 100%);
  cursor: ew-resize;
  appearance: none;
}

#x-scroll-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

#x-scroll-range::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -6px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 2px 8px rgba(22, 32, 27, 0.22);
  appearance: none;
}

#x-scroll-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #dfe7df;
}

#x-scroll-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--green);
}

#x-scroll-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 2px 8px rgba(22, 32, 27, 0.22);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 10px 24px 18px;
}

.workspace.drawer-open {
  grid-template-columns: minmax(720px, 1fr) 430px;
}

.table-wrap {
  --sticky-col-1-width: 86px;
  --sticky-col-2-width: 70px;
  --sticky-col-3-width: 168px;
  min-width: 0;
  max-height: calc(100vh - 132px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-wrap[aria-busy="true"] tbody {
  opacity: 0.58;
}

.scan-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table-wrap[data-view="listed"] .scan-table {
  min-width: 2970px;
}

.table-wrap[data-view="active"] .scan-table {
  min-width: 2280px;
}

.table-wrap[data-view="failed"] .scan-table {
  min-width: 1390px;
}

.table-wrap[data-view="active"] {
  --sticky-col-1-width: 100px;
  --sticky-col-2-width: 72px;
  --sticky-col-3-width: 204px;
}

.table-wrap[data-view="failed"] {
  --sticky-col-1-width: 94px;
  --sticky-col-2-width: 72px;
  --sticky-col-3-width: 210px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 33px;
  padding: 0 9px;
  background: #edf3ec;
  color: #46534c;
  font-size: 12px;
  font-weight: 760;
}

th.sortable-head {
  padding: 0;
}

.sortable-head button {
  display: flex;
  width: 100%;
  height: 33px;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: inherit;
  text-align: left;
}

.sortable-head button:hover {
  background: rgba(15, 118, 110, 0.07);
}

.sort-arrows {
  display: inline-grid;
  gap: 0;
  color: #8b9992;
  font-size: 8px;
  line-height: 0.9;
}

.sort-up,
.sort-down {
  display: block;
  opacity: 0.35;
}

.sortable-head.sorted .sort-arrows {
  color: var(--green);
}

.sortable-head.sorted.asc .sort-up,
.sortable-head.sorted.desc .sort-down {
  opacity: 1;
}

th.svip-locked-head {
  color: #70511a;
}

.svip-locked-label {
  display: inline-flex;
  margin-left: 5px;
  padding: 1px 4px;
  border: 1px solid #d7b76c;
  border-radius: 999px;
  background: #fff7e7;
  color: #8a6117;
  font-size: 8px;
  font-weight: 850;
  vertical-align: middle;
}

td.svip-locked-cell {
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.82), rgba(255, 255, 255, 0.82));
  text-align: center;
}

.svip-locked-cell a {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #d7b76c;
  border-radius: 999px;
  background: #fff7e7;
  color: #7a5412;
  font-size: 9px;
  font-weight: 850;
}

.svip-locked-cell span {
  display: block;
  margin-top: 3px;
  color: #8a7a5e;
  font-size: 9px;
}

td {
  height: 51px;
  padding: 7px 9px;
  line-height: 1.24;
}

.scan-table td strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.scan-table tr {
  cursor: pointer;
  --row-rgb: 15, 118, 110;
}

.scan-table tbody tr {
  background: linear-gradient(90deg, rgba(var(--row-rgb), 0) 0%, rgba(var(--row-rgb), 0.03) 12%, rgba(var(--row-rgb), 0.012) 36%, rgba(var(--row-rgb), 0) 72%);
}

.scan-table tbody tr:nth-child(4n + 2) {
  --row-rgb: 37, 99, 235;
}

.scan-table tbody tr:nth-child(4n + 3) {
  --row-rgb: 183, 121, 31;
}

.scan-table tbody tr:nth-child(4n + 4) {
  --row-rgb: 109, 40, 217;
}

.scan-table tbody td:first-child {
  position: relative;
  overflow: hidden;
}

.scan-table tbody td:first-child::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 52px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(var(--row-rgb), 0) 0%, rgba(var(--row-rgb), 0.1) 100%);
}

.scan-table thead th.sticky-col,
.scan-table tbody td.sticky-col {
  position: sticky;
  background: var(--panel);
  background-clip: padding-box;
}

.scan-table thead th.sticky-col {
  z-index: 6;
  background: #edf3ec;
}

.scan-table tbody td.sticky-col {
  z-index: 3;
  background:
    linear-gradient(90deg, rgba(var(--row-rgb), 0) 0%, rgba(var(--row-rgb), 0.03) 100%),
    var(--panel);
}

.scan-table .sticky-col-1 {
  left: 0;
  width: var(--sticky-col-1-width);
  min-width: var(--sticky-col-1-width);
  max-width: var(--sticky-col-1-width);
}

.scan-table .sticky-col-2 {
  left: var(--sticky-col-1-width);
  width: var(--sticky-col-2-width);
  min-width: var(--sticky-col-2-width);
  max-width: var(--sticky-col-2-width);
}

.scan-table .sticky-col-3 {
  left: calc(var(--sticky-col-1-width) + var(--sticky-col-2-width));
  width: var(--sticky-col-3-width);
  min-width: var(--sticky-col-3-width);
  max-width: var(--sticky-col-3-width);
  box-shadow: 10px 0 16px -16px rgba(22, 32, 27, 0.65);
}

.scan-table tbody tr:hover,
.scan-table tbody tr.selected {
  background:
    linear-gradient(90deg, rgba(var(--row-rgb), 0) 0%, rgba(var(--row-rgb), 0.08) 18%, rgba(var(--row-rgb), 0.025) 42%, rgba(var(--row-rgb), 0) 100%),
    #f7fbf8;
}

.scan-table tbody tr:hover td.sticky-col,
.scan-table tbody tr.selected td.sticky-col {
  background:
    linear-gradient(90deg, rgba(var(--row-rgb), 0) 0%, rgba(var(--row-rgb), 0.08) 100%),
    #f7fbf8;
}

.scan-table tbody tr.selected {
  box-shadow: inset 3px 0 0 var(--green);
}

.table-wrap[data-view="listed"] th:nth-child(1) {
  width: 86px;
}

.table-wrap[data-view="listed"] th:nth-child(2) {
  width: 70px;
}

.table-wrap[data-view="listed"] th:nth-child(3) {
  width: 182px;
}

.table-wrap[data-view="listed"] th:nth-child(4) {
  width: 120px;
}

.table-wrap[data-view="listed"] th:nth-child(5) {
  width: 170px;
}

.table-wrap[data-view="listed"] th:nth-child(6) {
  width: 104px;
}

.table-wrap[data-view="listed"] th:nth-child(7) {
  width: 104px;
}

.table-wrap[data-view="listed"] th:nth-child(8),
.table-wrap[data-view="listed"] th:nth-child(9) {
  width: 100px;
}

.table-wrap[data-view="listed"] th:nth-child(10),
.table-wrap[data-view="listed"] th:nth-child(11),
.table-wrap[data-view="listed"] th:nth-child(12),
.table-wrap[data-view="listed"] th:nth-child(13),
.table-wrap[data-view="listed"] th:nth-child(23) {
  width: 84px;
}

.table-wrap[data-view="listed"] th:nth-child(14),
.table-wrap[data-view="listed"] th:nth-child(22) {
  width: 112px;
}

.table-wrap[data-view="listed"] th:nth-child(15),
.table-wrap[data-view="listed"] th:nth-child(16) {
  width: 98px;
}

.table-wrap[data-view="listed"] th:nth-child(17),
.table-wrap[data-view="listed"] th:nth-child(18),
.table-wrap[data-view="listed"] th:nth-child(19),
.table-wrap[data-view="listed"] th:nth-child(20) {
  width: 128px;
}

.table-wrap[data-view="listed"] th:nth-child(21) {
  width: 140px;
}

.table-wrap[data-view="listed"] th:nth-child(24) {
  width: 150px;
}

.table-wrap[data-view="listed"] th:nth-child(25) {
  width: 172px;
}

.table-wrap[data-view="listed"] th:nth-child(26) {
  width: 64px;
}

.table-wrap[data-view="active"] th:nth-child(1) {
  width: 100px;
}

.table-wrap[data-view="active"] th:nth-child(2) {
  width: 72px;
}

.table-wrap[data-view="active"] th:nth-child(3) {
  width: 204px;
}

.table-wrap[data-view="active"] th:nth-child(4) {
  width: 96px;
}

.table-wrap[data-view="active"] th:nth-child(5) {
  width: 104px;
}

.table-wrap[data-view="active"] th:nth-child(6) {
  width: 170px;
}

.table-wrap[data-view="active"] th:nth-child(7) {
  width: 104px;
}

.table-wrap[data-view="active"] th:nth-child(8) {
  width: 96px;
}

.table-wrap[data-view="active"] th:nth-child(9) {
  width: 118px;
}

.table-wrap[data-view="active"] th:nth-child(10),
.table-wrap[data-view="active"] th:nth-child(11),
.table-wrap[data-view="active"] th:nth-child(12) {
  width: 96px;
}

.table-wrap[data-view="active"] th:nth-child(13) {
  width: 86px;
}

.table-wrap[data-view="active"] th:nth-child(14),
.table-wrap[data-view="active"] th:nth-child(15) {
  width: 96px;
}

.table-wrap[data-view="active"] th:nth-child(16) {
  width: 156px;
}

.table-wrap[data-view="active"] th:nth-child(17) {
  width: 178px;
}

.table-wrap[data-view="active"] th:nth-child(18) {
  width: 64px;
}

.table-wrap[data-view="failed"] th:nth-child(1) {
  width: 94px;
}

.table-wrap[data-view="failed"] th:nth-child(2) {
  width: 72px;
}

.table-wrap[data-view="failed"] th:nth-child(3) {
  width: 210px;
}

.table-wrap[data-view="failed"] th:nth-child(4) {
  width: 118px;
}

.table-wrap[data-view="failed"] th:nth-child(5),
.table-wrap[data-view="failed"] th:nth-child(6) {
  width: 96px;
}

.table-wrap[data-view="failed"] th:nth-child(7),
.table-wrap[data-view="failed"] th:nth-child(8),
.table-wrap[data-view="failed"] th:nth-child(9) {
  width: 116px;
}

.table-wrap[data-view="failed"] th:nth-child(10) {
  width: 210px;
}

.table-wrap[data-view="failed"] th:nth-child(11) {
  width: 64px;
}

.ticker {
  color: var(--green);
  font-weight: 800;
  letter-spacing: 0;
}

.name-cell strong {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.name-cell span {
  display: block;
  margin-top: 2px;
}

.name-cell .name-attempt {
  color: var(--amber);
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
}

.role-cell {
  color: #26332d;
  font-size: 12px;
  font-weight: 680;
}

.scan-metric strong {
  font-size: 13px;
}

.market-cap-cell .float-tip-trigger {
  display: grid;
  gap: 3px;
  align-content: center;
  font-variant-numeric: tabular-nums;
}

.market-cap-cell strong {
  color: var(--green);
  white-space: nowrap;
}

.market-cap-cell span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-cell strong {
  font-size: 13px;
  font-weight: 860;
}

.score-cell span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.stock-connect-cell .float-tip-trigger {
  display: grid;
  gap: 2px;
  align-content: center;
}

.stock-connect-cell .stock-progress-track {
  margin-top: 2px;
}

.stock-connect-cell .stock-connect-metric {
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-progress-track {
  width: 100%;
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #e2e9e3;
}

.stock-progress-track i {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.score-cell.good .stock-progress-track i {
  background: var(--blue);
}

.score-cell.neutral .stock-progress-track i {
  background: var(--amber);
}

.score-cell.weak .stock-progress-track i {
  background: var(--red);
}

.score-cell.strong strong {
  color: var(--green);
}

.score-cell.good strong {
  color: var(--blue);
}

.score-cell.neutral strong {
  color: #48564e;
}

.score-cell.weak strong {
  color: var(--red);
}

.score-cell.pending strong {
  color: var(--muted);
}

.float-tip-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: help;
}

.cornerstone-cell .float-tip-trigger:focus-visible,
.market-cap-cell .float-tip-trigger:focus-visible,
.stock-connect-cell .float-tip-trigger:focus-visible {
  outline: 2px solid rgba(0, 127, 116, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.float-tip {
  position: fixed;
  z-index: 1000;
  padding: 10px 12px;
  border: 1px solid #cfe3dc;
  border-radius: 6px;
  background: #ffffff;
  color: #1f2a24;
  box-shadow: 0 12px 34px rgba(31, 42, 36, 0.2);
  font-size: 12px;
  line-height: 1.45;
  max-width: min(540px, calc(100vw - 24px));
  white-space: pre-line;
  pointer-events: none;
}

.stock-progress-overview {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr);
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 12px;
}

.stock-progress-overview > div:first-child {
  display: grid;
  gap: 2px;
}

.stock-progress-overview span {
  color: var(--muted);
  font-size: 11px;
}

.stock-progress-overview strong {
  color: var(--green);
  font-size: 20px;
}

.stock-progress-overview > span {
  grid-column: 1 / -1;
}

.stock-progress-track.large {
  height: 8px;
  margin: 0;
}

.stock-progress-components {
  display: grid;
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}

.stock-progress-components > div {
  display: grid;
  grid-template-columns: 100px 100px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.stock-progress-components span,
.stock-progress-components small {
  color: var(--muted);
  font-size: 11px;
}

.stock-progress-components strong {
  color: var(--ink);
  font-size: 12px;
}

.kv-item.strong strong {
  color: var(--green);
}

.kv-item.good strong {
  color: var(--blue);
}

.kv-item.weak strong {
  color: var(--red);
}

.kv-item.warn strong {
  color: var(--amber);
}

.scan-rate strong {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 24px;
  align-items: center;
  justify-content: flex-start;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.alloc-rate span,
.open-cell span,
.perf-cell span,
.lot-cell span,
.pattern-cell span,
.structure-cell span {
  display: block;
  margin-top: 3px;
  line-height: 1.2;
}

.open-cell strong,
.perf-cell strong,
.lot-cell strong,
.pattern-cell strong,
.structure-cell strong {
  font-size: 13px;
}

.open-cell.up strong,
.perf-cell.up strong,
.focus-metric.up strong,
.kv-item.up strong {
  color: var(--green);
}

.open-cell.down strong,
.perf-cell.down strong,
.focus-metric.down strong,
.kv-item.down strong {
  color: var(--red);
}

.open-cell.flat strong,
.perf-cell.flat strong,
.focus-metric.flat strong,
.kv-item.flat strong {
  color: #48564e;
}

.open-cell.pending strong,
.perf-cell.pending strong,
.focus-metric.pending strong,
.kv-item.pending strong {
  color: var(--muted);
}

.pattern-cell strong {
  color: var(--green);
}

.structure-cell strong {
  display: inline-flex;
  min-width: 34px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #48564e;
}

.structure-cell.sold strong {
  border-color: #cfe3dc;
  background: var(--soft-green);
  color: var(--green);
}

.structure-cell.yes strong {
  color: var(--blue);
}

.structure-cell.warn strong {
  border-color: #ead9ad;
  background: var(--soft-amber);
  color: var(--amber);
}

.structure-cell.failed strong {
  border-color: #efc2c2;
  background: #fff5f5;
  color: var(--red);
}

.structure-cell .failed-note {
  color: var(--red);
  font-weight: 760;
}

.structure-cell.no strong,
.structure-cell.pending strong {
  color: var(--muted);
}

.scan-rate.easy strong,
.kv-item.easy strong {
  color: var(--green);
}

.scan-rate.medium strong,
.kv-item.medium strong {
  color: var(--blue);
}

.scan-rate.hard strong,
.kv-item.hard strong {
  color: var(--red);
}

.scan-rate.pending strong,
.kv-item.pending strong {
  color: var(--muted);
  font-size: 12px;
}

.heatbar {
  width: 100%;
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0ea;
}

.heatbar span {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.heatbar.hot span {
  background: var(--red);
}

.heatbar.warm span {
  background: var(--amber);
}

.heatbar.cool span {
  background: var(--blue);
}

.heatbar.strong span,
.heatbar.good span,
.heatbar.easy span {
  background: var(--green);
}

.heatbar.medium span,
.heatbar.neutral span {
  background: var(--blue);
}

.heatbar.weak span,
.heatbar.hard span {
  background: var(--red);
}

.badge,
.row-action,
.doc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #435049;
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.badge.good,
.badge.active {
  border-color: #cfe3dc;
  background: var(--soft-green);
  color: var(--green);
}

.badge.warn {
  border-color: #ead9ad;
  background: var(--soft-amber);
  color: var(--amber);
}

.attempt-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.attempt-summary {
  display: grid;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.attempt-summary .badge {
  justify-self: start;
}

.attempt-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.attempt-row {
  display: grid;
  grid-template-columns: 22px minmax(84px, auto) auto 1fr;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.attempt-row > span,
.attempt-row small {
  color: var(--muted);
}

.attempt-row strong {
  font-size: 12px;
}

.peer-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.peer-row {
  display: grid;
  grid-template-columns: 76px minmax(118px, 1fr) 58px;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.peer-row > span,
.peer-row small {
  color: var(--muted);
}

.peer-row small {
  grid-column: 2 / 4;
}

.peer-row em {
  font-style: normal;
  font-weight: 820;
  text-align: right;
}

.peer-row.up em {
  color: var(--green);
}

.peer-row.down em {
  color: var(--red);
}

.row-action {
  width: 48px;
  color: var(--green);
  cursor: pointer;
}

.row-action:hover,
.doc-button:hover {
  border-color: var(--green);
  text-decoration: none;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doc-button.dense {
  min-width: 28px;
  min-height: 24px;
  padding: 0 6px;
}

.svip-doc-button {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

.svip-doc-button small {
  background: #fff4d6;
  border: 1px solid #dba73a;
  border-radius: 999px;
  color: #8a5a00;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.18rem 0.32rem;
}

.svip-doc-button.dense {
  gap: 0.2rem;
}

.quality {
  color: #48564e;
}

.quality.strong {
  color: var(--green);
}

.quality.good {
  color: var(--blue);
}

.quality.weak {
  color: var(--red);
}

.quality.neutral {
  color: #48564e;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.detail-drawer {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 92px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}

.drawer-code {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.drawer-head h2 {
  margin: 2px 0 4px;
  font-size: 20px;
  line-height: 1.2;
}

.drawer-head p {
  margin: 0;
}

.drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.drawer-body {
  padding: 0 14px 14px;
}

.drawer-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section h3 {
  margin: 0 0 10px;
  color: #334039;
  font-size: 13px;
  font-weight: 800;
}

.svip-drawer-lock {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dfc98f;
  border-radius: 7px;
  background: linear-gradient(135deg, #fffaf0, #fff7e7);
}

.svip-drawer-lock strong {
  color: #765113;
  font-size: 14px;
}

.svip-drawer-lock p {
  margin: 0;
  color: #786b54;
  line-height: 1.55;
}

.svip-drawer-lock a {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 0 11px;
  border-radius: 5px;
  background: #80601f;
  color: #fff;
  font-weight: 760;
}

.svip-drawer-lock a:hover {
  background: #67480e;
  text-decoration: none;
}

.focus-grid,
.kv-grid {
  display: grid;
  gap: 8px;
}

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

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

.focus-metric,
.kv-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.focus-metric span,
.kv-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.focus-metric strong,
.kv-item strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
}

.analysis-copy {
  margin: 10px 0 0;
  color: #34423b;
  line-height: 1.5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-group {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.role-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.tag-list span {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #435049;
  font-size: 12px;
}

.source-note {
  margin-top: 8px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .stats {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace.drawer-open {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: min(430px, 100vw);
    max-height: none;
    border-radius: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: block;
    padding: 16px 12px 10px;
  }

  .meta {
    margin-top: 8px;
    text-align: left;
  }

  .command-bar {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 12px;
  }

  .view-switch {
    width: 100%;
    padding: 0;
  }

  .view-switch button {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    padding: 0 7px;
  }

  .stats,
  .view-switch,
  .controls,
  .pagination-bar,
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pagination-bar button {
    width: 28px;
    flex-basis: 28px;
  }

  #page-jump {
    width: 68px;
    flex-basis: 68px;
    padding-left: 6px;
  }

  #page-status {
    display: none;
  }

  .stats,
  .controls,
  .focus-grid,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }

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

  .table-wrap {
    max-height: none;
  }
}
